/* PingWill design system — no build step, no external assets. */

:root {
  color-scheme: light;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: Georgia, "Times New Roman", "Songti SC", "Noto Serif SC", serif;
  --bg: #f5f1e9;
  --bg-deep: #efe9dd;
  --surface: #fffdf8;
  --surface-2: #faf6ee;
  --surface-3: #f2ece0;
  --ink: #1e2722;
  --ink-soft: #354039;
  --muted: #6f6a60;
  --muted-2: #918a7d;
  --line: #e5ddcf;
  --line-strong: #d5c9b6;
  --ok: #2f6b4f;
  --ok-soft: #e3f1e9;
  --warn: #9a5b06;
  --warn-soft: #fbefcf;
  --danger: #a32a1e;
  --danger-soft: #f9e3df;
  --info: #2f5f8f;
  --info-soft: #e4eef7;
  --accent: #b45309;
  --accent-strong: #8f3f06;
  --accent-soft: #f8e8d2;
  --accent-ink: #ffffff;
  --shadow-sm: 0 1px 2px rgba(40, 33, 22, .06), 0 6px 16px rgba(40, 33, 22, .04);
  --shadow: 0 2px 4px rgba(40, 33, 22, .05), 0 18px 40px rgba(40, 33, 22, .08);
  --shadow-lg: 0 30px 70px rgba(40, 33, 22, .14);
  --radius: 16px;
  --radius-lg: 24px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101613;
  --bg-deep: #0b100d;
  --surface: #161f1a;
  --surface-2: #1a251f;
  --surface-3: #202d26;
  --ink: #edf1e9;
  --ink-soft: #d6ddd2;
  --muted: #a3a89c;
  --muted-2: #82887c;
  --line: #2a352e;
  --line-strong: #3a4a40;
  --ok: #85c8a4;
  --ok-soft: #172a20;
  --warn: #ecc27b;
  --warn-soft: #2a2316;
  --danger: #f0978a;
  --danger-soft: #2d1a17;
  --info: #96bde8;
  --info-soft: #16232f;
  --accent: #e8b06a;
  --accent-strong: #f3c98d;
  --accent-soft: #2b2116;
  --accent-ink: #1a1208;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 16px rgba(0, 0, 0, .18);
  --shadow: 0 2px 4px rgba(0, 0, 0, .25), 0 18px 40px rgba(0, 0, 0, .3);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, .45);
}

@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    color-scheme: dark;
    --bg: #101613;
    --bg-deep: #0b100d;
    --surface: #161f1a;
    --surface-2: #1a251f;
    --surface-3: #202d26;
    --ink: #edf1e9;
    --ink-soft: #d6ddd2;
    --muted: #a3a89c;
    --muted-2: #82887c;
    --line: #2a352e;
    --line-strong: #3a4a40;
    --ok: #85c8a4;
    --ok-soft: #172a20;
    --warn: #ecc27b;
    --warn-soft: #2a2316;
    --danger: #f0978a;
    --danger-soft: #2d1a17;
    --info: #96bde8;
    --info-soft: #16232f;
    --accent: #e8b06a;
    --accent-strong: #f3c98d;
    --accent-soft: #2b2116;
    --accent-ink: #1a1208;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 16px rgba(0, 0, 0, .18);
    --shadow: 0 2px 4px rgba(0, 0, 0, .25), 0 18px 40px rgba(0, 0, 0, .3);
    --shadow-lg: 0 30px 70px rgba(0, 0, 0, .45);
  }
}

