:root {
  color-scheme: light;
  /* Copper Digital website tokens (copperdigital.com, 5 Dec 2026) */
  --green: #00C377; --green-2: #00E68A; --blue: #0095FF; --navy: #1B2D4B; --charcoal: #2D3A4F; --slate: #475569;
  --bg: #F8FAFC; --surface: #FFFFFF; --surface-2: #F1F5F9; --line: #E2E8F0;
  --text: #1B2D4B; --text-2: #475569; --muted: #64748B;
  --accent: #00C377; --accent-ink: #FFFFFF;
  --brand-gradient: linear-gradient(135deg, #00C377 0%, #0095FF 100%);
  --brand-gradient-hover: linear-gradient(135deg, #00B36B 0%, #0086E6 100%);
  --series-1: #0095FF; --series-2: #00C377;
  --good: #00895A; --good-bg: #E6F9F1; --warn: #9A6700; --warn-bg: #FFF4D6; --bad: #D92D20; --bad-bg: #FDECEA;
  --info: #0071C2; --info-bg: #E6F4FF; --bar-track: #E2E8F0;
  --shadow: 0 2px 8px rgba(27, 45, 75, .06);
  --shadow-md: 0 4px 12px rgba(27, 45, 75, .10);
  --radius: 12px;
  --font-head: "Poppins", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0D1626; --surface: #111D33; --surface-2: #17243D; --line: #26344D;
    --text: #F8FAFC; --text-2: #CBD5E1; --muted: #94A3B8; --accent: #00E68A; --accent-ink: #0D1626;
    --series-1: #33AAFF; --series-2: #00E68A;
    --good: #3DDC97; --good-bg: #0F2E24; --warn: #F2C14E; --warn-bg: #33290F; --bad: #FF8A80; --bad-bg: #3A1A1A;
    --info: #66BFFF; --info-bg: #10243F; --bar-track: #26344D; --shadow: 0 2px 8px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D1626; --surface: #111D33; --surface-2: #17243D; --line: #26344D;
  --text: #F8FAFC; --text-2: #CBD5E1; --muted: #94A3B8; --accent: #00E68A; --accent-ink: #0D1626;
  --series-1: #33AAFF; --series-2: #00E68A;
  --good: #3DDC97; --good-bg: #0F2E24; --warn: #F2C14E; --warn-bg: #33290F; --bad: #FF8A80; --bad-bg: #3A1A1A;
  --info: #66BFFF; --info-bg: #10243F; --bar-track: #26344D; --shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); line-height: 1.45;
  font-family: var(--font-body);
  overflow-x: hidden;
}
a { color: var(--info); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-family: var(--font-head); font-size: 1.5rem; font-weight: 600; margin: 0; letter-spacing: -.01em; }
h2 { font-family: var(--font-head); font-size: 1.05rem; font-weight: 600; margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; word-break: break-all; }

/* header */
.top {
  box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(27, 45, 75, .04);
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-img { height: 27px; width: auto; display: block; }
.brand .product { font-family: var(--font-head); font-weight: 600; font-size: .95rem; padding-left: 10px;
  border-left: 1px solid var(--line); background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .top .logo-img { content: url(/static/brand/copper-digital-logo-white.webp); } }
:root[data-theme="dark"] .top .logo-img { content: url(/static/brand/copper-digital-logo-white.webp); }

nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
nav a {
  padding: 6px 10px; border-radius: 7px; color: var(--text-2); text-decoration: none; white-space: nowrap;
}
nav a { font-weight: 500; }
nav a:hover { color: var(--text); background: var(--surface-2); }
nav a.on { color: var(--text); font-weight: 600; background: var(--good-bg); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 7px 7px 2px 2px; }
.who { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: .85rem; }

main { max-width: 1240px; margin: 0 auto; padding: 22px 24px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px; }

/* buttons */
.btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 12px; cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand-gradient); border: 0; color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(0, 149, 255, .18); }
.btn.primary:hover { background: var(--brand-gradient-hover); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: default; }
button.link { border: 0; background: none; color: var(--info); cursor: pointer; padding: 0; }

/* summary strip */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand-gradient); }
.stat b { display: block; font-family: var(--font-head); font-weight: 600; font-size: 1.6rem; font-variant-numeric: tabular-nums; color: var(--text); }
.stat span { color: var(--muted); font-size: .82rem; }

