/* ---------- Tokens ---------- */
:root {
  --bg: #f7f1e5; --bg-2: #eee5d2; --card: #fffbf3;
  --ink: #2f3a2f; --ink-2: #6b705f; --ink-3: #a39e8c; --line: #e5dbc7;
  --soil: #e3d2b1; --soil-dark: #b89f78;
  --leaf: #8dc07a; --leaf-dark: #6a9e5b; --stem: #6f9e5f; --plant-ink: #3b4a36;
  --accent: #df765d; --accent-2: #f8d8cd; --on-accent: #fff; --danger: #c4553f; --ok: #34c759;
  --shadow: 0 1px 2px rgb(60 50 30 / .06), 0 8px 24px rgb(60 50 30 / .07);
  --radius: 18px;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-write: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 58px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151a2a; --bg-2: #1f2538; --card: #222a40;
    --ink: #eeebe2; --ink-2: #aeb2c3; --ink-3: #737a95; --line: #2f3752;
    --soil: #3b3854; --soil-dark: #5a547a;
    --leaf: #86be77; --leaf-dark: #5f9457; --stem: #79ad69; --plant-ink: #11151f;
    --accent: #f0907a; --accent-2: #5a3a3a; --on-accent: #2a1712;
    --shadow: 0 1px 2px rgb(0 0 0 / .25), 0 8px 24px rgb(0 0 0 / .22);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151a2a; --bg-2: #1f2538; --card: #222a40;
  --ink: #eeebe2; --ink-2: #aeb2c3; --ink-3: #737a95; --line: #2f3752;
  --soil: #3b3854; --soil-dark: #5a547a;
  --leaf: #86be77; --leaf-dark: #5f9457; --stem: #79ad69; --plant-ink: #11151f;
  --accent: #f0907a; --accent-2: #5a3a3a; --on-accent: #2a1712;
  --shadow: 0 1px 2px rgb(0 0 0 / .25), 0 8px 24px rgb(0 0 0 / .22);
  color-scheme: dark;
}
:root[data-font="rounded"] { --font-write: ui-rounded, "SF Pro Rounded", system-ui, sans-serif; }
:root[data-font="hand"] { --font-write: "Noteworthy", "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive; }
:root[data-font="type"] { --font-write: "American Typewriter", "Courier New", monospace; }
:root[data-font="simple"] { --font-write: var(--font-ui); }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; font: 16px/1.45 var(--font-ui); color: var(--ink); background: var(--bg);
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
body.no-scroll { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
button, .tabbar, .day, .key { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
svg { flex: none; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.view {
  max-width: 1120px; margin: 0 auto; min-height: 100dvh;
  padding: calc(var(--safe-top) + 14px) max(16px, env(safe-area-inset-right)) calc(var(--tabbar-h) + var(--safe-bottom) + 100px) max(16px, env(safe-area-inset-left));
}

/* ---------- Header bits ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.year-switch { display: flex; align-items: center; gap: 2px; margin-left: -8px; }
.year-title { font: 800 34px/1.1 var(--font-display); letter-spacing: -.02em; min-width: 3.2ch; text-align: center; }
.page-title { font: 800 32px/1.15 var(--font-display); letter-spacing: -.02em; }
.year-title.small { font-size: 21px; min-width: 2.8ch; }
body.privacy #app, body.privacy .overlay, body.privacy .viewer { filter: blur(28px); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:active { background: var(--bg-2); }
.icon-btn[disabled] { opacity: .25; pointer-events: none; }
.icon-btn svg { width: 22px; height: 22px; }
.subtitle { color: var(--ink-2); font-size: 15px; margin-top: 2px; }
.stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--bg-2); color: var(--ink-2); font-size: 14px; font-weight: 650;
}
.chip b { color: var(--ink); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.prompt-card { display: flex; align-items: center; gap: 12px; margin-top: 14px; width: 100%; text-align: left; }
.prompt-card .plant { width: 42px; height: 52px; }
.prompt-card strong { display: block; font: 700 17px/1.25 var(--font-display); }
.prompt-card span { color: var(--ink-2); font-size: 14px; }
.prompt-card .snippet { font-family: var(--font-write); color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prompt-card > svg:last-child { width: 18px; height: 18px; color: var(--ink-3); margin-left: auto; }

/* ---------- Garden ---------- */
.beds {
  display: grid; gap: 14px 16px; margin-top: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--bed-min, 300px)), 1fr));
}
.garden.compact .beds { --bed-min: 150px; gap: 10px; }
.bed { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 8px 6px; scroll-margin-top: calc(var(--safe-top) + 12px); }
.bed-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 6px 4px; }
.bed-name { font: 700 17px var(--font-display); }
.bed-count { font-size: 13px; color: var(--ink-3); font-weight: 650; }
.bed-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.wd { text-align: center; font-size: 11px; color: var(--ink-3); font-weight: 650; padding-bottom: 2px; }
.day { position: relative; display: block; width: 100%; aspect-ratio: 40 / 50; border-radius: 10px; }
.day .plant { width: 100%; height: 100%; display: block; overflow: visible; }
.day:active { background: var(--bg-2); }
.day .dn { position: absolute; bottom: 0; left: 1px; font-size: 9.5px; line-height: 1; font-weight: 650; color: var(--ink-3); opacity: .85; }
.day.has .dn { opacity: .55; }
.day.is-today { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.day.is-today .dn { color: var(--accent); opacity: 1; }
.garden.compact .dn { display: none; }
.garden.compact .bed { padding: 8px 5px 4px; border-radius: 14px; }
.garden.compact .bed-name { font-size: 14px; }
.garden.compact .bed-count, .garden.compact .wd { font-size: 10px; }

.plant.grow, .grow .plant { transform-origin: 50% 93%; animation: grow .7s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes grow { from { transform: scale(.15); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Tab bar & FAB ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; gap: 4px;
  padding: 6px 12px calc(6px + var(--safe-bottom)); border-top: 1px solid var(--line);
  background: var(--bg); background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
}
.tab { flex: 1; max-width: 150px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px 0; font-size: 11px; font-weight: 650; color: var(--ink-3); }
.tab svg { width: 26px; height: 26px; }
.tab[aria-current="page"] { color: var(--accent); }
.fab {
  position: fixed; z-index: 21; right: max(18px, env(safe-area-inset-right)); bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  height: 54px; padding: 0 20px 0 16px; border-radius: 27px; display: flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--on-accent); font-weight: 750; font-size: 16px;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 45%, transparent); transition: transform .15s;
}
.fab svg { width: 22px; height: 22px; }
.fab:active { transform: scale(.95); }

/* ---------- Sheets ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgb(20 18 12 / .34); animation: fade .2s ease both;
}
.sheet {
  width: 100%; max-width: 680px; max-height: calc(100dvh - var(--safe-top) - 10px); display: flex; flex-direction: column;
  background: var(--bg); border-radius: 22px 22px 0 0; overflow: hidden; animation: up .34s cubic-bezier(.2, .9, .3, 1) both;
}
.sheet.full { height: calc(100dvh - var(--safe-top) - 10px); }
@media (min-width: 700px) and (min-height: 620px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { border-radius: 22px; max-height: min(880px, 92dvh); animation-name: pop; }
  .sheet.full { height: min(880px, 92dvh); }
}
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font: 700 17px var(--font-display); text-align: center; }
.sheet-head .start { justify-self: start; display: flex; }
.sheet-head .end { justify-self: end; display: flex; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 16px 18px calc(28px + var(--safe-bottom)); }
.text-btn { color: var(--accent); font-weight: 750; padding: 8px 10px; border-radius: 10px; }
.text-btn:active { background: var(--bg-2); }
.overlay.closing { animation: fadeout .22s ease-in both; }
.overlay.closing .sheet { animation: down .22s ease-in both; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes down { to { transform: translateY(100%); } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }

/* ---------- Editor ---------- */
.editor-hero { display: flex; flex-direction: column; align-items: center; margin: 0 0 6px; }
.editor-hero .plant { width: 84px; height: 105px; }
.editor-date { font: 800 23px/1.2 var(--font-display); text-align: center; }
.editor-sub { color: var(--ink-3); font-size: 14px; text-align: center; margin-top: 2px; }
.moods { display: flex; justify-content: space-between; gap: 4px; margin: 16px 0; }
.mood { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 6px; border-radius: 14px; font-size: 12px; font-weight: 650; color: var(--ink-3); }
.mood .face { width: 38px; height: 38px; filter: grayscale(.9) opacity(.5); transition: filter .2s, transform .25s cubic-bezier(.2, 1.4, .4, 1); }
.mood[aria-pressed="true"] { background: var(--card); box-shadow: var(--shadow); color: var(--ink); }
.mood[aria-pressed="true"] .face { filter: none; transform: scale(1.12); }
.write {
  display: block; width: 100%; min-height: 190px; border: 0; outline: 0; resize: none; padding: 16px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  font-family: var(--font-write); font-size: 19px; line-height: 1.55;
}
.write::placeholder { color: var(--ink-3); }
.section-label { font-size: 13px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin: 20px 4px 8px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.photo-tile { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--bg-2); display: block; width: 100%; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.add-photo { display: grid; place-items: center; align-content: center; gap: 2px; border: 2px dashed var(--line); background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 650; cursor: pointer; }
.add-photo svg { width: 24px; height: 24px; }
.add-photo input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.save-state { font-size: 12.5px; color: var(--ink-3); text-align: center; margin-top: 14px; min-height: 1.2em; }
.danger-btn { display: block; width: 100%; margin-top: 18px; padding: 13px; border-radius: 14px; background: var(--card); color: var(--danger); font-weight: 650; }

/* ---------- Memories ---------- */
.search-wrap { position: relative; margin: 14px 0 4px; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); }
.search { width: 100%; padding: 11px 14px 11px 38px; border-radius: 12px; border: 0; outline: 0; background: var(--bg-2); font-size: 16px; }
.mood-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--bg-2); margin: 12px 0 8px; }
.mood-bar span { display: block; height: 100%; }
.mood-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-2); }
.mood-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.mem-list { display: grid; gap: 12px; margin-top: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); align-items: start; }
.mem { display: block; width: 100%; text-align: left; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px 14px; }
.mem:active { transform: scale(.99); }
.mem-head { display: flex; align-items: center; gap: 10px; }
.mem-head .plant { width: 30px; height: 38px; }
.mem-date { font: 700 16px/1.2 var(--font-display); }
.mem-wd { font-size: 13px; color: var(--ink-3); }
.mem-head .face { width: 26px; height: 26px; margin-left: auto; }
.mem-text {
  margin: 8px 0 0; font-family: var(--font-write); font-size: 16.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden;
}
.mem-photos { display: flex; gap: 6px; margin-top: 10px; overflow: hidden; }
.mem-photos img { width: 64px; height: 64px; flex: none; object-fit: cover; border-radius: 10px; background: var(--bg-2); }
.empty { text-align: center; color: var(--ink-2); padding: 48px 20px; }
.empty .plant { width: 72px; height: 90px; margin: 0 auto 8px; }
.empty strong { display: block; color: var(--ink); font: 700 18px var(--font-display); margin-bottom: 4px; }

