:root {
  --paper: #f6f0e4;
  --paper-2: #eee4d1;
  --card: #fbf8f1;
  --ink: #2b2420;
  --ink-soft: #6b5d52;
  --ink-faint: #9a8b7d;
  --rule: #dccfb9;
  --wood: #3a2a1f;
  --wood-2: #4d3829;
  --on-wood: #f3e9d6;
  --green: #2f5b4c;
  --green-2: #3f7462;
  --green-soft: #dde7de;
  --brass: #a9864f;
  --red: #973a2c;
  --shadow: 0 1px 2px rgba(58, 42, 31, .08), 0 4px 14px rgba(58, 42, 31, .07);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --mono: "Courier Prime", "Courier New", Courier, monospace;
  --heat-0: #e9dfcc;
  --heat-1: #cfdccf;
  --heat-2: #8fb3a0;
  --heat-3: #2f5b4c;
  color-scheme: light;
}
[data-theme="night"] {
  --paper: #1f1a16;
  --paper-2: #26201b;
  --card: #2a231d;
  --ink: #ece2d0;
  --ink-soft: #bfb19f;
  --ink-faint: #8d7f70;
  --rule: #40362d;
  --wood: #15110e;
  --wood-2: #2a211a;
  --on-wood: #ece2d0;
  --green: #7fb39d;
  --green-2: #9cc8b4;
  --green-soft: #2b3a33;
  --brass: #c9a66b;
  --red: #e08a76;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  --heat-0: #2e2721;
  --heat-1: #34483f;
  --heat-2: #4f7e6b;
  --heat-3: #8cc2aa;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  background-image: radial-gradient(ellipse at 50% -10%, rgba(255, 245, 220, .55), transparent 60%);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
[data-theme="night"] body { background-image: radial-gradient(ellipse at 50% -10%, rgba(201, 166, 107, .10), transparent 60%); }
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(169, 134, 79, .35); }

.boot { display: grid; place-items: center; height: 100vh; font-size: 22px; letter-spacing: .08em; color: var(--ink-faint); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 22px;
  padding: 10px 22px; min-height: 56px;
  background: var(--wood); color: var(--on-wood);
  border-bottom: 3px solid var(--brass);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.wordmark { color: var(--on-wood); text-decoration: none; font-size: 21px; letter-spacing: .02em; white-space: nowrap; }
.wordmark b { color: var(--brass); font-weight: 600; }
.topnav { display: flex; gap: 4px; }
.topnav a {
  color: var(--on-wood); opacity: .78; text-decoration: none; padding: 6px 11px; border-radius: 6px;
  font-size: 15px; letter-spacing: .03em;
}
.topnav a:hover { opacity: 1; background: rgba(255, 255, 255, .07); }
.topnav a.on { opacity: 1; background: rgba(255, 255, 255, .1); }
.spacer { flex: 1; }
.meter { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--on-wood); }
.meter .bar { width: 120px; height: 7px; border-radius: 6px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.meter .fill { height: 100%; background: var(--brass); border-radius: 6px; transition: width .35s ease; }
.meter.done .fill { background: #8cc2aa; }
.meter .num { font-variant-numeric: tabular-nums; font-size: 15px; white-space: nowrap; }
.meter .num small { opacity: .7; }
.iconbtn {
  background: none; border: 1px solid transparent; color: inherit; cursor: pointer;
  border-radius: 8px; padding: 6px 8px; line-height: 0;
}
.iconbtn:hover { background: rgba(127, 110, 90, .12); }
.topbar .iconbtn:hover { background: rgba(255, 255, 255, .1); }
.iconbtn svg { width: 20px; height: 20px; }

/* ---------- general ---------- */
.page { max-width: 1060px; margin: 0 auto; padding: 34px 24px 80px; }
.page.narrow { max-width: 720px; }
h1, h2, h3 { font-weight: 500; line-height: 1.2; margin: 0; }
h1 { font-size: 34px; letter-spacing: -.005em; }
h2 { font-size: 23px; }
.label {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint);
}
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.row { display: flex; align-items: center; gap: 12px; }
.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 14px; }
hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 28px 0; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 9px 18px; border-radius: 8px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink);
  font-size: 16px; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--ink-faint); }
