/* Recall — web UI. Anthropic-style light theme: ivory paper, slate ink, clay accent. */
:root {
  --bg: #faf9f5;
  --bg-2: #f3f1ea;
  --surface: #ffffff;
  --surface-2: #f7f6f1;
  --border: #e8e6dc;
  --border-strong: #d8d5c7;
  --ink: #141413;
  --ink-2: #3d3d3a;
  --muted: #6f6e68;
  --faint: #a8a69c;

  --clay: #d97757;
  --clay-strong: #c6613f;
  --clay-soft: #f6e6de;
  --clay-wash: #fbf1ec;
  --olive: #788c5d;
  --olive-soft: #e9eee2;
  --sky: #6a9bcc;
  --sky-soft: #e4edf6;
  --kraft: #c9a26b;
  --kraft-soft: #f5ecdc;
  --red: #bf4d43;
  --red-soft: #f6e1de;
  --plum: #9b7bb0;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 19, 0.04), 0 1px 1px rgba(20, 20, 19, 0.03);
  --shadow: 0 1px 2px rgba(20, 20, 19, 0.04), 0 6px 20px -8px rgba(20, 20, 19, 0.12);
  --shadow-lg: 0 2px 6px rgba(20, 20, 19, 0.05), 0 24px 60px -20px rgba(20, 20, 19, 0.28);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);

  --serif: "Source Serif 4", "Tiempos Text", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--clay-soft); }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 34px; line-height: 1.15; }
h2 { font-size: 22px; line-height: 1.25; }
h3 { font-size: 17px; line-height: 1.3; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.serif { font-family: var(--serif); }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  padding: 22px 14px 18px;
  border-right: 1px solid var(--border);
  background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; text-decoration: none; }
.brand-mark { width: 26px; height: 26px; color: var(--clay); transition: transform 0.8s var(--spring); }
.brand:hover .brand-mark { transform: rotate(90deg); }
.brand-name { font-family: var(--serif); font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }

.nav { position: relative; display: flex; flex-direction: column; gap: 2px; }
.nav-pill {
  position: absolute; left: 0; right: 0; top: 0; height: 38px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-sm);
  transition: transform 0.45s var(--ease-out), height 0.45s var(--ease-out), opacity 0.2s;
  pointer-events: none;
}
.nav a {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 12px;
  border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 14px;
  transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--ink); background: rgba(20, 20, 19, 0.035); }
.nav a.active { color: var(--ink); background: transparent; }
.nav a svg { width: 18px; height: 18px; flex: none; color: var(--muted); transition: color 0.2s; }
.nav a.active svg { color: var(--clay); }
.nav .badge {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px;
  display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 600;
  background: var(--clay); color: white; font-variant-numeric: tabular-nums;
  animation: pop 0.5s var(--spring);
}
.nav .badge.soft { background: var(--bg-2); color: var(--muted); }

.sidebar-section { margin-top: 18px; padding: 0 10px; }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.link-btn { background: none; border: 0; padding: 4px 6px; border-radius: 6px; cursor: pointer; color: var(--muted); font-size: 12.5px; }
.link-btn:hover { color: var(--ink); background: var(--bg-2); }

