/* =============================================================================
   StealthLedger — private portfolio vault
   System fonts only: the application CSP intentionally permits no remote fonts.
   ========================================================================== */
:root {
  color-scheme: dark;    --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;    --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --text-xs: 0.75rem;    --text-sm: 0.875rem;    --text-base: 1rem;    --text-lg: clamp(1.125rem, 1rem + 0.7vw, 1.35rem);    --text-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);    --text-value: clamp(2.25rem, 9vw, 3.45rem);
  --space-1: 0.25rem;    --space-2: 0.5rem;    --space-3: 0.75rem;    --space-4: 1rem;    --space-5: 1.25rem;    --space-6: 1.5rem;    --space-7: 1.75rem;    --space-8: 2rem;
  --space-10: 2.5rem;    --space-12: 3rem;    --space-16: 4rem;
  --radius-sm: 0.5rem;    --radius-md: 0.75rem;    --radius-lg: 1rem;    --radius-xl: 1.25rem;    --radius-full: 999px;
  /* Dark is deliberately the default. Surfaces stay near-black, not blue. */
  --bg: #0b0d10;    --bg-raised: #11151a;    --surface: #151a20;    --surface-hover: #1a2027;    --surface-strong: #202730;    --field: #0d1116;    --border: #2a333d;    --border-strong: #3b4856;
  --hairline: rgba(213, 227, 239, 0.11);    --text: #edf3f7;    --text-muted: #a4b0bb;    --text-faint: #71808c;    --text-inverse: #071116;    --accent: #81d5e5;    --accent-strong: #b0eaf3;    --accent-ink: #06252d;
  --accent-subtle: rgba(129, 213, 229, 0.14);    --positive: #97daaa;    --positive-subtle: rgba(151, 218, 170, 0.13);    --negative: #ffb0a6;    --negative-subtle: rgba(255, 176, 166, 0.14);    --warning: #f6d692;    --warning-subtle: rgba(246, 214, 146, 0.15);    --danger: #ffb0a6;
  --danger-strong: #ffc2bb;    --focus: #9ae4f3;    --shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.34);    --shadow-dialog: 0 2rem 5rem rgba(0, 0, 0, 0.58);    --ease: 160ms cubic-bezier(0.2, 0, 0, 1);
}
/* Light is opt-in, not inherited from the OS. The desktop app is dark by
   default with an explicit Light button, and the two should not disagree
   just because a phone happens to be set to light. */
:root[data-theme="light"] {
  color-scheme: light;
    --bg: #f5f7f8;      --bg-raised: #eef2f4;      --surface: #ffffff;      --surface-hover: #f7fafb;      --surface-strong: #e9eef1;      --field: #ffffff;      --border: #cbd6dc;      --border-strong: #98a8b3;
  --hairline: rgba(28, 48, 62, 0.12);      --text: #14212a;      --text-muted: #4d606d;      --text-faint: #70808a;      --text-inverse: #f7fbfc;      --accent: #116d80;      --accent-strong: #075668;      --accent-ink: #edfbfd;
  --accent-subtle: rgba(17, 109, 128, 0.11);      --positive: #17683c;      --positive-subtle: rgba(23, 104, 60, 0.1);      --negative: #a33c32;      --negative-subtle: rgba(163, 60, 50, 0.1);      --warning: #785519;      --warning-subtle: rgba(120, 85, 25, 0.11);      --danger: #a33c32;
  --danger-strong: #7d2821;      --focus: #075f73;      --shadow: 0 1.25rem 3rem rgba(19, 37, 48, 0.11);      --shadow-dialog: 0 2rem 5rem rgba(19, 37, 48, 0.24);
}
/* =============================================================================
   Reset and foundations
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  min-width: 20rem;    min-height: 100%;    background: var(--bg);    -webkit-text-size-adjust: 100%;    text-size-adjust: 100%;    -webkit-tap-highlight-color: transparent;
}
body {
  min-width: 20rem;    min-height: 100dvh;    margin: 0;    overflow-x: hidden;    color: var(--text);    background: var(--bg);    font-family: var(--font-ui);    font-size: var(--text-base);
  line-height: 1.5;    text-rendering: optimizeLegibility;    -webkit-font-smoothing: antialiased;    -moz-osx-font-smoothing: grayscale;
}
body[data-screen="app"] {
  background: var(--bg-raised);
}
button,
input,
select {
  font: inherit;
}
button {
  border: 0;
}
button,
select,
input[type="checkbox"] {
  -webkit-touch-callout: none;
}
button:disabled {
  cursor: not-allowed;
}
input,
select {
  width: 100%;    min-height: 2.875rem;    border: 1px solid var(--border);    border-radius: var(--radius-md);    outline: none;    color: var(--text);    background: var(--field);
  font-size: 1rem; /* Avoids iOS automatic zoom on focus. */
  line-height: 1.25;    transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}
input {
  padding: 0.6875rem 0.75rem;
}
select {
  padding: 0.6875rem 2.4rem 0.6875rem 0.75rem;    cursor: pointer;
}
input::placeholder {
  color: var(--text-faint);    opacity: 1;
}
input:hover,
select:hover {
  border-color: var(--border-strong);
}
input:focus,
select:focus {
  border-color: var(--accent);    box-shadow: 0 0 0 0.1875rem var(--accent-subtle);
}
input:invalid:not(:placeholder-shown) {
  border-color: var(--negative);
}
input:disabled,
select:disabled {
  cursor: not-allowed;    opacity: 0.58;    background: var(--surface-strong);
}
::selection {
  color: var(--text);    background: var(--accent-subtle);
}
:focus-visible {
  outline: 0.1875rem solid var(--focus);    outline-offset: 0.1875rem;
}
[hidden] {
  display: none !important;
}
/* =============================================================================
   Shared type and lightweight utilities
   ========================================================================== */
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  color: var(--text);    font-weight: 650;    letter-spacing: -0.025em;    line-height: 1.16;
}
h1 {
  font-size: var(--text-xl);
}
h2 {
  font-size: var(--text-lg);
}
h3 {
  font-size: var(--text-base);
}
code,
.mono {
  font-family: var(--font-mono);    font-variant-numeric: tabular-nums slashed-zero;
}
.muted {
  color: var(--text-muted);
}
.small-text {
  font-size: var(--text-sm);
}
.row {
  display: flex;    align-items: center;
}
.gap {
  gap: var(--space-2);
}
.wrap {
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.short {
  width: 5.75rem;    flex: 0 0 5.75rem;    text-align: center;    font-variant-numeric: tabular-nums;
}
.spacer {
  flex: 1 1 auto;    min-width: var(--space-2);
}
/* =============================================================================
   Entry and access screens
   A fixed shell keeps confidential setup flows visually quiet and centered.
   ========================================================================== */
.screen {
  min-height: 100dvh;
}
/*
  Centering is the default for every entry/access screen. The main app view
  (#screen-app) opts out below because it has its own header + table layout.
  We do NOT list screen IDs here on purpose -- an allowlist got out of date
  every time a new screen was added.
*/
.screen {
  display: grid;    place-items: center;
  padding: calc(var(--space-8) + env(safe-area-inset-top))
    calc(var(--space-5) + env(safe-area-inset-right))
    calc(var(--space-8) + env(safe-area-inset-bottom))
    calc(var(--space-5) + env(safe-area-inset-left));
  background: var(--bg);
}
#screen-boot {
  background:
    radial-gradient(circle at 50% 38%, var(--accent-subtle), transparent 20rem),
    var(--bg);
}
#screen-app {
  display: block;
  place-items: initial;
  padding: 0;
  background: var(--bg);
}
.centered {
  display: grid;    justify-items: center;    gap: var(--space-4);    width: min(100%, 28rem);    text-align: center;
}
.centered > .muted {
  max-width: 22rem;
}
.card {
  width: min(100%, 38rem);    padding: var(--space-6);    border: 1px solid var(--border);    border-radius: var(--radius-xl);    background: var(--surface);    box-shadow: var(--shadow);
}
.card.narrow {
  width: min(100%, 30rem);
}
.card > h1,
.card > .brand-mark + h1 {
  margin-bottom: var(--space-3);
}
.card > .muted:not(.small-text) {
  margin-bottom: var(--space-6);
}
.card > .brand-mark.small {
  margin-bottom: var(--space-6);
}
/* A simple nested-square mark can be recognized without an external asset. */
.brand-mark {
  position: relative;    display: inline-block;    width: 3.25rem;    aspect-ratio: 1;    border: 0.2rem solid var(--accent);    border-radius: 0.85rem;    background: var(--accent-subtle);
}
.brand-mark::before,
.brand-mark::after {
  position: absolute;    content: "";    border: 0.16rem solid var(--accent);    border-radius: 0.42rem;
}
.brand-mark::before {
  inset: 0.48rem;
}
.brand-mark::after {
  inset: 1rem;    border-width: 0.15rem;    background: var(--accent);
}
.brand-mark.small {
  width: 2.5rem;    border-width: 0.16rem;    border-radius: 0.68rem;
}
.brand-mark.small::before {
  inset: 0.4rem;    border-width: 0.13rem;
}
.brand-mark.small::after {
  inset: 0.77rem;    border-width: 0.12rem;
}
.brand-mark.tiny {
  width: 1.5rem;    flex: 0 0 1.5rem;    border-width: 0.12rem;    border-radius: 0.42rem;
}
.brand-mark.tiny::before {
  inset: 0.23rem;    border-width: 0.1rem;    border-radius: 0.18rem;
}
.brand-mark.tiny::after {
  inset: 0.5rem;    border-width: 0.08rem;    border-radius: 0.12rem;
}
/* =============================================================================
   Forms, validation and controls
   ========================================================================== */
