/* ==========================================================================
   UnyKorn Private Network — member app
   Tokens per task-1-brief.md §7. Dark by default, light under
   prefers-color-scheme: light. Ember accent restricted to chevrons, the
   status dot and primary buttons. Hairlines, not shadows. 4px radius.
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/inter-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/inter-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/inter-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/inter-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/playfair-display-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/playfair-display-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ============ Design tokens ============ */
:root {
  --bg: #EEF3F8;
  --bg-stage: #E8EEF5;
  --bg-elevated: rgba(255,255,255,0.72);
  --bg-card: rgba(255,255,255,0.64);
  --bg-input: rgba(255,255,255,0.78);
  --hairline: rgba(255, 255, 255, 0.9);
  --hairline-strong: rgba(109, 94, 252, 0.28);
  --text-primary: #0F1B2A;
  --text-secondary: #3D5A6C;
  --text-tertiary: #68788A;
  --accent-silver: #6D5EFC;
  --accent-silver-dim: #38BDF8;
  --accent-orange: #A30D22;
  --accent-orange-soft: rgba(163, 13, 34, 0.12);
  --btn-primary-bg: linear-gradient(135deg,#6d5efc,#38bdf8 55%,#a30d22);
  --btn-primary-text: #FFFFFF;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --glass-shadow: 0 20px 50px -22px rgba(64,40,86,.28), 0 2px 6px -2px rgba(64,40,86,.10);
}

@media (prefers-color-scheme: light) { /* Morpho frost is default */
  :root {
    --bg: #F6F5F2;
    --bg-stage: #EDEBE5;
    --bg-elevated: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-input: #FBFAF8;
    --hairline: rgba(12, 14, 18, 0.11);
    --hairline-strong: rgba(12, 14, 18, 0.20);
    --text-primary: #14171C;
    --text-secondary: #52575F;
    --text-tertiary: #6B7078;
    --accent-silver: #6B7178;
    --accent-silver-dim: #9AA0A6;
    --accent-orange-soft: rgba(196, 63, 0, 0.10);
  }
}

/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg-stage);
  color: var(--text-primary);
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}
h1, h2, h3, p, dl, dd, dt, ul { margin: 0; }
ul { list-style: none; padding: 0; }
button { font-family: inherit; }
input { font-family: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============ Icon marks ============ */
.mark { display: block; flex-shrink: 0; }
.mark--sm { width: 20px; height: 20px; }
.mark--lg { width: 84px; height: 84px; }
.chev { width: 9px; height: 9px; color: var(--accent-orange); flex-shrink: 0; }
.icn { width: 16px; height: 16px; flex-shrink: 0; }
.tab-icn { width: 20px; height: 20px; flex-shrink: 0; }

/* ============ App shell (Universal: Mobile Native Fullscreen & Desktop Frame) ============ */
html, body {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  background: var(--bg-stage);
  box-sizing: border-box;
  overflow-x: hidden;
}

.app-shell {
  width: 100%;
  max-width: 440px;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border-radius: 0;
  border: none;
  position: relative;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
}

.screen {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 14px 20px;
  -webkit-overflow-scrolling: touch;
}

/* ============ App bar ============ */
.app-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
}
.app-bar__word {
  font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .15em;
  color: var(--text-primary); line-height: 1.3;
}
.app-bar__word small {
  display: block; font-size: 8.5px; font-weight: 600; letter-spacing: .16em;
  color: var(--text-tertiary); margin-top: 1px;
}
.app-bar__spacer { flex: 1 1 auto; }
.app-bar__avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated); border: 1px solid var(--hairline-strong);
  font-family: var(--sans); font-size: 11px; font-weight: 700; color: var(--text-secondary);
}

/* ============ Multi-Wallet & Currency Bar ============ */
.wallet-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 16px;
  background: rgba(255,255,255,.3);
  border-bottom: 1px solid var(--hairline);
  font-size: 12px;
  flex-shrink: 0;
}
.wallet-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.65);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  max-width: 240px;
}
.wallet-pill:hover { background: rgba(255,255,255,.9); transform: translateY(-1px); }
.wallet-status-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #10B981; flex-shrink: 0;
}
.wallet-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.curr-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(109,94,252,.12);
  border: 1px solid rgba(109,94,252,.3);
  color: #6d5efc;
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
}
.curr-pill:hover { background: rgba(109,94,252,.22); }
.ops-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(16,185,129,.12);
  border: 1px solid rgba(16,185,129,.35);
  color: #10B981;
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 700;
  font-size: 10px;
  cursor: pointer;
  transition: all .15s;
}
.ops-pill:hover { background: rgba(16,185,129,.25); transform: translateY(-1px); }

/* ============ Screen body ============ */
.screen {
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  display: flex;
  flex-direction: column;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 12px 16px 20px !important;
  box-sizing: border-box !important;
  outline: none;
}
.screen[hidden] { display: none !important; }

