/* Memento Mori: warm paper, Polaroids with handwritten captions, typed notes to self.
   Light = paper and faded instant film; dark = the black-and-white sequences. */

@font-face { font-family: 'Fraunces'; src: url('/fonts/Fraunces.woff2') format('woff2'); font-weight: 300 900; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('/fonts/DMSans.woff2') format('woff2'); font-weight: 300 800; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('/fonts/Caveat-500.woff2') format('woff2'); font-weight: 400 600; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('/fonts/Caveat-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Courier Prime'; src: url('/fonts/CourierPrime-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Courier Prime'; src: url('/fonts/CourierPrime-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light dark;
  --paper: #f3eee6;
  --paper-2: #e9e2d6;
  --card: #fbf9f4;
  --ink: #2b2825;
  --ink-2: #5f574f;
  --ink-3: #93897d;
  --line: #e2d9cb;
  --accent: #5b8a8e;
  --accent-ink: #ffffff;
  --accent-soft: #dfe9e7;
  --shutter: #d9866a;
  --shutter-2: #c46f55;
  --danger: #b8604f;
  --shadow: 0 1px 2px rgba(70, 50, 30, 0.07), 0 6px 18px rgba(70, 50, 30, 0.08);
  --shadow-lift: 0 2px 4px rgba(70, 50, 30, 0.08), 0 14px 30px rgba(70, 50, 30, 0.12);
  --sage: #a8bea6;
  --rose: #ddb2aa;
  --sky: #a9c1cf;
  --sand: #dcc69c;
  --lilac: #c0b3d1;
  --clay: #d0a588;
  --moss: #b9c092;
  --slate: #aeb5bc;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hand: 'Caveat', 'Comic Sans MS', cursive;
  --typed: 'Courier Prime', 'Courier New', monospace;
  --tabs-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161514;
    --paper-2: #201e1c;
    --card: #252321;
    --ink: #ece6dc;
    --ink-2: #b9b0a5;
    --ink-3: #857c72;
    --line: #35322e;
    --accent: #8db5b7;
    --accent-ink: #12201f;
    --accent-soft: #24302f;
    --shutter: #d48e74;
    --shutter-2: #b9745c;
    --danger: #d98a7a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 22px rgba(0, 0, 0, 0.3);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.4), 0 16px 34px rgba(0, 0, 0, 0.4);
    --sage: #7f9a7d;
    --rose: #b48a83;
    --sky: #7f9bab;
    --sand: #b39e74;
    --lilac: #988aab;
    --clay: #ab8166;
    --moss: #939a6d;
    --slate: #87909a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
/* a whisper of paper grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45  0 0 0 0 .38  0 0 0 0 .3  0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
img, video { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.center { text-align: center; }
.pad { padding: 24px 0; }
.err { color: var(--danger); font-size: 14px; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; gap: 10px; }
.row.end { justify-content: flex-end; }

.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- frame ---------- */

.app { position: relative; z-index: 1; }
#view {
  max-width: 640px;
  margin: 0 auto;
  padding: 10px 16px calc(var(--tabs-h) + var(--safe-b) + 28px);
}
.tabs {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tabs-h) + var(--safe-b));
  padding: 6px 8px var(--safe-b);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabs a {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 12px;
}
.tabs a.on { color: var(--ink); }
.tabs a.on .i { stroke: var(--accent); }
.tabs .rail-brand { display: none; }
body.signed-out .tabs { display: none; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  margin-bottom: 6px;
}
.brand { display: grid; }
.wordmark { font-family: var(--serif); font-style: italic; font-size: 25px; font-weight: 450; letter-spacing: -0.02em; line-height: 1.1; }
.today { font-size: 13px; color: var(--ink-3); }
.title { font-size: 28px; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--ink-2);
  text-decoration: none;
}
.icon-btn:active { background: var(--paper-2); }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.starred .i { fill: var(--sand); stroke: var(--clay); }

/* ---------- buttons, inputs, chips ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.12s;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.primary.danger { background: var(--danger); color: #fff; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn.dashed { border-style: dashed; background: transparent; color: var(--ink-2); margin: 6px 0 18px; }
.btn .i { width: 18px; height: 18px; }
.btn:disabled { opacity: 0.45; }
.link { background: none; border: none; padding: 0; color: var(--accent); font-weight: 500; font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.link .i { width: 16px; height: 16px; }

.input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.small { padding: 6px 10px; font-size: 14px; border-radius: 999px; width: 110px; }
.input.time { width: auto; padding: 6px 10px; border-radius: 10px; }
.input.hand { font-family: var(--hand); font-size: 26px; }
.input.typed { font-family: var(--typed); font-size: 20px; font-weight: 700; }
textarea.input { resize: vertical; line-height: 1.45; }
.field { display: block; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 14px;
  white-space: nowrap;
}
.chip small { color: var(--ink-3); font-size: 12px; }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.on small { color: color-mix(in srgb, var(--paper) 65%, transparent); }
.chip .i { width: 15px; height: 15px; }
.chip.add { padding: 0 9px; }
.tagchip { gap: 2px; padding-right: 4px; }
.tagchip a { text-decoration: none; }
.tagchip button { border: none; background: none; display: grid; place-items: center; padding: 2px; color: var(--ink-3); }
.addtag { display: inline-flex; }

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--sand)); flex: none; }
.c-sage { --c: var(--sage); } .c-rose { --c: var(--rose); } .c-sky { --c: var(--sky); } .c-sand { --c: var(--sand); }
.c-lilac { --c: var(--lilac); } .c-clay { --c: var(--clay); } .c-moss { --c: var(--moss); } .c-slate { --c: var(--slate); }

.select select {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5 6 6l5-4.5' fill='none' stroke='%2393897d' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 32px 7px 13px;
  font: inherit;
  font-size: 14px;
}

.seg { display: flex; background: var(--paper-2); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: none; background: none; border-radius: 999px; padding: 8px 10px; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.seg.small { display: inline-flex; }
.seg.small button { padding: 4px 10px; }

.switch { position: relative; display: inline-block; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background 0.2s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.stepper button { border: none; background: none; width: 34px; height: 34px; font-size: 18px; }
.stepper b { min-width: 22px; text-align: center; }
.days { display: flex; gap: 6px; }
.day { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 13px; font-weight: 600; }
.day.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* ---------- capture ---------- */

.watchbox { margin: 4px 0 6px; }
.watch-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 8px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  text-align: left;
  min-height: 56px;
}
.watch-chip img { width: 32px; height: 46px; object-fit: cover; border-radius: 4px; }
.watch-chip > .i { color: var(--ink-3); margin-left: 4px; }
.watch-chip.empty { color: var(--ink-3); border-style: dashed; background: transparent; font-size: 14.5px; }
.watch-chip.empty b { color: var(--accent); font-weight: 500; }
.wc-text { display: grid; flex: 1; min-width: 0; }
.wc-text b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-text small { color: var(--ink-3); font-size: 13px; }