[data-accent="sage"] { --accent: #3f6f5a; --accent-strong: #2f5a47; --accent-soft: #e7f0ea; --accent-ink: #fff; }
[data-accent="indigo"] { --accent: #4453a6; --accent-strong: #34418c; --accent-soft: #e9ebf9; --accent-ink: #fff; }
[data-theme="dark"][data-accent="sage"] { --accent: #86bfa2; --accent-strong: #a3d4b9; --accent-soft: #182720; --accent-ink: #0d1a14; }
[data-theme="dark"][data-accent="indigo"] { --accent: #9aa8f5; --accent-strong: #b6c0fb; --accent-soft: #1b1e33; --accent-ink: #0e1124; }
@media (prefers-color-scheme: dark) {
  [data-theme="system"][data-accent="sage"] { --accent: #86bfa2; --accent-strong: #a3d4b9; --accent-soft: #182720; --accent-ink: #0d1a14; }
  [data-theme="system"][data-accent="indigo"] { --accent: #9aa8f5; --accent-strong: #b6c0fb; --accent-soft: #1b1e33; --accent-ink: #0e1124; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 85% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    radial-gradient(700px 420px at -10% 20%, color-mix(in srgb, var(--info) 6%, transparent), transparent 70%);
}
body.public { background: var(--bg); }
img, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-strong); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.16; letter-spacing: -.02em; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0; padding: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
hr.divider { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.icon { display: block; flex: none; }

.container { width: min(1160px, calc(100% - 48px)); margin: 0 auto; }
.container.narrow { width: min(820px, calc(100% - 48px)); }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: var(--ink-soft); line-height: 1.7; }
.center { text-align: center; justify-content: center; }
.grow { flex: 1; min-width: 0; }
.text-danger { color: var(--danger); }
.text-ok { color: var(--ok); }
.skip-link {
  position: fixed; top: -100px; left: 16px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: 0 1.05rem; border-radius: 11px;
  border: 1px solid transparent; background: transparent; color: var(--ink);
  font-weight: 600; font-size: .93rem; line-height: 1; text-align: center;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s, border-color .18s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 25%, transparent); }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
.btn-outline { border-color: var(--line-strong); background: var(--surface); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn-ghost { color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.94); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 .8rem; font-size: .84rem; border-radius: 9px; }
.btn-lg { min-height: 52px; padding: 0 1.5rem; font-size: 1rem; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--ink-soft);
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn.danger { color: var(--danger); }
.icon-btn.danger:hover { background: var(--danger-soft); }
.text-link { color: var(--accent-strong); font-weight: 600; display: inline-flex; align-items: center; gap: .3rem; }
.text-link:hover { text-decoration: underline; }

/* Badges & pills */
.badge {
  display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .62rem;
  border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .01em;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.badge-muted { background: var(--surface-3); color: var(--muted); border-color: var(--line); }
.badge-accent { background: var(--accent-soft); color: var(--accent-strong); border-color: color-mix(in srgb, var(--accent) 24%, transparent); }
.pill {
  display: inline-flex; align-items: center; gap: .45rem; padding: .42rem .8rem;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-soft); font-size: .8rem; font-weight: 600; box-shadow: var(--shadow-sm);
}
.pill .icon { color: var(--accent-strong); }
.eyebrow { display: inline-block; font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-strong); margin-bottom: .9rem; }

/* Cards, forms */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.card.soft { background: var(--surface-2); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.18rem; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .42rem; font-size: .88rem; font-weight: 600; color: var(--ink-soft); }
.field > span:first-child { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.field em { font-style: normal; color: var(--muted-2); font-weight: 500; font-size: .78rem; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); padding: .78rem .9rem; font-size: .95rem; font-weight: 400;
  transition: border-color .16s, box-shadow .16s; min-height: 46px;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.65; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input { padding-right: 2.8rem; }
.input-action {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
}
.input-action:hover { background: var(--surface-3); color: var(--ink); }
.input-action.is-revealed { color: var(--accent-strong); }
.hint { color: var(--muted); font-size: .78rem; font-weight: 400; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.checkbox { display: inline-flex; align-items: flex-start; gap: .55rem; font-size: .86rem; font-weight: 500; color: var(--ink-soft); line-height: 1.5; }
.checkbox input { width: 18px; height: 18px; margin-top: .1rem; accent-color: var(--accent); flex: none; }
.checkbox-block { padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.form-error, .form-notice {
  display: flex; align-items: flex-start; gap: .5rem; padding: .8rem .9rem; border-radius: 10px;
  font-size: .85rem; line-height: 1.5; margin-bottom: 1rem;
}
.form-error { background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); }
.form-notice { background: var(--info-soft); color: var(--info); border: 1px solid color-mix(in srgb, var(--info) 22%, transparent); }
.strength { display: flex; gap: 4px; margin-top: .35rem; }
.strength span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); transition: background .2s; }
.strength[data-level="1"] span:nth-child(-n+1),
.strength[data-level="2"] span:nth-child(-n+2) { background: var(--danger); }
.strength[data-level="3"] span:nth-child(-n+3) { background: var(--warn); }
.strength[data-level="4"] span:nth-child(-n+4),
.strength[data-level="5"] span:nth-child(-n+5) { background: var(--ok); }
.hint-box { display: flex; align-items: flex-start; gap: .45rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; font-size: .8rem; color: var(--muted); line-height: 1.55; }
.info-note { display: flex; gap: .5rem; align-items: flex-start; font-size: .8rem; color: var(--muted); }
.button-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.range-row { display: flex; align-items: center; gap: .9rem; }
.range-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.range-row output { min-width: 92px; text-align: right; font-weight: 700; color: var(--accent-strong); font-size: .85rem; }

/* Toasts */
.toast-container { position: fixed; right: 20px; bottom: 24px; z-index: 90; display: flex; flex-direction: column; gap: .6rem; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: .7rem; padding: .85rem 1rem;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: 12px; box-shadow: var(--shadow);
  font-size: .86rem; animation: toast-in .32s var(--ease);
}
.toast-success { border-left-color: var(--ok); }
.toast-error { border-left-color: var(--danger); }
.toast-info { border-left-color: var(--info); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
.toast-close { margin-left: auto; border: 0; background: transparent; color: var(--muted); padding: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Header / footer */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; letter-spacing: -.02em; font-size: 1.08rem; color: var(--ink); }
.brand-mark { display: inline-flex; color: var(--accent-strong); }
.brand-name { font-family: var(--font-display); font-size: 1.22rem; }
.brand em { font-style: normal; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.site-nav { display: flex; align-items: center; gap: 1.4rem; font-size: .89rem; font-weight: 600; color: var(--ink-soft); }
.site-nav a:hover { color: var(--accent-strong); }
.header-actions { display: flex; align-items: center; gap: .3rem; }
.popover { position: relative; }
.popover > summary { list-style: none; cursor: pointer; }
.popover > summary::-webkit-details-marker { display: none; }
.popover-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 150px; padding: .4rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.popover-item { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem .6rem; border-radius: 8px; font-size: .86rem; font-weight: 600; }
.popover-item:hover, .popover-item.is-active { background: var(--surface-3); }
.lang-switch[open] .icon-btn { background: var(--surface-3); }
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline-flex; }
@media (prefers-color-scheme: dark) {
  [data-theme="system"] .theme-icon-light { display: none; }
  [data-theme="system"] .theme-icon-dark { display: inline-flex; }
}
.nav-toggle { display: none; }
.mobile-nav { display: none; }
.site-footer { margin-top: 5rem; padding: 3.5rem 0 2rem; border-top: 1px solid var(--line); background: var(--surface-2); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem; }
.footer-brand p { max-width: 34ch; color: var(--muted); font-size: .87rem; margin-top: 1rem; }
.footer-grid h4 { font-family: var(--font-body); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); margin-bottom: .9rem; }
.footer-grid a { display: block; padding: .22rem 0; font-size: .87rem; color: var(--ink-soft); }
.footer-grid a:hover { color: var(--accent-strong); }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1.4rem; font-size: .78rem; color: var(--muted); flex-wrap: wrap; }

/* Marketing */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 7vw, 6.5rem) 0 clamp(3rem, 6vw, 5rem); }
.hero-glow {
  position: absolute; inset: -20% -10% auto auto; width: 760px; height: 760px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%);
  filter: blur(10px); pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; position: relative; }