form {
  display: grid;    gap: var(--space-5);
}
.field {
  display: grid;    gap: var(--space-2);    min-width: 0;    color: var(--text);
}
.field-label {
  display: flex;    align-items: center;    justify-content: space-between;    gap: var(--space-2);    color: var(--text);    font-size: var(--text-sm);    font-weight: 620;    letter-spacing: 0.01em;
}
.field-label .link.tiny {
  margin-left: auto;
}
.field-hint {
  color: var(--text-muted);    font-size: var(--text-xs);    line-height: 1.45;
}
.field-hint code,
.help code {
  padding: 0.05em 0.25em;    border-radius: 0.25rem;    color: var(--text);    background: var(--surface-strong);    font-size: 0.95em;
}
.row-field {
  align-items: center;    grid-template-columns: minmax(0, 1fr) auto;
}
.row-field > .field-label {
  align-self: center;
}
.row-field > .row {
  justify-content: flex-end;
}
.btn {
  display: inline-flex;    align-items: center;    justify-content: center;    min-height: 2.75rem;    gap: var(--space-2);    padding: 0.625rem 0.9rem;    border: 1px solid var(--border-strong);    border-radius: var(--radius-md);
  color: var(--text);    background: transparent;    box-shadow: 0 0 0 transparent;    cursor: pointer;    font-size: var(--text-sm);    font-weight: 650;    letter-spacing: 0.005em;    line-height: 1.2;
  text-align: center;
  transition: transform var(--ease), color var(--ease), background var(--ease),
    border-color var(--ease), box-shadow var(--ease), opacity var(--ease);
}
.btn:hover:not(:disabled) {
  border-color: var(--accent);    background: var(--accent-subtle);
}
.btn:active:not(:disabled) {
  transform: translateY(0.0625rem);
}
.btn:disabled {
  border-color: var(--border);    color: var(--text-faint);    background: var(--surface-strong);    opacity: 0.6;
}
.btn.primary {
  border-color: var(--accent);    color: var(--accent-ink);    background: var(--accent);
}
.btn.primary:hover:not(:disabled) {
  border-color: var(--accent-strong);    background: var(--accent-strong);    box-shadow: 0 0.4rem 1.1rem var(--accent-subtle);
}
.btn.small {
  min-height: 2.5rem;    padding: 0.5rem 0.7rem;    border-radius: var(--radius-sm);    font-size: var(--text-xs);
}
.btn.danger {
  border-color: color-mix(in srgb, var(--danger) 60%, var(--border));    color: var(--danger);
}
.btn.danger:hover:not(:disabled) {
  border-color: var(--danger);    color: var(--danger-strong);    background: var(--negative-subtle);
}
.btn.block {
  width: 100%;
}
.btn.biometric {
  min-height: 3.25rem;    padding-block: var(--space-3);
}
.icon-btn {
  display: inline-grid;    place-items: center;    width: 2.75rem;    min-width: 2.75rem;    height: 2.75rem;    padding: 0;    border: 1px solid transparent;    border-radius: var(--radius-full);
  color: var(--text-muted);    background: transparent;    cursor: pointer;
  transition: color var(--ease), background var(--ease), border-color var(--ease),
    transform var(--ease);
}
.icon-btn:hover:not(:disabled) {
  border-color: var(--border);    color: var(--text);    background: var(--surface-hover);
}
.icon-btn:active:not(:disabled) {
  transform: scale(0.94);
}
.link {
  display: inline-flex;    align-items: center;    min-height: 2.75rem;    padding: var(--space-2) 0;    color: var(--accent);    background: transparent;    cursor: pointer;    font-size: var(--text-sm);
  font-weight: 600;    line-height: 1.2;    text-align: left;    text-decoration: underline;    text-decoration-color: transparent;    text-underline-offset: 0.2em;    transition: color var(--ease), text-decoration-color var(--ease);
}
.link:hover {
  color: var(--accent-strong);    text-decoration-color: currentColor;
}
.link.tiny {
  min-height: 1.5rem;    padding: 0;    font-size: var(--text-xs);
}
.check {
  display: flex;    align-items: flex-start;    gap: var(--space-3);    min-height: 2.75rem;    color: var(--text-muted);    cursor: pointer;    font-size: var(--text-sm);    line-height: 1.45;
}
.check input {
  width: 1.25rem;    min-width: 1.25rem;    min-height: 1.25rem;    margin: 0.1rem 0 0;    accent-color: var(--accent);
}
.error,
.ok-msg,
.working {
  display: flex;    align-items: center;    gap: var(--space-2);    min-height: 1.5rem;    padding: var(--space-3);    border-radius: var(--radius-sm);    font-size: var(--text-sm);    line-height: 1.4;
}
.error {
  border: 1px solid color-mix(in srgb, var(--negative) 52%, transparent);    color: var(--negative);    background: var(--negative-subtle);
}
.ok-msg {
  border: 1px solid color-mix(in srgb, var(--positive) 50%, transparent);    color: var(--positive);    background: var(--positive-subtle);
}
.working {
  color: var(--text-muted);    background: var(--surface-strong);
}
/* Static status containers have their own IDs so JS can safely update them. */
#token-error,
#setup-error,
#unlock-error,
#holding-error,
#cash-error,
#settings-error,
#prompt-error {
  margin-top: var(--space-4);
}
#settings-ok {
  margin-top: var(--space-4);
}
#unlock-working {
  margin-top: var(--space-4);
}
/* =============================================================================
   Strength, recovery and disclosure details
   ========================================================================== */
.strength {
  display: grid;    grid-template-columns: minmax(0, 1fr) auto;    align-items: center;    gap: var(--space-3);    margin-top: calc(var(--space-4) * -1);
}
.strength-bar {
  height: 0.375rem;    overflow: hidden;    border-radius: var(--radius-full);    background: var(--surface-strong);
}
.strength-bar > span {
  display: block;    width: 0;    height: 100%;    border-radius: inherit;    background: var(--warning);    transition: width var(--ease), background var(--ease);
}
.strength-label {
  min-width: 5rem;    color: var(--text-muted);    font-size: var(--text-xs);    text-align: right;
}
#setup-strength-fill,
#prompt-strength-fill {
  background: var(--accent);
}
#setup-strength-label,
#prompt-strength-label {
  font-variant-numeric: tabular-nums;
}
.recovery-code {
  display: block;    width: 100%;    margin: var(--space-6) 0;    padding: var(--space-4);    overflow-wrap: anywhere;    border: 1px dashed var(--border-strong);    border-radius: var(--radius-md);    color: var(--accent-strong);
  background: var(--field);    font-size: clamp(1rem, 4vw, 1.2rem);    font-weight: 650;    letter-spacing: 0.08em;    line-height: 1.65;    text-align: center;
}
#recovery-code {
  min-height: 4.5rem;
}
#recovery-continue {
  margin-top: var(--space-5);
}
.help {
  margin-top: var(--space-6);    border-top: 1px solid var(--hairline);    color: var(--text-muted);    font-size: var(--text-sm);
}
.help summary {
  min-height: 2.75rem;    padding-top: var(--space-4);    color: var(--text-muted);    cursor: pointer;    font-weight: 600;
}
.help summary:hover {
  color: var(--text);
}
.help p {
  padding-bottom: var(--space-2);    line-height: 1.55;
}
.divider {
  display: flex;    align-items: center;    gap: var(--space-3);    color: var(--text-faint);    font-size: var(--text-xs);    text-transform: uppercase;    letter-spacing: 0.08em;
}
.divider::before,
.divider::after {
  height: 1px;    flex: 1;    content: "";    background: var(--hairline);
}
/* =============================================================================
   CSS-only icons — shapes stay in the stylesheet and require no image requests.
   ========================================================================== */
.icon-face,
.icon-refresh,
.icon-gear,
.icon-lock {
  position: relative;    display: inline-block;    width: 1.25rem;    height: 1.25rem;    flex: 0 0 1.25rem;    color: currentColor;
}
.icon-face {
  border: 0.125rem solid currentColor;    border-radius: 0.4rem;
}
.icon-face::before,
.icon-face::after {
  position: absolute;    content: "";
}
.icon-face::before {
  top: 0.33rem;    left: 0.26rem;    width: 0.18rem;    height: 0.18rem;    border-radius: 50%;    color: currentColor;    background: currentColor;    box-shadow: 0.42rem 0 currentColor;
}
.icon-face::after {
  right: 0.26rem;    bottom: 0.25rem;    left: 0.26rem;    height: 0.25rem;    border-bottom: 0.11rem solid currentColor;    border-radius: 0 0 0.35rem 0.35rem;
}
.icon-refresh {
  border: 0.125rem solid currentColor;    border-left-color: transparent;    border-radius: 50%;    transform: rotate(-42deg);
}
.icon-refresh::before {
  position: absolute;    top: -0.18rem;    right: -0.1rem;    width: 0;    height: 0;    content: "";    border-top: 0.26rem solid transparent;    border-bottom: 0.26rem solid transparent;
  border-left: 0.36rem solid currentColor;    transform: rotate(28deg);
}
.icon-gear {
  width: 1.125rem;    height: 1.125rem;    margin: 0.0625rem;    border: 0.14rem solid currentColor;    border-radius: 50%;
  box-shadow: 0 -0.32rem 0 -0.1rem currentColor, 0 0.32rem 0 -0.1rem currentColor,
    0.32rem 0 0 -0.1rem currentColor, -0.32rem 0 0 -0.1rem currentColor;
}
.icon-gear::after {
  position: absolute;    inset: 0.25rem;    content: "";    border: 0.11rem solid currentColor;    border-radius: 50%;
}
.icon-lock {
  width: 1.1rem;    height: 0.9rem;    margin-top: 0.35rem;    border: 0.125rem solid currentColor;    border-radius: 0.18rem;
}
.icon-lock::before {
  position: absolute;    bottom: calc(100% - 0.125rem);    left: 50%;    width: 0.68rem;    height: 0.65rem;    content: "";    border: 0.125rem solid currentColor;    border-bottom: 0;
  border-radius: 0.45rem 0.45rem 0 0;    transform: translateX(-50%);
}
.icon-lock::after {
  position: absolute;    top: 0.24rem;    left: 50%;    width: 0.14rem;    height: 0.28rem;    content: "";    border-radius: var(--radius-full);    background: currentColor;
  transform: translateX(-50%);
}
.icon-lock.big {
  width: 2.65rem;    height: 2.15rem;    margin-top: 0.85rem;    border-width: 0.22rem;    border-radius: 0.38rem;
}
.icon-lock.big::before {
  bottom: calc(100% - 0.22rem);    width: 1.65rem;    height: 1.55rem;    border-width: 0.22rem;    border-bottom: 0;    border-radius: 1rem 1rem 0 0;
}
.icon-lock.big::after {
  top: 0.56rem;    width: 0.24rem;    height: 0.65rem;
}
/* =============================================================================
   Dashboard shell and application bar
   ========================================================================== */
#screen-app {
  width: min(100%, 82rem);    margin: 0 auto;    padding-bottom: calc(var(--space-10) + env(safe-area-inset-bottom));
}
.app-bar {
  position: sticky;    z-index: 10;    top: 0;    display: flex;    align-items: center;    justify-content: space-between;    min-height: calc(3.75rem + env(safe-area-inset-top));
  padding: env(safe-area-inset-top)
    calc(var(--space-4) + env(safe-area-inset-right))
    var(--space-2)
    calc(var(--space-4) + env(safe-area-inset-left));
  border-bottom: 1px solid var(--hairline);    background: color-mix(in srgb, var(--bg-raised) 92%, transparent);    backdrop-filter: blur(1rem);    -webkit-backdrop-filter: blur(1rem);
}
.app-bar-left,
.app-bar-right {
  display: flex;    align-items: center;
}
.app-bar-left {
  min-width: 0;    gap: var(--space-3);
}
.app-bar-right {
  gap: var(--space-1);
}
.app-title {
  overflow: hidden;    color: var(--text);    font-size: var(--text-sm);    font-weight: 720;    letter-spacing: 0.015em;    text-overflow: ellipsis;    white-space: nowrap;
}
#btn-refresh,
#btn-settings,
#btn-lock {
  flex: 0 0 auto;
}
.banner {
  margin: var(--space-4) var(--space-4) 0;    padding: var(--space-3) var(--space-4);    border: 1px solid color-mix(in srgb, var(--warning) 42%, transparent);    border-radius: var(--radius-md);    color: var(--warning);    background: var(--warning-subtle);    font-size: var(--text-sm);    line-height: 1.4;
}
#sync-banner {
  max-width: calc(100% - var(--space-8));
}
.hero {
  padding: var(--space-10) var(--space-4) var(--space-8);    border-bottom: 1px solid var(--hairline);
}
.hero-label {
  margin-bottom: var(--space-2);    color: var(--text-muted);    font-size: var(--text-sm);    font-weight: 620;    letter-spacing: 0.02em;
}
.hero-value {
  overflow-wrap: anywhere;    color: var(--text);    font-size: var(--text-value);    font-weight: 680;    font-variant-numeric: tabular-nums lining-nums;    letter-spacing: -0.055em;    line-height: 1;
}
#total-grand {
  min-height: 1em;
}
.hero-sub {
  display: flex;    flex-wrap: wrap;    align-items: center;    gap: var(--space-2);    min-height: 1.5rem;    margin-top: var(--space-4);    font-size: var(--text-sm);
}
.delta {
  display: inline-flex;    align-items: center;    min-height: 1.5rem;    padding: 0.14rem 0.45rem;    border: 1px solid var(--border);    border-radius: var(--radius-full);    color: var(--text-muted);    background: var(--surface);
  font-size: var(--text-xs);    font-weight: 720;    font-variant-numeric: tabular-nums;
}
/* JS may apply these semantic values; arrows make state legible beyond hue. */
.delta.positive,
.delta.up,
.delta.gain {
  border-color: color-mix(in srgb, var(--positive) 55%, transparent);    color: var(--positive);    background: var(--positive-subtle);
}
.delta.positive::before,
.delta.up::before,
.delta.gain::before {
  content: "↑ ";    font-weight: 800;
}
.delta.negative,
.delta.down,
.delta.loss {
  border-color: color-mix(in srgb, var(--negative) 55%, transparent);    color: var(--negative);    background: var(--negative-subtle);
}
.delta.negative::before,
.delta.down::before,
.delta.loss::before {
  content: "↓ ";    font-weight: 800;
}
#total-change {
  max-width: 100%;
}
#price-status {
  font-size: var(--text-xs);
}
.hero-split {
  display: grid;    grid-template-columns: repeat(2, minmax(0, 1fr));    gap: var(--space-3);    margin-top: var(--space-7);
}
.hero-split > div {
  display: grid;    gap: var(--space-1);    min-width: 0;    padding: var(--space-3);    border-left: 2px solid var(--border-strong);
}
.hero-split .muted {
  font-size: var(--text-xs);
}
.hero-split strong {
  overflow: hidden;    color: var(--text);    font-size: var(--text-sm);    font-variant-numeric: tabular-nums lining-nums;    text-overflow: ellipsis;    white-space: nowrap;
}
#total-crypto,
#total-cash {
  min-height: 1.25rem;
}
/* =============================================================================
   Portfolio panels and dynamic holding rows
   ========================================================================== */
