/* Ditto. Warm, calm, easy to read at arm's length in a shop. */

:root {
  --bg: #fbf7f2;
  --bar: rgba(251, 247, 242, 0.86);
  --surface: #ffffff;
  --surface-2: #f4ede5;
  --line: #ece3d9;
  --ink: #2a211d;
  --ink-2: #6f635c;
  --ink-3: #a0948d;
  --accent: #e04a2f;
  --accent-ink: #c2412a;
  --accent-soft: #fce6de;
  --on-accent: #ffffff;
  --new: #fff3d1;
  --new-dot: #f0a92e;
  --danger: #c8372d;
  --check: #c9bdb5;
  --toast-bg: #2a211d;
  --toast-ink: #fbf7f2;
  --toast-action: #ffb39f;
  --scrim: rgba(30, 18, 12, 0.38);
  --shadow: 0 1px 2px rgba(60, 40, 30, 0.05), 0 6px 18px rgba(60, 40, 30, 0.06);
  --shadow-lift: 0 14px 34px rgba(60, 40, 30, 0.2);
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --kb: 0px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171311;
    --bar: rgba(23, 19, 17, 0.86);
    --surface: #221c19;
    --surface-2: #2d2622;
    --line: #382f2a;
    --ink: #f5eee8;
    --ink-2: #b7aba4;
    --ink-3: #7f736c;
    --accent: #e04a2f;
    --accent-ink: #ff8f74;
    --accent-soft: #3b231c;
    --new: #3a2f1a;
    --new-dot: #f0a92e;
    --danger: #ff7a6b;
    --check: #5b504a;
    --toast-bg: #f5eee8;
    --toast-ink: #171311;
    --toast-action: #c2412a;
    --scrim: rgba(0, 0, 0, 0.55);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lift: 0 14px 34px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #171311;
  --bar: rgba(23, 19, 17, 0.86);
  --surface: #221c19;
  --surface-2: #2d2622;
  --line: #382f2a;
  --ink: #f5eee8;
  --ink-2: #b7aba4;
  --ink-3: #7f736c;
  --accent: #e04a2f;
  --accent-ink: #ff8f74;
  --accent-soft: #3b231c;
  --new: #3a2f1a;
  --new-dot: #f0a92e;
  --danger: #ff7a6b;
  --check: #5b504a;
  --toast-bg: #f5eee8;
  --toast-ink: #171311;
  --toast-action: #c2412a;
  --scrim: rgba(0, 0, 0, 0.55);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lift: 0 14px 34px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg { display: block; }
[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; line-height: 1.2; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 10px; }

/* ------------------------------------------------------------------ */
/* Screens and bars                                                    */
/* ------------------------------------------------------------------ */

.screen {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 calc(16px + var(--safe-r)) calc(28px + var(--safe-b)) calc(16px + var(--safe-l));
  min-height: 100dvh;
}

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: calc(60px + var(--safe-t));
  padding-top: var(--safe-t);
  margin: 0 -16px;
  padding-left: 12px;
  padding-right: 12px;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}

.brand { display: flex; align-items: center; gap: 10px; flex: 1; padding-left: 4px; }
.brand-logo { width: 34px; height: 34px; }

.wordmark {
  font-family: var(--font);
  font-weight: 800;
  font-size: 27px;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.wordmark-big { font-size: 52px; letter-spacing: -0.04em; }

.icon-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  color: var(--ink);
  flex: none;
}
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:active { background: var(--surface-2); }

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 17px;
  display: grid; place-items: center;
  flex: none;
}
.avatar.big { width: 52px; height: 52px; font-size: 22px; }

.net {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 700;
  color: var(--ink-2);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 5px 10px 5px 8px;
  white-space: nowrap;
  flex: none;
}
.net svg { width: 16px; height: 16px; }
.net-line {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 8px 0 0;
  font-size: 14px; font-weight: 650;
  color: var(--ink-2);
}
.net-line svg { width: 17px; height: 17px; flex: none; }

