/* LingoFlow — single stylesheet using CSS variables */
:root {
    --color-bg:        #f4f4fb;
    --color-surface:   #ffffff;
    --color-text:      #1a1c2e;
    --color-muted:     #6b6f94;
    --color-primary:   #393D7E;
    --color-primary-d: #2e3168;
    --color-primary-mid: #5459AC;
    --color-accent:    #6DC3BB;
    --color-accent-2:  #F2AEBB;
    --color-danger:    #dc2626;
    --color-border:    #e0e1f0;
    --color-success-bg:#ecfdf5;
    --color-success:   #047857;
    --color-error-bg:  #fef2f2;
    --color-error:     #b91c1c;

    --radius:   14px;
    --radius-sm:8px;
    --shadow:   0 4px 16px rgba(57, 61, 126, 0.08);
    --shadow-h: 0 10px 28px rgba(57, 61, 126, 0.14);

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --gap: 1.25rem;
    --container: 1100px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.55;
}

img { max-width: 100%; display: block; }
a { color: var(--color-primary-mid); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--color-primary); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; margin-top: 2rem; }
h3 { font-size: 1.15rem; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header { background: var(--color-primary); border-bottom: none; position: sticky; top: 0; z-index: 5; box-shadow: 0 2px 12px rgba(57, 61, 126, 0.25); }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; }
.brand { font-weight: 800; font-size: 1.25rem; color: #fff; }
.brand span { color: var(--color-accent); }
.site-header nav { display: flex; gap: 1.1rem; align-items: center; }
.site-header nav a { color: rgba(255,255,255,0.88); font-weight: 500; transition: color .15s; display: inline-flex; align-items: center; }
.site-header nav a:hover { color: #fff; text-decoration: none; }
.site-header nav .btn { padding: .45rem .9rem; }
.inline { display: inline; margin: 0; }
.link { background: none; border: 0; color: rgba(255,255,255,0.88); cursor: pointer; font: inherit; padding: 0; }
.link:hover { color: #fff; text-decoration: underline; }

/* Custom tooltips for header menu icons */
.site-header nav a[aria-label],
.site-header nav button[aria-label] {
    position: relative;
}

.site-header nav a[aria-label]::after,
.site-header nav button[aria-label]::after {
    content: attr(aria-label);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: #111827;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.3rem 0.55rem;
    border-radius: 5px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    z-index: 100;
    line-height: 1.2;
}

.site-header nav a[aria-label]::before,
.site-header nav button[aria-label]::before {
    content: '';
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    border-width: 0 4px 4px 4px;
    border-style: solid;
    border-color: transparent transparent #111827 transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 100;
}

.site-header nav a[aria-label]:hover::after,
.site-header nav button[aria-label]:hover::after,
.site-header nav a[aria-label]:hover::before,
.site-header nav button[aria-label]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

main.container { padding-top: 2rem; padding-bottom: 3rem; min-height: 70vh; }

/* Footer */
.site-footer { border-top: none; padding: 1.5rem 0; color: #fff; background: var(--color-primary); margin-top: 3rem; }

/* Buttons */
.btn {
    display: inline-block; padding: .6rem 1rem; border-radius: var(--radius-sm);
    border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text);
    cursor: pointer; font: inherit; transition: transform .05s, box-shadow .15s, background .15s;
}
.btn:hover { box-shadow: var(--shadow); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-d); border-color: var(--color-primary-d); color: #fff; }
.btn-accent { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.btn-accent:hover { background: #56b0a8; border-color: #56b0a8; color: #fff; }
.btn-ghost { background: transparent; border-color: var(--color-primary); color: var(--color-primary); }
.btn-ghost:hover { background: var(--color-primary); color: #fff; }
.btn-danger { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn-success { background: #059669; color: #fff; border-color: #059669; }
.btn-success:hover { background: #047857; border-color: #047857; color: #fff; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1.05rem; }

/* Flash */
.flashes { margin-top: 1rem; display: grid; gap: .5rem; }
.flash { padding: .75rem 1rem; border-radius: var(--radius-sm); border: 1px solid; }
.flash-success { background: var(--color-success-bg); color: var(--color-success); border-color: #a7f3d0; }
.flash-error   { background: var(--color-error-bg);   color: var(--color-error);   border-color: #fecaca; }

/* Hero */
.hero {
    display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: center;
    padding: 3rem 0 2rem;
}
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
.hero h1 span { color: var(--color-primary-mid); }
.hero .lead { font-size: 1.15rem; color: var(--color-muted); max-width: 50ch; }
.hero .cta { display: flex; gap: .75rem; margin-top: 1.25rem; flex-wrap: wrap; }
.hero-art { position: relative; height: 320px; }
.bubble {
    position: absolute; background: var(--color-surface); border: 1px solid var(--color-border);
    padding: .75rem 1rem; border-radius: 999px; box-shadow: var(--shadow);
    font-weight: 600;
}
.bubble.b1 { top: 10%; left: 10%; border-color: var(--color-accent-2); }
.bubble.b2 { top: 35%; left: 55%; background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.bubble.b3 { top: 65%; left: 15%; border-color: var(--color-accent-2); }
.bubble.b4 { top: 75%; left: 60%; background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } .hero-art { display: none; } }

/* How it works */
.how { margin-top: 2rem; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding: 0; list-style: none; }
.steps li { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1rem; transition: box-shadow .15s, border-color .15s; }
.steps li:hover { border-color: var(--color-accent); box-shadow: var(--shadow-h); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* Section head */
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 2rem; }

/* Cards & grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--gap); }
.card {
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: .35rem;
}
.card h3 { margin: .25rem 0; }
.card .price { font-weight: 700; color: var(--color-primary-mid); margin-top: auto; }
.card-foot { display: flex; justify-content: space-between; margin-top: .5rem; }
.badge { display: inline-block; align-self: flex-start; background: rgba(109,195,187,0.15); color: var(--color-primary-mid); padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.muted { color: var(--color-muted); }
.link-card:hover { box-shadow: var(--shadow-h); text-decoration: none; }

/* Tutor */
.tutor .avatar, .avatar {
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), var(--color-primary-mid));
    color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.25rem;
}
.avatar.lg { width: 96px; height: 96px; font-size: 2rem; }
.rating { color: #e08c20; font-weight: 600; }

.tutor-profile { display: flex; gap: 1.25rem; align-items: center; margin: 1rem 0 2rem; }

.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--gap); }
.slot { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .35rem; }
.slot-time { font-weight: 600; }

/* Forms */
form label { display: block; margin: .8rem 0; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=search],
input[type=datetime-local], input[type=number], textarea, select {
    width: 100%; padding: .7rem .85rem; border: 1px solid var(--color-border);
    border-radius: var(--radius-sm); font: inherit; background: var(--color-surface); color: var(--color-text);
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--color-primary-mid);
    outline: none;
    box-shadow: 0 0 0 3px rgba(84, 89, 172, 0.15);
}
textarea { resize: vertical; }
.role-picker { border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: .75rem 1rem; }
.role-picker legend { padding: 0 .35rem; color: var(--color-muted); }
.radio { display: inline-flex; align-items: center; gap: .35rem; margin-right: 1rem; font-weight: 400; }
.row { display: flex; gap: .75rem; align-items: end; flex-wrap: wrap; }
.row label { flex: 1; min-width: 200px; margin: 0; }

.filters { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filters input[type=search] { flex: 1; min-width: 220px; }

.auth-card { max-width: 460px; margin: 1rem auto; background: var(--color-surface); padding: 1.5rem; border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow); border-top: 3px solid var(--color-primary); }

/* Table */
.table { width: 100%; border-collapse: collapse; background: var(--color-surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: .75rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--color-border); }
.table th { background: linear-gradient(135deg, #393D7E11, #5459AC11); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--color-primary); }
.actions { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.status { display: inline-block; padding: .15rem .6rem; border-radius: 999px; background: #f0f0f8; color: var(--color-muted); font-size: .8rem; }
.status-paid      { background: #ecfdf5; color: #047857; }
.status-pending   { background: #fffbeb; color: #b45309; }
.status-cancelled { background: #fef2f2; color: #b91c1c; }
.status-completed { background: rgba(84,89,172,0.12); color: var(--color-primary-mid); }

.back { display: inline-block; margin-bottom: 1rem; }

.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.admin-head h1 { margin: 0; }

/* Intro video embed */
.video-embed { margin: 1.25rem 0; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 16/9; }
.video-embed iframe, .video-embed video { width: 100%; height: 100%; border: 0; display: block; }
.video-fieldset { border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: .75rem 1rem; margin: .8rem 0; }
.video-fieldset legend { padding: 0 .35rem; font-weight: 600; }
.current-video { margin: 0 0 .75rem; font-size: .9rem; }

.text-right { text-align: right; }

/* ── Video room ───────────────────────────────────────────── */
body.is-compact main.container { max-width: 1400px; }

.room {
    display: grid;
    grid-template-columns: 1fr 300px;
    grid-template-rows: auto 1fr auto;
    gap: .75rem;
    min-height: calc(100vh - 140px);
}

/* Room header */
.room-head {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem 0;
}
.room-head-left h1 { font-size: 1.35rem; margin: 0; }
.room-head-left .room-meta { margin: 0; font-size: .85rem; }
.room-head-right { display: flex; align-items: center; gap: .75rem; }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; }

/* Lesson timer */
.lesson-timer {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: .95rem;
    color: var(--color-primary-mid);
    background: rgba(84,89,172,0.08);
    padding: .3rem .75rem;
    border-radius: 999px;
    letter-spacing: .02em;
}

/* ── Video tiles ─────────────────────────────────────────── */
.videos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    position: relative;
    transition: grid-template-columns .35s ease;
}
.video-tile {
    position: relative;
    background: #0b0d12;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/9;
    transition: all .35s ease;
}
.video-tile video {
    width: 100%; height: 100%;
    object-fit: cover;
    background: #000;
    display: block;
}
.video-tile .tag {
    position: absolute;
    bottom: .5rem; left: .5rem;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    padding: .2rem .65rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 500;
    letter-spacing: .01em;
}

/* Connection quality indicator */
.conn-quality {
    position: absolute;
    bottom: .55rem; right: .55rem;
    font-size: .7rem;
    line-height: 1;
    color: #888;
    transition: color .3s;
}
.conn-quality.quality-good { color: #22c55e; }
.conn-quality.quality-fair { color: #eab308; }
.conn-quality.quality-poor { color: #ef4444; }

/* Waiting overlay */
.waiting {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    color: rgba(255,255,255,.9);
    background: rgba(11,13,18,.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    font-size: .95rem;
    font-weight: 500;
    z-index: 2;
}

/* ── Speaker view ────────────────────────────────────────── */
.videos.speaker-view {
    grid-template-columns: 1fr;
}
.videos.speaker-view #remoteTile {
    grid-column: 1; grid-row: 1;
    aspect-ratio: 16/9;
}
.videos.speaker-view #localTile {
    position: absolute;
    bottom: 1rem; right: 1rem;
    width: 220px;
    aspect-ratio: 16/9;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,.25);
    box-shadow: 0 4px 20px rgba(0,0,0,.5);
    z-index: 3;
    cursor: grab;
    transition: width .25s ease, box-shadow .2s;
}
.videos.speaker-view #localTile:hover {
    box-shadow: 0 6px 28px rgba(0,0,0,.65);
}
.videos.speaker-view #localTile.dragging {
    cursor: grabbing;
    transition: none;
}
.videos.speaker-view #localTile .tag { display: none; }

/* ── Controls bar ────────────────────────────────────────── */
.controls {
    grid-column: 1 / 2;
    display: flex;
    gap: .5rem;
    justify-content: center;
    align-items: center;
    padding: .5rem 0;
    flex-wrap: wrap;
}

.ctrl-btn {
    display: inline-flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: .2rem;
    width: 62px; height: 62px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    font: inherit;
    font-size: .65rem;
    transition: background .15s, border-color .15s, box-shadow .2s, transform .08s;
}
.ctrl-btn:hover {
    border-color: var(--color-primary-mid);
    box-shadow: 0 0 0 3px rgba(84,89,172,0.12);
}
.ctrl-btn:active { transform: scale(.95); }

.ctrl-btn.is-active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}
.ctrl-btn.is-active:hover {
    background: var(--color-primary-d);
    border-color: var(--color-primary-d);
    box-shadow: 0 0 0 3px rgba(57,61,126,0.2);
}

.ctrl-btn-danger {
    border-color: var(--color-danger);
    color: var(--color-danger);
}
.ctrl-btn-danger:hover {
    background: var(--color-danger);
    color: #fff;
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.15);
}

.ctrl-btn-success {
    border-color: #059669;
    color: #059669;
}
.ctrl-btn-success:hover {
    background: #059669;
    color: #fff;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5,150,105,0.15);
}

.ctrl-icon {
    display: flex; align-items: center; justify-content: center;
    width: 22px; height: 22px;
}
.ctrl-icon svg { width: 20px; height: 20px; fill: currentColor; }

.ctrl-label {
    font-size: .6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: .75;
}

.ctrl-confirm { display: inline-flex; }

/* Mic/cam active pulse animation */
@keyframes ctrl-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(84,89,172,0.12); }
    50% { box-shadow: 0 0 0 5px rgba(84,89,172,0.2); }
}
.ctrl-btn.is-active { animation: ctrl-pulse 2s ease-in-out infinite; }
.ctrl-btn.is-active:hover { animation: none; }

/* ── Chat panel ──────────────────────────────────────────── */
.chat {
    grid-column: 2 / 3;
    grid-row: 2 / 4;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: .75rem;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 180px);
}
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .5rem;
}
.chat-header h3 { margin: 0; font-size: 1rem; }
.chat-toggle-btn {
    background: none; border: none; cursor: pointer;
    font-size: .85rem; color: var(--color-muted);
    padding: .15rem .3rem;
    transition: transform .2s;
}
.chat.collapsed .chat-toggle-btn { transform: rotate(-90deg); }
.chat.collapsed .chat-log,
.chat.collapsed .chat-form { display: none; }

.chat-log {
    flex: 1;
    overflow-y: auto;
    min-height: 120px;
    max-height: 50vh;
    padding: .5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    margin-bottom: .5rem;
    scroll-behavior: smooth;
}
.chat-msg { margin: .25rem 0; font-size: .88rem; }
.chat-msg .who { font-weight: 600; }
.chat-msg.mine .who { color: var(--color-primary-mid); }

.chat-form { display: flex; gap: .35rem; }
.chat-form input { flex: 1; padding: .45rem .65rem; font-size: .88rem; }

/* ── Fullscreen mode ─────────────────────────────────────── */
.room:fullscreen,
.room:-webkit-full-screen {
    background: #0b0d12;
    padding: 1rem;
}
.room:fullscreen .room-head,
.room:-webkit-full-screen .room-head {
    color: #fff;
}
.room:fullscreen .room-head-left h1,
.room:-webkit-full-screen .room-head-left h1 { color: #fff; }
.room:fullscreen .room-meta,
.room:-webkit-full-screen .room-meta { color: rgba(255,255,255,.6); }
.room:fullscreen .lesson-timer,
.room:-webkit-full-screen .lesson-timer {
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.85);
}
.room:fullscreen .ctrl-btn,
.room:-webkit-full-screen .ctrl-btn {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.15);
    color: rgba(255,255,255,.85);
}
.room:fullscreen .ctrl-btn:hover,
.room:-webkit-full-screen .ctrl-btn:hover {
    background: rgba(255,255,255,.15);
    border-color: rgba(255,255,255,.25);
}
.room:fullscreen .ctrl-btn.is-active,
.room:-webkit-full-screen .ctrl-btn.is-active {
    background: var(--color-primary-mid);
    border-color: var(--color-primary-mid);
    color: #fff;
}
.room:fullscreen .chat,
.room:-webkit-full-screen .chat {
    background: rgba(255,255,255,.05);
    border-color: rgba(255,255,255,.1);
    color: #fff;
}
.room:fullscreen .chat-log,
.room:-webkit-full-screen .chat-log {
    background: rgba(0,0,0,.3);
    border-color: rgba(255,255,255,.1);
    color: rgba(255,255,255,.9);
}
.room:fullscreen .chat-form input,
.room:-webkit-full-screen .chat-form input {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.15);
    color: #fff;
}

/* ── Screen sharing active indicator ─────────────────────── */
.video-tile.screen-sharing {
    border: 2px solid var(--color-accent);
    box-shadow: 0 0 0 3px rgba(109,195,187,0.2);
}

/* ── Mobile responsive ───────────────────────────────────── */
@media (max-width: 900px) {
    .room {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .chat {
        grid-column: 1;
        grid-row: auto;
        max-height: 300px;
    }
    .videos { grid-template-columns: 1fr; }
    .videos.speaker-view #localTile {
        width: 140px;
        bottom: .5rem; right: .5rem;
    }
    .ctrl-btn { width: 52px; height: 52px; border-radius: 12px; }
    .ctrl-label { font-size: .55rem; }
    .ctrl-icon svg { width: 17px; height: 17px; }
    .room-head { flex-direction: column; align-items: flex-start; gap: .5rem; }
    .room-head-right { width: 100%; justify-content: space-between; }
}

/* ── Accent utilities ─────────────────────────────────────── */
.text-accent  { color: var(--color-accent); }
.text-accent2 { color: var(--color-accent-2); }
.text-primary { color: var(--color-primary); }

/* Card hover highlight */
.link-card:hover { box-shadow: var(--shadow-h); text-decoration: none; border-color: var(--color-accent); }

/* Hero background accent strip */
.hero-wrap {
    background: linear-gradient(160deg, rgba(57,61,126,0.04) 0%, rgba(109,195,187,0.08) 60%, rgba(242,174,187,0.06) 100%);
    border-radius: var(--radius);
    padding: 0 1rem;
    margin-bottom: 1rem;
}

/* Admin section highlight */
.admin-head h1 { color: var(--color-primary); }

/* Flash success / error refinement */
.flash-success { background: var(--color-success-bg); color: var(--color-success); border-color: #a7f3d0; }
.flash-error   { background: var(--color-error-bg);   color: var(--color-error);   border-color: #fecaca; }

/* Page section headings accent line */
h2 { position: relative; }
h2::after { content: ''; display: block; width: 2.5rem; height: 3px; margin-top: .35rem; border-radius: 2px; background: linear-gradient(90deg, var(--color-primary-mid), var(--color-accent)); }

/* Slot availability card */
.slot { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .35rem; transition: border-color .15s, box-shadow .15s; }
.slot:hover { border-color: var(--color-accent); box-shadow: var(--shadow); }

/* Card accent top border on hover */
.card { transition: box-shadow .2s, border-color .2s; }
.card:hover { box-shadow: var(--shadow-h); border-color: rgba(109,195,187,0.5); }

/* Nav active link indicator */
.site-header nav a.active { color: var(--color-accent); font-weight: 700; }

/* Calendar grid */
.cal-card { overflow: hidden; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cal-nav { display: flex; align-items: center; gap: .75rem; }
.cal-nav h2 { font-size: 1.1rem; white-space: nowrap; }
.badge-next { background: var(--color-primary-mid); color: #fff; font-size: .65rem; padding: .15rem .5rem; border-radius: 99px; vertical-align: middle; margin-left: .35rem; }
.cal-options { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.cal-options label { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--color-muted); }
.cal-options select { padding: .35rem .5rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-size: .85rem; }
.cal-wrap { overflow-x: auto; }
.cal-grid { display: grid; grid-template-columns: 50px repeat(7, 1fr); min-width: 560px; user-select: none; }
.cal-header { font-weight: 700; font-size: .8rem; text-align: center; padding: .5rem .25rem; color: var(--color-muted); border-bottom: 2px solid var(--color-border); }
.cal-label { font-size: .7rem; color: var(--color-muted); text-align: right; padding: .15rem .35rem; border-top: 1px solid var(--color-border); line-height: 1.6rem; }
.cal-cell { border-top: 1px solid var(--color-border); border-left: 1px solid var(--color-border); cursor: pointer; transition: background .1s; min-height: 2.3rem; padding: 1px; }
.cal-cell:nth-child(8n) { border-right: 1px solid var(--color-border); }
.cal-cell:hover { background: rgba(84,89,172,0.08); }
.cal-cell.active { background: rgba(5,150,105,0.2); cursor: default; }
.cal-cell.active:hover { background: rgba(5,150,105,0.28); }
.cal-cell.planned { background: rgba(84,89,172,0.12); cursor: default; }
.cal-cell.planned:hover { background: rgba(84,89,172,0.2); }
.cal-cell.selected { background: var(--color-primary-mid); }
.cal-cell.selected:hover { background: var(--color-primary); }
.cal-cell.selected.active { background: var(--color-primary-mid); }
.cal-cell.selected.planned { background: var(--color-primary-mid); }
.cal-legend { display: flex; align-items: center; gap: 1.25rem; margin-top: .75rem; font-size: .8rem; color: var(--color-muted); }
.legend-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--color-border); vertical-align: middle; }
.swatch-empty { background: transparent; }
.swatch-planned { background: rgba(84,89,172,0.12); border-color: rgba(84,89,172,0.25); }
.swatch-active { background: rgba(5,150,105,0.2); border-color: rgba(5,150,105,0.3); }
.swatch-selected { background: var(--color-primary-mid); border-color: var(--color-primary-mid); }
.cal-student { display: block; font-size: .6rem; line-height: 1.1; color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.slot-chip-student { display: block; font-size: .7rem; color: inherit; opacity: .8; }

/* Compact upcoming slots */
.slots-compact {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.slot-day {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: .65rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color .15s;
}
.slot-day:hover { border-color: rgba(109,195,187,0.5); }
.slot-day-head {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 120px;
    flex-shrink: 0;
}
.slot-day-label {
    font-weight: 600;
    font-size: .85rem;
    line-height: 1.3;
}
.slot-day-count {
    font-size: .72rem;
    color: var(--color-muted);
    line-height: 1.3;
}
.slot-day-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    flex: 1;
}
.slot-chip {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 500;
    background: #f0f0f8;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    line-height: 1.5;
}
.slot-chip-booked {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}
.slot-chip-del {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 .1rem;
    color: var(--color-muted);
    font-family: var(--font);
}
.slot-chip-del:hover { color: var(--color-danger); }