.panel {
  padding: var(--space-7) var(--space-4);    border-bottom: 1px solid var(--hairline);
}
.panel-head {
  display: flex;    align-items: center;    justify-content: space-between;    gap: var(--space-4);    margin-bottom: var(--space-5);
}
.panel-head h2 {
  min-width: 0;    font-size: var(--text-lg);
}
.panel-head h2 .muted {
  font-size: var(--text-sm);    font-weight: 500;
}
.panel-head .btn {
  flex: 0 0 auto;
}
#btn-add-coin,
#btn-add-cash {
  white-space: nowrap;
}
.rows {
  display: grid;    overflow: hidden;    border-top: 1px solid var(--hairline);
}
.rows:empty {
  display: none;
}
/* The following selectors target rows generated by app.js, not frozen HTML. */
.row-item {
  display: grid;    grid-template-columns: minmax(0, 1fr) auto;    gap: var(--space-3);    align-items: center;    min-height: 4.25rem;    padding: var(--space-3) 0;    border-bottom: 1px solid var(--hairline);
}
.row-item:last-child {
  border-bottom: 0;
}
.row-item:hover {
  background: color-mix(in srgb, var(--surface-hover) 58%, transparent);
}
.row-main {
  display: grid;    min-width: 0;    gap: 0.15rem;
}
.sym {
  display: inline-flex;    align-items: center;    justify-self: start;    max-width: 100%;    padding: 0.16rem 0.38rem;    overflow: hidden;    border: 1px solid var(--border-strong);    border-radius: 0.32rem;
  color: var(--text);    background: var(--surface);    font-family: var(--font-mono);    font-size: var(--text-sm);    font-weight: 720;    font-variant-numeric: tabular-nums;    letter-spacing: 0.025em;    text-overflow: ellipsis;
  white-space: nowrap;
}

/* Coin icon column.
 * Icon sits to the LEFT of the ticker chip. .c-sym becomes a flex row so
 * icon+chip read as one unit, not two children strung along the parent grid.
 * flex-shrink:0 on the icon so a long ticker truncates the chip first rather
 * than squishing the logo into an oval. */
.row-item .c-sym {
  display: inline-flex;    align-items: center;    gap: 0.42rem;    min-width: 0;
}
.coin-icon {
  flex-shrink: 0;    width: 1.25rem;    height: 1.25rem;    border-radius: 50%;    background: var(--surface);    object-fit: contain;
}
.coin-icon-fallback {
  flex-shrink: 0;    display: inline-flex;    align-items: center;    justify-content: center;    width: 1.25rem;    height: 1.25rem;    border-radius: 50%;    color: #fff;
  font-family: var(--font-mono);    font-size: 0.7rem;    font-weight: 720;    letter-spacing: 0;    text-transform: uppercase;    user-select: none;
}
.row-note {
  overflow: hidden;    color: var(--text-muted);    font-size: var(--text-xs);    text-overflow: ellipsis;    white-space: nowrap;
}
.row-figs {
  display: grid;    min-width: 6.8rem;    gap: 0.05rem;    justify-items: end;    text-align: right;
}
.row-amount,
.row-value,
.row-price {
  max-width: 100%;    overflow: hidden;    font-variant-numeric: tabular-nums lining-nums;    text-overflow: ellipsis;    white-space: nowrap;
}
.row-value {
  color: var(--text);    font-size: var(--text-sm);    font-weight: 680;
}
.row-amount,
.row-price {
  color: var(--text-muted);    font-size: var(--text-xs);
}
.row-price::before {
  content: "@ ";    color: var(--text-faint);
}
.row-edit {
  grid-column: 1 / -1;    justify-self: start;    min-height: 2.25rem;    padding: 0.25rem 0;    color: var(--accent);    background: transparent;    cursor: pointer;    font-size: var(--text-xs);
  font-weight: 680;    text-decoration: underline;    text-decoration-color: transparent;    text-underline-offset: 0.2em;
}
.row-edit:hover {
  color: var(--accent-strong);    text-decoration-color: currentColor;
}
/* Duplicate entries remain identifiable without suggesting an error state. */
.dupe-row .sym {
  border-color: var(--accent);    box-shadow: 0 0 0 0.125rem var(--accent-subtle);
}
.dupe-row .row-note::before {
  content: "Duplicate · ";    color: var(--accent);    font-weight: 650;
}
/* A stale mark pairs a small non-colour symbol with lower visual prominence. */
.stale {
  opacity: 0.67;
}
.stale .row-price::after {
  display: inline-block;    margin-left: 0.33rem;    color: var(--warning);    content: "†";    font-size: var(--text-sm);    font-weight: 800;    vertical-align: -0.03em;
}
.stale .row-value {
  color: var(--text-muted);
}
.dupes {
  margin: 0 0 var(--space-4);    padding: var(--space-3);    border-left: 0.18rem solid var(--accent);    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;    color: var(--text-muted);    background: var(--accent-subtle);    font-size: var(--text-xs);    line-height: 1.45;
}
#external-dupes-note {
  max-width: 100%;
}
.empty {
  margin: var(--space-4) 0 0;    padding: var(--space-5) var(--space-4);    border: 1px dashed var(--border);    border-radius: var(--radius-md);    color: var(--text-muted);    font-size: var(--text-sm);    text-align: center;
}
#external-empty,
#cash-empty {
  min-height: 4rem;
}
.note {
  color: var(--text-muted);    font-size: var(--text-sm);    line-height: 1.52;
}
.panel > .note {
  margin: calc(var(--space-3) * -1) 0 var(--space-5);
}
.pill {
  display: inline-flex;    align-items: center;    min-height: 1.75rem;    padding: 0.14rem 0.48rem;    border: 1px solid var(--border);    border-radius: var(--radius-full);    color: var(--text-muted);    background: var(--surface);
  font-size: var(--text-xs);    font-weight: 650;    letter-spacing: 0.015em;    white-space: nowrap;
}
#koinly-synced {
  color: var(--text-muted);
}
.panel-total {
  display: flex;    align-items: baseline;    justify-content: space-between;    gap: var(--space-4);    min-height: 3rem;    margin-top: var(--space-4);    padding-top: var(--space-4);    border-top: 1px solid var(--hairline);
  font-size: var(--text-sm);
}
.panel-total strong {
  overflow: hidden;    color: var(--text);    font-weight: 720;    font-variant-numeric: tabular-nums lining-nums;    text-align: right;    text-overflow: ellipsis;    white-space: nowrap;
}
#total-external,
#total-koinly {
  min-width: 5rem;
}
#panel-koinly {
  background: color-mix(in srgb, var(--surface) 36%, transparent);
}
.app-foot {
  min-height: calc(4rem + env(safe-area-inset-bottom));
  padding: var(--space-6)
    calc(var(--space-4) + env(safe-area-inset-right))
    calc(var(--space-6) + env(safe-area-inset-bottom))
    calc(var(--space-4) + env(safe-area-inset-left));
  font-size: var(--text-xs);    text-align: center;
}
#foot-status {
  display: inline-block;    max-width: 100%;
}
/* =============================================================================
   Locked overlay and toast notification
   ========================================================================== */
.overlay {
  position: fixed;    z-index: 40;    inset: 0;    display: grid;    place-items: center;
  padding: calc(var(--space-6) + env(safe-area-inset-top))
    calc(var(--space-5) + env(safe-area-inset-right))
    calc(var(--space-6) + env(safe-area-inset-bottom))
    calc(var(--space-5) + env(safe-area-inset-left));
  color: var(--text);    background: color-mix(in srgb, var(--bg) 88%, transparent);    backdrop-filter: blur(0.9rem);    -webkit-backdrop-filter: blur(0.9rem);
}
#lock-overlay .centered {
  gap: var(--space-4);    padding: var(--space-8) var(--space-6);    border: 1px solid var(--border);    border-radius: var(--radius-xl);    background: var(--surface);    box-shadow: var(--shadow-dialog);
}
#lock-overlay .icon-lock {
  color: var(--accent);
}
#lock-overlay p:not(.muted) {
  font-size: var(--text-lg);    font-weight: 680;
}
#lock-reason {
  margin-top: calc(var(--space-3) * -1);
}
#lock-unlock {
  min-width: 8rem;    margin-top: var(--space-2);
}
.toast {
  position: fixed;    z-index: 60;    right: max(var(--space-4), env(safe-area-inset-right));    bottom: calc(var(--space-5) + env(safe-area-inset-bottom));    left: max(var(--space-4), env(safe-area-inset-left));    width: auto;    max-width: 34rem;    margin: 0 auto;
  padding: var(--space-3) var(--space-4);    border: 1px solid var(--border-strong);    border-radius: var(--radius-md);    color: var(--text);    background: var(--surface-strong);    box-shadow: var(--shadow);    font-size: var(--text-sm);    line-height: 1.4;
  text-align: center;
}
#toast {
  overflow-wrap: anywhere;
}
/* =============================================================================
   Dialogs
   Dialog stays modal from native showModal(); no display override is used.
   ========================================================================== */