.shutter-wrap { display: grid; justify-items: center; padding: 34px 0 18px; }
.shutter {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: none;
  display: grid;
  place-items: center;
  color: #fff;
  background: radial-gradient(circle at 34% 28%, color-mix(in srgb, var(--shutter) 70%, #fff), var(--shutter) 55%, var(--shutter-2));
  box-shadow: 0 0 0 10px var(--card), 0 0 0 11px var(--line), 0 18px 34px color-mix(in srgb, var(--shutter) 35%, transparent);
  transition: transform 0.15s;
}
.shutter:active { transform: scale(0.95); }
.shutter .i { width: 54px; height: 54px; stroke-width: 1.5; }
.shutter-hint { margin: 22px 0 0; font-family: var(--hand); font-size: 24px; color: var(--ink-2); }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 12px; }
.qbtn {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 16px 6px 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  font-weight: 500;
  font-size: 14.5px;
  box-shadow: var(--shadow);
  transition: transform 0.12s;
}
.qbtn:active { transform: scale(0.96); }
.qbtn .i { width: 26px; height: 26px; color: var(--accent); }
.bringin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px;
  border: 1px dashed color-mix(in srgb, var(--ink-3) 60%, transparent);
  border-radius: 16px;
  background: transparent;
  color: var(--ink-2);
  font-size: 15px;
}
.after { display: grid; gap: 8px; padding: 12px 14px; margin: 0 0 12px; border-radius: 16px; background: var(--accent-soft); animation: rise 0.25s ease-out; }
.after[hidden] { display: none; }

