:root {
  color-scheme: light;
  --ink: #1d201c;
  --muted: #585b54;
  --base: #f5f4ef;
  --white: #fffefa;
  --line: #dedfd6;
  --dark: #181917;
  --orange: #fb793d;
  --accent-ink: #6d2b0d;
  font: 16px/1.5 Onest, system-ui, sans-serif;
  color: var(--ink);
  background: var(--base);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
h1, h2, p { margin: 0; }
a { color: inherit; }
button, select, input { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #aa460e; outline-offset: 3px; }
.skip { position: absolute; z-index: 3; left: 12px; top: 12px; padding: 10px 15px; background: var(--white); transform: translateY(-150%); }
.skip:focus { transform: none; }
.top { height: 74px; padding: 0 max(22px, 3.2vw); background: var(--dark); color: #fffdf6; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: inline-flex; gap: 10px; align-items: center; font-weight: 750; font-size: 1.22rem; letter-spacing: -.045em; text-decoration: none; }
.brand img { filter: brightness(0) invert(1); }
.top-actions { display: flex; gap: 16px; align-items: center; }
.top-actions a { text-decoration: none; color: #eae8df; font-size: .88rem; white-space: nowrap; padding: 12px 0; }
.top-actions a:hover { color: var(--orange); }
.test-label { border: 1px solid #78472f; color: #ffd3b9; border-radius: 6px; padding: 2px 8px; font-size: .75rem; }
.shell { min-height: calc(100vh - 74px); display: flex; align-items: stretch; }
.sidebar { width: 238px; flex: 0 0 238px; border-right: 1px solid var(--line); background: #eeeee7; padding: 28px 17px 20px; display: flex; flex-direction: column; justify-content: space-between; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a { min-height: 46px; display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: 8px; text-decoration: none; font-size: .94rem; font-weight: 600; }
.sidebar nav a:hover { background: #e3e3da; }
.sidebar nav a[aria-current="page"] { color: var(--accent-ink); background: #ffdfcb; }
.nav-icon { font-size: 1.25rem; line-height: 1; width: 23px; text-align: center; }
.account { border-top: 1px solid #d5d6cc; padding: 13px 10px 0; font-size: .84rem; display: grid; overflow-wrap: anywhere; }
.account > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-button { min-height: 44px; cursor: pointer; border: 0; padding: 5px 0; background: none; color: var(--muted); font-weight: 650; text-align: left; }
.text-button:hover { color: var(--ink); }
main { width: 100%; min-width: 0; }
main:focus { outline: none; }
.view { max-width: 1180px; margin: auto; padding: clamp(24px, 4vw, 58px); }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 27px; }
h1 { font-size: clamp(2.15rem, 3.9vw, 4rem); line-height: 1.02; letter-spacing: -.075em; font-weight: 760; overflow-wrap: anywhere; }
.page-head p, .muted, .card p, .back { color: var(--muted); }
.page-head p { margin-top: 9px; }
h2 { font-size: 1.25rem; letter-spacing: -.03em; line-height: 1.2; }
.button { display: inline-flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 9px 16px; border: 1px solid #bcbfb4; border-radius: 8px; text-decoration: none; color: var(--ink); background: var(--white); font-weight: 700; font-size: .9rem; cursor: pointer; white-space: normal; }
.button:hover { border-color: #74776d; background: #f3f2ea; }
.button.primary { color: #27170e; background: var(--orange); border-color: transparent; }
.button.primary:hover { background: #ffa077; }
.button:disabled { cursor: default; opacity: .63; }
.card, .stats, .record-list { background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 24px; }
.stats > div { display: grid; gap: 3px; padding: clamp(12px, 2.2vw, 22px); }
.stats > div + div { border-left: 1px solid var(--line); }
.stats span { color: var(--muted); font-size: .86rem; }
.stats strong { font-size: 2.25rem; line-height: 1.1; letter-spacing: -.065em; font-variant-numeric: tabular-nums; }
.record { padding: 16px 21px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; text-decoration: none; }
.record:hover { background: #f6f5ee; }
.record + .record { border-top: 1px solid var(--line); }
.record:first-child { border-radius: 12px 12px 0 0; }
.record:last-child { border-radius: 0 0 12px 12px; }
.record:only-child { border-radius: 12px; }
.record small { display: block; color: var(--muted); }
.record strong { overflow-wrap: anywhere; }
.empty { padding: 31px 24px; display: grid; gap: 8px; justify-items: start; }
.empty .button { margin-top: 6px; }
.status { display: inline-flex; align-items: center; gap: 7px; color: #6d3e12; background: #fff0dc; border-radius: 30px; padding: 5px 10px; font-size: .79rem; font-weight: 680; width: fit-content; }
.status::before { content: ''; height: 7px; width: 7px; border-radius: 50%; flex: 0 0 7px; background: currentColor; }
.status[data-state="active"] { background: #e4f2dc; color: #2e5933; }
.status[data-state="cancelled"], .status[data-state="review"], .status[data-state="refunded"], .status[data-state="suspended"], .status[data-state="expired"] { color: #713833; background: #f8e6e2; }
.card { padding: clamp(16px, 2.5vw, 25px); }
.card h2 + p { margin-top: 8px; }
.auth-view { max-width: 1060px; display: grid; grid-template-columns: 1fr minmax(285px, .75fr); min-height: min(660px, calc(100vh - 74px)); align-content: center; align-items: center; gap: clamp(22px, 5vw, 80px); }
.auth-intro h1 { font-size: clamp(3rem, 7vw, 6.5rem); }
.auth-intro h1 span { color: #c74a19; }
.auth-intro p { margin-top: 20px; max-width: 335px; color: var(--muted); }
.auth-card form, .field-grid, .config-grid, .summary-card, .detail-grid { display: grid; gap: 16px; }
.mode-group { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.mode-group .text-button[aria-pressed="true"] { border-bottom: 3px solid #bd4d21; color: var(--ink); }
label { display: grid; gap: 6px; font-size: .88rem; font-weight: 650; min-width: 0; }
input, select { width: 100%; min-width: 0; min-height: 45px; border: 1px solid #bcbfb4; border-radius: 7px; padding: 8px 10px; background: white; color: var(--ink); }
.field-grid { grid-template-columns: 1fr 1fr; margin-top: 18px; }
.wide { grid-column: 1 / -1; }
.form-card .muted { margin-top: 12px; }
.form-card > .button { margin-top: 16px; }
.config-grid, .detail-grid { grid-template-columns: minmax(0, 1.7fr) minmax(230px, 1fr); align-items: start; }
.summary-card { gap: 11px; }
.quote-price { font-size: clamp(1.7rem, 4vw, 2.65rem); letter-spacing: -.065em; }
#notice { margin: 18px auto 0; width: calc(100% - 32px); max-width: 1064px; background: #fff1df; border: 1px solid #eccbad; border-radius: 8px; padding: 12px 15px; color: #643111; overflow-wrap: anywhere; }
#notice[data-error="true"] { color: #711e1b; border-color: #efc0b9; background: #fff0ed; }
.back { display: inline-block; margin-bottom: 18px; font-size: .9rem; }
.detail-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.details-list { display: grid; gap: 10px; margin: 15px 0 0; }
.details-list div { display: flex; justify-content: space-between; gap: 12px; }
dd { margin: 0; font-weight: 650; text-align: right; overflow-wrap: anywhere; }
dt { color: var(--muted); }
.history { display: grid; margin: 12px 0 0; padding: 0; list-style: none; }
.history li { padding: 8px 0; display: flex; gap: 10px; justify-content: space-between; }
.history li + li { border-top: 1px solid var(--line); }
.history time { color: var(--muted); white-space: nowrap; font-size: .8rem; }
.access-value { overflow-wrap: anywhere; user-select: all; }
dialog { width: min(420px, calc(100% - 24px)); border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); padding: 23px; }
dialog::backdrop { background: #141412a8; }
dialog p, #action-input > label { margin-top: 12px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; margin-top: 18px; }
@media (max-width: 900px) { .sidebar { flex-basis: 182px; width: 182px; } .config-grid, .detail-grid { grid-template-columns: 1fr; } }
@media (max-width: 670px) {
  .top { height: 60px; padding: 0 16px; }
  .shell { display: block; min-height: calc(100vh - 60px); }
  .sidebar { width: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px 9px; }
  .sidebar nav { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
  .sidebar nav a { justify-content: center; text-align: center; padding: 4px; font-size: .76rem; gap: 4px; }
  .nav-icon, .account { display: none; }
  .view { padding: 25px 15px; }
  .auth-view { grid-template-columns: 1fr; align-content: start; gap: 26px; }
  .auth-intro h1 br { display: none; }
  .auth-intro p { margin-top: 9px; }
  .page-head { align-items: start; flex-wrap: wrap; margin-bottom: 19px; }
  .record { grid-template-columns: minmax(0, 1fr) auto; padding: 13px; gap: 8px; }
  .record .record-extra { display: none; }
  .stats span { font-size: .77rem; }
}
@media (max-width: 380px) { .field-grid { grid-template-columns: 1fr; } .top-actions { gap: 8px; } .brand { font-size: 1rem; } }