dialog {
  color: var(--text);
}
dialog::backdrop {
  background: rgba(3, 6, 8, 0.64);    backdrop-filter: blur(0.22rem);    -webkit-backdrop-filter: blur(0.22rem);
}
.modal {
  width: min(calc(100% - var(--space-8)), 33rem);    max-height: min(46rem, calc(100dvh - var(--space-8)));    margin: auto;    padding: 0;    overflow: auto;    overscroll-behavior: contain;    border: 1px solid var(--border-strong);    border-radius: var(--radius-xl);
  color: var(--text);    background: var(--surface);    box-shadow: var(--shadow-dialog);
}
.modal.wide {
  width: min(calc(100% - var(--space-8)), 42rem);
}
.modal > form,
.modal-body {
  padding: var(--space-6);
}
.modal > form > h2,
.modal-body > h2 {
  margin-bottom: var(--space-6);
}
.modal-body {
  display: grid;    gap: var(--space-6);
}
.modal-body > h2 {
  margin-bottom: 0;
}
.modal-actions {
  display: flex;    align-items: center;    gap: var(--space-2);    margin-top: var(--space-2);    padding-top: var(--space-4);    border-top: 1px solid var(--hairline);
}
.modal-actions .btn {
  flex: 0 0 auto;
}
#modal-holding,
#modal-cash,
#modal-settings,
#modal-prompt {
  scrollbar-color: var(--border-strong) transparent;
}
#holding-title,
#cash-title,
#prompt-title {
  min-height: 1.25em;
}
#holding-id-hint {
  display: block;
}
#holding-delete,
#cash-delete {
  margin-right: auto;
}
/* =============================================================================
   Settings and status data
   ========================================================================== */
.settings-group {
  display: grid;    gap: var(--space-4);    padding-top: var(--space-6);    border-top: 1px solid var(--hairline);
}
.settings-group:first-of-type {
  padding-top: 0;    border-top: 0;
}
.settings-group > h3 {
  color: var(--text);
}
.settings-group > .note {
  margin-top: calc(var(--space-3) * -1);
}
#passkey-support-note {
  margin-top: calc(var(--space-3) * -1);
}
.unlockers {
  display: grid;    border-top: 1px solid var(--hairline);
}
.unlockers:empty {
  display: none;
}
/* Defensive styling for current and future generated unlocker rows. */
.unlockers > * {
  display: flex;    align-items: center;    justify-content: space-between;    gap: var(--space-3);    min-height: 3.25rem;    padding: var(--space-3) 0;    border-bottom: 1px solid var(--hairline);    color: var(--text-muted);
  font-size: var(--text-sm);
}
.unlockers button {
  min-width: 2.75rem;    min-height: 2.75rem;
}
.audit {
  overflow: hidden;    border: 1px solid var(--hairline);    border-radius: var(--radius-md);
}
.audit:empty::before {
  display: block;    padding: var(--space-4);    color: var(--text-muted);    content: "No recent writes.";    font-size: var(--text-sm);
}
.audit > * {
  margin: 0;    padding: var(--space-3) var(--space-4);    border-bottom: 1px solid var(--hairline);    color: var(--text-muted);    font-size: var(--text-xs);    line-height: 1.45;
}
.audit > *:last-child {
  border-bottom: 0;
}
/* Two spans with no layout render as "20 min agoupdate · seq 14". The time is
   the thing being scanned down, so it leads and gets a fixed column; the detail
   follows and wraps under itself rather than under the timestamp. */
.audit-row {
  display: grid;    grid-template-columns: minmax(5.5rem, auto) 1fr;    gap: 0.2rem var(--space-4);    align-items: baseline;
}
.audit-row > :first-child {
  color: var(--text);    font-variant-numeric: tabular-nums;    font-weight: 600;    white-space: nowrap;
}
.audit-row > .muted {
  min-width: 0;    overflow-wrap: anywhere;
}
@media (max-width: 30rem) {
  .audit-row {
    grid-template-columns: 1fr;
  }
}
#audit-list {
  min-height: 2.875rem;
}
#autolock-mins {
  font-variant-numeric: tabular-nums;
}
#settings-currency,
#setup-currency {
  max-width: 100%;    font-variant-numeric: tabular-nums;
}
#btn-add-passkey,
#btn-change-pass,
#btn-new-recovery,
#btn-export,
#btn-forget-device {
  flex: 0 1 auto;
}
/* =============================================================================
   Screen-specific controls and identifiers
   ========================================================================== */
#token-form,
#setup-form,
#unlock-form,
#recovery-form,
#holding-form,
#cash-form,
#prompt-form {
  width: 100%;
}
#token-input,
#recovery-input {
  letter-spacing: 0.015em;
}
#holding-symbol,
#cash-currency {
  font-family: var(--font-mono);    font-variant-numeric: tabular-nums;    letter-spacing: 0.04em;    text-transform: uppercase;
}
#holding-amount,
#cash-amount {
  font-variant-numeric: tabular-nums;
}
#holding-uid,
#cash-index {
  display: none;
}
#recovery-copy,
#recovery-print {
  min-width: 5.5rem;
}
#unlock-passkey-label {
  min-width: 0;
}
#unlock-recovery-toggle,
#unlock-forget {
  min-height: 2.5rem;
}
#prompt-message {
  margin-top: calc(var(--space-2) * -1);
}
#prompt-confirm-field {
  margin-top: calc(var(--space-2) * -1);
}
/* =============================================================================
   Responsive refinements
   ========================================================================== */
@media (min-width: 30rem) {
  #screen-token,
  #screen-setup,
  #screen-recovery,
  #screen-unlock {
    padding-inline: var(--space-6);
  }
  .card {
    padding: var(--space-8);
  }
  .hero,
  .panel {
    padding-right: var(--space-6);      padding-left: var(--space-6);
  }
  .app-bar {
    padding-right: calc(var(--space-6) + env(safe-area-inset-right));      padding-left: calc(var(--space-6) + env(safe-area-inset-left));
  }
  .banner {
    margin-right: var(--space-6);      margin-left: var(--space-6);
  }
  .row-item {
    grid-template-columns: minmax(0, 1fr) minmax(7.5rem, auto) auto;      gap: var(--space-4);
  }
  .row-edit {
    grid-column: auto;      justify-self: end;      min-width: 2.75rem;      padding-right: 0;      padding-left: var(--space-2);      text-align: right;
  }
  .row-figs {
    min-width: 8.5rem;
  }
  .modal > form,
  .modal-body {
    padding: var(--space-8);
  }
}
@media (min-width: 44rem) {
  #screen-app {
    margin-top: var(--space-4);      margin-bottom: var(--space-4);      border: 1px solid var(--border);      border-radius: var(--radius-xl);      background: var(--surface);      box-shadow: var(--shadow);
  }
  .app-bar {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
  .app-foot {
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  }
  .hero {
    padding-top: var(--space-12);
  }
  .hero-split {
    max-width: 28rem;
  }
}
/* Compact landscape preserves the unlock action above iPhone browser chrome. */
@media (max-height: 34rem) and (orientation: landscape) {
  #screen-boot,
  #screen-token,
  #screen-setup,
  #screen-recovery,
  #screen-unlock {
    place-items: start center;      padding-top: calc(var(--space-5) + env(safe-area-inset-top));      padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom));
  }
  .card {
    padding: var(--space-5);
  }
  .card > .muted:not(.small-text) {
    margin-bottom: var(--space-4);
  }
}
/* =============================================================================
   Motion is short and purposeful. Reduced-motion disables all non-essential
   movement, including the activity spinner, rather than merely slowing it.
   ========================================================================== */
.spinner {
  display: inline-block;    width: 1rem;    height: 1rem;    flex: 0 0 1rem;    border: 0.14rem solid var(--border-strong);    border-top-color: var(--accent);    border-radius: 50%;    animation: vault-spin 700ms linear infinite;
}
@keyframes vault-spin {
  to {
    transform: rotate(1turn);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;      transition-duration: 0.01ms !important;      animation-duration: 0.01ms !important;      animation-iteration-count: 1 !important;
  }
  .spinner {
    animation: none;      border-top-color: var(--border-strong);
  }
}
/* =============================================================================
   Print is intentionally sparse: recovery code can be printed without chrome.
   ========================================================================== */
@media print {
  :root {
    --bg: #ffffff;      --surface: #ffffff;      --field: #ffffff;      --text: #000000;      --text-muted: #333333;      --border: #777777;      --border-strong: #444444;      --accent: #000000;
    --accent-strong: #000000;      --accent-subtle: transparent;
  }
  body {
    min-height: auto;      background: #ffffff;
  }
  .app-bar,
  .app-foot,
  .overlay,
  .toast,
  .btn,
  .icon-btn,
  .modal,
  .banner {
    display: none !important;
  }
  .card {
    width: 100%;      border: 0;      box-shadow: none;
  }
  .recovery-code {
    color: #000000;      border-color: #000000;      font-size: 14pt;
  }
}

/* Frozen-DOM identifier refinements: these leave no control dependent on a
   generic selector alone, while keeping the visual system intentionally spare. */
#boot-status { min-height: 1.5rem; }
#external-rows,
#koinly-rows,
#cash-rows { min-height: 0; }
#unlocker-list { min-height: 0; }
#unlock-divider { margin: var(--space-5) 0; }
#recovery-ack,
#autolock-onhide { accent-color: var(--accent); }
#token-submit,
#setup-submit,
#unlock-submit,
#holding-save,
#cash-cancel,
#settings-close,
#prompt-cancel,
#prompt-ok { letter-spacing: 0.01em; }
#holding-cancel,
#holding-lookup,
#cash-cancel,
#prompt-cancel { white-space: nowrap; }
#setup-pass,
#setup-pass2,
#cash-label,
#cash-note,
#holding-note,
#prompt-input { min-width: 0; }
#prompt-label { min-width: 0; }

/* Present to assistive tech and to password managers, but not on screen.
   Deliberately not `display:none` or the `hidden` attribute: browsers skip
   hidden fields when deciding whether a form is a credential form, which would
   defeat the purpose of the hidden username in the unlock form. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------------------
   Code fingerprint (unlock screen)
   --------------------------------------------------------------------------- */
/* Sits below the unlock form, separated by a rule rather than a box: it is
   reference information, not an action, and should not compete with the
   passphrase field for attention. It becomes prominent only when the pinned code
   has actually changed. */
.code-id {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.code-id > .row {
  gap: var(--space-3);
}
/* Long hex must be allowed to break rather than force the card wider on a
   narrow phone. */
#code-id-value {
  color: var(--text-faint);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  text-align: right;
}
.code-id .help {
  margin-top: var(--space-3);
}
.warn-inline {
  margin: var(--space-3) 0 0;
  padding: var(--space-3);
  border: 1px solid color-mix(in srgb, var(--warning) 45%, var(--border));
  border-radius: var(--radius-md);
  color: var(--warning);
  background: var(--warning-subtle);
  font-size: var(--text-sm);
  line-height: 1.45;
}
#code-id-actions {
  margin-top: var(--space-3);
  flex-wrap: wrap;
}
/* Once the code has changed, the fingerprint itself stops being incidental. */
.code-id.changed #code-id-value {
  color: var(--warning);
}
/* =============================================================================
   Dense table dashboard
   Mirrors the desktop app (`npm run serve`): dark cards, uppercase column
   heads, tabular figures, both AUD and USD unit prices. Eight columns cannot
   fit on a phone honestly, so below 52rem the same markup folds into a
   four-line block per row -- no duplicate markup, nothing hidden that matters.
   ========================================================================== */