.recent { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 24px 0 12px; }
.section-head h2 { font-size: 20px; }
.strip { display: flex; gap: 14px; overflow-x: auto; margin: 0 -16px; padding: 6px 16px 16px; scroll-snap-type: x proximity; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip > * { scroll-snap-align: start; }
.empty-state { color: var(--ink-3); text-align: center; padding: 30px 12px; font-family: var(--hand); font-size: 23px; line-height: 1.25; grid-column: 1 / -1; }

/* recorder */
dialog.sheet.full { max-width: none; width: 100%; height: 100dvh; max-height: none; border-radius: 0; margin: 0; padding: 0; background: var(--paper); }
.rec { display: grid; justify-items: center; align-content: center; gap: 18px; min-height: 100dvh; padding: 24px 20px calc(24px + var(--safe-b)); text-align: center; }
.rec-top { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 500; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--shutter); animation: pulse 1.4s ease-in-out infinite; }
.rec-time { font-family: var(--serif); font-size: 64px; font-weight: 400; font-variant-numeric: tabular-nums; line-height: 1; }
.rec-wave { width: min(100%, 420px); height: 84px; }
.rec-watch { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14px; }
.rec-watch .i { width: 16px; height: 16px; }
.rec-file { display: grid; gap: 8px; justify-items: center; max-width: 520px; }
.rec-file .chips { justify-content: center; }
.rec-stop {
  width: 96px;
  height: 96px;
  margin-top: 8px;
  border-radius: 50%;
  border: none;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--shutter);
  box-shadow: 0 0 0 8px var(--card), 0 0 0 9px var(--line), 0 14px 28px color-mix(in srgb, var(--shutter) 35%, transparent);
}
.rec-stop .i { width: 34px; height: 34px; }

/* ---------- polaroids ---------- */