.hero-copy h1 { margin-top: 1.2rem; font-size: clamp(2.6rem, 5vw, 4.3rem); line-height: 1.04; letter-spacing: -.035em; }
.hero-copy h1 em { font-style: italic; color: var(--accent-strong); }
.hero-copy .lead { max-width: 52ch; margin: 1.5rem 0 2rem; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }
.trust-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: .65rem 1.4rem; margin-top: 2rem; font-size: .83rem; color: var(--muted); }
.trust-list li { display: flex; align-items: flex-start; gap: .5rem; }
.trust-list .icon { color: var(--ok); margin-top: .15rem; }
.hero-visual { position: relative; display: flex; justify-content: center; }
.vault-card {
  width: min(420px, 100%); background: linear-gradient(155deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow-lg);
  transform: rotate(-1.2deg); overflow: hidden;
}
.vault-card-head { display: flex; align-items: center; gap: .55rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.vault-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); animation: pulse 2.6s infinite; }
.vault-label { font-size: .68rem; letter-spacing: .14em; font-weight: 800; color: var(--muted); }
.vault-card-head .badge { margin-left: auto; }
.vault-card-body { padding: 1.3rem 1.3rem 1rem; display: flex; flex-direction: column; gap: 1rem; }
.vault-row { display: flex; align-items: center; gap: .8rem; }
.vault-row > div { display: flex; flex-direction: column; line-height: 1.35; }
.vault-row strong { font-size: 1.02rem; }
.vault-icon { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); }
.mini-timeline { display: flex; gap: .4rem; margin-top: .6rem; }
.mini-timeline span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.mini-timeline span.done { background: color-mix(in srgb, var(--accent) 65%, var(--line)); }
.vault-card-foot { display: flex; align-items: center; gap: .4rem; padding: .85rem 1.2rem; border-top: 1px solid var(--line); font-size: .72rem; color: var(--muted); background: var(--surface-2); }
.hero-stamp {
  position: absolute; right: -8px; bottom: -18px; width: 112px; height: 112px; border-radius: 50%;
  background: var(--surface); border: 1px dashed var(--line-strong); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; text-align: center;
  color: var(--accent-strong); transform: rotate(7deg);
}
.hero-stamp small { font-size: .56rem; letter-spacing: .14em; font-weight: 800; line-height: 1.4; color: var(--muted); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); } 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--ok) 8%, transparent); } }

