:root {
  color-scheme: light;
  --ink: #162437;
  --muted: #526278;
  --line: #dce4ec;
  --surface: #ffffff;
  --backdrop: #f1f5f8;
  --nav: #101b2d;
  --nav-raised: #1d2b40;
  --mint: #79e5bb;
  --green: #05724e;
  --green-dark: #06533e;
  --green-pale: #e5f7ef;
  --danger: #9e2f38;
  --danger-pale: #fff0ef;
  font-family: 'Segoe UI', Arial, sans-serif;
  font-synthesis: none;
  line-height: 1.5;
  color: var(--ink);
  background: var(--backdrop);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
form, dl, dd { margin: 0; }
ul, ol { padding-inline-start: 1.3rem; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 3vw, 2.55rem); letter-spacing: -.045em; line-height: 1.12; font-weight: 720; }
h2 { font-size: 1.13rem; letter-spacing: -.014em; line-height: 1.31; }
code, time, .money, .metrics dd { font-variant-numeric: tabular-nums; }
code { font-family: 'Cascadia Mono', Consolas, monospace; }
:focus-visible { outline: 3px solid #168b66; outline-offset: 3px; }
.sidebar :focus-visible { outline-color: var(--mint); }
.skip-link { position: absolute; top: .75rem; left: .75rem; z-index: 10; transform: translateY(-160%); background: white; padding: .5rem .8rem; border-radius: .45rem; }
.skip-link:focus { transform: translateY(0); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }
.wrap { overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.inline, .actions { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.stack { display: grid; gap: 1rem; }
.stack > * { min-width: 0; }
.form-grid { display: grid; gap: .95rem; }

.workspace { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--nav); color: #e5eef9;
  display: flex; flex-direction: column; padding: 1.5rem 1rem 1rem;
}
.brand { display: flex; gap: .7rem; align-items: center; width: fit-content; text-decoration: none; font-weight: 740; font-size: 1.02rem; line-height: 1.13; letter-spacing: -.025em; }
.sidebar .brand { margin-inline: .35rem; }
.brand small { display: block; margin-top: .25rem; font-weight: 520; font-size: .73rem; letter-spacing: .07em; text-transform: uppercase; }
.sidebar .brand small { color: #a2b2c8; }
.brand-mark {
  width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px;
  background: var(--mint); color: #093626; font-family: Georgia, serif; font-size: 1.55rem; font-weight: 800;
  box-shadow: inset 0 0 0 1px #bdffdd;
}
.navigation { display: grid; gap: .35rem; margin-top: 2.1rem; }
.navigation a {
  min-height: 43px; display: flex; align-items: center; gap: .75rem; padding: .45rem .65rem;
  color: #bfcfe3; text-decoration: none; border-radius: .6rem; font-size: .91rem; font-weight: 650;
}
.navigation a:hover { background: var(--nav-raised); color: #fff; }
.navigation a[aria-current='page'] { background: #203348; color: #fff; }
.nav-icon { display: grid; place-items: center; width: 1.5rem; font-size: 1.18rem; color: #a9c1cd; line-height: 1; }
.navigation a[aria-current='page'] .nav-icon { color: var(--mint); }
.sidebar-footer { display: flex; align-items: center; gap: .5rem; justify-content: space-between; margin: auto .4rem 0; padding-top: 1rem; border-top: 1px solid #334257; font-size: .72rem; color: #bdcada; }
.version { padding: .16rem .42rem; border-radius: .35rem; background: var(--nav-raised); font-variant-numeric: tabular-nums; white-space: nowrap; }
.work-area { min-width: 0; }
.topbar {
  min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--surface); border-bottom: 1px solid var(--line); padding: .7rem clamp(.9rem, 4vw, 2.1rem);
}
.environment { display: inline-flex; align-items: center; width: fit-content; min-height: 28px; gap: .4rem; padding: .15rem .55rem; border-radius: 999px; color: #14573f; background: var(--green-pale); font-size: .75rem; font-weight: 700; white-space: nowrap; }
.environment > span { height: .42rem; width: .42rem; border-radius: 50%; background: #0a7852; }
.account-actions { display: flex; align-items: center; justify-content: end; gap: .7rem; min-width: 0; }
.account-link { min-width: 0; display: grid; gap: .02rem; text-decoration: none; line-height: 1.26; overflow-wrap: anywhere; font-size: .83rem; }
.account-link:hover strong { color: var(--green); text-decoration: underline; }
.account-link span { color: var(--muted); font-size: .72rem; }
.content { max-width: 1500px; margin-inline: auto; padding: 1.85rem clamp(.9rem, 4vw, 2.1rem) 3rem; }
.content > * + * { margin-top: 1.15rem; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; min-width: 0; margin-bottom: 1.2rem; }
.page-head > * { min-width: 0; }
.page-head p, .panel-head p, .section-head p, .start-panel p { margin-top: .35rem; color: var(--muted); }
.page-head p { font-size: .95rem; }
.back-link, .text-link { color: var(--green-dark); text-decoration: none; font-weight: 660; }
.back-link { display: inline-flex; align-items: center; min-height: 26px; font-size: .87rem; }
.back-link:hover, .text-link:hover { text-decoration: underline; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 39px;
  padding: .45rem .8rem; border: 1px solid transparent; border-radius: .55rem; text-decoration: none;
  font-size: .86rem; line-height: 1.22; font-weight: 680; text-align: center; background: var(--green); color: white;
}
.button:hover { background: var(--green-dark); }
.button.secondary { color: #23364c; border-color: #cbd8e3; background: var(--surface); }
.button.secondary:hover { background: #edf3f7; border-color: #a9bdca; }
.button.subtle { color: var(--muted); background: #f0f4f7; }
.button.subtle:hover { color: var(--ink); background: #e4edf4; }
.button:disabled { opacity: .7; cursor: default; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: .85rem;
  padding: 1.15rem; min-width: 0; box-shadow: 0 2px 4px #273b5410;
}
.panel.flushed { padding: 0; }
.panel-head, .section-head { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.panel-head { padding: 1.1rem 1.15rem; border-bottom: 1px solid var(--line); }
.panel-head a { flex-shrink: 0; }
.section-head { margin-bottom: 1rem; }
.panel-head p, .section-head p, .start-panel p { font-size: .86rem; }
.empty { color: var(--muted); padding: 1.8rem 1.15rem; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.metrics-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric {
  display: grid; align-content: start; gap: .42rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: .82rem; min-height: 105px; padding: .85rem 1rem;
}
.metric dt { font-size: .82rem; font-weight: 640; color: var(--muted); }
.metric dd { font-size: clamp(1.27rem, 2.7vw, 1.95rem); line-height: 1.22; font-weight: 750; letter-spacing: -.035em; overflow-wrap: anywhere; }
.metric dd small { font-size: .73rem; letter-spacing: .02em; }
.metric-accent { background: #e9f8f0; border-color: #b9dfca; }
.metric-accent dt, .metric-accent dd { color: #145339; }
.start-panel { display: flex; align-items: center; gap: .85rem; }
.start-panel .button { margin-inline-start: auto; }
.start-mark, .entity-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: .65rem; color: #146046; background: var(--green-pale); flex: 0 0 auto; font-size: 1.3rem; }
.rows { margin: 0; padding: 0; list-style: none; }
.rows li + li { border-top: 1px solid var(--line); }
.entity-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .65rem 1.15rem; text-decoration: none; }
.entity-row:hover { background: #f7fafc; }
.entity-row > strong { margin-inline-end: auto; min-width: 0; }
.entity-mark { width: 34px; height: 34px; font-size: 1.1rem; }

.table-wrap { overflow-x: auto; }
.table-wrap:focus-visible { outline-offset: -3px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .87rem; }
thead { background: #f4f7fa; color: #45566e; }
th, td { padding: .74rem .9rem; border-bottom: 1px solid #e8edf3; vertical-align: middle; }
thead th { font-size: .76rem; font-weight: 700; white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:hover { background: #f9fbfd; }
.table-link { color: #173952; font-weight: 700; text-decoration: none; }
.table-link:hover { color: var(--green); text-decoration: underline; }
.table-sub { display: block; margin-top: .18rem; color: var(--muted); font-size: .73rem; font-weight: 500; }
.table-sub.wrap { min-width: 170px; }
.money { font-weight: 700; white-space: nowrap; }
.status { display: inline-flex; align-items: center; min-height: 24px; padding: .14rem .47rem; border-radius: 6px; color: #394d67; background: #eaf0f5; font-size: .73rem; font-weight: 690; white-space: nowrap; }
.status-test { color: #28557c; background: #e7f1fd; }
.status-awaiting_confirmation { color: #704900; background: #fff2d2; }
.status-succeeded { color: #0b583c; background: #dff6eb; }
.status-cancelled, .status-dispute { color: #8a2430; background: #ffeded; }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .7rem; padding: .75rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.pagination .button { min-height: 32px; }

.form-panel { max-width: 625px; padding: 1.3rem; }
label, .field-readonly > span { display: block; margin-bottom: .32rem; color: #364861; font-size: .83rem; font-weight: 670; }
input:not([type='checkbox'], [type='radio']), select, textarea {
  width: 100%; min-height: 41px; padding: .5rem .65rem; border: 1px solid #77899d; border-radius: .55rem;
  color: var(--ink); background: var(--surface); min-width: 0;
}
input::placeholder { color: #66778c; }
textarea { resize: vertical; }
.helptext, .helptext li { color: var(--muted); font-size: .8rem; }
.helptext { margin-top: .35rem; }
.helptext ul { margin: .35rem 0 0; }
.errorlist { margin: .25rem 0 .6rem; color: var(--danger); font-size: .84rem; }
.field-readonly { padding: .65rem .8rem; border-radius: .5rem; border: 1px solid var(--line); background: #f4f7fa; }
.field-readonly > span { margin-bottom: .08rem; }
.filters { display: grid; grid-template-columns: minmax(155px, 1.2fr) repeat(4, minmax(115px, 1fr)) auto; align-items: end; gap: .6rem; }
.filters > div { min-width: 0; }
.filter-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.filter-errors { grid-column: 1 / -1; }
.notice { padding: .62rem .8rem; background: var(--green-pale); border: 1px solid #c2e6d5; border-radius: .55rem; color: #175139; font-size: .87rem; }
.notice.error { color: var(--danger); background: var(--danger-pale); border-color: #f4cbd0; }
.messages { display: grid; gap: .45rem; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.13fr) minmax(0, 1fr); gap: .8rem; }
.definition { margin-top: .8rem; }
.definition > div { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 1.15fr); gap: .6rem; padding: .48rem 0; border-bottom: 1px solid #e8edf3; font-size: .84rem; }
.definition > div:last-child { border-bottom: 0; }
.definition dt { color: var(--muted); }
.definition dd { font-weight: 660; overflow-wrap: anywhere; }
.definition a.text-link { text-decoration: underline; }
.credential-list { display: grid; gap: .65rem; }
.credential-list dt { color: #384d66; font-size: .8rem; font-weight: 660; margin-bottom: .23rem; }
.credential-list dd { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .45rem .55rem .45rem .7rem; border: 1px solid var(--line); border-radius: .5rem; background: #f4f7fa; }
.credential-list code { font-size: .8rem; overflow-wrap: anywhere; min-width: 0; }
.credential-list .button { min-height: 31px; font-size: .76rem; }
.copy-feedback { color: var(--green-dark); font-size: .78rem; }
.copy-feedback:not(:empty) { display: block; margin-top: .4rem; }
.timeline { display: grid; gap: .85rem; margin: 1rem 0; padding: 0; list-style: none; font-size: .85rem; }
.timeline li { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .2rem .65rem; border-inline-start: 3px solid #b5d8c7; padding-inline-start: .55rem; }
.timeline time { color: var(--muted); font-size: .75rem; }

.standalone { min-height: 100vh; display: grid; place-items: center; padding: 1.4rem .8rem; background: radial-gradient(ellipse at 40% 0%, #ddf4e9 0%, transparent 60%), #eef3f8; }
.standalone-content { width: min(100%, 440px); }
.standalone-content > * + * { margin-top: 1.05rem; }
.standalone-brand { margin: 0 auto .95rem; color: var(--ink); }
.standalone-brand small { color: var(--muted); }
.standalone .panel { padding: clamp(1.05rem, 4vw, 1.65rem); }
.standalone .button { width: 100%; }
.checkout-shell { width: min(100%, 505px); }
.checkout-panel { text-align: center; }
.checkout-panel > * + * { margin-top: .7rem; }
.checkout-panel h1 { font-size: clamp(2.1rem, 7vw, 3.4rem); margin-top: .9rem; }
.checkout-merchant, .checkout-panel p:not(.notice) { color: var(--muted); }
.checkout-definition { text-align: left; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: .6rem; background: #f7fafc; }
.checkout-action { margin-top: .35rem; }
.order-actions, .callback-form { margin-top: 1rem; }
.callback-form { max-width: 38rem; margin-bottom: 1.1rem; }
.timer-attention { color: var(--danger); font-weight: 750; }

@media (max-width: 1190px) {
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; padding: .75rem .9rem .45rem; }
  .sidebar .brand { margin-inline: 0; }
  .navigation { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .62rem; }
  .navigation a { min-height: 34px; padding: .3rem .4rem; gap: .25rem; font-size: .8rem; }
  .nav-icon { width: 1rem; font-size: .95rem; }
  .sidebar-footer { position: absolute; right: .9rem; top: .92rem; padding-top: 0; border: 0; }
  .sidebar-footer > span:first-child { display: none; }
  .topbar { min-height: 56px; }
  .content { padding-top: 1.15rem; }
  table { min-width: 575px; }
}
@media (max-width: 540px) {
  .content > * + * { margin-top: .8rem; }
  .page-head { align-items: start; flex-direction: column; }
  .page-head p { font-size: .86rem; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
  .metric { min-height: 77px; padding: .58rem .68rem; }
  .metric dt { font-size: .73rem; }
  .start-panel { flex-wrap: wrap; }
  .start-mark { display: none; }
  .start-panel .button { margin-inline-start: 0; }
  .filters, .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid > * { grid-column: 1 / -1; }
  .topbar { gap: .3rem; padding-inline: .65rem; }
  .account-actions { gap: .3rem; }
  .account-actions .button { min-height: 32px; padding-inline: .43rem; }
  .account-link { font-size: .73rem; }
  .account-link span { font-size: .66rem; }
}
