/* Hallway Screens admin — Apple-style design system */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, Roboto, "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Inter, Roboto, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --bg: #f5f5f7;
  --content: #fbfbfd;
  --sidebar: rgba(240, 240, 244, .82);
  --card: #ffffff;
  --fill: #f2f2f7;
  --fill-2: #e9e9ee;
  --hover: rgba(0, 0, 0, .045);
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #8e8e93;
  --sep: rgba(60, 60, 67, .13);
  --sep-strong: rgba(60, 60, 67, .22);
  --accent: #007aff;
  --accent-tint: rgba(0, 122, 255, .12);
  --on-accent: #fff;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --yellow: #ffcc00;
  --purple: #af52de;
  --pink: #ff2d55;
  --teal: #30b0c7;
  --indigo: #5856d6;
  --toggle-off: #e9e9eb;
  --seg-on: #ffffff;
  --thumb-bg: #1c1c1e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04), 0 0 0 .5px rgba(0, 0, 0, .06);
  --shadow: 0 6px 24px rgba(0, 0, 0, .07), 0 0 0 .5px rgba(0, 0, 0, .06);
  --shadow-lg: 0 30px 90px rgba(0, 0, 0, .22), 0 0 0 .5px rgba(0, 0, 0, .08);
  --radius: 16px;
  --radius-sm: 10px;
  --scrim: rgba(0, 0, 0, .25);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --content: #000;
    --sidebar: rgba(28, 28, 30, .82);
    --card: #1c1c1e;
    --fill: #2c2c2e;
    --fill-2: #3a3a3c;
    --hover: rgba(255, 255, 255, .06);
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #7c7c80;
    --sep: rgba(84, 84, 88, .48);
    --sep-strong: rgba(120, 120, 128, .5);
    --accent: #0a84ff;
    --accent-tint: rgba(10, 132, 255, .2);
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --yellow: #ffd60a;
    --purple: #bf5af2;
    --pink: #ff375f;
    --teal: #40c8e0;
    --indigo: #5e5ce6;
    --toggle-off: #39393d;
    --seg-on: #636366;
    --thumb-bg: #000;
    --shadow-sm: 0 0 0 .5px rgba(255, 255, 255, .08);
    --shadow: 0 8px 30px rgba(0, 0, 0, .5), 0 0 0 .5px rgba(255, 255, 255, .1);
    --shadow-lg: 0 30px 90px rgba(0, 0, 0, .7), 0 0 0 .5px rgba(255, 255, 255, .12);
    --scrim: rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.45 var(--font); color: var(--text); background: var(--content); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; }