/* ------------------------------------------------------------------ */
/* Buttons and fields                                                  */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 700;
  transition: transform 0.12s ease, filter 0.12s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 22px; height: 22px; }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn.secondary { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.quiet { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--danger) 45%, transparent); }
.btn.danger.armed { background: var(--danger); color: #fff; }
.btn.quiet.armed { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn.block { width: 100%; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

.link {
  color: var(--accent-ink);
  font-weight: 650;
  padding: 10px 4px;
  font-size: 16px;
}

.field { display: block; margin: 0 0 16px; }
.field > span, .label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  margin: 0 0 7px 2px;
}
.input, .field input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  font-size: 17px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  background: var(--surface-2);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.input:focus, .field input:focus { border-color: var(--accent); background: var(--surface); }

.seg {
  display: flex;
  background: var(--surface-2);
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
}
.seg button {
  flex: 1;
  min-height: 42px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-2);
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.err { color: var(--danger); font-size: 15px; font-weight: 600; margin: 10px 2px 0; min-height: 1px; }
.muted { color: var(--ink-2); }
.fine { color: var(--ink-3); font-size: 14px; }

/* ------------------------------------------------------------------ */
/* Welcome                                                             */
/* ------------------------------------------------------------------ */

.welcome {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: calc(32px + var(--safe-t)) 8px calc(24px + var(--safe-b));
  max-width: 420px;
  margin: 0 auto;
}
.welcome-logo { width: 88px; height: 88px; margin-bottom: 14px; filter: drop-shadow(0 12px 24px color-mix(in srgb, var(--accent) 35%, transparent)); }
.tagline { font-size: 20px; color: var(--ink-2); margin: 4px 0 26px; font-weight: 600; }
.steps { list-style: none; padding: 0; margin: 0 0 30px; text-align: left; display: grid; gap: 12px; }
.steps li { display: flex; align-items: center; gap: 12px; font-size: 17px; }
.steps span {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; font-size: 15px;
}
.welcome-form { width: 100%; display: grid; gap: 12px; text-align: left; }
.welcome-form label { font-weight: 700; font-size: 17px; margin-left: 2px; }
#welcome-name {
  width: 100%; min-height: 56px; padding: 0 18px; font-size: 19px;
  border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); outline: none;
}
#welcome-name:focus { border-color: var(--accent); }
.welcome .link { margin-top: 14px; }
.welcome .fine { margin-top: 18px; }

/* ------------------------------------------------------------------ */
/* Home                                                                */
/* ------------------------------------------------------------------ */

.home-main { padding-bottom: calc(110px + var(--safe-b)); }