.stats {
  display: grid;    grid-template-columns: minmax(13rem, 1.25fr) repeat(auto-fit, minmax(9.5rem, 1fr));    gap: var(--space-5) var(--space-6);
  margin: var(--space-4);    padding: var(--space-5) var(--space-6);    border: 1px solid var(--border);    border-radius: var(--radius-lg);    background: var(--surface);
}
.stat {
  display: grid;    align-content: start;    gap: var(--space-1);    min-width: 0;
}
.stat-k {
  color: var(--text-faint);    font-size: var(--text-xs);    font-weight: 650;    letter-spacing: 0.08em;    text-transform: uppercase;
}
.stat-v {
  overflow-wrap: anywhere;    color: var(--text);    font-size: var(--text-lg);    font-weight: 700;    font-variant-numeric: tabular-nums lining-nums;    line-height: 1.15;
}
.stat-grand .stat-v {
  /* Never wrap: a total broken across two lines reads as a different number.
     The clamp shrinks the type instead, which is the honest trade. */
  overflow-wrap: normal;    white-space: nowrap;    font-size: clamp(1.35rem, 0.75rem + 1.9vw, 2rem);    letter-spacing: -0.03em;
}
.stat-v-sm {
  color: var(--text-muted);    font-size: var(--text-sm);    font-weight: 600;
}
.stat-sub {
  display: flex;    flex-wrap: wrap;    align-items: center;    gap: var(--space-2);    min-height: 1.25rem;    font-size: var(--text-xs);
}
.stat .cur {
  color: var(--text-faint);    font-weight: 600;
}
/* ---- panels as cards ---- */
.panel {
  margin: var(--space-4);    padding: var(--space-5) var(--space-6) var(--space-4);    border: 1px solid var(--border);    border-radius: var(--radius-lg);    background: var(--surface);
}
.panel-head {
  margin-bottom: var(--space-3);
}
.panel-head h2 {
  font-size: var(--text-sm);    font-weight: 720;    letter-spacing: 0.09em;    text-transform: uppercase;
}
.panel-head h2 .muted {
  font-size: var(--text-xs);    letter-spacing: 0.04em;    text-transform: none;
}
#panel-koinly {
  background: var(--surface);
}
/* ---- the grid itself ---- */
.table {
  --cols:
    minmax(4rem, 1fr) minmax(4.5rem, 1fr) minmax(5rem, 1fr) minmax(5rem, 1fr)
    minmax(5.5rem, 1.15fr) minmax(4rem, 0.85fr) minmax(3rem, 0.85fr) 3.5rem;
}
.row-head,
.row-item {
  display: grid;    grid-template-columns: var(--cols);    gap: var(--space-3);    align-items: center;
}
.row-head {
  padding: 0 0 var(--space-2);    border-bottom: 1px solid var(--hairline);    color: var(--text-faint);    font-size: var(--text-xs);    font-weight: 650;    letter-spacing: 0.08em;    text-transform: uppercase;
}
.row-head span {
  overflow: hidden;    text-overflow: ellipsis;    white-space: nowrap;
}
.row-head .c-amt,
.row-head .c-unit,
.row-head .c-usd,
.row-head .c-val,
.row-head .c-chg {
  text-align: right;
}
.row-head i {
  color: var(--text-faint);    font-style: normal;    font-weight: 500;
}
.rows {
  border-top: 0;
}
.row-item {
  min-height: 2.85rem;    padding: var(--space-2) 0;    border-bottom: 1px solid var(--hairline);
}
.row-item > span {
  min-width: 0;    overflow: hidden;    text-overflow: ellipsis;    white-space: nowrap;
}
.row-item .num {
  color: var(--text-muted);    font-size: var(--text-sm);    font-variant-numeric: tabular-nums lining-nums;    text-align: right;
}
.row-item .c-val {
  color: var(--text);    font-weight: 680;
}
.row-item .sym {
  border-color: transparent;    color: var(--accent);    background: var(--accent-subtle);    font-size: var(--text-xs);
}
.row-item .c-note {
  color: var(--text-muted);    font-size: var(--text-xs);
}
.c-chg.up {
  color: var(--positive);
}
.c-chg.down {
  color: var(--negative);
}
.c-chg.up::before {
  content: "▲ ";    font-size: 0.7em;
}
.c-chg.down::before {
  content: "▼ ";    font-size: 0.7em;
}
.c-act {
  text-align: right;
}
.warn-note {
  color: var(--warning);
}
/* A snapshot price is named rather than only dimmed: on a phone there is no
   hover, and a row the vault cannot re-price live is worth saying out loud. */
.stale {
  opacity: 1;
}
.stale .c-unit,
.stale .c-usd,
.stale .c-val {
  color: var(--text-muted);
}
.stale-flag {
  margin-left: 0.4rem;    padding: 0.05rem 0.3rem;    border-radius: 0.25rem;    color: var(--warning);    background: var(--warning-subtle);    font-size: 0.65rem;    font-weight: 700;    letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* ---- totals row ---- */
.panel-total {
  min-height: 2.5rem;    margin-top: 0;    padding-top: var(--space-3);    border-top: 1px solid var(--border);
}
.panel-total .muted {
  /* inline-flex drops the whitespace between "Total" and the count, so the gap
     has to be declared rather than typed. */
  display: inline-flex;    gap: 0.28rem;    padding: 0.1rem 0.45rem;    border-radius: 0.3rem;    color: var(--text-muted);    background: var(--surface-strong);    font-size: var(--text-xs);    font-weight: 650;    letter-spacing: 0.04em;
}
/* ---- app-bar theme toggle ---- */
.btn.tiny {
  min-height: 1.95rem;    padding: 0.15rem 0.55rem;    font-size: var(--text-xs);    font-weight: 650;
}
.btn.ghost {
  border: 1px solid var(--border);    color: var(--text-muted);    background: var(--surface);
}
.btn.ghost:hover {
  border-color: var(--border-strong);    color: var(--text);
}
/* Settings list: the label and its metadata were running together
   ("Passphrasepassphrase · added 20 min ago") because both are inline. */
.unlocker-info {
  display: grid;    gap: 0.15rem;    min-width: 0;
}
/* The panels carry their own frame now, so the shell must not add a second. */
@media (min-width: 44rem) {
  #screen-app {
    border: 0;      border-radius: 0;      background: transparent;      box-shadow: none;
  }
}
/* ---- phone: four lines per row, nothing dropped ---- */
@media (max-width: 52rem) {
  .stats,
  .panel {
    margin: var(--space-3);      padding: var(--space-4);
  }
  .row-head {
    display: none;
  }
  .row-item {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "sym  val"
      "amt  unit"
      "usd  chg"
      "note act";
    row-gap: 0.1rem;      column-gap: var(--space-3);      min-height: 0;      padding: var(--space-3) 0;
  }
  .row-item .c-sym  { grid-area: sym; }
  .row-item .c-val  { grid-area: val; font-size: var(--text-base); }
  .row-item .c-amt  { grid-area: amt; text-align: left; }
  .row-item .c-unit { grid-area: unit; }
  .row-item .c-usd  { grid-area: usd; text-align: left; font-size: var(--text-xs); }
  .row-item .c-chg  { grid-area: chg; font-size: var(--text-xs); }
  .row-item .c-note { grid-area: note; white-space: normal; }
  .row-item .c-act  { grid-area: act; }
  .row-item .row-edit {
    grid-column: auto;      min-height: 2rem;
  }
}
/* The rolled-up tail of a long list. Muted, and clearly a control. */
.row-more {
  border-bottom: 0;
}
.more-toggle {
  padding: 0.1rem 0;    color: var(--accent);    background: transparent;    cursor: pointer;    font-size: var(--text-xs);    font-weight: 680;    letter-spacing: 0.02em;
}
.more-toggle:hover {
  color: var(--accent-strong);    text-decoration: underline;    text-underline-offset: 0.2em;
}
.row-more .num {
  color: var(--text-faint);
}

/* Between phone and full desktop, five stats no longer fit on one line and the
   fifth wraps alone with three empty columns beside it. Three across wraps
   3 + 2, which still reads as a grid. */
@media (min-width: 34rem) and (max-width: 72rem) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------------------------------------------------------------------------
 * Multi-tenant additions
 * ------------------------------------------------------------------------ */

/* Brand heading -- larger, tighter than the default h1 used on the setup
 * screen. Applied to signup/login/FAQ where StealthLedger is the wordmark. */
.brand-heading {
  font-size: clamp(1.5rem, 2.4vw + 1rem, 2rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.35em;
}

/* Cross-screen link row under the primary action. */
.center { text-align: center; }
.small { font-size: 0.9rem; }
.card a { color: var(--fg); text-decoration: underline; }
.card a:hover { color: var(--accent); }

/* FAQ */
.card.wide { max-width: 720px; }
.faq { margin: 1.5em 0; }
.faq details {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6em 0.9em;
  margin-bottom: 0.5em;
  background: var(--card-2);
}
.faq details[open] { border-color: var(--accent-dim, var(--border)); }
.faq summary {
  cursor: pointer;
  font-weight: 500;
  padding: 0.15em 0;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+";
  display: inline-block;
  width: 1.2em;
  color: var(--muted);
  transition: transform 0.15s;
}
.faq details[open] summary::before { content: "\2212"; }
.faq p, .faq ul {
  margin: 0.6em 0 0.2em;
  line-height: 1.55;
  color: var(--fg-2, var(--fg));
}
.faq ul { padding-left: 1.2em; }
.faq li { margin: 0.25em 0; }

/* FAQ donate panel styles used to live here. The FAQ page no longer
 * hosts a donate card -- donations are only surfaced on the home page
 * via .home-donate-*, so this whole block was dead CSS. */

/* Row layout helpers used by settings account group + FAQ header. */
.row.between { display: flex; justify-content: space-between; align-items: center; gap: 1em; }

/* Admin panel */

/* Sub-sections: give each group (Signup gate / Invites / Users) a visible
 * shelf so the whole screen doesn't read as one loose list. */
.admin-section {
  padding: 1em 1.1em 1.15em;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  margin-top: 1.1em;
}
.admin-section > h3 {
  margin: 0 0 0.15em;
  font-size: 1rem;
}
.admin-section > .muted.small { margin-top: 0; }

/* Stat cards -- tighter block so the value sits under its label instead of
 * floating in the middle of a giant box. */
.admin-stats {
  display: grid;
  gap: 0.7em;
  grid-template-columns: 1fr;
  margin: 0.4em 0 0.6em;
}
@media (min-width: 560px) {
  .admin-stats { grid-template-columns: repeat(3, 1fr); }
}
.admin-stat {
  padding: 0.7em 0.9em;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-2);
  display: flex;
  flex-direction: column;
  gap: 0.15em;
  min-height: 0;
}
.admin-stat > .muted { font-size: 0.85em; }
.admin-stat strong {
  font-size: 1.55rem;
  line-height: 1.15;
  display: block;
  margin-top: 0.05em;
}
.admin-stat > .muted.small { margin-top: 0.15em; font-size: 0.75em; opacity: 0.75; }
.admin-stat.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

/* Signup-mode chip row: pressed state so it's obvious which mode is live. */
.admin-mode-row { margin-top: 0.6em; }
.admin-mode-btn.is-active {
  border-color: var(--accent);
  background: color-mix(in oklch, var(--accent) 15%, var(--card-2));
  color: var(--fg);
}