/* ---------- Settings ---------- */
.group { margin-top: 24px; }
.group-title { font-size: 13px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin: 0 6px 8px; }
.group-note { font-size: 13px; color: var(--ink-3); margin: 8px 8px 0; }
.rows { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 16px; text-align: left; }
.row + .row, .row + .font-grid, .font-grid + .row { border-top: 1px solid var(--line); }
.row-label { flex: 1; min-width: 0; }
.row-label small { display: block; color: var(--ink-3); font-size: 13px; line-height: 1.35; }
.row-value { color: var(--ink-2); font-size: 15px; }
.row > svg { width: 20px; height: 20px; color: var(--ink-2); }
button.row:active { background: var(--bg-2); }
.row input[type="text"], .row input[type="time"] { flex: 1; min-width: 0; max-width: 55%; border: 0; outline: 0; background: transparent; text-align: right; font-size: 16px; color: var(--ink-2); }
.row.danger { color: var(--danger); font-weight: 650; }
.switch {
  -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 51px; height: 31px; margin: 0;
  border-radius: 16px; background: var(--line); transition: background .2s; cursor: pointer;
}
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgb(0 0 0 / .2); transition: transform .2s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }
.seg { display: flex; flex: none; background: var(--bg-2); border-radius: 10px; padding: 2px; }
.seg button { padding: 6px 11px; border-radius: 8px; font-size: 14px; font-weight: 650; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.font-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; padding: 12px; }
.font-opt { padding: 10px 12px; border-radius: 12px; background: var(--bg-2); text-align: left; }
.font-opt[aria-pressed="true"] { background: var(--card); box-shadow: inset 0 0 0 2px var(--accent); }
.font-opt b { display: block; font-size: 19px; font-weight: 400; line-height: 1.3; }
.font-opt span { font-size: 12px; color: var(--ink-3); }
.about { text-align: center; color: var(--ink-3); font-size: 13px; margin-top: 28px; }
.about .plant { width: 40px; height: 50px; margin: 0 auto 4px; }

