/* ============================================================================
   今日 — one thing at a time.

   Sizing note (the one iOS-specific decision in this file):
   --app-h is the height of the app shell.
     · iOS home-screen app: 100vh. The first-frame probe (2026-11-09) showed
       display-mode still reports "browser" when launched from the home screen
       (dmB=1, dmS=0), so a CSS media query cannot detect standalone. But
       navigator.standalone is set, so the head script records it as
       html.is-standalone. On that device dvh/lvh = 852 while vh/svh = 896
       (the screen), so 100vh is the only unit that matches the screen.
     · browser tab / desktop: 100dvh — the honest, visible height.
   No geometry is measured in JS; the head script records a mode only.
   ========================================================================== */

:root {
  --bg: #050506;
  --ink: #F2EFE8;
  --ink-2: rgba(242, 239, 232, .74);
  --ink-3: rgba(242, 239, 232, .42);
  --ink-4: rgba(242, 239, 232, .20);

  --h: 40;
  --s: 52%;
  --l: 70%;
  --accent: hsl(var(--h), var(--s), var(--l));
  --accent-hi: hsl(var(--h), var(--s), 90%);
  --accent-dim: hsl(var(--h), var(--s), 40%);

  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", Georgia, "Times New Roman", serif;
  --sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --num: Georgia, "Times New Roman", serif;

  --pad-x: 26px;
  /* Fixed spacing, not env()-derived: env(safe-area-inset-*) is 0 during the
     first layout and only fills in on the first resize (probe: 0 -> 44/34 at
     63 ms). A bottom padding of sB+74 would jump 34 px and move the dock.
     88/108 already clear every iPhone safe area; on 414×896 they equal the
     old max()/calc() values exactly, so the resting appearance is unchanged. */
  --pad-top: 88px;
  --pad-bottom: 108px;

  --app-h: 100vh;
}
/* Browser tabs get the visible height; an iOS home-screen app keeps 100vh
   (the screen) through the class the head script sets from navigator.standalone. */
@supports (height: 100dvh) {
  :root { --app-h: 100dvh; }
}
html.is-standalone { --app-h: 100vh; }

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 280px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

input { font: inherit; color: inherit; }

:focus-visible {
  outline: 1px solid hsl(var(--h), var(--s), var(--l), .7);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- light on the page ------------------------------------------------- */

.backdrop {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  /* One height authority: the same --app-h as the shell. `inset: 0` follows
     the layout viewport, which is 44 px shorter than the screen on an iOS
     home-screen cold start; that leaves the tinted layer above the bottom
     band while the page background shows through. */
  height: var(--app-h);
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
}
.backdrop__glow {
  position: absolute;
  left: 50%;
  top: -18%;
  width: 160%;
  height: 62%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, hsl(var(--h), var(--s), var(--l), .14), transparent 72%);
}
.backdrop__amb {
  position: absolute;
  inset: -14%;
  background-image: var(--amb, none);
  background-position: center;
  background-size: cover;
  filter: blur(38px) saturate(1.7);
  opacity: var(--amb-o, 0);
  transform: scale(1.2);
  transition: opacity .9s ease;
}
.backdrop__grain {
  position: absolute;
  inset: 0;
  opacity: .055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ---------- shell ------------------------------------------------------------- */

.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  min-height: var(--app-h);
  margin: 0 auto;
  padding: var(--pad-top) var(--pad-x) var(--pad-bottom);
}

/* ---------- date -------------------------------------------------------------- */

.today {
  display: flex;
  align-items: baseline;
  gap: 11px;
  flex: 0 0 auto;
  margin-bottom: 26px;
}
.today__day {
  margin-left: -.045em;
  color: transparent;
  font-family: var(--num);
  font-size: 54px;
  font-weight: 400;
  line-height: .8;
  letter-spacing: -.04em;
  font-variant-numeric: lining-nums proportional-nums;
  background: linear-gradient(168deg, #FFFFFF 0%, var(--accent-hi) 30%, var(--accent) 66%, var(--accent-dim) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 28px hsl(var(--h), var(--s), var(--l), .22));
}
.today__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 2px;
}
.today__month {
  margin-right: -.28em;
  color: var(--accent);
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: .28em;
  opacity: .86;
}
.today__weekday {
  color: var(--ink-4);
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: .21em;
}

