:root {
    --bg: #0b1020;
    --card: #121a33;
    --muted: #98a2b3;
    --text: #e6e9f2;
    --line: #243057;
    --accent: #7c5cff;
    --good: #35d07f;
    --bad: #ff4d6d;
    --warn: #ffcc00;
    --shadow: 0 10px 30px rgba(0, 0, 0, .25);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans KR", Arial, sans-serif;
    background: radial-gradient(1200px 600px at 20% 0%, rgba(124, 92, 255, .25), transparent 55%),
        radial-gradient(900px 500px at 90% 20%, rgba(53, 208, 127, .18), transparent 60%),
        var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

.wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 18px 14px 40px;
}

header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
    background: rgba(11, 16, 32, .65);
    border-bottom: 1px solid rgba(36, 48, 87, .55);
}

.topbar {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px;
}

.brand {
    display: flex;
    gap: 10px;
    align-items: center;
    font-weight: 800;
    letter-spacing: .2px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 6px rgba(124, 92, 255, .15);
}

nav {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.tabbtn {
    border: 1px solid rgba(36, 48, 87, .85);
    background: rgba(18, 26, 51, .5);
    color: var(--text);
    padding: 9px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: .15s ease;
    font-weight: 650;
    font-size: 13px;
}

.tabbtn:hover {
    transform: translateY(-1px);
    border-color: rgba(124, 92, 255, .65);
}

.tabbtn.active {
    background: rgba(124, 92, 255, .18);
    border-color: rgba(124, 92, 255, .85);
}

.grid {
    display: grid;
    grid-template-columns: 1.3fr .7fr;
    gap: 14px;
    margin-top: 16px;
}

@media (max-width: 860px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: linear-gradient(180deg, rgba(18, 26, 51, .72), rgba(18, 26, 51, .52));
    border: 1px solid rgba(36, 48, 87, .85);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

.card h2 {
    margin: 0 0 10px;
    font-size: 16px;
    letter-spacing: .2px;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.sp {
    height: 10px;
}

.pill {
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(36, 48, 87, .85);
    background: rgba(11, 16, 32, .25);
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    transition: .15s ease;
    user-select: none;
}

.pill.active {
    border-color: rgba(124, 92, 255, .85);
    background: rgba(124, 92, 255, .18);
}

.timer {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 210px;
    border-radius: 22px;
    border: 1px solid rgba(36, 48, 87, .85);
    background: rgba(11, 16, 32, .22);
    margin: 12px 0 12px;
    position: relative;
    overflow: hidden;
}

.timer::before {
    content: "";
    position: absolute;
    inset: -40px -60px auto -60px;
    height: 120px;
    background: radial-gradient(circle at 40% 50%, rgba(124, 92, 255, .35), transparent 60%);
    transform: rotate(12deg);
}

.time {
    font-size: 62px;
    font-weight: 900;
    letter-spacing: 1px;
    position: relative;
}

.subtime {
    position: absolute;
    bottom: 14px;
    left: 14px;
    font-size: 12px;
    color: rgba(152, 162, 179, .95);
}

.btn {
    border: none;
    border-radius: 14px;
    padding: 12px 14px;
    cursor: pointer;
    font-weight: 800;
    background: rgba(124, 92, 255, .22);
    color: var(--text);
    border: 1px solid rgba(124, 92, 255, .55);
    transition: .15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn.secondary {
    background: rgba(11, 16, 32, .25);
    border: 1px solid rgba(36, 48, 87, .85);
    font-weight: 750;
}

.btn.danger {
    background: rgba(255, 77, 109, .15);
    border-color: rgba(255, 77, 109, .5);
}

.btn.good {
    background: rgba(53, 208, 127, .16);
    border-color: rgba(53, 208, 127, .5);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

label {
    font-size: 12px;
    color: rgba(152, 162, 179, .95);
}

input,
select {
    background: rgba(11, 16, 32, .25);
    border: 1px solid rgba(36, 48, 87, .85);
    color: var(--text);
    padding: 11px 12px;
    border-radius: 12px;
    outline: none;
    font-size: 14px;
}

input::placeholder {
    color: rgba(152, 162, 179, .65);
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media(max-width:560px) {
    .split {
        grid-template-columns: 1fr;
    }
}

.toast {
    position: fixed;
    right: 14px;
    bottom: 14px;
    background: rgba(18, 26, 51, .82);
    border: 1px solid rgba(36, 48, 87, .95);
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: var(--shadow);
    display: none;
    max-width: 360px;
    z-index: 99;
    font-size: 13px;
    color: var(--text);
}

.toast.show {
    display: block;
}

.toast b {
    color: var(--good);
}

/* Sessions list */
.list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item {
    border: 1px solid rgba(36, 48, 87, .85);
    background: rgba(11, 16, 32, .20);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.title {
    font-weight: 850;
    font-size: 14px;
}

.tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tag {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(36, 48, 87, .85);
    background: rgba(124, 92, 255, .12);
    color: rgba(230, 233, 242, .95);
}

.smallbtn {
    padding: 8px 10px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 12px;
    border: 1px solid rgba(36, 48, 87, .85);
    background: rgba(11, 16, 32, .25);
    color: var(--text);
    cursor: pointer;
    transition: .15s ease;
    white-space: nowrap;
}

.smallbtn:hover {
    transform: translateY(-1px);
}

.smallbtn.danger {
    border-color: rgba(255, 77, 109, .5);
    background: rgba(255, 77, 109, .12);
}

.smallbtn.good {
    border-color: rgba(53, 208, 127, .5);
    background: rgba(53, 208, 127, .12);
}

/* Stats */
.cards3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

@media(max-width:860px) {
    .cards3 {
        grid-template-columns: 1fr;
    }
}

.stat {
    border: 1px solid rgba(36, 48, 87, .85);
    background: rgba(11, 16, 32, .20);
    border-radius: 16px;
    padding: 12px;
}

.stat .k {
    color: var(--muted);
    font-size: 12px;
}

.stat .v {
    font-weight: 900;
    font-size: 22px;
    margin-top: 6px;
}

canvas {
    width: 100%;
    height: 240px;
    border-radius: 16px;
    border: 1px solid rgba(36, 48, 87, .85);
    background: rgba(11, 16, 32, .20);
    margin-top: 12px;
}

.hidden {
    display: none !important;
}

.hr {
    height: 1px;
    background: rgba(36, 48, 87, .75);
    margin: 12px 0;
}
