/* ShuDue — the "Campus" look, layered over styles.css.
   A bold, colourful identity with square corners: condensed poster-style headings, a cobalt / signal-orange /
   sun-yellow palette, your course colours used as solid blocks, and hard ink outlines. On a phone it's an app
   with a dark tab bar; on a laptop it becomes a workspace: dark sidebar, the list in the middle, today on the right. */


:root {
  --paper: #f3efe6;
  --surface: #fffdf8;
  --surface-solid: #fffdf8;
  --sunk: #e9e4d8;
  --ink: #141414;
  --ink-2: #3a3833;
  --muted: #6f6b61;
  --line: #d9d3c5;
  --line-strong: #141414;
  --accent: #1f3bd6;
  --accent-soft: #e4e8fb;
  --signal: #ff5a1f;
  --sun: #ffc21a;
  --mint: #10a36b;
  --critical: #e0301e;
  --serious: #ff7a2f;
  --warning: #f2b100;
  --good: #10a36b;
  --hard: 3px 3px 0 var(--ink);
  font-family: "Archivo", -apple-system, "Segoe UI", Roboto, sans-serif;
}
body { background: var(--paper); font-stretch: 100%; }
#bg { background-image: none; background-color: var(--paper); }
button, input, select, textarea { font-family: inherit; }