.screen-body {
  padding: 22px 22px 28px; flex: 1 1 auto; display: flex; flex-direction: column;
}
.screen-body--center { align-items: center; text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-tertiary); margin-bottom: 8px;
}
.screen-title {
  font-family: var(--serif); font-weight: 600; font-size: 21px; color: var(--text-primary);
  line-height: 1.3; margin-bottom: 20px;
}

/* ============ HOME ============ */
.member-name {
  font-family: var(--serif); font-weight: 600; font-size: 27px; color: var(--text-primary);
  letter-spacing: .005em; margin-bottom: 22px;
}
.position-block {
  padding: 18px 0 20px; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
}
.position-block .label { font-size: 12px; color: var(--text-tertiary); margin-bottom: 6px; }
.figure--xl {
  font-family: var(--serif); font-weight: 600; font-size: clamp(30px, 8vw, 36px);
  color: var(--text-primary); letter-spacing: -0.01em;
}

.balance-list { margin: 18px 0 26px; }
.balance-list li {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 13px 0; border-bottom: 1px solid var(--hairline);
}
.balance-list li:last-child { border-bottom: none; }
.balance-list .currency-block { display: flex; flex-direction: column; }
.balance-list .currency { font-size: 14px; font-weight: 600; color: var(--text-primary); letter-spacing: .02em; }
.balance-list .balance-sub { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }
.balance-list .amount { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--text-primary); }

.voice-block {
  display: flex; flex-direction: column; align-items: center;
  padding: 22px 0 8px;
}
.voice-btn {
  position: relative; width: 118px; height: 118px; margin: 14px 0 16px;
  border-radius: 50%; border: 1px solid var(--hairline-strong);
  background: var(--bg-elevated); color: var(--text-primary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform .15s ease, border-color .15s ease;
}
.voice-btn::before, .voice-btn::after {
  content: ""; position: absolute; border-radius: 50%; border: 1px solid var(--hairline); pointer-events: none;
}
.voice-btn::before { inset: -13px; }
.voice-btn::after { inset: -27px; opacity: .55; }
.voice-btn:hover { border-color: var(--accent-silver-dim); }
.voice-btn:active, .voice-btn[aria-pressed="true"] { transform: scale(.96); border-color: var(--accent-orange); }
.voice-btn[aria-pressed="true"]::before { border-color: var(--accent-orange-soft); }
.voice-btn svg { width: 32px; height: 32px; }
.voice-caption { font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--text-primary); }
.voice-hint { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; letter-spacing: .04em; }

.text-request { margin: 18px 0 20px; }
.text-request input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--hairline-strong);
  border-radius: 4px; padding: 13px 14px; font-size: 13.5px; color: var(--text-primary);
}
.text-request input::placeholder { color: var(--text-tertiary); }

.agent-status {
  display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 14px;
  font-size: 12px; color: var(--text-secondary);
}
.agent-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-orange); flex-shrink: 0; }

/* ============ APPROVAL ============ */
.agent-message {
  background: var(--bg-card); border: 1px solid var(--hairline); border-radius: 4px;
  padding: 16px; margin-bottom: 16px;
}
.agent-message__label {
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-tertiary);
  margin-bottom: 8px;
}
.agent-message__text {
  font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.4; color: var(--text-primary);
}
.agent-message__text strong { font-weight: 700; }

.mandate-note {
  display: flex; gap: 9px; align-items: flex-start; padding: 12px 2px 18px;
  color: var(--text-tertiary); font-size: 12px; line-height: 1.5; border-bottom: 1px solid var(--hairline);
  margin-bottom: 18px;
}
.mandate-note svg { margin-top: 1px; color: var(--accent-silver-dim); }

.detail-list { margin-bottom: 22px; }
.detail-list div {
  display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--hairline);
  font-size: 13px;
}
.detail-list div:last-child { border-bottom: none; }
.detail-list dt { color: var(--text-tertiary); }
.detail-list dd { color: var(--text-primary); font-weight: 500; text-align: right; }

.action-row { display: flex; gap: 12px; margin-top: auto; }
.action-row .btn { flex: 1 1 0; }

.btn {
  appearance: none; border-radius: 4px; padding: 14px 18px; font-size: 14px; font-weight: 600;
  letter-spacing: .01em; cursor: pointer; transition: opacity .15s ease, transform .1s ease;
  border: 1px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; border-color: var(--hairline-strong); color: var(--text-primary); }
.btn--ghost:hover { border-color: var(--accent-silver-dim); }
.btn--primary {
  background: var(--btn-primary-bg); color: var(--btn-primary-text); border-color: var(--btn-primary-bg);
}
.btn--primary:hover { opacity: .92; }
.btn--primary:disabled { opacity: .4; cursor: not-allowed; }
.btn--block { width: 100%; }

