/* The look of oneeur.com (tokens from crossmobile/src/theme/tokens.ts):
   dark page, gold top, flat glass panels with hairline edges, no rounded corners. */
:root {
  --bg: #0A0805; --text: #FFFFFF; --body-text: #F4EFE4; --muted: #C2B8A3; --strong: #DDD4C1; --soft: #9C927E;
  --accent: #FFD98A; --icon-accent: #FFE3A0;
  --glass: rgba(255,255,255,.05); --glass-down: rgba(231,180,60,.14); --hair: rgba(255,255,255,.14); --divider: rgba(255,255,255,.07);
  --gold: #E7B43C; --gold-light: #FFE08A; --gold-dark: #A8720F; --gold-block: #C98F22; --gold-block-border: #FFE9A3;
  --on-gold: #1A1300; --on-gold-secondary: #3A2A05;
  --gold-glass: rgba(255,255,255,.24); --gold-glass-down: rgba(255,255,255,.4); --gold-hair: rgba(255,255,255,.7);
  --tile-bg: rgba(231,180,60,.14); --tile-border: rgba(245,210,130,.3);
  --in: #9BE0AE; --out: #FFAA86; --warn: var(--accent); --flash: rgba(255,217,138,.2);
  --dialog: #15110A;
  --display: "Sora", system-ui, sans-serif; --body: "Manrope", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--body-text); font: 14px/1.5 var(--body); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #fff; }
a:focus-visible, button:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2 { font-family: var(--display); color: var(--text); margin: 0; letter-spacing: -.03em; }
/* Full browser width; the page is at least as tall as the window, footer at the bottom. */
.wrap { padding: 0 32px; }
#explorer { min-height: 100vh; display: flex; flex-direction: column; }
.muted { color: var(--soft); } .pos { color: var(--in); } .neg { color: var(--out); }
.error { color: var(--out); margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--out); background: rgba(255,170,134,.08); }

/* --- gold top -------------------------------------------------------------------- */
.goldtop { position: relative; overflow: hidden; color: var(--on-gold);
  background: radial-gradient(600px 400px at 90% 0%, rgba(255,255,255,.35), transparent 70%),
              linear-gradient(135deg, var(--gold-light), var(--gold) 50%, var(--gold-dark));
  box-shadow: 0 18px 50px rgba(231,180,60,.2); }
.goldtop::before, .goldtop::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  left: 88%; top: 60%; transform: translate(-50%, -50%); }
.goldtop::before { width: 620px; aspect-ratio: 1; border: 12px solid rgba(255,255,255,.16); }
.goldtop::after { width: 400px; aspect-ratio: 1; border: 2px solid rgba(255,255,255,.1); }
.goldtop > * { position: relative; }
.goldtop a:focus-visible { outline-color: var(--on-gold); }

header.wrap { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 36px; padding-bottom: 36px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--on-gold); font-family: var(--display); font-weight: 700; font-size: 19px; }
.brand:hover { color: var(--on-gold); }
.title { display: flex; align-items: center; gap: 16px; min-width: 0; }
.title h1 { padding-left: 16px; border-left: 1px solid rgba(26,19,0,.25); font-size: 19px; font-weight: 700; line-height: 34px; color: var(--on-gold); }
.mark { width: 34px; height: 34px; flex: none; display: block; border-radius: 22.4%; overflow: hidden;
  border: 1px solid rgba(255,255,255,.7); box-shadow: 0 2px 6px rgba(26,19,0,.28); }
.mark img { display: block; width: 100%; height: 100%; }


/* connection status: LiveView puts phx-connected / phx-error on its root element */
.status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px;
  font-size: 13px; font-weight: 700; color: var(--on-gold); background: var(--gold-glass); border: 1px solid var(--gold-hair); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--soft); display: inline-block; flex: none; }