.greeting { margin: 6px 4px 16px; color: var(--ink-2); font-size: 17px; font-weight: 600; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.card {
  --tint: #e04a2f;
  position: relative;
  display: flex; align-items: center; gap: 14px;
  min-height: 80px;
  padding: 14px 6px 14px 14px;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow);
  cursor: pointer;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:active { transform: scale(0.985); }
.tile {
  width: 52px; height: 52px; flex: none;
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 28px;
  background: color-mix(in srgb, var(--tint) 17%, var(--surface));
}
.card-text { flex: 1; min-width: 0; }
.card-name { display: block; font-size: 19px; font-weight: 750; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { display: block; font-size: 15px; color: var(--ink-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub .new-count { color: var(--accent-ink); font-weight: 750; }

.grip {
  width: 40px; height: 48px; flex: none;
  display: grid; place-items: center;
  color: var(--ink-3);
  touch-action: none;
  cursor: grab;
  border-radius: 12px;
}
.grip svg { width: 22px; height: 22px; }

.version-line { text-align: center; color: var(--ink-3); font-size: 13px; margin: 28px 0 0; }

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; gap: 10px;
  max-width: 640px; margin: 0 auto;
  padding: 18px calc(16px + var(--safe-r)) calc(14px + var(--safe-b)) calc(16px + var(--safe-l));
  background: linear-gradient(to bottom, transparent, var(--bg) 38%);
}
.dock .btn { flex: 1; }
.dock .btn.primary { flex: 1.2; }

.empty { text-align: center; padding: 36px 18px 10px; color: var(--ink-2); }
.empty h2 { color: var(--ink); font-size: 22px; margin: 14px 0 8px; }
.empty p { margin: 0 auto; max-width: 340px; }
.empty-logo { width: 64px; height: 64px; margin: 0 auto; opacity: 0.95; }
.empty.small { padding-top: 40px; }
.empty .big-emoji { font-size: 44px; line-height: 1; }

/* ------------------------------------------------------------------ */
/* A list                                                              */
/* ------------------------------------------------------------------ */

.list-top {
  position: sticky; top: 0; z-index: 20;
  margin: 0 -16px;
  padding: 0 16px 10px;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}
.list-top .bar { position: static; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

.list-title {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  text-align: left;
  padding: 6px 4px;
  border-radius: 12px;
}
.list-title .tile { width: 36px; height: 36px; border-radius: 11px; font-size: 20px; }
.list-title b { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-title svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }

.done-pill {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 40px;
  padding: 0 12px 0 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-weight: 750; font-size: 15px;
  flex: none;
}
.done-pill svg { width: 20px; height: 20px; }
.done-pill.has { color: var(--accent-ink); background: var(--accent-soft); }

.adder {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow), inset 0 0 0 1.5px var(--line);
  padding: 0 6px 0 14px;
  min-height: 58px;
  transition: box-shadow 0.15s ease;
}
.adder:focus-within { box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); }
.adder-plus { width: 24px; height: 24px; color: var(--accent); flex: none; }
.adder input {
  flex: 1; min-width: 0;
  border: 0; outline: none; background: transparent;
  font-size: 18px;
  min-height: 56px;
  padding: 0 8px;
}
.adder input::placeholder { color: var(--ink-3); }
.adder-go {
  min-height: 44px; padding: 0 16px; border-radius: 13px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 750; font-size: 16px;
}

.chips {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 10px 2px 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 16px; font-weight: 600;
  white-space: nowrap;
}
.chip:active { background: var(--accent-soft); }
.chip.back { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 40%, var(--line)); }
.chip-label { color: var(--ink-3); font-size: 14px; font-weight: 700; flex: none; align-self: center; padding: 0 2px 0 4px; }

.hint {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 0 2px;
  padding: 10px 10px 10px 14px;
  background: var(--accent-soft);
  color: var(--ink);
  border-radius: 14px;
  font-size: 15px;
}
.hint p { margin: 0; flex: 1; }
.hint svg { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; }
.hint button { font-weight: 750; color: var(--accent-ink); padding: 8px 10px; border-radius: 10px; flex: none; }

.items { list-style: none; margin: 12px 0 0; padding: 0; }

.item {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  min-height: 60px;
  margin-bottom: 8px;
  padding: 10px 2px 10px 16px;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  transition: background-color 0.4s ease, transform 0.18s ease, opacity 0.3s ease;
}
.item.new { background: var(--new); }
.item.new .item-text::after {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--new-dot);
  vertical-align: 2px;
}