/* Invites list */
/* Toolbar sitting above the invites list: "Show used" toggle on the
 * left, live summary count on the right. Keeps the visual weight of the
 * card low when there are lots of redeemed invites in the ledger. */
.admin-invites-toolbar {
  margin-top: 0.6em;
  align-items: center;
  justify-content: space-between;
}
/* The global `input, select { width:100%; min-height:2.875rem }` rule
 * also lands on our checkbox and blows it up into a huge form field.
 * Reset it to a normal-sized native checkbox inside the toggle label,
 * and keep the label + text on one line rather than wrapping into a
 * tall column next to the giant box. */
.admin-invites-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.admin-invites-toggle input[type="checkbox"] {
  appearance: auto;
  width: 1rem;
  height: 1rem;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
  flex: 0 0 auto;
  cursor: pointer;
}
.admin-invites-toggle > span {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.2;
}

/* Invites list: single column on narrow screens, 2-up when the admin
 * card is wide, 3-up on very wide displays. auto-fill+minmax means the
 * grid just picks the right count and every card gets the same width. */
.admin-invites {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 0.8em;
}
@media (min-width: 900px) {
  .admin-invites {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 14px;
  }
}
.admin-invite {
  padding: 0.8em 0.9em;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-2);
  display: flex;
  flex-direction: column;
  gap: 0.55em;
}
.admin-invite-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95em;
  color: var(--fg);
  letter-spacing: 0.01em;
  flex: 1 1 auto;
  min-width: 0;
  /* overflow-wrap:anywhere lets a long code wrap when it truly runs out
   * of horizontal room, without breaking every single letter onto its
   * own line the way word-break:break-all would in a narrow flex slot. */
  overflow-wrap: anywhere;
}
.admin-invite-status {
  font-size: 0.75em;
  color: var(--muted);
  flex: 0 0 auto;
  white-space: nowrap;
  text-align: right;
  line-height: 1.35;
}
/* Signup URL input should always fill the row rather than sit in a
 * narrow column with dead space to its right. Belt-and-braces alongside
 * the width:100% already on the input. */
.admin-invite > div { min-width: 0; }
.admin-invite-link { max-width: 100%; box-sizing: border-box; }
.admin-invite-link-label {
  display: block;
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.25em;
}
.admin-invite-link {
  width: 100%;
  padding: 0.5em 0.65em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82em;
  cursor: text;
}
.admin-invite-link:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* --- Admin > Users list -------------------------------------------------- */
.admin-users-actions { margin: 0.2em 0 0.8em; align-items: center; }
.admin-users { display: flex; flex-direction: column; gap: 0.6em; margin-top: 0.4em; }
.admin-user {
  padding: 0.8em 0.95em 0.85em;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-2);
  display: flex;
  flex-direction: column;
  gap: 0.6em;
}
.admin-user-head { display: flex; justify-content: space-between; align-items: center; gap: 0.8em; }
.admin-user-name { font-weight: 600; font-size: 1.02em; letter-spacing: 0.01em; }

/* Meta grid: labelled key/value pairs. Auto-fills so 3 items wrap tidily. */
.admin-user-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.35em 0.9em;
  padding: 0.15em 0;
}
.admin-user-meta > div { display: flex; flex-direction: column; gap: 0.05em; }
.admin-user-meta .k {
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.admin-user-meta .v { font-size: 0.88em; color: var(--fg); }
.admin-user-meta .v.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78em;
  overflow-wrap: anywhere;
}

.admin-user-status {
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2em 0.7em;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.admin-user-status-vault { background: rgba(80, 180, 120, 0.18); border-color: rgba(80, 180, 120, 0.45); color: #a7e8bc; }
.admin-user-status-pending { background: rgba(220, 160, 60, 0.18); border-color: rgba(220, 160, 60, 0.45); color: #f2d199; }

/* --- Unlock screen ------------------------------------------------------- */
/* The old unlock screen was a naked "Unlock" heading over a passphrase
 * field: no branding, no context, no way out. These bits fix that. */
.unlock-brand {
  display: flex;
  align-items: center;
  gap: 0.55em;
  margin-bottom: 0.3em;
}
.unlock-wordmark {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--fg);
}
.unlock-subtitle {
  margin: -0.15em 0 0.75em;
  line-height: 1.45;
}
.unlock-account {
  margin: 0 0 0.9em;
  font-size: 0.88em;
  color: var(--muted);
}
.unlock-account strong { color: var(--fg); font-weight: 600; }

/* Session-expired welcome-back banner on login. Uses the same colour as
 * warn accents so it reads as ‘informational, not an error’. */
.login-resume {
  margin: 0.4em 0 0.9em;
  padding: 0.55em 0.75em;
  border: 1px solid color-mix(in oklch, var(--accent) 45%, var(--border));
  border-radius: 8px;
  background: color-mix(in oklch, var(--accent) 10%, var(--card-2));
  color: var(--fg);
  font-size: 0.88em;
  line-height: 1.4;
}
.login-resume strong { font-weight: 600; }
.unlock-exit {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.55em;
  margin-top: 0.9em;
  padding-top: 0.75em;
  border-top: 1px solid var(--border);
}

/* --- Koinly import preview + bridge page --------------------------------- */
.koinly-preview {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4em 0.6em;
  margin: 0.6em 0;
  background: var(--card);
}
.koinly-preview-row {
  padding: 0.25em 0;
  border-bottom: 1px solid var(--border);
}
.koinly-preview-row:last-child { border-bottom: 0; }
body.bridge { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2em 1em; }
.bridge-card { max-width: 460px; margin: 0 auto; }
.bridge-cta { margin-top: 1em; }
.bridge-help { margin-top: 1.5em; }

/* --- Auth mode selector (passkey vs passphrase on signup) ----------------
 *
 * Radios sit tight against a full-width text column. Everything inside the
 * fieldset behaves like a normal form row -- no flex stretching, no columns
 * of empty space next to the label.
 */
.auth-mode-select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6em 0.9em 0.7em;
  margin: 0 0 1em;
  background: var(--card-2);
  min-width: 0;
}
.auth-mode-select > legend {
  padding: 0 0.4em;
  font-size: 0.85rem;
  font-weight: 600;
}
.auth-mode-option {
  display: grid;
  grid-template-columns: 1.25em 1fr;
  align-items: start;
  column-gap: 0.7em;
  padding: 0.5em 0.25em;
  cursor: pointer;
  border-radius: 8px;
  line-height: 1.4;
}
.auth-mode-option + .auth-mode-option { margin-top: 0.15em; }
.auth-mode-option:hover { background: rgba(255, 255, 255, 0.03); }
.auth-mode-option input[type="radio"] {
  /* The global input rule (width:100%, min-height:2.875rem, padding, border,
   * background) applies to type=radio and blows out the layout -- reset it
   * back to a native radio. */
  appearance: radio;
  -webkit-appearance: radio;
  width: 1.05em;
  min-width: 0;
  height: 1.05em;
  min-height: 0;
  margin: 0.28em 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: revert;
  transition: none;
  flex: none;
  accent-color: var(--accent);
}
.auth-mode-option input[type="radio"]:focus,
.auth-mode-option input[type="radio"]:hover {
  border: 0;
  box-shadow: none;
  background: transparent;
}
.auth-mode-option > span {
  min-width: 0;
  display: block;
}
.auth-mode-option strong { font-weight: 600; }
.auth-mode-option .field-hint {
  display: block;
  margin-top: 0.15em;
}

/* =============================================================================
   Home / marketing landing screen (#screen-home)
   Shown as the default logged-out view on the multi-tenant deploy.
   ========================================================================== */
html:has(#screen-home:not([hidden])) {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}
#screen-home a { text-decoration: none; }
#screen-home p a,
#screen-home dd a { text-decoration: underline; text-underline-offset: 0.15em; }
#screen-home {
  display: block;
  place-items: initial;
  padding: 0;
  background:
    radial-gradient(circle at 15% -10%, var(--accent-subtle), transparent 32rem),
    radial-gradient(circle at 100% 0%, rgba(129, 213, 229, 0.06), transparent 28rem),
    var(--bg);
  color: var(--text);
}
.home-screen {
  --home-max: 72rem;
  --home-gutter: clamp(1.25rem, 3vw, 2.5rem);
}

/* --- Nav ------------------------------------------------------------------ */
.home-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: var(--space-5);
  max-width: var(--home-max);
  margin: 0 auto;
  padding: var(--space-4) var(--home-gutter);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.home-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.home-brand .brand-mark.small { width: 1.5rem; }
.home-brand-name { font-size: 1.05rem; }
.home-nav-links {
  display: flex;
  gap: var(--space-6);
  margin-left: auto;
}
.home-nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  padding: 0.35rem 0;
  transition: color var(--ease);
}
.home-nav-links a:hover,
.home-nav-links a:focus-visible {
  color: var(--text);
  outline: none;
}
.home-nav-cta {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
@media (max-width: 44rem) {
  .home-nav-links { display: none; }
  .home-nav { gap: var(--space-2); padding-inline: var(--space-3); }
  /* Both CTAs stay visible on mobile — returning users need the Log in
   * button above the fold. Force single-line labels and shrink padding so
   * they fit on a 320px viewport (iPhone SE, small Android) without
   * wrapping to two lines. */
  .home-nav-cta { gap: var(--space-1); flex-shrink: 0; }
  .home-nav-cta .btn {
    padding-inline: 0.7em;
    font-size: 0.82em;
    white-space: nowrap;
  }
  /* Shorten the brand wordmark so it doesn’t push CTAs off-screen on very
   * narrow viewports. On mobile the mark alone is plenty for context. */
  .home-brand-name { font-size: 0.95em; }
}

@media (max-width: 22rem) {
  /* Extra squeeze for the smallest phones: mark only, no wordmark. */
  .home-brand-name { display: none; }
}

/* --- Hero ----------------------------------------------------------------- */
.home-hero {
  max-width: var(--home-max);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) var(--home-gutter) clamp(2rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
@media (max-width: 60rem) {
  .home-hero { grid-template-columns: 1fr; }
  .home-hero-panel { order: -1; }
}
.home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 var(--space-4);
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.home-eyebrow-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-subtle);
}
.home-hero-title {
  font-size: clamp(2rem, 4.6vw, 3.35rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-5);
  font-weight: 650;
}
.home-hero-title-accent { color: var(--accent-strong); }
.home-hero-sub {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--text-muted);
  margin: 0 0 var(--space-7);
  max-width: 34rem;
  line-height: 1.55;
}
.home-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-7);
}
.home-hero-cta .btn { min-width: 12rem; }
.home-hero-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.home-hero-facts li {
  padding-left: 1.25rem;
  position: relative;
}
.home-hero-facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.home-hero-facts strong { color: var(--text); font-weight: 600; }

/* --- Terminal side panel ------------------------------------------------- */
.home-hero-panel { width: 100%; }
.home-terminal {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-raised) 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.home-terminal-chrome {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-strong);
}
.home-terminal-chrome > span:not(.home-terminal-title) {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--border-strong);
}
.home-terminal-title {
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-faint);
}
.home-terminal-body {
  margin: 0;
  padding: 1.1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}
.home-terminal-body .c-key { color: var(--accent); }
.home-terminal-body .c-str { color: var(--positive); }
.home-terminal-body .c-num { color: var(--warning); }
.home-terminal-body .c-muted { color: var(--text-faint); font-style: italic; }