.dot.on { background: var(--in); box-shadow: 0 0 10px rgba(155,224,174,.6); }
.dot.off { background: var(--out); }
.status .dot { background: var(--on-gold-secondary); opacity: .5; }
.phx-connected .status .dot { background: #1F7A3D; opacity: 1; box-shadow: 0 0 0 3px rgba(31,122,61,.25); }
:is(.phx-error, .phx-client-error, .phx-server-error) .status .dot { background: #A3321A; opacity: 1; }
.status .when-live, .status .when-error { display: none; }
.phx-connected .status .when-connecting { display: none; }
.phx-connected .status .when-live { display: inline; }
:is(.phx-error, .phx-client-error, .phx-server-error) .status .when-connecting { display: none; }
:is(.phx-error, .phx-client-error, .phx-server-error) .status .when-error { display: inline; }

/* --- facts strip: totals edge to edge, hairlines between --------------------------- */
/* Always one row of five; the supply gets double width for its long number. */
.facts { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--hair); background: var(--glass); }
.facts > div { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 96px; padding: 12px 16px; text-align: center; min-width: 0; }
.facts > div + div { border-left: 1px solid var(--hair); }
.facts strong { font-family: var(--display); font-weight: 700; font-size: clamp(14px, 1.35vw, 22px); color: var(--text);
  letter-spacing: -.02em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.facts span { font-size: 13px; font-weight: 500; color: var(--soft); }

/* --- panels ------------------------------------------------------------------------- */
.content { flex: 1; width: 100%; padding-top: 32px; padding-bottom: 56px; }
.panel { background: var(--glass); border: 1px solid var(--hair); min-width: 0; }
.panel h2 { font-family: var(--body); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--soft);
  padding: 14px 18px; border-bottom: 1px solid var(--hair);
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.aside { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500; color: var(--soft); }
a.aside { color: var(--accent); font-weight: 700; }
a.aside:hover { color: #fff; }
/* tabs: a flat strip with hairlines between, the open one underlined in gold */
.tabs { display: flex; margin-bottom: 24px; border: 1px solid var(--hair); background: var(--glass); overflow-x: auto; }
.tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 18px;
  white-space: nowrap; font-size: 14px; font-weight: 700; color: var(--muted); box-shadow: inset 0 -2px 0 transparent; }
.tab + .tab { border-left: 1px solid var(--hair); }
.tab:hover { color: var(--text); background: var(--glass-down); }
.tab.active { color: var(--text); background: var(--tile-bg); box-shadow: inset 0 -2px 0 var(--gold); }
.stack { display: grid; gap: 24px; }
.holders { display: flex; flex-direction: column; }
.holders > span { display: flex; align-items: center; gap: 8px; padding: 11px 18px; font-weight: 600; color: var(--strong); }
.holders > span + span { border-top: 1px solid var(--divider); }
.holders .muted { font-weight: 500; }

/* --- tables ------------------------------------------------------------------------- */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--divider); white-space: nowrap; }
th { font-weight: 700; color: var(--soft); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { color: var(--text); font-weight: 600; }
td.num.pos { color: var(--in); } td.num.neg { color: var(--out); } td.num.muted { color: var(--soft); font-weight: 500; }
tr.wallet, tr.tx { cursor: pointer; }
:is(tr.wallet, tr.tx):hover { background: var(--glass-down); }
tr.selected { background: var(--tile-bg); box-shadow: inset 3px 0 0 var(--gold); }
.addr, .hash { font-family: var(--mono); font-size: 12px; color: var(--muted); }
td.hash a { color: var(--soft); }
td.hash a:hover { color: var(--accent); }
.name { font-weight: 700; color: var(--accent); }
.memo { display: inline-block; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom;
  margin-left: 6px; color: var(--soft); font-style: italic; font-size: 12px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 8px; color: var(--strong); background: var(--glass); border: 1px solid var(--hair); }
.tag.send { color: var(--out); border-color: rgba(255,170,134,.45); background: rgba(255,170,134,.08); }
.tag.receive { color: var(--in); border-color: rgba(155,224,174,.4); background: rgba(155,224,174,.07); }
.tag.open { color: var(--on-gold); border-color: var(--gold-block-border); background: linear-gradient(180deg, var(--gold-light), var(--gold-block)); }
.tag.pending { color: var(--accent); border-color: var(--tile-border); background: var(--tile-bg); }
.flash { animation: flash 2s ease-out; }
@keyframes flash { from { background: var(--flash); } to { background: transparent; } }
.empty { padding: 28px 18px; color: var(--soft); text-align: center; }

/* --- pagination ------------------------------------------------------------------------ */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 10px 18px; border-top: 1px solid var(--hair); font-size: 12px; color: var(--soft); }
.pager .controls { display: flex; align-items: center; gap: 6px; }
.pager form { margin: 0; }
.pager .btn, .pager select { font: inherit; font-weight: 600; color: var(--text); background: var(--glass); border: 1px solid var(--hair);
  border-radius: 0; padding: 5px 11px; cursor: pointer; }