/* ============ CONVERT ============ */
.rate-card {
  background: var(--bg-card); border: 1px solid var(--hairline); border-radius: 4px;
  padding: 18px; margin-bottom: 22px;
}
.rate-card__quote { font-size: 11.5px; color: var(--text-tertiary); margin-bottom: 4px; }
.rate-card__value {
  font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--text-primary);
  margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--hairline);
}
.convert-sides { display: flex; align-items: center; gap: 10px; }
.side { flex: 1 1 0; display: flex; flex-direction: column; }
.side__label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 5px; }
.side__amount { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--text-primary); }
.side__currency { font-size: 11px; color: var(--text-secondary); margin-top: 2px; letter-spacing: .04em; }
.side__chevron {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--hairline-strong);
  display: flex; align-items: center; justify-content: center; color: var(--accent-silver-dim); flex-shrink: 0;
}
.side__chevron svg { width: 13px; height: 13px; }

.fine-print { font-size: 11px; color: var(--text-tertiary); margin-top: 14px; line-height: 1.5; text-align: center; }

/* ============ LEDGER ============ */
.ledger-list { flex: 1 1 auto; }
.ledger-row {
  display: flex; justify-content: space-between; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--hairline);
}
.ledger-list li:last-child .ledger-row { border-bottom: none; }
.ledger-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.ledger-sub { font-size: 11.5px; color: var(--text-tertiary); margin-top: 3px; }
.ledger-amount-block { text-align: right; flex-shrink: 0; }
.ledger-amount { font-family: var(--serif); font-size: 14.5px; font-weight: 600; color: var(--text-primary); }
.ledger-status {
  display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 5px;
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary);
}
.ledger-status svg { width: 10px; height: 10px; color: var(--accent-silver-dim); }

/* ============ INVITE (nomination flow) ============ */
.field-group { width: 100%; margin-bottom: 16px; text-align: left; }
.field-group label {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-tertiary); margin-bottom: 7px;
}
.field-group input[type="text"] {
  width: 100%; background: var(--bg-input); border: 1px solid var(--hairline-strong);
  border-radius: 4px; padding: 13px 14px; font-size: 13.5px; color: var(--text-primary);
}
.field-group input[type="text"]::placeholder { color: var(--text-tertiary); }

.endorse-note {
  width: 100%; text-align: left; padding: 12px 0; border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline); margin: 4px 0 20px;
}
.endorse-note p { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.endorse-note p strong { color: var(--text-primary); font-weight: 600; }
.endorse-note .expiry { font-size: 11.5px; color: var(--text-tertiary); margin-top: 5px; }

.charter-check {
  width: 100%; display: flex; align-items: flex-start; gap: 10px; text-align: left;
  margin-bottom: 22px; cursor: pointer;
}
.charter-check input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px;
  border: 1px solid var(--hairline-strong); border-radius: 3px; background: var(--bg-input);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.charter-check input[type="checkbox"]:checked {
  background: var(--accent-orange); border-color: var(--accent-orange);
}
.charter-check input[type="checkbox"]:checked::after {
  content: ""; width: 9px; height: 6px; border-left: 2px solid var(--btn-primary-text);
  border-bottom: 2px solid var(--btn-primary-text); transform: rotate(-45deg) translate(1px, -1px);
}
.charter-check span { font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); }

/* ============ Bottom tab bar ============ */
.tab-bar {
  display: flex; border-top: 1px solid var(--hairline); background: var(--bg);
  flex-shrink: 0; padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab-bar__btn {
  flex: 1 1 0; appearance: none; background: transparent; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px 12px; color: var(--text-tertiary); min-height: 56px;
}
.tab-bar__btn[aria-current="page"] { color: var(--text-primary); }
.tab-bar__label { font-size: 10px; font-weight: 600; letter-spacing: .04em; }

/* ============ Motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}

/* ============ Small screens: guarantee no horizontal scroll ============ */
@media (max-width: 390px) {
  .screen-body { padding: 18px 16px 22px; }
  .app-bar { padding: 16px 16px 14px; }
}


/* Morpho frost overlays */
body, html {
  background:
    radial-gradient(1100px 620px at 8% -10%, rgba(109,94,252,.14), transparent 55%),
    radial-gradient(900px 520px at 92% 8%, rgba(56,189,248,.12), transparent 50%),
    linear-gradient(180deg,#f7fbff 0%,#eef3f8 100%) !important;
}
.card, .panel, .sheet, .tray, .modal, .balance, .tile {
  background: linear-gradient(165deg,rgba(255,255,255,.78),rgba(248,250,252,.48)) !important;
  border: 1px solid rgba(255,255,255,.9) !important;
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255,255,255,.85) !important;
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
}
button.primary, .btn-primary, [data-primary] {
  background: linear-gradient(135deg,#6d5efc,#38bdf8 55%,#a30d22) !important;
  color: #fff !important;
  border: 0 !important;
}

/* 2026-09-29 tester fixes: the balance figure must be readable on the light card; action buttons wrap instead of clipping. */
.balance-card__val { color: var(--text, #0f172a) !important; }
.balance-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.balance-actions .btn { flex: 1 1 45%; min-width: 0; white-space: nowrap; }
