/* ---------- App frame ---------- */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.app {
  position: relative;
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
}
@media (min-width: 520px) {
  .app { box-shadow: 0 0 0 1px rgba(21, 23, 28, 0.06), 0 20px 60px rgba(80, 60, 30, 0.15); }
}
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: env(safe-area-inset-top);
}
.scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden; /* only the filter chips scroll sideways */
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.scroll > * { flex-shrink: 0; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 8px; }
h2.label { margin: 0; padding: 0 4px; }
.stack-12 { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Header bar ---------- */
.bar { display: flex; align-items: center; gap: 10px; padding: 16px 16px 8px; }
.bar-icon { display: inline-flex; }
.bar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.bar-title h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.bar-title .label { color: var(--muted); letter-spacing: 0.14em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-h1 { flex: 1; margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.bar-center { flex: 1; display: flex; flex-direction: column; align-items: center; }
.bar-center h1 { margin: 0; font-size: 18px; font-weight: 700; }
.bar-center .label { color: #1F1E1C; }
.bar-spacer { width: 44px; flex: none; }
.csv-key { width: 48px; height: 48px; padding: 0; flex-direction: column; gap: 1px; border-radius: 12px; }
.csv-key span:last-child { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; }
.section-label {
  margin: 0;
  padding: 0 4px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-label.split { display: flex; justify-content: space-between; }
.section-label h2 { margin: 0; font-size: inherit; font-weight: inherit; }

/* ---------- Period navigator ---------- */
.summary { display: flex; flex-direction: column; gap: 12px; padding: 14px 14px 16px; }
.period { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; }
.period-mid { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.period-name { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 700; }
.period-name.big { font-size: 22px; }
.year-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 32px;
  color: var(--signal-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- LCD contents ---------- */
.spent { display: flex; flex-direction: column; gap: 10px; }
.lcd-row { display: flex; justify-content: space-between; }
.led-tag { display: flex; align-items: center; gap: 6px; }
.led { display: inline-block; width: 6px; height: 6px; border-radius: 3px; background: var(--signal); box-shadow: 0 0 6px var(--signal); }
.led.green { width: 8px; height: 8px; border-radius: 4px; background: var(--bill); box-shadow: 0 0 6px var(--bill); }
.lcd-amount {
  font-family: var(--mono);
  font-size: 38px;
  font-weight: 500;
  color: var(--coin);
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.lcd-amount.mid { display: block; margin-top: 6px; font-size: 30px; }
.lcd-extra { font-family: var(--mono); font-size: 12px; color: var(--lcd-label); }
.lcd-extra:empty { display: none; }
.segments { display: flex; gap: 3px; height: 12px; }
.segments .seg { border-radius: 3px; min-width: 4px; }
.segments .seg.dark { box-shadow: inset 0 0 0 1.5px #6B6760; }
.segments .seg.empty { flex: 1; background: transparent; box-shadow: inset 0 0 0 1.5px #4A4844; }

.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; padding: 0 4px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.legend-item .name { flex: 1; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-item .amt { font-family: var(--mono); font-size: 12px; }
.dot { width: 11px; height: 11px; border-radius: 3px; flex: none; border: 1.5px solid var(--line); }
.legend-empty { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--label); text-align: center; }

/* ---------- Filter chips ---------- */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  margin: 0 -16px;
  padding: 2px 16px 6px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chips .key { flex: none; height: 38px; font-size: 13px; padding: 0 14px; }

/* ---------- Day lists ---------- */
.day { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.day:last-child { margin-bottom: 0; }
.day-head {
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.paper.list, .paper.rows { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.entry-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1.5px dashed var(--dash);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
li:last-child > .entry-row, li:last-child > .month-row { border-bottom: 0; }
.entry-row:active { background: #F4EDE0; }
.entry-row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.entry-row .merchant { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-row .meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; min-width: 0; }
.entry-row .meta .note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-row .amount { font-family: var(--mono); font-size: 15px; font-weight: 500; white-space: nowrap; }
.badge {
  flex: none;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  background: var(--bill);
  color: var(--line);
  border: 1.5px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
}
.empty-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 16px; text-align: center; }
.empty-card p { margin: 0; font-size: 14px; color: var(--muted); }
.empty-card strong { font-size: 16px; color: var(--line); }

/* ---------- Docks ---------- */
.dock {
  padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
  background: var(--panel);
  border-radius: 24px 24px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 -6px 18px rgba(80, 60, 30, 0.10);
}
.dock-main { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); gap: 8px; padding-left: 14px; padding-right: 14px; border-radius: 26px 26px 0 0; }
.dock-btn {
  height: 96px;
  border-radius: 16px;
  background: var(--key-sunk);
  box-shadow: 0 3px 0 var(--key-shadow), inset 0 1px 0 #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  color: var(--line);
  transition: transform 0.06s, box-shadow 0.06s;
}
.dock-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--key-shadow), inset 0 1px 0 #FFFFFF; }
.dock-round { width: 52px; height: 52px; border-radius: 26px; display: flex; align-items: center; justify-content: center; }
.dock-round.signal { background: var(--signal); color: var(--line); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.25); }
.dock-round.ink { background: var(--ink); color: #FFFFFF; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.25); }
.dock-label { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.grille {
  border-radius: 12px;
  background-color: #BDB8AF;
  background-image: radial-gradient(circle, #8C877E 1.6px, transparent 1.8px);
  background-size: 8px 8px;
  display: flex;
  justify-content: center;
  padding-top: 10px;
}
.grille-led { width: 18px; height: 8px; border-radius: 4px; background: var(--signal); box-shadow: 0 0 6px rgba(255, 91, 26, 0.7); }
.grille-led.busy { animation: blink 0.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

.big-signal {
  width: 100%;
  height: 56px;
  border: none;
  border-radius: 14px;
  background: var(--signal);
  color: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--signal-dark), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.06s, box-shadow 0.06s;
}
.big-signal:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--signal-dark), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.big-signal:disabled { opacity: 0.6; }

/* ---------- Year view ---------- */
.year-panel { display: flex; flex-direction: column; gap: 14px; padding: 14px 14px 18px; }
.year-lcd { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.year-lcd .avg { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.year-lcd #year-avg { font-family: var(--mono); font-size: 15px; color: #FF8A57; white-space: nowrap; }
.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 160px; padding: 0 4px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; border: 0; padding: 0; background: none; cursor: pointer; }
.bar-col:disabled { cursor: default; }
.bar-track {
  flex: 1;
  width: 100%;
  border-radius: 8px;
  background: #3A3936;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  padding: 2px;
}
.bar-fill {
  width: 100%;
  border-radius: 6px;
  background: var(--coin);
  background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 5px);
}
.bar-fill.current { background-color: var(--signal); }
.bar-letter { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--label); }
.bar-letter.current { font-weight: 700; color: var(--line); }
.month-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1.5px dashed var(--dash);
  background: transparent;
  color: var(--line);
  text-align: left;
  cursor: pointer;
}
.month-row .name { flex: 1; font-size: 15px; font-weight: 600; }
.month-row .count { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.month-row .amt { font-family: var(--mono); font-size: 14px; min-width: 88px; text-align: right; }
.month-row svg { color: var(--muted); }

/* ---------- Scan ---------- */
.scan { background: #8C8A85; }
.dark-shadow { box-shadow: 0 3px 0 #5E5C58, inset 0 1px 0 #FFFFFF; }
#torch[aria-pressed="true"] { background: var(--coin); color: var(--line); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35), 0 0 10px rgba(246, 194, 26, 0.7); }
.viewfinder-frame {
  flex: 1;
  min-height: 0;
  margin: 0 16px;
  padding: 10px;
  border-radius: 26px;
  background: #2B2A28;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.3);
  display: flex;
}
.viewfinder {
  flex: 1;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background-color: #4E5B5A;
  background-image: radial-gradient(circle, rgba(239, 227, 207, 0.18) 1.2px, transparent 1.4px);
  background-size: 6px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.viewfinder video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viewfinder-fallback { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px; }
.viewfinder-fallback p { margin: 0; max-width: 240px; text-align: center; color: #EFE3CF; font-size: 13px; font-weight: 500; }
.fake-receipt {
  width: 150px;
  padding: 16px 14px;
  background: #F4EFE4;
  transform: rotate(-3deg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #3A3B3F;
  font-family: var(--mono);
  font-size: 9px;
}
.fake-receipt > b { text-align: center; font-size: 11px; }
.fake-receipt > i, .fake-receipt p i { display: block; height: 5px; background: #D6D1C6; border-radius: 2px; }
.fake-receipt > i { align-self: center; }
.fake-receipt hr { width: 100%; border: 0; border-top: 1px dashed #A9A69E; margin: 3px 0; }
.fake-receipt p { margin: 0; display: flex; justify-content: space-between; gap: 8px; }
.fake-receipt p i:first-child { width: 70%; }
.fake-receipt p i:last-child { width: 20%; }
.fake-receipt .hl { padding: 2px 4px; margin: 0 -4px; }
.fake-receipt .coin { background: var(--coin); font-size: 10px; }
.fake-receipt .bill { background: var(--bill); }
.corner { position: absolute; width: 34px; height: 34px; border: 0 solid var(--signal); pointer-events: none; }
.corner.tl { top: 30px; left: 30px; border-top-width: 4px; border-left-width: 4px; border-top-left-radius: 12px; }
.corner.tr { top: 30px; right: 30px; border-top-width: 4px; border-right-width: 4px; border-top-right-radius: 12px; }
.corner.bl { bottom: 30px; left: 30px; border-bottom-width: 4px; border-left-width: 4px; border-bottom-left-radius: 12px; }
.corner.br { bottom: 30px; right: 30px; border-bottom-width: 4px; border-right-width: 4px; border-bottom-right-radius: 12px; }
.pill {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  background: var(--ink);
  color: #F4F1EA;
  padding: 7px 12px;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hint { margin: 12px 16px 0; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; box-shadow: none; }
.hint p { margin: 0; font-size: 13px; line-height: 1.35; font-weight: 500; }
.scan-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 18px 24px calc(24px + env(safe-area-inset-bottom));
}
.side-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--line); cursor: pointer; }
.side-btn.left { justify-self: start; }
.side-btn.right { justify-self: end; }
.big-key { width: 52px; height: 52px; border-radius: 12px; padding: 0; }
.ink-key { background: var(--ink); color: #FFFFFF; box-shadow: 0 3px 0 #000000, inset 0 1px 0 #4A4844; }
.label.dark { color: var(--line); letter-spacing: 0.12em; }
.shutter {
  width: 88px;
  height: 88px;
  border-radius: 44px;
  border: 0;
  padding: 0;
  background: #3A3936;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.shutter span {
  width: 68px;
  height: 68px;
  border-radius: 34px;
  background: radial-gradient(circle at 40% 35%, #FF8A57, var(--signal) 60%, #D9480F);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.45), inset 0 -3px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.08s;
}
.shutter:active span { transform: scale(0.92); }

/* ---------- Expense form ---------- */
.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bill);
  border: 2px solid var(--line);
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--line);
}
.banner.working { background: var(--coin); }
.banner.warn { background: #FFB38F; }
.banner-thumb { flex: none; display: flex; padding: 0; border: 0; background: none; cursor: pointer; }
.banner-thumb img { width: 34px; height: 44px; object-fit: cover; border: 1.5px solid var(--line); border-radius: 4px; }
.banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.banner-text strong { font-size: 14px; }
.banner-text span { font-size: 12px; font-weight: 500; }
.banner-link {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 4px;
}
.banner.working .banner-text strong::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

.entry { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 24px; }
.amount-lcd { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px 14px; }
.amount-lcd select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-bottom: 1px dashed var(--lcd-label);
  border-radius: 0;
  padding: 0 2px;
  background: transparent;
  color: var(--lcd-label);
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
.amount-lcd select option { color: var(--line); }
.amount-row { display: flex; align-items: baseline; gap: 4px; }
.currency-symbol { font-family: var(--mono); font-size: 34px; color: var(--lcd-label); }
#f-amount {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--coin);
  padding: 0;
  border-radius: 6px;
}
#f-amount::placeholder { color: #5E5A52; }
.fields { background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12); }
.field-row { display: flex; align-items: center; gap: 12px; padding: 0 14px; min-height: 54px; border-bottom: 1.5px dashed var(--dash); }
.field-row:last-child { border-bottom: 0; }
.field-row.top { align-items: flex-start; padding: 14px; }
.field-row.top .label { padding-top: 4px; }
.field-row .label { width: 64px; flex: none; letter-spacing: 0.14em; }
.field-row input, .field-row textarea {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  color: var(--line);
  border-radius: 6px;
  padding: 0;
}
.field-row textarea { height: auto; font-size: 15px; font-weight: 400; resize: none; }
.field-row ::placeholder { color: #9A8F7E; font-weight: 400; }
.missing { box-shadow: inset 4px 0 0 var(--signal); }
.amount-lcd.missing { box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5), inset 0 0 0 2px var(--signal); }

.categories { border: 0; margin: 0; padding: 0; min-width: 0; }
.categories legend { margin-bottom: 10px; }
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cat {
  min-height: 78px;
  padding: 8px 2px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: var(--key);
  box-shadow: 0 3px 0 var(--key-shadow), inset 0 1px 0 #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  color: var(--line);
  cursor: pointer;
}
.cat[aria-pressed="true"] { border-color: var(--line); background: #FFF3C4; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.18); }
.form-error { margin: 0; color: var(--signal-dark); font-weight: 600; font-size: 14px; text-align: center; }
.form-error:empty { display: none; }

/* ---------- Export ---------- */
.seg3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.seg3 .key { height: 46px; font-size: 14px; }
.period-lcd { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 14px; min-height: 52px; border-radius: 12px; }
#export-period { font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--coin); text-transform: uppercase; }
#export-change {
  height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: #FF8A57;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.period-inputs { display: flex; flex-direction: column; gap: 8px; }
.period-inputs input, .period-inputs select, .setting input, .setting select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--card);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
  font-weight: 600;
}
.custom-range { display: flex; align-items: center; gap: 8px; }
.custom-range input { flex: 1; min-width: 0; }
.custom-range span { font-family: var(--mono); }
.checks { padding: 4px 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 46px; font-size: 14px; font-weight: 500; cursor: pointer; min-width: 0; }
.check input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--signal); }
.check span:last-child { line-height: 1.2; }
.preview {
  margin: 0;
  color: var(--bill);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
}
.filename { padding: 0 4px; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---------- Settings ---------- */
.options { padding: 4px 14px; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1.5px dashed var(--dash); cursor: pointer; }
.option:last-child { border-bottom: 0; }
.option input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--signal); flex: none; }
.option span { font-size: 13px; color: var(--muted); }
.option strong { display: block; font-size: 15px; color: var(--line); }
.setting { display: flex; flex-direction: column; gap: 6px; }
.setting small { font-size: 12px; color: var(--label); }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.key.danger { color: var(--signal-dark); }
.fineprint { margin: 0 4px; font-size: 13px; color: var(--muted); }

/* ---------- Photo viewer & toast ---------- */
#photo-dialog {
  max-width: min(480px, 100vw);
  max-height: 100dvh;
  padding: 16px;
  border: 0;
  border-radius: 20px;
  background: var(--panel);
  text-align: center;
}
#photo-dialog::backdrop { background: rgba(21, 23, 28, 0.7); }
#photo-dialog img { display: block; max-width: 100%; max-height: 75dvh; margin: 0 auto 12px; border-radius: 10px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(132px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--coin);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