.check {
  width: 28px; height: 28px; flex: none;
  border-radius: 50%;
  border: 2.5px solid var(--check);
  display: grid; place-items: center;
  color: transparent;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.check svg { width: 18px; height: 18px; transform: scale(0.4); transition: transform 0.22s cubic-bezier(0.3, 1.6, 0.5, 1); }

.item.checking .check, .done-items .check { background: var(--accent); border-color: var(--accent); color: #fff; }
.item.checking .check svg, .done-items .check svg { transform: scale(1); }
.item.checking .item-text { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 2px; }

.done-items .check { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); border-color: transparent; color: var(--accent-ink); }
.done-items .item-text { color: var(--ink-2); }

.item-body { flex: 1; min-width: 0; padding: 4px 0; }
.item-text { display: block; font-size: 18px; font-weight: 550; line-height: 1.3; overflow-wrap: anywhere; transition: color 0.2s ease; }
.item-meta { display: block; font-size: 13px; color: var(--ink-3); margin-top: 2px; font-weight: 600; }

.item.flash { animation: flash 0.9s ease; }
@keyframes flash { 0%, 100% { background: var(--surface); } 30% { background: var(--accent-soft); } }

.entering { animation: enter 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
@keyframes enter { from { opacity: 0; transform: translateY(-10px) scale(0.97); } to { opacity: 1; transform: none; } }

.leaving {
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.97);
  transition: height 0.28s ease, margin 0.28s ease, padding 0.28s ease, opacity 0.22s ease, transform 0.22s ease, min-height 0.28s ease;
  min-height: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.is-dragging .items > li:not(.dragging),
.is-dragging .cards > li:not(.dragging) { transition: transform 0.18s ease; }
.dragging { z-index: 5; box-shadow: var(--shadow-lift) !important; transition: none !important; cursor: grabbing; }
.dragging .grip { color: var(--accent); }
body.is-dragging { -webkit-user-select: none; user-select: none; cursor: grabbing; }

.done-title { flex: 1; min-width: 0; padding-left: 4px; }
.done-title b { display: block; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.done-title small { display: block; color: var(--ink-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.done-help { color: var(--ink-2); margin: 4px 4px 0; font-size: 15px; }

/* ------------------------------------------------------------------ */
/* Sheets                                                              */
/* ------------------------------------------------------------------ */

.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity 0.25s ease; }
.sheet {
  position: absolute;
  left: 0; right: 0;
  bottom: var(--kb);
  max-width: 640px;
  margin: 0 auto;
  max-height: calc(100dvh - var(--kb) - var(--safe-t) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  padding: 8px calc(22px + var(--safe-r)) calc(24px + var(--safe-b)) calc(22px + var(--safe-l));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
  transform: translateY(105%);
  transition: transform 0.3s cubic-bezier(0.2, 0.85, 0.25, 1), bottom 0.2s ease;
}
.sheet-wrap.open .scrim { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }

@media (min-width: 720px) {
  .sheet {
    top: 50%; bottom: auto;
    width: 560px;
    border-radius: 26px;
    max-height: 86dvh;
    transform: translateY(-46%) scale(0.97);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.2s ease;
  }
  .sheet-wrap.open .sheet { transform: translateY(-50%); opacity: 1; }
  .grabber { display: none; }
}

.sheet h2 { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 16px; }
.sheet h3 { font-size: 16px; font-weight: 800; margin: 22px 0 10px; }
.sheet p { margin: 0 0 14px; }
.sheet .row { display: flex; gap: 10px; }
.sheet .row .btn { flex: 1; }
.sheet .stack { display: grid; gap: 10px; }
.sheet hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }

.kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.kind {
  text-align: left;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 2px transparent;
  display: grid; gap: 4px;
  align-content: start;
}
.kind .kind-emoji { font-size: 26px; line-height: 1; }
.kind b { font-size: 17px; }
.kind small { color: var(--ink-2); font-size: 14px; line-height: 1.3; }
.kind.on { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }

.icons { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.icons button {
  aspect-ratio: 1;
  border-radius: 14px;
  font-size: 24px;
  background: color-mix(in srgb, var(--tint) 14%, var(--surface));
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 2px transparent;
}
.icons button.on { box-shadow: inset 0 0 0 2.5px var(--tint); }

.code-input {
  width: 100%;
  min-height: 76px;
  text-align: center;
  font-size: clamp(28px, 8.5vw, 38px);
  font-weight: 800;
  letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums;
  border-radius: 18px;
  border: 2px solid var(--line);
  background: var(--surface-2);
  outline: none;
  padding: 0 0 0 0.16em;
}
.code-input::placeholder { color: var(--ink-3); opacity: 0.6; }
.code-input:focus { border-color: var(--accent); background: var(--surface); }

.code-big {
  text-align: center;
  font-size: clamp(32px, 10.5vw, 46px);
  font-weight: 800;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 20px;
  padding: 18px 10px;
  margin: 0 0 14px;
  -webkit-user-select: all; user-select: all;
}

.sheet-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 12px; }
.sheet-head h2 { margin: 0; flex: 1; min-width: 0; }
.sheet-head .tile { width: 44px; height: 44px; font-size: 24px; border-radius: 13px; }

.people { display: flex; flex-wrap: wrap; gap: 8px; }
.person {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: var(--surface-2);
  font-weight: 650;
}
.person i {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-style: normal; font-weight: 800; font-size: 14px;
  background: var(--accent-soft); color: var(--accent-ink);
}

.me { display: flex; align-items: center; gap: 14px; margin: 4px 0 20px; }
.me b { display: block; font-size: 20px; }
.me small { display: block; color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }

.panel {
  background: var(--surface-2);
  border-radius: 18px;
  padding: 16px;
  margin: 18px 0;
}
.panel b { display: block; font-size: 17px; margin-bottom: 4px; }
.panel p { color: var(--ink-2); font-size: 15px; margin-bottom: 12px; }

.menu-links { display: grid; margin: 4px -8px 0; }
.menu-links button {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 54px;
  padding: 0 8px;
  font-size: 17px; font-weight: 650;
  border-radius: 12px;
}
.menu-links button + button { border-top: 1px solid var(--line); border-radius: 0; }
.menu-links svg { width: 20px; height: 20px; color: var(--ink-3); }

.import-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 12px;
  align-items: center;
  background: var(--surface-2);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 10px;
}
.import-row .tile { width: 44px; height: 44px; font-size: 22px; border-radius: 13px; }
.import-row input { min-height: 46px; background: var(--surface); }
.import-row .seg { grid-column: 1 / -1; background: var(--surface); }
.import-row .seg button.on { background: var(--accent-soft); color: var(--accent-ink); box-shadow: none; }
.import-row small { grid-column: 1 / -1; color: var(--ink-2); font-size: 14px; margin-top: -4px; }

/* Help */
.help details { border-bottom: 1px solid var(--line); }
.help summary {
  list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 56px;
  font-weight: 750; font-size: 17px;
  cursor: pointer;
}
.help summary::-webkit-details-marker { display: none; }
.help summary svg { width: 20px; height: 20px; color: var(--ink-3); transition: transform 0.2s ease; flex: none; }
.help details[open] summary svg { transform: rotate(180deg); }
.help .body { padding: 0 0 16px; color: var(--ink-2); }
.help .body p { margin: 0 0 10px; }
.help .body ul { margin: 0 0 10px; padding-left: 20px; }
.help .body li { margin-bottom: 6px; }
.help .body b { color: var(--ink); }
.help .lead { color: var(--ink-2); }

/* About */
.about-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 16px; }
.about-head svg { width: 56px; height: 56px; flex: none; }
.about-head .wordmark { font-size: 34px; display: block; line-height: 1; }
.about-head p { margin: 4px 0 0; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 14px; font-size: 16px; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 700; }
.changes { list-style: none; padding: 0; margin: 0; }
.changes > li { padding: 10px 0; border-top: 1px solid var(--line); }
.changes b { font-size: 16px; }
.changes small { color: var(--ink-3); margin-left: 6px; }
.changes ul { margin: 6px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 15px; }
.links { display: grid; gap: 4px; margin-top: 8px; }
.links a { color: var(--accent-ink); font-weight: 650; text-decoration: none; padding: 6px 0; }

/* ------------------------------------------------------------------ */
/* Toast                                                               */
/* ------------------------------------------------------------------ */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + var(--safe-b) + var(--dock-space, 0px));
  z-index: 60;
  display: flex; align-items: center; gap: 14px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 12px 12px 18px;
  border-radius: 16px;
  background: var(--toast-bg);
  color: var(--toast-ink);
  font-weight: 600;
  font-size: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, 20px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.2s ease;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.toast button { color: var(--toast-action); font-weight: 800; padding: 6px 8px; border-radius: 8px; flex: none; }
.toast button:empty { display: none; }
body.on-home { --dock-space: 78px; }

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