/* ---------- deck -------------------------------------------------------------- */

.deck {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  min-height: 0;
  padding: 2px 0;
}

/* main card */
.lead {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  min-height: 250px;
  padding: 24px 22px 26px;
  border: .5px solid rgba(255, 255, 255, .105);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .062), rgba(255, 255, 255, .014));
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  transition: opacity .16s ease, transform .22s ease;
}
.lead::before {
  content: "";
  position: absolute;
  top: 0;
  right: 22px;
  left: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, hsl(var(--h), var(--s), var(--l), .55), transparent);
}
.lead__kicker {
  margin-right: -.21em;
  color: var(--ink-4);
  font-size: 9px;
  letter-spacing: .21em;
}
.lead__swap {
  position: absolute;
  top: 13px;
  right: 14px;
  padding: 4px 10px;
  border: .5px solid rgba(255, 255, 255, .13);
  border-radius: 999px;
  color: var(--ink-4);
  font-size: 9px;
  letter-spacing: .085em;
  transition: color .25s ease, border-color .25s ease;
}
.lead__swap:active {
  border-color: var(--accent);
  color: var(--accent);
}
.lead__main {
  margin-top: auto;
  padding-right: 40px;
}
.lead__title {
  margin: 0 0 10px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .01em;
  overflow-wrap: anywhere;
}
.lead__meta {
  margin: 0 0 14px;
  color: var(--ink-3);
  font-size: 10.5px;
  letter-spacing: .085em;
  font-variant-numeric: lining-nums tabular-nums;
}
.lead__meter {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent-hi));
  box-shadow: 0 0 12px hsl(var(--h), var(--s), var(--l), .45);
  transition: width .5s cubic-bezier(.2, .7, .2, 1);
}
.lead__check {
  position: absolute;
  top: 50%;
  right: 20px;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  border: 1px solid rgba(242, 239, 232, .22);
  border-radius: 50%;
  transition: border-color .3s ease, box-shadow .3s ease;
}
.lead:active .lead__check {
  border-color: var(--accent);
  box-shadow: 0 0 16px hsl(var(--h), var(--s), var(--l), .6);
}
.lead.is-leaving {
  opacity: 0;
  transform: translateY(-6px) scale(.995);
}

/* empty main card */
.lead--empty {
  justify-content: center;
  cursor: default;
}
.lead--empty .lead__kicker {
  position: absolute;
  top: 24px;
  left: 22px;
  margin: 0;
}
.lead--empty .lead__main {
  margin: 0;
  padding-right: 0;
}
.lead--empty .lead__title {
  color: rgba(242, 239, 232, .46);
}
.lead--empty .lead__meta {
  margin-bottom: 0;
}

/* the rest of the batch */
.queue {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 9px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.peek {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 18px;
  border: .5px solid rgba(255, 255, 255, .055);
  border-radius: 14px;
  background: rgba(255, 255, 255, .02);
  text-align: left;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  transition: opacity .2s ease;
}
.peek:active { opacity: .75; }
.peek__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: .01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.peek__min {
  flex: 0 0 auto;
  color: var(--ink-4);
  font-size: 9px;
  letter-spacing: .085em;
  font-variant-numeric: lining-nums tabular-nums;
}
.peek__up {
  flex: 0 0 auto;
  margin-left: 2px;
  color: rgba(242, 239, 232, .22);
  font-size: 10px;
  line-height: 1;
}

/* done today */
.done {
  flex: 0 0 auto;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.done__row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: .5px solid rgba(242, 239, 232, .05);
}
.done__row:last-child { border-bottom: 0; }
.done__tick {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 9px;
  opacity: .75;
}
.done__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--ink-4);
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: .01em;
  text-decoration: line-through;
  text-decoration-color: rgba(242, 239, 232, .16);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.done__time {
  flex: 0 0 auto;
  color: var(--ink-4);
  font-size: 9px;
  letter-spacing: .085em;
  font-variant-numeric: lining-nums tabular-nums;
}