.btn.primary { background: var(--green); border-color: var(--green); color: #f7f2e7; }
[data-theme="night"] .btn.primary { color: #13201a; }
.btn.primary:hover { background: var(--green-2); }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn.small { padding: 5px 12px; font-size: 14px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn.ghost:hover { background: rgba(127, 110, 90, .1); color: var(--ink); }
.btn:disabled { opacity: .55; cursor: default; }

input.text, select.text, textarea.text {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--rule);
  background: var(--card); outline: none; font-size: 16px;
}
input.text:focus, select.text:focus, textarea.text:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(47, 91, 76, .14); }
.field { display: block; }
.field > span { display: block; margin-bottom: 6px; font-size: 14px; color: var(--ink-soft); }
.hint { font-size: 14px; color: var(--ink-faint); margin-top: 6px; }
.error { color: var(--red); font-size: 15px; min-height: 1em; }

.card {
  background: var(--card); border: 1px solid var(--rule); border-radius: 12px;
  box-shadow: var(--shadow); padding: 22px;
}

/* ---------- welcome ---------- */
.welcome { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.welcome .left {
  background: var(--wood); color: var(--on-wood); padding: 56px 60px; display: flex; flex-direction: column;
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 120px),
    radial-gradient(ellipse at 20% 0%, rgba(201, 166, 107, .22), transparent 55%);
}
.welcome .left .wordmark { font-size: 26px; }
.welcome .pitch { margin: auto 0; max-width: 470px; }
.welcome .pitch h1 { font-size: 46px; line-height: 1.1; color: var(--on-wood); }
.welcome .pitch p { font-size: 19px; opacity: .85; margin: 22px 0 0; }
.welcome .promise {
  margin-top: 34px; padding: 14px 18px; border-left: 3px solid var(--brass);
  background: rgba(255, 255, 255, .05); font-size: 16px; opacity: .9;
}
.shelf-art { display: flex; align-items: flex-end; gap: 5px; height: 84px; margin-top: 40px; opacity: .85; }
.shelf-art i { display: block; width: 18px; border-radius: 2px 2px 0 0; }
.welcome .right { display: grid; place-items: center; padding: 40px 24px; }
.auth { width: 100%; max-width: 380px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 22px; }
.tabs button {
  background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--ink-faint);
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 17px;
}
.tabs button.on { color: var(--ink); border-bottom-color: var(--green); }

/* ---------- desk ---------- */
.desk-head { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; margin-bottom: 30px; }
.today-card { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; margin-bottom: 40px; }
.ring { width: 118px; height: 118px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--heat-0); }
.ring .prog { stroke: var(--green); transition: stroke-dashoffset .5s ease; }
.ring .in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .in b { font-size: 30px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1; }
.ring .in small { font-size: 12px; color: var(--ink-faint); letter-spacing: .1em; text-transform: uppercase; margin-top: 4px; }
.today-card h2 { margin-bottom: 6px; }
.today-stats { display: flex; gap: 28px; margin-top: 12px; flex-wrap: wrap; }
.today-stats div b { display: block; font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }

.shelf { margin-bottom: 36px; }
.shelf-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.shelf-head h2 { font-size: 20px; }
.books {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px;
  padding-bottom: 16px; border-bottom: 6px solid var(--wood-2); border-radius: 0 0 3px 3px;
  box-shadow: 0 10px 12px -10px rgba(58, 42, 31, .45);
}
.book {
  position: relative; display: block; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--rule); border-radius: 4px 10px 10px 4px;
  padding: 16px 16px 14px 24px; min-height: 132px; box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.book::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 9px; border-radius: 4px 0 0 4px;
  background: var(--spine, var(--green));
}
.book:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(58, 42, 31, .14); }
.book h3 { font-size: 19px; margin: 4px 0 10px; overflow-wrap: anywhere; }
.book .meta { font-size: 14px; color: var(--ink-faint); }
.empty-desk { text-align: center; padding: 60px 20px; border: 1px dashed var(--rule); border-radius: 14px; }
.empty-desk p { max-width: 430px; margin: 10px auto 22px; color: var(--ink-soft); }