/* ---------- the poster headings ---------- */
.topbar { border-bottom: 3px solid var(--ink); padding: 2px 0 12px; margin-bottom: 16px; align-items: flex-end; }
.topbar h1 { font-stretch: 72%; font-weight: 850; font-size: 40px; letter-spacing: -0.01em; text-transform: uppercase; line-height: .95; word-spacing: .14em; }
.topbar .hello small { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--accent); }
.icon-btn { border: 2px solid var(--ink); background: var(--surface); box-shadow: 2px 2px 0 var(--ink); }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.count-badge { background: var(--signal); color: #fff; font-weight: 800; }

.section-title { font-stretch: 75%; font-size: 17px; font-weight: 850; letter-spacing: .02em; color: var(--ink); margin: 24px 0 10px; gap: 10px; align-items: center; }
.section-title::before { content: ""; width: 10px; height: 10px; background: var(--signal); }
.section-title .count { background: var(--ink); color: #fff; font-size: 11px; font-stretch: 100%; padding: 1px 6px; font-weight: 700; }

/* ---------- today: colour blocks ---------- */
#next-class .nextclass {
  background: var(--accent); color: #fff; border: 2px solid var(--ink); box-shadow: var(--hard); padding: 14px 16px; margin-bottom: 10px;
}
#next-class .nextclass .nc-label, #next-class .nextclass .nc-where, #next-class .nextclass .nc-after { color: rgba(255,255,255,.78); }
#next-class .nextclass .nc-main { color: #fff; font-size: 17px; }
#next-class .nextclass .nc-big { color: var(--sun); font-stretch: 75%; font-size: 22px; font-weight: 850; }
#next-class .nextclass.soon { background: var(--signal); }
#next-class .nextclass.now { background: var(--mint); }
.nc-label { font-weight: 800; letter-spacing: .12em; }

.nextclass.planner-row { background: var(--sun); color: var(--ink); border: 2px solid var(--ink); box-shadow: var(--hard); padding: 14px 16px; margin-bottom: 10px; }
.nextclass.planner-row .nc-label { color: var(--ink); }
.nextclass.planner-row .nc-big { font-stretch: 75%; font-size: 22px; font-weight: 850; color: var(--ink); }
.nextclass.planner-row.is-behind { background: var(--signal); color: #fff; }
.nextclass.planner-row.is-behind .nc-label, .nextclass.planner-row.is-behind .nc-big { color: #fff; }

.banner { background: var(--ink); color: #fff; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--signal); margin-bottom: 10px; }
.banner .i { color: var(--sun); }
.banner em { background: var(--sun); color: var(--ink); border: 0; font-weight: 800; }

.summary { border: 2px solid var(--ink); background: var(--surface); box-shadow: var(--hard); margin: 0 0 16px; }
.summary .tile { border: 0; border-top: 6px solid var(--ink); background: transparent; }
.summary .tile:nth-child(2) { border-top-color: var(--accent); }
.summary .tile:nth-child(3) { border-top-color: var(--signal); }
.summary .tile + .tile { border-left: 2px solid var(--ink); }
.tile .num { font-stretch: 72%; font-size: 34px; font-weight: 850; line-height: 1; }
.tile .lbl { font-weight: 700; letter-spacing: .1em; color: var(--ink-2); }

/* ---------- controls ---------- */
input:not([type=checkbox]):not([type=radio]), select, textarea { border: 2px solid var(--ink); background-color: var(--surface); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 3px 3px 0 var(--accent); }
.btn { border: 2px solid var(--ink); background: var(--surface); box-shadow: 2px 2px 0 var(--ink); font-weight: 700; }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn.primary { background: var(--accent); border-color: var(--ink); color: #fff; }
.btn.good { background: var(--mint); border-color: var(--ink); }
.btn.danger { border-color: var(--critical); box-shadow: 2px 2px 0 var(--critical); }
.chip-btn { border: 2px solid var(--ink); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 13px; }
.chip-btn.active { background: var(--accent); color: #fff; border-color: var(--ink); }
.seg { border: 2px solid var(--ink); }
.seg button { font-weight: 700; }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button.active { background: var(--ink); color: var(--sun); }
.badge { border: 2px solid var(--ink); font-weight: 800; }

/* ---------- task cards: your course colours, loud ---------- */
.list { gap: 10px; }
.task { background: var(--surface); border: 2px solid var(--ink); box-shadow: var(--hard); padding: 12px 14px 12px 20px; }
.task::before { width: 8px; background: var(--c, var(--ink)); }
.task:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.task.lvl-overdue { border-color: var(--critical); box-shadow: 3px 3px 0 var(--critical); }
.check { border: 2px solid var(--ink); width: 24px; height: 24px; }
.check:hover { background: var(--mint); color: #fff; }
.task-top .course { background: var(--c, var(--ink)); color: #fff; padding: 2px 6px; font-weight: 800; letter-spacing: .06em; }
.task-title { font-stretch: 88%; font-size: 18px; font-weight: 800; letter-spacing: -0.005em; }
.countdown { font-stretch: 72%; font-size: 22px; font-weight: 850; }
.status { border: 0; background: var(--s); color: #fff; font-weight: 800; }
.status::before { background: #fff; }
.s-soon { color: var(--ink); }
.s-soon::before { background: var(--ink); }
.progress { height: 6px; background: var(--sunk); }
.progress > span { background: var(--c, var(--accent)); }

/* ---------- schedule ---------- */
.week { border: 2px solid var(--ink); box-shadow: var(--hard); }
.week-day-name { background: var(--ink); color: #fff; font-stretch: 75%; font-weight: 850; letter-spacing: .06em; }
.slot { background: var(--c); border-left: 0; color: #fff; }
.slot strong { font-stretch: 80%; font-size: 12.5px; }
.slot small, .slot .slot-time { color: rgba(255,255,255,.85); }
.sched-tools .btn { white-space: nowrap; }

/* ---------- sheets ---------- */
.sheet { border-top: 4px solid var(--ink); }
.sheet-head h2, .detail-title { font-stretch: 75%; font-weight: 850; letter-spacing: 0; }
.detail-title { font-size: 30px; line-height: 1; }
.why { border-left: 6px solid var(--signal); }
.meters { border: 2px solid var(--ink); }
.pips span.on { background: var(--accent); }
.link-row { border: 2px solid var(--ink); border-left: 8px solid var(--accent); box-shadow: 2px 2px 0 var(--ink); }
.request { border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--signal); }

/* ---------- phone: an app ---------- */
.tabbar { background: var(--ink); border-top: 0; }
.tab { color: rgba(255,255,255,.62); font-weight: 700; }
.tab.active { color: var(--sun); }
.tab.active::before { top: 0; left: 25%; right: 25%; height: 3px; background: var(--sun); }
.fab { background: var(--signal); color: #fff; border: 2px solid var(--ink); box-shadow: var(--hard); font-weight: 800; }

/* ---------- laptop: a workspace ---------- */
@media (min-width: 1100px) {
  :root { --side: 248px; --rail: 340px; }
  body:not(.auth) #app { max-width: 1160px; margin-left: calc(var(--side) + max(32px, (100vw - var(--side) - 1160px) / 2)); padding: 30px 32px 90px 0; }
  .tabbar { top: 0; bottom: 0; right: auto; width: var(--side); padding: 26px 14px; }
  .tabbar::before {
    content: ""; display: block; height: 46px; margin: 0 8px 28px; padding-bottom: 18px; border-bottom: 2px solid rgba(255,255,255,.14);
    background: url(/brand/logo-light.svg) left top / auto 46px no-repeat; background-origin: content-box;
  }
  .tabbar-inner { display: flex; flex-direction: column; gap: 4px; max-width: none; }
  .tab { flex-direction: row; justify-content: flex-start; gap: 14px; padding: 11px 14px; font-size: 15px; color: rgba(255,255,255,.72); }
  .tab:hover { background: rgba(255,255,255,.08); color: #fff; }
  .tab.active { background: var(--sun); color: var(--ink); }
  .tab.active::before { display: none; }
  .topbar h1 { font-size: 52px; }

  /* Tasks: the list in the middle, today down the right */
  main:has(> #next-class) > #next-class,
  main:has(> #next-class) > .banner,
  main:has(> #next-class) > .study-card,
  main:has(> #next-class) > .nextclass.planner-row,
  main:has(> #next-class) > .summary { float: right; clear: right; width: var(--rail); }
  main:has(> #next-class) > :not(#next-class):not(.banner):not(.study-card):not(.planner-row):not(.summary) { margin-right: calc(var(--rail) + 28px); }
  main:has(> #next-class) > .chips { margin-left: 0; padding-left: 0; }
  main:has(> #next-class) > .summary { display: grid; grid-template-columns: 1fr 1fr 1fr; }

  .fab { right: 40px; bottom: 36px; }
  #sheet-root .sheet {
    top: 50%; bottom: auto; left: 50%; right: auto; width: min(600px, calc(100vw - 48px)); max-height: min(86vh, 860px);
    border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink);
    transform: translate(-50%, calc(-50% + 16px)); opacity: 0; transition: transform .18s ease, opacity .18s ease;
  }
  #sheet-root.open .sheet { transform: translate(-50%, -50%); opacity: 1; }
  .sheet-grip { display: none; }
}

/* ---------- Courses: folders, from the outside ---------- */
.course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.cf-box { position: relative; display: flex; flex-direction: column; padding: 14px 0 0; border: 0; background: none; text-align: left; color: #fff; cursor: pointer; }
.cf-tab { position: absolute; top: 0; left: 0; width: 46%; height: 16px; background: var(--c); border: 2px solid var(--ink); border-bottom: 0; }
.cf-body { display: flex; flex-direction: column; background: var(--c); border: 2px solid var(--ink); border-bottom: 0; padding: 12px 12px 10px; min-height: 132px; }
.cf-word { font-stretch: 72%; font-weight: 850; font-size: 19px; text-transform: uppercase; line-height: 1; overflow-wrap: anywhere; }
.cf-num { font-stretch: 70%; font-weight: 900; font-size: 44px; line-height: .95; }
.cf-facts { display: flex; gap: 10px; margin-top: auto; padding-top: 10px; font-size: 11px; font-weight: 600; color: rgba(255,255,255,.85); }
.cf-facts b { color: #fff; font-size: 13px; }
.cf-next { background: var(--ink); color: #fff; font-size: 11.5px; font-weight: 600; padding: 7px 12px; border: 2px solid var(--ink); box-shadow: var(--hard); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-next em { font-style: normal; color: var(--sun); margin-left: 4px; }
.cf-box:active { transform: translate(2px, 2px); }
.cf-box:hover .cf-body { filter: brightness(1.06); }

/* ---------- Courses: inside the folder ---------- */
.back-row { border: 2px solid var(--ink); background: var(--surface); font-weight: 700; box-shadow: 2px 2px 0 var(--ink); margin-bottom: 14px; }
.cf-hero { background: var(--c); color: #fff; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); padding: 14px 16px 16px; position: relative; margin-top: 16px; }
.cf-hero::before { content: ""; position: absolute; left: -2px; top: -16px; width: 40%; height: 16px; background: var(--c); border: 2px solid var(--ink); border-bottom: 0; }
.cf-hero-top { display: flex; align-items: center; justify-content: space-between; }
.cf-label { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.8); }
.cf-rename { border: 1.5px solid rgba(255,255,255,.7); background: transparent; color: #fff; font-size: 12px; font-weight: 700; padding: 4px 8px; display: inline-flex; gap: 5px; align-items: center; }
.cf-title { font-stretch: 70%; font-weight: 900; font-size: 46px; line-height: .95; text-transform: uppercase; margin: 8px 0 14px; }
.cf-title span { color: var(--sun); }
.cf-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid rgba(255,255,255,.35); padding-top: 10px; gap: 6px; }
.cf-stats strong { display: block; font-stretch: 72%; font-weight: 850; font-size: 24px; }
.cf-stats span { font-size: 10.5px; font-weight: 600; color: rgba(255,255,255,.82); line-height: 1.2; display: block; }

.cf-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 6px; }
.cf-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px; border: 2px solid var(--ink); background: var(--surface); box-shadow: 2px 2px 0 var(--ink); text-align: left; min-width: 0; }
.cf-tile:nth-child(1) { border-top: 6px solid var(--accent); }
.cf-tile:nth-child(2) { border-top: 6px solid var(--signal); }
.cf-tile:nth-child(3) { border-top: 6px solid var(--mint); }
.cf-tile:nth-child(4) { background: var(--sun); }
.cf-tile:active { transform: translate(2px, 2px); box-shadow: none; }
.cf-tile-v { font-stretch: 70%; font-weight: 900; font-size: 28px; line-height: 1; }
.cf-tile-l { font-weight: 800; font-size: 12.5px; }
.cf-tile-s { font-size: 10.5px; color: var(--muted); line-height: 1.2; }
.cf-tile:nth-child(4) .cf-tile-s { color: var(--ink-2); }

.cf-panel { border: 2px solid var(--ink); background: var(--surface); box-shadow: var(--hard); margin-top: 16px; }
.cf-panel h3 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px; background: var(--ink); color: #fff; font-stretch: 75%; font-weight: 850; font-size: 16px; text-transform: uppercase; letter-spacing: .03em; }
.cf-panel h3 .count { background: var(--sun); color: var(--ink); font-stretch: 100%; font-size: 11px; padding: 1px 6px; }
.cf-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-top: 1px solid var(--line); cursor: pointer; }
.cf-row:first-of-type { border-top: 0; }
.cf-row .countdown { font-size: 18px; }
.cf-empty { padding: 12px; color: var(--muted); font-size: 13.5px; }
.cf-link { border: 0; background: none; color: var(--accent); font-weight: 700; padding: 0; text-decoration: underline; }

/* ---------- panels on Dashboard, Settings and elsewhere ---------- */
main .card:not(.task):not(.tile):not(.summary):not(.empty) { border: 2px solid var(--ink); box-shadow: var(--hard); background: var(--surface); }
main .card h2 { font-stretch: 75%; font-weight: 850; text-transform: uppercase; letter-spacing: .03em; }
.empty { border: 2px dashed var(--ink); background: var(--surface); }
.planner-day { border: 2px solid var(--ink); background: var(--surface); }
.planner-day.active { background: var(--accent); border-color: var(--ink); }
.planner-status { border: 2px solid currentColor; box-shadow: 2px 2px 0 currentColor; font-weight: 700; }
.inbox-tabs button.on { box-shadow: inset 0 -3px 0 var(--signal); }

@media (min-width: 1100px) {
  .course-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px 18px; }
  .cf-body { min-height: 160px; }
  .cf-num { font-size: 56px; }
  main:has(> .cf-hero) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; align-items: start; }
  main:has(> .cf-hero) > .back-row, main:has(> .cf-hero) > .cf-hero, main:has(> .cf-hero) > .cf-tiles { grid-column: 1 / -1; }
  main:has(> .cf-hero) > .back-row { justify-self: start; }
  .cf-title { font-size: 72px; }
  .cf-stats strong { font-size: 32px; }
}
.cf-body, .cf-hero { color: var(--on, #fff); }
.cf-facts, .cf-label, .cf-stats span { color: color-mix(in srgb, var(--on, #fff) 80%, transparent); }
.cf-facts b { color: var(--on, #fff); }
.cf-rename { color: var(--on, #fff); border-color: color-mix(in srgb, var(--on, #fff) 60%, transparent); }
.cf-stats { border-top-color: color-mix(in srgb, var(--on, #fff) 30%, transparent); }
.cf-hero[style*="--on:#141414"] .cf-title span { color: #fff; -webkit-text-stroke: 2px var(--ink); }

/* ---------- Study session: dark, but a soft slate rather than black, with the Campus colours ---------- */
#room-root { background-image: linear-gradient(#2a2d35 1px, transparent 1px), linear-gradient(90deg, #2a2d35 1px, transparent 1px); }
.desk-top { border-bottom: 3px solid #181a1f; }
.desk-title strong { font-stretch: 78%; font-weight: 850; font-size: 19px; text-transform: uppercase; letter-spacing: .01em; }
.desk-title .room-label { color: var(--sun); }
.desk-clock { border: 2px solid #181a1f; background: #23262d; box-shadow: 3px 3px 0 #181a1f; }
.desk-clock span { font-stretch: 72%; font-weight: 850; font-size: 28px; color: var(--sun); }
.desk-clock.resting span { color: var(--mint); }
.room-btn, .dk-btn, .desk-mtabs button { border: 2px solid #181a1f; background: #3a404c; color: #f3f1ea; box-shadow: 2px 2px 0 #181a1f; font-weight: 700; }
.room-btn:hover, .dk-btn:hover { border-color: #181a1f; background: #454c5a; }
.room-btn:active, .dk-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.room-btn.primary, .dk-btn.tool.on, .dk-btn.on, .desk-mtabs button.on { background: var(--sun); color: #141414; border-color: #181a1f; }
.room-btn.danger { background: transparent; }
.room-exit { border: 2px solid #181a1f; background: #3a404c; box-shadow: 2px 2px 0 #181a1f; color: #f3f1ea; }
.room-exit:hover { background: var(--critical); border-color: #181a1f; color: #fff; }
.room-modes { border: 2px solid #181a1f; }
.room-modes button.on { background: var(--sun); color: #141414; }
.room-modes button + button { border-left: 2px solid #181a1f; }

.room-card { border: 2px solid #181a1f; box-shadow: 3px 3px 0 #181a1f; }
.room-clock-card { border-top: 6px solid var(--signal); }
.room-task-card { border-top: 6px solid var(--accent); }
.voice-card { border-top: 6px solid var(--sun); }
.music-card { border-top: 6px solid var(--mint); }
.room-steps-card { border-top: 6px solid var(--mint); }
.room-notes-card { border-top: 6px solid var(--accent); }
.room-distract-card { border-top: 6px solid var(--signal); }
.room-label { color: #b6bccb; font-weight: 800; }
.room-clock { font-stretch: 72%; font-weight: 850; color: #fff; }
.room-select, .room-goal input, .room-distract input, #room-notes { border: 2px solid #181a1f; background: #262a32; color: #f3f1ea; }
.room-goal input::placeholder, .room-distract input::placeholder { color: #8f96a6; }
.room-bar span, .progress > span { background: var(--mint); }

.desk-left, .desk-right { box-shadow: inset 0 0 0 1px #2f343e; }
.desk-left { border-right: 3px solid #181a1f; }
.desk-right { border-left: 3px solid #181a1f; }
.dk-side-head { color: var(--sun); }
.dk-course .dk-row.course { color: #fff; }
.dk-row:hover { background: #363c48; }
.dk-row.file.on { background: #444b5a; box-shadow: inset 3px 0 0 var(--sun); }
.dk-link { border: 2px dashed #7b849a; color: #f3f1ea; }
.dk-tabs { border-bottom: 3px solid #181a1f; background: #2c3038; }
.dk-tab { border-right: 2px solid #181a1f; }
.dk-tab.on { background: #3a404c; box-shadow: inset 0 3px 0 var(--sun); }
.dk-tool { background: #2c3038; border-bottom: 2px solid #181a1f; }
.dk-scroll { background: #3d4350; }
.dk-note { background: #303540; }
.desk-ptabs { border-bottom: 3px solid #181a1f; }
.desk-ptabs button.on { box-shadow: inset 0 -3px 0 var(--sun); color: #fff; }
.desk-live { background: #1f5a3f; border: 2px solid #181a1f; }
#desk-overlay { background: #23262d; }
.dk-swatch { border: 2px solid #181a1f; }
#room-root input, #room-root select, #room-root textarea { background-color: #262a32; color: #f3f1ea; border: 2px solid #181a1f; min-height: 0; }
#room-root input::placeholder, #room-root textarea::placeholder { color: #8f96a6; }
#room-root input:focus, #room-root textarea:focus { border-color: var(--sun); box-shadow: 3px 3px 0 #181a1f; }

/* ---------- Welcome tour ---------- */
#tour-root { position: fixed; inset: 0; z-index: 300; background: rgba(20, 20, 20, .55); display: grid; place-items: center; padding: 14px; overflow: auto; }
.tour-card {
  width: min(460px, 100%); max-height: 100%; overflow: auto; background: var(--paper); border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink);
  display: flex; flex-direction: column;
}
.tour-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 0; }
.tour-step { font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--muted); }
.tour-skip { border: 0; background: none; font-weight: 700; color: var(--ink-2); text-decoration: underline; padding: 4px; }
.tour-art {
  margin: 12px 16px 0; padding: 18px; min-height: 150px; background: var(--tc); color: var(--ti); border: 2px solid var(--ink);
  display: flex; flex-direction: column; justify-content: center; gap: 10px; position: relative; overflow: hidden;
}
.tour-body { padding: 16px 20px 4px; }
.tour-kicker { margin: 0 0 4px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.tour-body h2 { font-stretch: 75%; font-weight: 850; font-size: 30px; line-height: 1.02; letter-spacing: 0; margin: 0 0 12px; text-transform: none; }
.tour-body ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 15px; color: var(--ink-2); }
.tour-dots { display: flex; gap: 6px; padding: 14px 20px 0; }
.tour-dots span { width: 22px; height: 6px; background: var(--line-2, #d6d6d2); }
.tour-dots span.on { background: var(--ink); }
.tour-nav { display: flex; gap: 10px; padding: 14px 20px 20px; }
.tour-nav .btn { flex: 1; }
.tour-nav .btn.primary { flex: 2; }
body.touring { overflow: hidden; }

/* the little pictures */
.tr-card { position: relative; background: #fffdf8; color: #141414; border: 2px solid #141414; box-shadow: 3px 3px 0 #141414; padding: 10px 12px 10px 18px; display: flex; flex-direction: column; gap: 1px; }
.tr-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: var(--c); }
.tr-course { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; color: var(--c); }
.tr-card b { font-size: 16px; font-stretch: 88%; font-weight: 800; }
.tr-card small { font-size: 12px; color: #6f6b61; }
.tr-pill { position: absolute; right: 10px; top: 10px; font-size: 10.5px; font-weight: 800; padding: 2px 7px; background: #10a36b; color: #fff; }
.tr-pill.hot { background: #ff7a2f; }
.tr-add { align-self: flex-end; background: #ff5a1f; color: #fff; border: 2px solid #141414; box-shadow: 3px 3px 0 #141414; font-weight: 800; padding: 8px 16px; }
.tr-week { position: relative; height: 120px; background: #fffdf8; border: 2px solid #141414; }
.tr-week i { position: absolute; width: 18%; background: var(--c); border: 1.5px solid #141414; }
.tr-folders { display: flex; gap: 12px; justify-content: center; }
.tr-folders span { background: var(--c); color: #fff; border: 2px solid #141414; box-shadow: 3px 3px 0 #141414; padding: 10px 14px; font-weight: 800; font-size: 13px; display: flex; flex-direction: column; font-stretch: 75%; }
.tr-folders b { font-size: 30px; line-height: 1; }
.tr-desk { display: grid; grid-template-columns: 22% 1fr 26%; gap: 6px; height: 110px; }
.tr-desk > span { border: 2px solid #141414; background: #303540; }
.tr-doc { background: #fff !important; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.tr-doc i { height: 6px; background: #d6d6d2; display: block; }
.tr-doc i:nth-child(2) { width: 70%; background: #ffc21a; }
.tr-panel { color: #ffc21a; font-weight: 900; font-size: 20px; display: grid; place-items: center; font-stretch: 72%; }
.tr-notif { background: #fffdf8; color: #141414; border: 2px solid #141414; box-shadow: 3px 3px 0 #141414; padding: 10px 12px; display: flex; flex-direction: column; }
.tr-notif small { color: #6f6b61; }
.tr-notif.dim { margin-left: 22px; }

/* ---------- Syllabus import ---------- */
.syl-row { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.syl-row.off { opacity: .5; }
.syl-check { padding-top: 10px; }
.syl-check input { width: 20px; height: 20px; }
.syl-fields { flex: 1; min-width: 0; display: grid; gap: 6px; }
.syl-line { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 6px; }
.syl-line input, .syl-line select, .syl-fields > input { min-height: 40px; font-size: 14px; padding: 6px 8px; }
.syl-note { color: var(--critical); font-weight: 600; }
.tour-body { min-height: 200px; }

/* ---------- wallpaper preview ---------- */
.wall-frame { display: grid; place-items: center; margin: 4px 0 14px; }
.wall-frame img { width: min(100%, 250px); height: auto; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); display: block; }

/* ---- Night (and any dark custom theme): blocks drawn in "ink" stay dark panels, not light ones ---- */
.theme-dark .tabbar, .theme-dark .banner, .theme-dark .section-title .count, .theme-dark .week-day-name,
.theme-dark .cf-next, .theme-dark .cf-panel h3, .theme-dark .study-card, .theme-dark .cm-hero,
.theme-dark .leave-opt.main, .theme-dark .uni-badge, .theme-dark .profile-uni b, .theme-dark .fr-count,
.theme-dark .avatar, .theme-dark pre {
  background: #2c313c; color: #f1efe8; border-color: #3d4350;
}
.theme-dark .chip-btn.active, .theme-dark .seg button.active, .theme-dark .opt input:checked + span,
.theme-dark .wiz-choice.on, .theme-dark .planner-day.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.theme-dark .tab { color: rgba(255,255,255,.62); }
.theme-dark .cm-hero p, .theme-dark .study-card-text small { color: #b9b6ac; }

/* ---- study desk polish ---- */
.desk-top { position: relative; }
.desk-progress { position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: transparent; pointer-events: none; }
.desk-progress span { display: block; height: 100%; background: var(--sun); transition: width 1s linear; }
.desk-progress.resting span { background: var(--mint); }
.room-block-bar { width: 100%; max-width: 280px; height: 8px; margin: 10px auto 6px; background: #1d2026; border: 1.5px solid #181a1f; }
.room-block-bar span { display: block; height: 100%; background: var(--sun); transition: width 1s linear; }
.room-clock-card.resting .room-block-bar span { background: var(--mint); }
.room-block-meta { margin: 0 0 4px; font-size: 13.5px; font-weight: 600; color: #e6e3d8; }

.dk-cdot { width: 10px; height: 10px; flex: none; background: var(--c, #888); box-shadow: 0 0 0 1.5px #181a1f; }
.dk-linkbtn { flex: none; margin-right: 8px; border: 1px solid #596173; background: transparent; color: #c9cdd8; font-size: 11px; font-weight: 600; padding: 3px 7px; }
.dk-linkbtn:hover { border-color: var(--sun); color: var(--sun); }
.dk-linkbtn.warn { border-color: #8a6a1a; color: var(--sun); }

.dk-welcome { max-width: 420px; padding: 34px 30px; background: #2c3038; border: 2px solid #181a1f; box-shadow: 4px 4px 0 #181a1f; }
.dk-welcome-icon { display: inline-grid; place-items: center; width: 58px; height: 58px; margin-bottom: 12px; background: var(--sun); color: #141414; border: 2px solid #181a1f; }
.dk-welcome h2 { font-stretch: 78%; font-weight: 850; font-size: 26px; text-transform: uppercase; letter-spacing: .01em; }
.dk-welcome p { color: #c9cdd8; font-size: 14px; line-height: 1.5; }
.dk-welcome-open { margin: 14px 0 6px; padding: 9px 18px; font-size: 14px; background: var(--sun); color: #141414; }
.dk-welcome-open:hover { background: #ffd04d; }
.dk-welcome .dk-hint { margin: 8px 0 0; }

@media (min-width: 900px) {
  /* Music sits as the left column's footer instead of floating over it. */
  body.in-room #music-listen-btn {
    left: 0; bottom: 0; width: 260px; justify-content: center; padding: 13px 16px;
    border: 0; border-top: 3px solid #181a1f; border-right: 3px solid #181a1f; box-shadow: none;
  }
  body.in-room #music-listen-btn:hover { filter: brightness(1.06); }
  .desk-left { padding-bottom: 56px; }
}

/* ----- study desk: where files live ----- */
.dk-where { font-weight: 600; letter-spacing: 0; text-transform: none; color: #a9afbf; }
.dk-change { display: block; margin: 0 12px 8px; border: 0; padding: 0; text-decoration: underline; color: #a9afbf; }
.dk-change:hover { border: 0; }
.dk-chooser { display: grid; gap: 6px; margin: 4px 10px 12px; }
.dk-chooser .dk-hint { margin: 2px 2px 4px; }
.dk-chooser .dk-linkbtn { justify-self: end; margin: 2px 0 0; }
.dk-store {
  display: grid; gap: 2px; text-align: left; padding: 9px 11px; border: 1px solid #3d4352; border-radius: 10px;
  background: rgba(255, 255, 255, .03); color: #eceae3; cursor: pointer;
}
.dk-store strong { font-size: 13px; }
.dk-store span { font-size: 11.5px; color: #a9afbf; }
.dk-store:hover { border-color: var(--sun); }
.dk-store.on { border-color: var(--sun); background: rgba(255, 255, 255, .07); }
.dk-spin { margin-left: auto; width: 12px; height: 12px; border: 2px solid #596173; border-top-color: var(--sun); border-radius: 50%; animation: dk-spin .8s linear infinite; }
@keyframes dk-spin { to { transform: rotate(360deg); } }
.dk-btn.dk-del { margin-left: 6px; }
.dk-btn.dk-del:hover { border-color: var(--critical, #e5484d); color: var(--critical, #e5484d); }

/* ----- study desk: fold the folders away (computers) ----- */
.desk-body { position: relative; transition: grid-template-columns .22s ease; }
.desk.left-closed .desk-body { grid-template-columns: 0 minmax(0, 1fr) 360px; }
.desk.left-closed .desk-left { visibility: hidden; border-right: 0; }
.desk-fold {
  position: absolute; z-index: 6; top: 50%; left: 260px; transform: translate(-50%, -50%);
  width: 18px; height: 54px; display: grid; place-items: center; padding: 0;
  background: #3a404c; color: #f3f1ea; border: 2px solid #181a1f; box-shadow: 2px 2px 0 #181a1f;
  cursor: pointer; transition: left .22s ease, background .15s;
}
.desk-fold:hover { background: var(--sun); color: #141414; }
.desk.left-closed .desk-fold { left: 0; transform: translate(0, -50%); border-left: 0; width: 20px; }
@media (prefers-reduced-motion: reduce) { .desk-body, .desk-fold { transition: none; } }

/* ----- study desk on phones: one-line header, bottom tab bar ----- */
.desk-mclock, .desk-more, .desk-mbar { display: none; }
@media (max-width: 899px) {
  .desk-fold { display: none; }
  .desk.left-closed .desk-body { grid-template-columns: 1fr; }
  .desk.left-closed .desk-left { visibility: visible; }
  .desk-top { flex-wrap: nowrap; gap: 8px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); }
  .desk-top .desk-clock, .desk-top .desk-play, .desk-top .desk-people, .desk-top .room-exit, .desk-top #music-mini-inline { display: none !important; }
  .desk-title { min-width: 0; flex: 1 1 auto; }
  .desk-title .room-label { font-size: 10px; }
  .desk-title strong { font-size: 14px; }
  .desk-mclock {
    display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 7px 11px; min-height: 38px;
    background: #3a404c; color: #f3f1ea; border: 2px solid #181a1f; box-shadow: 2px 2px 0 #181a1f;
    font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums;
  }
  .desk-mclock.running { background: var(--sun); color: #141414; }
  .desk-mclock.resting.running { background: var(--mint, var(--good)); }
  .desk-more {
    display: grid; place-items: center; flex: none; width: 38px; height: 38px; padding: 0;
    background: #3a404c; color: #f3f1ea; border: 2px solid #181a1f; box-shadow: 2px 2px 0 #181a1f; font-size: 20px; line-height: 1;
  }
  .desk-mbar {
    display: flex; flex: none; background: #23262d; border-top: 3px solid #181a1f;
    padding: 4px 4px max(4px, env(safe-area-inset-bottom));
  }
  .desk-mbar button {
    position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 2px; border: 0; background: none; color: #a9afbf; font-size: 11px; font-weight: 700; min-height: 48px;
  }
  .desk-mbar button.on { color: var(--sun); }
  .desk-mbar button.on::before { content: ''; position: absolute; top: -4px; left: 22%; right: 22%; height: 3px; background: var(--sun); }
  .desk-mbar b { position: absolute; top: 3px; right: calc(50% - 20px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--sun); color: #141414; font-size: 10px; line-height: 16px; }
  .desk-mbar b.dot { min-width: 8px; width: 8px; height: 8px; padding: 0; background: var(--good); top: 6px; right: calc(50% - 14px); }
  body.in-room #music-listen-btn { display: none; }
  /* the PDF and file toolbars scroll sideways instead of wrapping into three rows */
  .dk-tool, .dk-tools2 { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .dk-tool::-webkit-scrollbar, .dk-tools2::-webkit-scrollbar { display: none; }
  .dk-tool > *, .dk-tools2 > * { flex: none; }
  .dk-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .desk-pbody { padding-bottom: 16px; }
  .dk-welcome { margin: 16px; padding: 24px 20px; }
}

/* ----- study card (session panel) ----- */
.room-study-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.room-study-btn {
  display: flex; align-items: flex-start; gap: 10px; text-align: left; padding: 11px 12px; min-height: 58px;
  background: #3a404c; color: #f3f1ea; border: 2px solid #181a1f; box-shadow: 2px 2px 0 #181a1f; cursor: pointer;
}
.room-study-btn .i { flex: none; margin-top: 1px; color: var(--sun); }
.room-study-btn span { display: grid; gap: 2px; min-width: 0; }
.room-study-btn strong { font-size: 13.5px; }
.room-study-btn small { font-size: 11.5px; color: #c9cdd8; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.room-study-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.room-study-card .review-row { margin-top: 10px; }

/* ----- comparing with friends: dotted lines where their day starts and ends ----- */
.friend-edge { position: absolute; left: 0; right: 0; z-index: 3; height: 0; border-top: 2px dotted var(--ink-2, #555); pointer-events: none; }
.friend-edge span {
  position: absolute; right: 2px; top: -15px; padding: 0 3px; font-size: 9.5px; font-weight: 700; white-space: nowrap;
  color: var(--ink-2, #555); background: var(--surface-solid); line-height: 13px;
}
.friend-edge.end span { top: 1px; }
.theme-dark .friend-edge { border-top-color: rgba(255, 255, 255, .55); }
.theme-dark .friend-edge span { color: rgba(255, 255, 255, .8); }

/* ----- free right now: plain text in the "Free time with" row ----- */
/* a green-tinted strip, in the app's card style, so it stands out above the chips */
.free-now-line {
  align-items: baseline; flex-wrap: wrap; gap: 6px 12px; padding: 10px 12px;
  background: color-mix(in srgb, var(--good) 13%, var(--surface-solid, #fff));
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
}
.free-now-line .free-label { display: inline-flex; align-items: center; gap: 6px; color: color-mix(in srgb, var(--good) 75%, var(--ink)); }
.free-now-line .free-label::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); }
.free-now-text { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--ink-2, #3a382f); }
.free-now-text strong { color: var(--ink); font-weight: 800; }
.theme-dark .free-now-line { background: color-mix(in srgb, var(--good) 22%, #1e2127); border-color: #0c0d10; box-shadow: 3px 3px 0 #0c0d10; }
.theme-dark .free-now-text, .theme-dark .free-now-text strong { color: #f3f1ea; }
.theme-dark .free-now-line .free-label { color: color-mix(in srgb, var(--good) 55%, #fff); }

/* ----- "Due for a look": the topic gets the full width, its buttons go underneath ----- */
.room-topic.review { flex-direction: column; align-items: stretch; gap: 8px; }
.room-topic.review .room-topic-text { line-height: 1.35; overflow-wrap: anywhere; }
.room-topic.review .room-topic-text small { margin-top: 3px; line-height: 1.3; }
.room-topic.review .room-row-actions { flex-wrap: wrap; justify-content: space-between; }

/* ======================= Notes: the library ======================= */
.nb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.nb-head h2 { margin: 0; font-stretch: 78%; font-weight: 900; font-size: 26px; text-transform: uppercase; }
.nb-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.nb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 10px; }
.nb-card { position: relative; }
.nb-open { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 0; border: 0; background: none; text-align: left; color: var(--ink); cursor: pointer; }
.nb-cover {
  position: relative; display: block; aspect-ratio: 3 / 4; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  background: var(--c); overflow: hidden; transition: transform .12s;
}
.nb-cover i { position: absolute; inset: 0 auto 0 0; width: 12%; background: rgba(0,0,0,.18); border-right: 2px solid rgba(0,0,0,.25); }
.nb-cover b { position: absolute; right: 12%; bottom: 8%; font-size: 44px; font-weight: 900; color: rgba(255,255,255,.88); font-stretch: 78%; }
.nb-open:hover .nb-cover { transform: translate(-1px, -1px); }
.nb-open:active .nb-cover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.nb-text { display: grid; gap: 2px; min-width: 0; }
.nb-text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-text small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-more { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border: 2px solid var(--ink); background: var(--surface-solid); color: var(--ink); font-size: 16px; line-height: 1; cursor: pointer; }
.nf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 10px; }
.nf-tile {
  position: relative; display: grid; gap: 3px; text-align: left; padding: 22px 14px 12px; cursor: pointer; color: var(--ink);
  background: var(--surface-solid); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
}
.nf-tile strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nf-tile small { font-size: 12px; color: var(--muted); }
.nf-tab { position: absolute; left: -2px; top: -2px; width: 46%; height: 12px; background: var(--c); border: 2px solid var(--ink); }
.nf-tile:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.nb-paper-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 6px; }
.nb-paper-opt input { position: absolute; opacity: 0; pointer-events: none; }
.nb-paper-opt span { display: grid; justify-items: center; gap: 6px; padding: 8px 4px; border: 2px solid var(--line); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.nb-paper-opt input:checked + span { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.nb-paper-opt i, .nbx-paper i { display: block; width: 40px; height: 52px; border: 1px solid #c9c4b6; background-color: #fff; }
.pp-lined { background-image: repeating-linear-gradient(#fff 0 6px, #b8c8e0 6px 7px); }
.pp-grid { background-image: linear-gradient(#c8d4e6 1px, transparent 1px), linear-gradient(90deg, #c8d4e6 1px, transparent 1px); background-size: 7px 7px; }
.pp-dotted { background-image: radial-gradient(#b8c4d8 1.1px, transparent 1.3px); background-size: 7px 7px; }

/* ======================= Notes: the editor ======================= */
#notes-root { position: fixed; inset: 0; z-index: 150; background: #e9e6de; }
#notes-root > div { height: 100%; }
body.in-notebook { overflow: hidden; }
.nbx { display: flex; flex-direction: column; height: 100%; min-height: 0; position: relative; background: #e9e6de; color: #141414; }
.nbx-bar {
  flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top));
  background: #fcfbf7; border-bottom: 2px solid #141414;
}
.nbx-title { min-width: 0; max-width: 40vw; border: 0; background: none; padding: 4px 6px; font-weight: 900; font-size: 16px; font-stretch: 85%; color: inherit; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: text; }
.nbx-status { font-size: 12px; color: #6b675d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nbx-grow { flex: 1; }
.nbx-ib { flex: none; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 2px solid #141414; background: #fff; color: #141414; font-size: 18px; font-weight: 700; cursor: pointer; }
.nbx-ib:active, .nbx-tool:active { transform: translate(1px, 1px); }
.nbx-zoom { flex: none; min-width: 52px; height: 36px; border: 2px solid #141414; background: #fff; color: #141414; font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; cursor: pointer; }
.nbx-tools {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 10px; overflow-x: auto; scrollbar-width: none;
  background: #fcfbf7; border-bottom: 2px solid #141414;
}
.nbx-tools::-webkit-scrollbar { display: none; }
.nbx-group { flex: none; display: flex; align-items: center; gap: 6px; }
.nbx-group + .nbx-group { padding-left: 10px; border-left: 1.5px solid #d3cebf; }
.nbx-tool { display: grid; justify-items: center; gap: 1px; min-width: 54px; padding: 4px 6px; border: 2px solid transparent; background: none; color: inherit; cursor: pointer; }
.nbx-tool span { font-size: 18px; line-height: 1.1; }
.nbx-tool small { font-size: 10.5px; font-weight: 700; }
.nbx-tool.on { border-color: #141414; background: var(--sun, #ffc21a); color: #141414; box-shadow: 2px 2px 0 #141414; }
.nbx-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(0,0,0,.25); background: var(--c); cursor: pointer; padding: 0; }
.nbx-swatch.on { outline: 3px solid #141414; outline-offset: 2px; }
.nbx-swatch.sm { width: 20px; height: 20px; }
.nbx-size { width: 34px; height: 34px; display: grid; place-items: center; border: 2px solid transparent; background: none; cursor: pointer; padding: 0; color: #141414; }
.nbx-size i { display: block; border-radius: 50%; background: currentColor; }
.nbx-size.on { border-color: #141414; background: #fff; }
.nbx-chip { flex: none; padding: 6px 10px; border: 2px solid #141414; background: #fff; color: #141414; font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.nbx-chip.on { background: #141414; color: #fff; }
.nbx-hint { font-size: 12.5px; color: #6b675d; white-space: nowrap; }
.nbx-scroll { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; }
.nbx-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 18px 12px 80px; width: max-content; min-width: 100%; box-sizing: border-box; }
.nbx-page { position: relative; flex: none; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18), 0 6px 18px rgba(0,0,0,.08); touch-action: none; user-select: none; -webkit-user-select: none; }
/* pages never scroll by themselves, even in Pencil-only mode: Safari counts the Pencil as a touch */
.nbx-canvas, .nbx-live { position: absolute; inset: 0; display: block; }
.nbx-live { pointer-events: none; }
.nbx-add { padding: 12px 22px; border: 2px dashed #8a857a; background: transparent; color: #4f4b42; font-weight: 800; cursor: pointer; }
.nbx-pageno { position: absolute; right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); padding: 4px 10px; background: rgba(20,20,20,.78); color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none; }
.nbx-msg { padding: 40px 16px; text-align: center; color: #6b675d; }
.nbx-sel { position: absolute; border: 2px dashed #1f5fd6; background: rgba(31,95,214,.05); cursor: move; touch-action: none; }
.nbx-sel-handle { position: absolute; right: -9px; bottom: -9px; width: 16px; height: 16px; background: #1f5fd6; border: 2px solid #fff; cursor: nwse-resize; }
.nbx-sel-menu { position: absolute; left: 0; top: -46px; display: flex; align-items: center; gap: 6px; padding: 5px 7px; background: #141414; white-space: nowrap; cursor: default; }
.nbx-sel-menu button:not(.nbx-swatch) { border: 0; background: none; color: #fff; font-size: 12.5px; font-weight: 700; padding: 3px 6px; cursor: pointer; }
.nbx-sel-menu button.danger { color: #ff8a80; }
.nbx-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; max-height: 40vh; overflow: auto; }
.nbx-thumb { aspect-ratio: 1000 / 1294; border: 2px solid var(--line); background: #fff; display: grid; place-items: end center; padding-bottom: 4px; font-size: 12px; font-weight: 800; color: #6b675d; cursor: pointer; }
.nbx-thumb.on { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); color: var(--ink); }
.nbx-papers { display: flex; gap: 8px; flex-wrap: wrap; }
.nbx-paper { display: grid; justify-items: center; gap: 6px; padding: 8px 10px; border: 2px solid var(--line); background: var(--surface-solid); color: var(--ink); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.nbx-paper.on { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
@media (max-width: 640px) {
  .nbx-bar .nbx-zoom, .nbx-bar [data-nb="zoom-in"], .nbx-bar [data-nb="zoom-out"] { display: none; }
  .nbx-tool { min-width: 46px; }
  .nbx-tool small { display: none; }
  .nbx-pages { padding: 10px 6px 70px; gap: 12px; }
}

/* the study desk: a notebook in a tab */
.dk-nbhost { flex: 1; min-height: 0; display: flex; flex-direction: column; height: 100%; }
.dk-nbhost .nbx { height: 100%; }
.dk-view:has(.dk-nbhost) { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.dk-kind.nb { background: var(--c, #2a78d6); color: #fff; }
.dk-nbs { border-top: 1.5px solid #3f4552; margin-top: 8px; padding-top: 6px; }

/* ----- "Beta" on the Notes tab, library and editor ----- */
.beta-pill {
  display: inline-block; flex: none; padding: 1px 6px; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
  background: var(--sun, #ffc21a); color: #141414; border: 1.5px solid #141414; line-height: 1.5;
}
.tab { position: relative; }
.tab-beta {
  position: absolute; top: 2px; right: 3px; padding: 0 4px; font-size: 8px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase;
  background: var(--sun, #ffc21a); color: #141414; border: 1px solid #141414; line-height: 1.4;
}
.nb-beta { display: flex; align-items: flex-start; gap: 10px; flex: 1 1 320px; }
.nb-beta p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.nb-beta .beta-pill { margin-top: 2px; }
@media (min-width: 1100px) {
  /* the side menu: the badge sits after the word, not above the icon */
  .tab-beta { position: static; margin-left: -6px; font-size: 9.5px; padding: 1px 5px; }
}

/* ----- notes: the pen / highlighter / eraser options menu ----- */
.nbx-pop {
  position: absolute; z-index: 20; width: min(440px, calc(100% - 16px)); max-height: min(70vh, 640px); overflow: auto;
  background: #fcfbf7; color: #141414; border: 2px solid #141414; box-shadow: 5px 5px 0 #141414; padding: 12px 14px 14px;
}
.nbx-pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.nbx-pop-head strong { font-size: 15px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.nbx-pop-x { width: 30px; height: 30px; border: 2px solid #141414; background: #fff; cursor: pointer; font-weight: 800; }
.nbx-pens { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; margin-bottom: 12px; }
.nbx-pen { display: grid; gap: 1px; text-align: left; padding: 6px 8px 8px; border: 2px solid #d3cebf; background: #fff; color: #141414; cursor: pointer; }
.nbx-pen canvas { width: 100%; height: 35px; display: block; }
.nbx-pen strong { font-size: 13px; }
.nbx-pen small { font-size: 11px; color: #6b675d; line-height: 1.25; }
.nbx-pen.on { border-color: #141414; box-shadow: 3px 3px 0 #141414; background: #fff7d6; }
.nbx-slider { display: grid; gap: 6px; margin: 10px 0 4px; font-size: 13px; font-weight: 700; }
.nbx-slider span { display: flex; justify-content: space-between; }
.nbx-slider b { font-variant-numeric: tabular-nums; }
.nbx-slider input[type=range] { width: 100%; accent-color: #141414; height: 28px; }
.nbx-pop-hint { margin: 0 0 8px; font-size: 12px; color: #6b675d; line-height: 1.4; }
.nbx-check { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; font-size: 13px; line-height: 1.35; cursor: pointer; }
.nbx-check input { width: 18px; height: 18px; margin-top: 1px; accent-color: #141414; flex: none; }
.nbx-opts { font-variant-numeric: tabular-nums; }

/* the whole notebook area handles its own touch: no Safari scrolling or zooming of the page */
.nbx-scroll { touch-action: none; overscroll-behavior: contain; }
.nbx-flash {
  position: absolute; left: 50%; top: 120px; transform: translateX(-50%); z-index: 30; pointer-events: none;
  padding: 7px 16px; background: rgba(20,20,20,.85); color: #fff; font-weight: 800; font-size: 14px; opacity: 0;
}
.nbx-flash.show { animation: nbx-flash 1.1s ease-out; }
@keyframes nbx-flash { 0% { opacity: 0; } 12% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