/* ---------- ledger ------------------------------------------------------------ */

.ledger {
  flex: 0 0 auto;
  min-height: 14px;
  margin: 20px 0 0;
  color: var(--ink-4);
  font-size: 10px;
  letter-spacing: .085em;
}
.ledger b {
  color: rgba(242, 239, 232, .62);
  font-family: var(--num);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: -.008em;
  font-variant-numeric: lining-nums tabular-nums;
}

/* ---------- dock -------------------------------------------------------------- */

.dock {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 22px;
}
.dock__link {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-4);
  font-size: 9px;
  letter-spacing: .21em;
  transition: color .3s ease;
}
.dock__link:first-child { margin-right: auto; }
.dock__link:active { color: var(--accent); }
.dock__link span {
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0;
}

/* ---------- sheet ------------------------------------------------------------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, .62);
  opacity: 0;
  transition: opacity .28s ease;
}
.scrim.is-on { opacity: 1; }

.sheet {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 21;
  display: flex;
  flex-direction: column;
  max-height: calc(var(--app-h) * .86);
  padding: 10px 24px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px 20px 0 0;
  outline: none;
  background: #0B0B0E;
  box-shadow: 0 -30px 80px rgba(0, 0, 0, .6);
  transform: translateY(102%);
  transition: transform .34s cubic-bezier(.2, .8, .2, 1);
}
.sheet.is-on { transform: none; }
.sheet__grip {
  flex: 0 0 auto;
  width: 36px;
  height: 4px;
  margin: 0 auto 18px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .14);
}
.sheet__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  margin-bottom: 18px;
}
.sheet__title {
  margin: 0;
  color: var(--ink-4);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .21em;
}
.sheet__close {
  color: var(--ink-4);
  font-size: 10px;
  letter-spacing: .085em;
  transition: color .3s ease;
}
.sheet__close:active { color: var(--ink); }
.sheet__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

/* ---------- forms ------------------------------------------------------------- */

.field {
  width: 100%;
  margin: 0 0 22px;
  padding: 4px 0 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  border-radius: 0;
  outline: none;
  background: none;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.4;
  -webkit-appearance: none;
  transition: border-color .25s ease;
}
.field::placeholder { color: rgba(242, 239, 232, .22); }
.field:focus { border-bottom-color: var(--accent); }
.field.is-invalid { border-bottom-color: #C8615A; }

.form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 32px;
  margin-bottom: 18px;
}
.form__label {
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: .085em;
}
.form__num {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-size: 11px;
}
.numfield {
  width: 58px;
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  border-radius: 0;
  outline: none;
  background: none;
  color: var(--ink);
  font-family: var(--num);
  font-size: 16px;
  text-align: center;
  font-variant-numeric: lining-nums tabular-nums;
  -webkit-appearance: none;
  appearance: textfield;
  transition: border-color .25s ease;
}
.numfield:focus { border-bottom-color: var(--accent); }
.numfield::-webkit-outer-spin-button,
.numfield::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.seg {
  display: flex;
  overflow: hidden;
  border: .5px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
}
.seg__btn {
  padding: 8px 13px;
  color: var(--ink-3);
  font-size: 10.5px;
  letter-spacing: .085em;
  transition: background .25s ease, color .25s ease;
}
.seg__btn.is-on {
  background: rgba(242, 239, 232, .10);
  color: var(--ink);
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 26px;
}
.actions .btn { flex: 1; }
.btn {
  padding: 14px 0;
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: .085em;
  transition: opacity .25s ease, background .25s ease, color .25s ease, border-color .25s ease;
}
.btn:active { opacity: .8; }
.btn--ghost {
  border: 1px solid rgba(255, 255, 255, .12);
  color: var(--ink-3);
}
.btn--primary {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  color: #0A0A0C;
  font-weight: 600;
}
.btn--wide {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 13px 0;
  border: 1px solid rgba(255, 255, 255, .12);
  color: var(--ink-3);
}
.btn--quiet {
  margin-top: 10px;
  border-color: rgba(255, 255, 255, .07);
  color: var(--ink-4);
}

/* ---------- library ----------------------------------------------------------- */

