/* PLUTUS — premium asset management theme */
:root {
  --bg: #07080b;
  --bg-soft: #0b0e13;
  --surface: #0e1218;
  --surface-2: #141b25;
  --surface-3: #1a2230;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --hairline-gold: rgba(227, 197, 124, 0.22);
  --text: #f4f1e8;
  --muted: #9aa3b2;
  --muted-2: #6b7484;
  --gold: #e3c57c;
  --gold-soft: rgba(227, 197, 124, 0.12);
  --accent: #e3c57c;
  --accent-ink: #1a1408;
  --gain: #34d399;
  --gain-bg: rgba(52, 211, 153, 0.1);
  --loss: #f87171;
  --loss-bg: rgba(248, 113, 113, 0.1);
  --radius: 12px;
  --radius-lg: 18px;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --max: 1120px;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1100px 480px at 50% -8%, rgba(227, 197, 124, 0.07), transparent 62%),
    radial-gradient(900px 520px at 90% 10%, rgba(80, 120, 255, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

::selection { background: rgba(227, 197, 124, 0.32); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  z-index: 100;
  background: var(--gold);
  color: #1a1408;
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0.6rem; }

/* ————— Header ————— */
header.brand {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 8, 11, 0.82);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  padding-top: env(safe-area-inset-top);
}

header.brand::after {
  content: "";
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline-gold), transparent);
  opacity: 0.55;
}

.brand-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-id {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-right: auto;
  min-width: 0;
}

.brand-mark {
  width: 2.1rem;
  height: 2.1rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: linear-gradient(135deg, #f5e6c4, #e3c57c 55%, #b98f3e);
  color: #1a1408;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  box-shadow: 0 4px 14px rgba(227, 197, 124, 0.25);
}

.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.brand h1 span {
  background: linear-gradient(120deg, #f5e6c4, #e3c57c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-left: auto;
}

.tb-field {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.tb-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.tb-field select { width: 5.6rem; }

/* Segmented */
.segmented {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  padding: 2px;
  gap: 2px;
}

.segmented button {
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  min-height: 2.3rem;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.86rem;
}

.segmented button + button { border-left: none; }

.segmented button[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ————— Buttons ————— */
button {
  min-height: 2.75rem;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.93rem;
  letter-spacing: 0.01em;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

button:hover { border-color: var(--border-strong); background: var(--surface-3); }
button:active { transform: translateY(1px); }

button.primary {
  background: linear-gradient(180deg, #f7f3e8, #ece5d3);
  border-color: transparent;
  color: #171204;
  font-weight: 650;
  box-shadow: 0 6px 20px rgba(227, 197, 124, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

button.primary:hover { background: linear-gradient(180deg, #fffdf4, #f2ebd8); }

button.ghost { background: transparent; }

button.quiet {
  background: none;
  border-color: transparent;
  color: var(--muted);
  padding: 0.6rem 0.75rem;
}

button.quiet:hover { color: var(--text); border-color: var(--border); background: rgba(255,255,255,0.03); }

button.primary.danger-btn {
  background: var(--loss);
  border-color: transparent;
  color: #fff;
  box-shadow: none;
}

button.quiet.danger:hover { color: var(--loss); border-color: rgba(248, 113, 113, 0.4); }

.icon-btn {
  padding: 0.6rem 0.7rem;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius);
}

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ————— Banner ————— */
#banner {
  max-width: var(--max);
  margin: 0.85rem auto 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
}

#banner.error {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.09);
}

#banner.info {
  border-color: var(--hairline-gold);
  background: rgba(227, 197, 124, 0.07);
}

#banner[hidden] { display: none; }
#banner-text { flex: 1; }
#banner-close {
  min-height: 2rem;
  padding: 0.25rem 0.6rem;
  background: none;
  border-color: transparent;
  color: var(--text);
}
.banner-error { color: var(--loss); font-weight: 600; }

/* ————— Layout ————— */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 7rem;
  display: grid;
  gap: 1.5rem;
}

/* Sections stack inside view wrappers, so the gap must live there —
   otherwise hero / summary / accounts glue together with zero space. */
#view-home, #view-account {
  display: grid;
  gap: 1.75rem;
  align-content: start;
  min-width: 0;
}

section, aside { background: transparent; border: none; padding: 0; }
section h2, aside h2 {
  margin: 0 0 0.8rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.muted { color: var(--muted); }

/* ————— Hero: premium portfolio panel ————— */
#hero {
  position: relative;
  overflow: hidden;
  padding: 1.75rem 1.75rem 1.4rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)), var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

#hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline-gold), transparent);
}

.hero-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hero-value {
  margin: 0.35rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.hero-pl { margin: 0 0 0.15rem; display: inline-block; }

.pill {
  border-radius: 999px;
  padding: 0.32rem 0.9rem;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.pill.gain { color: var(--gain); background: var(--gain-bg); border-color: rgba(52,211,153,0.25); }
.pill.gain::before { content: "▲"; margin-right: 0.45em; font-size: 0.72em; }
.pill.loss { color: var(--loss); background: var(--loss-bg); border-color: rgba(248,113,113,0.25); }
.pill.loss::before { content: "▼"; margin-right: 0.45em; font-size: 0.72em; }

.hero-sub {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.gain { color: var(--gain); }
.loss { color: var(--loss); }
.card-value.gain::before { content: "+"; }
.skeleton { color: var(--muted); }

/* ————— Summary cards ————— */
#overview { padding: 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.card {
  padding: 1.15rem 1.35rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  border-left: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
}

.card:first-child { border-left: none; }

.card-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-value {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#summary-cards > p {
  grid-column: 1 / -1;
  padding: 1.1rem 1.25rem;
  margin: 0;
}

/* ————— Accounts ————— */
#accounts { display: grid; gap: 0.85rem; padding: 0; }

#accounts > h2, .section-title {
  margin: 1.4rem 0 0.3rem;
  font-size: 0.74rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.account-card {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  padding: 1.05rem 1.2rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), transparent), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.account-card:hover {
  border-color: var(--border-strong);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), transparent), var(--surface-2);
}

