/* Zegel — phone-first, large touch targets, calm colours; red only for risk. */
:root {
  --ink: #1f2d3d;
  --paper: #f3efe6;
  --card: #ffffff;
  --muted: #5d6b7a;
  --line: #d9d2c3;
  --seal: #a62626;
  --risk: #b3261e;
  --risk-bg: #fdecea;
  --warn-bg: #fff4d6;
  --ok: #1e6b3a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
main { max-width: 640px; margin: 0 auto; padding: 0 12px calc(96px + env(safe-area-inset-bottom)); }
[hidden] { display: none !important; }
header { display: flex; align-items: center; gap: 8px; padding: 14px 2px 6px; }
header h1 { font-size: 24px; margin: 0; flex: 1; }
h2 { font-size: 18px; margin: 18px 4px 8px; }
.card h2 { margin: 0 0 8px; }
section { margin-top: 6px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin: 10px 0;
}
.card.warn { background: var(--warn-bg); border-color: #e7c66a; }
.card.bad { background: var(--risk-bg); border-color: var(--risk); }
.card.ask { border-width: 2px; border-color: var(--ink); }
.card.ask.risky { border-color: var(--risk); }
.card p { margin: 6px 0; }
.center { text-align: center; }
.small { font-size: 14px; color: var(--muted); }
.big { font-size: 22px; font-weight: 600; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; }
.wrap { white-space: pre-wrap; word-break: break-all; }
label { display: block; margin: 10px 0; font-size: 15px; color: var(--muted); }
label > input, label > select, label > textarea { display: block; width: 100%; margin-top: 4px; }
label.check { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); }
label.check > input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; }
.warnline { color: var(--risk) !important; }
input, select, textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
button {
  display: block;
  width: 100%;
  font: inherit;
  font-weight: 600;
  padding: 13px 14px;
  margin: 8px 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  min-height: 48px;
}
button:disabled { opacity: 0.55; }
button.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
button.danger { color: var(--risk); border-color: var(--risk); }
button.small { width: auto; display: inline-block; min-height: 36px; padding: 6px 12px; font-size: 14px; }
button.back { width: auto; margin: 0; padding: 8px 10px; border: none; background: none; color: var(--ink); min-height: 40px; }
button.big { font-size: 20px; padding: 18px; }
button.row, .row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  font-weight: 500;
  gap: 2px;
}
.row.static { padding: 10px 4px; border-bottom: 1px solid var(--line); }
.row small { color: var(--muted); font-size: 14px; }
/* Home: the seal in the header, a calm line when nothing waits, the list. */
header.home { gap: 10px; }
.logo { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--seal); color: #f5e6d2;
  font: 700 20px/34px Georgia, serif; text-align: center; }
.calm { color: var(--ok); font-weight: 600; margin: 14px 4px 4px; }
.h2row { display: flex; align-items: center; gap: 8px; }
.h2row h2 { margin-right: 0; }
.count { background: var(--line); color: var(--ink); border-radius: 10px; padding: 1px 8px; font-size: 13px; font-weight: 700; margin-top: 10px; }
input.search { width: 100%; margin: 2px 0 8px; -webkit-appearance: none; appearance: none; }
.list button.row { margin: 6px 0; }
button.row.secret { flex-direction: row; align-items: center; gap: 12px; padding: 10px 12px; }
.badge { flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.rowtext { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rowtext > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The bar at the bottom of the main screens. */
nav.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; display: flex; justify-content: center;
  background: rgba(255, 255, 255, 0.96); border-top: 1px solid var(--line);
  padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
button.tab { flex: 1; max-width: 128px; width: auto; margin: 0; padding: 6px 0 4px; min-height: 54px; border: none; border-radius: 10px;
  background: none; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: var(--muted); }
button.tab.on { color: var(--ink); }
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Form helpers: a text-like button, the password tools, a file chooser. */
button.link { width: auto; background: none; border: none; padding: 8px 2px; margin: 4px 0; min-height: 40px;
  color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; text-align: left; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 10px; }
.tools button { margin: 0; }
label.filepick { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0; padding: 13px 14px;
  min-height: 48px; border: 1px dashed #c9bfa9; border-radius: 12px; background: #fff; color: var(--ink); font-weight: 600; }
label.filepick input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
textarea { width: 100%; }
.effect { font-weight: 700; padding: 6px 10px; border-radius: 8px; }
.effect.read { background: #e8f2ec; color: var(--ok); }
.effect.change { background: var(--risk-bg); color: var(--risk); }
.who { font-size: 18px; }
.details { background: #f7f5f0; border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
/* Text an AI wrote stays inside its own box: stacked accent marks or very
   long words cannot paint over the lines around them (review SA-3). */
.who, .reason, .details, .effect { overflow: hidden; overflow-wrap: anywhere; }
.card.ask { overflow: hidden; }
.mono { overflow-wrap: anywhere; }
.details small { display: block; margin-top: 6px; color: var(--muted); }
button.news { background: var(--warn-bg); border-color: #e7c66a; position: sticky; top: 4px; z-index: 5; }
.reason { border-left: 3px solid var(--line); padding-left: 10px; margin: 8px 0; }
.reason small { color: var(--muted); }
.reason p { font-style: italic; }
.code { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.code .group { display: flex; flex-direction: column; align-items: center; font: 600 22px ui-monospace, Menlo, monospace; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 0; letter-spacing: 2px; }
.code .group small { font: 11px -apple-system, sans-serif; color: var(--muted); letter-spacing: 0; }
.seal { width: 96px; height: 96px; border-radius: 50%; background: var(--seal); color: #f5e6d2; font: 700 52px/96px Georgia, serif; margin: 16px auto; }
.reveal .field { border-bottom: 1px solid var(--line); padding: 8px 0; }
.reveal .field small { color: var(--muted); display: block; }
.sub { margin-left: 32px; }
.toast {
  position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom));
  background: var(--ink); color: #fff; padding: 14px; border-radius: 12px; z-index: 10;
  max-width: 616px; margin: 0 auto; box-shadow: 0 4px 18px rgba(0,0,0,.25);
}
.toast.bad { background: var(--risk); }
ol { padding-left: 22px; }
