:root {
  color-scheme: light;
  --paper: #ffffff;
  --mist: #eef3f6;
  --ink: #14283f;
  --muted: #50647a;
  --line: #cbd6e2;
  --line-soft: #dfe7ef;
  --blue: #2453c6;
  --blue-dark: #1d419e;
  --blue-pale: #e8efff;
  --navy: #173050;
  --green: #146652;
  --green-pale: #e3f4ec;
  --gold: #794c08;
  --gold-pale: #fff2d8;
  --red: #a4323e;
  --red-pale: #ffedf0;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
  font: 400 16px/1.55 Manrope, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--mist);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 280px; margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-underline-offset: .22em; }
a:hover { color: var(--blue-dark); }
svg { display: block; }
.icon { width: 1.15em; height: 1.15em; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 3.2vw, 2.72rem); letter-spacing: -.055em; line-height: 1.14; }
h2 { font-size: clamp(1.22rem, 2vw, 1.56rem); letter-spacing: -.032em; line-height: 1.25; }
h3 { font-size: 1.03rem; letter-spacing: -.015em; line-height: 1.33; }
p + p { margin-top: .65rem; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
:focus:not(:focus-visible) { outline: none; }
.skip { position: fixed; top: .5rem; left: .5rem; z-index: 5; padding: .65rem .9rem; background: white; transform: translateY(-160%); }
.skip:focus { transform: translateY(0); }
.boot { display: grid; min-height: 100svh; place-content: center; justify-items: center; gap: 1rem; color: var(--muted); }
.noscript { position: fixed; inset: auto 1rem 1rem; padding: .75rem; border: 1px solid var(--line); background: white; }

.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; font-weight: 750; font-size: 1.16rem; letter-spacing: -.038em; color: var(--ink); width: max-content; }
.brand svg { width: 2.18rem; height: 2.18rem; color: var(--blue); }
.brand-light { color: white; }
.brand-light svg { color: #3864d4; }

.entry { min-height: 100svh; display: grid; grid-template-columns: minmax(310px, 43%) 1fr; background: var(--paper); }
.entry-aside { padding: clamp(1.7rem, 4vw, 4rem); display: flex; flex-direction: column; justify-content: space-between; position: relative; background: var(--navy); color: white; overflow: hidden; }
.entry-aside::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .27; background-image: linear-gradient(#46617e 1px, transparent 1px), linear-gradient(90deg, #46617e 1px, transparent 1px); background-size: 38px 38px; mask-image: linear-gradient(transparent 10%, black 55%, transparent 100%); }
.entry-aside > * { z-index: 1; }
.entry-caption { color: #b8cbe5; font-size: .94rem; }
.entry-art { width: min(340px, 100%); aspect-ratio: 1.2; display: grid; place-items: center; position: relative; align-self: center; }
.device { width: 126px; height: 210px; padding: 1.1rem .75rem; border: 1px solid #7190b5; border-radius: 1.35rem; background: #1b3b63; box-shadow: 0 18px 55px #0c2340a0; display: flex; align-items: center; flex-direction: column; justify-content: center; }
.device-top { position: absolute; width: 34px; height: 4px; background: #7896bc; border-radius: 2px; align-self: center; transform: translateY(-77px); }
.device-barcode { width: 78px; height: 42px; background: repeating-linear-gradient(90deg,#d8e6fb 0 2px,transparent 2px 5px,#d8e6fb 5px 9px,transparent 9px 12px,#d8e6fb 12px 13px,transparent 13px 15px); }
.device-rule { margin: .72rem 0 1rem; width: 75px; height: 3px; background: #6684a9; border-radius: 2px; }
.device-status { display: flex; align-items: center; gap: .28rem; color: #b7f0da; background: #234e56; border: 1px solid #518378; padding: .22rem .35rem; border-radius: .25rem; font-size: .62rem; white-space: nowrap; }
.device-status svg { width: .82rem; height: .82rem; stroke: currentColor; fill: none; stroke-width: 2; }
.scan-corner { position: absolute; width: 23px; height: 23px; border-color: #8ab3fc; border-style: solid; }
.top-left { left: 0; top: 0; border-width: 2px 0 0 2px; }
.top-right { right: 0; top: 0; border-width: 2px 2px 0 0; }
.bottom-left { left: 0; bottom: 0; border-width: 0 0 2px 2px; }
.bottom-right { right: 0; bottom: 0; border-width: 0 2px 2px 0; }
.entry-body { display: grid; place-items: center; padding: clamp(1.5rem, 6vw, 5rem); }
.entry-form { width: min(100%, 26rem); }
.entry-icon { display: grid; width: 3rem; height: 3rem; place-items: center; color: var(--blue); background: var(--blue-pale); border-radius: .6rem; margin-bottom: 1.25rem; }
.entry-icon svg { width: 1.4rem; height: 1.4rem; }
.entry-form h1 { font-size: clamp(2rem, 4vw, 2.72rem); }
.entry-form form { margin-top: 1.65rem; display: grid; gap: 1rem; }
.entry-submit { width: 100%; justify-content: space-between; }
.entry-help { margin-top: .9rem; }
.entry-note { font-size: .84rem; margin-top: 1.6rem; color: var(--muted); }
.lede { margin-top: .52rem; color: var(--muted); max-width: 63ch; }

.dashboard { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100svh; }
.sidebar { min-width: 0; display: flex; flex-direction: column; gap: 2.15rem; padding: 1.4rem 1rem .8rem; background: var(--paper); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100svh; }
.sidebar > .brand { margin-left: .35rem; }
.navigation { display: grid; gap: .25rem; }
.navigation a { display: flex; align-items: center; gap: .67rem; padding: .65rem .72rem; border-radius: .43rem; text-decoration: none; font-size: .91rem; font-weight: 600; white-space: nowrap; color: var(--muted); }
.navigation a:hover { color: var(--ink); background: var(--mist); }
.navigation a[aria-current="page"] { color: var(--blue-dark); background: var(--blue-pale); }
.sidebar-foot { display: flex; gap: .5rem; align-items: center; border-top: 1px solid var(--line-soft); margin-top: auto; padding: .8rem 0 .1rem; }
.avatar { flex: 0 0 auto; display: grid; place-items: center; width: 2rem; height: 2rem; background: var(--blue-pale); border-radius: 50%; font-size: .82rem; font-weight: 750; color: var(--blue-dark); }
.account-info { min-width: 0; flex: 1 1 auto; font-size: .75rem; line-height: 1.3; }
.account-info > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-info span { color: var(--muted); margin-top: .15rem; }
.workspace { min-width: 0; }
.workspace-bar { display: flex; justify-content: space-between; align-items: center; gap: .7rem; padding: .65rem clamp(1rem, 3vw, 2.6rem); min-height: 3.5rem; border-bottom: 1px solid var(--line); background: var(--paper); }
.workspace-bar > span { font-size: .9rem; font-weight: 650; color: var(--muted); }
.top-wallet { display: flex; align-items: center; gap: .44rem; font-size: .83rem; color: var(--ink); text-decoration: none; }
.top-wallet .icon { color: var(--blue); }
.top-wallet strong { font-variant-numeric: tabular-nums; }
.top-wallet > span { color: var(--muted); }
.main-content { max-width: 1320px; margin: 0 auto; padding: clamp(1.15rem, 3vw, 2.75rem); }
.page-heading { margin: 0 0 1.5rem; }
.heading-row, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .85rem; }
.section-heading { align-items: center; margin-bottom: .9rem; }
.stack { display: grid; gap: 1rem; }
.grid-two { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(248px, 1fr); gap: 1rem; align-items: start; }
.grid-two.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.overview-grid { align-items: stretch; }
.panel { min-width: 0; padding: clamp(1rem, 2vw, 1.5rem); border: 1px solid var(--line); border-radius: .65rem; background: var(--paper); }
.hero-panel { display: flex; flex-direction: column; justify-content: center; position: relative; min-height: 16rem; padding: clamp(1.25rem, 3vw, 2.2rem); overflow: hidden; background: var(--navy); border-color: var(--navy); color: white; }
.hero-panel h2 { position: relative; font-size: clamp(1.65rem, 3vw, 2.3rem); max-width: 15ch; line-height: 1.13; }
.hero-panel .lede { position: relative; color: #d0dcf0; max-width: 39ch; }
.hero-panel .actions { position: relative; margin-top: 1.25rem; }
.hero-art { width: 13rem; height: 13rem; color: #96b8f5; position: absolute; right: -.15rem; bottom: -1.75rem; opacity: .19; transform: rotate(-10deg); }
.hero-panel .button.primary { background: #fff; border-color: #fff; color: var(--navy); }
.hero-panel .button.primary:hover { background: #e8efff; }
.hero-panel .button.secondary { background: transparent; color: #e3edff; border-color: #809ac0; }
.hero-panel .button.secondary:hover { background: #294968; }
.balance-panel { min-height: 16rem; display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; }
.balance-amount { display: block; font-size: clamp(1.75rem, 3.4vw, 2.55rem); letter-spacing: -.05em; line-height: 1.2; margin: .25rem 0 .35rem; overflow-wrap: anywhere; font-weight: 750; font-variant-numeric: tabular-nums; }
.small { font-size: .86rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .9em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.empty { padding: 1.45rem 1rem; border: 1px dashed var(--line); border-radius: .45rem; background: #f8fbfd; color: var(--muted); text-align: center; }
.empty strong { display: block; color: var(--ink); margin-bottom: .2rem; }
.hint { font-size: .85rem; color: var(--muted); }
.inline-status { font-size: .85rem; color: var(--muted); min-height: 1.35rem; }
.price-lines { display: grid; gap: .52rem; margin: .8rem 0 0; }
.price-lines div { display: flex; justify-content: space-between; gap: .6rem; }
.price-lines dt { color: var(--muted); font-size: .87rem; }
.price-lines dd { margin: 0; font-size: .9rem; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.price-lines .total { padding-top: .65rem; border-top: 1px solid var(--line-soft); }
.price-lines .total dd { color: var(--ink); font-weight: 750; font-size: 1.05rem; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.button { min-height: 2.56rem; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .55rem .88rem; border: 1px solid transparent; border-radius: .42rem; text-decoration: none; font-weight: 670; font-size: .88rem; line-height: 1.25; }
.button:disabled { opacity: .52; cursor: not-allowed; }
.button.primary { background: var(--blue); border-color: var(--blue); color: white; }
.button.primary:hover:not(:disabled) { background: var(--blue-dark); border-color: var(--blue-dark); }
.button.secondary { background: white; color: var(--ink); border-color: var(--line); }
.button.secondary:hover:not(:disabled) { background: var(--mist); }
.button.danger { color: var(--red); background: white; border-color: #e7b8bf; }
.button.danger:hover:not(:disabled) { background: var(--red-pale); }
.button.small-button { padding: .34rem .65rem; min-height: 2rem; font-size: .79rem; }
.icon-button { padding: .35rem; min-width: 2rem; min-height: 2rem; border: 0; border-radius: .34rem; display: inline-grid; place-items: center; color: var(--muted); background: transparent; }
.icon-button:hover { color: var(--ink); background: var(--mist); }
.text-button { border: 0; background: transparent; padding: .12rem 0; color: var(--blue); font-size: .9rem; font-weight: 660; text-decoration: underline; text-underline-offset: .2em; }
.text-button:hover { color: var(--blue-dark); }
.text-button:disabled { opacity: .55; cursor: not-allowed; }
.field { display: grid; gap: .33rem; min-width: 0; }
label, legend { font-weight: 670; font-size: .9rem; }
input:not([type=radio]), textarea, select { width: 100%; min-width: 0; padding: .58rem .68rem; border: 1px solid var(--line); border-radius: .4rem; background: white; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); }
input::placeholder, textarea::placeholder { color: #667a8e; }
textarea { min-height: 10rem; resize: vertical; font-family: var(--mono); font-size: .9rem; }
.form-grid { display: grid; gap: .85rem; }
.choice-row { display: flex; align-items: flex-start; gap: .6rem; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: .44rem; cursor: pointer; }
.choice-row:has(input:checked) { border-color: var(--blue); background: var(--blue-pale); }
.choice-row input { margin: .28rem 0 0; accent-color: var(--blue); }
.choice-row span { display: block; }
.choice-row span small { display: block; color: var(--muted); font-weight: 400; margin-top: .16rem; }
fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
fieldset legend { margin-bottom: .38rem; }
.notice { border: 1px solid var(--line); background: #f6f9fc; border-radius: .42rem; padding: .65rem .82rem; font-size: .88rem; color: var(--ink); overflow-wrap: anywhere; }
.notice.error { border-color: #edc0c6; background: var(--red-pale); color: #822432; }
.notice.success { border-color: #b8dfcc; background: var(--green-pale); color: #104f3e; }
.notice.warning { border-color: #f0d9a8; background: var(--gold-pale); color: #6b4408; }
#global-alert:not(:empty), #entry-alert:not(:empty) { margin-bottom: .85rem; margin-top: .75rem; }

.table-wrap { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .87rem; }
th { color: var(--muted); background: #f6f9fc; font-size: .78rem; font-weight: 670; }
th, td { padding: .65rem .66rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th:first-child { border-radius: .3rem 0 0 .3rem; }
th:last-child { border-radius: 0 .3rem .3rem 0; }
tbody tr:last-child td { border-bottom: 0; }
.table-wrap td time { white-space: nowrap; }
.badge { display: inline-flex; align-items: center; min-height: 1.5rem; padding: .11rem .44rem; border-radius: .26rem; white-space: nowrap; font-size: .76rem; font-weight: 660; color: var(--muted); background: var(--mist); }
.badge.good { color: var(--green); background: var(--green-pale); }
.badge.blue { color: var(--blue-dark); background: var(--blue-pale); }
.badge.warn { color: var(--gold); background: var(--gold-pale); }
.badge.bad { color: var(--red); background: var(--red-pale); }
.input-list { margin: .2rem 0 0; padding-left: 1.3rem; }
.code-block { max-width: 100%; overflow: auto; background: #173050; color: #ecf3ff; padding: .85rem; border-radius: .4rem; margin: .25rem 0; font: .81rem/1.55 var(--mono); white-space: pre; }
.doc-section { display: grid; gap: .65rem; overflow-wrap: anywhere; }
.doc-section h2, .doc-section h3 { margin-top: .7rem; }
.doc-section h2:first-child { margin-top: 0; }
.doc-section ul, .doc-section ol { margin: 0; padding-left: 1.35rem; }
.doc-section li + li { margin-top: .3rem; }
.doc-section code:not(pre code) { color: var(--blue-dark); padding: .07em .23em; background: var(--blue-pale); border-radius: .2rem; font: .9em var(--mono); }
.line-item { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.divider { border: 0; border-top: 1px solid var(--line-soft); margin: .95rem 0; }
.space-top { margin-top: .9rem; }
.qr { display: block; max-width: min(100%, 240px); max-height: 240px; width: auto; height: auto; margin: .8rem auto; border: 1px solid var(--line); padding: .45rem; border-radius: .4rem; }

dialog { width: min(100% - 1.6rem, 38rem); max-height: calc(100svh - 2rem); padding: 0; border: 1px solid var(--line); border-radius: .68rem; color: var(--ink); background: white; box-shadow: 0 18px 65px #14283f38; }
dialog::backdrop { background: #14283f80; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; padding: .82rem 1.12rem; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: white; z-index: 1; }
.dialog-heading h2 { font-size: 1.2rem; }
#dialog-body { padding: 1.05rem 1.12rem; }
.secret { padding: .72rem; background: var(--mist); border: 1px solid var(--line); border-radius: .35rem; user-select: all; }
.secret-list { columns: 2; padding-left: 1.35rem; margin: .5rem 0; }
.secret-list li { break-inside: avoid; }
.loading { min-height: 3rem; display: flex; align-items: center; gap: .6rem; color: var(--muted); }
.loading::before { content: ""; width: 1rem; height: 1rem; border: 2px solid var(--line); border-right-color: var(--blue); border-radius: 50%; animation: spin .65s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1000px) {
  .dashboard { grid-template-columns: 186px minmax(0, 1fr); }
  .grid-two { grid-template-columns: minmax(0, 1.35fr) minmax(215px, 1fr); }
}
@media (max-width: 770px) {
  .dashboard { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .62rem .4rem; height: auto; position: static; padding: .75rem .85rem .1rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar > .brand { margin: 0; }
  .sidebar-foot { grid-column: 2; grid-row: 1; padding: 0; margin: 0; border: 0; gap: .35rem; }
  .account-info { display: none; }
  .navigation { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .16rem; padding: .18rem .15rem .5rem; }
  .navigation a { padding: .42rem .62rem; font-size: .83rem; }
  .navigation .icon { display: none; }
  .workspace-bar { min-height: 2.75rem; padding-inline: .95rem; }
  .grid-two, .grid-two.equal { grid-template-columns: minmax(0, 1fr); }
  .balance-panel { min-height: 0; }
  .entry { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .entry-aside { padding: 1rem 1.15rem; }
  .entry-art, .entry-caption { display: none; }
  .entry-body { padding: 2.25rem 1.2rem; align-items: start; }
  .entry-form { margin-top: clamp(.3rem, 6vw, 1.35rem); }
  .heading-row { flex-wrap: wrap; }
  .hero-panel { min-height: 12rem; }
}
@media (max-width: 385px) {
  .main-content { padding-inline: .8rem; }
  .top-wallet > span { display: none; }
  .table-wrap { margin-inline: -.1rem; }
  .secret-list { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