@media (min-width: 721px) {
  .acct-figs {
    padding-right: 1.25rem;
    border-right: 1px solid var(--border);
  }
}

.acct-avatar {
  width: 2.9rem;
  height: 2.9rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #232c3b, #141a24);
  border: 1px solid var(--border-strong);
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.acct-mid { display: flex; flex-direction: column; min-width: 0; margin-right: auto; gap: 0.1rem; }

.account-name {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-ticker { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.04em; }

.acct-figs {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  line-height: 1.3;
}

.acct-value { font-weight: 650; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.acct-pl { font-size: 0.84rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.acct-pl.gain { color: var(--gain); }
.acct-pl.loss { color: var(--loss); }
.acct-open { flex-shrink: 0; }

.account-empty {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
}
.account-create-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: end; margin-top: 1rem; }
.account-create-row .fld { display: flex; flex-direction: column; gap: 0.3rem; min-width: 10rem; flex: 1; text-align: left; }
.account-create-row .fld label { margin: 0; }

/* ————— Detail ————— */
#acct-back {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
  padding: 0.4rem 0.2rem;
}
#acct-back:hover { color: var(--text); }

.detail-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1.25rem 1.25rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.detail-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ticker-chip {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
  border: 1px solid var(--hairline-gold);
  background: var(--gold-soft);
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  white-space: nowrap;
}

.menu { position: relative; margin-left: auto; }
.menu summary {
  list-style: none;
  cursor: pointer;
  padding: 0.55rem 0.85rem;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  user-select: none;
  background: rgba(255,255,255,0.02);
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { color: var(--text); border-color: var(--border-strong); }
.menu-box {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 13rem;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.4rem;
  box-shadow: var(--shadow);
}
.menu-box button {
  background: none;
  border: none;
  text-align: left;
  padding: 0.7rem 0.85rem;
  min-height: 2.75rem;
  border-radius: 9px;
  white-space: nowrap;
}
.menu-box button:hover { background: rgba(255, 255, 255, 0.06); }
.detail-stats { margin: 1rem 0 0.25rem; }
.closed-flag { margin: 0.9rem 0 0; }

/* ————— Facts + trades ————— */
.stat-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.7rem 0.15rem;
  border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--muted); font-size: 0.88rem; flex-shrink: 0; }
.stat-val {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  text-align: right;
  overflow-wrap: anywhere;
}
.rate-line .stat-val { font-family: var(--font-ui); font-size: 0.83rem; font-weight: 400; max-width: 70%; }

.trade-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem 0.7rem;
  margin: 0.85rem 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent), var(--surface);
}
.trade-block:last-child { margin-bottom: 0; }
.trade-head { display: flex; align-items: center; gap: 0.8rem; padding-bottom: 0.6rem; }

.side {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  flex-shrink: 0;
  border: 1px solid transparent;
}
.side-buy { color: var(--gain); background: var(--gain-bg); border-color: rgba(52,211,153,0.25); }
.side-sell { color: var(--loss); background: var(--loss-bg); border-color: rgba(248,113,113,0.25); }

.trade-what { font-weight: 600; letter-spacing: -0.01em; }
.trade-when { margin-left: auto; font-size: 0.83rem; color: var(--muted); flex-shrink: 0; }
.trade-block .stat-label { flex: 0 0 7rem; }
.trade-block .stat-val { flex: 1; }
.trade-block .stat-row { padding: 0.5rem 0.1rem; }
.trade-foot { display: flex; justify-content: flex-end; padding: 0.5rem 0 0.35rem; }
.trade-del { margin-left: 0.25rem; padding: 0.45rem 0.7rem; min-height: 2.5rem; font-size: 1.05rem; line-height: 1; }

