:root {
  --brand: #111111;        /* main colour: buttons, selected states, nav */
  --brand-hover: #333333;
  --on-brand: #ffffff;     /* text/icons placed on --brand */
  --accent: #111111;
  --accent-soft: #e6e6e6;
  --ink: #111111;
  --muted: #8f8f8f;
  --line: #dcdcdc;
  --card: #f1f1f1;
  --tint: #e6e6e6;
  --bg: #e4e4e4;
  --cell: #d6d6d6;
  --now: #d9503a;
  --radius: 14px;

  --fresh: #e8404f;
  --clot: #1a1a1a;
  --oxidized: #b97d4a;
  --watery: #f78fb8;
  --tissue: #a4a4ad;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Urbanist", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell: phone first ---------- */
.app {
  display: flex; flex-direction: column;
  height: 100dvh; max-width: 520px; margin: 0 auto;
  background: var(--card);
  position: relative;
}
.screen {
  flex: 1; order: 1; overflow-y: auto; overflow-x: hidden;
  padding: calc(env(safe-area-inset-top) + 18px) 20px 24px;
  -webkit-overflow-scrolling: touch;
}
.tabbar {
  order: 2; display: flex; justify-content: space-around;
  padding: 8px 0 calc(env(safe-area-inset-bottom) + 8px);
  border-top: 1px solid var(--line); background: var(--card);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); padding: 4px 18px; }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--accent); }
.app.editing .tabbar { display: none; }

/* ---------- headers ---------- */
.head { display: flex; align-items: center; justify-content: space-between; min-height: 40px; margin-bottom: 14px; }
.head h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.3px; }
.head.center { position: relative; justify-content: center; }
.head.center h2 { margin: 0; font-size: 18px; font-weight: 500; }
.head.center .left  { position: absolute; left: -6px; }
.head.center .right { position: absolute; right: -6px; }
.round-btn { width: 40px; height: 40px; display: grid; place-items: center; color: var(--accent); border-radius: 50%; }
.round-btn:active { background: var(--accent-soft); }
.add-btn { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-brand); display: grid; place-items: center; }
.add-btn .icon { width: 16px; height: 16px; stroke-width: 2.6; }