.pager select { background: var(--bg); }
.pager .btn:hover { color: var(--text); background: var(--glass-down); border-color: var(--tile-border); }
.pager .btn.disabled { color: var(--soft); opacity: .45; cursor: default; }
.pager .btn.disabled:hover { background: var(--glass); border-color: var(--hair); }

/* --- activity chart: one series, 60 one-minute columns in gold ----------------------- */
.chart { padding: 18px 18px 10px 50px; }
.plot { position: relative; height: 140px; }
.gridline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--divider); }
.gridline.baseline { border-top-color: var(--hair); }
.tick { position: absolute; right: calc(100% + 8px); transform: translateY(-50%); font-size: 11px;
  color: var(--soft); font-variant-numeric: tabular-nums; }
.cols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.col { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar { width: 100%; max-width: 24px; background: linear-gradient(180deg, var(--gold-light), var(--gold-block));
  box-shadow: inset 0 1px 0 var(--gold-block-border); }
.col:hover .bar { box-shadow: 0 0 14px rgba(255,217,138,.6); }
.tip { display: none; position: absolute; left: 50%; transform: translateX(-50%); z-index: 2; pointer-events: none;
  background: var(--dialog); color: var(--body-text); border: 1px solid var(--tile-border);
  font-size: 12px; padding: 6px 9px; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.tip b { color: var(--accent); }
.col.tip-start .tip { transform: translateX(-15%); }
.col.tip-end .tip { transform: translateX(-85%); }
.col:hover .tip { display: block; }
.note { position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center;
  color: var(--soft); font-size: 12px; pointer-events: none; }
.xaxis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--soft); font-variant-numeric: tabular-nums; }

/* --- transaction details dialog ----------------------------------------------------------- */
.overlay { position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh 16px 16px; overflow-y: auto; background: rgba(0,0,0,.65); backdrop-filter: blur(2px); }
.dialog { width: 100%; max-width: 760px; background: var(--dialog); border-color: var(--tile-border);
  box-shadow: 0 24px 60px rgba(0,0,0,.6); }