img { display: block; }
::selection { background: var(--accent-tint); }
:focus-visible { outline: 3px solid var(--accent-tint); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer { flex: 1; }
.hstack { display: flex; align-items: center; gap: 10px; }
.vstack { display: flex; flex-direction: column; gap: 14px; }
.wrap { flex-wrap: wrap; }

.boot { height: 100vh; display: grid; place-items: center; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--sep-strong); border-top-color: var(--text-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); height: 100vh; }
.sidebar { background: var(--sidebar); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-right: .5px solid var(--sep); display: flex; flex-direction: column; padding: 16px 12px 12px; min-height: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 20px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.brand .name { font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.brand .school { font-size: 12px; color: var(--text-2); max-width: 160px; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav .label { font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 14px 10px 5px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text); font-weight: 500; transition: background .12s; }
.nav a svg { color: var(--accent); flex: none; }
.nav a:hover { background: var(--hover); }
.nav a.active { background: var(--accent); color: var(--on-accent); }
.nav a.active svg { color: var(--on-accent); }
.nav a .count { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nav a.active .count { color: rgba(255, 255, 255, .8); }
.sidebar .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; }
.sidebar .me:hover { background: var(--hover); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 12.5px; color: #fff; flex: none; letter-spacing: .02em; }
.me .who { min-width: 0; }
.me .who .n { font-weight: 600; font-size: 13px; }
.me .who .r { font-size: 11.5px; color: var(--text-2); text-transform: capitalize; }

.content-col { min-width: 0; display: flex; flex-direction: column; height: 100vh; }
.main { flex: 1; overflow-y: auto; min-width: 0; position: relative; }
.topbar { display: none; }
.page { max-width: 1320px; margin: 0 auto; padding: 30px 40px 80px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font: 700 30px/1.12 var(--font-display); letter-spacing: -.022em; margin: 0; }
.page-head .sub { color: var(--text-2); margin-top: 5px; font-size: 14px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-weight: 500; margin-bottom: 8px; cursor: pointer; background: none; border: 0; padding: 0; }
.section { margin-top: 30px; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: center; gap: 10px; margin: 0 2px 12px; }
.section-head h2 { font: 650 19px/1.2 var(--font-display); letter-spacing: -.012em; margin: 0; }
.section-head .meta { color: var(--text-2); font-size: 13px; }
.section-head .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 15px; border-radius: 999px; border: 0;
  font: 500 13.5px/1 var(--font); background: var(--accent); color: var(--on-accent); cursor: pointer; white-space: nowrap; transition: filter .15s, transform .08s, background .15s; }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.secondary { background: var(--fill); color: var(--text); }
.btn.secondary:hover { background: var(--fill-2); filter: none; }
.btn.plain { background: transparent; color: var(--accent); padding: 0 8px; }
.btn.plain:hover { background: var(--accent-tint); filter: none; }
.btn.danger { background: transparent; color: var(--red); }
.btn.danger:hover { background: color-mix(in srgb, var(--red) 12%, transparent); filter: none; }
.btn.danger-fill { background: var(--red); color: #fff; }
.btn.icon { width: 32px; padding: 0; }
.btn.lg { height: 40px; padding: 0 20px; font-size: 15px; }
.btn.block { width: 100%; }
.btn svg { flex: none; }

.input, select.input, textarea.input { font: inherit; width: 100%; padding: 8px 12px; min-height: 36px; border-radius: 10px; border: .5px solid var(--sep-strong);
  background: var(--card); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { resize: vertical; min-height: 70px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }
.input::placeholder { color: var(--text-3); }
select.input { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9l4-4 4 4M8 15l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 15px; }
input[type="time"].input, input[type="date"].input { font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.field { display: block; }
.field > .lbl { display: block; font-size: 12.5px; font-weight: 550; color: var(--text-2); margin: 0 0 6px 3px; }
.field > .hint { font-size: 12px; color: var(--text-3); margin: 6px 3px 0; line-height: 1.4; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 34px; border-radius: 999px; background: var(--fill); border-color: transparent; min-width: 220px; }
.search .input:focus { background: var(--card); }

.switch { position: relative; display: inline-block; width: 44px; height: 27px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--toggle-off); transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 23px; height: 23px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16), 0 0 0 .5px rgba(0, 0, 0, .04); transition: transform .25s cubic-bezier(.3, .7, .4, 1.15); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(17px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 4px var(--accent-tint); }
.switch input:disabled + span { opacity: .5; }

.seg { display: inline-flex; background: var(--fill); padding: 2px; border-radius: 9px; gap: 2px; max-width: 100%; }
.seg button { border: 0; background: transparent; padding: 5px 14px; border-radius: 7px; font: 500 13px/1.3 var(--font); color: var(--text); cursor: pointer; white-space: nowrap; transition: background .15s; }
.seg button:hover:not(.on) { background: var(--hover); }
.seg button.on { background: var(--seg-on); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); font-weight: 600; }
.seg.block { display: flex; }
.seg.block button { flex: 1; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 550; background: var(--fill); color: var(--text-2); white-space: nowrap; }
.pill.green { background: color-mix(in srgb, var(--green) 16%, transparent); color: color-mix(in srgb, var(--green) 80%, var(--text)); }
.pill.orange { background: color-mix(in srgb, var(--orange) 16%, transparent); color: color-mix(in srgb, var(--orange) 85%, var(--text)); }
.pill.red { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.pill.blue { background: var(--accent-tint); color: var(--accent); }

.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--fill); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; transition: background .15s, color .15s, transform .08s; }
.days button.on { background: var(--accent); color: #fff; }
.days button:active { transform: scale(.94); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .15); position: relative; }
.swatches button.on::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2.5px solid currentColor; opacity: .5; }

/* Grouped lists (Settings-style) */
.list { background: var(--card); border-radius: 12px; box-shadow: var(--shadow-sm); overflow: hidden; }
.sheet .list, .list.filled { background: var(--fill); box-shadow: none; }
.row { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 16px; position: relative; }
.row + .row::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep); }
.row.with-icon + .row.with-icon::before { left: 56px; }
.row.click { cursor: pointer; transition: background .12s; }
.row.click:hover { background: var(--hover); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 500; }
.row .subtitle { font-size: 12.5px; color: var(--text-2); }
.row .value { color: var(--text-2); text-align: right; }
.row .chev { color: var(--text-3); flex: none; }
.row .input.inline { border: 0; background: transparent; text-align: right; padding: 0; box-shadow: none; min-height: 0; max-width: 60%; }
.group-label { font-size: 12.5px; color: var(--text-2); margin: 22px 16px 7px; font-weight: 500; }
.group-label:first-child { margin-top: 0; }
.group-foot { font-size: 12px; color: var(--text-3); margin: 7px 16px 0; line-height: 1.4; }
.row-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }

/* ---------- Cards & grids ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.grid.tight { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow .2s, transform .2s; position: relative; }
.card.click { cursor: pointer; }
.card.click:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card .body { padding: 14px 16px 15px; }
.card .name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.card .meta { font-size: 12.5px; color: var(--text-2); }

.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--thumb-bg); overflow: hidden; display: grid; place-items: center; color: rgba(255, 255, 255, .7); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .glyph { display: grid; place-items: center; width: 100%; height: 100%; }
.thumb.k-web { background: linear-gradient(150deg, #5ac8fa, #007aff); color: #fff; }
.thumb.k-slides { background: linear-gradient(150deg, #ffd60a, #ff9f0a); color: #fff; }
.thumb.k-stream { background: linear-gradient(150deg, #ff375f, #af52de); color: #fff; }
.thumb.k-blank { background: #000; }
.thumb.k-idle { background: linear-gradient(150deg, #3a3a3c, #1c1c1e); }
.thumb.k-offline { background: linear-gradient(150deg, #48484a, #2c2c2e); }
.glass { position: absolute; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: rgba(0, 0, 0, .45); color: #fff; backdrop-filter: blur(12px) saturate(1.5); -webkit-backdrop-filter: blur(12px) saturate(1.5); }
.glass.tl { top: 10px; left: 10px; }
.glass.tr { top: 10px; right: 10px; }
.glass.br { bottom: 10px; right: 10px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(48, 209, 88, .6); animation: pulse 2s infinite; }
.live-dot.off { background: #8e8e93; animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(48, 209, 88, .55); } 70% { box-shadow: 0 0 0 7px rgba(48, 209, 88, 0); } 100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); } }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .18); }
.progress > i { display: block; height: 100%; width: 0; background: #fff; border-radius: 0 2px 2px 0; }
.bar { height: 6px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }

.screen-card .line { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; min-width: 0; }
.screen-card .line svg { color: var(--text-3); flex: none; }
.screen-card .foot { display: flex; gap: 6px; margin-top: 11px; flex-wrap: wrap; }

.mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; }
.mosaic img, .mosaic div { width: 100%; height: 100%; object-fit: cover; background: var(--fill-2); }
.mosaic.one { grid-template-columns: 1fr; grid-template-rows: 1fr; }

.tile .body { padding: 10px 12px 12px; }
.tile .name { font-size: 13.5px; font-weight: 550; }
.tile.selected { box-shadow: 0 0 0 3px var(--accent); }
.check { position: absolute; top: 9px; right: 9px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, .25); display: grid; place-items: center; color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.tile.selected .check { background: var(--accent); border-color: var(--accent); }
.processing { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12.5px; font-weight: 600; backdrop-filter: blur(6px); }
.processing .bar { width: 60%; background: rgba(255, 255, 255, .25); }
.processing .bar > i { background: #fff; }
.errored { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 14px; text-align: center; background: color-mix(in srgb, var(--red) 75%, #000); color: #fff; font-size: 12px; font-weight: 500; }

.empty { text-align: center; padding: 70px 20px; color: var(--text-2); }
.empty .ico { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; display: grid; place-items: center; background: var(--fill); color: var(--text-3); }
.empty h3 { margin: 0 0 6px; color: var(--text); font: 650 19px/1.2 var(--font-display); }
.empty p { margin: 0 auto 18px; max-width: 440px; }
.empty ol { text-align: left; display: inline-block; margin: 0 0 20px; padding-left: 20px; line-height: 1.8; }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; background: var(--accent-tint); color: var(--text); margin-bottom: 18px; font-size: 13.5px; }
.banner svg { color: var(--accent); flex: none; margin-top: 1px; }
.banner.warn { background: color-mix(in srgb, var(--orange) 14%, transparent); }
.banner.warn svg { color: var(--orange); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.copybox { display: flex; align-items: center; gap: 8px; background: var(--fill); border-radius: 10px; padding: 6px 6px 6px 12px; font-family: var(--mono); font-size: 13px; }
.copybox span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Sheets, alerts, menus, toasts ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; animation: fadeIn .2s ease; }
.scrim.closing { animation: fadeOut .18s ease forwards; }
.sheet { width: min(var(--w, 560px), 100%); max-height: calc(100vh - 32px); background: var(--card); border-radius: 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: sheetIn .38s cubic-bezier(.2, .95, .25, 1.05); }
.scrim.closing .sheet { animation: sheetOut .18s ease forwards; }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 12px 14px; border-bottom: .5px solid var(--sep); gap: 8px; }
.sheet-head .t { font-weight: 650; font-size: 15px; text-align: center; }
.sheet-head .l { justify-self: start; }
.sheet-head .r { justify-self: end; }
.sheet-head .btn.plain { font-size: 15px; }
.sheet-head .btn.done { font-weight: 650; }
.sheet-body { padding: 20px 22px 24px; overflow-y: auto; }
.sheet-foot { padding: 12px 22px 18px; display: flex; gap: 10px; border-top: .5px solid var(--sep); }
.alert { width: min(300px, 100%); background: var(--card); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; text-align: center; animation: alertIn .3s cubic-bezier(.2, .95, .25, 1.15); }
.alert .content { padding: 20px 18px 16px; }
.alert h3 { margin: 0 0 4px; font-size: 16px; font-weight: 650; }
.alert p { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.4; }
.alert .secret { margin-top: 12px; font: 600 17px var(--mono); background: var(--fill); padding: 10px; border-radius: 10px; user-select: all; color: var(--text); }
.alert .buttons { display: flex; border-top: .5px solid var(--sep); }
.alert .buttons button { flex: 1; border: 0; background: none; padding: 12px; font-size: 15px; color: var(--accent); cursor: pointer; }
.alert .buttons button + button { border-left: .5px solid var(--sep); }
.alert .buttons button.primary { font-weight: 650; }
.alert .buttons button.destructive { color: var(--red); }
.alert .buttons button:hover { background: var(--hover); }
.menu { position: fixed; z-index: 150; min-width: 220px; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(30px) saturate(1.8); -webkit-backdrop-filter: blur(30px) saturate(1.8);
  border-radius: 13px; box-shadow: var(--shadow-lg); padding: 5px; animation: menuIn .18s cubic-bezier(.2, .9, .3, 1.1); transform-origin: top right; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; font-size: 14px; }
.menu button:hover { background: var(--accent); color: #fff; }
.menu button:hover svg { color: #fff; }
.menu button svg { color: var(--text-2); }
.menu button.destructive { color: var(--red); }
.menu button.destructive svg { color: var(--red); }
.menu hr { border: 0; border-top: .5px solid var(--sep); margin: 4px 8px; }
.toasts { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: rgba(30, 30, 32, .9); color: #fff; padding: 11px 18px; border-radius: 999px; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .25); font-weight: 500; font-size: 13.5px; display: flex; gap: 8px; align-items: center; animation: toastIn .35s cubic-bezier(.2, .95, .3, 1.2); max-width: 90vw; }
.toast.error svg { color: #ff6961; }
.toast.ok svg { color: #30d158; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes sheetIn { from { opacity: 0; transform: translateY(24px) scale(.97); } }
@keyframes sheetOut { to { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes alertIn { from { opacity: 0; transform: scale(1.12); } }
@keyframes menuIn { from { opacity: 0; transform: scale(.92); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.95); } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, var(--accent-tint), transparent 70%), var(--content); }
.auth-card { width: min(400px, 100%); text-align: center; }
.auth-card > img { width: 76px; height: 76px; border-radius: 20px; margin: 0 auto 22px; box-shadow: 0 12px 30px rgba(0, 122, 255, .3); }
.auth-card h1 { font: 700 27px/1.15 var(--font-display); letter-spacing: -.02em; margin: 0 0 6px; }
.auth-card .sub { color: var(--text-2); margin: 0 0 26px; }
.auth-card form { text-align: left; display: flex; flex-direction: column; gap: 12px; }
.auth-card .input { min-height: 44px; font-size: 15px; border-radius: 12px; }
.auth-card .error { color: var(--red); font-size: 13px; min-height: 18px; text-align: center; }
.shake { animation: shake .45s; }

/* ---------- Playlist editor ---------- */
.title-input { font: 700 30px/1.12 var(--font-display); letter-spacing: -.022em; border: 0; background: transparent; color: var(--text); padding: 2px 6px; margin-left: -6px; border-radius: 8px; width: 100%; outline: none; }
.title-input:hover { background: var(--hover); }
.title-input:focus { background: var(--fill); }
.items .row { min-height: 64px; gap: 14px; }
.items .row.dragging { opacity: .4; }
.items .row.drop-before { box-shadow: inset 0 3px 0 var(--accent); }
.items .row.drop-after { box-shadow: inset 0 -3px 0 var(--accent); }
.items .grip { cursor: grab; color: var(--text-3); padding: 4px; flex: none; }
.items .mini { width: 72px; aspect-ratio: 16/9; border-radius: 7px; overflow: hidden; flex: none; }
.items .mini.thumb { display: grid; }
.items .num { width: 22px; text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 12.5px; flex: none; }
.dur { width: 74px; text-align: right; font-variant-numeric: tabular-nums; }
.saving { font-size: 12.5px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.stats { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.stats .stat .k { font-size: 12px; color: var(--text-2); }
.stats .stat .v { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- Schedule ---------- */
.cal { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.cal-head { display: grid; grid-template-columns: 56px repeat(7, 1fr); border-bottom: .5px solid var(--sep); background: var(--card); position: sticky; top: 0; z-index: 3; }
.cal-head div { padding: 10px 6px; text-align: center; font-size: 12px; color: var(--text-2); font-weight: 550; }
.cal-head .dnum { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 99px; font-size: 18px; font-weight: 600; color: var(--text); margin-top: 2px; padding: 0 4px; }
.cal-head .today .dnum { background: var(--red); color: #fff; }
.cal-scroll { height: min(640px, calc(100vh - 290px)); overflow-y: auto; position: relative; }
.cal-body { display: grid; grid-template-columns: 56px repeat(7, 1fr); position: relative; }
.cal-hours div { height: 46px; font-size: 11px; color: var(--text-3); text-align: right; padding-right: 8px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.cal-day { position: relative; border-left: .5px solid var(--sep); background-image: linear-gradient(var(--sep) .5px, transparent .5px); background-size: 100% 46px; cursor: crosshair; }
.cal-day.today { background-color: color-mix(in srgb, var(--accent) 3%, transparent); }
.cal-off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(-45deg, transparent 0 6px, color-mix(in srgb, var(--text) 5%, transparent) 6px 7px); pointer-events: none; }
.ev { position: absolute; border-radius: 7px; padding: 4px 7px; font-size: 12px; line-height: 1.25; overflow: hidden; cursor: pointer; border-left: 3px solid var(--c);
  background: color-mix(in srgb, var(--c) 18%, var(--card)); color: color-mix(in srgb, var(--c) 55%, var(--text)); transition: filter .15s, box-shadow .15s; z-index: 1; }
.ev:hover { filter: brightness(1.04) saturate(1.1); box-shadow: 0 4px 14px rgba(0, 0, 0, .12); z-index: 2; }
.ev .t { font-weight: 650; }
.ev .s { opacity: .85; }
.ev.overridden { opacity: .5; background-image: repeating-linear-gradient(-45deg, transparent 0 5px, rgba(127, 127, 127, .15) 5px 6px); }
.ev.disabled { opacity: .35; border-left-style: dashed; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 4; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 272px; transform: translateX(-100%); transition: transform .3s cubic-bezier(.3, .8, .3, 1); box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 10; padding: 10px 12px; background: color-mix(in srgb, var(--content) 80%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: .5px solid var(--sep); }
  .topbar .t { font-weight: 650; }
  .page { padding: 20px 16px 60px; }
  .page-head h1 { font-size: 26px; }
  .grid-2 { grid-template-columns: 1fr; }
  .cal-head, .cal-body { grid-template-columns: 40px repeat(7, minmax(0, 1fr)); }
  .ev .s { display: none; }
  .search .input { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