/* type picker */
.types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.type-opt {
  text-align: left; padding: 14px; border: 1px solid var(--rule); border-radius: 10px; background: var(--card);
  cursor: pointer; position: relative; overflow: hidden;
}
.type-opt::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--spine); }
.type-opt b { display: block; font-weight: 500; font-size: 17px; }
.type-opt span { font-size: 13.5px; color: var(--ink-faint); line-height: 1.35; display: block; margin-top: 3px; }
.type-opt.on { border-color: var(--green); box-shadow: 0 0 0 2px rgba(47, 91, 76, .25); }

/* ---------- modal ---------- */
.scrim {
  position: fixed; inset: 0; background: rgba(30, 22, 16, .45); z-index: 50;
  display: grid; place-items: center; padding: 20px; animation: fade .15s ease;
}
.modal {
  width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow: auto;
  background: var(--paper); border-radius: 14px; border: 1px solid var(--rule);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3); padding: 26px;
}
.modal h2 { margin-bottom: 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
@keyframes fade { from { opacity: 0; } }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; }
.toast {
  background: var(--wood); color: var(--on-wood); padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow);
  font-size: 15px; animation: fade .2s ease; max-width: 90vw;
}
.toast.err { background: var(--red); color: #fff; }

/* ---------- project / writing room ---------- */
.room { display: grid; grid-template-columns: 290px 1fr; min-height: calc(100vh - 59px); }
.rail {
  background: var(--paper-2); border-right: 1px solid var(--rule); padding: 20px 14px 40px;
  position: sticky; top: 59px; height: calc(100vh - 59px); overflow-y: auto;
}
.rail-title { padding: 0 8px 14px; border-bottom: 1px solid var(--rule); margin-bottom: 14px; }
.rail-title h2 { font-size: 20px; overflow-wrap: anywhere; }
.rail-title .row { justify-content: space-between; margin-top: 6px; }
.rail-group { margin-bottom: 18px; }
.rail-group > .head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; }
.rail-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 6px 8px; border-radius: 7px; border: 0; background: none; cursor: pointer;
  color: var(--ink); font-size: 15.5px; text-decoration: none; line-height: 1.3;
}
.rail-item:hover { background: rgba(127, 110, 90, .1); }
.rail-item.on { background: var(--card); box-shadow: var(--shadow); }
.rail-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-item .w { font-size: 12.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.rail-item.container { font-weight: 600; margin-top: 4px; }
.rail-item.scene { padding-left: 22px; }
.rail-item.scene.top { padding-left: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; border: 1.5px solid var(--ink-faint); }
.dot.full { background: var(--green); border-color: var(--green); }
.add-link {
  background: none; border: 0; color: var(--green); cursor: pointer; font-size: 14px; padding: 4px 8px; border-radius: 6px;
}
.add-link:hover { background: rgba(47, 91, 76, .1); }
.add-link.indent { padding-left: 22px; }
.rail-foot { border-top: 1px solid var(--rule); padding-top: 14px; margin-top: 8px; }
.twisty { width: 14px; height: 14px; flex: none; transition: transform .15s; color: var(--ink-faint); }
.collapsed .twisty { transform: rotate(-90deg); }

.desk-pane { padding: 26px 32px 120px; min-width: 0; }
.paper {
  max-width: 740px; margin: 0 auto; background: var(--card); border: 1px solid var(--rule); border-radius: 6px;
  box-shadow: var(--shadow); padding: 44px 60px 70px; min-height: 70vh;
}
.crumbs { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }
.title-input {
  width: 100%; border: 0; background: transparent; font-size: 30px; outline: none; padding: 2px 0;
  font-family: var(--serif); color: var(--ink);
}
.title-input::placeholder { color: var(--ink-faint); }
.notes-toggle { background: none; border: 0; padding: 0; color: var(--ink-soft); cursor: pointer; font-size: 14.5px; margin: 6px 0 4px; }
.notes {
  width: 100%; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper);
  padding: 10px 12px; font-size: 15.5px; line-height: 1.5; resize: vertical; outline: none; min-height: 70px;
  color: var(--ink-soft);
}
.notes:focus { border-color: var(--green); }
.writing {
  display: block; width: 100%; border: 0; outline: none; resize: none; background: transparent;
  font-family: var(--serif); font-size: 19.5px; line-height: 1.75; color: var(--ink);
  min-height: 55vh; margin-top: 22px; overflow: hidden; padding: 0;
}
.writing::placeholder { color: var(--ink-faint); font-style: italic; }
.writing.mono { font-family: var(--mono); font-size: 17px; line-height: 1.6; }
.writing.poem { line-height: 1.6; }
.paper-foot {
  position: sticky; bottom: 0; margin: 0 auto; max-width: 740px; display: flex; gap: 16px; align-items: center;
  padding: 10px 6px; font-size: 14px; color: var(--ink-faint); background: linear-gradient(transparent, var(--paper) 35%);
}
.paper-foot .saved.dirty { color: var(--brass); }
.paper-foot .saved.fail { color: var(--red); }