/* account cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: box-shadow .15s ease;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.card-head .title { min-width: 0; }
.card-head .title h2 { overflow-wrap: anywhere; }
.card-head .sub { color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.card:hover { box-shadow: var(--shadow-md); }
.engine { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 6px; background: var(--info-bg); color: var(--info); margin-right: 6px; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: .8rem;
  font-weight: 600; white-space: nowrap; }
.pill::before { font-size: .75rem; }
.pill.ready { background: var(--good-bg); color: var(--good); }
.pill.ready::before { content: "\2713"; }
.pill.near_limit { background: var(--warn-bg); color: var(--warn); }
.pill.near_limit::before { content: "\25B2"; }
.pill.limited, .pill.error { background: var(--bad-bg); color: var(--bad); }
.pill.limited::before { content: "\25A0"; }
.pill.error::before { content: "!"; }
.pill.signed_out, .pill.unknown { background: var(--surface-2); color: var(--text-2); }
.pill.signed_out::before { content: "\25CB"; }
.pill.unknown::before { content: "?"; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: .85rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.on { background: var(--good); }
.dot.off { background: var(--bad); }

.meter { display: grid; grid-template-columns: 74px 1fr 46px; gap: 8px; align-items: center; font-size: .85rem; }
.meter .label { color: var(--text-2); }
.meter .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.track { height: 8px; background: var(--bar-track); border-radius: 99px; overflow: hidden; }
.fill { height: 100%; border-radius: 99px; background: var(--brand-gradient); min-width: 2px; }
.fill.warn { background: linear-gradient(90deg, #F5B300, #E08A00); }
.fill.bad { background: var(--bad); }
.fill.stale { opacity: .35; }
.resets { grid-column: 2 / 4; color: var(--muted); font-size: .78rem; margin-top: -5px; }

.status-msg { font-size: .82rem; color: var(--text-2); background: var(--surface-2); border-radius: 7px; padding: 6px 9px; }
.status-msg.bad { background: var(--bad-bg); color: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }

.signin { border: 1px dashed var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 8px; font-size: .88rem; }
.signin .code { font-size: 1.3rem; font-weight: 700; letter-spacing: .08em; font-family: ui-monospace, Menlo, monospace; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row input { flex: 1; min-width: 0; }

/* forms */
label.field { display: grid; gap: 4px; font-size: .88rem; }
label.field span { color: var(--text-2); font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; width: 100%;
}
input:focus-visible, select:focus-visible, .btn:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--info); outline-offset: 1px;
}
.form { display: grid; gap: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .9rem; }
.hint { color: var(--muted); font-size: .8rem; }

/* tables */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .86rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); position: sticky; top: 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters select { width: auto; min-width: 140px; }
.tag { font-size: .78rem; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); }
.tag.succeeded { background: var(--good-bg); color: var(--good); }
.tag.failed { background: var(--bad-bg); color: var(--bad); }
.tag.running, .tag.queued { background: var(--info-bg); color: var(--info); }

.keybox { background: var(--warn-bg); color: var(--text); border-radius: 8px; padding: 12px; display: grid; gap: 8px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }

/* sign-in / set password */
body.auth { background: var(--surface); }
.auth-page { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); overflow: auto; }
.auth-brand { position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column;
  justify-content: space-between; gap: 32px; background: var(--brand-gradient); }