/* --- Feature band -------------------------------------------------------- */
.home-band {
  max-width: var(--home-max);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) var(--home-gutter);
}
.home-band-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--space-5);
}
.home-feature {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: var(--surface);
  transition: transform var(--ease), border-color var(--ease);
}
.home-feature:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.home-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--accent-subtle);
  color: var(--accent-strong);
  margin-bottom: var(--space-4);
}
.home-feature h3 {
  margin: 0 0 var(--space-2);
  font-size: 1.05rem;
  letter-spacing: -0.005em;
}
.home-feature p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}

/* --- Section heading pattern -------------------------------------------- */
.home-section-head {
  max-width: 44rem;
  margin: 0 auto var(--space-8);
  text-align: center;
}
.home-section-eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--accent);
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.home-section-head h2 {
  margin: 0 0 var(--space-3);
  font-size: clamp(1.5rem, 2.6vw, 2.15rem);
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.home-section-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

/* --- How it works -------------------------------------------------------- */
.home-how {
  max-width: var(--home-max);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) var(--home-gutter);
}
.home-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: home-step;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-5);
}
.home-step {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5) var(--space-5);
  background: var(--surface);
}
.home-step-num {
  position: absolute;
  top: -0.9rem;
  left: var(--space-5);
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  box-shadow: 0 0 0 4px var(--bg);
}
.home-step h3 {
  margin: 0 0 var(--space-2);
  font-size: 1.1rem;
}
.home-step p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}
.home-step em {
  font-style: normal;
  color: var(--accent-strong);
}

/* --- Under the hood ------------------------------------------------------ */
.home-security {
  background:
    linear-gradient(180deg, transparent, color-mix(in oklab, var(--bg-raised) 55%, transparent) 20%, color-mix(in oklab, var(--bg-raised) 55%, transparent) 80%, transparent);
  padding: clamp(2rem, 5vw, 4.5rem) var(--home-gutter);
}
.home-security > .home-section-head,
.home-security > .home-crypto-grid {
  max-width: var(--home-max);
  margin-left: auto;
  margin-right: auto;
}
.home-crypto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.home-crypto-cell {
  background: var(--surface);
  padding: var(--space-5);
}
.home-crypto-cell dt {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 var(--space-2);
}
.home-crypto-cell dd {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}

/* --- Final CTA ----------------------------------------------------------- */
.home-cta {
  max-width: var(--home-max);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) var(--home-gutter);
}
.home-cta-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(2rem, 4vw, 3rem);
  text-align: center;
  background:
    radial-gradient(circle at 30% 0%, var(--accent-subtle), transparent 24rem),
    var(--surface);
}
.home-cta-card h2 {
  margin: 0 0 var(--space-3);
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  letter-spacing: -0.015em;
}
.home-cta-card .muted { max-width: 34rem; margin: 0 auto var(--space-6); }
.home-cta-buttons {
  display: inline-flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}
.home-cta-buttons .btn { min-width: 12rem; }

/* --- Home donations panel ----------------------------------------------- */
/* Shiny, unmissable support card. Sits between the CTA and the footer;
 * hydrateHomeDonate() flips the `hidden` bit only when the operator has
 * configured an XMR address so the section never renders empty.
 *
 * Colour token: Monero uses a warm orange (#f26822). Injected here as a
 * local variable so nothing else picks it up. */
.home-donate {
  --xmr: #f26822;
  --xmr-glow: rgba(242, 104, 34, 0.28);
  --xmr-glow-strong: rgba(242, 104, 34, 0.55);
  max-width: var(--home-max);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) var(--home-gutter);
}
/* Outer wrapper carries a conic gradient border effect. The `card`
 * itself is a solid surface layered on top; the wrapper's padding is
 * the border thickness. Slightly slower/hover-brighter gradient makes
 * it feel alive without being a distracting animation loop. */
.home-donate-card {
  position: relative;
  border-radius: calc(var(--radius-xl) + 4px);
  padding: 1px;
  background:
    conic-gradient(
      from 140deg,
      var(--xmr) 0deg,
      var(--accent) 90deg,
      var(--xmr) 180deg,
      transparent 210deg,
      var(--xmr) 300deg,
      var(--xmr) 360deg
    );
  box-shadow:
    0 20px 40px -20px var(--xmr-glow),
    0 10px 30px -18px rgba(0, 0, 0, 0.55);
  transition: box-shadow 220ms ease;
}
.home-donate-card:hover {
  box-shadow:
    0 24px 48px -18px var(--xmr-glow-strong),
    0 14px 34px -18px rgba(0, 0, 0, 0.62);
}
/* Soft radial glow that sits behind the card content -- gives the
 * whole panel a warm halo that scales with viewport width. Pointer
 * events off so it never blocks clicks on the address or buttons. */
.home-donate-glow {
  position: absolute;
  inset: -40px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 55% at 15% 40%, var(--xmr-glow) 0%, transparent 65%),
    radial-gradient(50% 60% at 85% 60%, var(--accent-subtle) 0%, transparent 70%);
  filter: blur(10px);
  opacity: 0.9;
}
.home-donate-inner {
  position: relative;
  border-radius: var(--radius-xl);
  padding: clamp(1.6rem, 3.6vw, 2.4rem);
  background:
    radial-gradient(circle at 12% -10%, rgba(242, 104, 34, 0.10), transparent 22rem),
    radial-gradient(circle at 100% 100%, var(--accent-subtle), transparent 20rem),
    var(--surface);
}
.home-donate-head {
  text-align: center;
  margin-bottom: clamp(1.2rem, 3vw, 1.8rem);
}
.home-donate-head h2 {
  margin: 0.15rem 0 var(--space-3);
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  letter-spacing: -0.015em;
}
/* Eyebrow "Support the project" picks up the XMR orange for one clear
 * visual cue that this section is about donating specifically. */
.home-donate .home-section-eyebrow {
  color: var(--xmr);
  text-shadow: 0 0 12px var(--xmr-glow);
}
.home-donate-sub {
  max-width: 42rem;
  margin: 0 auto;
  color: var(--text-muted);
  line-height: 1.55;
}
/* Two-column body on desktop: coin badge on the left, address + actions
 * on the right. Stacks under 640px so the coin sits above the address
 * on mobile. */
.home-donate-body {
  display: grid;
  gap: clamp(1.2rem, 3vw, 2rem);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 640px) {
  .home-donate-body {
    grid-template-columns: auto 1fr;
  }
}
.home-donate-coin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  justify-self: center;
}
.home-donate-coin-mark {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff8236 0%, #f26822 55%, #c94a10 100%);
  color: #fff;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  box-shadow:
    0 12px 24px -8px var(--xmr-glow-strong),
    inset 0 -2px 6px rgba(0, 0, 0, 0.25),
    inset 0 2px 4px rgba(255, 255, 255, 0.28);
}
.home-donate-coin-label {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.home-donate-addr-wrap {
  min-width: 0;  /* let long addresses wrap inside the grid cell */
}
.home-donate-addr-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.home-donate-addr {
  display: block;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 10px);
  background: var(--field);
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.45;
  word-break: break-all;
  overflow-wrap: anywhere;
  user-select: all;  /* one triple-click selects the whole address */
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.home-donate-addr:hover,
.home-donate-addr:focus-visible {
  border-color: var(--xmr);
  box-shadow: 0 0 0 3px var(--xmr-glow);
  outline: none;
}
.home-donate-actions {
  margin-top: 0.9rem;
  align-items: center;
}
/* Copy button picks up an XMR-tinted hover so the click target reads
 * as "the button that copies THIS address" rather than a generic btn. */
#home-donate-copy {
  background: linear-gradient(135deg, #ff8236 0%, #f26822 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px -8px var(--xmr-glow-strong);
}
#home-donate-copy:hover {
  filter: brightness(1.08);
  box-shadow: 0 12px 22px -8px var(--xmr-glow-strong);
}
#home-donate-copy:active { transform: translateY(1px); }
.home-donate-meta {
  margin-top: 0.6rem;
}

/* --- Footer -------------------------------------------------------------- */
.home-footer {
  border-top: 1px solid var(--hairline);
  margin-top: var(--space-4);
}
.home-footer-inner {
  max-width: var(--home-max);
  margin: 0 auto;
  padding: var(--space-6) var(--home-gutter) var(--space-8);
  display: grid;
  gap: var(--space-4);
  grid-template-columns: auto 1fr auto;
  align-items: center;
}
@media (max-width: 40rem) {
  .home-footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
}
.home-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 600;
}
.home-footer-brand .brand-mark.small { width: 1.25rem; }
.home-footer-links {
  display: flex;
  gap: var(--space-6);
  justify-content: center;
}
.home-footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
}
.home-footer-links a:hover,
.home-footer-links a:focus-visible {
  color: var(--text);
}
.home-footer-fine { grid-column: 1 / -1; margin: var(--space-3) 0 0; text-align: center; }
/* Copyright line sits centered directly under the fine-print liability
 * note, one grid row down. Slightly quieter than the fine print. */
.home-footer-copy {
  grid-column: 1 / -1;
  margin: 0.35rem 0 0;
  text-align: center;
  color: var(--text-faint);
}

/* --- Motion sensitivity -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .home-feature { transition: none; }
  .home-feature:hover { transform: none; }
}

/* Invite-only hint below the hero CTAs. Small, dim, but with a colored chip
   so it registers as "context, not decoration". */
.home-hero-invite {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: calc(var(--space-4) * -1) 0 var(--space-6);
  color: var(--text-muted);
}
.home-invite-badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Small "back to home" affordance at the top of the login/signup cards.
   Sits above the heading so a first-time visitor never feels trapped. */
.card-back {
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
}
.link-back {
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color var(--ease);
}
.link-back:hover,
.link-back:focus-visible {
  color: var(--text);
  outline: none;
}

/* Inline FAQ on the marketing home (matches home-* section rhythm). */
.home-faq {
  padding: var(--space-16) var(--home-pad);
  max-width: var(--home-max);
  margin: 0 auto;
}
.home-faq-grid {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-8);
}
.home-faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  padding: var(--space-4) var(--space-5);
  transition: border-color var(--ease);
}
.home-faq-item[open] {
  border-color: var(--border-strong);
}
.home-faq-item > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.home-faq-item > summary::-webkit-details-marker { display: none; }
.home-faq-item > summary::after {
  content: "+";
  font-weight: 400;
  color: var(--text-muted);
  transition: transform var(--ease);
}
.home-faq-item[open] > summary::after { content: "\2013"; }
.home-faq-item > p,
.home-faq-item > ul {
  margin-top: var(--space-3);
  color: var(--text-muted);
  line-height: 1.6;
}
.home-faq-item ul { padding-left: var(--space-5); }
.home-faq-item li + li { margin-top: var(--space-2); }

/* Product showcase on the marketing home. Shows an actual portfolio
   screenshot with feature callouts underneath, so first-time visitors
   see what the thing looks like, not just what it claims. */
.home-showcase {
  padding: var(--space-16) var(--home-pad);
  max-width: var(--home-max);
  margin: 0 auto;
}
.home-showcase-figure {
  margin: var(--space-8) 0 0;
  padding: 0;
}
.home-showcase-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.6);
  background: var(--surface-1);
}
.home-showcase-figure figcaption {
  margin-top: var(--space-3);
  text-align: center;
}
.home-showcase-points {
  list-style: none;
  padding: 0;
  margin: var(--space-8) 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4) var(--space-6);
}
.home-showcase-points li {
  color: var(--text-muted);
  line-height: 1.55;
  padding-left: var(--space-4);
  border-left: 2px solid var(--border);
}
.home-showcase-points strong {
  color: var(--text);
  font-weight: 600;
  display: block;
  margin-bottom: var(--space-1);
}