.section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section-head { max-width: 720px; margin-bottom: 2.5rem; }
.section-head.align-center { text-align: center; margin-left: auto; margin-right: auto; }
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); }
.section-head p { color: var(--muted); max-width: 62ch; margin: .9rem auto 0; }
.how-section { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.step-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem 1.3rem; box-shadow: var(--shadow-sm); }
.step-index { position: absolute; top: 1rem; right: 1.1rem; font-family: var(--font-display); font-size: 1.5rem; color: var(--line-strong); }
.step-icon { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 13px; background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 1rem; }
.step-card h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.step-card p { color: var(--muted); font-size: .86rem; margin: 0; }
.security-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.security-copy h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
.check-list { list-style: none; display: flex; flex-direction: column; gap: .7rem; margin: 1.6rem 0; font-size: .9rem; }
.check-list li { display: flex; gap: .6rem; align-items: flex-start; }
.check-list .icon { color: var(--ok); margin-top: .15rem; }
.security-visual { display: flex; justify-content: center; }
.diagram-card { width: 100%; max-width: 430px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow); }
.diagram-node { display: flex; flex-direction: column; gap: .2rem; padding: 1rem; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.diagram-node.server { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.diagram-node .node-icon { color: var(--accent-strong); margin-bottom: .3rem; }
.diagram-node code { font-size: .76rem; color: var(--muted); }
.diagram-link { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .6rem 0; }
.diagram-caption { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); font-weight: 700; }
.wire { width: 2px; height: 34px; background: repeating-linear-gradient(to bottom, var(--line-strong) 0 5px, transparent 5px 10px); }
.diagram-note { font-size: .76rem; color: var(--muted); margin: .9rem 0 0; text-align: center; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.feature-card { padding: 1.4rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.feature-icon { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 11px; background: var(--surface-3); color: var(--accent-strong); margin-bottom: .9rem; }
.feature-card h3 { font-family: var(--font-body); font-size: .98rem; margin-bottom: .35rem; }
.feature-card p { color: var(--muted); font-size: .85rem; margin: 0; }
.plans-section { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; align-items: stretch; }
.plan-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.6rem; box-shadow: var(--shadow-sm); }
.plan-card.is-featured { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); }
.plan-ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: .3rem .75rem; border-radius: 999px; white-space: nowrap; }
.plan-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.plan-top h3 { margin: 0; font-size: 1.3rem; }
.plan-tag { font-size: .7rem; color: var(--muted); font-weight: 700; }
.plan-price { display: flex; align-items: baseline; gap: .3rem; margin: 1rem 0 .2rem; }
.plan-price strong { font-family: var(--font-display); font-size: 2.3rem; letter-spacing: -.03em; }
.plan-price span { font-size: .8rem; color: var(--muted); }
.plan-desc { font-size: .85rem; color: var(--muted); min-height: 2.6em; }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: .45rem; margin: 1rem 0 1.4rem; font-size: .84rem; flex: 1; }
.plan-features li { display: flex; gap: .5rem; align-items: flex-start; }
.plan-features .icon { color: var(--ok); margin-top: .12rem; }
.plans-footnote { display: flex; align-items: flex-start; gap: .45rem; justify-content: center; margin: 1.5rem auto 0; max-width: 720px; font-size: .78rem; color: var(--muted); text-align: left; }
.faq-list { display: flex; flex-direction: column; gap: .65rem; }
.faq-item { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0 1.1rem; }
.faq-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.05rem 0; font-weight: 700; font-size: .94rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p { color: var(--muted); font-size: .88rem; padding-bottom: 1.05rem; margin: 0; max-width: 68ch; }
.faq-plus { transition: transform .2s; color: var(--muted); }
.faq-item[open] .faq-plus { transform: rotate(45deg); }
.cta-band { padding: 0 0 5rem; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: clamp(2rem, 4vw, 3rem); border-radius: var(--radius-lg); background: linear-gradient(120deg, var(--ink), #2f4037); color: #f6f3eb; border: 1px solid #3a4a40; }
.cta-inner h2 { color: #f8f5ed; font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: .4rem; }
.cta-inner p { color: #c9c9bd; margin: 0; }
.cta-inner .btn-primary { box-shadow: none; }
.page-title { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 1rem; }
.prose h2 { font-size: 1.35rem; margin-top: 2rem; }
.prose p { color: var(--ink-soft); }
.prose .muted { color: var(--muted); }
.callout { display: flex; gap: .7rem; padding: 1rem 1.1rem; background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent); border-radius: 12px; color: var(--warn); font-size: .85rem; margin-top: 2rem; }
.info-panel { display: flex; gap: .9rem; align-items: flex-start; padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-top: 2rem; }
.info-panel .icon { color: var(--accent-strong); margin-top: .15rem; }
.info-panel p { margin: .25rem 0 0; font-size: .85rem; }
.info-panel.compact { margin: 0; }
.security-list { display: flex; flex-direction: column; gap: 1.2rem; margin-top: 2.5rem; }
.security-item { display: flex; gap: 1rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.security-number { font-family: var(--font-display); color: var(--accent-strong); font-size: 1.2rem; min-width: 2.2rem; }
.security-item h2 { font-family: var(--font-body); font-size: 1rem; margin-bottom: .25rem; }
.security-item p { color: var(--muted); font-size: .88rem; margin: 0; }
.status-banner { display: flex; gap: .9rem; align-items: flex-start; padding: 1.1rem 1.2rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); margin: 1.5rem 0; }
.status-banner.is-ok { border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: var(--ok-soft); }
.status-banner.is-warn { border-color: color-mix(in srgb, var(--warn) 30%, transparent); background: var(--warn-soft); }
.status-dot { width: 10px; height: 10px; margin-top: .45rem; border-radius: 50%; background: var(--ok); }
.status-banner.is-warn .status-dot { background: var(--warn); }
.status-banner p { margin: .2rem 0 0; font-size: .85rem; color: var(--muted); }

/* Auth */
.auth-page { background: var(--bg); }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; padding: clamp(2.5rem, 6vw, 5rem) 0; }
.auth-aside { position: relative; border-radius: var(--radius-lg); padding: clamp(2rem, 4vw, 3.5rem); background: linear-gradient(160deg, #203129, #2c4239 60%, #3b5245); color: #eef1e8; overflow: hidden; min-height: 560px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow); }
.auth-aside::after { content: ""; position: absolute; width: 380px; height: 380px; right: -160px; bottom: -160px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 0 0 40px rgba(255,255,255,.03), 0 0 0 80px rgba(255,255,255,.02); }
.auth-aside .pill { background: rgba(255,255,255,.08); color: #f0e8d7; border-color: rgba(255,255,255,.14); box-shadow: none; }
.auth-aside h2 { color: #f7f3e9; font-size: clamp(1.9rem, 3vw, 2.6rem); margin-top: 1.4rem; }
.auth-aside h2 em { color: #e7b878; font-style: italic; }
.auth-aside p { color: #c6ccc1; }
.auth-aside .trust-list { color: #c6ccc1; }
.auth-aside .trust-list .icon { color: #9fd0b1; }
.auth-aside-foot { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; color: #d7dbd0; margin-top: 2rem; }
.auth-card { width: 100%; max-width: 470px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.7rem, 3vw, 2.4rem); box-shadow: var(--shadow); }
.auth-card h1 { font-size: clamp(1.7rem, 2.6vw, 2.2rem); margin-bottom: .4rem; }
.auth-card > .muted { margin-bottom: 1.5rem; font-size: .88rem; }
.auth-narrow { max-width: 520px; padding: 4rem 0; }
.auth-switch { margin: 1.3rem 0 0; font-size: .86rem; color: var(--muted); text-align: center; }
.auth-switch a { color: var(--accent-strong); font-weight: 700; }
.auth-legal { display: flex; align-items: flex-start; gap: .4rem; justify-content: center; margin: 1.2rem 0 0; font-size: .72rem; color: var(--muted-2); text-align: center; }
.centered-card { max-width: 560px; margin: clamp(2.5rem, 8vw, 6rem) auto; text-align: center; }
.centered-card .hero-actions { justify-content: center; margin-top: 1.5rem; }
.auth-success-icon { display: inline-flex; width: 58px; height: 58px; align-items: center; justify-content: center; border-radius: 18px; background: var(--ok-soft); color: var(--ok); margin-bottom: 1.2rem; }
.auth-success-icon.is-warn { background: var(--warn-soft); color: var(--warn); }
.error-code { display: block; font-family: var(--font-display); font-size: 4rem; color: var(--line-strong); line-height: 1; margin-bottom: 1rem; }

/* App shell */
.app { background: var(--bg); }
.app-layout { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; align-self: start; height: 100vh; display: flex; flex-direction: column; gap: 1.4rem; padding: 1.5rem 1.1rem; background: var(--surface-2); border-right: 1px solid var(--line); }
.side-nav { display: flex; flex-direction: column; gap: .25rem; }
.side-link { display: flex; align-items: center; gap: .7rem; padding: .7rem .75rem; border-radius: 10px; font-size: .89rem; font-weight: 600; color: var(--ink-soft); }
.side-link:hover { background: var(--surface-3); color: var(--ink); }
.side-link.is-active { background: var(--surface); color: var(--accent-strong); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.sidebar-card { margin-top: auto; padding: .9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sidebar-card p { margin: .5rem 0 0; }
.sidebar-user { display: flex; align-items: center; gap: .6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.sidebar-user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sidebar-user-meta strong, .sidebar-user-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-weight: 800; flex: none; }
.avatar-sm { width: 30px; height: 30px; font-size: .78rem; }
.avatar-muted { background: var(--surface-3); color: var(--muted); }
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem clamp(1.2rem, 3vw, 2.4rem); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.app-topbar-title h1 { font-size: 1.25rem; margin: .1rem 0 0; }
.app-topbar-title .small { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.app-topbar-actions { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.app-content { width: min(1080px, 100%); margin: 0 auto; padding: clamp(1.2rem, 3vw, 2.2rem) clamp(1.1rem, 3vw, 2.4rem) 4rem; }
.mobile-tabs { display: none; }
.mobile-settings-link { display: none; }
.greeting { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0 0 .2rem; }
.dashboard-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.dashboard-head p { margin: 0; font-size: .88rem; }
.page-intro { max-width: 70ch; margin-bottom: 1.4rem; font-size: .9rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }

.status-hero { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: clamp(1.4rem, 3vw, 2.2rem); border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.status-hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--accent); }
.status-hero.status-ok::before { background: var(--ok); }
.status-hero.status-warn::before { background: var(--warn); }
.status-hero.status-danger::before { background: var(--danger); }
.status-hero.status-info::before { background: var(--info); }
.status-hero.status-muted::before { background: var(--muted-2); }
.status-copy { min-width: 0; }
.status-topline { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem; }
.status-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem; border-radius: 999px; background: var(--surface-3); font-size: .78rem; font-weight: 700; color: var(--ink-soft); }
.status-ok .status-pill { background: var(--ok-soft); color: var(--ok); }
.status-warn .status-pill { background: var(--warn-soft); color: var(--warn); }
.status-danger .status-pill { background: var(--danger-soft); color: var(--danger); }
.status-info .status-pill { background: var(--info-soft); color: var(--info); }
.status-hero h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: .4rem; }
.status-hero p { color: var(--muted); max-width: 60ch; font-size: .88rem; margin-bottom: 1rem; }
.status-deadline { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.2rem; font-size: .85rem; color: var(--muted); }
.status-deadline strong { font-size: 1.02rem; color: var(--ink); }
.status-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.status-actions form { margin: 0; }
.status-ring { --p: 40%; width: 132px; height: 132px; border-radius: 50%; flex: none; background: conic-gradient(var(--accent) var(--p), var(--surface-3) 0); display: grid; place-items: center; position: relative; }
.status-ring::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface); }
.status-ring-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem; text-align: center; }
.status-ring-inner strong { font-family: var(--font-display); font-size: 1.5rem; }
.status-ring-inner .small { font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; }
.journey { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin: 1rem 0 1.4rem; }
.journey-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: .45rem; padding-top: .9rem; text-align: center; }
.journey-step::before { content: ""; position: absolute; top: 18px; left: 0; right: 0; height: 2px; background: var(--line); z-index: 0; }
.journey-step:first-child::before { left: 50%; }
.journey-step:last-child::before { right: 50%; }
.journey-dot { position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.journey-step.is-done .journey-dot { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); color: var(--accent-strong); }
.journey-step.is-current .journey-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.journey-step.is-done::before { background: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.journey-label { font-size: .72rem; color: var(--muted); font-weight: 600; }
.journey-step.is-current .journey-label { color: var(--ink); }

.dashboard-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 1rem; }
.dashboard-grid .span-2 { grid-column: span 2; }
.envelope-preview-grid { display: flex; flex-direction: column; gap: .6rem; }
.envelope-preview { display: flex; gap: .8rem; align-items: center; padding: .75rem; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface-2); }
.envelope-preview > div { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.envelope-preview strong { font-size: .88rem; }
.envelope-preview .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.envelope-seal { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); flex: none; }
.checklist { list-style: none; display: flex; flex-direction: column; gap: .55rem; margin-bottom: 1rem; }
.checklist li { display: flex; align-items: flex-start; gap: .55rem; font-size: .86rem; }
.checklist a:hover { color: var(--accent-strong); }
.checkmark { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface-3); color: var(--muted); flex: none; margin-top: .1rem; }
.checklist li.is-done .checkmark { background: var(--ok-soft); color: var(--ok); }
.checklist li.is-done a { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.people-list { list-style: none; display: flex; flex-direction: column; gap: .7rem; }
.people-list li { display: flex; align-items: center; gap: .6rem; }
.people-list li > div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.people-list li .badge { font-size: .64rem; }
.people-meta { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted); }
.people-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.activity-list { list-style: none; display: flex; flex-direction: column; gap: .8rem; }
.activity-list li { display: flex; align-items: flex-start; gap: .65rem; }
.activity-list li > div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.activity-list strong { font-size: .85rem; font-weight: 600; }
.activity-list time { flex: none; }
.activity-icon { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 8px; background: var(--surface-3); color: var(--muted); flex: none; }
.activity-state { background: var(--info-soft); color: var(--info); }
.activity-opened { background: var(--ok-soft); color: var(--ok); }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.quick-action { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.quick-action:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.quick-action div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.quick-action .small { font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-icon { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 12px; background: var(--surface-3); color: var(--accent-strong); flex: none; }
.quick-warn { background: var(--warn-soft); color: var(--warn); }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); margin-bottom: 1rem; font-size: .85rem; flex-wrap: wrap; }
.banner > span { display: flex; align-items: center; gap: .5rem; }
.banner-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }
.banner-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 22%, transparent); color: var(--info); }
.banner-success { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }
.banner form { margin: 0; }

/* Envelope list / editor */
.usage-row { display: flex; gap: 1.4rem; align-items: center; margin-bottom: 1.2rem; padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); flex-wrap: wrap; }
.usage-item { display: flex; flex-direction: column; gap: .2rem; }
.usage-item strong { font-size: .95rem; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: .4rem; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.unlock-panel { margin-bottom: 1rem; }
.unlock-form { display: flex; gap: .6rem; align-items: center; margin-top: .8rem; }
.unlock-panel.is-unlocked { border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); }
.envelope-list { display: flex; flex-direction: column; gap: .7rem; }
.envelope-card { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.envelope-card.is-unlocked { border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); }
.envelope-main { flex: 1; min-width: 0; }
.envelope-main h3 { font-family: var(--font-body); font-size: .95rem; margin: 0 0 .2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.envelope-main p { margin: 0; }
.envelope-actions { display: flex; align-items: center; gap: .4rem; }
.envelope-actions form { margin: 0; }
.editor-layout { display: grid; grid-template-columns: 1.6fr .9fr; gap: 1rem; align-items: start; }
.editor-card textarea { min-height: 300px; font-size: 1rem; line-height: 1.75; }
.editor-side { display: flex; flex-direction: column; gap: 1rem; }
.editor-side h3 { font-family: var(--font-body); font-size: .95rem; }
.mini-points { list-style: none; display: flex; flex-direction: column; gap: .55rem; font-size: .82rem; color: var(--muted); }
.mini-points li { display: flex; gap: .45rem; align-items: flex-start; }
.mini-points .icon { color: var(--ok); margin-top: .1rem; }
.passphrase-fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; background: var(--surface-2); }
.passphrase-fieldset h3 { font-family: var(--font-body); font-size: .9rem; margin-bottom: .2rem; }
.passphrase-fieldset p { margin-bottom: .8rem; }
.seal-status { display: flex; align-items: center; gap: .6rem; font-size: .82rem; color: var(--accent-strong); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 1rem; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(12, 16, 14, .55); backdrop-filter: blur(3px); }
.modal-card { position: relative; width: min(680px, 100%); max-height: 85vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 1.15rem; }
.modal-foot { display: flex; justify-content: space-between; gap: .6rem; padding: 1rem 1.4rem; border-top: 1px solid var(--line); background: var(--surface-2); }
.letter-body { padding: 1.5rem 1.4rem; overflow: auto; white-space: pre-wrap; line-height: 1.75; font-size: .95rem; }
body.modal-open { overflow: hidden; }

/* People, settings, plans */
.person-form { display: grid; grid-template-columns: 1fr 1.3fr .8fr auto; gap: .7rem; align-items: end; padding: 1rem; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2); margin-bottom: 1rem; }
.person-form .btn { min-height: 46px; }
.person-list { list-style: none; display: flex; flex-direction: column; gap: .2rem; }
.person-row { display: flex; align-items: center; gap: .8rem; padding: .8rem .2rem; border-bottom: 1px solid var(--line); }
.person-row:last-child { border-bottom: 0; }
.person-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.person-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-actions { display: flex; align-items: center; gap: .4rem; }
.person-actions form { margin: 0; }
.plans-grid.app-plans { grid-template-columns: repeat(3, 1fr); margin: 1rem 0; }
.current-plan-card { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.current-plan-card h2 { margin: 0 0 .2rem; }
.usage-pills { display: flex; gap: .6rem; flex-wrap: wrap; }
.usage-pills span { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .7rem; border-radius: 999px; background: var(--surface-3); font-size: .78rem; font-weight: 600; }
.plan-request-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1.5rem; align-items: start; }
.transfer-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem; }
.transfer-card h3 { font-family: var(--font-body); font-size: .95rem; }
.transfer-row { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .82rem; }
.transfer-row:last-of-type { border-bottom: 0; }
.transfer-row span { color: var(--muted); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.settings-grid .danger-zone { grid-column: span 2; border-color: color-mix(in srgb, var(--danger) 28%, var(--line)); }
.settings-grid .card h3 { font-family: var(--font-body); font-size: .92rem; margin-bottom: .3rem; }
.readonly-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-weight: 500; }
.danger-zone h2 { color: var(--danger); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -.4rem; padding: 0 .4rem; }
.table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.table th { text-align: left; font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted-2); padding: .6rem .7rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .8rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table a:hover { color: var(--accent-strong); }
.table td code { color: var(--muted); word-break: break-all; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }

/* Empty states */
.empty-state { text-align: center; padding: 2.2rem 1rem; border: 1px dashed var(--line-strong); border-radius: 14px; background: var(--surface-2); }
.empty-icon { display: inline-flex; width: 52px; height: 52px; align-items: center; justify-content: center; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--accent-strong); margin-bottom: .9rem; }
.empty-state h3 { font-family: var(--font-body); font-size: 1rem; margin-bottom: .3rem; }
.empty-state p { color: var(--muted); font-size: .85rem; max-width: 46ch; margin: 0 auto 1rem; }

/* Emergency */
.emergency-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1rem; align-items: start; }
.emergency-grid .btn-danger { width: 100%; }

/* Admin */
.admin { background: var(--bg-deep); }
.admin-layout { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.admin-sidebar { background: #151d19; border-right-color: #2a352e; }
.admin-sidebar .brand, .admin-sidebar .side-link { color: #dfe5dc; }
.admin-sidebar .side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-sidebar .side-link.is-active { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.1); color: #f2d3a5; }
.admin-sidebar .sidebar-card { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); }
.admin-sidebar .sidebar-user { border-top-color: rgba(255,255,255,.12); }
.admin-sidebar .muted { color: #8f9a90; }
.admin-sidebar .avatar { background: rgba(255,255,255,.1); color: #f2d3a5; }
.admin-badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-strong); margin-bottom: .8rem; }
.admin-login-card { text-align: left; }
.admin-login-card h1 { text-align: left; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
.stat-card { position: relative; padding: 1.2rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.stat-card span { display: block; font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: .4rem; }
.stat-card strong { font-family: var(--font-display); font-size: 1.9rem; letter-spacing: -.02em; }
.stat-card .icon { position: absolute; top: 1rem; right: 1rem; color: var(--line-strong); }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; align-items: start; }
.admin-grid .span-2 { grid-column: span 2; }
.kv-list { display: flex; flex-direction: column; gap: .55rem; font-size: .82rem; }
.kv-list > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: .55rem; border-bottom: 1px solid var(--line); }
.kv-list > div:last-child { border-bottom: 0; }
.kv-list span { color: var(--muted); flex: none; }
.kv-list strong { text-align: right; word-break: break-word; }
.kv-list.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 2rem; }
.simple-list { list-style: none; display: flex; flex-direction: column; gap: .6rem; font-size: .84rem; }
.simple-list li { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.search-bar { display: flex; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.search-bar .input-wrap { display: flex; align-items: center; gap: .45rem; padding: 0 .8rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); min-height: 46px; }
.search-bar .input-wrap input { border: 0; background: transparent; padding: .5rem 0; width: 100%; outline: none; }
.search-bar .input-wrap .icon { color: var(--muted); }
.profile-banner { display: flex; align-items: center; gap: 1rem; margin: 1rem 0; }
.profile-banner h2 { margin: 0; }
.profile-banner p { margin: .2rem 0 0; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.timeline-list { list-style: none; display: flex; flex-direction: column; gap: .7rem; }
.timeline-list li { display: flex; align-items: flex-start; gap: .7rem; }
.timeline-list li > div { display: flex; flex-direction: column; flex: 1; }
.timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: .45rem; flex: none; }
.dev-mail { width: min(980px, calc(100% - 40px)); margin: 0 auto; padding: 3rem 0; }
.dev-mail h1 { margin-bottom: .3rem; }

/* Minimal / recipient */
.minimal { background: var(--bg); }
.minimal-shell { min-height: 100vh; display: flex; flex-direction: column; }
.minimal-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem clamp(1rem, 4vw, 2.5rem); }
.minimal-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem 3rem; }
.minimal-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem clamp(1rem, 4vw, 2.5rem); border-top: 1px solid var(--line); font-size: .74rem; color: var(--muted); flex-wrap: wrap; }
.recover-card { width: min(620px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.6rem, 4vw, 2.6rem); box-shadow: var(--shadow); }
.recover-mark { display: inline-flex; width: 52px; height: 52px; align-items: center; justify-content: center; border-radius: 15px; background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 1rem; }
.recover-mark.is-ok { background: var(--ok-soft); color: var(--ok); }
.recover-mark.is-warn { background: var(--warn-soft); color: var(--warn); }
.recover-card h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.recover-card > .muted { font-size: .9rem; }
.recover-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); margin: 1.2rem 0; }
.recover-meta div { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.recover-meta strong { font-size: .86rem; word-break: break-word; }
.recover-letters { display: flex; flex-direction: column; gap: 1.2rem; margin-top: 1rem; }
.letter { border: 1px solid var(--line); border-radius: 12px; padding: 1.2rem; background: var(--surface-2); }
.letter h2 { font-size: 1.2rem; margin-bottom: .6rem; }
.letter-text { white-space: pre-wrap; line-height: 1.85; font-size: .95rem; color: var(--ink-soft); font-family: var(--font-display); }
.recover-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.2rem; }
.recover-note { margin-top: 1.2rem; }
.recover-footer { margin: 1.5rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .72rem; color: var(--muted-2); text-align: center; }
.delivery-date { font-family: var(--font-display); font-size: 1.1rem; color: var(--danger); }
.pin-input { text-align: center; letter-spacing: .55em; font-size: 1.5rem !important; font-weight: 700; }
.minimal .auth-card h1 { text-align: center; }
.minimal .auth-success-icon { margin-left: auto; margin-right: auto; }