.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px;
  background: var(--card); border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
  padding: 6px; animation: fade .12s ease;
}
.menu button, .menu a {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 6px;
  cursor: pointer; font-size: 15px; color: var(--ink); text-decoration: none;
}
.menu button:hover, .menu a:hover { background: rgba(127, 110, 90, .1); }
.menu .sep { border-top: 1px solid var(--rule); margin: 6px 4px; }
.menu .danger { color: var(--red); }
.menu .label { padding: 6px 10px 2px; }

/* index cards for chapter/act outlines */
.cards { display: grid; gap: 14px; margin-top: 24px; }
.index-card {
  background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 12px 16px 10px;
}
.index-card .row { justify-content: space-between; margin: 0 -16px; padding: 0 16px 10px; border-bottom: 1px solid rgba(151, 58, 44, .28); }
.index-card input { border: 0; background: transparent; font-size: 18px; outline: none; flex: 1 1 160px; min-width: 0; width: 0; padding: 0; height: 30px; }
.index-card .row { flex-wrap: wrap; row-gap: 6px; }
.index-card .row > .faint:nth-child(3) { margin-left: auto; }
.index-card textarea {
  width: 100%; border: 0; background: transparent; resize: vertical; outline: none; margin-top: 6px;
  font-size: 15.5px; line-height: 1.55; color: var(--ink-soft); min-height: 48px;
}

/* single-page header */
.single-head { max-width: 740px; margin: 0 auto 14px; display: flex; align-items: center; gap: 12px; }
.single-head .title-input { font-size: 26px; }

/* focus mode */
body.focus .topbar, body.focus .rail, body.focus .single-head .hide-focus { display: none; }
body.focus .room { grid-template-columns: 1fr; }
body.focus .paper { border-color: transparent; box-shadow: none; background: transparent; }
.focus-exit { position: fixed; top: 14px; right: 18px; z-index: 40; display: none; }
body.focus .focus-exit { display: inline-flex; }
.focus-meter { position: fixed; top: 18px; left: 22px; z-index: 40; display: none; color: var(--ink-faint); font-size: 14px; font-variant-numeric: tabular-nums; }
body.focus .focus-meter { display: block; }

/* manuscript */
.manuscript { max-width: 700px; margin: 0 auto; }
.manuscript .ms-body { font-size: 19px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: break-word; }
.manuscript .ms-body.mono { font-family: var(--mono); font-size: 16.5px; }
.manuscript h2.ms-container { text-align: center; margin: 56px 0 26px; font-size: 26px; }
.manuscript h3.ms-scene { font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin: 30px 0 12px; }
.manuscript h3.ms-scene a { color: inherit; text-decoration: none; }
.manuscript h3.ms-scene a:hover { color: var(--green); }
.manuscript .break { text-align: center; color: var(--ink-faint); margin: 26px 0; letter-spacing: .5em; }
.manuscript .unwritten { color: var(--ink-faint); font-style: italic; }