.liblist {
  margin: 0;
  padding: 0;
  list-style: none;
}
.librow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 14px 0;
  border-bottom: .5px solid rgba(242, 239, 232, .07);
  text-align: left;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  transition: opacity .25s ease;
}
.librow:active { opacity: .6; }
.librow__title {
  min-width: 0;
  color: rgba(242, 239, 232, .86);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: .01em;
  overflow-wrap: anywhere;
}
.librow__meta {
  flex: 0 0 auto;
  color: var(--ink-4);
  font-size: 9px;
  letter-spacing: .085em;
  font-variant-numeric: lining-nums tabular-nums;
}
.librow.is-done .librow__title {
  color: var(--ink-4);
  text-decoration: line-through;
  text-decoration-color: rgba(242, 239, 232, .16);
}
.librow.is-current .librow__meta {
  color: var(--accent);
  opacity: .8;
}

/* ---------- log --------------------------------------------------------------- */

.logday { margin-bottom: 26px; }
.logday__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 6px;
  padding-bottom: 9px;
  border-bottom: .5px solid rgba(242, 239, 232, .08);
  color: var(--ink-4);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .21em;
}
.logday__title span { letter-spacing: .085em; }
.loglist {
  margin: 0;
  padding: 0;
  list-style: none;
}
.logrow {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 8px 0;
}
.logrow__time {
  flex: 0 0 auto;
  width: 60px;
  white-space: nowrap;
  color: var(--ink-4);
  font-size: 9px;
  letter-spacing: .085em;
  font-variant-numeric: lining-nums tabular-nums;
}
.logrow__title {
  min-width: 0;
  color: rgba(242, 239, 232, .78);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: .01em;
  overflow-wrap: anywhere;
}

/* ---------- background -------------------------------------------------------- */

.swatches {
  display: flex;
  gap: 16px;
  margin: 6px 0 26px;
}
.swatch {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  transition: transform .25s ease;
}
.swatch:active { transform: scale(1.06); }
.swatch.is-on::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 50%;
}

/* ---------- misc -------------------------------------------------------------- */

.hint {
  margin: 14px 0 0;
  color: rgba(242, 239, 232, .24);
  font-size: 9px;
  line-height: 1.9;
  letter-spacing: .085em;
}
.empty {
  margin: 0;
  padding: 26px 0;
  color: var(--ink-4);
  font-size: 11px;
  line-height: 1.9;
  letter-spacing: .085em;
}
.noscript {
  position: fixed;
  right: 24px;
  bottom: 24px;
  left: 24px;
  z-index: 40;
  color: var(--ink-2);
  font-size: 12px;
  text-align: center;
}

.toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
  left: 50%;
  z-index: 30;
  padding: 9px 16px;
  border: .5px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: rgba(20, 20, 23, .94);
  color: var(--ink-2);
  font-size: 10.5px;
  letter-spacing: .085em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .22s ease, transform .22s ease;
}
.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}
/* While a sheet covers the lower screen, speak from the top instead. */
.toast.is-sheet {
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  bottom: auto;
  transform: translate(-50%, -8px);
}
.toast.is-sheet.is-on {
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { transition-duration: .001s !important; }
}

/* Short phones (an iPhone SE is 667px tall): keep the whole page — ledger and
   dock included — inside one screen. The card is the only thing that gives. */
@media (max-height: 720px) {
  :root {
    --pad-top: max(64px, calc(env(safe-area-inset-top, 0px) + 30px));
    --pad-bottom: calc(env(safe-area-inset-bottom, 0px) + 34px);
  }
  .today { margin-bottom: 16px; }
  .lead { min-height: 218px; padding: 20px 20px 22px; }
  .lead__title { font-size: 26px; }
  .queue { gap: 8px; margin-top: 10px; }
  .peek { padding: 12px 16px; }
  .done { margin-top: 12px; }
  .done__row { padding: 7px 2px; }
  .ledger { margin-top: 12px; }
  .dock { padding-top: 14px; }
}

/* ---------- search · 7-day record · reminder · sleep card ---------- */

