/* Atelier — warm-paper minimalism (approved design language). */
:root {
  --bg: #faf8f5;
  --card: #ffffff;
  --ink: #26241f;
  --muted: #6b6557;
  --accent: #2a5db0;
  --accent-soft: #e9eef8;
  --green: #256b42;
  --green-soft: #e6efe9;
  --amber: #8a6d00;
  --amber-soft: #f6f1e2;
  --red: #b3261e;
  --red-soft: #f7e7e5;
  --line: #e8e4dc;
  --radius: 8px;
  font-size: 17px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 80px;
}
button, select { cursor: pointer; }
:is(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---- header ---- */
header {
  position: relative;
  background: var(--bg);
  max-width: 720px;
  margin: 0 auto;
  padding: 34px 20px 2px;
}
header h1 { font-size: 1.15rem; font-weight: 600; }
header p { color: var(--muted); font-size: 0.82rem; margin-top: 3px; }
.week-banner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.82rem;
  max-width: 720px;
  margin: 0 auto;
  padding: 4px 20px 16px;
}
.week-banner b { color: var(--ink); }
.capture-btn {
  position: absolute;
  right: 20px;
  top: 36px;
  background: none;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 7px;
}
.capture-btn:hover { background: var(--accent-soft); }
.sync-chip {
  position: absolute;
  right: 110px;
  top: 44px;
  font-size: 0.72rem;
  color: var(--muted);
}
.sync-chip.err { color: var(--red); font-weight: 600; }

