/* The multi-chain wallet screen.
 *
 * EVERY COLOUR IS A TOKEN, NEVER A LITERAL. Nine themes redefine --neon/--panel/--line/--text and
 * the rest, so a hardcoded cyan would look right on `dark` and wrong on win98, professional,
 * cherryblossom and monero. The cyberpunk feel comes from how the tokens are USED — neon rules,
 * glow on the things you can act on, mono for anything a machine reads — which survives a theme
 * that has no neon at all, because it degrades to that theme's own accent.
 *
 * SIZED BY THE SPACE IT IS IN, NOT BY THE SCREEN. `#feed` is shared by every view, and on the
 * windowed desktop it sits inside an `.osw` window whose width has nothing to do with the viewport
 * — so @media asks the wrong question there and a 480px window on a 2560px screen keeps the desktop
 * layout. Same lesson monero-wallet.css records; @container is the right instrument. @media is used
 * only for the phone's safe areas and its bottom nav, which ARE facts about the screen.
 */
.ex-wrap{width:100%;max-width:820px;min-width:0;margin:0 auto;padding-block:18px;
  padding-inline:clamp(8px,2.5%,18px);overflow-x:clip;container:ex/inline-size}

.ex-title{margin:0 0 4px;font-size:clamp(20px,5cqi,27px);letter-spacing:.02em;overflow-wrap:anywhere}
/* The hairline under the title is the one piece of pure decoration here, and it is drawn from the
   accent so every theme gets its own. */
.ex-title::after{content:"";display:block;width:64px;height:2px;margin-top:7px;border-radius:2px;
  background:linear-gradient(90deg,var(--neon),transparent)}
.ex-lead{margin:10px 0 14px;color:var(--muted);font-size:13.5px}

/* WHOSE KEYS THESE ARE. Loud on purpose and never decorative: somebody who believes they hold their
   own keys and does not is one server failure from a loss they never agreed to risk. Uses --amber
   rather than --danger, which is reserved here for a destructive action, not for a standing fact. */
.ex-custody{margin:12px 0 16px;padding:12px 14px;border:1px solid rgba(var(--accent-rgb),.34);
  border-inline-start:3px solid var(--amber);border-radius:12px;
  background:linear-gradient(180deg,rgba(var(--accent-rgb),.07),transparent);
  color:var(--text);font-size:13px;line-height:1.5;overflow-wrap:anywhere}
.ex-custody b{color:var(--amber)}

/* ---- holdings ------------------------------------------------------------------------------ */
.ex-coins{list-style:none;margin:14px 0;padding:0;border:1px solid var(--line);border-radius:var(--r,14px);
  background:var(--panel);overflow:hidden}
.ex-coin{display:grid;min-width:0;align-items:center;gap:10px;padding:12px 14px;
  grid-template-columns:minmax(0,1fr) auto auto auto;border-top:1px solid var(--line);
  transition:background .14s ease}