.searchbar { margin: 0 0 14px; }
.searchfield {
  width: 100%;
  padding: 4px 0 10px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  border-radius: 0;
  outline: none;
  background: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;              /* iOS does not zoom a 16px input */
  -webkit-appearance: none;
  transition: border-color .25s ease;
}
.searchfield::placeholder { color: rgba(242, 239, 232, .22); }
.searchfield:focus { border-bottom-color: var(--accent); }

/* library meta is allowed to be long (duration · days · state); the title gives way */
.librow__meta { white-space: nowrap; }

/* seven folded days */
.logstats {
  margin: 0 0 16px;
  color: var(--ink-3);
  font-size: 10px;
  letter-spacing: .085em;
}
.logstats b {
  color: rgba(242, 239, 232, .62);
  font-family: var(--num);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: -.008em;
  font-variant-numeric: lining-nums tabular-nums;
}
.logday {
  margin: 0;
  border-bottom: .5px solid rgba(242, 239, 232, .07);
}
.logday:last-child { border-bottom: 0; }
.logday__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 13px 0;
  border: 0;
  color: var(--ink-4);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .21em;
  cursor: pointer;
  list-style: none;
}
.logday__title::-webkit-details-marker { display: none; }
.logday__title::before {
  content: "＋";
  flex: 0 0 auto;
  margin-right: 2px;
  font-size: 9px;
  letter-spacing: 0;
  color: var(--ink-4);
}
.logday[open] .logday__title::before { content: "－"; }
.logday[open] .logday__title { color: var(--ink-3); }
.logday__label { flex: 1; min-width: 0; }
.logday__count { flex: 0 0 auto; letter-spacing: .085em; }
.logday > .loglist { padding: 0 0 12px; }
.logday > .logday__empty {
  padding: 0 0 14px;
  font-size: 10px;
}

/* reminder section inside 背景 */
.remind {
  margin-top: 24px;
  padding-top: 18px;
  border-top: .5px solid rgba(255, 255, 255, .08);
}
.remind__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.remind__title {
  color: var(--ink-4);
  font-size: 10px;
  letter-spacing: .21em;
}
.remind__status {
  color: var(--ink-4);
  font-size: 9px;
  letter-spacing: .085em;
  text-align: right;
}
.remind .btn { margin-top: 12px; }

/* sleep / wake card */
.peek--sleep { border-color: rgba(255, 255, 255, .08); }
.peek--sleep .peek__title { color: var(--ink-3); }
.peek.is-dim,
.lead.is-dim { opacity: .45; }

/* library row + edit affordance (SPEC "增删改") */
.librow-row {
  display: flex;
  align-items: stretch;
  border-bottom: .5px solid rgba(242, 239, 232, .07);
}
.librow-row .librow {
  flex: 1;
  min-width: 0;
  border-bottom: 0;
}
.librow-edit {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 0 0 12px;
  color: var(--ink-4);
  font-size: 9px;
  letter-spacing: .085em;
  -webkit-user-select: none;
  user-select: none;
}
.librow-edit:active { opacity: .6; }

/* ---------- 补记 (after-the-fact entry) -------------------------------------- */

.retro-open { margin-bottom: 2px; }
.retroform { margin: 2px 0 22px; }
.retroform__row { justify-content: flex-start; gap: 12px; }
.retroform__where { margin: -4px 0 0; }
.timefield {
  width: 92px;
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  border-radius: 0;
  outline: none;
  background: none;
  color: var(--ink);
  font-family: var(--num);
  font-size: 16px;
  text-align: center;
  font-variant-numeric: lining-nums tabular-nums;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .25s ease;
}
.timefield:focus { border-bottom-color: var(--accent); }
.timefield::-webkit-date-and-time-value { text-align: center; }

/* A range is the whole identity of a 补记: quieter, and removable in place. */
.logrow--retro .logrow__time { color: rgba(242, 239, 232, .30); }
.logrow--retro .logrow__title { color: rgba(242, 239, 232, .62); }
.logrow__del {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0 2px 0 14px;
  color: rgba(242, 239, 232, .26);
  font-size: 12px;
  line-height: 1;
}
.logrow__del:active { opacity: .6; }