/* ————— Dialogs ————— */
dialog {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent), var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 1.5rem;
  width: min(560px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(3, 4, 6, 0.72); backdrop-filter: blur(8px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.dialog-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.2rem; font-weight: 650; letter-spacing: -0.01em; }
.dialog-head [data-close] { flex-shrink: 0; min-height: 2.5rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.65rem; margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.dialog-actions button { min-width: 6.5rem; }
#confirm-message { margin: 0.4rem 0 0; line-height: 1.65; color: var(--muted); }

/* ————— Forms ————— */
label { display: block; margin: 1rem 0 0.35rem; color: var(--muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
input, select, textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  min-height: 2.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0a0e14;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--hairline-gold);
  box-shadow: 0 0 0 3px rgba(227, 197, 124, 0.14);
  outline: none;
}
textarea { min-height: 4rem; }
input::placeholder { color: var(--muted-2); }
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%239aa4b2' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.3rem;
  cursor: pointer;
}
#trade-form, #account-dialog-body, #settings-dialog-body { display: grid; gap: 0.15rem; padding-bottom: 0.5rem; }
#trade-form label:first-child { margin-top: 0.25rem; }
#trade-form button.primary, #account-dialog-body button.primary { width: 100%; margin-top: 1.4rem; margin-bottom: 0.5rem; min-height: 3.1rem; font-size: 1rem; }
.fld-locked { margin-top: 1rem; padding: 0.7rem 0.85rem; background: rgba(227,197,124,0.06); border: 1px dashed var(--hairline-gold); border-radius: var(--radius); font-size: 0.9rem; color: var(--muted); }
.fld-label { color: var(--muted); }
#t-symbol-locked { color: var(--gold); font-weight: 700; }
details.adv, details.opt { margin-top: 1.1rem; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.65rem 0.9rem; background: rgba(255,255,255,0.015); }
details.adv summary, details.opt summary { color: var(--muted); font-size: 0.88rem; font-weight: 600; cursor: pointer; min-height: 2rem; }
details.opt + details.opt { margin-top: 0.65rem; }

/* ————— Settings ————— */
#settings-dialog { width: min(680px, 94vw); }
.set-layout { display: flex; gap: 1.25rem; margin-top: 0.5rem; }
.set-tabs { display: flex; flex-direction: column; gap: 0.35rem; flex: 0 0 11.5rem; }
.set-tabs button { background: none; border: 1px solid transparent; text-align: left; min-height: 2.9rem; color: var(--muted); white-space: nowrap; font-weight: 500; }
.set-tabs button:hover { color: var(--text); }
.set-tabs button[aria-selected="true"] { background: rgba(227,197,124,0.08); border-color: var(--hairline-gold); color: var(--gold); font-weight: 600; }
.set-panels { flex: 1; min-width: 0; min-height: 16rem; }
.set-blurb { margin: 0 0 0.9rem; font-size: 0.9rem; line-height: 1.6; text-transform: none; letter-spacing: normal; font-weight: 400; }
.set-panels label { text-transform: uppercase; }
#o-list { list-style: none; margin: 0.85rem 0 0; padding: 0; }
#o-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.65rem 0; border-bottom: 1px solid var(--border); }
#o-add, #s-download, #s-clear { margin-top: 1.25rem; margin-bottom: 0.5rem; }
input[type="file"] { padding: 0.55rem; }
input[type="file"]::file-selector-button {
  font: inherit; font-weight: 600; color: var(--text);
  background: var(--surface-3); border: 1px solid var(--border-strong);
  border-radius: 9px; padding: 0.5rem 0.9rem; margin-right: 0.75rem; cursor: pointer;
}

/* ————— FAB ————— */
#fab-trade {
  display: none;
  position: fixed;
  right: 1.1rem;
  bottom: calc(1.1rem + env(safe-area-inset-bottom));
  z-index: 25;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  background: linear-gradient(180deg, #f7f3e8, #e3c57c);
  color: #171204;
  font-size: 1.7rem;
  font-weight: 600;
  border: none;
  box-shadow: 0 10px 28px rgba(227, 197, 124, 0.3);
  align-items: center;
  justify-content: center;
  padding: 0;
  min-height: 0;
}

/* ————— Progressive disclosure: no irrelevant buttons ————— */
/* Step 1 (no accounts): the landing CTA is the only path. Topbar chrome hides. */
body.is-empty .topbar-controls { display: none; }

/* Step 2 (accounts, no trades yet): only the next action shows.
   Currency + cost method + extra account can wait for real data. */
body.has-no-trades .tb-field,
body.has-no-trades .segmented,
body.has-no-trades #tb-account { display: none; }

/* ————— Guide panel (Step 2 of 3) ————— */
.guide-panel {
  position: relative;
  overflow: hidden;
  padding: 2rem 1.75rem 1.6rem;
  background: linear-gradient(180deg, rgba(227,197,124,0.07), transparent 60%), var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 0.5rem;
}

.guide-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline-gold), transparent);
}