.ex-coin:first-child{border-top:0}
.ex-coin:hover{background:var(--panel2)}
.ex-coin-id{min-width:0;display:flex;align-items:baseline;gap:8px}
.ex-coin-id b{font:800 14px/1.2 var(--mono,monospace);letter-spacing:.06em;color:var(--neon)}
.ex-coin-id small{min-width:0;color:var(--muted);font-size:12px;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap}
.ex-coin-amt{min-width:0;text-align:end;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.ex-coin-amt b{font-size:clamp(14px,3.4cqi,17px)}
.ex-coin-amt em{font-style:normal;color:var(--muted);font-size:.8em;margin-inline-start:3px}
.ex-coin-amt .ex-hint{display:block;margin-top:2px;font-size:11px}

/* "COULD NOT ASK" MUST NOT LOOK LIKE A NUMBER. Deliberately not a digit, not tabular, and dashed —
   a balance nobody could fetch and a balance of zero mean opposite things, and the screen is the
   last place that distinction can survive. */
.ex-unknown{display:inline-block;padding:2px 8px;border:1px dashed var(--line);border-radius:999px;
  color:var(--muted);font-size:11.5px;letter-spacing:.03em;cursor:help}

/* ---- panels, notes, actions ----------------------------------------------------------------- */
.ex-actions{display:flex;flex-wrap:wrap;gap:9px;margin:14px 0}
.ex-panel{min-width:0;margin:14px 0;padding:16px;border:1px solid rgba(var(--accent-rgb),.32);
  border-radius:var(--r,14px);background:var(--panel);box-shadow:var(--glow,none);
  overflow-wrap:anywhere}
.ex-panel h3{margin:0 0 12px;font-size:16px;color:var(--neon)}
.ex-panel label{display:block;margin:10px 0;font-size:13px;color:var(--muted)}
.ex-panel input,.ex-panel textarea{display:block;width:100%;min-width:0;margin-top:6px;padding:10px 11px;
  border:1px solid var(--line);border-radius:10px;background:var(--panel2);color:var(--text);
  font:500 15px/1.4 var(--mono,monospace);outline:none;transition:border-color .14s ease,box-shadow .14s ease}
.ex-panel input:focus,.ex-panel textarea:focus{border-color:var(--neon);box-shadow:var(--glow-cy,none)}
.ex-restore{margin:12px 0}
.ex-restore.hidden{display:none}

.ex-note{margin:10px 0;padding:11px 13px;border:1px solid var(--line);border-radius:11px;
  background:var(--panel2);font-size:13px;line-height:1.5;overflow-wrap:anywhere}
.ex-note.ex-warn{border-color:rgba(255,207,43,.42);border-inline-start:3px solid var(--amber)}
.ex-note.ex-bad{border-color:rgba(214,31,78,.45);border-inline-start:3px solid var(--danger);
  color:var(--text)}
.ex-hint{margin:8px 0 0;color:var(--muted);font-size:12px;line-height:1.5;overflow-wrap:anywhere}

/* ANYTHING A MACHINE READS IS MONOSPACED AND BREAKS ANYWHERE. An address that wraps mid-character
   with a proportional font is one somebody transcribes wrongly, and this is money. */
.ex-addr,.ex-phrase{display:block;max-width:100%;margin:10px 0;padding:11px 12px;
  border:1px solid var(--line);border-radius:10px;background:var(--panel2);color:var(--text);
  font:600 13.5px/1.65 var(--mono,monospace);letter-spacing:.02em;
  white-space:normal;word-break:break-all;overflow-wrap:anywhere;user-select:all}
.ex-phrase{border-color:rgba(255,207,43,.4);letter-spacing:.06em;word-spacing:.35em}
.ex-qr{display:grid;place-items:center;width:100%;margin:12px 0}
/* The QR is read by a camera, so it keeps a white quiet zone whatever the theme is doing. */
.ex-qr svg,.ex-qr img{display:block;width:min(208px,100%);height:auto;aspect-ratio:1;padding:9px;
  border-radius:10px;background:#fff}

/* ---- the space it is in --------------------------------------------------------------------- */
@container ex (max-width:560px){
  .ex-coin{grid-template-columns:minmax(0,1fr) auto;row-gap:8px;padding:12px}
  .ex-coin-amt{grid-column:1;text-align:start}
  .ex-coin .btn{grid-row:2}
  .ex-coin-id small{white-space:normal}
  .ex-panel{padding:13px}
  .ex-actions .btn{flex:1;min-width:0;min-height:42px}
}
@container ex (max-width:340px){
  .ex-title{font-size:19px}
  .ex-coins{border-radius:11px}
  .ex-coin{padding:10px}
  .ex-actions{flex-direction:column}
}
/* Viewport-only, and correctly so: the safe areas and the phone's bottom nav are facts about the
   SCREEN, not about the window this view happens to be in. */
@media(max-width:600px){
  .ex-wrap{padding:10px max(8px,env(safe-area-inset-right))
    calc(74px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}
}
/* Somebody who has asked not to see motion still gets the colour, just not the transition. */
@media(prefers-reduced-motion:reduce){
  .ex-coin,.ex-panel input,.ex-panel textarea{transition:none}
}

/* THE BUTTON THAT MOVES MONEY DOES NOT LOOK LIKE THE ONE THAT RECEIVES IT. Both are `.btn small`
   and inherited identically, which put an irreversible action and a harmless one side by side
   wearing the same face. Receive stays quiet; Send carries the accent and a glow on hover, so the
   consequential one is the one the eye lands on. */
.ex-coin .ex-receive{border-color:var(--line);color:var(--muted)}
.ex-coin .ex-receive:hover{color:var(--text);border-color:var(--neon)}
.ex-coin .ex-send{border-color:rgba(var(--accent-rgb),.55);color:var(--neon);font-weight:700}
.ex-coin .ex-send:hover{border-color:var(--neon);box-shadow:var(--glow-cy,none)}

/* Portfolio overview: scales with a desktop window as well as the viewport. */
.ex-wrap{max-width:1120px}
.ex-header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px}
.ex-eyebrow{display:block;color:var(--muted);font-size:10px;font-weight:750;letter-spacing:.18em;margin-bottom:8px}
.ex-switches{display:flex;flex-wrap:wrap;align-items:end;gap:10px;max-width:100%}
.ex-switches label{display:flex;flex-direction:column;gap:5px;color:var(--muted);font-size:11px;min-width:0;flex:1}
.ex-switches select{max-width:200px;min-width:110px;width:100%;min-height:42px;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:10px;padding:8px 12px;font:inherit;font-size:13px}
.ex-switches .btn{min-height:42px;font-size:12px}
.ex-dashboard{display:grid;grid-template-columns:minmax(0,1.85fr) minmax(210px,1fr);gap:18px;margin-bottom:20px}
.ex-value-card,.ex-allocation-card{position:relative;min-width:0;border:1px solid var(--line);border-radius:22px;padding:24px;background:linear-gradient(135deg,color-mix(in srgb,var(--neon) 11%,var(--panel)),var(--panel) 65%);box-shadow:0 10px 30px color-mix(in srgb,var(--bg) 65%,transparent)}
.ex-value-card{overflow:hidden}.ex-value-card:before{content:'';position:absolute;width:160px;height:160px;border-radius:50%;background:var(--neon);opacity:.06;filter:blur(30px);right:-30px;top:-60px;pointer-events:none}
.ex-value-caption{font-size:12px;color:var(--muted);margin-bottom:12px}
.ex-total{font-size:clamp(28px,5.7cqi,48px);font-weight:750;letter-spacing:-.035em;line-height:1.1;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.ex-currency{display:inline-block;margin-top:8px;font-size:11px;color:var(--muted);letter-spacing:.12em}
.ex-price-time{font-size:10px;color:var(--muted);margin:10px 0 0}
.ex-chart-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:25px}.ex-chart-heading h3,.ex-allocation-card h3{margin:0;font-size:13px;font-weight:600}
.ex-ranges{display:flex;gap:4px}.ex-ranges .btn{font-size:10px;min-height:30px;padding:4px 9px}.ex-ranges [aria-pressed=true]{border-color:var(--neon);color:var(--neon);background:color-mix(in srgb,var(--neon) 12%,var(--panel))}
.ex-value-chart{width:100%;height:auto;display:block;margin-top:12px}.ex-chart-line{fill:none;stroke:var(--neon);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}.ex-chart-fill{fill:var(--neon);opacity:.08}
.ex-chart-labels{display:flex;justify-content:space-between;font-size:10px;color:var(--muted)}.ex-chart-empty{min-height:145px;display:grid;place-content:center;text-align:center;color:var(--muted);font-size:12px;line-height:1.6;padding:20px}
.ex-allocation-ring{display:block;width:180px;max-width:100%;margin:14px auto 10px;transform:rotate(-90deg)}
.ex-ring-track,.ex-ring-part{fill:none;stroke-width:17}.ex-ring-track{stroke:var(--line)}.ex-ring-part{stroke:var(--asset-color,var(--neon))}
[data-ex-color="0"]{--asset-color:var(--neon)}[data-ex-color="1"]{--asset-color:var(--amber)}[data-ex-color="2"]{--asset-color:var(--pink,var(--neon))}[data-ex-color="3"]{--asset-color:var(--green,var(--text))}[data-ex-color="4"]{--asset-color:var(--purple,var(--muted))}[data-ex-color="5"]{--asset-color:var(--cyan,var(--text))}
.ex-allocation-count{text-align:center;font-size:28px;font-weight:700;margin-top:-120px;margin-bottom:85px;line-height:1;pointer-events:none}.ex-allocation-count small{display:block;font-size:9px;color:var(--muted);font-weight:400;margin-top:8px}
.ex-allocation-list{list-style:none;margin:0;padding:0}.ex-allocation-list li{display:flex;align-items:center;gap:8px;margin-top:10px;font-size:11px}.ex-allocation-list b{margin-left:auto;font-variant-numeric:tabular-nums}.ex-dot{width:7px;height:7px;border-radius:50%;background:var(--asset-color,var(--neon))}
.ex-asset-logo{flex:none;width:34px;height:34px;object-fit:contain;filter:drop-shadow(0 3px 8px color-mix(in srgb,var(--bg) 20%,transparent))}
.ex-coin-id{align-items:center;flex-wrap:wrap}.ex-coin-id small{flex-basis:100%;margin-left:42px;margin-top:-6px}.ex-fiat{display:block;color:var(--muted);font-size:11px;margin-top:4px;font-variant-numeric:tabular-nums}
.ex-holdings-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:24px 0 10px}.ex-holdings-title h3{font-size:15px;margin:0}.ex-holdings-title span{font-size:11px;color:var(--muted)}
.ex-panel input,.ex-panel textarea{width:100%;box-sizing:border-box;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--text);padding:12px;margin:6px 0 12px;font:inherit}.ex-panel label{display:block;font-size:12px;color:var(--muted)}
.ex-wrap :is(button,select,input,textarea):focus-visible{outline:2px solid var(--neon);outline-offset:3px}
@container ex (max-width:650px){.ex-dashboard{grid-template-columns:minmax(0,1fr)}.ex-allocation-card{display:grid;grid-template-columns:110px minmax(0,1fr);gap:8px;padding:18px}.ex-allocation-card h3{grid-column:1/-1}.ex-allocation-ring{width:100px;margin:0;grid-column:1;grid-row:2}.ex-allocation-list{grid-column:2;grid-row:2}.ex-allocation-count{display:none}.ex-allocation-card>.ex-hint{grid-column:1/-1}.ex-value-card{padding:20px}.ex-switches{width:100%}.ex-switches label{flex-basis:38%}.ex-switches select{max-width:none}.ex-total{font-size:38px}.ex-asset-logo{width:28px;height:28px}.ex-coin-id small{margin-left:0;margin-top:0}.ex-coin-id{gap:6px}.ex-holdings-title span{display:none}}
@media(prefers-reduced-motion:reduce){.ex-wrap *{transition:none!important}}

