:root {
  color-scheme: light;
  --paper: #f2f0e9;
  --surface: rgba(252, 251, 247, 0.94);
  --surface-solid: #fcfbf7;
  --sunk: #ebe8de;
  --ink: #16150f;
  --ink-2: #3b3930;
  --muted: #6d6a5f;
  --line: #d3cebf;
  --line-strong: #16150f;
  --accent: #2346d6;
  --accent-soft: rgba(35, 70, 214, 0.12);

  /* status palette — always paired with a text label */
  --critical: #d03b3b;
  --serious: #ec835a;
  --warning: #fab219;
  --good: #0ca30c;
  --neutral: #9a968a;

  --bg-dim: 0.55;
  --bg-blur: 0px;
  --tabbar-h: 62px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* Space under the tab bar icons: sit close to the home indicator instead of clearing all of it. */
  --tabbar-pad: max(6px, calc(var(--safe-bottom) - 14px));
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; border-radius: 0; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

/* ---------- Background (schedule picture) ---------- */
#bg {
  position: fixed;
  inset: calc(var(--bg-blur) * -2);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
  filter: blur(var(--bg-blur));
  z-index: -2;
  opacity: 1;
}
body:not(.has-bg) #bg { opacity: .45; }
body.has-bg #bg { background-size: var(--bg-size, contain); background-position: center; background-repeat: no-repeat; }
#bg-dim {
  position: fixed; inset: 0; z-index: -1;
  background: rgba(242, 240, 233, var(--bg-dim));
}
body:not(.has-bg) #bg-dim { background: transparent; }

body.peek #app, body.peek #sheet-root, body.peek #toast { display: none; }
body.peek #bg { filter: none; inset: 0; background-size: contain; background-position: center; background-color: #fff; }
body.peek #bg-dim { background: transparent; }
#peek-exit {
  display: none; position: fixed; inset: 0; border: 0; background: transparent; z-index: 50;
  align-items: flex-end; justify-content: center; padding-bottom: calc(24px + var(--safe-bottom));
}
#peek-exit span { background: var(--ink); color: var(--paper); padding: 10px 16px; font-size: 14px; font-weight: 600; }
body.peek #peek-exit { display: flex; }

/* ---------- Layout ---------- */
#app {
  max-width: 600px;
  margin: 0 auto;
  /* Always at least one screen tall: on short pages iOS home-screen apps otherwise
     leave a gap under the fixed tab bar. */
  min-height: 100vh;
  min-height: 100dvh;
  padding: 12px 16px calc(var(--tabbar-h) + var(--tabbar-pad) + 96px);
}
body.auth #app { padding-bottom: 32px; }

.topbar {
  display: flex; align-items: flex-end; gap: 12px;
  padding: 6px 0 12px; margin-bottom: 14px;
  border-bottom: 2px solid var(--ink);
}
.topbar .hello { flex: 1; min-width: 0; }
.topbar .hello small { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; display: block; }
.topbar h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }

.icon-btn {
  width: 40px; height: 40px; flex: none;
  display: inline-grid; place-items: center;
  border: 1.5px solid var(--ink); background: var(--surface-solid); color: var(--ink);
}
.icon-btn:active { background: var(--ink); color: var(--paper); }
.i { display: block; flex: none; }

.glass, .card {
  background: var(--surface);
  border: 1px solid var(--line);
}
.pad { padding: 16px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
/* icons sitting inside a sentence */
.small .i, p .i { display: inline-block; vertical-align: -3px; }

.section-title {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink); margin: 22px 0 8px;
}
.section-title .count { color: var(--muted); font-weight: 600; }

/* ---------- Summary + filters ---------- */
.summary {
  display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 12px;
  border: 1.5px solid var(--ink); background: var(--surface);
}
.summary .tile { padding: 10px 12px; border: 0; background: transparent; }
.summary .tile + .tile { border-left: 1px solid var(--line); }
.tile .num { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile .lbl { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 2px; }

.chips {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 16px 4px; margin: 0 -16px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip-btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border: 1px solid var(--line); background: var(--surface-solid);
  color: var(--ink-2); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.chip-btn.active { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 600; }
.chip-btn .n { font-variant-numeric: tabular-nums; opacity: .6; }

.sortbar { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 0; }
.seg { display: inline-flex; border: 1.5px solid var(--ink); background: var(--surface-solid); }
.seg button { border: 0; background: transparent; color: var(--ink-2); padding: 6px 12px; font-size: 13px; font-weight: 500; }
.seg button + button { border-left: 1.5px solid var(--ink); }
.seg button.active { background: var(--ink); color: var(--paper); font-weight: 600; }

.dot { width: 9px; height: 9px; background: var(--c, var(--neutral)); flex: none; }

/* ---------- Task cards ---------- */
.list { display: grid; gap: 8px; }
.task {
  position: relative; display: flex; gap: 12px; align-items: stretch;
  padding: 13px 14px 13px 16px; overflow: hidden; cursor: pointer;
}
.task:active { background: var(--surface-solid); border-color: var(--ink); }
.task::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--c, var(--neutral));
}
.task.lvl-overdue { border: 1.5px solid var(--critical); }

.check {
  width: 26px; height: 26px; flex: none; margin-top: 1px;
  border: 1.5px solid var(--ink); background: var(--surface-solid);
  display: grid; place-items: center; color: transparent; padding: 0;
}
.check:hover, .check:focus-visible { color: var(--ink); }
.check.done { background: var(--good); border-color: var(--good); color: #fff; }

.task-main { flex: 1; min-width: 0; }
.task-top { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 2px; flex-wrap: wrap; }
.task-top .course { color: var(--ink); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.task-title { font-size: 16px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.task-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.task-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; flex: none; }
.countdown { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -0.01em; }

.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink);
  padding: 3px 7px 3px 6px;
  background: color-mix(in srgb, var(--s) 16%, var(--surface-solid));
  border: 1px solid var(--s);
  white-space: nowrap;
}
.status::before { content: ""; width: 7px; height: 7px; background: var(--s); }
.s-overdue { --s: var(--critical); }
.s-now { --s: var(--serious); }
.s-soon { --s: var(--warning); }
.s-planned { --s: var(--good); }
.s-later { --s: var(--neutral); }

.progress { height: 6px; background: var(--sunk); overflow: hidden; margin-top: 8px; }
.progress > span { display: block; height: 100%; width: var(--p); background: var(--accent); transition: width .25s; }
.progress-label { font-size: 12px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 36px 20px; border-style: dashed; border-color: var(--ink); }
.empty h2 { font-size: 18px; margin-bottom: 6px; }
.empty p { color: var(--muted); }

/* ---------- FAB + tab bar ---------- */
.fab {
  position: fixed; right: max(16px, calc(50% - 284px)); bottom: calc(var(--tabbar-h) + var(--tabbar-pad) + 16px);
  height: 54px; padding: 0 22px 0 18px; border: 0;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .01em;
  box-shadow: 4px 4px 0 var(--ink);
  z-index: 10;
}
.fab:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 0 0 var(--tabbar-pad);
  background: var(--surface-solid); border-top: 2px solid var(--ink);
}
.tabbar-inner { max-width: 600px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; }
.tab {
  position: relative; min-width: 0; border: 0; background: transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 8px; font-size: 11px; font-weight: 600;
}
.tab.active { color: var(--ink); }
.tab.active::before { content: ""; position: absolute; top: -2px; left: 20%; right: 20%; height: 3px; background: var(--accent); }

/* ---------- Buttons + fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 1.5px solid var(--ink); background: var(--surface-solid); color: var(--ink);
  font-weight: 600; font-size: 15px; text-decoration: none;
}
.btn:active { background: var(--sunk); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:active { background: #1b37ab; }
.btn.danger { color: var(--critical); border-color: var(--critical); background: var(--surface-solid); }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.block { width: 100%; }
.btn.sm { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: .5; }

.field { display: block; }
.field > span, .field-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); margin: 0 0 6px;
}
.field-label em, .field > span em { font-style: normal; color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; text-align: right; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=time], select, textarea, input:not([type]) {
  width: 100%; min-height: 46px; padding: 10px 12px;
  font-size: 16px; /* prevents iOS zoom */
  border: 1.5px solid var(--ink); background: var(--surface-solid); color: var(--ink);
  outline: none; -webkit-appearance: none; appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px;
}
textarea { min-height: 80px; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: #9a968a; }
input[type=date], input[type=time] { min-width: 0; }
.form-error { color: var(--critical); font-size: 14px; font-weight: 600; }
.form-error:empty { display: none; }

/* ---------- Sheets ---------- */
#sheet-root { position: fixed; inset: 0; z-index: 120; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(22, 21, 15, .45); opacity: 0; transition: opacity .2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto;
  max-width: 600px; max-height: calc(100dvh - var(--safe-top) - 24px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); border-top: 3px solid var(--ink);
  padding: 8px 16px calc(20px + var(--safe-bottom));
  transform: translateY(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}
#sheet-root.open .sheet-backdrop { opacity: 1; }
#sheet-root.open .sheet { transform: none; }
body.sheet-open { overflow: hidden; }
.sheet-grip { width: 36px; height: 4px; background: var(--line); margin: 2px auto 10px; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sheet-head h2 { flex: 1; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.sheet-head .badges { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 4px 8px; background: var(--surface-solid); border: 1px solid var(--ink); color: var(--ink);
}

.form-grid { display: grid; gap: 16px; }
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1.5px solid var(--ink); border-left: 1.5px solid var(--ink); }
.type-grid .opt span { border: 0; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 42px; padding: 4px 6px; font-size: 13px; font-weight: 600;
  border: 1.5px solid var(--ink); background: var(--surface-solid); color: var(--ink-2);
}
.opt input:checked + span { background: var(--ink); color: var(--paper); }
.opt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: -3px; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); }
.scale .opt + .opt span { border-left: 0; }
.scale .opt span { min-height: 44px; font-size: 16px; font-variant-numeric: tabular-nums; }