.dialog h2 { color: var(--accent); }
.dialog .close { color: var(--soft); font-size: 14px; padding: 0 4px; }
.dialog .close:hover { color: var(--text); }
.dialog dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 24px; margin: 0; padding: 6px 18px 10px; }
.dialog dt, .dialog dd { padding: 10px 0; border-top: 1px solid var(--divider); }
.dialog dt:first-of-type, .dialog dd:first-of-type { border-top: 0; }
.dialog dt { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); padding-top: 12px; }
.dialog dd { margin: 0; min-width: 0; color: var(--body-text); }
.dialog dd b { font-family: var(--display); font-size: 18px; letter-spacing: -.02em; }
.dialog a:hover { color: #fff; }
.dialog .full { word-break: break-all; }
.dialog .memo-full { white-space: pre-wrap; overflow-wrap: anywhere; }
.dialog .name { margin-right: 6px; }
.dialog .foot { margin: 0; border-top: 1px solid var(--hair); }
.dialog .foot a { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; font-size: 14px; font-weight: 700;
  color: var(--on-gold); background: linear-gradient(135deg, var(--gold-light), var(--gold) 50%, var(--gold-dark)); }
.dialog .foot a::after { content: "→"; }
.dialog .foot a:hover { color: var(--on-gold); filter: brightness(1.06); }

footer { padding: 24px 0; border-top: 1px solid var(--hair); background: var(--glass); font-size: 13px; color: var(--soft); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }

@media (max-width: 1000px) {
  .facts > div { padding: 10px 8px; }
  .facts strong { font-size: clamp(12px, 2vw, 18px); }
  .facts span { font-size: 12px; }
}
@media (max-width: 640px) {
  /* Still one row: tighter cells and smaller text; a long number may wrap. */
  .facts > div { padding: 8px 4px; }
  .facts strong { font-size: clamp(10px, 2.9vw, 14px); letter-spacing: -.01em; }
  .facts span { font-size: 10px; line-height: 1.25; }
  header.wrap { padding-top: 28px; padding-bottom: 28px; gap: 12px; }
  /* Logo, name and status share one line on phones: smaller and tighter. */
  .brand { font-size: 16px; gap: 8px; }
  .mark { width: 28px; height: 28px; }
  .title { gap: 10px; }
  .title h1 { padding-left: 10px; font-size: 16px; line-height: 28px; }
  .status { padding: 4px 9px; font-size: 12px; gap: 6px; flex: none; }
  /* Three tabs fit side by side: labels may take two lines. */
  .tabs { overflow-x: visible; }
  .tab { padding: 8px 6px; gap: 6px; font-size: 12px; line-height: 1.2; white-space: normal; text-align: center; }
  .wrap { padding: 0 16px; }
      .goldtop::before { left: 92%; top: 30%; width: 420px; }
  .goldtop::after { left: 92%; top: 30%; width: 270px; }
  .facts > div { min-height: 80px; }
  .content { padding-top: 24px; }
    th, td { padding: 9px 14px; }
  .dialog dl { grid-template-columns: 1fr; }
  .dialog dd { border-top: 0; padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } }

/* Monitor page (OneEur.Web.MonitorLive) */
.monitor-facts { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.monitor-facts .fact { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 18px 24px; color: inherit; }
.monitor-facts .fact + .fact { border-left: 1px solid var(--hair); }
.monitor-facts .fact:hover { background: var(--glass-down); }
.monitor-facts .fact.active { background: var(--tile-bg); box-shadow: inset 0 -2px 0 var(--accent); }
.monitor-facts strong.bad, .tag.bad { color: var(--out); }
.monitor-facts strong.warn, .tag.warn { color: var(--accent); }
.tag.bad { border-color: rgba(255,170,134,.45); background: rgba(255,170,134,.08); }
.tag.warn { border-color: var(--tile-border); background: var(--tile-bg); }
.bar.bad { background: linear-gradient(180deg, #FFC2A6, #D9643A); }
.monitor-actions { display: inline-flex; align-items: center; gap: 8px; }
.monitor-actions .btn { font: inherit; font-weight: 600; color: var(--text); background: var(--glass); border: 1px solid var(--hair); padding: 4px 10px; cursor: pointer; }
.monitor-actions .btn:hover { background: var(--glass-down); }
.incidents { list-style: none; margin: 0; padding: 0; }
.incidents li + li { border-top: 1px solid var(--divider); }
.incidents .row { width: 100%; display: flex; align-items: baseline; gap: 10px; padding: 10px 18px; font: inherit; font-size: 13px; color: var(--body-text); background: none; border: 0; text-align: left; cursor: pointer; }
.incidents .row:hover { background: var(--glass-down); }
.incidents .when { flex: none; font-family: var(--mono); font-size: 12px; }
.incidents .reason, td.reason { font-weight: 700; overflow-wrap: anywhere; }
.incidents .summary { min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.incidents dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 16px; margin: 0; padding: 4px 18px 14px; }
.incidents dt { padding: 6px 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
.incidents dd { margin: 0; padding: 6px 0; min-width: 0; }
.incidents pre { margin: 0; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--strong, var(--body-text)); }
@media (max-width: 860px) {
  .monitor-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitor-facts .fact + .fact { border-left: 0; }
  .incidents .row { flex-wrap: wrap; }
  .incidents .summary { flex-basis: 100%; white-space: normal; }
}