.auth-brand::before, .auth-brand::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.18), rgba(255,255,255,0) 70%); }
.auth-brand::before { width: 520px; height: 520px; right: -160px; top: -140px; }
.auth-brand::after { width: 420px; height: 420px; left: -140px; bottom: -160px; }
.auth-logo { width: 220px; height: auto; position: relative; }
.auth-copy { position: relative; max-width: 460px; }
.auth-copy .eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 600; opacity: .85; margin: 0 0 10px; }
.auth-copy h1 { color: #fff; font-size: 2.8rem; font-weight: 700; line-height: 1.1; margin: 0 0 14px; }
.auth-copy p { margin: 0; font-size: 1.05rem; line-height: 1.6; opacity: .95; }
.auth-points { position: relative; list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: .95rem; }
.auth-points li { display: flex; gap: 10px; align-items: center; }
.auth-points li::before { content: "\2713"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,.22); font-size: .75rem; font-weight: 700; flex: none; }
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; gap: 18px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-md); padding: 32px 30px; display: grid; gap: 14px; }
.auth-card h2 { font-size: 1.5rem; }
.auth-card > .muted { margin: -6px 0 4px; font-size: .92rem; }
.auth-logo-sm { display: none; width: 150px; height: auto; }
.auth-foot { color: var(--muted); font-size: .78rem; margin: 0; }
.btn.block { width: 100%; padding: 11px 14px; font-size: 1rem; border-radius: 10px; }
.pw { position: relative; }
.pw input { padding-right: 64px; }
.pw .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--info);
  font-size: .82rem; font-weight: 600; cursor: pointer; padding: 6px 8px; }
.auth-card input, .pw-panel input { padding: 11px 12px; border-radius: 10px; }
.strength { display: grid; gap: 6px; margin-top: -4px; }
.strength i { display: block; height: 5px; border-radius: 99px; background: var(--bar-track); position: relative; overflow: hidden; }
.strength i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 0; background: var(--bad); border-radius: 99px; transition: width .2s, background .2s; }
.strength[data-score="1"] i::after { width: 25%; background: var(--bad); }
.strength[data-score="2"] i::after { width: 50%; background: #E08A00; }
.strength[data-score="3"] i::after { width: 75%; background: var(--blue); }
.strength[data-score="4"] i::after { width: 100%; background: var(--green); }
.pw-panel { max-width: 520px; margin-top: 18px; }
@media (max-width: 860px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-logo-sm { display: block; }
  .auth-panel { padding: 28px 16px; justify-content: flex-start; padding-top: 10vh; }
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-logo-sm { content: url(/static/brand/copper-digital-logo-white.webp); } }

/* dialog */
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(620px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .35); }
.dlg { padding: 18px 20px; display: grid; gap: 14px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* history chart */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .s1 { stroke: var(--series-1); }
.chart .s2 { stroke: var(--series-2); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { stroke: var(--surface); stroke-width: 2; }
.chart .pt.s1 { fill: var(--series-1); }
.chart .pt.s2 { fill: var(--series-2); }
.chart .cross { stroke: var(--muted); stroke-dasharray: 3 3; }
.chart .lbl { font-size: 11px; fill: var(--text-2); }
.legend { display: flex; gap: 14px; font-size: .82rem; color: var(--text-2); }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: 3px; margin-right: 5px; }
.legend i.s1 { background: var(--series-1); }
.legend i.s2 { background: var(--series-2); }
.tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 9px; font-size: .8rem; box-shadow: var(--shadow); white-space: nowrap; }

#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--navy);
  color: #fff; padding: 9px 16px; border-radius: 9px; font-size: .9rem; z-index: 20; max-width: calc(100vw - 32px); }

@media (max-width: 640px) {
  :root { font-size: 14.5px; }
  .top { padding: 8px 16px; gap: 8px; }
  nav { order: 3; flex-basis: 100%; }
  .who { margin-left: auto; }
  main { padding: 16px 16px 50px; }
  .cards { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