.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.quick-dates { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.quick-dates button { border: 1px solid var(--line); background: var(--surface-solid); color: var(--ink-2); padding: 6px 10px; font-size: 13px; font-weight: 500; }
.quick-dates button:active { background: var(--ink); color: var(--paper); }

.items { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.items:empty { display: none; }
.item { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.item label { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.item .text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.item input[type=checkbox] {
  -webkit-appearance: none; appearance: none; flex: none;
  width: 22px; height: 22px; margin: 0; border: 1.5px solid var(--ink); background: var(--surface-solid);
  display: grid; place-items: center;
}
.item input[type=checkbox]:checked { background: var(--good); border-color: var(--good); }
.item input[type=checkbox]:checked::after {
  content: ""; width: 10px; height: 5px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: translateY(-1px) rotate(-45deg);
}
.item.is-done .text { color: var(--muted); text-decoration: line-through; }
.item .remove { border: 0; background: transparent; color: var(--muted); width: 32px; height: 32px; display: grid; place-items: center; }

.preview {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px; background: var(--surface-solid); border: 1.5px dashed var(--ink); font-size: 14px; color: var(--ink-2);
}

.detail-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.detail-due { margin-top: 6px; color: var(--ink-2); }
.detail-due strong { color: var(--ink); }
.meters { display: grid; grid-template-columns: 1fr 1fr; margin-top: 16px; border: 1.5px solid var(--ink); background: var(--surface-solid); }
.meter { padding: 12px; }
.meter + .meter { border-left: 1px solid var(--line); }
.meter .lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.meter .val { font-weight: 700; margin-top: 2px; }
.pips { display: flex; gap: 3px; margin-top: 8px; }
.pips span { flex: 1; height: 6px; background: var(--sunk); }
.pips span.on { background: var(--ink); }
.why { margin-top: 12px; padding: 12px; background: var(--surface-solid); border: 1px solid var(--line); border-left: 4px solid var(--ink); }
.why p { color: var(--ink-2); font-size: 14px; margin-top: 8px; }
.detail-section { margin-top: 20px; }
.detail-section h3 { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); margin-bottom: 8px; }
.detail-section h3 span { color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.notes { white-space: pre-wrap; color: var(--ink-2); padding: 12px; background: var(--surface-solid); border: 1px solid var(--line); overflow-wrap: anywhere; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.detail-actions .wide { grid-column: 1 / -1; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--tabbar-pad) + 84px); z-index: 130;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px);
  padding: 10px 10px 10px 16px;
  background: var(--ink); color: var(--paper); font-weight: 600; font-size: 14px;
  box-shadow: 4px 4px 0 var(--accent);
  transition: opacity .18s, transform .18s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast:not(:has(button)) { padding-right: 16px; }
#toast button { border: 1.5px solid var(--paper); background: transparent; color: var(--paper); padding: 5px 12px; font-weight: 700; }

/* ---------- Completed ---------- */
.done-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.done-row .check { width: 22px; height: 22px; }
.done-row .title { font-weight: 600; overflow-wrap: anywhere; }
.done-row .sub { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.done-row .right { flex: none; text-align: right; }

/* ---------- Dashboard ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--ink); background: var(--surface); }
.stat-grid .tile { padding: 14px; border: 0; background: transparent; }
.stat-grid .tile:nth-child(even) { border-left: 1px solid var(--line); }
.stat-grid .tile:nth-child(n+3) { border-top: 1px solid var(--line); }
.stat-grid .num { font-size: 30px; }
.stat-grid .foot { font-size: 12px; color: var(--muted); margin-top: 2px; }

.chart-card { padding: 16px; margin-top: 10px; }
.chart-card h2 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.chart-card .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

.vchart { position: relative; margin-top: 18px; height: 150px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; align-items: end; padding-top: 22px; }
.vchart .grid-top { position: absolute; left: 0; right: 0; top: 22px; border-top: 1px dashed var(--line); }
.vchart .grid-top span { position: absolute; right: 0; top: -17px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.vbar { position: relative; height: 100%; border: 0; padding: 0; background: transparent; display: flex; align-items: flex-end; justify-content: center; }
.vbar .fill { width: min(28px, 70%); height: var(--h); min-height: 2px; background: var(--accent); }
.vbar.zero .fill { background: var(--line); }
.vbar .tip {
  position: absolute; bottom: calc(var(--h) + 6px); left: 50%; transform: translateX(-50%);
  font-size: 12px; font-weight: 700; color: var(--paper); background: var(--ink);
  padding: 2px 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s;
}
.vbar:hover .tip, .vbar:focus .tip, .vbar.last .tip { opacity: 1; }
.vbar:focus { outline: none; }
.vchart-axis { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; border-top: 1.5px solid var(--ink); }
.vchart-axis span { text-align: center; font-size: 11px; color: var(--muted); padding-top: 6px; }

.hbars { display: grid; gap: 12px; margin-top: 14px; }
.hbar .top { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.hbar .top .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hbar .top .val { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; }
.hbar .track { height: 10px; margin-top: 6px; }
.hbar .track.bg { background: var(--sunk); }
.hbar .track span { display: block; height: 100%; width: var(--w); min-width: 3px; background: var(--c); }

.agenda-day { margin-top: 14px; }
.agenda-date { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); padding-bottom: 4px; border-bottom: 1.5px solid var(--ink); }
.agenda-item { display: flex; align-items: center; gap: 10px; padding: 9px 2px; cursor: pointer; border-bottom: 1px solid var(--line); }
.agenda-title { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.agenda-title small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }

/* ---------- Toolbar + overdue alert ---------- */
.toolbar { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 10px; }
.toolbar select { width: auto; max-width: 42vw; }
.searchbox { position: relative; display: block; }
.searchbox .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; z-index: 1; }
.searchbox input { padding-left: 38px; }
#history-list { margin-top: 2px; }
.repeat { display: inline-flex; align-items: center; gap: 3px; color: var(--accent); font-weight: 700; margin-left: 2px; }
.badge .i { color: var(--accent); }
.repeat-scale { grid-template-columns: repeat(4, 1fr); }
.repeat-scale .opt span { font-size: 13px; }

.alert-title { display: flex; align-items: center; gap: 8px; }
.alert-title .i { color: var(--critical); }
.overdue-row {
  position: relative; display: flex; align-items: center; gap: 10px; overflow: hidden;
  padding: 12px 12px 12px 17px; background: var(--surface-solid); border: 1.5px solid var(--critical);
}
.overdue-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c, var(--critical)); }
.overdue-main { flex: 1; min-width: 0; cursor: pointer; }

/* ---------- Sharing + collaboration ---------- */
.inbox-btn { position: relative; }
.count-badge {
  position: absolute; top: -7px; right: -7px; min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center; background: var(--critical); color: #fff; font-size: 11px; font-weight: 800;
  border: 1.5px solid var(--paper);
}
.banner {
  width: 100%; display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 12px 14px; text-align: left;
  background: var(--accent); color: #fff; border: 0; box-shadow: 4px 4px 0 var(--ink);
}
.banner span { flex: 1; min-width: 0; }
.banner strong { display: block; font-size: 15px; }
.banner small { display: block; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner em { font-style: normal; font-weight: 700; border: 1.5px solid #fff; padding: 4px 10px; font-size: 13px; }
.banner:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

/* The class line at the top of Tasks: what you're in, what's next, or how long the break is. */
.nextclass {
  width: 100%; display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 11px 14px; text-align: left;
  background: var(--surface-solid); border: 1.5px solid var(--line-strong); border-left-width: 6px;
}
.nextclass:active { transform: translate(1px, 1px); }
.nc-text { flex: 1; min-width: 0; }
.nc-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nc-main { display: block; font-size: 15px; color: var(--ink); }
.nc-where { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); }
.nc-where.muted { color: var(--muted); }
.nc-main strong { font-weight: 700; }
.nc-main small { color: var(--muted); }
.nc-after { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.nc-big { flex: none; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.nextclass.now { border-left-color: var(--good); }
.nextclass.now .nc-label, .nextclass.now .nc-big { color: var(--good); }
.nextclass.soon { border-left-color: var(--critical); }
.nextclass.soon .nc-label, .nextclass.soon .nc-big { color: var(--critical); }
.nextclass.break { border-left-color: var(--accent); }
.nextclass.break .nc-label, .nextclass.break .nc-big { color: var(--accent); }
.nextclass.later { border-left-color: var(--neutral); }
.nextclass.later .nc-big { color: var(--muted); font-size: 14px; }


/* Which kinds of notification you want. */
.push-kinds { display: grid; gap: 2px; margin-top: 10px; }
.push-refused { color: var(--critical); }
.push-kinds .switch-row span { display: flex; flex-direction: column; }
.push-kinds .switch-row small { color: var(--muted); font-size: 12px; font-weight: 400; }
/* Back out of a page that isn't a tab of its own. */
.back-row {
  display: inline-flex; align-items: center; gap: 4px; margin: 0 0 12px; padding: 6px 12px 6px 6px;
  border: 1px solid var(--line); background: var(--surface-solid); color: var(--ink-2);
  font-size: 13px; font-weight: 600;
}
.back-row:hover { border-color: var(--line-strong); }
/* The Courses tab: a coloured box per course. */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.course-box {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left;
  padding: 14px; min-height: 118px; border: 1.5px solid var(--line-strong);
  background: color-mix(in srgb, var(--c) 16%, var(--surface-solid));
  border-left: 6px solid var(--c); color: var(--ink); cursor: pointer;
}
.course-box:active { transform: translate(1px, 1px); }
.course-name { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.course-grade { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.course-meta { font-size: 12px; color: var(--ink-2); }
.course-next { margin-top: auto; padding-top: 6px; font-size: 11px; color: var(--muted); }

/* Everything about one course, in its sheet. */
.course-strip { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 6px; }
.course-strip strong { display: block; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.course-strip span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.course-grades .link-row:first-child { border-top: 0; }

/* Picking how to go over a folder. */
.review-pick { display: grid; gap: 10px; margin-top: 4px; }
.review-pick .btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; }
.review-pick .btn small { font-weight: 400; color: var(--muted); font-size: 12px; }
.review-row { display: flex; flex-wrap: wrap; gap: 8px; }
.review-row.compact .btn { padding: 7px 12px; font-size: 13px; }
.review-row .n { margin-left: 4px; opacity: .6; font-variant-numeric: tabular-nums; }

/* All of them on one page, the way you'd read your own notes. */
.allnotes { display: grid; gap: 2px; }
.allnote { padding: 12px 0; border-top: 1px solid var(--line); }
.allnote:first-child { border-top: 0; }
.allnote h3 { margin: 0 0 4px; font-size: 15px; }
.allnote-body { font-size: 14px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.allnote-body.formula {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--sunk); padding: 8px 10px; font-size: 14px;
}

/* One card at a time: a white page with ruled lines, the words in the middle. */
.paper-wrap {
  min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 10px 0 24px;
}
.paper-top {
  display: flex; align-items: center; gap: 12px; width: min(680px, 100%);
  font-size: 12px; color: #a9afbf; letter-spacing: .04em; text-transform: uppercase;
}
.paper-top span:nth-child(2) { margin-left: auto; font-variant-numeric: tabular-nums; }
.paper {
  width: min(680px, 100%); aspect-ratio: 3 / 2; max-height: 62vh; padding: 28px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 0; cursor: pointer; color: #111;
  background-color: #fff;
  background-image: repeating-linear-gradient(#fff 0 30px, #111 30px 32px);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, .55);
}
.paper:active { transform: translate(2px, 2px); box-shadow: 6px 6px 0 rgba(0, 0, 0, .55); }
.paper-text {
  font-size: clamp(20px, 3.4vw, 34px); font-weight: 700; line-height: 32px; letter-spacing: -0.01em;
  background: #fff; box-shadow: 0 0 0 10px #fff; overflow-wrap: anywhere; white-space: pre-wrap;
}
.paper.turned .paper-text { font-weight: 500; font-size: clamp(17px, 2.6vw, 26px); }
.paper.formula.turned .paper-text {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: clamp(16px, 2.4vw, 24px);
}
.paper-controls { display: flex; align-items: center; gap: 10px; width: min(680px, 100%); }
.paper-controls .room-btn:disabled { opacity: .35; cursor: default; }
.paper-controls .wide { flex: 1; }

/* A photo from a room, full size, on top of everything. */
#lightbox {
  position: fixed; inset: 0; z-index: 150; background: rgba(8, 8, 9, .96);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: max(14px, env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px));
}
#lightbox img { max-width: 100%; max-height: calc(100% - 60px); object-fit: contain; }
.lightbox-bar {
  display: flex; align-items: center; gap: 10px; width: 100%; max-width: 900px;
  color: #f3f1ea; font-size: 13px;
}
.lightbox-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox-bar .room-btn { flex: none; text-decoration: none; padding: 7px 14px; }
body.lit { overflow: hidden; }
.share-shot { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }

/* A course's folder of things to memorize. */
.memo-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.memo-top button { margin-left: auto; }
.memo-form { margin-bottom: 16px; }
.memo-form textarea { resize: vertical; }
.memo-kind { align-self: start; }
.memo-list { list-style: none; margin: 0; padding: 0; }
.memo-list.tight { margin-top: 6px; }
.memo {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.memo:first-child { border-top: 0; }
.memo-main { min-width: 0; flex: 1; }
.memo-front { font-size: 14px; font-weight: 600; }
.memo-back { margin-top: 2px; font-size: 13px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.memo-back img, .allnote-body img { max-width: 100%; display: block; margin: 6px 0; border: 1px solid var(--line-strong); }
.memo-back.formula {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px;
  background: var(--sunk); padding: 4px 7px; display: inline-block;
}
.memo.is-solid .memo-front { color: var(--muted); }
.memo-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.memo-tools { display: flex; gap: 10px; align-items: center; }
.memo-on { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.memo-on input { width: 14px; height: 14px; }
.memo.small { padding: 7px 0; }
.link-btn.danger { color: var(--critical); }
.memo-link {
  display: flex; align-items: center; gap: 6px; width: 100%; margin-top: 10px; padding: 7px 10px;
  border: 1px solid var(--line); background: var(--surface-solid); color: var(--ink-2);
  font-size: 13px; font-weight: 600; text-align: left;
}
.memo-link:hover { border-color: var(--line-strong); }

/* Drilling a card: prompt, then the answer, then how it went. */
.drill .blurt-back.formula {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 17px; color: #f3f1ea;
}
.drill-hint { margin: 18px 0 0; font-size: 14px; color: #a9afbf; }
.drill .blurt-actions { margin-top: 26px; }

/* Two halves of the inbox: your people, and your course pages. */
.inbox-tabs { display: flex; gap: 0; margin: 0 0 14px; border-bottom: 1.5px solid var(--line); }
.inbox-tabs button {
  flex: 1; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted);
  padding: 8px 10px 10px; font-size: 13px; font-weight: 700; letter-spacing: .04em; cursor: pointer;
}
.inbox-tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.inbox-tabs span {
  display: inline-block; margin-left: 5px; padding: 0 6px; background: var(--accent);
  color: #fff; font-size: 11px; letter-spacing: 0;
}
.inbox-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
/* The three steps for getting a calendar link out of Moodle. */
.steps-list { margin: 0 0 14px; padding-left: 20px; color: var(--ink-2); font-size: 14px; }
.steps-list li { margin: 3px 0; }
.steps-list strong { font-weight: 700; }
/* Who you're comparing with, above the grid. */
.free-line { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.free-label {
  flex: none; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.free-line .chips { margin: 0; }
.ghost-chip { border-style: dashed; color: var(--muted); }
.free-waiting { margin: 6px 0 0; }

/* The hours everyone picked is free, drawn behind the classes. */
.free-slot {
  position: absolute; z-index: 0; pointer-events: none;
  background: repeating-linear-gradient(135deg, rgba(12, 163, 12, .13) 0 6px, rgba(12, 163, 12, .05) 6px 12px);
  border: 1.5px dashed var(--good);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.free-slot span {
  font-size: 10px; font-weight: 700; letter-spacing: .02em; color: var(--good);
  background: var(--surface-solid); padding: 1px 4px; white-space: nowrap;
}


/* ---------- The study room ---------- */
/* Its own dark world on top of the app: sharp panels, one job each. */

body.in-room { overflow: hidden; }
body.in-room #app, body.in-room #bg, body.in-room #bg-dim { display: none; }

#room-root {
  position: fixed; inset: 0; z-index: 90; overflow: auto;
  background: #23262d;
  background-image: linear-gradient(#383d49 1px, transparent 1px), linear-gradient(90deg, #383d49 1px, transparent 1px);
  background-size: 44px 44px;
  color: #f3f1ea;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  -webkit-font-smoothing: antialiased;
}

.room-grid {
  display: grid; gap: 14px; max-width: 1180px; margin: 0 auto;
  grid-template-columns: 1fr;
}
@media (min-width: 860px) {
  .room-grid {
    grid-template-columns: 1.15fr 1fr 1fr;
    grid-template-areas:
      "clock task next"
      "clock steps steps"
      "notes steps steps"
      "notes distract distract";
  }
  .room-clock-card { grid-area: clock; }
  .room-task-card { grid-area: task; }
  .voice-card { grid-area: next; }
  .room-steps-card { grid-area: steps; }
  .room-notes-card { grid-area: notes; }
  .room-distract-card { grid-area: distract; }
}

.room-card {
  background: #303540; border: 1.5px solid #484f5e; padding: 16px;
  display: flex; flex-direction: column; min-width: 0;
}
.room-label {
  margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: #a9afbf;
}

.room-clock-card { align-items: center; justify-content: center; text-align: center; padding: 24px 16px; }
.room-clock-card.resting { border-color: var(--good); }
.room-clock {
  margin: 0; font-size: clamp(64px, 12vw, 132px); font-weight: 800; line-height: .95;
  font-variant-numeric: tabular-nums; letter-spacing: -0.04em;
}
.room-clock-card.resting .room-clock { color: var(--good); }
.room-clock-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
.room-modes { display: inline-flex; margin-top: 14px; border: 1.5px solid #596173; }
.room-modes button {
  border: 0; background: transparent; color: #d0d4de; padding: 6px 12px; font-size: 13px; font-weight: 600;
}
.room-modes button + button { border-left: 1.5px solid #596173; }
.room-modes button.on { background: #f3f1ea; color: #23262d; }
.room-total { margin: 14px 0 0; font-size: 13px; color: #a9afbf; font-variant-numeric: tabular-nums; }

.room-btn {
  border: 1.5px solid #6a7387; background: transparent; color: #f3f1ea;
  padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.room-btn:hover { border-color: #f3f1ea; }
.room-btn.primary { background: #f3f1ea; color: #23262d; border-color: #f3f1ea; }
.room-btn.wide { width: 100%; margin-top: 18px; padding: 12px; }

.room-select, .room-goal input, .room-distract input, #room-notes {
  width: 100%; background: #23262d; border: 1.5px solid #596173; color: #f3f1ea;
  padding: 9px 10px; font: inherit; font-size: 14px;
}
.room-select:focus, .room-goal input:focus, .room-distract input:focus, #room-notes:focus {
  outline: none; border-color: #f3f1ea;
}
.room-task-meta { margin: 10px 0 0; font-size: 13px; color: #d0d4de; }
.room-goal { display: block; margin-top: 14px; }
.room-goal .room-label { margin-bottom: 6px; }
.room-bar { height: 8px; background: #3f4552; }
.room-bar span { display: block; height: 100%; width: var(--p); background: var(--good); }

.room-empty { margin: 0; font-size: 13px; color: #a9afbf; }

.voice-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.voice-top .room-label { margin: 0; }
.voice-roster { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.voice-person {
  display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: #d0d4de;
  padding: 5px 8px; border: 1.5px solid #484f5e;
}
.voice-person .i { flex: none; color: #6a7387; }
.voice-person.talking { border-color: var(--good); color: #f3f1ea; }
.voice-person.talking .i { color: var(--good); }
.voice-ptt {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; width: 100%;
  padding: 16px; border: 2px solid #6a7387; background: #23262d; color: #f3f1ea;
  font-size: 15px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
  touch-action: none; -webkit-user-select: none; user-select: none; cursor: pointer;
}
.voice-ptt .i { width: 20px; height: 20px; }
.voice-ptt.on { background: var(--good); border-color: var(--good); color: #0e1a14; }

.voice-mode { display: inline-flex; margin-top: 12px; border: 1.5px solid #596173; align-self: flex-start; }
.voice-mode button { border: 0; background: transparent; color: #d0d4de; padding: 6px 12px; font-size: 12.5px; font-weight: 700; }
.voice-mode button + button { border-left: 1.5px solid #596173; }
.voice-mode button.on { background: #f3f1ea; color: #23262d; }

.voice-status { color: #a9afbf; font-weight: 600; margin-left: auto; padding-left: 8px; white-space: nowrap; }

.voice-device { margin-top: 14px; padding-top: 12px; border-top: 1px solid #3f4552; }
.voice-device-label { margin: 0 0 8px; font-size: 12.5px; color: #a9afbf; display: flex; align-items: center; gap: 6px; }
.voice-device-label .i { flex: none; color: #6a7387; }
.voice-meter-track { height: 6px; background: #23262d; border: 1px solid #484f5e; overflow: hidden; }
.voice-meter-fill { height: 100%; width: 0%; background: var(--good); transition: width .08s linear; }
.voice-device-select {
  width: 100%; margin-top: 10px; background: #23262d; border: 1.5px solid #596173; color: #f3f1ea;
  padding: 8px 9px; font: inherit; font-size: 13px;
}

.voice-key { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: #a9afbf; }
.voice-key b { color: #f3f1ea; }
.voice-key em { color: var(--good); font-style: normal; }
.voice-key .room-btn { padding: 5px 10px; font-size: 12px; }

#voice-talking-badge {
  position: fixed; left: 12px; z-index: 96; display: flex; flex-direction: column; gap: 6px;
  pointer-events: none;
}
#voice-talking-badge span {
  display: flex; align-items: center; gap: 6px; background: #23262d; border: 1.5px solid var(--good);
  color: #f3f1ea; font-size: 12.5px; font-weight: 700; padding: 6px 10px; box-shadow: 3px 3px 0 #141414;
}
#voice-talking-badge .i { color: var(--good); flex: none; }

.music-popup .icon-btn, .dk-albums .icon-btn { border: 1.5px solid #596173; background: #303540; color: #f3f1ea; box-shadow: none; }
.music-popup .icon-btn:active, .dk-albums .icon-btn:active { background: #3f4552; transform: none; }

.music-album-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.music-album-head strong { flex: 1; min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----- the mini player, inline in the desk header, between the title and the clock ----- */
#music-mini-inline:empty { display: none; }
#music-mini-inline {
  display: flex; align-items: center; gap: 8px; flex: 1 1 260px; min-width: 220px;
  background: #3a404c; border: 2px solid #181a1f; box-shadow: 2px 2px 0 #181a1f; padding: 6px 9px;
}
#music-mini-inline img, #music-mini-inline .music-mini-art { width: 28px; height: 28px; flex: none; background: var(--good); border: 2px solid #181a1f; object-fit: cover; }
.music-mini-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.music-mini-title { font-size: 12.5px; font-weight: 700; color: #f3f1ea; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#music-mini-inline .icon-btn {
  flex: none; width: 27px; height: 27px; padding: 0; display: grid; place-items: center;
  border: 2px solid #181a1f; background: #3a404c; color: #f3f1ea; box-shadow: 2px 2px 0 #181a1f;
}
#music-mini-inline .icon-btn:active { transform: translate(2px, 2px); box-shadow: none; }
#music-mini-inline .icon-btn[disabled] { opacity: .35; box-shadow: none; }
#music-seek, #music-volume {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px; background: #181a1f; outline: none;
}
#music-volume { width: 56px; flex: none; }
#music-seek::-webkit-slider-thumb, #music-volume::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 0; border: 2px solid #181a1f; background: var(--good); cursor: pointer;
}
#music-seek::-moz-range-thumb, #music-volume::-moz-range-thumb { width: 12px; height: 12px; border-radius: 0; background: var(--good); border: 2px solid #181a1f; cursor: pointer; }

/* ----- the "Focus sounds" button, bottom-left, and its popup ----- */
#music-listen-btn {
  position: fixed; left: 12px; bottom: 12px; z-index: 96;
  display: flex; align-items: center; gap: 8px;
  background: var(--good); color: #0e1a14; border: 1.5px solid #141414; box-shadow: 3px 3px 0 #141414;
  padding: 10px 16px; font-weight: 800; font-size: 13.5px;
}
#music-listen-btn:active { transform: translate(2px, 2px); box-shadow: none; }

#music-popup-root { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.music-popup-backdrop { position: absolute; inset: 0; background: rgba(10, 11, 14, .65); }
.music-popup {
  position: relative; width: min(440px, 100%); max-height: 82vh; overflow: auto;
  background: #23262d; border: 1.5px solid #596173; box-shadow: 6px 6px 0 #141414;
  color: #f3f1ea; padding: 18px;
}

.room-list { list-style: none; margin: 0; padding: 0; overflow: auto; max-height: 340px; }
.room-step, .room-topic { border-top: 1px solid #3f4552; padding: 9px 0; }
.room-step:first-child, .room-topic:first-child { border-top: 0; }
.room-step label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.room-step.is-done span { color: #7a766c; text-decoration: line-through; }
.room-topic { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.room-topic-text { font-size: 14px; min-width: 0; }
.room-topic.is-solid .room-topic-text { color: #7a766c; }

.rate { display: inline-flex; flex: none; border: 1.5px solid #596173; }
.rate button {
  border: 0; background: transparent; color: #a9afbf; padding: 4px 9px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; cursor: pointer;
}
.rate button + button { border-left: 1.5px solid #596173; }
.rate button.on { color: #23262d; }
.rate button[data-level="shaky"].on { background: var(--serious); }
.rate button[data-level="okay"].on { background: var(--warning); }
.rate button[data-level="solid"].on { background: var(--good); color: #fff; }

#room-notes { flex: 1; min-height: 160px; resize: vertical; line-height: 1.5; }
.room-distract { display: flex; gap: 8px; }
.room-distract input { flex: 1; }
.room-parked { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; color: #d0d4de; }
.room-parked li { padding: 4px 0; border-top: 1px solid #3f4552; }

.room-exit {
  display: block; margin: 16px auto 0; border: 1.5px solid #6a7387; background: transparent;
  color: #d0d4de; padding: 10px 22px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.room-exit:hover { border-color: var(--critical); color: var(--critical); }

/* The shared room: a stream down one side of the grid. */
@media (min-width: 860px) {
  .room-grid.with-share {
    grid-template-columns: 1.15fr 1fr 1fr;
    grid-template-areas:
      "clock task next"
      "clock steps share"
      "notes steps share"
      "distract distract share";
  }
  .room-share-card { grid-area: share; min-height: 0; }
}
.room-share-card { display: flex; flex-direction: column; }
.share-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.share-topic { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
.share-who { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.share-who .who {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px;
  border: 1px solid #596173; color: #a9afbf; font-size: 11px; font-weight: 600;
}
.share-who .who::before { content: ""; width: 6px; height: 6px; background: #6a7387; border-radius: 50%; }
.share-who .who.here { color: var(--good); border-color: var(--good); }
.share-who .who.here::before { background: var(--good); }

.share-stream {
  flex: 1; min-height: 180px; max-height: 46vh; overflow-y: auto;
  margin: 12px 0; padding-right: 4px; display: flex; flex-direction: column; gap: 12px;
}
.share-post { border-left: 2px solid #484f5e; padding-left: 10px; }
.share-post.mine { border-left-color: var(--accent); }
.share-head-row { display: flex; align-items: center; gap: 8px; }
.share-from { font-size: 12px; font-weight: 700; color: #d0d4de; }
.share-post.mine .share-from { color: var(--accent); }
.share-at { font-size: 11px; color: #6d6a5f; font-variant-numeric: tabular-nums; }
.share-drop {
  margin-left: auto; border: 0; background: transparent; color: #6d6a5f; cursor: pointer;
  padding: 2px; line-height: 0; opacity: 0;
}
.share-post:hover .share-drop, .share-drop:focus { opacity: 1; }
.share-drop:hover { color: var(--critical); }
.share-said { margin: 3px 0 0; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.share-shot { display: block; margin-top: 6px; }
.share-shot img { display: block; width: 100%; max-height: 260px; object-fit: cover; border: 1px solid #484f5e; }
.share-file {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 10px;
  border: 1px solid #596173; color: #f3f1ea; font-size: 13px; text-decoration: none;
}
.share-file:hover { border-color: #f3f1ea; }

.share-compose { display: flex; gap: 8px; }
.share-compose input {
  flex: 1; min-width: 0; background: #23262d; border: 1.5px solid #596173; color: #f3f1ea;
  padding: 9px 10px; font: inherit; font-size: 14px;
}
.share-compose input:focus { outline: none; border-color: #f3f1ea; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.share-actions .room-btn { padding: 7px 12px; font-size: 13px; }
.room-btn.danger { border-color: var(--critical); color: var(--critical); }
.room-btn.danger:hover { background: var(--critical); color: #fff; }
.share-note { margin: 10px 0 0; font-size: 12px; color: #6d6a5f; }

.room-bottom { display: flex; justify-content: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.room-bottom .room-exit { margin: 0; }

/* What you did, kept on screen until you say you've read it. */
.room-done { max-width: 560px; margin: 6vh auto 0; background: #303540; border: 1.5px solid #484f5e; padding: 26px; }
.room-done h2 { margin: 0 0 18px; font-size: 26px; letter-spacing: -0.02em; }
.room-done-figures { display: flex; gap: 26px; flex-wrap: wrap; }
.room-done-figures strong { display: block; font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.room-done-figures span { font-size: 12px; color: #a9afbf; }
.room-done-task { margin: 16px 0 0; font-size: 15px; color: #d0d4de; }
.room-done-goal, .room-done-notes { margin-top: 20px; border-top: 1px solid #3f4552; padding-top: 16px; }
.room-done-goal p, .room-done-notes ul { margin: 0; font-size: 15px; }
.room-done-notes pre { margin: 0; white-space: pre-wrap; font: inherit; font-size: 14px; color: #d0d4de; }
.room-done-notes ul { padding-left: 18px; color: #d0d4de; font-size: 14px; }
.room-done-notes .room-btn { margin-top: 12px; }
.room-met { display: inline-flex; margin-top: 12px; border: 1.5px solid #596173; }
.room-met button {
  border: 0; background: transparent; color: #d0d4de; padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.room-met button + button { border-left: 1.5px solid #596173; }
.room-met button.on { background: #f3f1ea; color: #23262d; }

/* Two lists in one panel: this task, or everything due today. */
.room-tabs { display: flex; gap: 0; margin-bottom: 12px; border-bottom: 1.5px solid #484f5e; }
.room-tabs button {
  border: 0; border-bottom: 2px solid transparent; background: transparent; color: #a9afbf;
  padding: 6px 12px 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; cursor: pointer;
}
.room-tabs button.on { color: #f3f1ea; border-bottom-color: #f3f1ea; }
.room-tabs span {
  display: inline-block; margin-left: 6px; padding: 0 6px; background: var(--accent);
  color: #fff; font-size: 11px; letter-spacing: 0;
}
.room-topic.review { align-items: flex-start; }
.room-topic-text small { display: block; margin-top: 2px; font-size: 11px; color: #a9afbf; letter-spacing: 0; text-transform: none; }
.room-row-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.room-blurt-btn {
  border: 1.5px solid #6a7387; background: transparent; color: #d0d4de;
  padding: 4px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; cursor: pointer;
}
.room-blurt-btn:hover { border-color: #f3f1ea; color: #f3f1ea; }

/* Two minutes, from memory, nothing else on screen. */
.blurt { max-width: 720px; margin: 5vh auto 0; }
.blurt-topic { margin: 4px 0 0; font-size: clamp(26px, 4vw, 40px); letter-spacing: -0.02em; }
.blurt-clock {
  margin: 10px 0 14px; font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em; color: var(--warning);
}
#blurt-text {
  width: 100%; min-height: 40vh; background: #303540; border: 1.5px solid #596173; color: #f3f1ea;
  padding: 14px; font: inherit; font-size: 15px; line-height: 1.6; resize: vertical;
}
#blurt-text:focus { outline: none; border-color: #f3f1ea; }
.blurt-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.blurt-back {
  margin: 14px 0 0; padding: 14px; background: #303540; border: 1.5px solid #484f5e;
  white-space: pre-wrap; font: inherit; font-size: 15px; line-height: 1.6; color: #d0d4de;
  max-height: 40vh; overflow: auto;
}
.blurt-ask { margin: 22px 0 0; font-size: 17px; font-weight: 600; }
.blurt-rate { margin-top: 10px; }
.blurt-rate button { padding: 9px 22px; }
.blurt-note { margin: 14px 0 0; font-size: 13px; color: #a9afbf; }

/* The way in, under the task list. */

/* Topic ratings on the task sheet, in the app's own light palette. */
.item.topic { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.item.topic .text { flex: 1; min-width: 0; }
.item.topic .rate { border-color: var(--line); }
.item.topic .rate button { color: var(--muted); }
.item.topic .rate button + button { border-left-color: var(--line); }
.item.topic.is-solid .text { color: var(--muted); }

.with { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--accent); }
/* inline-block keeps the done-item strikethrough off the "Done by" line */
.by { display: inline-block; width: 100%; font-size: 12px; font-weight: 600; color: var(--accent); margin-top: 1px; }
.by.me { color: var(--muted); }

.person-list { border: 1.5px solid var(--ink); background: var(--surface-solid); }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.person + .person { border-top: 1px solid var(--line); }
.avatar { width: 30px; height: 30px; flex: none; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-weight: 800; font-size: 14px; }
.pname { flex: 1; font-weight: 600; }
.pname em { font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-left: 4px; }

.link-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px;
  background: var(--surface-solid); border: 1px solid var(--line); border-left: 4px solid var(--accent);
}
.link-row + .link-row, .person-list + .link-row { margin-top: 8px; }
.link-row.pending { border-left-color: var(--neutral); }
.link-main { flex: 1; min-width: 60%; }
.link-main strong { display: block; overflow-wrap: anywhere; }
.link-main small { display: block; color: var(--muted); font-size: 12px; }
.link-row > p, .their-progress, .link-row .switch-row { flex-basis: 100%; }
.their-progress .progress { margin-top: 0; }
.their-progress .progress-label { display: flex; align-items: center; gap: 4px; }
.their-items summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); margin-top: 6px; }
.their-items ul, .req-items { list-style: none; margin: 6px 0 0; padding: 0; }
.their-items li, .req-items li { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
.their-items li.done, .req-items li.done { color: var(--muted); }
.their-items li .i, .req-items li .i { color: var(--good); }
.box { width: 14px; height: 14px; border: 1.5px solid var(--ink); flex: none; }

.switch-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 12px; border: 1.5px solid var(--ink); background: var(--surface-solid); }
.switch-row.compact { padding: 8px 0 0; border: 0; background: transparent; align-items: center; font-size: 14px; font-weight: 600; }
.switch-row input {
  -webkit-appearance: none; appearance: none; flex: none; margin: 1px 0 0; width: 40px; height: 22px;
  border: 1.5px solid var(--ink); background: var(--sunk); position: relative; cursor: pointer;
}
.switch-row input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; background: var(--ink); transition: transform .15s; }
.switch-row input:checked { background: var(--accent); border-color: var(--accent); }
.switch-row input:checked::after { background: #fff; transform: translateX(18px); }
.switch-row input:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.switch-row strong { display: block; }
.switch-row small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

.modes { display: grid; gap: 8px; }
.mode { position: relative; display: block; cursor: pointer; }
.mode input { position: absolute; opacity: 0; pointer-events: none; }
.mode > span { display: block; padding: 12px 14px; border: 1.5px solid var(--line); background: var(--surface-solid); }
.mode strong { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.mode small { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }
.mode input:checked + span { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--accent); }
.mode input:focus-visible + span { outline: 3px solid var(--accent-soft); }
.mode.disabled { cursor: not-allowed; opacity: .6; }
.mode .blocked { color: var(--critical); font-weight: 600; }

.requests { display: grid; gap: 12px; }
.request { padding: 14px; background: var(--surface-solid); border: 1.5px solid var(--ink); box-shadow: 4px 4px 0 var(--accent); }
.req-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.req-line { font-size: 14px; color: var(--ink-2); }
.req-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin: 2px 0 4px; overflow-wrap: anywhere; }
.request .req-items { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 4px; }
.request .notes { margin-top: 8px; }
.request > p.small { display: flex; align-items: center; gap: 5px; margin-top: 10px; }
.request form { margin-top: 12px; padding-top: 12px; border-top: 1.5px solid var(--ink); gap: 10px; }

/* ---------- Schedule builder ---------- */
.section-list { display: grid; gap: 8px; margin-top: 10px; }
.section-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
  background: var(--surface-solid); border: 1px solid var(--line); border-left: 4px solid var(--line);
}
.section-row.chosen { border-left-color: var(--good); background: #f2faf2; }
.section-row.clashing { border-left-color: var(--critical); }
.section-main { flex: 1; min-width: 0; }
.section-top { display: flex; align-items: baseline; gap: 6px; font-size: 15px; }
.section-top span { font-weight: 700; color: var(--accent); }
.section-top small { color: var(--muted); font-size: 11px; margin-left: auto; white-space: nowrap; }
.section-name { font-size: 14px; font-weight: 600; margin-top: 1px; overflow-wrap: anywhere; }
.section-when { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-top: 2px; }
.section-who { font-size: 12px; color: var(--muted); }
.seats-none { color: var(--critical); font-weight: 600; }
.section-clash { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--critical); margin-top: 3px; }
.section-clash .i { color: var(--critical); }
.section-add { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 1.5px solid var(--ink); }
.section-row.chosen .section-add { background: var(--good); border-color: var(--good); color: #fff; }

.search-line { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-top: 10px; }
.search-line .seg { flex: none; }
.search-line .seg button { padding: 10px 10px; font-size: 12px; }
.preview-hint { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-top: 10px; }
.preview-note { margin-top: 10px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-size: 13px; font-weight: 700; text-decoration: underline; }

.week-wrap { overflow-x: auto; margin-top: 10px; -webkit-overflow-scrolling: touch; }
.week {
  display: grid; grid-template-columns: 46px repeat(auto-fit, minmax(0, 1fr));
  gap: 3px; min-width: 330px;
  border: 1.5px solid var(--ink); background: var(--surface-solid); padding: 8px 8px 10px;
}
.week-hours { padding-top: 26px; }
.week-hours .hour { height: var(--row-h); position: relative; }
.week-hours span { position: absolute; top: -7px; right: 5px; font-size: 10px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.week-day { min-width: 62px; }
.week-day-name {
  height: 26px; display: grid; place-items: center; margin-bottom: 0;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink); background: var(--sunk);
}
.week-col { position: relative; height: calc(var(--rows) * var(--row-h)); background: var(--paper); }
.week-line { height: var(--row-h); border-top: 1px solid var(--line); }
.week-line:nth-child(odd) { background: rgba(0,0,0,.015); }

.slot {
  position: absolute; overflow: hidden; cursor: pointer; padding: 3px 5px; line-height: 1.2;
  background: color-mix(in srgb, var(--c) 20%, #fff); border-left: 4px solid var(--c);
}
.slot strong { display: block; font-size: 11.5px; font-weight: 800; line-height: 1.1; }
.slot small { display: block; font-size: 10px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .slot-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.slot.narrow { padding: 2px 3px; }
.slot.narrow strong { font-size: 9.5px; letter-spacing: -0.02em; }
.slot.narrow small { font-size: 9px; }
.slot.clash {
  background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--critical) 16%, #fff) 0 6px, #fff 6px 12px);
  border-left-color: var(--critical); outline: 2px solid var(--critical); outline-offset: -2px;
}
.slot.clash strong { color: var(--critical); }
.week.previewing .slot { opacity: .3; }

/* Sections from a search, flashing until you pick one */
.ghost {
  position: absolute; overflow: hidden; cursor: pointer; padding: 3px 5px; line-height: 1.2; z-index: 2;
  background: color-mix(in srgb, var(--accent) 16%, #fff);
  border: 2px dashed var(--accent); color: var(--accent);
  animation: ghost-pulse 1.1s ease-in-out infinite;
}
.ghost strong { display: block; font-size: 10px; font-weight: 800; line-height: 1.05; }
.ghost small { display: block; font-size: 9.5px; color: var(--ink-2); }
.ghost:active { transform: scale(.97); }
.ghost-clash { background: color-mix(in srgb, var(--critical) 14%, #fff); border-color: var(--critical); color: var(--critical); }
@keyframes ghost-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .ghost { animation: none; } }

/* The picker popup */
.picker-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.picker-section { color: var(--accent); }
.picker-facts { display: grid; gap: 1px; background: var(--line); border: 1.5px solid var(--ink); margin-top: 14px; }
.picker-facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; background: var(--surface-solid); }
.picker-facts span { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.picker-facts strong { text-align: right; font-size: 14px; overflow-wrap: anywhere; }

/* ---------- Printable schedule ---------- */
/* The poster carries its own stylesheet (POSTER_CSS in app.js) so the preview and the printed
   page are identical. This only frames it in the sheet: white, with room to scroll sideways. */
.pv-frame { margin-top: 12px; background: #fff; border: 1.5px solid var(--line-strong); padding: 10px 10px 4px 0;
  overflow-x: auto; }
.pv-frame .pv-week { min-width: 560px; }

.poster-legend { display: grid; gap: 6px; }
.legend-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.legend-row input[type=color] {
  -webkit-appearance: none; appearance: none; flex: none; width: 38px; height: 34px; padding: 0;
  border: 1.5px solid var(--ink); background: none;
}
.legend-row input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.legend-row input[type=color]::-webkit-color-swatch { border: 0; }
.legend-row span { min-width: 0; }
.legend-row strong { display: block; font-size: 14px; }
.legend-row small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Grades ---------- */
.grade-card { position: relative; padding: 14px 14px 14px 18px; cursor: pointer; overflow: hidden; }
.grade-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c, var(--neutral)); }
.grade-head { display: flex; align-items: center; gap: 8px; }
.grade-head h2 { flex: 1; font-size: 16px; font-weight: 700; }
.grade-head .i { color: var(--muted); }
.grade-big { display: flex; align-items: baseline; gap: 8px; font-size: 32px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.grade-big span { font-size: 17px; font-weight: 700; color: var(--accent); letter-spacing: 0; }
.grade-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.grade-none { font-size: 14px; color: var(--muted); margin-top: 6px; }

.grade-row { display: grid; grid-template-columns: 1fr 58px 76px 34px; gap: 6px; align-items: center; }
.grade-row + .grade-row { margin-top: 6px; }
.grade-row input { min-height: 42px; padding: 8px 10px; }
.grade-row input[name=weight], .grade-row input[name=grade] { text-align: center; }
.grade-summary { padding: 12px; background: var(--surface-solid); border: 1.5px solid var(--ink); }
.grade-targets { width: 100%; border-collapse: collapse; font-size: 14px; }
.grade-targets th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-bottom: 4px; }
.grade-targets td { padding: 7px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.grade-targets td:first-child { font-weight: 800; width: 3.5em; }
.grade-targets td:last-child { text-align: right; color: var(--muted); }
.grade-targets tr.secured td { color: var(--good); }
.grade-targets tr.gone td { color: var(--muted); text-decoration: line-through; }

/* ---------- Grade weight + step ownership ---------- */
.weight-chip {
  display: inline-flex; align-items: center; padding: 1px 5px; margin-left: 2px;
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent);
}
.by.late { color: var(--critical); }
.person .pname small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.person .pname small.overdue-note { color: var(--critical); font-weight: 600; }
.person .btn.sm { flex: none; }
.item .remove .i { color: var(--muted); }
.request.nudge { box-shadow: 4px 4px 0 var(--warning); }

/* ---------- Offline + sync ---------- */
.sync-bar {
  display: flex; align-items: center; gap: 8px; margin: -4px 0 12px; padding: 9px 12px;
  background: var(--surface-solid); border: 1.5px solid var(--ink); font-size: 13px; color: var(--ink-2);
}
.sync-bar .i { flex: none; color: var(--accent); }
.sync-bar.offline { background: #fff4d6; border-color: var(--warning); border-left: 5px solid var(--warning); }
.sync-bar.offline .i { color: var(--ink); }
.pending-chip {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 2px; padding: 1px 5px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink); background: #fff4d6; border: 1px solid var(--warning);
}

/* ---------- Settings ---------- */
.settings-card { padding: 16px; margin-top: 10px; }
.settings-card h2 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.settings-card > p { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.bg-setup { display: grid; grid-template-columns: minmax(0, 132px) minmax(0, 1fr); gap: 12px; align-items: start; }
.bg-controls { display: grid; gap: 8px; }
.bg-controls .field { margin-top: 2px; }
.fit-seg { display: flex; width: 100%; }
.fit-seg button { flex: 1; padding: 8px 4px; }
.phone-preview {
  position: relative; aspect-ratio: 9 / 19.5; max-width: 100%; overflow: hidden;
  border: 2px solid var(--ink); border-top-width: 10px; border-bottom-width: 10px;
  background: var(--paper); display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; padding: 6px;
}
.phone-img { position: absolute; inset: 0; background: center / var(--bg-size, contain) no-repeat; }
.phone-dim { position: absolute; inset: 0; background: rgba(242, 240, 233, var(--bg-dim)); }
.slider { display: block; margin-top: 14px; }
input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; }
.course-row { display: flex; align-items: center; gap: 8px; }
.course-row + .course-row { margin-top: 8px; }
.course-row input[type=color] {
  -webkit-appearance: none; appearance: none; flex: none; width: 44px; height: 44px; padding: 0;
  border: 1.5px solid var(--ink); background: none; overflow: hidden;
}
.course-row input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.course-row input[type=color]::-webkit-color-swatch { border: 0; }
.course-row .icon-btn { width: 44px; height: 44px; }
details.guide { border-top: 1px solid var(--line); padding: 12px 0; }
details.guide:first-of-type { border-top: 0; padding-top: 4px; }
details.guide summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; }
details.guide summary::-webkit-details-marker { display: none; }
details.guide summary::after { content: "+"; margin-left: auto; font-size: 20px; line-height: 1; font-weight: 400; }
details.guide[open] summary::after { content: "–"; }
details.guide ol { margin: 10px 0 0; padding-left: 22px; color: var(--ink-2); }
details.guide li + li { margin-top: 6px; }
details.guide p { color: var(--ink-2); margin-top: 8px; font-size: 14px; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
code { background: var(--sunk); padding: 1px 5px; font-size: 13px; overflow-wrap: anywhere; }
pre {
  margin: 10px 0 0; padding: 12px; max-height: 220px; overflow: auto; font-size: 11.5px; line-height: 1.45;
  background: var(--ink); color: #e6e3d8;
}
.copy-line { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.copy-line code { flex: 1; padding: 10px; }
.callout { margin-top: 10px; padding: 10px 12px; background: #fff4d6; border: 1px solid var(--warning); border-left: 4px solid var(--warning); color: var(--ink-2); font-size: 13px; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100dvh - var(--safe-top) - 44px); display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 400px; padding: 24px 20px; border: 2px solid var(--ink); background: var(--surface-solid); box-shadow: 6px 6px 0 var(--ink); }
.brand { text-align: left; margin-bottom: 20px; }
.brand img { display: block; margin: 0 0 14px; }
.brand h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.legal-note { margin-top: 10px; text-align: center; }
.legal-links { margin-top: 18px; text-align: center; }
.legal-note a, .legal-links a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.brand-logo { display: block; height: 52px; width: auto; max-width: 100%; }
.brand p { color: var(--muted); margin-top: 6px; }
.auth-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.auth-sub { font-size: 14px; margin: 4px 0 16px; }
.two-even { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0 12px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.auth-back { margin-top: 10px; border-color: var(--line); }
.auth-done { text-align: left; margin-bottom: 16px; }
.done-mark { display: inline-grid; place-items: center; width: 48px; height: 48px; background: var(--good); color: #fff; margin-bottom: 12px; }
.inbox-section + .requests, .inbox-section + h3 { margin-top: 18px; }
.request.access { box-shadow: 4px 4px 0 var(--ink); }
.request.access .detail-actions { margin-top: 12px; }

@media (min-width: 700px) {
  .type-grid { grid-template-columns: repeat(9, 1fr); }
  .sheet { bottom: 24px; border: 2px solid var(--ink); border-top-width: 3px; max-height: calc(100dvh - 48px); box-shadow: 8px 8px 0 var(--ink); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* "Where are you?" — a pin stuck to each friend chip */
.chip-pair { display: inline-flex; }
.chip-pair > .chip-btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.chip-pair > .where-btn { border-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; padding-left: 8px; padding-right: 8px; }
.where-chips { margin: 0; flex-wrap: wrap; overflow: visible; padding: 0; }

/* ---------- Planner ---------- */
.nextclass.planner-row { border-left-color: var(--accent); }
.nextclass.planner-row.is-behind { border-left-color: var(--critical); }
.nextclass.planner-row.is-behind .nc-label, .nextclass.planner-row.is-behind .nc-big { color: var(--critical); }

.planner-status {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 14px;
  border: 1.5px solid var(--good); background: var(--surface-solid); color: var(--good);
}
.planner-status.is-behind { border-color: var(--critical); color: var(--critical); }
.planner-status strong { color: inherit; }

.planner-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 16px; }
.planner-day {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px;
  border: 1.5px solid var(--line); background: var(--surface-solid);
}
.planner-day.active { border-color: var(--ink); background: var(--ink); }
.planner-day.active .pd-name, .planner-day.active .pd-num { color: var(--paper); }
.pd-name { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pd-num { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pd-dot { width: 6px; height: 6px; background: var(--accent); margin-top: 1px; }
.pd-dot.done { background: var(--good); }
.pd-dot.behind { background: var(--critical); }
.planner-day.active .pd-dot { background: var(--paper); }

.planner-entry { cursor: pointer; }

/* ---------- The study desk ---------- */
#room-root:has(.desk) { padding: 0; overflow: hidden; }
.desk { height: 100dvh; display: flex; flex-direction: column; position: relative; }
.desk-top {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1.5px solid #484f5e; background: #2c3038; flex-wrap: wrap;
}
.desk-title { flex: 1; min-width: 140px; display: flex; flex-direction: column; }
.desk-title .room-label { margin: 0 0 2px; }
.desk-title strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-clock { display: flex; align-items: baseline; gap: 6px; padding: 4px 12px; border: 1.5px solid #596173; }
.desk-clock span { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.desk-clock small { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #a9afbf; }
.desk-clock.resting { border-color: var(--good); }
.desk-clock.resting span { color: var(--good); }
.desk-top .room-exit { margin: 0; }

.desk-mtabs { display: none; width: 100%; }
.desk-mtabs button { flex: 1; padding: 8px 4px; border: 1.5px solid #596173; background: transparent; color: #d0d4de; font-weight: 600; font-size: 13px; }
.desk-mtabs button + button { border-left: 0; }
.desk-mtabs button.on { background: #f3f1ea; color: #23262d; border-color: #f3f1ea; }

.desk-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr) 360px; }
.desk-left, .desk-main, .desk-right { min-height: 0; overflow: auto; }
.desk-left { border-right: 1.5px solid #484f5e; background: #282c34; }
.desk-right { border-left: 1.5px solid #484f5e; background: #282c34; display: flex; flex-direction: column; }
.desk-main { display: flex; flex-direction: column; overflow: hidden; }

@media (max-width: 899px) {
  .desk-mtabs { display: flex; }
  .desk-body { grid-template-columns: 1fr; }
  .desk-left, .desk-main, .desk-right { display: none; border: 0; }
  .desk[data-mview="files"] .desk-left { display: block; }
  .desk[data-mview="viewer"] .desk-main { display: flex; }
  .desk[data-mview="panel"] .desk-right { display: flex; }
}

/* Loading */
.desk-loading { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.desk-loading-card { width: min(380px, 100%); background: #303540; border: 1.5px solid #484f5e; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.desk-loading-card h2 { margin: 0; font-size: 22px; }
.desk-bar { height: 6px; background: #3f4552; overflow: hidden; }
.desk-bar span { display: block; width: 40%; height: 100%; background: #f3f1ea; animation: desk-slide 1.1s ease-in-out infinite; }
@keyframes desk-slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* Left: the folders */
.dk-side-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 8px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #a9afbf; }
.dk-hint { margin: 6px 12px; font-size: 12px; color: #a9afbf; }
.dk-course { padding-bottom: 6px; }
.dk-line { display: flex; align-items: center; }
.dk-row {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left; border: 0; background: transparent;
  color: #e6e8ee; padding: 7px 10px; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dk-row:hover { background: #383d49; }
.dk-row.course { font-weight: 700; color: #f3f1ea; }
.dk-row.file.on, .dk-row.on { background: #3f4552; color: #fff; }
.dk-dot { width: 9px; height: 9px; background: var(--c, #888); flex: none; }
.dk-caret { margin-left: auto; color: #a9afbf; transition: transform .12s; }
.dk-row.dir .dk-caret { margin: 0 2px 0 0; }
.dk-caret.on { transform: rotate(90deg); }
.dk-kind { flex: none; min-width: 30px; text-align: center; font-size: 9px; font-weight: 800; letter-spacing: .04em; padding: 2px 0; border: 1px solid #596173; color: #d0d4de; }
.dk-kind.pdf { color: #ff8a80; border-color: #6b3a36; }
.dk-kind.text { color: #9ec5ff; border-color: #34496b; }
.dk-mini { flex: none; border: 1px solid #596173; background: transparent; color: #d0d4de; width: 26px; height: 24px; margin-right: 8px; font-size: 14px; line-height: 1; }
.dk-mini.wide { width: auto; padding: 0 8px; font-size: 11px; letter-spacing: 0; text-transform: none; margin: 0; height: 26px; }
.dk-mini:hover { border-color: #f3f1ea; color: #f3f1ea; }
.dk-link { margin: 2px 10px 6px 27px; border: 1.5px dashed #6a7387; background: transparent; color: #f3f1ea; padding: 6px 10px; font-size: 12.5px; font-weight: 600; }
.dk-tools { display: flex; gap: 8px; padding: 6px 10px 6px 27px; }
.dk-tools button { border: 0; background: transparent; color: #a9afbf; font-size: 12px; padding: 0; text-decoration: underline; }

/* Middle: tabs and files */
.dk-tabs { flex: none; display: flex; overflow-x: auto; border-bottom: 1.5px solid #484f5e; background: #2c3038; scrollbar-width: none; }
.dk-tab { flex: none; display: flex; align-items: center; border-right: 1.5px solid #484f5e; max-width: 220px; }
.dk-tab button { border: 0; background: transparent; color: #d0d4de; padding: 10px 10px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-tab button.x { padding: 10px 10px 10px 0; font-size: 16px; }
.dk-tab.on { background: #383d49; box-shadow: inset 0 -2px 0 #f3f1ea; }
.dk-tab.on button { color: #fff; }
.dk-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dk-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dk-empty { margin: auto; text-align: center; padding: 30px; max-width: 360px; color: #d0d4de; }
.dk-empty h2 { color: #f3f1ea; margin: 0 0 8px; }
.dk-tool { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1.5px solid #484f5e; background: #2c3038; flex-wrap: wrap; }
.dk-name { flex: 1; min-width: 100px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-pager, .dk-status { font-size: 12px; color: #a9afbf; font-variant-numeric: tabular-nums; }
.dk-btn { border: 1.5px solid #6a7387; background: transparent; color: #f3f1ea; padding: 5px 10px; font-size: 12.5px; font-weight: 600; text-decoration: none; }
.dk-btn.sq { width: 30px; padding: 5px 0; }
.dk-btn:hover { border-color: #f3f1ea; }
.dk-share { display: none; }
.desk.has-room .dk-share { display: inline-block; }
.dk-scroll { flex: 1; min-height: 0; overflow: auto; background: #3d4350; }
.dk-pdfscroll { padding: 14px 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.dk-page { background: #fff; flex: none; box-shadow: 0 2px 14px rgba(0,0,0,.5); }
.dk-page canvas { display: block; }
.dk-imgwrap { display: grid; place-items: center; padding: 14px; }
.dk-imgwrap img { max-width: 100%; height: auto; background: #fff; }
.dk-note {
  width: 100%; height: 100%; min-height: 100%; border: 0; outline: 0; padding: 18px 20px; overflow: auto;
  background: #303540; color: #f3f1ea; font: 15px/1.6 ui-monospace, "SF Mono", Consolas, monospace;
  white-space: pre-wrap; word-wrap: break-word;
}
.dk-note img { max-width: 100%; display: block; margin: 6px 0; border: 1px solid #484f5e; }

/* Right: the session */
.desk-ptabs { flex: none; display: flex; border-bottom: 1.5px solid #484f5e; }
.desk-ptabs button { flex: 1; border: 0; background: transparent; color: #a9afbf; padding: 11px 4px; font-size: 13px; font-weight: 600; }
.desk-ptabs button.on { color: #f3f1ea; box-shadow: inset 0 -2px 0 #f3f1ea; }
.desk-ptabs button span { font-size: 10px; color: var(--good); }
.desk-pbody { flex: 1; min-height: 0; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.desk-pbody .room-clock { font-size: 60px; }
.desk-pbody .room-share-card { min-height: 0; }
.desk-pbody .share-stream { max-height: 42vh; }

#desk-overlay { position: absolute; inset: 0; z-index: 5; overflow: auto; background: #23262d; padding: 18px; }

/* drawing on PDFs, and showing them */
.dk-scroll { position: relative; }
.dk-page { position: relative; }
.dk-ann { position: absolute; left: 0; top: 0; pointer-events: none; }
.dk-pdfscroll.drawing .dk-page { touch-action: none; cursor: crosshair; user-select: none; }
.dk-tools2 { gap: 6px; }
.dk-btn.tool.on, .dk-btn.on { background: #f3f1ea; color: #23262d; border-color: #f3f1ea; }
.dk-sw { display: inline-flex; gap: 4px; margin: 0 4px; }
.dk-swatch { width: 20px; height: 20px; border: 1.5px solid #6a7387; background: var(--c); padding: 0; }
.dk-swatch.on { outline: 2px solid #f3f1ea; outline-offset: 1px; }
.dk-tools2 .dk-status { flex: 1; min-width: 60px; }
.dk-present { display: none; }
.desk.has-room .dk-present { display: inline-block; }
.dk-dot {
  position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff 0 18%, #ff2a2a 22% 55%, rgba(255,42,42,.0) 72%);
  box-shadow: 0 0 14px 6px rgba(255,42,42,.55); opacity: 0; transition: opacity .25s, left .08s linear, top .08s linear;
}
.dk-dot.on { opacity: 1; }
.desk-live { flex: 1 1 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: #16321a; border: 1.5px solid var(--good); font-size: 13px; }

/* empty rooms */
.rooms-busy { margin-top: 12px; }
.rooms-busy summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.rooms-busy p { margin: 4px 0 0; }

/* ---------- Schedule builder and CRN list ---------- */

.wiz-dots { display: flex; gap: 4px; margin: 2px 0 6px; }
.wiz-dots span { flex: 1; height: 4px; background: var(--line); }
.wiz-dots span.on { background: var(--ink); }
.wiz-count { margin: 0 0 14px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wiz-q { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 8px; }
.wiz-sub { margin: 16px 0 8px; font-weight: 600; }
.wiz-row { display: flex; flex-wrap: wrap; gap: 8px; }
.wiz-col { display: grid; gap: 8px; }
.wiz-choice {
  border: 1.5px solid var(--ink); background: var(--surface-solid); color: var(--ink);
  padding: 12px 16px; text-align: left; font-size: 15px; display: flex; flex-direction: column; gap: 2px;
}
.wiz-row .wiz-choice { align-items: center; padding: 10px 16px; }
.wiz-choice small { color: var(--muted); font-size: 13px; }
.wiz-choice.on { background: var(--ink); color: var(--paper); }
.wiz-choice.on small { color: var(--paper); opacity: .8; }
.wiz-hits { display: grid; gap: 8px; margin-top: 10px; }
.wiz-hit { width: 100%; text-align: left; cursor: pointer; }
.wiz-chosen { margin: 0; overflow: visible; flex-wrap: wrap; padding: 0; }
.wiz-open { margin-top: 18px; }
.wiz-nav { margin-top: 20px; }
.wiz-option { border: 1.5px solid var(--ink); background: var(--surface-solid); padding: 12px; margin-top: 12px; display: grid; gap: 8px; }
.wiz-option .req-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.wiz-sec { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.wiz-sec small { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; }
.wiz-crn { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; }

.crn-big {
  font: 700 22px/1.5 ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: .04em; word-spacing: .3em;
  padding: 12px; margin: 10px 0; background: var(--surface-solid); border: 1.5px solid var(--ink); user-select: all; overflow-wrap: anywhere;
}
.crn-num { font: 700 17px ui-monospace, "SF Mono", Consolas, monospace; font-variant-numeric: tabular-nums; }

/* Word documents in the study desk */
.dk-docscroll { padding: 18px 12px; display: flex; flex-direction: column; align-items: center; }
.dk-page.dk-docpage {
  width: min(820px, 100%); height: auto; padding: 44px 52px; background: #fff; color: #1a1a1a;
  font: 16px/1.6 Georgia, "Times New Roman", serif; box-shadow: 0 2px 14px rgba(0,0,0,.5); overflow-wrap: anywhere;
}
.dk-docpage h1, .dk-docpage h2, .dk-docpage h3 { font-family: inherit; line-height: 1.25; margin: 1.2em 0 .4em; }
.dk-docpage h1 { font-size: 1.9em; } .dk-docpage h2 { font-size: 1.5em; } .dk-docpage h3 { font-size: 1.2em; }
.dk-docpage p { margin: 0 0 .9em; }
.dk-docpage img { max-width: 100%; height: auto; }
.dk-docpage table { border-collapse: collapse; margin: 1em 0; max-width: 100%; }
.dk-docpage td, .dk-docpage th { border: 1px solid #999; padding: 4px 8px; }
.dk-docpage a { color: #1f3bd6; }
.dk-pdfscroll.drawing .dk-docpage, .dk-docscroll.drawing .dk-docpage { cursor: crosshair; }
@media (max-width: 700px) { .dk-page.dk-docpage { padding: 22px 18px; } }

/* schedule builder: the options as little weeks */
.wiz-restart { border: 0; background: none; color: var(--muted); font-size: 12.5px; text-decoration: underline; padding: 0; margin: -6px 0 8px; }
.wiz-grid { display: grid; grid-template-columns: 34px repeat(var(--days), minmax(0, 1fr)); gap: 0 2px; border: 1px solid var(--line-2, var(--line)); background: var(--surface-solid); padding: 6px 6px 8px 4px; }
.wiz-dayname { text-align: center; font-size: 10.5px; font-weight: 800; padding: 2px 0 4px; }
.wiz-hours, .wiz-col { position: relative; height: calc(var(--rows) * 34px); }
.wiz-hours span { position: absolute; right: 4px; transform: translateY(-50%); font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.wiz-col { background: repeating-linear-gradient(to bottom, transparent 0, transparent 33px, var(--line) 33px, var(--line) 34px); border-left: 1px solid var(--line); }
.wiz-blk { position: absolute; left: 1px; right: 1px; background: var(--c); color: #fff; overflow: hidden; padding: 2px 3px; line-height: 1.1; display: flex; flex-direction: column; }
.wiz-blk b { font-size: 9.5px; font-weight: 800; letter-spacing: -0.02em; }
.wiz-blk span { font-size: 9px; opacity: .9; }
.wiz-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 2px 0 4px; }
.wiz-key { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.wiz-key i { width: 10px; height: 10px; display: inline-block; }
.wiz-key b { font-variant-numeric: tabular-nums; font-weight: 800; }
.wiz-blk b, .wiz-blk span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wiz-blk { padding: 2px 3px 1px; }

/* ---- study session entry, top of Tasks ---- */
.study-card {
  width: 100%; display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 12px 14px; text-align: left;
  background: var(--ink); color: var(--paper); border: 1.5px solid var(--ink); box-shadow: 4px 4px 0 var(--warning);
}
.study-card:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--warning); }
.study-card-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; background: var(--warning); color: var(--ink); }
.study-card-text { flex: 1; min-width: 0; }
.study-card-text strong { display: block; font-size: 16px; font-weight: 800; }
.study-card-text small { display: block; font-size: 12.5px; color: #c9c5b8; margin-top: 1px; }

/* ---- friends + invite sheets ---- */
.fr-count { display: inline-block; vertical-align: middle; font-size: 13px; padding: 2px 7px; background: var(--ink); color: var(--paper); font-family: inherit; letter-spacing: 0; }
.fr-add { display: flex; gap: 8px; }
.fr-add input { flex: 1; min-width: 0; }
.fr-add .btn { flex: none; min-height: 46px; }
.fr-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.fr-suggest span { width: 100%; font-size: 12px; color: var(--muted); }
.fr-section { margin-top: 22px; }
.fr-section h3 { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.fr-section h3 span { background: var(--accent); color: #fff; padding: 1px 6px; letter-spacing: 0; }
.fr-list { border: 1.5px solid var(--ink); background: var(--surface-solid); }
.fr-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.fr-row + .fr-row { border-top: 1px solid var(--line); }
.fr-row .avatar { width: 36px; height: 36px; font-size: 15px; }
.fr-row .avatar.muted { background: var(--sunk); color: var(--muted); }
.fr-main { flex: 1; min-width: 0; }
.fr-main strong { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-main small { display: block; font-size: 12px; color: var(--muted); }
.fr-actions { flex: none; display: flex; align-items: center; gap: 6px; }
.fr-actions .btn.sm { min-height: 34px; padding: 0 10px; font-size: 13px; gap: 5px; }
.fr-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1.5px solid var(--ink); background: var(--surface-solid); color: var(--ink); font-size: 18px; line-height: 1; padding: 0; }
.fr-icon:active { background: var(--sunk); }
.fr-tag { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; padding: 1px 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--sunk); }
.fr-tag.on { color: var(--good); background: rgba(12, 163, 12, .1); }
.fr-tag.warn { color: #9a6200; background: rgba(250, 178, 25, .18); }
.fr-actions .fr-tag { margin-top: 0; }
.fr-empty { padding: 14px; border: 1.5px dashed var(--line-strong); background: var(--surface-solid); }
.fr-empty p + p { margin-top: 6px; }
.fr-menu { display: grid; gap: 8px; }

/* ---- schedule header ---- */
.sched-head { display: flex; gap: 8px; align-items: center; }
.sched-term { flex: 0 1 auto; width: auto; max-width: 52%; min-height: 40px; padding: 6px 34px 6px 10px; font-size: 14px; font-weight: 600; }
.sched-picks { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.sched-picks::-webkit-scrollbar { display: none; }
.sched-picks .chip-btn { flex: none; white-space: nowrap; }
.sched-picks .sched-new { padding: 0 10px; }
.sched-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 0; }
.tool-btn { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 6px; border: 1.5px solid var(--line-strong); background: var(--surface-solid); color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
.tool-btn:active { background: var(--sunk); }
.fr-ask { border: 1.5px solid var(--accent); color: var(--accent); background: var(--accent-soft); cursor: pointer; }
.fr-ask:active { background: var(--accent); color: #fff; }

/* ---- study desk header, one way out ---- */
.desk-play, .desk-people { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.leave-list { display: grid; gap: 8px; }
.leave-opt { display: block; width: 100%; text-align: left; padding: 12px 14px; border: 1.5px solid var(--ink); background: var(--surface-solid); color: var(--ink); }
.leave-opt strong { display: block; font-size: 15px; }
.leave-opt small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.leave-opt.main { background: var(--ink); color: var(--paper); box-shadow: 4px 4px 0 var(--warning); }
.leave-opt.main small { color: #c9c5b8; }
.leave-opt.danger { border-color: var(--critical); color: var(--critical); }
.leave-opt:active { transform: translate(1px, 1px); }
@media (max-width: 899px) {
  .desk-top { gap: 8px; }
  .desk-title { flex: 1 1 50%; min-width: 0; }
  .desk-play, .desk-people, .desk-top .room-exit { flex: 1 1 28%; min-height: 40px; }
  .desk-ptabs { display: none; }
  .desk-mtabs button { padding: 9px 2px; font-size: 12px; }
}

/* ---- university sign-up + settings ---- */
.signup-unis { margin-top: -4px; }
.signup-again { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.code-input { font-size: 24px; letter-spacing: .4em; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.uni-line { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.uni-line strong { display: block; }
.uni-line small { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--good); }
.uni-badge { flex: none; min-width: 48px; height: 48px; padding: 0 6px; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-weight: 800; font-size: 15px; letter-spacing: .04em; }
.campus-seg { display: flex; width: 100%; margin-top: 10px; }
.campus-seg button { flex: 1; padding: 8px 4px; font-size: 13px; }

/* ---- Profile ---- */
.profile-head { display: flex; align-items: center; gap: 14px; padding: 14px; margin-bottom: 12px; }
.profile-avatar { width: 56px; height: 56px; font-size: 24px; }
.profile-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.profile-who strong { font-size: 19px; font-weight: 800; }
.profile-who small { color: var(--muted); font-size: 13px; }
.profile-uni { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 4px; font-size: 12.5px; color: var(--ink-2); }
.profile-uni b { background: var(--ink); color: var(--paper); padding: 0 5px; font-size: 11.5px; }
.profile-seg { display: flex; width: 100%; margin-bottom: 14px; }
.profile-seg button { flex: 1; padding: 10px; font-size: 14px; }

/* ---- Community folders ---- */
.cm-section + .cm-section { margin-top: 26px; }
.cm-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.cm-section-head h2 { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: .01em; }
.cm-sub { margin: 16px 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cm-search { margin-bottom: 10px; }
.cm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.cm-box { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 92px; padding: 12px; text-align: left;
  border: 1.5px solid var(--ink); background: var(--surface-solid); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.cm-box.mine { border-top: 6px solid var(--accent); }
.cm-box:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.cm-code { font-size: 18px; font-weight: 800; letter-spacing: .01em; }
.cm-counts { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; }
.cm-counts span { background: var(--sunk); padding: 1px 6px; }
.cm-counts span.muted { background: none; padding: 0; color: var(--muted); }
.cm-hero { margin: 8px 0 12px; padding: 18px; background: var(--ink); color: var(--paper); border: 1.5px solid var(--ink); box-shadow: 4px 4px 0 var(--accent); }
.cm-hero-label { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--warning); }
.cm-hero h2 { font-size: 40px; font-weight: 900; line-height: 1.05; margin: 4px 0; }
.cm-hero p { color: #c9c5b8; font-size: 13.5px; margin-bottom: 12px; }
.cm-kinds { margin-bottom: 4px; }
.cm-posts { display: grid; gap: 10px; margin-top: 10px; }
.cm-post { padding: 12px 14px; border: 1.5px solid var(--ink); background: var(--surface-solid); border-left-width: 6px; }
.cm-post.kind-previous { border-left-color: var(--critical); }
.cm-post.kind-notes { border-left-color: var(--accent); }
.cm-post.kind-tutor { border-left-color: var(--good); }
.cm-post.kind-tip { border-left-color: var(--warning); }
.cm-post-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cm-post h3 { font-size: 16px; font-weight: 700; margin: 6px 0 2px; }
.cm-body { font-size: 14px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.cm-tutor { display: flex; flex-wrap: wrap; gap: 10px; font-size: 14px; margin-top: 4px; }
.cm-tutor span { display: inline-flex; align-items: center; gap: 4px; }
.cm-post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.cm-post-actions .btn.sm { min-height: 34px; font-size: 13px; gap: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-stars { display: flex; align-items: center; gap: 2px; margin-top: 10px; }
.cm-stars button { border: 0; background: none; font-size: 22px; line-height: 1; padding: 2px; color: var(--line); cursor: pointer; }
.cm-stars button.on { color: var(--warning); }
.cm-stars button[disabled] { cursor: default; }
.cm-stars small { margin-left: 8px; color: var(--muted); font-size: 12px; }
.fr-tag.bad { color: var(--critical); background: rgba(208, 59, 59, .1); }
.cm-kind-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.cm-kind-opt { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border: 1.5px solid var(--ink); background: var(--surface-solid); cursor: pointer; }
.cm-kind-opt input { margin-top: 3px; accent-color: var(--accent); }
.cm-kind-opt strong { display: block; font-size: 14px; }
.cm-kind-opt small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.cm-kind-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.check-row { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.check-row input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
input[type=url] { width: 100%; min-height: 46px; padding: 10px 12px; font-size: 16px; border: 1.5px solid var(--ink); background: var(--surface-solid); color: var(--ink); outline: none; }

/* ---- colour themes ---- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 10px; }
.theme-swatch { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 1.5px solid var(--line-strong); background: var(--surface-solid); color: var(--ink); text-align: left; }
.theme-swatch.on { outline: 3px solid var(--accent); outline-offset: 2px; }
.ts-preview { display: flex; align-items: flex-end; gap: 4px; height: 52px; padding: 6px; border: 1px solid rgba(0,0,0,.15); }
.ts-preview span { flex: 1; height: 60%; }
.ts-preview span:first-child { height: 100%; }
.ts-name { font-size: 13px; font-weight: 700; }
.theme-custom { display: grid; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.theme-custom.hidden { display: none; }
.theme-color { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.theme-color input[type=color] { width: 52px; height: 40px; padding: 2px; border: 1.5px solid var(--line-strong); background: var(--surface-solid); cursor: pointer; }
.theme-color small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }

/* ---- a study session closed for now: the way back ---- */
.session-pill {
  position: fixed; z-index: 95; left: 16px; right: 120px; bottom: calc(var(--tabbar-h) + var(--tabbar-pad) + 14px);
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-align: left;
  background: #23262d; color: #f3f1ea; border: 2px solid #141414; box-shadow: 3px 3px 0 var(--warning);
}
.session-pill.resting { box-shadow: 3px 3px 0 var(--good); }
.session-pill-dot { width: 10px; height: 10px; flex: none; background: var(--warning); animation: pill-pulse 1.6s ease-in-out infinite; }
.session-pill.resting .session-pill-dot { background: var(--good); }
@keyframes pill-pulse { 50% { opacity: .35; } }
.session-pill-text { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-pill-clock { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; color: var(--warning); }
.session-pill.resting .session-pill-clock { color: var(--good); }
.session-pill-back { padding: 4px 10px; background: var(--warning); color: #141414; font-weight: 800; font-size: 12.5px; }
body:not(.in-room) #music-listen-btn, body:not(.in-room) #music-popup-root { display: none; }
@media (min-width: 1100px) {
  .session-pill { left: auto; right: 190px; bottom: 36px; width: 380px; }
}
@media (prefers-reduced-motion: reduce) { .session-pill-dot { animation: none; } }

.room-steps-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.room-steps-count { font-size: 12px; font-weight: 700; color: #a9afbf; }
.room-steps-card .room-list { margin-top: 6px; }
.room-steps-edit { margin-top: 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 6px 10px; }

/* Word documents rendered by docx-preview: flow as one page that fits the screen, keep Word's own
   fonts, colours and tables, and show equations as real maths. */
.dk-docpage section.docx {
  width: auto !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important;
  box-shadow: none !important; background: transparent !important; overflow-wrap: anywhere;
}
.dk-docpage section.docx + section.docx { margin-top: 28px !important; padding-top: 28px !important; border-top: 1px dashed #c9c9c9; }
.dk-docpage section.docx > header, .dk-docpage section.docx > footer { color: #6b6b6b; font-size: .85em; }
.dk-docpage table { max-width: 100%; border-collapse: collapse; }
.dk-docpage img { max-width: 100%; height: auto; }
.dk-docpage math { font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", math, serif; font-size: 1.15em; math-style: normal; }
.dk-docpage math[display="block"] { margin: .6em 0; overflow-x: auto; max-width: 100%; }
@media (max-width: 600px) { .dk-page.dk-docpage { padding: 22px 18px; } }
/* MathType / embedded-object equations: pictures that sit inside the line of text, like in Word. */
.dk-docpage div:has(> svg > image) { display: inline-block; vertical-align: baseline; line-height: 0; }
.dk-docpage svg:has(> image) { overflow: visible; }

/* ----- report / block / delete account ----- */
.share-report {
  margin-left: auto; border: 0; background: transparent; color: #6d6a5f; cursor: pointer;
  padding: 2px; line-height: 0; opacity: .45;
}
.share-report + .share-drop { margin-left: 0; }
.share-post:hover .share-report, .share-report:focus { opacity: 1; }
.share-report:hover { color: var(--warning); }
@media (hover: none) { .share-drop { opacity: .6; } }
.cm-report { margin-left: auto; color: var(--muted, #8a8678); font-weight: 600; }
.report-reasons { display: grid; gap: 6px; }
.report-reason {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px;
  border: 1px solid var(--line, rgba(127,127,127,.25)); cursor: pointer; font-size: 14px;
}
.report-reason input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.report-reason:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.account-more { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.account-more .link-btn { text-decoration: none; }
.blocked-list { display: grid; gap: 8px; }
.blocked-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px;
  border-radius: 12px; border: 1px solid var(--line, rgba(127,127,127,.25));
}
.auth-forgot { display: block; margin: 10px auto 0; text-decoration: none; }

/* ----- settings: course files ----- */
.store-opts { display: grid; gap: 8px; margin-top: 10px; }
.store-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 14px;
}
.store-opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.store-text { display: grid; gap: 3px; min-width: 0; }
.store-text strong { font-size: 14px; }
.store-act { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.store-act .link-btn { text-decoration: none; font-size: 12px; }
.store-bar { display: block; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 4px; max-width: 220px; }
.store-bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

/* ----- focus sounds (replaces the YouTube player) ----- */
.sounds-intro { margin: -4px 0 12px; color: #a9afbf; }
.sounds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.sound-card { display: grid; gap: 8px; padding: 10px; border: 1.5px solid #3f4552; background: #2a2e36; }
.sound-card.on { border-color: var(--good); background: #24342d; }
.sound-toggle { display: grid; gap: 2px; text-align: left; border: 0; background: none; color: #f3f1ea; padding: 0; cursor: pointer; }
.sound-toggle strong { font-size: 14px; }
.sound-toggle small { font-size: 11.5px; color: #a9afbf; }
.sound-card.on .sound-toggle strong::after { content: ' · on'; color: var(--good); font-weight: 700; }
.sound-level, #sounds-master {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px; background: #181a1f; outline: none;
}
.sound-level::-webkit-slider-thumb, #sounds-master::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border: 2px solid #181a1f; background: var(--good); cursor: pointer;
}
.sound-level::-moz-range-thumb, #sounds-master::-moz-range-thumb { width: 14px; height: 14px; border-radius: 0; background: var(--good); border: 2px solid #181a1f; cursor: pointer; }
.sounds-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.sounds-master { display: flex; align-items: center; gap: 8px; flex: 1; color: #a9afbf; }
.sounds-apps { margin-top: 16px; padding-top: 12px; border-top: 1px solid #3f4552; }
.sounds-apps p { margin: 0 0 8px; color: #a9afbf; }
.sounds-app-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sounds-app-row a { text-decoration: none; }
.sounds-mini-open { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; max-width: 100%; }
.sounds-wave { display: flex !important; align-items: flex-end; justify-content: center; gap: 2px; padding: 5px 4px; }
.sounds-wave i { width: 4px; background: #0e1a14; animation: sounds-bar 1.1s ease-in-out infinite; }
.sounds-wave i:nth-child(2) { animation-delay: -.4s; }
.sounds-wave i:nth-child(3) { animation-delay: -.8s; }
@keyframes sounds-bar { 0%, 100% { height: 30%; } 50% { height: 90%; } }
@media (prefers-reduced-motion: reduce) { .sounds-wave i { animation: none; height: 60%; } }

/* ----- community: professor filter ----- */
.cm-prof-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.cm-prof-label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cm-profs { margin: 0; }
.cm-prof-tag { display: inline-flex; align-items: center; gap: 5px; margin: 2px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }

/* ----- shared with friends ----- */
.count-badge.static { position: static; display: inline-grid; margin-left: 6px; padding: 0 7px; width: auto; font-size: 11px; vertical-align: middle; }
.fs-list { display: grid; gap: 10px; margin-top: 10px; }
.fs-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--card, transparent); }
.fs-item.new { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.fs-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fs-code { font-size: 12px; font-weight: 700; }
.fs-item h3 { margin: 6px 0 4px; font-size: 15.5px; }
.fs-body { margin: 0 0 8px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 9.5em; overflow: auto; }
.fs-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fs-actions .link-btn { text-decoration: none; }
.fs-all { margin-top: 10px; }
.fs-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.seg-row { display: flex; gap: 6px; flex-wrap: wrap; }
.fs-friends { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fs-friend { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 99px; font-size: 13.5px; cursor: pointer; }
.fs-friend input { accent-color: var(--accent); margin: 0; }
.fs-friend:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.fs-all-friends:has(input:checked) + .fs-friends { opacity: .45; pointer-events: none; }
.fs-file-chip { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; font-size: 14px; }
.fs-file-chip span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