/* ---------- Dialogs & toast ---------- */
.dialog-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgb(20 18 12 / .4); animation: fade .15s both; }
.dialog { width: min(340px, 100%); background: var(--card); border-radius: 20px; padding: 20px 18px 14px; text-align: center; box-shadow: 0 20px 60px rgb(0 0 0 / .25); animation: pop .22s cubic-bezier(.2, 1.2, .4, 1) both; }
.dialog h3 { font: 700 18px/1.3 var(--font-display); margin-bottom: 6px; }
.dialog p { margin: 0 0 16px; color: var(--ink-2); font-size: 15px; white-space: pre-line; }
.dialog-actions { display: flex; gap: 8px; }
.dialog-actions button { flex: 1; padding: 12px; border-radius: 12px; font-weight: 700; background: var(--bg-2); }
.dialog-actions .primary { background: var(--accent); color: var(--on-accent); }
.dialog-actions .danger { background: var(--danger); color: #fff; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 84px); z-index: 90; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; max-width: calc(100% - 40px); width: max-content; padding: 11px 18px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 650; box-shadow: var(--shadow); animation: toast 2.8s ease both;
}
.toast.sticky { animation: fade .2s both; }
.toast button { color: var(--accent); font-weight: 800; }
@keyframes toast { 0% { opacity: 0; translate: 0 10px; } 8%, 88% { opacity: 1; translate: 0 0; } 100% { opacity: 0; } }