.guide-step {
  margin: 0 0 0.7rem;
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  border: 1px solid var(--hairline-gold);
  background: var(--gold-soft);
  border-radius: 999px;
  padding: 0.28rem 0.8rem;
}

.guide-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.guide-sub {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.65;
  max-width: 34rem;
}

.guide-ctas { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.guide-ctas button { min-height: 3.1rem; padding: 0.75rem 1.6rem; font-size: 1rem; }

button.linklike {
  background: none;
  border: none;
  min-height: 0;
  padding: 0.2rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

button.linklike:hover { color: var(--text); background: none; border-color: transparent; }

/* ————— Landing ————— */
#landing {
  position: relative;
  overflow: hidden;
  text-align: left;
  padding: 3.25rem 2.25rem 2.25rem;
  background: linear-gradient(180deg, rgba(227,197,124,0.06), transparent 55%), var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  margin-top: 1.25rem;
  box-shadow: var(--shadow);
}
#landing::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline-gold), transparent);
}
.landing-eyebrow {
  margin: 0 0 1rem;
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  border: 1px solid var(--hairline-gold);
  background: var(--gold-soft);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
}
.landing-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 700;
  max-width: 22ch;
}
.landing-sub {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
  max-width: 38rem;
}
.landing-ctas { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.landing-ctas button { min-height: 3.2rem; padding: 0.8rem 2rem; font-size: 1.02rem; }
.landing-step {
  margin: 0 0 1.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.landing-alt { margin: 0 0 2rem; }
.landing-feats {
  list-style: none;
  margin: 0;
  padding: 1.6rem 0 0;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
.landing-feats li { display: flex; flex-direction: column; gap: 0.25rem; }
.landing-feats strong { font-size: 0.93rem; font-weight: 650; }
.landing-feats span { font-size: 0.83rem; color: var(--muted); }
@media (max-width: 720px) {
  #landing { padding: 2.25rem 1.4rem 1.6rem; }
  .landing-ctas { flex-direction: column; align-items: stretch; }
  .landing-ctas button { width: 100%; }
  .landing-feats { grid-template-columns: 1fr; gap: 1rem; }
}

footer { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem 2.5rem; }
footer .muted { font-size: 0.79rem; color: var(--muted-2); }

/* Tables (legacy safety) */
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.07em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-display); }

/* ————— Responsive ————— */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; row-gap: 0.8rem; }
  .brand-id { flex: 1 1 100%; }
  .topbar-controls { flex-wrap: wrap; width: 100%; gap: 0.65rem; row-gap: 0.7rem; }
  .tb-field select { width: 5rem; }
  #tb-account { display: none; }
  #fab-trade { display: inline-flex; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .card:nth-child(3) { border-left: none; }
  .card:nth-child(n+3) { border-top: 1px solid var(--border); }
  .hero-value { font-size: 2.4rem; }
  #hero { padding: 1.4rem 1.25rem 1.1rem; }
  .account-card { flex-wrap: wrap; }
  .acct-figs { flex-direction: row; gap: 0.75rem; align-items: baseline; }
  main { padding-bottom: 7rem; }
  table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table, table tbody, table tr, table td { display: block; width: 100%; }
  table tr { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.75rem; padding: 0.5rem 0.75rem; background: var(--surface); }
  table td { border-bottom: none; padding: 0.3rem 0; }
  table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; }
  td.num, th.num { text-align: left; }
}

@media (max-width: 560px) {
  .set-layout { flex-direction: column; }
  .set-tabs { flex-direction: row; flex: none; overflow-x: auto; }
  .trade-block .stat-label { flex-basis: 6rem; }
  dialog { width: 100vw; max-width: 100vw; margin-bottom: 0; border-radius: 20px 20px 0 0; }
  .segmented button { padding: 0.45rem 0.7rem; }
  .topbar-controls button { padding-left: 0.85rem; padding-right: 0.85rem; }
}

@media (min-width: 721px) {
  #fab-trade { display: none !important; }
}

@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: dlg-in 0.2s cubic-bezier(0.2, 0.9, 0.3, 1); }
  @keyframes dlg-in {
    from { opacity: 0; transform: translateY(10px) scale(0.99); }
    to { opacity: 1; transform: none; }
  }
  .account-card, button { transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  body { background: #fff; color: #000; }
  header.brand, #fab-trade, .menu, dialog { display: none !important; }
  .cards, .account-card, .trade-block, #hero, #landing { border: 1px solid #ccc; background: none; box-shadow: none; }
}