/* ---- nav ---- */
.navwrap { position: sticky; top: 0; z-index: 20; background: var(--bg); }
nav {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  overflow-x: auto;
}
nav button {
  flex: 1;
  min-width: 86px;
  padding: 13px 6px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  position: relative;
}
nav button:hover { color: var(--ink); }
nav button.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
nav .badge {
  position: absolute;
  top: 6px;
  right: 10px;
  color: var(--red);
  font-size: 0.68rem;
  font-weight: 700;
  display: none;
}
nav .badge.show { display: inline-block; }
.subnav {
  display: flex;
  justify-content: center;
  gap: 2px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.subnav:empty { display: none; }
.subnav button {
  background: none;
  border: none;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--muted);
}
.subnav button:hover { color: var(--ink); }
.subnav button.active {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---- layout ---- */
main { max-width: 720px; margin: 0 auto; padding: 8px 20px 56px; }
section.card { margin-bottom: 42px; }
.h2row { display: flex; justify-content: space-between; align-items: baseline; }
h2 { font-size: 0.95rem; font-weight: 600; margin-bottom: 2px; }
.sub { color: var(--muted); font-size: 0.84rem; margin-bottom: 14px; }
.hint { color: var(--muted); font-size: 0.85rem; margin-bottom: 24px; }
.hint b { color: var(--ink); font-weight: 600; }

/* ---- buttons ---- */
.btn {
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 7px;
  padding: 10px 16px;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: #000; color: #fff; }
.btn-ghost { background: none; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-small { padding: 8px 13px; font-size: 0.8rem; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn-primary[disabled] { opacity: 1; background: var(--line); color: #4f4a3f; border: 1px solid #d8d2c6; cursor: not-allowed; }
.edit-link, .add-toggle {
  display: block;
  background: none;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 0;
  text-align: left;
}
.edit-link { font-size: 0.8rem; padding: 4px 8px; border-radius: 6px; }
.edit-link:hover { background: var(--accent-soft); }
.add-toggle:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- tags / chips / countdown ---- */
.tag { color: var(--muted); font-size: 0.75rem; margin-left: 8px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 30px; }
.chip { display: flex; align-items: baseline; gap: 6px; background: none; border: none; font-family: inherit; padding: 0; text-align: left; }
.chip .num { font-size: 1rem; font-weight: 600; }
.chip .lbl { font-size: 0.8rem; color: var(--muted); }
.chip.jump:hover .lbl { text-decoration: underline; }
.countdown { min-width: 70px; padding: 2px 0; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.countdown .num { font-size: 1.05rem; font-weight: 600; }
.countdown .lbl { font-size: 0.7rem; color: var(--muted); }
.cd-urgent, .cd-urgent .lbl { color: var(--red); }
.cd-past { color: var(--muted); }
.cd-past .num { font-weight: 400; }
.mini-days { min-width: 58px; font-weight: 600; font-size: 0.82rem; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.mini-days.cd-urgent { color: var(--red); }

/* ---- progress / heatmap ---- */
.progress-bar { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.progress-bar > div { height: 100%; background: var(--ink); border-radius: 99px; transition: width 0.3s; }
.heatmap { display: flex; gap: 5px; margin-top: 10px; flex-wrap: wrap; }
.hm-cell { width: 20px; height: 20px; background: #ece8e0; border-radius: 4px; }
.hm-cell.full { background: var(--ink); }
.hm-cell.current { outline: 2px solid var(--accent); outline-offset: 1px; }
.hm-label { font-size: 0.76rem; color: var(--muted); margin-top: 6px; }

/* ---- rows ---- */
.task, .deadline, .inbox-row, .work-row, .money-row, .r-edit { border-top: 1px solid var(--line); }
.task { display: flex; align-items: flex-start; gap: 12px; padding: 11px 4px; }
.task input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); margin-top: 2px; flex-shrink: 0; }
.task .body { flex: 1; }
.task .title { font-weight: 600; font-size: 0.92rem; }
.task.done .title { text-decoration: line-through; color: var(--muted); }
.task .note { color: var(--muted); font-size: 0.82rem; margin-top: 2px; line-height: 1.45; }
.task a, .inbox-row a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.deadline { display: flex; align-items: center; gap: 12px; padding: 12px 4px; }
.deadline.past { opacity: 0.55; }
.deadline .body { flex: 1; }
.deadline .title { font-weight: 600; font-size: 0.92rem; }
.deadline .title a { color: inherit; text-decoration: underline; text-decoration-color: #d5cfc4; text-underline-offset: 3px; }
.deadline .meta, .inbox-row .meta, .work-row .meta, .app-head .meta { color: var(--muted); font-size: 0.82rem; margin-top: 2px; line-height: 1.4; }
.inbox-row { padding: 11px 0; }
.inbox-main { display: flex; align-items: flex-start; gap: 10px; }
.inbox-main .body { flex: 1; }
.inbox-main .title { font-weight: 600; font-size: 0.9rem; }
.inbox-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.triage-date { display: flex; gap: 8px; margin-top: 8px; }
.del, .chev, .drag-handle {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.05rem;
  padding: 6px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 6px;
  flex-shrink: 0;
}
.del:hover { color: var(--red); }
.drag-handle { color: #c9c3b8; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.drag-handle:hover { color: var(--ink); }
.dragging { background: var(--accent-soft); border-radius: 8px; opacity: 0.85; }
.chev { font-size: 0.85rem; transition: transform 0.2s; min-width: 32px; min-height: 32px; padding: 8px; }
.open > .app-head .chev { transform: rotate(90deg); }

/* ---- applications ---- */
.app-row { border-top: 1px solid var(--line); padding: 10px 0; }
.app-head { display: flex; align-items: center; gap: 10px; cursor: pointer; border-radius: 6px; padding: 4px 0; }
.app-head:hover { background: #f3efe8; }
.app-head .body { flex: 1; }
.app-head .title { font-weight: 600; font-size: 0.92rem; }
.app-detail { display: none; margin-top: 8px; padding: 10px 12px; background: #f3efe8; border-radius: 8px; }
.open .app-detail { display: block; }
.req { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 0.85rem; }
.req input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--green); }
.req.done span { text-decoration: line-through; color: var(--muted); }
.req .del { margin-left: auto; font-size: 0.85rem; min-width: 30px; min-height: 30px; }
.req .drag-handle { min-width: 30px; min-height: 30px; font-size: 0.9rem; padding: 2px 4px; }
.req-add { display: flex; gap: 8px; margin-top: 8px; }
.req-add input { flex: 1; }
select.status {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 8px;
  width: auto;
  max-width: 160px;
}
.st-inprogress { color: var(--accent); }
.st-accepted, .st-sold { color: var(--green); }
.st-planned, .st-rejected, .st-loaned, .st-gifted { color: var(--muted); }

/* ---- money ---- */
.money-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 0.88rem; }
.money-row .date { color: var(--muted); font-size: 0.78rem; min-width: 64px; flex-shrink: 0; }
.money-row .body { flex: 1; }
.money-row .amt { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.amt.plus { color: var(--green); }
.bud-status { font-size: 0.86rem; background: #f3efe8; border-radius: 8px; padding: 10px 12px; margin-top: 10px; line-height: 1.6; }
.ok-flag { color: var(--green); font-weight: 700; }
.warn-flag { color: var(--red); font-weight: 700; }
.price-out { background: #f3efe8; border-radius: 8px; padding: 12px 14px; margin-top: 10px; font-size: 0.88rem; line-height: 1.7; }

/* ---- forms ---- */
form.add { display: grid; gap: 8px; }
form.add.collapsible { display: none; margin: 4px 0 14px; }
form.add.collapsible.open { display: grid; }
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 12px;
  width: 100%;
}
textarea { min-height: 64px; resize: vertical; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.filter-chip {
  border: none;
  background: none;
  border-radius: 6px;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.8rem;
  padding: 6px 8px;
}
.filter-chip:hover { color: var(--ink); }
.filter-chip.active { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

/* ---- routine edit ---- */
.r-edit { display: flex; gap: 8px; align-items: flex-start; padding: 10px 0; }
.r-edit .fields { flex: 1; display: grid; gap: 6px; }
.r-edit .fields .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.r-edit input, .r-edit select { font-size: 0.88rem; padding: 8px 10px; }
.r-edit select { width: auto; }

/* ---- next action ---- */
.next-action { padding: 0 0 6px; margin-bottom: 30px; }
.kicker {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.kicker.good { color: var(--green); }
.next-action h2 { font-size: 1.25rem; margin-bottom: 6px; }
.next-action p { color: var(--muted); font-size: 0.88rem; margin-bottom: 14px; line-height: 1.5; }
.mini-deadline { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-top: 1px solid var(--line); font-size: 0.86rem; }

/* ---- share / composer ---- */
.platform-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.platform {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 11px; font-size: 0.85rem; cursor: pointer; background: var(--card);
}
.platform.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.platform.off { opacity: 0.85; }
.platform .pconnect { margin-left: auto; min-height: 28px; padding: 3px 10px; }
.platform input { width: 18px; height: 18px; accent-color: var(--accent); }
.platform .pname { font-weight: 600; }
.platform .pstate { color: var(--muted); font-size: 0.72rem; }
.platform.on .pstate { color: var(--accent); }
.media-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.media-tile { position: relative; width: 104px; }
.media-tile img, .media-tile video { width: 104px; height: 104px; object-fit: cover; border-radius: 8px; display: block; border: 1px solid var(--line); }
.media-tile.busy img, .media-tile.busy video { opacity: 0.45; }
.media-busy {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 600; color: var(--ink);
  background: rgba(250, 248, 245, 0.62); border-radius: 8px;
}
.media-tile .ord {
  position: absolute; top: 4px; left: 4px;
  background: var(--ink); color: var(--bg);
  font-size: 0.72rem; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.media-ctrls { display: flex; gap: 4px; margin-top: 4px; align-items: center; }
.media-ctrls button {
  border: 1px solid var(--line); background: var(--card); border-radius: 6px;
  min-width: 36px; min-height: 36px; font-size: 0.85rem; cursor: pointer; color: var(--ink);
}
.media-ctrls button:disabled { opacity: 0.4; cursor: default; }
.media-ctrls .del { min-width: 36px; min-height: 36px; margin-left: auto; }
.song-note {
  background: var(--amber-soft); color: var(--ink);
  border-radius: 8px; padding: 10px 12px; font-size: 0.82rem; line-height: 1.5;
}
.over-limit { color: var(--red); font-weight: 600; }
.char-count, .pv-over, .fi-due { font-variant-numeric: tabular-nums; }
.post-bar { display: flex; gap: 10px; align-items: center; padding-top: 14px; border-top: 1px solid var(--line); }
.post-bar .btn-primary { flex: 1; padding: 13px 16px; }
.post-result {
  margin-top: 12px; background: var(--green-soft); color: var(--ink);
  border-radius: 8px; padding: 12px 14px; font-size: 0.88rem; line-height: 1.5;
}
/* per-platform posting checklist */
.post-checks {
  background: var(--amber-soft); border: 1px solid #e7dcb8; border-radius: 8px;
  padding: 10px 12px; margin-bottom: 10px; font-size: 0.85rem; line-height: 1.5;
}
.post-checks .pc-title { font-weight: 700; color: #6f5600; margin-bottom: 4px; }
.post-checks ul { margin: 0; padding-left: 18px; }
.post-checks li { margin: 2px 0; }
/* compose-from-a-work picker */
.work-picker { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: var(--bg); }
.wp-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.wp-item {
  display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 6px 10px 6px 6px;
}
.wp-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.wp-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; flex: none; }
.wp-meta { display: flex; flex-direction: column; }
.wp-title { font-weight: 600; font-size: 0.85rem; }
.wp-count { color: var(--muted); font-size: 0.74rem; }
/* quiet text-link button (per-platform toggle, reset) */
.link-btn {
  display: inline-flex; align-items: center; min-height: 36px; background: none; border: 0;
  color: var(--accent); font: inherit; font-size: 0.82rem; font-weight: 500;
  padding: 5px 8px; border-radius: 6px; cursor: pointer;
}
.link-btn:hover { background: var(--accent-soft); }
/* per-platform caption overrides */
.ovr-box { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.ovr-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ovr-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 99px; padding: 6px 14px; font-size: 0.8rem; cursor: pointer;
}
.ovr-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ovr-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }
.ovr-chip.on .ovr-dot { background: var(--accent); }
.ovr-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; }
.ovr-foot .sub { min-width: 0; }
/* live preview */
.prev-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.prev-tab {
  display: inline-flex; align-items: center; min-height: 36px;
  border: 0; background: none; color: var(--muted);
  font: inherit; font-size: 0.82rem; padding: 6px 12px; border-radius: 99px; cursor: pointer;
}
.prev-tab:hover { background: var(--accent-soft); }
.prev-tab.on { background: var(--ink); color: var(--bg); font-weight: 600; }
.preview-card {
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  max-width: 380px; overflow: hidden;
}
.pv-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.pv-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--line); flex: none; }
.pv-handle { font-weight: 600; font-size: 0.86rem; }
.pv-plat { color: var(--muted); font-size: 0.74rem; }
.pv-media { position: relative; background: #f3efe8; }
.pv-media img, .pv-media video { display: block; width: 100%; max-height: 380px; object-fit: cover; }
.pv-count {
  position: absolute; top: 8px; right: 8px;
  background: rgba(38,36,31,0.72); color: #fff;
  font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 99px;
}
.pv-nomedia {
  background: #f3efe8; color: var(--muted); font-size: 0.82rem;
  display: flex; align-items: center; justify-content: center; height: 120px;
}
.pv-caption { padding: 12px 14px; font-size: 0.88rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.pv-cut { background: var(--red-soft); color: var(--red); text-decoration: line-through; }
.pv-empty { color: var(--muted); font-style: italic; }
.pv-over { padding: 0 14px 12px; color: var(--red); font-size: 0.78rem; font-weight: 600; }
/* scheduling */
.when-opts { display: flex; flex-wrap: wrap; gap: 16px; }
.when-opt { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; cursor: pointer; }
.when-opt input { width: 18px; height: 18px; accent-color: var(--accent); }
.dt-input {
  border: 1px solid var(--line); border-radius: 7px; background: var(--card);
  padding: 9px 11px; font: inherit; font-size: 0.9rem; color: var(--ink); max-width: 260px;
}
.dt-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

/* ---- document uploads ---- */
.kit-files { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.file-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; width: 100%;
}
.file-row a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.file-row .file-size { color: var(--muted); font-size: 0.74rem; white-space: nowrap; }
.file-row .del { min-width: 28px; min-height: 28px; font-size: 0.85rem; }
.upload-btn {
  display: inline-block;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.upload-btn:hover { background: var(--accent-soft); }

/* ---- werkverzeichnis images + lightbox ---- */
.work-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.work-thumb { position: relative; width: 72px; height: 72px; }
.thumb-open {
  padding: 0; margin: 0; width: 72px; height: 72px; display: block; cursor: zoom-in;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card);
}
.thumb-open img { width: 72px; height: 72px; object-fit: cover; display: block; }
.thumb-del {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; padding: 0;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 50%; font-size: 0.95rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.thumb-del:hover { color: var(--red); border-color: var(--red); }
.thumb-add {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  width: 72px; height: 72px; padding: 4px; border: 1px dashed var(--line); border-radius: 8px;
  color: var(--accent); font-size: 0.78rem; font-weight: 500; cursor: pointer;
}
.thumb-add:hover { background: var(--accent-soft); }
.thumb-add.busy { color: var(--muted); cursor: default; }
.lightbox {
  position: fixed; inset: 0; z-index: 100; padding: 24px;
  background: rgba(38, 36, 31, 0.86); display: flex; align-items: center; justify-content: center;
}
.lb-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lb-fig img { max-width: 92vw; max-height: 82vh; object-fit: contain; border-radius: 6px; background: var(--card); }
.lb-fig figcaption { color: #f3efe8; font-size: 0.85rem; text-align: center; max-width: 92vw; }
.lb-close, .lb-nav {
  position: absolute; width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(0, 0, 0, 0.35); color: #fff; font-size: 1.6rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.lb-close:hover, .lb-nav:hover { background: rgba(0, 0, 0, 0.6); }
.lb-close { top: 16px; right: 16px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

/* ---- snippets ---- */
.snippet { border-top: 1px solid var(--line); padding: 12px 0; }
.snip-head { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.snip-head input { border: none; background: none; font-weight: 600; font-size: 0.9rem; padding: 4px 0; }
.copied { color: var(--green) !important; }

/* ---- modal ---- */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(250, 248, 245, 0.92);
  z-index: 50;
  padding: 20px 14px;
  overflow-y: auto;
}
.overlay.show { display: flex; align-items: flex-start; justify-content: center; }
.modal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(38, 36, 31, 0.08);
  max-width: 540px;
  width: 100%;
  margin-top: 4vh;
  padding: 20px;
}
.modal-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sprint-timer { font-variant-numeric: tabular-nums; font-weight: 600; padding: 6px 0; }
.sprint-timer.over { color: var(--red); }
.sprint-count { font-size: 0.8rem; color: var(--muted); }
.sprint-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.sprint-note { color: var(--muted); font-size: 0.85rem; line-height: 1.5; margin-bottom: 14px; }
.sprint-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.sprint-capture { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.cap-list { font-size: 0.82rem; color: var(--green); margin-top: 8px; line-height: 1.5; }
.sprint-done { text-align: center; padding: 14px 4px; }
.sprint-done .big { font-size: 2.4rem; margin-bottom: 10px; color: var(--accent); }
.sprint-done p { color: var(--muted); font-size: 0.88rem; margin: 8px 0 16px; line-height: 1.5; }

/* ---- drag drop targets / file drop ---- */
#dropTargets {
  display: none;
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  gap: 10px;
}
#dropTargets.show { display: flex; }
.drop-chip {
  background: #fff;
  border: 1px dashed var(--accent);
  color: var(--accent);
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}
.drop-chip.hot { background: var(--accent-soft); }
#dropOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  border: 2px dashed var(--accent);
  background: rgba(250, 248, 245, 0.9);
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#dropOverlay.show { display: flex; }
#dropOverlay .msg {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(38, 36, 31, 0.08);
  padding: 18px 26px;
  font-weight: 600;
}

/* ---- auth ---- */
.auth-wrap { max-width: 380px; margin: 12vh auto 0; padding: 0 20px; }
.auth-wrap h1 { font-size: 1.3rem; font-weight: 600; margin-bottom: 4px; }
.auth-wrap .sub { margin-bottom: 26px; }
.auth-form { display: grid; gap: 10px; }
.auth-error { color: var(--red); font-size: 0.84rem; padding: 4px 0; }
.auth-switch { margin-top: 18px; font-size: 0.84rem; color: var(--muted); }
.auth-switch button { background: none; border: none; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 3px; padding: 2px 4px; }
.auth-or {
  display: flex; align-items: center; text-align: center; gap: 10px;
  color: var(--muted); font-size: 0.78rem; margin: 22px 0 14px;
}
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-sso {
  width: 100%; background: var(--card); color: var(--ink);
  border: 1px solid var(--accent); font-weight: 600;
}
.btn-sso:hover { background: var(--accent-soft); }

/* ---- profile header bar + clickable school chip ---- */
.profile-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin: 2px 0 10px; font-size: 0.86rem; }
.pb-name { font-weight: 600; color: var(--ink); }
.pb-role { color: var(--muted); font-size: 0.78rem; }
.pb-school {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--accent); color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 4px 10px 4px 9px; font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.pb-school:hover { background: var(--accent); color: #fff; }
.pb-ico { font-size: 0.8rem; opacity: 0.85; }
.pb-chev { font-size: 1rem; line-height: 1; }
/* ---- institution modal ---- */
.inst-modal { max-width: 560px; max-height: 86vh; overflow-y: auto; }
.inst-title { font-size: 1.1rem; font-weight: 700; color: var(--ink); margin: 0; }
/* aggregate stats: borderless chips (hairlines, not boxes — matches Today/Studio) */
.inst-stats .stat-row { gap: 12px 22px; margin-bottom: 6px; }
.inst-stats .chip .num { font-size: 1.05rem; }
.inst-stats .num.zero { color: var(--muted); }
.inst-priv {
  margin: 12px 0 0; font-size: 0.8rem; line-height: 1.45;
  background: var(--accent-soft); border-radius: 8px; padding: 9px 11px;
}
.inst-feed { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.inst-feed h2 { margin-bottom: 10px; }
.inst-add { margin-top: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.feed-group { margin-top: 12px; }
.feed-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.feed-item:first-child { border-top: none; }
.fi-main { flex: 1; min-width: 0; }
.fi-title { font-weight: 600; font-size: 0.9rem; overflow-wrap: anywhere; }
.fi-due { display: inline-block; background: var(--ink); color: var(--bg); font-size: 0.72rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; margin-right: 2px; }
.fi-body { color: var(--ink); font-size: 0.84rem; margin-top: 2px; line-height: 1.5; overflow-wrap: anywhere; }
.fi-meta { color: var(--muted); font-size: 0.74rem; margin-top: 3px; }
.fi-meta a { color: var(--accent); }

/* ---- toast ---- */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.85rem;
  z-index: 80;
  box-shadow: 0 8px 30px rgba(38, 36, 31, 0.18);
}

/* ---- footer ---- */
footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 20px;
  line-height: 1.8;
}
footer button { background: none; border: none; color: var(--muted); text-decoration: underline; font: inherit; font-size: 0.78rem; padding: 2px 4px; }

/* ---- mobile: nav docks to the thumb zone ---- */
@media (max-width: 640px) {
  .navwrap { position: static; }
  .subnav { position: sticky; top: 0; z-index: 20; }
  .navwrap nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    border-top: 1px solid var(--line);
    border-bottom: none;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .navwrap nav button { padding: 14px 4px; border-bottom: none; border-top: 2px solid transparent; }
  .navwrap nav button.active { border-bottom: none; border-top-color: var(--ink); }
  body { padding-bottom: 150px; }
  .capture-btn { top: 26px; right: 12px; }
  .sync-chip { right: 104px; top: 34px; }
  header h1 { padding-right: 100px; }
  .chip-row { gap: 4px 16px; }
  .form-row3 { grid-template-columns: 1fr 1fr; }
  .modal .form-row { grid-template-columns: 1fr; }
}