/* ---------- Photo viewer ---------- */
.viewer { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: #000; color: #fff; animation: fade .2s both; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; padding: calc(var(--safe-top) + 6px) 10px 6px; }
.viewer-bar .icon-btn { color: #fff; }
.viewer-count { font-weight: 650; font-size: 15px; opacity: .8; }
.viewer-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.viewer-track::-webkit-scrollbar { display: none; }
.viewer-slide { flex: 0 0 100%; display: grid; place-items: center; scroll-snap-align: center; padding: 4px; }
.viewer-slide img { max-width: 100%; max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 140px); object-fit: contain; border-radius: 6px; }
.viewer-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 10px 12px calc(14px + var(--safe-bottom)); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px; background: rgb(255 255 255 / .14); color: #fff; font-size: 15px; font-weight: 650; }
.pill svg { width: 18px; height: 18px; }
.pill[aria-pressed="true"] { background: #fff; color: #111; }
.pill.busy { opacity: .6; pointer-events: none; }

/* ---------- Lock ---------- */
.lock { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: var(--safe-top) 20px var(--safe-bottom); background: var(--bg); }
.lock .plant { width: 60px; height: 75px; }
.lock h2 { font: 700 21px var(--font-display); }
.lock p { margin: -8px 0 0; color: var(--ink-3); font-size: 14px; min-height: 1.4em; }
.dots { display: flex; gap: 16px; height: 16px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink-2); }
.dots i.on { background: var(--ink); border-color: var(--ink); }
.dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 74px); gap: 14px 22px; margin-top: 8px; }
.key { width: 74px; height: 74px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); font: 500 29px var(--font-display); }
.key:active { background: var(--bg-2); }
.key.ghost { background: none; box-shadow: none; font-size: 15px; font-weight: 650; color: var(--ink-2); }
.lock .cancel { position: absolute; top: calc(var(--safe-top) + 10px); left: 12px; }

/* ---------- Welcome & install guide ---------- */
.welcome {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; overflow-y: auto; text-align: center; background: var(--bg);
  padding: calc(var(--safe-top) + 28px) 24px calc(var(--safe-bottom) + 28px);
}
.welcome-inner { width: 100%; max-width: 440px; margin: auto; }
.welcome-garden { display: flex; justify-content: center; margin-bottom: 14px; }
.welcome-garden .plant { width: 50px; height: 62px; margin: 0 -3px; }
.welcome h1 { font: 800 30px/1.15 var(--font-display); letter-spacing: -.02em; margin-bottom: 10px; }
.welcome p { color: var(--ink-2); font-size: 16.5px; margin: 0 0 20px; }
.field { width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); outline: 0; background: var(--card); font-size: 17px; text-align: center; }
.field:focus { border-color: var(--accent); }
.btn { display: flex; justify-content: center; align-items: center; gap: 8px; width: 100%; margin-top: 12px; padding: 15px 18px; border-radius: 16px; background: var(--accent); color: var(--on-accent); font-size: 17px; font-weight: 750; }
.btn.secondary { background: var(--bg-2); color: var(--ink); }
.btn { position: relative; }
.btn svg { width: 20px; height: 20px; }
.key-box {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 22px; padding: 6px 6px 6px 16px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow);
}
.key-box:focus-within { border-color: var(--accent); }
.key-box > svg { width: 22px; height: 22px; color: var(--ink-3); }
.key-input { flex: 1; min-width: 0; padding: 10px 0; border: 0; outline: 0; background: transparent; font: 16px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.key-input::placeholder { color: var(--ink-3); font-family: var(--font-ui); }
.key-go { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent); color: var(--on-accent); }
.key-go svg { width: 22px; height: 22px; }
.welcome .login-msg { min-height: 1.4em; margin: 14px 0 0; font-size: 15px; color: var(--ink-2); }
.welcome .login-msg.error { color: var(--danger); }
.welcome.busy .key-box { opacity: .6; pointer-events: none; }
.sync-line { margin: 10px 4px 0; font-size: 13px; font-weight: 650; color: var(--ink-3); }
.sync-line:empty { display: none; }
.btn:active { transform: scale(.98); }
.steps { list-style: none; margin: 8px 0 18px; padding: 0; display: grid; gap: 10px; text-align: left; counter-reset: s; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); counter-increment: s; }
.steps li::before { content: counter(s); flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 800; }
.steps svg { width: 20px; height: 20px; vertical-align: -4px; color: #1a7cf5; }
.note { font-size: 14px; color: var(--ink-3); }

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