/* Expressive portfolio surfaces retain the active theme's palette and real data. */
.ex-header{padding-block:8px}.ex-eyebrow{color:var(--neon);letter-spacing:.24em}
.ex-title{font-size:clamp(28px,5cqi,40px);font-weight:800;letter-spacing:-.04em}
.ex-title::after{width:96px;height:3px;background:linear-gradient(90deg,var(--neon),var(--pink,var(--neon)),transparent)}
.ex-dashboard{gap:20px}
.ex-value-card,.ex-allocation-card{border-color:color-mix(in srgb,var(--neon) 30%,var(--line));border-radius:24px;
  box-shadow:0 16px 48px color-mix(in srgb,var(--neon) 9%,transparent),inset 0 1px 0 color-mix(in srgb,var(--text) 8%,transparent)}
.ex-value-card{padding:32px;isolation:isolate;background:radial-gradient(ellipse at 100% 0,color-mix(in srgb,var(--neon) 23%,transparent),transparent 65%),
  radial-gradient(ellipse at 0 100%,color-mix(in srgb,var(--pink,var(--neon)) 12%,transparent),transparent 65%),var(--panel)}
.ex-value-card::before{width:260px;height:260px;border:1px solid color-mix(in srgb,var(--neon) 20%,transparent);border-radius:50%;filter:none;right:-120px;top:-100px;background:transparent;z-index:-1}
.ex-value-card::after{content:"";position:absolute;width:340px;height:340px;right:-160px;top:-140px;border-radius:50%;border:1px solid color-mix(in srgb,var(--neon) 12%,transparent);pointer-events:none;z-index:-1}
.ex-value-caption{font-size:13px;letter-spacing:.04em}.ex-total{font-size:clamp(40px,7cqi,72px);font-weight:800;letter-spacing:-.055em;text-shadow:0 0 32px color-mix(in srgb,var(--neon) 15%,transparent)}
.ex-currency{padding:5px 10px;border:1px solid color-mix(in srgb,var(--neon) 25%,var(--line));border-radius:999px;background:color-mix(in srgb,var(--panel) 70%,transparent);color:var(--text)}
.ex-chart-heading{margin-top:32px}.ex-chart-heading h3{font-size:14px}.ex-ranges .btn{border-radius:999px;min-height:32px}
.ex-value-chart{border-radius:12px;background:repeating-linear-gradient(0deg,transparent,transparent calc(25% - 1px),color-mix(in srgb,var(--text) 5%,transparent) 25%)}
.ex-chart-line{stroke-width:3;filter:drop-shadow(0 0 5px color-mix(in srgb,var(--neon) 45%,transparent))}.ex-chart-fill{opacity:.13}
.ex-allocation-card{background:radial-gradient(ellipse at 50% 40%,color-mix(in srgb,var(--neon) 12%,transparent),transparent 65%),var(--panel)}
.ex-allocation-ring{filter:drop-shadow(0 0 12px color-mix(in srgb,var(--neon) 20%,transparent))}.ex-ring-part{stroke-width:20}
.ex-allocation-list li{padding:8px 0;border-bottom:1px solid var(--line);margin-top:0}.ex-allocation-list li:last-child{border:0}
.ex-coins{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;border:0;background:transparent;overflow:visible}
.ex-coin,.ex-coin:first-child{position:relative;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding:20px;border:1px solid var(--line);border-radius:20px;
  background:linear-gradient(135deg,color-mix(in srgb,var(--neon) 6%,var(--panel)),var(--panel));transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.ex-coin:hover,.ex-coin:focus-within{border-color:color-mix(in srgb,var(--neon) 60%,var(--line));box-shadow:0 8px 24px color-mix(in srgb,var(--neon) 12%,transparent)}
@media(hover:hover) and (prefers-reduced-motion:no-preference){.ex-coin:hover{transform:translateY(-3px)}}
.ex-coin-id{grid-column:1/-1;display:grid;grid-template-columns:48px minmax(0,1fr);column-gap:12px;row-gap:4px}
.ex-asset-logo{width:44px;height:44px;grid-row:1/3;grid-column:1;filter:drop-shadow(0 4px 8px color-mix(in srgb,var(--text) 15%,transparent))}
.ex-coin-id b{grid-column:2;font-size:16px}.ex-coin-id small{grid-column:2;margin:0;font-size:12px;white-space:normal}
.ex-coin-amt{grid-column:1/-1;grid-row:2;text-align:start}.ex-coin-amt b{font-size:26px;letter-spacing:-.03em}.ex-fiat{font-size:13px;margin-top:6px}
.ex-coin .btn{grid-row:3;min-height:40px;border-radius:12px}.ex-coin .ex-send{background:color-mix(in srgb,var(--neon) 10%,var(--panel));color:var(--text)}
.ex-holdings-title{margin-top:32px}.ex-holdings-title h3{font-size:20px;letter-spacing:-.02em}
@container ex (max-width:900px){.ex-coins{grid-template-columns:repeat(2,minmax(0,1fr))}}
@container ex (max-width:560px){.ex-coins{grid-template-columns:minmax(0,1fr)}.ex-value-card{padding:24px}.ex-total{font-size:clamp(36px,10cqi,52px)}.ex-coin{padding:20px}.ex-coin-amt{grid-column:1/-1}.ex-title{font-size:28px}}
