:root {
  --bg: #F7F8F6;
  --surface: #FFFFFF;
  --surface-2: #F0F2EF;
  --ink: #23272E;
  --ink-2: #5B636E;
  --muted: #8C949E;
  --line: #E2E5E1;
  --line-2: #D2D7D1;
  --accent: #4F7E70;
  --accent-ink: #FFFFFF;
  --accent-soft: #E2EEEA;
  --accent-text: #3D6A5D;
  --warn: #B4533C;
  --today: #F3E7C9;
  --shadow: 0 1px 2px rgba(20, 30, 25, .05), 0 2px 8px rgba(20, 30, 25, .04);
  --radius: 14px;
  --radius-s: 9px;
  --side-w: 232px;
  --tab-h: 62px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16191D;
    --surface: #1E2227;
    --surface-2: #262B31;
    --ink: #E7EAEE;
    --ink-2: #B3BAC3;
    --muted: #838B96;
    --line: #2E343B;
    --line-2: #3A414A;
    --accent: #7DB3A3;
    --accent-ink: #10201B;
    --accent-soft: #24352F;
    --accent-text: #93C6B6;
    --warn: #E0826B;
    --today: #3A3423;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #16191D;
  --surface: #1E2227;
  --surface-2: #262B31;
  --ink: #E7EAEE;
  --ink-2: #B3BAC3;
  --muted: #838B96;
  --line: #2E343B;
  --line-2: #3A414A;
  --accent: #7DB3A3;
  --accent-ink: #10201B;
  --accent-soft: #24352F;
  --accent-text: #93C6B6;
  --warn: #E0826B;
  --today: #3A3423;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- boot ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); opacity: .25; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .6; } }

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w);
  padding: 22px 14px; border-right: 1px solid var(--line);
  background: var(--bg); display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); font-size: 13px; font-weight: 800; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500;
}
.nav-link svg { width: 19px; height: 19px; flex: none; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.side .spacer { flex: 1; }
.side .sync-row { padding: 10px 12px 0; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

.main { margin-left: var(--side-w); padding: 28px 36px 60px; max-width: calc(1180px + var(--side-w)); }

.tabbar { display: none; }

@media (max-width: 899px) {
  .side { display: none; }
  .main { margin-left: 0; padding: 14px 16px calc(var(--tab-h) + 28px + env(safe-area-inset-bottom)); padding-top: calc(14px + env(safe-area-inset-top)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600; }
  .tab svg { width: 22px; height: 22px; }
  .tab.on { color: var(--accent-text); }
}

/* ---------- sync pill ---------- */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.dot.busy { background: #C9A64B; }
.dot.off { background: var(--muted); }
.dot.err { background: var(--warn); }
.sync-pill {
  position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 14px; z-index: 30;
  display: none; align-items: center; gap: 7px;
  padding: 5px 10px; border-radius: 99px; font-size: 12px; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
@media (max-width: 899px) { .sync-pill.show { display: flex; } }

/* ---------- page header ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--accent-text); }
.crumbs .sep { opacity: .6; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.head h1 { margin: 0; font-size: 30px; line-height: 1.15; letter-spacing: -.02em; }
.head .sub { color: var(--ink-2); margin-top: 3px; }
.head .sub small { color: var(--muted); }
.tools { display: flex; align-items: center; gap: 6px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 14px;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent-text); }
.btn.danger { color: var(--warn); }
.btn.icon { width: 36px; padding: 0; }
.btn svg { width: 18px; height: 18px; }
@media (max-width: 899px) {
  .head h1 { font-size: 26px; }
  .head { margin-bottom: 16px; }
  .btn { min-height: 40px; }
  .btn.icon { width: 40px; }
}

/* ---------- cards & layout ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stack { display: grid; gap: 18px; }
@media (max-width: 899px) {
  .grid2 { grid-template-columns: 1fr; gap: 14px; }
  .grid3 { grid-template-columns: 1fr; gap: 14px; }
  .stack { gap: 14px; }
}
@media (min-width: 900px) and (max-width: 1199px) { .grid3 { grid-template-columns: 1fr 1fr; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.card h2, .label {
  margin: 0 0 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.card h2 a { font-size: 12px; letter-spacing: 0; text-transform: none; font-weight: 600; }
.hint { color: var(--muted); font-size: 13px; }

details.card > summary { list-style: none; cursor: pointer; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h2 { margin: 0; }
details.card[open] > summary h2 { margin-bottom: 10px; }
details.card > summary h2::after { content: "Show"; font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--muted); font-weight: 500; }
details.card[open] > summary h2::after { content: "Hide"; }

/* ---------- inputs ---------- */
.field, .area {
  width: 100%; border: 0; background: transparent; padding: 6px 0; outline: none;
  border-bottom: 1px solid var(--line);
}
.field:focus, .area:focus { border-bottom-color: var(--accent); }
.area { resize: none; min-height: 96px; line-height: 1.55; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; background: var(--surface-2); }
.area:focus { border-color: var(--accent); background: var(--surface); }
.area.tall { min-height: 260px; }
.field.big { font-size: 20px; font-weight: 600; }
::placeholder { color: var(--muted); opacity: .8; }

/* ---------- top 3 ---------- */
.top3 { display: grid; gap: 4px; }
.top3 .row { display: flex; align-items: center; gap: 10px; }
.num { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none; }

/* ---------- todo lists ---------- */
.todos { list-style: none; margin: 0; padding: 0; }
.todos li { display: flex; align-items: center; gap: 10px; min-height: 40px; border-bottom: 1px solid var(--line); }
.todos li:last-child { border-bottom: 0; }
.todos.compact li { min-height: 34px; gap: 8px; }
.check {
  width: 22px; height: 22px; flex: none; border-radius: 7px; border: 1.6px solid var(--line-2); background: transparent; padding: 0;
  display: grid; place-items: center;
}
.check svg { width: 14px; height: 14px; opacity: 0; color: var(--accent-ink); }
.todos li.done .check { background: var(--accent); border-color: var(--accent); }
.todos li.done .check svg { opacity: 1; }
.todos li.done .txt { color: var(--muted); text-decoration: line-through; }
.txt { flex: 1; min-width: 0; border: 0; background: transparent; padding: 6px 0; outline: none; }
.due { border: 0; background: var(--surface-2); border-radius: 7px; padding: 4px 6px; font-size: 13px; color: var(--ink-2); max-width: 140px; }
.due.late { color: var(--warn); }
.due.empty { background: transparent; color: var(--muted); opacity: .45; }
.todos li:hover .due.empty, .due.empty:focus { opacity: 1; }
@media print { .due.empty { display: none; } }
.del {
  width: 30px; height: 30px; flex: none; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  font-size: 18px; line-height: 1; opacity: 0; transition: opacity .15s;
}
.todos li:hover .del, .todos li:focus-within .del { opacity: 1; }
@media (hover: none) { .del { opacity: .55; } }
.del:hover { background: var(--surface-2); color: var(--warn); }
.addrow .plus { width: 22px; text-align: center; color: var(--accent-text); font-size: 20px; font-weight: 400; flex: none; }
.add { flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 0; outline: none; }

/* ---------- schedule ---------- */
.sched { display: grid; }
.sched .slot { display: grid; grid-template-columns: 52px 1fr; align-items: center; border-bottom: 1px solid var(--line); min-height: 38px; }
.sched .slot:last-child { border-bottom: 0; }
.sched .hr { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sched .slot.now .hr { color: var(--accent-text); font-weight: 700; }
.sched .slot input { border: 0; background: transparent; outline: none; padding: 7px 0; width: 100%; }

/* ---------- habits chips (day) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px 0 10px;
  border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 500; font-size: 14px;
}
.chip .tick { width: 18px; height: 18px; border-radius: 50%; border: 1.6px solid var(--line-2); display: grid; place-items: center; }
.chip .tick svg { width: 11px; height: 11px; opacity: 0; color: var(--accent-ink); }
.chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.chip.on .tick { background: var(--accent); border-color: var(--accent); }
.chip.on .tick svg { opacity: 1; }
.segs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.seg { min-height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.seg.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- week ---------- */
.week { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1199px) { .week { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 599px) { .week { grid-template-columns: 1fr; } }
.daycard { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.daycard .dhead { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.daycard .dhead b { font-size: 14px; }
.daycard .dhead span { font-size: 12.5px; color: var(--muted); }
.daycard.today .dhead { background: var(--today); }
.daycard .dbody { padding: 6px 14px 8px; }
.daycard .tops { padding: 8px 0 2px; display: grid; gap: 2px; }
.daycard .tops div { font-size: 13px; font-weight: 600; display: flex; gap: 6px; }
.daycard .tops div::before { content: "★"; color: var(--accent); font-size: 11px; }
.daycard.prio .dhead { background: var(--accent); color: var(--accent-ink); }
.daycard.prio .dhead span { color: var(--accent-ink); opacity: .8; }

/* ---------- month ---------- */
.month { display: grid; grid-template-columns: 44px repeat(7, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.month .dow { padding: 8px 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.month .wk {
  display: grid; place-items: center; background: var(--surface-2); color: var(--accent-text); font-size: 11px; font-weight: 700;
  border-bottom: 1px solid var(--line); writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .05em;
}
.month .cell { min-height: 104px; padding: 6px 8px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.month .cell:hover { background: var(--surface-2); }
.month .cell.out { background: var(--surface-2); color: var(--muted); opacity: .6; }
.month .cell .n { font-size: 13px; font-weight: 700; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; margin: -2px 0 2px -4px; }
.month .cell.today .n { background: var(--accent); color: var(--accent-ink); }
.month .cell.we .n { color: var(--accent-text); }
.month .cell.today.we .n { color: var(--accent-ink); }
.month .cell .it { font-size: 12px; line-height: 1.3; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month .cell .it.star { color: var(--ink); font-weight: 600; }
.month .cell .it.done { text-decoration: line-through; color: var(--muted); }
.month .cell .more { font-size: 11px; color: var(--muted); }
.month .cell .pips { display: none; gap: 3px; }
.month .cell .pips i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
@media (max-width: 699px) {
  .month { grid-template-columns: 26px repeat(7, 1fr); border-radius: 12px; }
  .month .dow { padding: 6px 0; text-align: center; font-size: 10px; letter-spacing: 0; }
  .month .wk { font-size: 9px; }
  .month .cell { min-height: 54px; padding: 4px 2px; align-items: center; }
  .month .cell .n { margin: 0; }
  .month .cell .it, .month .cell .more { display: none; }
  .month .cell .pips { display: flex; }
}

/* ---------- year ---------- */
.year { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1199px) { .year { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 799px) { .year { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
@media (max-width: 459px) { .year { grid-template-columns: 1fr 1fr; gap: 10px; } }
.mini { padding: 12px; }
.mini h3 { margin: 0 0 8px; font-size: 14px; }
.mini h3 a { color: var(--ink); }
.mini .g { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; gap: 1px; }
.mini .g span { font-size: 10px; color: var(--muted); font-weight: 600; padding-bottom: 3px; }
.mini .g a { font-size: 12px; color: var(--ink-2); aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; position: relative; font-variant-numeric: tabular-nums; }
.mini .g a:hover { background: var(--surface-2); }
.mini .g a.has { color: var(--ink); font-weight: 700; }
.mini .g a.has::after { content: ""; position: absolute; bottom: 1px; width: 3px; height: 3px; border-radius: 50%; background: var(--accent); }
.mini .g a.today { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 459px) { .mini { padding: 10px 8px; } .mini .g a { font-size: 10.5px; } .mini .g span { font-size: 9px; } }

/* ---------- habits table ---------- */
.htable-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.htable { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.htable th, .htable td { border-bottom: 1px solid var(--line); padding: 0; text-align: center; }
.htable tr:last-child td { border-bottom: 0; }
.htable thead th { font-size: 10.5px; color: var(--muted); font-weight: 600; padding: 6px 0 5px; background: var(--surface-2); min-width: 30px; }
.htable thead th b { display: block; font-size: 12px; color: var(--ink-2); }
.htable thead th.we b { color: var(--accent-text); }
.htable thead th.today { background: var(--today); }
.htable .name { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; min-width: 170px; max-width: 220px; padding: 0 6px 0 12px; border-right: 1px solid var(--line); }
.htable thead .name { background: var(--surface-2); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); font-weight: 700; }
.htable .name .nrow { display: flex; align-items: center; gap: 4px; }
.htable .name input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 0; outline: none; font-weight: 500; }
.htable .name .del { width: 26px; height: 26px; }
.htable tr:hover .del { opacity: 1; }
@media (min-width: 900px) { .htable thead th { min-width: 24px; } .hcell { width: 100%; min-width: 24px; } .htable .name { min-width: 150px; } }
.hcell { width: 30px; height: 40px; border: 0; background: transparent; padding: 0; display: grid; place-items: center; }
.hcell i { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-2); display: block; }
.hcell.on i { background: var(--accent); border-color: var(--accent); }
td.today { background: color-mix(in srgb, var(--today) 55%, transparent); }
.htable .cnt { font-size: 12px; color: var(--ink-2); font-weight: 700; min-width: 44px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.addhabit { position: sticky; left: 0; border-top: 1px solid var(--line); }
.addhabit input { width: 100%; border: 0; background: transparent; padding: 12px; outline: none; }
@media (max-width: 899px) { .htable .name { min-width: 130px; } }

/* ---------- tasks ---------- */
.listbar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.listbar::-webkit-scrollbar { display: none; }
.listbar .seg { white-space: nowrap; flex: none; }
.listbar .seg .c { font-weight: 500; opacity: .75; margin-left: 4px; }

/* ---------- goals ---------- */
.word { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }

/* ---------- notes ---------- */
.notes-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.note-card { display: flex; flex-direction: column; gap: 6px; color: var(--ink); min-height: 120px; }
.note-card:hover { border-color: var(--line-2); }
.note-card b { font-size: 15px; }
.note-card p { white-space: pre-line; margin: 0; color: var(--ink-2); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note-card small { color: var(--muted); margin-top: auto; }
.search { width: 100%; min-height: 42px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--surface); padding: 0 14px; outline: none; margin-bottom: 14px; }
.search:focus { border-color: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }
.note-title { font-size: 24px; font-weight: 700; border: 0; background: transparent; outline: none; width: 100%; padding: 4px 0 10px; letter-spacing: -.01em; }
.note-body { min-height: 60vh; }

/* ---------- more menu ---------- */
.menu { display: grid; gap: 8px; }
.menu a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--ink); font-weight: 600; }
.menu a svg { width: 22px; height: 22px; color: var(--accent-text); }
.menu a .chev { margin-left: auto; color: var(--muted); }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 380px; padding: 28px 24px; }
.auth h1 { margin: 14px 0 4px; font-size: 24px; letter-spacing: -.01em; }
.auth p { margin: 0 0 18px; color: var(--ink-2); }
.auth label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; color: var(--ink-2); }
.auth input { width: 100%; min-height: 46px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--surface-2); padding: 0 14px; outline: none; font-size: 16px; }
.auth input:focus { border-color: var(--accent); background: var(--surface); }
.auth .btn { width: 100%; min-height: 46px; margin-top: 18px; }
.err { color: var(--warn); font-size: 13.5px; margin-top: 10px; min-height: 1em; }
.ok { color: var(--accent-text); font-size: 13.5px; margin-top: 10px; }
.settings .field { margin-bottom: 8px; }
.settings p { margin: 0 0 10px; color: var(--ink-2); }
.settings ol { margin: 0; padding-left: 20px; color: var(--ink-2); }
.settings li { margin: 4px 0; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 22px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50; box-shadow: var(--shadow);
}
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* ---------- coaching theme ---------- */
:root { --gold: #A88A45; --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif; }
.linkbtn { border: 0; background: transparent; color: var(--accent-text); font-weight: 600; font-size: 12.5px; padding: 4px 6px; border-radius: 6px; }
.linkbtn:hover { background: var(--accent-soft); }

.scripture {
  position: relative; margin-bottom: 16px; padding: 18px 22px 18px 24px; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}
.scripture::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.s-kicker { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: -4px 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.s-kicker a { color: var(--accent-text); }
.scripture blockquote { margin: 0; font-family: var(--serif); font-size: 18px; line-height: 1.5; color: var(--ink); }
.scripture cite { display: block; margin-top: 8px; font-style: normal; font-size: 13px; font-weight: 600; color: var(--accent-text); }
.scripture .area, .quote .area { background: var(--surface); }
.scripture .field { margin-top: 6px; }

.quote { margin-top: 18px; padding: 22px 24px; text-align: center; border-top: 1px solid var(--line); }
.quote p { margin: 0 auto; max-width: 640px; font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.5; color: var(--ink-2); }
.quote p::before { content: "“"; display: block; font-size: 40px; line-height: .8; color: var(--gold); font-style: normal; }
.quote cite { display: block; margin-top: 8px; font-style: normal; font-size: 12.5px; color: var(--muted); }
.quote .label { justify-content: center; }
.quote .field, .quote .area { text-align: left; }

.soon { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; color: var(--ink); background: var(--today); border-color: transparent; }
.soon .go { color: var(--accent-text); font-weight: 700; white-space: nowrap; }

.bdays { margin-bottom: 18px; padding-top: 12px; padding-bottom: 12px; }
.bdays h2 { margin-bottom: 8px; }
.bd-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bd { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 6px 0 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-size: 14px; }
.bd-ic svg { width: 16px; height: 16px; display: block; }
.bd-x { border: 0; background: transparent; color: inherit; opacity: .6; font-size: 16px; width: 24px; height: 24px; border-radius: 50%; }
.bd-x:hover { opacity: 1; background: var(--surface); }
.bd-add { flex: 1; min-width: 160px; border: 0; border-bottom: 1px dashed var(--line-2); background: transparent; padding: 7px 0; outline: none; }
.bd-add:focus { border-bottom-color: var(--accent); }
.bd-form { display: grid; grid-template-columns: 1fr 180px auto; gap: 12px; align-items: end; }
@media (max-width: 599px) { .bd-form { grid-template-columns: 1fr 1fr; } .bd-form .btn { grid-column: 1 / -1; } }
.month .cell .bd-it { color: var(--accent-text); font-weight: 600; }

.mstrip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.mstrip .card { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; color: var(--ink); border-left: 4px solid var(--accent); }
.mstrip .card:hover { background: var(--accent-soft); }
.mstrip small { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-text); }
.mstrip b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 599px) { .mstrip { gap: 8px; } .mstrip .card { padding: 10px; } .mstrip b { font-size: 13px; white-space: normal; } .mstrip small { font-size: 9.5px; } }

.linkcard { display: flex; align-items: center; gap: 14px; color: var(--ink); border-left: 4px solid var(--accent); }
.linkcard:hover { background: var(--accent-soft); }
.lc-ic svg { width: 26px; height: 26px; color: var(--accent-text); display: block; }
.lc-tx { display: flex; flex-direction: column; flex: 1; }
.lc-tx b { font-size: 16px; }
.lc-tx span { color: var(--ink-2); font-size: 13.5px; }
.linkcard .chev { color: var(--muted); }

.kicker { margin: -10px 0 16px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.area.journal { min-height: 340px; background-image: repeating-linear-gradient(transparent 0 30px, var(--line) 30px 31px); background-attachment: local; line-height: 31px; padding-top: 4px; }

/* opener */
.opener {
  position: relative; overflow: hidden; border-radius: 22px; min-height: min(78vh, 720px);
  display: grid; place-items: center; text-align: center; padding: 56px 28px;
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 60%),
    linear-gradient(180deg, var(--accent-soft), var(--surface) 75%);
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
}
.opener::after { content: ""; position: absolute; inset: 14px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); border-radius: 14px; pointer-events: none; }
.o-art { position: absolute; right: 6%; bottom: -8px; width: 120px; color: var(--gold); opacity: .55; }
.o-art svg { width: 100%; height: auto; display: block; }
.o-body { position: relative; z-index: 1; max-width: 560px; display: flex; flex-direction: column; align-items: center; }
.o-kicker { font-size: 13px; letter-spacing: .4em; color: var(--accent-text); font-weight: 600; padding-left: .4em; }
.o-month { margin: 10px 0 0; font-family: var(--serif); font-weight: 400; font-size: clamp(54px, 11vw, 104px); line-height: 1; letter-spacing: -.01em; color: var(--accent-text); }
.o-rule { width: 64px; height: 2px; background: var(--gold); margin: 26px 0 22px; border-radius: 2px; }
.o-theme { font-size: 13px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--ink); }
.o-empty { color: var(--accent-text); }
.o-sub { margin-top: 8px; font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--ink-2); }
.o-verse { margin: 30px 0 0; }
.o-verse p { margin: 0; font-family: var(--serif); font-size: 20px; line-height: 1.5; color: var(--ink); }
.o-verse cite { display: block; margin-top: 10px; font-style: normal; font-size: 13px; font-weight: 600; color: var(--accent-text); }
.o-bd { margin-top: 26px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 13.5px; }
.o-bd-l { width: 100%; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.o-bd a { color: var(--ink-2); }
.o-go { margin-top: 34px; min-height: 46px; padding: 0 24px; border-radius: 99px; }
@media (max-width: 599px) { .opener { padding: 48px 20px; border-radius: 18px; } .o-art { width: 80px; right: 2%; } .o-verse p { font-size: 18px; } }

/* coaching page */
.coach { display: grid; gap: 18px; max-width: 860px; }
.coach-intro { padding: 26px 28px; }
.coach-intro p { font-size: 16px; line-height: 1.7; margin: 0 0 14px; color: var(--ink); }
.coach-intro p:last-child { margin-bottom: 0; }
.c-sub { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--accent-text); margin-bottom: 14px; }
.c-verse { margin: 0 0 20px; padding: 14px 18px; border-left: 3px solid var(--gold); background: var(--accent-soft); border-radius: 0 10px 10px 0; }
.c-verse p { font-family: var(--serif); font-size: 18px !important; margin: 0 !important; }
.c-verse cite { display: block; margin-top: 6px; font-style: normal; font-size: 13px; font-weight: 600; color: var(--accent-text); }
.c-p { margin: 0 0 14px; color: var(--ink-2); line-height: 1.6; }
.journey { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: j; }
.journey li { display: grid; grid-template-columns: 92px 1fr; column-gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.journey li:last-child { border-bottom: 0; }
.journey .j-d { grid-row: span 2; font-size: 12.5px; font-weight: 700; color: var(--accent-text); padding-top: 2px; }
.journey b { font-size: 15px; }
.journey li > span:last-child { color: var(--ink-2); font-size: 14px; }
.stones { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
@media (max-width: 699px) { .stones { grid-template-columns: 1fr; } }
.stone { display: flex; align-items: center; gap: 10px; }
.st-m { width: 34px; flex: none; font-size: 12px; font-weight: 700; color: var(--accent-text); text-transform: uppercase; letter-spacing: .04em; }
.qs { display: grid; gap: 18px; }
.q-t { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; margin-bottom: 8px; }
.q-t .num { margin-top: 1px; }
.efield { margin-bottom: 14px; }
.efield label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }

/* ---------- buckets ---------- */
.bk { --bt: color-mix(in srgb, var(--b) 80%, var(--ink)); }
.bbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 16px; }
.bbar-l { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.bchip {
  --bt: color-mix(in srgb, var(--b) 80%, var(--ink));
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 13px 0 10px; border-radius: 99px;
  border: 1.5px solid color-mix(in srgb, var(--b) 45%, var(--line)); background: var(--surface); color: var(--bt); font-weight: 700; font-size: 13.5px;
}
.bchip i { width: 10px; height: 10px; border-radius: 50%; background: var(--b); }
.bchip.on { background: var(--b); border-color: var(--b); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--b) 35%, transparent); }
.bchip.on i { background: #fff; }
@media (max-width: 599px) {
  .bbar { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px 4px; scrollbar-width: none; }
  .bbar::-webkit-scrollbar { display: none; }
  .bchip { flex: none; }
}
.bdot { position: relative; width: 22px; height: 22px; flex: none; display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
.bdot i { width: 11px; height: 11px; border-radius: 50%; background: var(--b); box-shadow: 0 0 0 3px color-mix(in srgb, var(--b) 18%, transparent); }
.bdot:hover i { box-shadow: 0 0 0 4px color-mix(in srgb, var(--b) 30%, transparent); }
.bsel { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; font-size: 16px; }
.todos li.bk { border-left: 3px solid var(--b); padding-left: 8px; margin-left: -11px; }
.todos li.bk .txt { color: var(--bt); font-weight: 500; }
.todos li.bk.done .txt, .todos li.bk.moved .txt { color: var(--muted); font-weight: 400; }
.todos li.bk.done { border-left-color: color-mix(in srgb, var(--b) 35%, transparent); }
.todos li.moved .check { opacity: .35; cursor: default; }
.todos li.moved .txt { font-style: italic; }
.todos li.addrow.bk { border-left-style: dashed; }
.todos li.addrow.bk .plus { color: var(--bt); }
.todos li.addrow.bk .add::placeholder { color: var(--bt); opacity: .7; }
.meta { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.meta.late { color: var(--warn); font-weight: 600; }
.top3 .row.bk .num { background: var(--b); color: #fff; }
.top3 .row.bk .txt { color: var(--bt); font-weight: 600; }
.top3 .num { position: relative; cursor: pointer; }
.month .cell .it.bk { color: var(--bt); border-left: 2px solid var(--b); padding-left: 4px; }
.month .cell .it.bk.done { color: var(--muted); }

.bgroup { border-top: 4px solid var(--b); }
.bgroup h2 { color: var(--bt, var(--ink)); --bt: color-mix(in srgb, var(--b) 80%, var(--ink)); }
.bg-name { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.bg-name i { width: 11px; height: 11px; border-radius: 50%; background: var(--b); }
.bg-count { font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--muted); font-weight: 600; }
.lcol { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; }
.mlist .ltxt { padding: 0; min-width: 0; }
a.ltxt:hover { text-decoration: underline; }
.todos li.bk.done .check { background: var(--b); border-color: var(--b); }
.bbar-l { white-space: nowrap; }
@media (max-width: 599px) {
  .lcol { flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 0; }
  .lcol .meta { white-space: normal; }
  .mlist .linkbtn { flex: none; }
}
.carry { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--today); border-color: transparent; }
.carry span { color: var(--ink-2); }
.bset li.bk { margin-left: 0; padding-left: 0; border-left: 0; gap: 12px; }
.bcolor { width: 34px; height: 34px; border: 0; padding: 0; background: none; cursor: pointer; flex: none; }
.bcolor::-webkit-color-swatch-wrapper { padding: 2px; }
.bcolor::-webkit-color-swatch { border: 0; border-radius: 50%; }
.bcolor::-moz-color-swatch { border: 0; border-radius: 50%; }
.mswitch a { font-size: 13px; }
.mstrip { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 699px) { .mstrip { grid-template-columns: 1fr 1fr; } }

/* ---------- print ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f4f5f4; --ink: #111; --ink-2: #333; --line: #ccc; --line-2: #bbb; --shadow: none; color-scheme: light; }
  @page { margin: 12mm; }
  body { background: #fff; font-size: 12px; }
  .side, .tabbar, .sync-pill, .tools, .noprint, .del, .addrow, .addhabit, .toast { display: none !important; }
  .main { margin: 0; padding: 0; max-width: none; }
  .card, .month, .htable-wrap { box-shadow: none; break-inside: avoid; }
  details.card > summary h2::after { content: none; }
  details.card:not([open]) > *:not(summary) { display: block; }
  ::placeholder { color: transparent; }
  .area { background: #fff; min-height: 0; }
  .htable-wrap { overflow: visible; }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .week { grid-template-columns: repeat(4, 1fr); }
  .year { grid-template-columns: repeat(4, 1fr); }
  .month { grid-template-columns: 30px repeat(7, 1fr); }
  .month .cell { min-height: 90px; }
  .daycard { min-height: 150px; }
  .month .cell .it, .month .cell .more { display: block; }
  .month .cell .pips { display: none; }
  a { color: inherit; }
  .scripture, .opener, .c-verse { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .opener { min-height: 250mm; }
  .area.journal { min-height: 140mm; }
  .bd-add { display: none; }
  .bk, .bgroup, .bdot i, .top3 .num { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .bgroup { break-inside: auto; }
}
