:root {
  --bg: #f4f5f7; --card: #ffffff; --text: #16181d; --muted: #5d6470; --line: #d9dde3;
  --accent: #1f5fd6; --accent-text: #ffffff; --danger: #b42318; --notice: #fff6db; --focus: #1f5fd6;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --card: #181b21; --text: #e8eaee; --muted: #9aa1ad; --line: #2b3039;
    --accent: #5b8def; --accent-text: #0b0d10; --danger: #f97066; --notice: #3a3220; --focus: #8fb2f5;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Hiragino Sans", sans-serif;
}
main { max-width: 760px; margin: 0 auto; padding: 0 16px 48px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; }
.brand { font-size: 1.05rem; letter-spacing: .02em; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; max-width: 440px; margin: 0 auto; }
.card.wide { max-width: none; }
h1 { font-size: 1.3rem; margin: 0 0 16px; }
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 4px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > input, .row > textarea { flex: 1 1 200px; min-width: 0; }
.row.end { justify-content: flex-end; margin-top: 8px; }
.btns { display: flex; gap: 6px; flex-wrap: wrap; }
input, textarea {
  font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; width: 100%;
}
textarea { resize: vertical; }
input:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button { font: inherit; border-radius: 8px; padding: 10px 14px; cursor: pointer; border: 1px solid var(--line); background: transparent; color: inherit; }
button:disabled { opacity: .6; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
form.card > button.primary, section.card > button.primary { width: 100%; margin-top: 8px; }
button.danger { color: var(--danger); border-color: var(--danger); margin-right: auto; }
button.link { border: 0; padding: 0; color: var(--accent); text-decoration: underline; }
.switch { text-align: center; margin: 16px 0 0; }
.muted { color: var(--muted); font-size: .92rem; }
.notice { background: var(--notice); border-radius: 8px; padding: 8px 12px; }
.error { color: var(--danger); margin: 0 0 8px; }
.check { display: flex; gap: 10px; align-items: center; margin: 12px 0; }
.check input { width: auto; }
.recovery {
  display: block; font: 600 1.05rem/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 12px; word-break: break-all; user-select: all;
}
.items { list-style: none; margin: 8px 0 0; padding: 0; }
.items li + li { border-top: 1px solid var(--line); }
.item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; border: 0; border-radius: 0; padding: 12px 4px; text-align: left; }
.item:hover { background: var(--bg); }
.item .title { font-weight: 600; }
.item .sub { color: var(--muted); font-size: .9rem; word-break: break-all; }
button.full { width: 100%; margin-top: 8px; }
.pk { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 4px; }
.pk button.danger { margin-right: 0; }
.actions { flex-wrap: wrap; justify-content: flex-end; }
.brand { white-space: nowrap; }
@media (max-width: 480px) {
  .bar button { padding: 8px 10px; font-size: .9rem; }
  .actions { gap: 6px; }
}
h2 { font-size: 1.05rem; margin: 0 0 8px; }
h3 { font-size: .95rem; margin: 20px 0 8px; }
.section { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 16px; }
.dev { display: flex; flex-direction: column; min-width: 0; }
.dev .sub { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.pk .sub { display: block; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.tag { align-self: flex-start; font-size: .78rem; background: var(--notice); border-radius: 6px; padding: 1px 6px; margin: 2px 0; }
.pk button { white-space: nowrap; flex: none; }
select {
  font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 10px; max-width: 100%;
}
.row > select { flex: 1 1 200px; min-width: 0; }
select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tag.ok { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.tag.leak { background: var(--danger); color: var(--card); font-weight: 600; }
.dev .btns { margin-top: 6px; }
.dev strong { overflow-wrap: anywhere; }
/* sharing (v0.8): the fingerprint is read aloud, so keep its digit groups together and large */
.fp { font-variant-numeric: tabular-nums; }
/* read aloud group by group: wrap only between the five-digit groups */
[data-testid="my-fingerprint"], [data-testid="member-fingerprint"] { font-size: 1.15rem; letter-spacing: .04em; word-spacing: .3em; word-break: normal; overflow-wrap: normal; }
.confirm-fp { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 12px; background: var(--bg); }
.add-member h3 { margin-top: 16px; }
.totp { display: flex; align-items: center; gap: 10px; margin: -6px 0 14px; flex-wrap: wrap; }
.totp[hidden] { display: none; }
.totp-code { font: 600 1.4rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.compare { max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; }
.compare h1 { font-size: 1.5rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line, #ddd); border-radius: 8px; }
.compare table { border-collapse: collapse; min-width: 900px; font-size: .9rem; }
.compare th, .compare td { padding: 8px 10px; border-bottom: 1px solid var(--line, #e5e7eb); text-align: left; vertical-align: top; }
.compare thead th { position: sticky; top: 0; background: var(--bg, #f3f4f6); }
.compare tbody th { position: sticky; left: 0; background: var(--card); min-width: 150px; }
.compare tr.us th { background: linear-gradient(rgba(37, 99, 235, .1), rgba(37, 99, 235, .1)), var(--card); }
.compare tr.us th, .compare tr.us td { background: rgba(37, 99, 235, .1); }
.compare small { color: var(--muted, #6b7280); }
.compare .v-yes { color: #15803d; }
.compare .v-no { color: #dc2626; }
.compare .v-unconfirmed { color: var(--muted, #6b7280); }
.compare .v-planned, .compare .v-limited, .compare .v-paid { color: #b45309; }