.polaroid {
  position: relative;
  display: block;
  min-width: 0;
  background: var(--card);
  padding: 7px 7px 9px;
  border-radius: 3px;
  box-shadow: var(--shadow);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.25s ease, box-shadow 0.25s;
  color: inherit;
  text-decoration: none;
}
a.polaroid:hover, a.polaroid:focus-visible { transform: rotate(0deg) translateY(-2px); box-shadow: var(--shadow-lift); outline: none; }
.polaroid.pending { opacity: 0.88; }
.polaroid.picked { outline: 3px solid var(--accent); outline-offset: 2px; }
.pframe { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--paper-2); border-radius: 1px; }
.pic { width: 100%; height: 100%; }
.pic img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9) sepia(0.05) contrast(0.98); }
@media (prefers-color-scheme: dark) { .pic img { filter: saturate(0.75) contrast(1.02) brightness(0.95); } }
.pic.blank { display: grid; place-items: center; color: var(--ink-3); }
.pic.blank .i { width: 34px; height: 34px; }
.notepic {
  padding: 12px 12px 0;
  background:
    repeating-linear-gradient(transparent 0 21px, color-mix(in srgb, var(--accent) 16%, transparent) 21px 22px) 0 12px / 100% 100%,
    var(--card);
  -webkit-mask-image: linear-gradient(#000 70%, transparent);
  mask-image: linear-gradient(#000 70%, transparent);
}
.notepic p { margin: 0; font-size: 14px; line-height: 22px; color: var(--ink-2); overflow-wrap: anywhere; }
.pbadge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px 2px 5px;
  border-radius: 999px;
  background: rgba(24, 22, 20, 0.55);
  color: #fff;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.pbadge .i { width: 13px; height: 13px; }
.pstar { position: absolute; right: 6px; top: 6px; color: #fff; }
.pstar .i { width: 18px; height: 18px; fill: var(--sand); stroke: rgba(0, 0, 0, 0.25); }
.pcap {
  display: block;
  font-family: var(--hand);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.05;
  padding: 7px 2px 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}
.pmeta { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 11.5px; color: var(--ink-3); padding: 0 2px; white-space: nowrap; overflow: hidden; }
.pwatch { display: inline-flex; align-items: center; gap: 3px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pwatch .i { width: 12px; height: 12px; }
.psnip { margin: 6px 2px 0; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.psnip mark { background: color-mix(in srgb, var(--sand) 55%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.pstat { display: block; margin: 5px 2px 0; font-size: 11.5px; color: var(--accent); }
.pstat.bad { color: var(--danger); }
.polaroid.small { width: 132px; flex: none; padding: 6px 6px 8px; }
.polaroid.small .pcap { font-size: 19px; }
.polaroid.big { padding: 10px 10px 14px; }
.polaroid.big .pcap { font-size: 30px; padding-top: 10px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; margin-top: 14px; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.grid.small .polaroid.small { width: auto; }
.more { min-height: 40px; display: grid; place-items: center; }

/* ---------- memories list ---------- */

.search { position: relative; margin-bottom: 10px; }
.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 19px; height: 19px; }
.search .input { padding-left: 42px; border-radius: 999px; }
.themes-row { margin-bottom: 8px; }
.filters { margin: 4px 0 2px; }
.offline-note { font-size: 13px; color: var(--ink-2); background: var(--paper-2); border-radius: 10px; padding: 8px 12px; margin-top: 10px; }

/* ---------- one memory ---------- */

.memory { display: grid; gap: 4px; }
.memory .polaroid.big { margin: 4px auto 0; width: min(100%, 460px); }
.big-frame { aspect-ratio: auto; min-height: 120px; display: grid; gap: 8px; background: var(--paper-2); }
.big-media { width: 100%; max-height: 70vh; object-fit: contain; background: #111; }
.big-media.wave { background: none; aspect-ratio: 1; object-fit: cover; max-height: none; }
.big-frame audio { width: 100%; padding: 0 6px 6px; }
.big-note { padding: 18px 16px; font-size: 18px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--card); }
.edit-cap { width: 100%; text-align: left; background: none; border: none; cursor: text; }
.when { text-align: center; color: var(--ink-3); font-size: 13.5px; margin: 14px 0 6px; }
.block { padding: 14px 0; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.block:first-of-type { border-top: none; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.block-head h3 { font-size: 17px; }
.transcript { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; }
.watched { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); text-align: left; }
.watched img { width: 36px; height: 52px; object-fit: cover; border-radius: 4px; }
.watched span { display: grid; }
.watched small { color: var(--ink-3); }
.linked { display: grid; gap: 4px; justify-items: start; width: 132px; flex: none; }
.link-note { margin: 0; font-family: var(--hand); font-size: 18px; line-height: 1.1; color: var(--ink-2); }
.menu { gap: 2px; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 6px; border: none; background: none; text-align: left; font-size: 16px; text-decoration: none; border-radius: 10px; }
.menu-item:active { background: var(--paper-2); }
.menu-item.danger { color: var(--danger); }

/* ---------- remember ---------- */

.shuffle { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 18px; padding: 8px 0 6px; }
.random-slot { width: min(86%, 340px); min-width: 0; transition: opacity 0.2s, transform 0.25s; }
.random-slot.swap { opacity: 0; transform: translateY(6px) rotate(-1deg); }
.random-slot .polaroid { --tilt: -1.6deg !important; }

/* ---------- notes to self ---------- */

.lede { margin: -4px 0 16px; color: var(--ink-2); }
.notes { display: grid; gap: 14px; margin-bottom: 4px; }
.tagnote {
  position: relative;
  padding: 16px 18px 16px 34px;
  border-radius: 6px 14px 14px 6px;
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.tagnote::before { content: ''; position: absolute; left: 12px; top: 20px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18); }
.tagnote.resting { opacity: 0.6; }
.tag-label { font-family: var(--typed); font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.tag-text { margin: 6px 0 2px; font-family: var(--typed); font-weight: 700; font-size: 21px; line-height: 1.25; }
.tag-detail { margin: 0 0 6px; color: var(--ink-2); font-size: 15px; }
.tag-when { margin: 8px 0 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 13px; color: var(--ink-3); }
.tag-thanks { font-family: var(--hand); font-size: 24px; color: var(--ink-2); text-align: center; margin: 18px 0; }
[data-nudge] .tagnote { margin-top: 22px; cursor: default; }
[data-nudge] .tagnote .row { margin-top: 10px; }
.card.soft { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--accent-soft); margin-bottom: 16px; }
.card.soft > .i { color: var(--accent); }
.card.soft div { flex: 1; }
.card.soft p { margin: 2px 0 0; }
.sched { display: grid; gap: 12px; padding: 4px 0; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.log li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.log small { color: var(--ink-3); text-align: right; }

/* ---------- settings ---------- */

.theme-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.theme-list li { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.theme-name { flex: 1; display: flex; justify-content: space-between; align-items: center; border: none; background: none; text-align: left; padding: 10px 0; font-size: 16px; }
.theme-name small { color: var(--ink-3); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--card); background: var(--c); box-shadow: 0 0 0 1px var(--line); }
.swatch.on { box-shadow: 0 0 0 2px var(--ink); }
.meter { height: 8px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.meter span { display: block; height: 100%; min-width: 4px; background: var(--accent); border-radius: inherit; }
.binned { display: grid; gap: 6px; justify-items: start; }

/* ---------- sheets and toasts ---------- */

dialog.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  margin: auto auto 0;
  padding: 0;
  border: none;
  border-radius: 22px 22px 0 0;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
  animation: up 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
  overflow: auto;
}
dialog.sheet.tall { min-height: 60dvh; }
dialog.sheet.out { animation: down 0.18s ease-in forwards; }
dialog.sheet::backdrop { background: rgba(30, 24, 18, 0.32); }
.sheet-body { display: grid; gap: 14px; padding: 22px 18px calc(22px + var(--safe-b)); }
.sheet-body::before { content: ''; justify-self: center; width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: -10px 0 4px; }
.sheet-title { font-size: 22px; }
.write .note-input { font-size: 18px; min-height: 150px; }
.results { display: grid; gap: 4px; max-height: 300px; overflow: auto; }
.results-label { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.result { display: flex; align-items: center; gap: 12px; padding: 6px; border: 1px solid transparent; border-radius: 12px; background: none; text-align: left; }
.result.on { border-color: var(--accent); background: var(--accent-soft); }
.result img, .noposter { width: 34px; height: 50px; object-fit: cover; border-radius: 4px; background: var(--paper-2); display: grid; place-items: center; flex: none; }
.result small { color: var(--ink-3); }
.into { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink-2); }
.input.mins { width: 72px; text-align: center; padding: 8px; }
.into .icon-btn { border: 1px solid var(--line); width: 36px; height: 36px; font-size: 18px; }

#toasts { position: fixed; z-index: 50; left: 0; right: 0; bottom: calc(var(--tabs-h) + var(--safe-b) + 12px); display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 520px;
  padding: 11px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  animation: rise 0.2s ease-out;
}
.toast.out { opacity: 0; transform: translateY(6px); transition: 0.2s; }
.toast-act { border: none; background: none; color: var(--accent-soft); font-weight: 600; padding: 0; }

/* ---------- sign in ---------- */

.login { display: grid; gap: 14px; max-width: 340px; margin: 9vh auto 0; }
.login-card { width: 220px; justify-self: center; margin-bottom: 8px; }
.login-pic { display: grid; place-items: center; background: linear-gradient(160deg, var(--accent-soft), var(--paper-2)); }
.hourglass .i { width: 64px; height: 64px; stroke-width: 1.2; color: var(--accent); }
.login .pcap { text-align: center; font-size: 30px; }

@keyframes up { from { transform: translateY(100%); } }
@keyframes down { to { transform: translateY(100%); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes pulse { 50% { opacity: 0.35; transform: scale(0.8); } }

/* ---------- bigger screens ---------- */

@media (min-width: 620px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 20px; }
}

@media (min-width: 960px) {
  :root { --tabs-h: 0px; }
  .tabs {
    top: 0;
    right: auto;
    width: 220px;
    height: auto;
    padding: 26px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: none;
    border-right: 1px solid var(--line);
  }
  .tabs .rail-brand { display: block; font-family: var(--serif); font-style: italic; font-size: 24px; padding: 0 12px 22px; text-decoration: none; }
  .tabs a:not(.rail-brand) { display: flex; gap: 12px; font-size: 15px; padding: 10px 12px; justify-content: flex-start; }
  .tabs a.on:not(.rail-brand) { background: var(--card); box-shadow: var(--shadow); }
  #view { margin-left: 220px; max-width: none; padding: 18px 40px 48px; }
  #view > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
  #view[data-view='capture'] > *, #view[data-view='notes'] > *, #view[data-view='settings'] > *, #view[data-view='m'] > * { max-width: 620px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .chips.scroll { margin: 0; padding: 2px 0 4px; flex-wrap: wrap; }
  .strip { margin: 0; padding: 6px 2px 16px; }
  #toasts { bottom: 24px; }
  dialog.sheet { margin: auto; border-radius: 22px; }
  dialog.sheet.full { border-radius: 0; }
  .wordmark { display: none; }
  .top .brand .today { font-size: 15px; }
  body.signed-out #view { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