/* ---------- stats ---------- */
.bignums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0 30px; }
.bignum { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 18px; }
.bignum b { display: block; font-size: 32px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.1; }
.bignum span { font-size: 14px; color: var(--ink-faint); }
.heat-wrap { overflow-x: auto; padding-bottom: 6px; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 14px); gap: 3px; width: max-content; }
.heat i { width: 14px; height: 14px; border-radius: 3px; background: var(--heat-0); display: block; }
.heat i.l1 { background: var(--heat-1); }
.heat i.l2 { background: var(--heat-2); }
.heat i.l3 { background: var(--heat-3); }
.heat i.future { background: transparent; }
.heat i.today { outline: 1.5px solid var(--brass); outline-offset: 1px; }
.heat-legend { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-faint); margin-top: 10px; }
.heat-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 150px; margin-top: 16px; }
.week-bars .col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.week-bars .b { width: 100%; max-width: 46px; background: var(--heat-2); border-radius: 5px 5px 2px 2px; min-height: 3px; position: relative; }
.week-bars .b.met { background: var(--green); }
.week-bars .col small { font-size: 12.5px; color: var(--ink-faint); }
.week-bars .col .v { font-size: 12.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.goal-line { position: relative; }

/* ---------- friends ---------- */
.friend {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 16px; background: var(--card); border: 1px solid var(--rule); border-radius: 12px;
}
.avatar {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 19px;
  background: var(--spine, var(--green)); color: #f7f2e7;
}
.friend .mini { height: 6px; background: var(--heat-0); border-radius: 4px; overflow: hidden; margin-top: 6px; max-width: 260px; }
.friend .mini i { display: block; height: 100%; background: var(--green); }
.friend a.name { color: var(--ink); text-decoration: none; font-size: 17.5px; }
.friend a.name:hover { color: var(--green); }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { display: none; }
.switch .knob { width: 44px; height: 26px; border-radius: 20px; background: var(--rule); position: relative; transition: background .2s; flex: none; }
.switch .knob::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: left .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + .knob { background: var(--green); }
.switch input:checked + .knob::after { left: 21px; }

.pledge { border-left: 3px solid var(--brass); padding: 10px 16px; background: var(--card); border-radius: 0 8px 8px 0; color: var(--ink-soft); }

.mobile-only { display: none; }

@media (max-width: 860px) {
  .welcome { grid-template-columns: 1fr; }
  .welcome .left { padding: 36px 28px; }
  .welcome .pitch { margin: 40px 0 10px; }
  .welcome .pitch h1 { font-size: 36px; }
  .shelf-art { display: none; }
  .room { grid-template-columns: 1fr; }
  .rail {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100%; width: 300px; max-width: 86vw; z-index: 45;
    transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .25);
  }
  .rail.open { transform: none; }
  .rail-scrim { position: fixed; inset: 0; background: rgba(30, 22, 16, .35); z-index: 44; }
  .mobile-only { display: inline-flex; }
  .desk-pane { padding: 16px 12px 100px; }
  .paper { padding: 26px 22px 50px; }
  .writing { font-size: 18.5px; }
  .bignums { grid-template-columns: repeat(2, 1fr); }
  .types { grid-template-columns: repeat(2, 1fr); }
  .topbar { gap: 10px; padding: 8px 12px; flex-wrap: wrap; }
  .topnav { order: 3; width: 100%; justify-content: space-between; }
  .topnav a { padding: 5px 8px; }
  .meter .bar { width: 70px; }
  .desk-head { grid-template-columns: 1fr; }
  .today-card { grid-template-columns: auto 1fr; gap: 16px; padding: 18px; }
  .today-card .ring { width: 84px; height: 84px; }
  .today-card .ring .in b { font-size: 22px; }
  .today-card h2 { font-size: 18px; }
  .today-stats { gap: 16px; }
  .today-stats div b { font-size: 18px; }
  .today-stats span { font-size: 13px; }
  h1 { font-size: 28px; }
  .page { padding: 24px 16px 70px; }
  .rail { top: 0; }
}
@media (max-width: 420px) {
  .types { grid-template-columns: 1fr; }
}

/* import */
.dropzone {
  border: 2px dashed var(--rule); border-radius: 12px; padding: 34px 20px; text-align: center; cursor: pointer;
  background: var(--card); margin-bottom: 12px; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over, .dropzone:focus { border-color: var(--green); background: var(--green-soft); outline: none; }
.dropzone b { color: var(--green); font-weight: 500; }
.import-preview {
  max-height: 240px; overflow: auto; border: 1px solid var(--rule); border-radius: 10px; padding: 12px 16px;
  background: var(--card); font-size: 15px; margin-bottom: 12px;
}
.import-preview ol { margin: 4px 0 10px; padding-left: 22px; }
.import-preview li { padding: 2px 0; }
.import-preview li { display: list-item; }
.import-preview li > span:last-child { float: right; font-size: 13px; margin-left: 12px; }
.pv-ct { font-weight: 600; margin-top: 6px; }