.main { min-width: 0; padding: 40px 48px 80px; }
.view { max-width: 1120px; margin: 0 auto; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.view-head p { margin: 8px 0 0; color: var(--muted); max-width: 60ch; }

/* staggered entrance */
.enter > * { animation: rise 0.6s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  font-weight: 500; font-size: 14px; white-space: nowrap; text-decoration: none;
  transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: var(--faint); box-shadow: var(--shadow); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--clay); border-color: var(--clay); color: #fff; }
.btn.primary:hover { background: var(--clay-strong); border-color: var(--clay-strong); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.dark:hover { background: #2b2b29; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { background: var(--bg-2); color: var(--ink); }
.btn.danger:hover { color: var(--red); border-color: #e0b3ad; background: var(--red-soft); }
.btn.success:hover { color: #4d6236; border-color: #c3cfb3; background: var(--olive-soft); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.kbd { font: 500 11px/1 var(--mono); padding: 3px 5px; border-radius: 5px; border: 1px solid currentColor; opacity: 0.55; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 10px;
  padding: 9px 12px; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--clay); box-shadow: 0 0 0 4px var(--clay-wash); }
.textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.select { appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236f6e68' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.search { position: relative; flex: 1; min-width: 220px; }
.search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--faint); }
.search .input { padding-left: 36px; height: 40px; }

/* segmented control with sliding thumb */
.seg { position: relative; display: inline-flex; padding: 3px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--border); }
.seg button { position: relative; z-index: 1; border: 0; background: none; height: 30px; padding: 0 13px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--muted); transition: color 0.25s; }
.seg button.on { color: var(--ink); }
.seg .thumb { position: absolute; top: 3px; bottom: 3px; left: 0; border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform 0.4s var(--ease-out), width 0.4s var(--ease-out); }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.chip.clay { background: var(--clay-soft); color: #9c4a2d; }
.chip.olive { background: var(--olive-soft); color: #4d6236; }
.chip.sky { background: var(--sky-soft); color: #3c6894; }
.chip.kraft { background: var(--kraft-soft); color: #7d5d2d; }
.chip.red { background: var(--red-soft); color: #9a3b32; }
.chip.outline { background: transparent; border: 1px solid var(--border-strong); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- cards & panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.panel-pad { padding: 22px 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }

.stat { padding: 18px 20px; position: relative; overflow: hidden; transition: transform 0.3s var(--ease-out), box-shadow 0.3s; }
a.stat { text-decoration: none; }
a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat .label { padding-right: 22px; display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.stat .value { font-family: var(--serif); font-size: 34px; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat .sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.stat .icon { position: absolute; right: 16px; top: 16px; width: 18px; height: 18px; color: var(--faint); }

/* hero */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 30px 32px;
  background: linear-gradient(135deg, #fff 0%, var(--clay-wash) 100%);
  border: 1px solid #efdcd2; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.hero .big { font-family: var(--serif); font-size: 64px; line-height: 1; letter-spacing: -0.03em; color: var(--clay-strong); font-variant-numeric: tabular-nums; }
.hero .orb { position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(217,119,87,0.18), transparent 65%); animation: breathe 6s ease-in-out infinite; pointer-events: none; }
.hero.calm { background: linear-gradient(135deg, #fff 0%, var(--olive-soft) 100%); border-color: #dde5d2; }
.hero.calm .big { color: var(--olive); }
.hero.calm .orb { background: radial-gradient(circle, rgba(120,140,93,0.2), transparent 65%); }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.12); opacity: 1; } }

/* bar chart */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; min-width: 0; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; }
.bar { width: min(100%, 38px); border-radius: 7px 7px 4px 4px; background: var(--clay); transform-origin: bottom; animation: grow 0.8s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); min-height: 3px; position: relative; transition: filter 0.2s; }
.bar.zero { background: var(--border); }
.bar-col:hover .bar { filter: brightness(1.06) saturate(1.1); }
.bar-val { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; animation: fade 0.4s both; animation-delay: calc(0.4s + var(--i, 0) * 60ms); }
.bar-lbl { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.bar-col.today .bar-lbl { color: var(--clay-strong); font-weight: 600; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.meter { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; display: flex; }
.meter > span { display: block; height: 100%; transform-origin: left; animation: growx 0.9s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* projects */
.project { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; transition: transform 0.3s var(--ease-out), box-shadow 0.3s; }
.project:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.project .desc { font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-stats { display: flex; gap: 18px; }
.mini-stats div { display: flex; flex-direction: column; }
.mini-stats b { font-family: var(--serif); font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: 11.5px; color: var(--muted); }
.topic-row { display: grid; grid-template-columns: 1fr 70px 34px; gap: 10px; align-items: center; font-size: 13px; padding: 3px 0; }
.topic-row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }

/* ---------- flashcards (drafts / library) ---------- */
.fc { position: relative; padding: 22px 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: box-shadow 0.25s, border-color 0.25s, transform 0.25s var(--ease-out); }
.fc:hover { box-shadow: var(--shadow); }
.fc.selected { border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-wash), var(--shadow); }
.fc-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.fc-front { font-family: var(--serif); font-size: 19px; line-height: 1.4; color: var(--ink); white-space: pre-wrap; }
.fc-divider { height: 1px; background: var(--border); margin: 16px 0; position: relative; }
.fc-back { white-space: pre-wrap; color: var(--ink-2); }
.fc-section { margin-top: 14px; }
.fc-section .eyebrow { margin-bottom: 6px; font-size: 11px; }
.kp { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.kp li { position: relative; padding-left: 20px; font-size: 14px; color: var(--ink-2); }
.kp li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 6px; height: 6px; border-radius: 2px; background: var(--clay); transform: rotate(45deg); }
.quote { border-left: 3px solid var(--kraft); padding: 6px 0 6px 14px; font-family: var(--serif); font-style: italic; color: var(--ink-2); font-size: 14.5px; white-space: pre-wrap; }
.warn { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; background: var(--kraft-soft); border-radius: 10px; font-size: 13px; color: #6d4f22; margin-top: 4px; }
.warn svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.fc-actions { display: flex; gap: 8px; margin-top: 18px; align-items: center; flex-wrap: wrap; }
.check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border-strong); background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; transition: all 0.2s var(--ease); flex: none; padding: 0; }
.check svg { width: 13px; height: 13px; color: white; transform: scale(0); transition: transform 0.25s var(--spring); }
.check.on { background: var(--clay); border-color: var(--clay); }
.check.on svg { transform: scale(1); }
.details summary { cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.details summary::-webkit-details-marker { display: none; }
.details summary svg { width: 14px; height: 14px; transition: transform 0.25s var(--ease); }
.details[open] summary svg { transform: rotate(90deg); }
.details[open] > :not(summary) { animation: rise 0.35s var(--ease-out); }

/* bulk action bar */
.bulkbar {
  position: fixed; left: 50%; bottom: 28px; z-index: 40; transform: translate(-50%, 140%);
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 18px; border-radius: 16px;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg);
  transition: transform 0.5s var(--spring), visibility 0s 0.5s;
  visibility: hidden;
}
.bulkbar { transform: translate(-50%, calc(100% + 48px)); }
.bulkbar.show { transform: translate(-50%, 0); visibility: visible; transition: transform 0.5s var(--spring), visibility 0s; }
.bulkbar .btn { box-shadow: none; }
.bulkbar .btn.ghost { color: #c9c7bd; }
.bulkbar .btn.ghost:hover { background: #2b2b29; color: #fff; }

/* list rows */
.list { display: flex; flex-direction: column; }
.lrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.2s; }
.lrow:last-child { border-bottom: 0; }
.lrow:hover { background: var(--surface-2); }
.lrow .t { font-family: var(--serif); font-size: 16px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lrow .m { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.lrow .r { display: flex; align-items: center; gap: 14px; }
.ring { --p: 0; --c: var(--olive); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--bg-2) 0); position: relative; flex: none; transition: --p 1s; }
.ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ring.lg { width: 92px; height: 92px; }
.ring.lg::before { inset: 8px; }
.ring.lg span { font-family: var(--serif); font-size: 24px; font-weight: 500; }
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(20, 20, 19, 0.24); backdrop-filter: blur(2px); animation: fade 0.3s both; }
.scrim.out { animation: fade 0.25s reverse both; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 51; width: min(620px, 100vw);
  background: var(--bg); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: slidein 0.5s var(--ease-out) both;
}
.drawer.out { animation: slideout 0.3s var(--ease) both; }
@keyframes slidein { from { transform: translateX(100%); } to { transform: none; } }
@keyframes slideout { from { transform: none; } to { transform: translateX(100%); } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); gap: 12px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px 26px 40px; }
.drawer-body > * { animation: rise 0.5s var(--ease-out) both; animation-delay: calc(120ms + var(--i, 0) * 50ms); }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--muted); transition: background 0.2s, color 0.2s, transform 0.15s; }
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 18px; height: 18px; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); }
.kv div { background: var(--surface); padding: 12px 14px; }
.kv b { display: block; font-family: var(--serif); font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.kv span { font-size: 11.5px; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 1.5px solid var(--border); font-size: 13.5px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 3px; width: 11px; height: 11px; border-radius: 50%; background: var(--c, var(--faint)); box-shadow: 0 0 0 3px var(--bg); }
.timeline .ans { margin-top: 4px; color: var(--muted); font-size: 13px; white-space: pre-wrap; }

/* ---------- review mode ---------- */
.review-wrap { max-width: 720px; margin: 0 auto; }
.progress { height: 4px; border-radius: 99px; background: var(--border); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--clay); border-radius: 99px; transition: width 0.6s var(--ease-out); }
.scene { perspective: 1600px; margin-top: 26px; }
.flip { position: relative; transform-style: preserve-3d; transition: transform 0.75s var(--ease-out); display: grid; }
.flip.flipped { transform: rotateY(180deg); }
.face { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); padding: 34px 38px; min-height: 340px; display: flex; flex-direction: column; }
.face.back { transform: rotateY(180deg); }
.face .q { font-family: var(--serif); font-size: 26px; line-height: 1.35; white-space: pre-wrap; margin: auto 0; padding: 18px 0; }
.face .q.small { font-size: 18px; margin: 0; padding: 0 0 4px; color: var(--muted); }
.card-in { animation: cardin 0.6s var(--ease-out) both; }
.card-out { animation: cardout 0.45s var(--ease) both; }
@keyframes cardin { from { opacity: 0; transform: translateY(24px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes cardout { to { opacity: 0; transform: translateX(-60px) rotate(-3deg); } }
.ratings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 20px; }
.rate { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 14px; padding: 12px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; transition: transform 0.2s var(--spring), border-color 0.2s, background 0.2s, box-shadow 0.2s; animation: rise 0.5s var(--ease-out) both; animation-delay: calc(0.25s + var(--i) * 60ms); }
.rate:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.rate:active { transform: scale(0.96); }
.rate b { font-weight: 600; font-size: 14.5px; }
.rate span { font-size: 12px; color: var(--muted); }
.rate[data-r="again"]:hover { border-color: var(--red); background: var(--red-soft); }
.rate[data-r="hard"]:hover { border-color: var(--kraft); background: var(--kraft-soft); }
.rate[data-r="good"]:hover { border-color: var(--olive); background: var(--olive-soft); }
.rate[data-r="easy"]:hover { border-color: var(--sky); background: var(--sky-soft); }
.done-mark { width: 84px; height: 84px; margin: 0 auto 18px; color: var(--olive); }
.done-mark circle { stroke-dasharray: 240; stroke-dashoffset: 240; animation: draw 0.9s var(--ease-out) forwards; }
.done-mark path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 0.5s 0.6s var(--ease-out) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- schedule calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-dow { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 0 4px 4px; }
.cal-cell {
  position: relative; min-height: 92px; border-radius: 12px; padding: 9px 10px; text-align: left; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 4px;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, border-color 0.25s;
  animation: rise 0.5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 14ms);
}
.cal-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cal-cell.blank { visibility: hidden; animation: none; }
.cal-cell .d { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; justify-content: space-between; }
.cal-cell .n { font-family: var(--serif); font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cal-cell .nw { font-size: 11px; color: var(--sky); font-weight: 500; }
.cal-cell .heat { position: absolute; inset: 0; border-radius: 11px; background: var(--clay); opacity: calc(var(--h, 0) * 0.16); pointer-events: none; }
.cal-cell .stackbar { margin-top: auto; height: 4px; border-radius: 99px; overflow: hidden; display: flex; background: var(--bg-2); }
.cal-cell.today { border-color: var(--clay); }
.cal-cell.today .d b { color: var(--clay-strong); }
.cal-cell.sel { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20,20,19,0.07), var(--shadow); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- empty / loading ---------- */
.empty { text-align: center; padding: 64px 24px; color: var(--muted); }
.empty svg { width: 52px; height: 52px; color: var(--faint); margin-bottom: 12px; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.skel { border-radius: var(--r-lg); background: linear-gradient(90deg, var(--bg-2) 0, #ecebe4 40%, var(--bg-2) 80%) 0 0 / 800px 100%; animation: shimmer 1.4s linear infinite; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: 420px; padding: 12px 14px 12px 16px; border-radius: 14px; background: var(--ink); color: #f1efe8; box-shadow: var(--shadow-lg); font-size: 14px; animation: toastin 0.5s var(--spring) both; }
.toast.out { animation: toastout 0.3s var(--ease) both; }
.toast .ic { width: 18px; height: 18px; flex: none; }
.toast.ok .ic { color: #a9c08a; }
.toast.err .ic { color: #f0a097; }
.toast button { background: #2f2f2c; border: 0; color: #fff; padding: 5px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; }
.toast button:hover { background: #3b3b37; }
@keyframes toastin { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateX(30px); } }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.login::before { content: ""; position: absolute; width: 900px; height: 900px; border-radius: 50%; background: radial-gradient(circle, rgba(217,119,87,0.13), transparent 60%); top: -380px; right: -300px; animation: breathe 9s ease-in-out infinite; }
.login-card { position: relative; width: min(420px, 100%); padding: 36px; animation: rise 0.8s var(--ease-out) both; }
.login-card .brand-mark { width: 40px; height: 40px; animation: spinin 1.4s var(--ease-out) both; }
@keyframes spinin { from { transform: rotate(-180deg) scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
.shake { animation: shake 0.45s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

/* tooltip */
.tip { position: fixed; z-index: 70; pointer-events: none; background: var(--ink); color: #f1efe8; font-size: 12.5px; padding: 8px 10px; border-radius: 9px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(4px); transition: opacity 0.15s, transform 0.15s; max-width: 260px; }
.tip.show { opacity: 1; transform: none; }

/* settings */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; background: linear-gradient(to right, var(--clay) var(--fill, 50%), var(--bg-2) var(--fill, 50%)); outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--clay); box-shadow: var(--shadow); cursor: pointer; transition: transform 0.2s var(--spring); }
.range::-webkit-slider-thumb:hover { transform: scale(1.15); }
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--clay); cursor: pointer; }
.toggle { position: relative; width: 42px; height: 24px; border-radius: 99px; background: var(--border-strong); border: 0; cursor: pointer; transition: background 0.25s; flex: none; padding: 0; }
.toggle::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.35s var(--spring); }
.toggle.on { background: var(--clay); }
.toggle.on::after { transform: translateX(18px); }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--border); }
.setting:last-child { border-bottom: 0; }
.setting h3 { font-family: var(--sans); font-size: 14.5px; font-weight: 600; }
.setting p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border); background: rgba(250, 249, 245, 0.92); backdrop-filter: blur(12px); overflow-x: auto; gap: 4px; }
  .brand { padding: 0 8px 0 4px; }
  .brand-name, .sidebar-section, .sidebar-foot, .nav a span.lbl { display: none; }
  .nav { flex-direction: row; }
  .nav a { padding: 0 10px; }
  .nav-pill { display: none; }
  .nav a.active { background: var(--surface); box-shadow: var(--shadow-sm); }
  .nav .badge { margin-left: 2px; }
  .main { padding: 24px 16px 100px; }
  h1 { font-size: 28px; }
  .cols-5, .cols-3, .cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2 { grid-column: auto; }
  .hero .big { font-size: 48px; }
  .face { padding: 24px; min-height: 280px; }
  .face .q { font-size: 21px; }
  .ratings { grid-template-columns: repeat(2, 1fr); }
  .cal { gap: 4px; }
  .cal-cell { min-height: 64px; padding: 6px; }
  .cal-cell .n { font-size: 18px; }
  .cal-cell .nw { display: none; }
  .setting { grid-template-columns: 1fr; gap: 10px; }
  .kv { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .cols-5, .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .lrow { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- modal ---------- */
.modal { position: fixed; left: 50%; top: 50%; z-index: 52; width: min(440px, calc(100vw - 32px)); transform: translate(-50%, -50%); padding: 26px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: modalin 0.45s var(--spring) both; }
.modal.out { animation: modalout 0.2s var(--ease) both; }
.modal p { color: var(--muted); margin: 8px 0 22px; }
@keyframes modalin { from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes modalout { to { opacity: 0; transform: translate(-50%, -50%) scale(0.97); } }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dlist > * + * { margin-top: 16px; }
.bars.dense { gap: 3px; height: 150px; }
.bars.dense .bar { border-radius: 3px 3px 1px 1px; width: 100%; animation-delay: calc(var(--i, 0) * 12ms); }
.bars.dense .bar-lbl { font-size: 10.5px; height: 14px; }
.center { text-align: center; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 11px; border-radius: 999px; background: var(--clay-soft); color: #9c4a2d; font-size: 13px; font-weight: 500; animation: pop 0.35s var(--spring); }
.filter-chip button { border: 0; background: transparent; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: inherit; padding: 0; }
.filter-chip button:hover { background: rgba(156, 74, 45, 0.12); }
.filter-chip svg { width: 12px; height: 12px; }
.editor { display: flex; flex-direction: column; gap: 14px; animation: fade 0.3s both; }
.chunk { padding: 16px 0; border-bottom: 1px solid var(--border); }
.chunk:last-child { border-bottom: 0; }
.chunk-text { white-space: pre-wrap; font-size: 14px; color: var(--ink-2); margin-top: 8px; max-height: 180px; overflow: hidden; position: relative; transition: max-height 0.5s var(--ease-out); }
.chunk-text.clamped::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 60px; background: linear-gradient(transparent, var(--bg)); }
.chunk-text.open { max-height: 4000px; }
@media (max-width: 1000px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .cols-4 { grid-template-columns: 1fr; } }
#ver { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