/* Handover kit */
.handover-page { background: var(--bg); }
.handover-sheet { width: min(1000px, calc(100% - 40px)); margin: 0 auto; padding: 2.5rem 0 4rem; }
.handover-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.handover-head h1 { margin-bottom: .4rem; }
.handover-actions { display: flex; gap: .5rem; }
.handover-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.handover-card { border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); padding: 1.4rem; }
.handover-card-head { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: .8rem; }
.handover-number { font-family: var(--font-display); font-size: 1.3rem; color: var(--accent-strong); }
.handover-card h2 { font-size: 1.1rem; margin: 0 0 .1rem; }
.handover-card p { font-size: .83rem; color: var(--ink-soft); }
.handover-code { padding: .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); margin: .8rem 0; }
.handover-code code { display: block; margin-top: .3rem; font-size: .72rem; word-break: break-all; color: var(--ink-soft); }
.handover-cut { display: flex; align-items: center; gap: .4rem; margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed var(--line-strong); font-size: .72rem; color: var(--muted); }
.handover-security { display: flex; align-items: flex-start; gap: .4rem; margin-top: 1.5rem; }

/* Responsive */
@media (max-width: 1040px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-copy h1 { font-size: clamp(2.3rem, 6vw, 3.4rem); }
  .steps-grid { grid-template-columns: 1fr 1fr; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; }
  .plans-grid.app-plans { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .danger-zone { grid-column: auto; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .site-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .mobile-nav { display: none; }
  .mobile-nav.is-open { display: block; position: fixed; top: 72px; left: 0; right: 0; bottom: 0; z-index: 35; background: var(--bg); border-top: 1px solid var(--line); overflow: auto; }
  .mobile-nav-inner { display: flex; flex-direction: column; gap: .3rem; padding: 1rem 0 3rem; }
  .mobile-nav-inner a { padding: .9rem .4rem; border-bottom: 1px solid var(--line); font-weight: 600; }
  .mobile-nav-inner .btn { margin-top: 1rem; }
  .nav-open { overflow: hidden; }
  body.app .site-header { display: none; }
  .app-layout, .admin-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .app-topbar { padding: .8rem 1rem; }
  .app-topbar-actions .btn-ghost { display: none; }
  .mobile-settings-link { display: inline-flex; }
  .app-content { padding: 1rem 1rem 6rem; }
  .mobile-tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; display: flex; justify-content: space-around; padding: .45rem .3rem calc(.45rem + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .mobile-tab { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .3rem .5rem; border-radius: 9px; font-size: .64rem; color: var(--muted); font-weight: 600; }
  .mobile-tab.is-active { color: var(--accent-strong); background: var(--accent-soft); }
  .dashboard-grid, .dashboard-grid .span-2 { grid-template-columns: 1fr; grid-column: auto; }
  .quick-actions { grid-template-columns: 1fr; }
  .current-plan-card { flex-direction: column; align-items: flex-start; }
  .plan-request-grid, .emergency-grid, .admin-grid, .editor-layout { grid-template-columns: 1fr !important; }
  .admin-grid .span-2, .emergency-grid .span-2 { grid-column: auto; }
  .auth-grid { grid-template-columns: 1fr; }
  .auth-aside { min-height: auto; padding: 2rem; }
  .auth-aside .trust-list { grid-template-columns: 1fr; }
  .auth-card { max-width: 100%; }
  .person-form { grid-template-columns: 1fr; }
  .handover-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .container, .container.narrow { width: min(100% - 32px, 1160px); }
  .header-inner { min-height: 64px; gap: .6rem; }
  .hide-sm { display: none !important; }
  .hero { padding-top: 2.4rem; }
  .hero-copy h1 { font-size: 2.3rem; }
  .hero-actions .btn { width: 100%; }
  .trust-list { grid-template-columns: 1fr; }
  .hero-stamp { display: none; }
  .vault-card { transform: none; }
  .steps-grid, .feature-grid, .plans-grid, .footer-grid, .stat-grid { grid-template-columns: 1fr; }
  .security-grid { grid-template-columns: 1fr; }
  .section { padding: 3rem 0; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .status-hero { flex-direction: column; align-items: flex-start; }
  .status-ring { width: 104px; height: 104px; align-self: flex-end; margin-top: -3rem; }
  .status-actions { width: 100%; }
  .status-actions form, .status-actions .btn { width: 100%; }
  .journey-label { font-size: .62rem; }
  .field-row, .recover-meta { grid-template-columns: 1fr; }
  .unlock-form { flex-direction: column; align-items: stretch; }
  .envelope-card { flex-wrap: wrap; }
  .envelope-actions { width: 100%; justify-content: flex-end; }
  .person-row { flex-wrap: wrap; }
  .person-actions { width: 100%; justify-content: flex-end; }
  .app-topbar-actions .popover, .app-topbar-actions [data-theme-toggle] { display: none; }
  .footer-bottom { flex-direction: column; }
  .modal-card { max-height: 90vh; }
  .toast-container { left: 16px; right: 16px; bottom: 80px; max-width: none; }
  .kv-list.two-col { grid-template-columns: 1fr; }
  .handover-sheet { width: calc(100% - 28px); }
  .handover-actions { width: 100%; }
  .handover-actions .btn { flex: 1; }
}

/* Print */
@media print {
  body { background: #fff; color: #111; }
  .minimal-header, .minimal-footer, .handover-actions, .toast-container, .sidebar, .mobile-tabs, .app-topbar, .skip-link { display: none !important; }
  .handover-page .minimal-main { display: block; padding: 0; }
  .handover-sheet { width: 100%; padding: 0; }
  .handover-grid { gap: 12mm; }
  .handover-card { break-inside: avoid; page-break-inside: avoid; border-color: #999; box-shadow: none; }
  .handover-head { margin-bottom: 8mm; }
  .handover-security { display: none; }
  a { color: #111; text-decoration: none; }
}

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

/* Chinese typography: larger body text, looser leading and a native CJK stack. */
html[lang="zh"] {
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --font-display: "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
}
html[lang="zh"] body {
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: .01em;
}
html[lang="zh"] h1,
html[lang="zh"] h2,
html[lang="zh"] h3,
html[lang="zh"] h4 {
  letter-spacing: .02em;
  line-height: 1.4;
  word-break: keep-all;
}
html[lang="zh"] p,
html[lang="zh"] li {
  line-height: 1.85;
  word-break: break-word;
}
html[lang="zh"] .btn,
html[lang="zh"] input,
html[lang="zh"] select,
html[lang="zh"] textarea,
html[lang="zh"] .status-pill,
html[lang="zh"] .badge {
  letter-spacing: .02em;
}
html[lang="zh"] .btn {
  min-height: 42px;
}
html[lang="zh"] code,
html[lang="zh"] .handover-code code {
  word-break: break-all;
  line-height: 1.7;
}
html[lang="zh"] .muted.small,
html[lang="zh"] .hint,
html[lang="zh"] .small {
  line-height: 1.75;
}

/* Payment QR block */
.payment-qr-grid { display: flex; gap: 16px; flex-wrap: wrap; margin: 12px 0 16px; }
.payment-qr-grid figure { margin: 0; text-align: center; }
.payment-qr { width: 148px; height: 148px; object-fit: contain; background: #fff; padding: 8px; border-radius: 12px; border: 1px solid var(--line); }
.payment-qr-grid figcaption { margin-top: 6px; font-size: 12px; color: var(--muted); }