/* ---------- day strip ---------- */
.days { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; margin: 0 -20px 8px; padding-inline: 20px; scrollbar-width: none; scroll-snap-type: x proximity; }
.days::-webkit-scrollbar { display: none; }
.day {
  flex: 0 0 auto; width: 52px; height: 58px; border-radius: 10px; background: var(--tint);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1px solid transparent; scroll-snap-align: end; position: relative;
}
.day small { font-size: 10px; color: var(--muted); }
.day b { font-size: 16px; font-weight: 400; color: var(--muted); }
.day.has::after { content: ""; position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: .5; }
.day.sel { background: #fff; border-color: var(--accent); }
.day.sel small, .day.sel b { color: var(--accent); }

/* ---------- entry cards ---------- */
.list { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.entry {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 16px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
}
.entry.done { background: var(--tint); border-color: transparent; }
.entry .txt { flex: 1; min-width: 0; }
.entry .t { font-size: 18px; }
.entry .s { font-size: 14px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.check { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid #c9ccd8; display: grid; place-items: center; color: var(--on-brand); flex: none; }
.check .icon { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.check.on { background: var(--accent); border-color: var(--accent); }
.check.on .icon { opacity: 1; }
.empty { text-align: center; color: var(--muted); padding: 48px 12px; line-height: 1.5; }
.empty b { color: var(--ink); display: block; font-size: 17px; margin-bottom: 6px; font-weight: 500; }

/* ---------- progress ---------- */
.big { display: flex; align-items: flex-end; gap: 10px; margin-top: 28px; }
.big .num { font-size: 60px; font-weight: 300; letter-spacing: -2px; line-height: 1; }
.big .delta { color: var(--accent); font-size: 15px; padding-bottom: 8px; }
.big .delta span { color: var(--muted); }
.cap { color: var(--muted); font-size: 16px; margin-top: 6px; }
.controls { display: flex; justify-content: space-between; margin: 28px 0 12px; color: var(--muted); }
.select { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 16px; }
.select svg { width: 10px; height: 10px; fill: var(--accent); }
.select select { appearance: none; border: 0; background: none; font: inherit; color: var(--muted); padding: 0; outline: none; cursor: pointer; }
.chart { width: 100%; height: 190px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.sec { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 12px; }
.sec span { color: var(--ink); font-size: 16px; }
.pill { background: var(--accent); color: var(--on-brand); font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 99px; }
.log { padding: 14px 16px; border-radius: 10px; background: var(--tint); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; }
.log .a { font-size: 19px; }
.log .b { font-size: 12px; color: var(--muted); margin-top: 4px; }
.log .c { font-size: 12px; color: var(--muted); }

/* ---------- editor ---------- */
.editor { display: flex; flex-direction: column; min-height: 100%; }
.editor-body { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.pad-wrap {
  position: relative; background: radial-gradient(circle at 50% 40%, #f7f8fc, #eceef6); border-radius: var(--radius);
  display: grid; place-items: center; padding: 10px; touch-action: none;
}
.pad-svg { width: 100%; max-height: 52dvh; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.pad-body { fill: #fff; stroke: #d9dbe5; stroke-width: 2; }
.pad-core { fill: #fbfbfd; stroke: #e3e5ee; stroke-width: 1.5; stroke-dasharray: 4 5; }
.pad-guide { stroke: #eceef4; stroke-width: 1.5; stroke-dasharray: 3 6; }
.pad-label { font-size: 11px; fill: #b5b9cc; pointer-events: none; letter-spacing: 1.5px; text-anchor: middle; text-transform: uppercase; }
.spot { cursor: grab; }
.spot .ring { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 4 3; opacity: 0; }
.spot.sel .ring { opacity: 1; }
.hint { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 12px; color: var(--muted); pointer-events: none; }

.panel h3 { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.type {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; text-align: left; transition: border-color .12s, background .12s;
}
.type i { width: 18px; height: 18px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.type b { display: block; font-size: 14px; font-weight: 500; }
.type small { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.type.on { border-color: var(--accent); background: var(--accent-soft); }

.seg { display: flex; background: var(--tint); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; padding: 9px 4px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.08); font-weight: 500; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
textarea {
  width: 100%; min-height: 70px; resize: vertical; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: 15px; color: var(--ink); outline: none; background: #fff;
}
textarea:focus { border-color: var(--accent); }
.time-input { border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; color: var(--ink); background: #fff; width: 100%; }
.actions { display: flex; gap: 10px; }
.btn { flex: 1; padding: 13px; border-radius: 12px; font-weight: 600; font-size: 15px; text-align: center; border: 1.5px solid var(--line); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-brand); }
.btn.danger { color: var(--accent); }
.btn:disabled { opacity: .4; }
.btn:active { transform: scale(.98); }
.spot-list { font-size: 13px; color: var(--muted); }

/* ---------- settings ---------- */
.card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.card h4 { margin: 0 0 4px; font-weight: 500; font-size: 16px; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.card .actions .btn { flex: none; padding: 10px 16px; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--on-brand); padding: 10px 16px; border-radius: 99px; font-size: 14px;
  transition: .25s; pointer-events: none; z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- tablet / iPad ---------- */
@media (min-width: 700px) {
  body { background: radial-gradient(1200px 600px at 80% -10%, #ffe9ed 0, transparent 60%), var(--bg); }
  .app {
    max-width: 1180px; height: 100dvh; flex-direction: row; background: transparent;
    padding: 24px; gap: 24px;
  }
  .tabbar {
    order: 0; flex-direction: column; justify-content: flex-start; gap: 6px;
    width: 96px; border: 0; border-radius: 22px; background: var(--card); padding: 18px 8px;
    box-shadow: 0 10px 40px rgba(47,51,73,.07); align-self: flex-start;
  }
  .tab { padding: 12px 6px; border-radius: 14px; width: 100%; font-size: 12px; }
  .tab.active { background: var(--accent-soft); }
  .app.editing .tabbar { display: flex; }
  .screen {
    background: var(--card); border-radius: 22px; padding: 28px 32px;
    box-shadow: 0 10px 40px rgba(47,51,73,.07);
  }
  .days { margin-inline: -32px; padding-inline: 32px; }
  .head h1 { font-size: 32px; }
  .days { gap: 12px; }
  .day { width: 64px; height: 68px; }
  .day b { font-size: 18px; }

  .list { margin-top: 0; }

  /* editor: pad left, controls right */
  .editor-body { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr); gap: 28px; align-items: start; }
  .pad-svg { max-height: calc(100dvh - 190px); }
  .pad-wrap { position: sticky; top: 0; }
  .types { grid-template-columns: 1fr 1fr; }
  .chart { height: 240px; }
  .progress { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 40px; align-items: start; }
  .progress .full { grid-column: 1 / -1; }
}
@media (min-width: 700px) and (max-width: 900px) { .tabbar { width: 80px; } .app { padding: 16px; gap: 16px; } }
@media (min-width: 1000px) { .screen { padding: 32px 40px; } }
@media (hover: none) { .type:hover, .btn:hover { background: inherit; } }

@media print {
  .tabbar, .head .right, .add-btn, .toast, .actions, .pill { display: none !important; }
  .app { display: block; height: auto; padding: 0; max-width: none; }
  .screen { box-shadow: none; overflow: visible; padding: 0; }
}

}

/* brush */
.pad-svg { cursor: crosshair; }
.pad-svg .hit { pointer-events: none; }
.pad-svg.erasing { cursor: cell; }
.pad-svg.erasing .hit { pointer-events: stroke; }

/* ---------- editor controls ---------- */
.controls-col { display: flex; flex-direction: column; gap: 18px; }
.dock { display: flex; flex-direction: column; gap: 18px; }
.dock-row { display: grid; gap: 14px; }
.mini { display: flex; gap: 8px; }
.chip-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-size: 14px; }
.chip-btn:disabled { opacity: .35; }
.chip-btn .icon { width: 20px; height: 20px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg .icon { width: 18px; height: 18px; }
.sz { display: none; width: var(--s); height: var(--s); border-radius: 50%; background: currentColor; }
.int { display: none; width: 14px; height: 14px; border-radius: 50%; background: var(--c); }
.save-link { color: var(--accent); font-weight: 600; font-size: 16px; padding: 8px 6px; }
.sheet-bg, .sheet-head, .only-phone { display: none; }
.sheet { display: flex; flex-direction: column; gap: 18px; }
.pad-wrap .hint { top: 10px; bottom: auto; }

@media (min-width: 700px) {
  .dock-row { grid-template-columns: 1fr; }
  .mini { justify-content: flex-start; }
  .sz, .int { display: none !important; }
}

/* ---------- phone: pad fills the screen, controls dock at the bottom ---------- */
@media (max-width: 699px) {
  .app.editing .screen { padding: 0; overflow: hidden; display: flex; }
  .editor { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; }
  .editor .head { margin: 0; padding: calc(env(safe-area-inset-top) + 6px) 14px 4px; min-height: 0; }
  .editor .head.center .left { left: 6px; }
  .editor .head.center .right { right: 8px; }
  .editor-body { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 0; }
  .pad-wrap { flex: 1; min-height: 0; border-radius: 0; padding: 4px 6px; display: flex; place-items: stretch; }
  .pad-svg { width: 100%; height: 100%; max-height: none; }
  .controls-col { display: block; gap: 0; }
  .dock {
    gap: 10px; padding: 10px 12px calc(env(safe-area-inset-bottom) + 10px);
    background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(47,51,73,.05);
  }
  .dock h3, .types-panel h3 { display: none; }
  .types { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 2px 12px; }
  .types::-webkit-scrollbar { display: none; }
  .type { flex: 0 0 auto; flex-direction: column; gap: 5px; padding: 8px 6px 6px; min-width: 62px; border-width: 1.5px; text-align: center; }
  .type i { width: 28px; height: 28px; }
  .type b { font-size: 11px; }
  .type small { display: none; }
  .dock-row { grid-template-columns: 1fr 1fr; align-items: center; gap: 8px; }
  .dock-row .seg button { padding: 9px 12px; min-width: 42px; }
  .dock-row .seg button span { display: none; }
  .sz, .int { display: block; }
  .chip-btn { padding: 9px 11px; }
  .chip-btn span { display: none; }
  .only-phone { display: inline-flex; }
  .sheet-head.only-phone { display: flex; }

  /* details bottom sheet */
  .details { position: fixed; inset: 0; z-index: 20; display: none; }
  .details.open { display: block; }
  .sheet-bg { display: block; position: absolute; inset: 0; background: rgba(30,32,48,.35); }
  .sheet {
    position: absolute; left: 0; right: 0; bottom: 0; max-height: 82dvh; overflow-y: auto;
    background: #fff; border-radius: 20px 20px 0 0; padding: 14px 18px calc(env(safe-area-inset-bottom) + 18px);
    animation: up .22s ease-out;
  }
  .sheet-head { justify-content: space-between; align-items: center; }
  .sheet-head b { font-size: 17px; font-weight: 600; }
  @keyframes up { from { transform: translateY(40px); opacity: 0; } }
}

.zoom-reset { position: absolute; right: 12px; bottom: 12px; z-index: 2; background: var(--ink); color: var(--on-brand); font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: 99px; opacity: .88; }
.zoom-reset[hidden] { display: none; }
@media (max-width: 699px) { .pad-wrap { padding: 4px 0; } }

/* ================= monochrome redesign ================= */
.btn.danger { color: #c4361f; }
.big .delta { color: var(--ink); }
.pill { letter-spacing: .4px; }
.card { background: #fff; border-color: transparent; }
.log { background: #fff; }

/* floating pill navigation */
.tabbar {
  position: fixed; z-index: 5; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 14px); transform: translateX(-50%);
  width: min(360px, calc(100% - 40px)); display: flex; flex-direction: row; gap: 4px; padding: 6px; align-self: auto;
  background: var(--brand); border: 0; border-radius: 99px; box-shadow: 0 10px 30px rgba(0,0,0,.22);
}
.tab { flex: 1; width: auto; flex-direction: row; justify-content: center; padding: 13px 8px; border-radius: 99px; font-size: 14px; font-weight: 600; color: var(--on-brand); }
.tab svg { display: none; }
.tab.active { background: var(--card); color: var(--brand); }
.app.editing .tabbar { display: none; }
.screen { padding-bottom: 120px; }

/* home */
.home-head { display: flex; justify-content: space-between; align-items: flex-start; }
.date-pick { position: relative; display: block; cursor: pointer; }
.date-pick .dow { display: block; font-size: 26px; font-weight: 600; letter-spacing: -.5px; line-height: 1.15; }
.date-pick .dmy { display: block; font-size: 22px; font-weight: 400; color: #333; letter-spacing: -.3px; }
.date-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.arrows { display: flex; }
.arrow-btn { width: 38px; height: 38px; display: grid; place-items: center; }
.arrow-btn:disabled { opacity: .2; }
.hero { margin-top: 26px; }
.clock { text-align: center; font-size: 78px; font-weight: 300; letter-spacing: -3px; line-height: 1; font-variant-numeric: tabular-nums; }
.tl-dots, .tl { margin-inline: -20px; }
.tl-dots { position: relative; height: 34px; margin-top: 2px; }
.tl-dots i { position: absolute; border-radius: 50%; background: var(--brand); }
.tl { position: relative; display: flex; gap: 2px; height: 16px; margin-bottom: 44px; }
.tl .c { flex: 1; background: var(--cell); }
.tl .c.on { background: var(--brand); }
.tl-entry {
  position: absolute; top: -3px; bottom: -3px; width: 12px; border: 1px solid var(--brand);
  background: repeating-linear-gradient(135deg, var(--brand) 0 1px, var(--card) 1px 3px);
}
.tl-now { position: absolute; top: -8px; bottom: -8px; width: 1.5px; background: var(--brand); transform: translateX(-50%); }
.tl-now span { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 8px; background: var(--now); color: #fff; font-size: 9.5px; font-weight: 700; letter-spacing: .6px; padding: 5px 10px; border-radius: 99px; }

.sec-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.sec-head h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.3px; }
.plus-btn { width: 32px; height: 32px; display: grid; place-items: center; }
.plus-btn .icon { width: 26px; height: 26px; stroke-width: 1.5; }

.list { gap: 0; margin-top: 0; }
.entry { padding: 22px 2px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; gap: 14px; }
.entry.done { background: none; }
.entry.done .t { opacity: .5; }
.entry .t { font-size: 20px; line-height: 1.2; letter-spacing: -.2px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { font-size: 11px; border: 1px solid var(--brand); border-radius: 99px; padding: 3px 10px; line-height: 1.3; }
.tag.ghost { border-color: transparent; color: var(--muted); padding-inline: 4px; }
.check { width: 34px; height: 34px; border-radius: 9px; background: #e3e3e3; border: 0; }
.check.on { background: var(--brand); }

@media (min-width: 700px) {
  body { background: var(--bg); }
  .app { max-width: 980px; }
  .app.editing .screen { padding-bottom: 28px; }
  .screen { padding-inline: 36px; border-radius: 28px; }
  .tl-dots, .tl { margin-inline: -36px; }
  .clock { font-size: 96px; }
  .home-head .dow, .date-pick .dow { font-size: 32px; }
}
@media (min-width: 1000px) { .screen { padding-inline: 48px; } .tl-dots, .tl { margin-inline: -48px; } }

/* ================= nav: four tabs ================= */
.tabbar { width: min(440px, calc(100% - 24px)); }
.tab { padding: 13px 4px; font-size: 13px; }

/* ================= login ================= */
.app.auth .tabbar { display: none; }
.app.auth .screen { display: flex; flex-direction: column; justify-content: center; padding-bottom: 28px; }
.auth-strip { margin-bottom: 30px; }
.auth-strip .tl-dots, .auth-strip .tl { margin-inline: 0; }
.auth-strip .tl { margin-bottom: 0; }
.auth-strip .tl-now span { display: none; }
.auth-wrap { width: 100%; max-width: 400px; margin: 0 auto; }
.auth-title { margin: 0 0 6px; font-size: 42px; font-weight: 600; letter-spacing: -1.2px; }
.auth-sub { margin: 0 0 24px; color: #555; font-size: 17px; line-height: 1.4; }
.auth-seg { background: #e2e2e2; }
.auth-seg button { padding: 11px 4px; font-weight: 500; }
.field { display: block; margin-top: 14px; }
.field span { display: block; font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field input { width: 100%; padding: 15px 16px; border-radius: 14px; border: 1.5px solid transparent; background: #fff; font: inherit; font-size: 17px; color: var(--ink); outline: none; }
.field input:focus { border-color: var(--brand); }
.form-error { color: #c4361f; font-size: 14px; min-height: 20px; margin-top: 12px; }
.btn.big { width: 100%; margin-top: 6px; padding: 16px; border-radius: 99px; font-size: 16px; }
.auth-note { margin: 22px 0 0; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* ================= dashboard ================= */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.stat { background: #fff; border-radius: 18px; padding: 16px 16px 14px; }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .num { font-size: 44px; font-weight: 300; letter-spacing: -1.5px; line-height: 1.1; margin-top: 6px; }
.stat .d { font-size: 13px; margin-top: 2px; }
.stat .d span { color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
.dcard { background: #fff; border-radius: 18px; padding: 18px; min-width: 0; }
.dcard h3 { margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.dcard .log { background: var(--card); }
.dcard .chart { height: 200px; }
.brow { display: grid; grid-template-columns: 76px 1fr 30px; gap: 10px; align-items: center; margin: 11px 0; font-size: 14px; }
.brow b { text-align: right; font-weight: 600; }
.btrack { height: 8px; border-radius: 99px; background: #ededed; overflow: hidden; }
.bfill { height: 100%; border-radius: 99px; min-width: 0; }
.muted { color: var(--muted); font-size: 14px; margin: 4px 0; }
.dash-grid .select { font-size: 16px; }
.home-head .select { color: var(--ink); padding-top: 6px; }
.home-head .select select { color: var(--ink); font-weight: 500; }

/* ================= calendar ================= */
.cal-sum { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; font-size: 14px; color: #555; }
.cal-sum .chip-btn { padding: 7px 14px; font-size: 13px; font-weight: 600; background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); margin: 18px 0 8px; text-align: center; font-size: 12px; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell { aspect-ratio: 1 / 1.12; border-radius: 12px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 16px; font-weight: 500; }
.cal-cell.blank { background: none; }
.cal-cell.h1 { background: #e0e0e0; }
.cal-cell.h2 { background: #c8c8c8; }
.cal-cell.h3 { background: #a8a8a8; }
.cal-cell.future { opacity: .4; pointer-events: none; }
.cal-cell.today { box-shadow: inset 0 0 0 1.5px var(--brand); }
.cal-cell.sel { background: var(--brand); color: var(--on-brand); }
.cal-dots { display: flex; gap: 3px; height: 6px; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.7); }
.cal-key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.cal-key i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.cal-day { margin-top: 26px; }

@media (min-width: 700px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .dcard.wide { grid-column: 1 / -1; }
  .dcard .chart { height: 240px; }
  .cal-layout { display: grid; grid-template-columns: minmax(340px, 1.2fr) minmax(280px, 1fr); gap: 36px; align-items: start; }
  .cal-day { margin-top: 0; padding-top: 6px; }
  .cal-dow { margin-top: 22px; }
}

/* ================= responsive: tablet + desktop ================= */
.brand, .nav-foot { display: none; }
.auth-hero { width: 100%; max-width: 400px; margin: 0 auto; }
.auth-wrap { margin-top: 0; }
.dcard .chart { height: auto; }

/* never let two-column layouts overflow their container */
@media (min-width: 700px) {
  .editor-body, .cal-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cal-layout { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .dcard .chart { height: auto; }
}

/* pointer / keyboard affordances for mouse users */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.field input:focus-visible, textarea:focus-visible { outline: none; }
@media (hover: hover) {
  .tab:not(.active):hover { background: rgba(255,255,255,.14); }
  .entry:hover, .log:hover { background: rgba(0,0,0,.035); }
  .dcard .log:hover { background: #e9e9e9; }
  .cal-cell:not(.sel):not(.blank):hover { filter: brightness(.94); }
  .type:hover { border-color: #b8b8b8; }
  .type.on:hover { border-color: var(--brand); }
  .btn:hover { background: #f6f6f6; }
  .btn.primary:hover { background: var(--brand-hover); }
  .arrow-btn:hover:not(:disabled), .plus-btn:hover, .round-btn:hover { background: rgba(0,0,0,.07); border-radius: 50%; }
  .chip-btn:hover:not(:disabled) { background: #f4f4f4; }
  .seg button:not(.on):hover { color: var(--brand); }
}

/* ---- iPad landscape + desktop: side navigation, full-width workspace ---- */
@media (min-width: 900px) {
  .app { max-width: none; margin: 0; padding: 20px; gap: 20px; flex-direction: row; }
  .tabbar {
    position: static; transform: none; order: 0; flex: none; width: 104px; align-self: stretch;
    flex-direction: column; justify-content: flex-start; gap: 6px; padding: 18px 8px; border-radius: 28px; box-shadow: none;
  }
  .tab { flex: none; flex-direction: column; gap: 6px; padding: 14px 4px; border-radius: 18px; font-size: 12px; }
  .tab svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .app.editing .tabbar { display: flex; }
  .screen { order: 1; flex: 1; min-width: 0; padding: 36px 44px; border-radius: 28px; }
  .app.editing .screen { padding-bottom: 36px; }
  .screen > * { max-width: 1240px; margin-inline: auto; }
  .tl-dots, .tl { margin-inline: 0; }
  .tl { border-radius: 2px; }
  .clock { font-size: 104px; letter-spacing: -4px; }
  .home-head .dow, .date-pick .dow { font-size: 34px; }
  .date-pick .dmy { font-size: 24px; }
  .sec-head h2 { font-size: 26px; }
  .entry .t { font-size: 22px; }
  .pad-svg { max-height: calc(100dvh - 190px); }

  /* login: brand on the left, form on the right */
  .app.auth { padding: 0; }
  .app.auth .screen { border-radius: 0; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 72px; padding: 48px 7vw; }
  .app.auth .screen > * { max-width: none; margin: 0; }
  .app.auth .screen > .auth-hero { max-width: 520px; margin-left: auto; }
  .app.auth .screen > .auth-wrap { max-width: 400px; margin-right: auto; }
  .auth-title { font-size: 60px; letter-spacing: -2px; }
  .auth-sub { font-size: 19px; }
  .auth-strip { margin-bottom: 40px; }
}

/* ---- wide desktop: expanded sidebar ---- */
@media (min-width: 1280px) {
  .tabbar { width: 248px; padding: 24px 14px; }
  .tab { flex-direction: row; justify-content: flex-start; gap: 14px; padding: 14px 16px; font-size: 15px; }
  .brand { display: block; color: var(--on-brand); font-size: 22px; font-weight: 600; letter-spacing: -.5px; padding: 4px 16px 24px; }
  .nav-foot { display: flex; align-items: center; gap: 12px; margin-top: auto; padding: 16px 16px 4px; border-top: 1px solid rgba(255,255,255,.14); color: var(--on-brand); }
  .screen { padding: 40px 56px; }
}

/* ---- dashboard + calendar use the extra width ---- */
@media (min-width: 1100px) {
  .stats { gap: 14px; }
  .dash-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .dcard.recent { grid-column: 1 / -1; }
  .recent-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
  .cal-layout { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; }
  .editor-body { gap: 44px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}
@media (min-width: 900px) {
  .cal-dow, .cal-grid { max-width: 720px; }
  .cal-key { max-width: 720px; }
  .stat .num { font-size: 52px; }
}

/* ---------- verse of the day + Bible reader ---------- */
.greeting { text-align: center; font-size: 13px; font-weight: 600; letter-spacing: 2.4px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.hero-verse { position: relative; max-width: 440px; margin: 20px auto 6px; padding: 18px 28px 0; text-align: center; }
.hero-verse::before { content: ""; display: block; width: 36px; height: 1px; background: var(--ink); opacity: .35; margin: 0 auto 16px; }
.hero-verse .verse-open { display: block; width: 100%; text-align: center; }
.hero-verse q { display: block; quotes: "\201C" "\201D"; font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-weight: 500; font-size: 23px; line-height: 1.4; letter-spacing: .1px; }
.hero-verse cite { display: block; margin-top: 12px; font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.verse-x { position: absolute; top: 4px; right: 0; width: 28px; height: 28px; font-size: 20px; line-height: 1; color: var(--muted); border-radius: 50%; opacity: .6; }
.verse-x:hover { background: var(--line); opacity: 1; }
@media (min-width: 700px) { .hero-verse q { font-size: 27px; } .hero-verse { max-width: 560px; } }


/* ---------- wear time + score ---------- */
.worn-grid { display: grid; grid-template-columns: 44px 1fr 96px; gap: 8px; align-items: center; }
.worn-grid span { color: var(--muted); font-size: 13px; }
.worn-grid .time-input { width: 100%; min-width: 0; }
.worn-dur { margin-top: 8px; font-size: 13px; color: var(--muted); }
.sec-head .day-score { margin-top: 3px; font-size: 13px; color: var(--muted); }
.head-score { display: block; margin-top: 1px; font-size: 12px; font-weight: 500; color: var(--muted); }
.head-score:empty { display: none; }

/* ---------- medicines ---------- */
.meds { margin-bottom: 22px; }
.btn.small { flex: none; padding: 7px 14px; font-size: 13px; }
.med-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.med-row { display: flex; align-items: stretch; gap: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.med-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; }
.med-check { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border: 1.5px solid var(--muted); border-radius: 50%; }
.med-check .icon { width: 16px; height: 16px; stroke-width: 2.4; }
.med-txt { display: block; min-width: 0; }
.med-txt b { display: block; font-size: 15px; font-weight: 600; }
.med-txt small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.med-txt small i { font-style: normal; }
.med-skip { flex: none; padding: 0 14px; color: var(--muted); font-size: 13px; }
.med-row.taken { background: var(--tint); }
.med-row.taken .med-check { background: var(--ink); border-color: var(--ink); color: var(--card); }
.med-row.taken .med-txt b { text-decoration: line-through; text-decoration-thickness: 1px; opacity: .6; }
.med-row.skipped { opacity: .6; }
.med-row.overdue, .med-row.missed { border-color: var(--now); }
.med-row.overdue .med-txt small i, .med-row.missed .med-txt small i { color: var(--now); font-weight: 600; }
.med-day h3 { margin: 18px 0 0; font-size: 15px; font-weight: 600; color: var(--muted); }

/* ---------- pencil switch (touch screens) ---------- */
.pencil-fab {
  position: absolute; left: 12px; bottom: 12px; z-index: 2; width: 54px; height: 54px; display: grid; place-items: center;
  border-radius: 50%; background: var(--card); color: var(--ink); border: 1.5px solid var(--ink); box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.pencil-fab .icon { width: 24px; height: 24px; }
.pencil-fab.on { background: var(--ink); color: var(--on-brand); }

/* while zooming or panning: no blur/displacement/blend filters, so every frame is cheap */
.pad-svg.moving g[filter] { filter: none; }
.pad-svg.moving [style*="mix-blend-mode"] { mix-blend-mode: normal !important; }

/* the stroke being drawn, painted on a light canvas laid over the pad */
.live-canvas { position: absolute; z-index: 1; pointer-events: none; }

/* ---------- entries table (wide screens) ---------- */
.entry-table { display: none; width: 100%; border-collapse: collapse; margin-top: 8px; }
@media (min-width: 700px) { .list.cards { display: none; } .entry-table { display: table; } }
.entry-table th { text-align: left; padding: 8px 12px; font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.entry-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 15px; }
.entry-table td small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.entry-table tbody tr { cursor: pointer; }
.entry-table tbody tr:hover { background: rgba(0,0,0,.035); }
.entry-table tr.done td:not(.c-thumb):not(:last-child) { opacity: .55; }
.entry-table .tag { margin: 0 4px 4px 0; }
.entry-table .dots { margin-left: 4px; }
.c-thumb { width: 64px; padding-block: 8px; }
.thumb-svg { display: block; width: 44px; height: 121px; border-radius: 8px; background: radial-gradient(circle at 50% 40%, #f7f8fc, #eceef6); }
.score-num { font-size: 22px; font-weight: 600; letter-spacing: -.5px; }

/* small pad picture on entry cards */
.card-thumb { flex: none; }
.card-thumb .thumb-svg { width: 34px; height: 94px; }

/* calendar: medicine status */
.cal-med { display: block; width: 14px; height: 3px; border-radius: 2px; background: var(--line); }
.cal-med.ok { background: var(--ink); }
.cal-med.part { background: linear-gradient(90deg, var(--ink) 50%, var(--line) 50%); }
.cal-med.miss { background: var(--now); }
.cal-cell.sel .cal-med.ok { background: var(--on-brand); }
.cal-cell { position: relative; }
.cal-cell .cal-med { position: absolute; bottom: 7px; }
.cal-key b.cal-med { display: inline-block; width: 14px; margin-right: 6px; vertical-align: middle; position: static; }
.cal-meds { margin-top: 22px; }

/* dashboard: medicines */
.med-head { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 14px; }
.med-pct { font-size: 40px; font-weight: 300; letter-spacing: -1.5px; line-height: 1; }
.med-rows { display: flex; flex-direction: column; gap: 10px; }
.mrow { display: grid; grid-template-columns: minmax(90px, 36%) 1fr 44px; align-items: center; gap: 10px; font-size: 14px; }
.mrow b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.mtrack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--cell); }
.mtrack i { display: block; height: 100%; }
.mtrack .t { background: var(--ink); }
.mtrack .s { background: #bdbdbd; }
.mtrack .m { background: var(--now); }
.med-strip { display: flex; gap: 2px; margin-top: 16px; }
.med-strip .d { flex: 1; height: 22px; border-radius: 3px; background: var(--cell); opacity: .55; }
.med-strip .d.ok { background: var(--ink); opacity: 1; }
.med-strip .d.part { background: linear-gradient(180deg, var(--cell) 50%, var(--ink) 50%); opacity: 1; }
.med-strip .d.miss { background: var(--now); opacity: 1; }

/* signed-in user, bottom of the side nav */
.nav-avatar { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--brand); font-size: 18px; font-weight: 600; }
.nav-name { min-width: 0; font-size: 18px; font-weight: 600; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-out { flex: none; margin-left: auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #b5b5b5; }
.nav-out:hover { background: rgba(255,255,255,.14); color: var(--on-brand); }
.nav-out .icon { width: 20px; height: 20px; }

/* theme picker */
.themes { display: flex; flex-wrap: wrap; gap: 10px; }
.theme-opt { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border: 1.5px solid var(--line); border-radius: 99px; background: #fff; font-size: 15px; font-weight: 500; cursor: pointer; }
.theme-opt i { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.theme-opt.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.theme-opt input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* ---------- Bible reader ---------- */
.reader-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.reader-titlebox { text-align: center; min-width: 0; }
.reader-title { display: inline-flex; align-items: center; gap: 8px; font-size: 26px; font-weight: 600; letter-spacing: -.4px; padding: 4px 10px; border-radius: 10px; }
.reader-title svg { width: 11px; height: 11px; fill: currentColor; opacity: .6; }
.reader-title:hover { background: var(--tint); }
.reader-titlebox small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; letter-spacing: .4px; }
.reader-tools { display: flex; justify-content: center; gap: 8px; margin: 12px 0 6px; }
.reader-pill { padding: 7px 16px; border: 1.5px solid var(--line); border-radius: 99px; background: #fff; font-size: 14px; font-weight: 600; }
.reader-pill.on { border-color: var(--brand); color: var(--brand); }
.reader-panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 10px 0 4px; }
.reader-panel .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }
.reader-panel .row + .row { margin-top: 8px; }
.reader-panel .link { color: var(--brand); font-weight: 600; font-size: 15px; }
.seg.wide { display: flex; margin-bottom: 12px; } .seg.wide button { flex: 1; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 6px; max-height: 52dvh; overflow-y: auto; }
.chap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; max-height: 52dvh; overflow-y: auto; margin-top: 8px; }
.book-grid button, .chap-grid button { padding: 10px 6px; border-radius: 10px; background: var(--card); font-size: 14px; font-weight: 500; }
.book-grid button:hover, .chap-grid button:hover { background: var(--tint); }
.book-grid button.on, .chap-grid button.on { background: var(--brand); color: var(--on-brand); }
.reader-h { margin: 18px 0 12px; text-align: center; font-size: 15px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }
.reader-text { --fs: 18px; font-size: var(--fs); line-height: 1.8; max-width: 38em; margin: 0 auto; }
.reader-text.size-0 { --fs: 15px; } .reader-text.size-1 { --fs: 16.5px; } .reader-text.size-2 { --fs: 18px; } .reader-text.size-3 { --fs: 21px; } .reader-text.size-4 { --fs: 25px; }
.reader-text.serif { font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif; }
.reader-text p { margin: 0 0 1.1em; }
.reader-text .v { cursor: pointer; border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.reader-text sup { color: var(--brand); font-size: .6em; font-weight: 700; margin-right: .35em; vertical-align: .55em; font-family: "Urbanist", sans-serif; }
.reader-text .hl1 { background: #fff1a6; } .reader-text .hl2 { background: #cdeccb; } .reader-text .hl3 { background: #cfe4fb; } .reader-text .hl4 { background: #fbd0e1; }
.reader-text .hl1, .reader-text .hl2, .reader-text .hl3, .reader-text .hl4 { color: #111; }
.reader-text .today { font-weight: 600; }
.reader-text .sel { text-decoration: underline; text-decoration-color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.reader-foot { display: flex; align-items: center; justify-content: space-between; margin: 24px auto 8px; max-width: 38em; }
.reader-foot small { color: var(--muted); font-size: 12px; }
.sel-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 12px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 28px rgba(0,0,0,.18); }
.sel-count { font-weight: 600; font-size: 14px; }
.sel-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hl-dot { width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.hl-dot.clear { background: #fff; font-size: 18px; line-height: 1; color: var(--muted); }
.sel-x { width: 28px; height: 28px; font-size: 20px; color: var(--muted); }
.reader-text.lines p { margin: 0 0 .55em; }
.reader-text.lines p.vline { padding-left: 1.5em; text-indent: -1.5em; } /* wrapped lines hang under the text, not the number */
.reader-text.lines sup { display: inline-block; min-width: 2.2em; text-indent: 0; }