/* --- Privacy-coin splash strip (marketing home) ------------------------- */
.home-splash {
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(1200px 200px at 50% -40%, rgba(124,196,255,0.10), transparent 60%),
    linear-gradient(180deg, rgba(124,196,255,0.04), transparent 100%);
}
.home-splash-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 28px;
}
.home-splash-label {
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted, #9aa5b4);
  font-weight: 600;
}
.home-splash-coins {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}
.home-splash-coins li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 8px;
  border: 1px solid var(--border, #1a2432);
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text, #eef2f7);
}
.home-splash-coins li img {
  width: 16px;
  height: 16px;
  display: block;
}
.home-splash-more {
  color: var(--text-muted, #9aa5b4) !important;
  font-style: normal;
  padding-left: 11px !important;
}
@media (max-width: 640px) {
  .home-splash-inner { padding: 12px 16px; gap: 10px; }
  .home-splash-label { font-size: 11px; }
  .home-splash-coins li { font-size: 12px; padding: 4px 9px 4px 7px; }
}

/* ============================================================ */
/* Preview banner on #screen-home                                */
/* ============================================================ */
.home-preview-banner {
  margin: 12px auto 0;
  max-width: 900px;
  padding: 0 16px;
}
.home-preview-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(129, 213, 229, 0.10), rgba(129, 213, 229, 0.03)),
    var(--surface);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: 14px;
  line-height: 1.35;
}
.home-preview-banner-inner strong { color: var(--accent); }
.home-preview-banner-inner > span:last-of-type { flex: 1; }
.home-preview-banner-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-subtle);
  animation: pulse-dot 1.8s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.3); opacity: 0.7; }
}
@media (prefers-reduced-motion: reduce) {
  .home-preview-banner-dot { animation: none; }
}
@media (max-width: 640px) {
  .home-preview-banner-inner { flex-wrap: wrap; padding: 10px 12px; }
  .home-preview-banner-inner > span:last-of-type { flex: 1 1 100%; }
}

/* ============================================================ */
/* Signup — disclosure ("Advanced: add a memorised passphrase")  */
/* ============================================================ */
.disclosure {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  background: var(--surface);
  margin: 12px 0;
}
.disclosure > summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 500;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before {
  content: "▸";
  display: inline-block;
  width: 1em;
  color: var(--text-muted);
  transition: transform var(--ease);
}
.disclosure[open] > summary::before { transform: rotate(90deg); }
.disclosure > summary:hover { background: var(--surface-hover); }
.disclosure[open] > summary { border-bottom: 1px solid var(--border); }
.disclosure .disclosure-body {
  padding: 14px;
}

/* ============================================================ */
/* Field variants                                                */
/* ============================================================ */
.field-inline {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}
.field-inline > input,
.field-inline > select { flex: 1 1 200px; }

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  padding: 6px 0;
  line-height: 1.4;
}
.checkbox input[type="checkbox"] {
  width: auto;
  min-height: 0;
  margin-top: 3px;
  flex-shrink: 0;
}

/* ============================================================ */
/* Recovery-code display                                         */
/* ============================================================ */
.recovery-code {
  display: block;
  padding: 14px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: var(--field);
  color: var(--accent);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-align: center;
  word-break: break-all;
  margin: 8px 0;
}

/* ============================================================ */
/* card-inner (sections inside cards, e.g. signup recovery)     */
/* ============================================================ */
.card-inner {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  margin: 12px 0;
}

/* ============================================================ */
/* Pending-hint pill in Settings                                */
/* ============================================================ */
.pending-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin: 10px 0;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent-subtle);
  color: var(--text);
  font-size: 14px;
}
.pending-hint > span:first-child { flex: 1 1 260px; }

/* ============================================================ */
/* Admin — preview code section                                  */
/* ============================================================ */
.admin-preview-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 12px 0;
}
@media (min-width: 640px) {
  .admin-preview-row { grid-template-columns: 2fr 1fr; }
}
.admin-preview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.admin-preview-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-strong);
}
.admin-preview-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
}
.admin-preview-status-row strong { color: var(--text); }
.admin-preview-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.admin-preview-pill::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.admin-preview-pill-on {
  color: var(--positive);
  background: var(--positive-subtle);
}
.admin-preview-pill-off {
  color: var(--text-muted);
  background: var(--surface-strong);
  border: 1px solid var(--border);
}
.admin-preview-link-panel {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--field);
  margin-top: 8px;
}
.admin-preview-link-url {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--accent);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 13px;
  word-break: break-all;
  margin: 6px 0 10px;
  border: 1px solid var(--hairline);
}

/* ============================================================ */
/* Admin — wide-card layout                                      */
/* ============================================================ */
.card.wide {
  max-width: 1100px;
  padding: 28px 32px;
}
@media (min-width: 900px) {
  .card.wide .settings-group.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 28px;
    align-items: start;
  }
  .card.wide .settings-group.two-col > * { min-width: 0; }
}
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 10px 0;
}
.admin-stat-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-strong);
}
.admin-stat-card .label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.admin-stat-card .value {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

/* ============================================================ */
/* VIP signup hero — shown when arriving via a preview link      */
/* ============================================================ */
.vip-hero {
  position: relative;
  overflow: hidden;
  padding: 22px 22px 18px;
  margin: 0 0 16px;
  border: 1px solid var(--accent);
  border-radius: 16px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(129, 213, 229, 0.22), transparent 60%),
    radial-gradient(120% 100% at 100% 100%, rgba(176, 234, 243, 0.14), transparent 55%),
    var(--surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: vip-hero-in 480ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes vip-hero-in {
  from { opacity: 0; transform: translateY(6px) scale(0.995); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.vip-hero::after {
  content: "";
  position: absolute;
  inset: -40% -40% auto auto;
  width: 240px; height: 240px;
  background: radial-gradient(closest-side, rgba(154, 228, 243, 0.28), transparent 70%);
  filter: blur(4px);
  pointer-events: none;
}
.vip-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent-subtle);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.vip-hero-badge::before {
  content: "★";
  color: var(--accent);
}
.vip-hero-title {
  font-size: 22px;
  line-height: 1.2;
  font-weight: 600;
  margin: 10px 0 4px;
  color: var(--text);
}
.vip-hero-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 6px;
}
.vip-hero-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.vip-hero-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(21, 26, 32, 0.55);
}
.vip-hero-meta strong { color: var(--text); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .vip-hero { animation: none; }
}

/* ============================================================ */
/* Admin — two-column layout on larger screens                   */
/* ============================================================ */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 960px) {
  .admin-grid {
    grid-template-columns: 1fr 1fr;
    gap: 22px 28px;
  }
  .admin-section-wide {
    grid-column: 1 / -1;  /* Users table gets the full width */
  }
}
.admin-section {
  min-width: 0;  /* prevent grid children from stretching to their content */
}
/* Wider card + gutters on the admin card at all breakpoints. The admin
 * panel is dashboard-shaped -- stats, config, invites list all side by
 * side -- so it wants more horizontal room than the vault card does.
 *
 * NOTE: `.card` sets `width: min(100%, 38rem)`, which clamps BEFORE
 * max-width takes effect. That means overriding max-width alone does
 * nothing -- the card stays 608px on desktop. We have to override the
 * width itself for the admin card. */
#screen-admin .card.wide {
  width: min(100%, 1200px);
  max-width: 1200px;
  padding: 24px 24px 28px;
}
@media (min-width: 900px) {
  #screen-admin .card.wide {
    padding: 32px 40px 36px;
  }
}
@media (min-width: 1400px) {
  #screen-admin .card.wide {
    width: min(100%, 1320px);
    max-width: 1320px;
  }
}
/* Denser stat cards inside the wider admin card */
#screen-admin .admin-stats {
  gap: 12px;
  margin-bottom: 8px;
}
@media (min-width: 640px) {
  #screen-admin .admin-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
  #screen-admin .admin-stats { grid-template-columns: repeat(4, 1fr); }
}

/* -----------------------------------------------------------------------
 * Danger zone (Settings > Account) + delete-account modal
 * --------------------------------------------------------------------- */
.danger-zone {
  margin-top: 24px;
  padding: 16px 18px 18px;
  border: 1px solid rgba(255, 90, 90, 0.28);
  border-radius: 12px;
  background: rgba(255, 60, 60, 0.05);
}
.danger-zone h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: #ff7a7a;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.danger-zone .note {
  margin: 0 0 12px;
  color: rgba(240, 220, 220, 0.75);
  line-height: 1.5;
}

/* Warning list inside the delete-account modal */
.warning-list {
  margin: 6px 0 14px;
  padding: 12px 16px 12px 32px;
  list-style: disc;
  border: 1px solid rgba(255, 90, 90, 0.28);
  border-radius: 10px;
  background: rgba(255, 60, 60, 0.06);
  color: rgba(240, 220, 220, 0.88);
}
.warning-list li {
  margin: 4px 0;
  line-height: 1.45;
}

/* Modal-specific tightening so the delete dialog reads urgent */
#modal-delete-account h2 {
  color: #ff7a7a;
}
#modal-delete-account .field-label strong {
  color: var(--fg, #fff);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}
#modal-delete-account #delete-account-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
#modal-delete-account .btn.danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* -----------------------------------------------------------------------
 * Setup screen mode chooser (Face ID / Touch ID vs. Passphrase)
 * --------------------------------------------------------------------- */
.setup-modes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 18px 0 12px;
}
@media (min-width: 520px) {
  .setup-modes { grid-template-columns: 1fr 1fr; }
}
.setup-mode-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 120ms ease, background 120ms ease, transform 60ms ease;
}
.setup-mode-btn:hover {
  border-color: rgba(120, 220, 220, 0.55);
  background: rgba(120, 220, 220, 0.06);
}
.setup-mode-btn:active { transform: scale(0.99); }
.setup-mode-btn.is-active,
.setup-mode-btn[aria-selected="true"] {
  border-color: rgba(120, 220, 220, 0.9);
  background: rgba(120, 220, 220, 0.09);
  box-shadow: 0 0 0 1px rgba(120, 220, 220, 0.35) inset;
}
.setup-mode-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.setup-mode-icon {
  flex: 0 0 auto;
  font-size: 1.4rem;
  line-height: 1.2;
}
.setup-mode-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.setup-mode-label strong {
  font-size: 0.98rem;
  color: var(--fg, #fff);
}
.setup-mode-hint {
  color: rgba(220, 220, 230, 0.7);
  font-size: 0.85rem;
  line-height: 1.35;
}
#setup-passkey-note {
  margin: 4px 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 190, 90, 0.08);
  border: 1px solid rgba(255, 190, 90, 0.25);
  color: rgba(255, 220, 180, 0.9);
  font-size: 0.85rem;
}
.setup-passkey-copy {
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(120, 220, 220, 0.06);
  border: 1px solid rgba(120, 220, 220, 0.22);
  color: rgba(220, 240, 245, 0.9);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* -----------------------------------------------------------------------
 * Login resume banner: "Not you? Sign in to a different account" link
 * --------------------------------------------------------------------- */
.login-resume-switch {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: rgba(120, 220, 220, 0.95);
}
.login-resume-switch:hover { text-decoration: underline; }
