:root {
  --ink: #13201e;
  --ink-2: #344541;
  --muted: #667772;
  --paper: #edf2f1;
  --panel: #f8faf9;
  --line: #cbd5d2;
  --line-strong: #9dacaa;
  --teal: #087a70;
  --teal-dark: #07564f;
  --teal-soft: #d9ece8;
  --amber: #d78d18;
  --amber-soft: #f8e9cc;
  --red: #a64435;
  --shadow: 0 18px 50px rgba(20, 37, 33, 0.08);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "IBM Plex Sans KR", "Malgun Gothic", "Segoe UI", sans-serif; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
code { font-family: "Cascadia Mono", Consolas, monospace; font-size: .84em; overflow-wrap: anywhere; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 10px 14px; color: white; background: var(--teal-dark); }
.skip-link:focus { top: 16px; }
.portal-shell { width: min(1460px, calc(100% - 48px)); margin-inline: auto; }
.portal-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(248, 250, 249, .96); backdrop-filter: blur(14px); }
.header-row { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.portal-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; letter-spacing: .08em; }
.portal-brand small { margin-left: 2px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.brand-scope { width: 27px; aspect-ratio: 1; border: 2px solid var(--teal); border-radius: 50%; position: relative; box-shadow: inset 0 0 0 5px var(--paper); background: var(--teal); }
.brand-scope::before, .brand-scope::after { content: ""; position: absolute; background: currentColor; }
.brand-scope::before { width: 1px; height: 35px; left: 11px; top: -6px; color: var(--line-strong); }
.brand-scope::after { height: 1px; width: 35px; left: -6px; top: 11px; color: var(--line-strong); }
.account-chip { display: flex; align-items: center; gap: 14px; color: var(--ink-2); font-size: 13px; }
.account-chip form { margin: 0; }
.account-chip button { border: 0; border-left: 1px solid var(--line); padding: 4px 0 4px 14px; color: var(--muted); background: transparent; cursor: pointer; }
.account-chip button:hover, .account-chip button:focus-visible { color: var(--teal-dark); text-decoration: underline; }
.portal-nav { border-top: 1px solid #e0e6e4; background: #f3f6f5; }
.nav-row { min-height: 44px; display: flex; align-items: stretch; gap: 28px; overflow-x: auto; scrollbar-width: none; }
.nav-row::-webkit-scrollbar { display: none; }
.nav-row a { flex: 0 0 auto; display: inline-flex; align-items: center; border-bottom: 2px solid transparent; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.nav-row a:hover, .nav-row a:focus-visible { color: var(--teal); }
.nav-row a[aria-current="page"] { border-bottom-color: var(--teal); color: var(--teal-dark); }
.nav-note { margin-left: auto; display: inline-flex; align-items: center; color: var(--muted); font: 11px "Cascadia Mono", monospace; letter-spacing: .06em; white-space: nowrap; }
.nav-separator { width: 1px; margin-block: 12px; background: var(--line); }
.portal-main { min-height: calc(100vh - 220px); padding-top: 52px; padding-bottom: 88px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; margin-bottom: 30px; }
.page-heading h1 { margin: 6px 0 5px; font-size: clamp(30px, 4vw, 46px); line-height: 1.1; letter-spacing: -.045em; }
.page-heading p { margin: 0; color: var(--muted); }
.eyebrow, .section-index { color: var(--teal); font: 700 11px/1.2 "Cascadia Mono", Consolas, monospace; letter-spacing: .13em; }
.primary-button, .secondary-button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; border: 1px solid var(--teal-dark); padding: 9px 16px; font-size: 13px; font-weight: 800; }
.primary-button { color: white; background: var(--teal-dark); }
.secondary-button { color: var(--teal-dark); background: transparent; }
.primary-button:hover, .secondary-button:hover { filter: brightness(.94); }
.balance-rail { display: grid; grid-template-columns: minmax(240px, 1.1fr) 2.2fr minmax(220px, .8fr); border: 1px solid var(--line-strong); background: var(--panel); box-shadow: var(--shadow); }
.balance-primary { min-height: 184px; padding: 28px; color: white; background: var(--teal-dark); display: flex; flex-direction: column; justify-content: space-between; }
.balance-primary > span { font-size: 13px; font-weight: 700; }
.balance-primary strong { font: 700 clamp(38px, 5vw, 58px)/1 "Cascadia Mono", Consolas, monospace; letter-spacing: -.06em; }
.balance-primary strong small { margin-left: 6px; font-size: 18px; letter-spacing: 0; }
.balance-primary p { margin: 0; color: #bfe0da; font-size: 13px; }
.balance-rail dl { margin: 0; padding: 28px 34px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; }
.balance-rail dl div { min-width: 0; border-left: 1px solid var(--line); padding-left: 25px; }
.balance-rail dt { color: var(--muted); font-size: 12px; }
.balance-rail dd { margin: 10px 0 0; font: 700 21px "Cascadia Mono", Consolas, monospace; }
.rail-action { border-left: 1px solid var(--line); padding: 28px; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(135deg, #f6e9cf, #fff9ed); }
.rail-action span { color: #78591d; font-size: 12px; }
.rail-action strong { margin-top: 8px; font-size: 16px; }
.metric-strip { margin-top: 18px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); background: #e7ecea; }
.metric-strip > div { min-height: 105px; padding: 18px 22px; display: grid; grid-template: auto 1fr / 1fr auto; border-right: 1px solid var(--line); }
.metric-strip > div:last-child { border-right: 0; }
.metric-strip span { color: var(--muted); font-size: 12px; }
.metric-strip strong { grid-row: 1 / 3; grid-column: 2; align-self: center; font: 700 34px "Cascadia Mono", Consolas, monospace; }
.metric-strip small { align-self: end; color: var(--ink-2); }
.section-block { margin-top: 46px; border-top: 2px solid var(--ink); padding-top: 18px; }
.section-block.flush { margin-top: 0; }
.section-heading { min-height: 48px; margin-bottom: 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.section-heading h2 { margin: 4px 0 0; font-size: 23px; letter-spacing: -.025em; }
.section-heading > a, .section-heading > span { color: var(--muted); font-size: 12px; }
.job-lane { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--line); }
.job-lane li { display: grid; grid-template-columns: 18px 58px minmax(260px, 1fr) 180px; gap: 18px; position: relative; min-height: 95px; padding: 18px 4px; border-top: 1px solid var(--line); align-items: center; }
.job-lane li::before { content: ""; position: absolute; top: 0; bottom: 0; left: 12px; width: 1px; background: var(--line); }
.lane-node { z-index: 1; width: 17px; height: 17px; border: 3px solid var(--paper); outline: 1px solid currentColor; border-radius: 50%; background: currentColor; }
.lane-time { display: flex; flex-direction: column; font-family: "Cascadia Mono", Consolas, monospace; }
.lane-time span { color: var(--muted); font-size: 12px; }
.lane-main { min-width: 0; display: grid; grid-template-columns: 105px 1fr; gap: 6px 14px; align-items: center; }
.lane-main code { grid-column: 1 / -1; color: var(--muted); }
.lane-meta { display: flex; justify-content: flex-end; gap: 14px; color: var(--muted); font-size: 12px; }
.status { display: inline-flex; width: fit-content; min-height: 24px; align-items: center; border: 1px solid currentColor; padding: 2px 8px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.tone-ok { color: #087265; }
.tone-active { color: #136d8e; }
.tone-warn { color: #94600c; }
.tone-muted { color: #68736f; }
.tone-neutral { color: #4e5c58; }
.empty-state { border: 1px dashed var(--line-strong); padding: 42px; text-align: center; background: rgba(255,255,255,.35); }
.empty-state p, .empty-compact { color: var(--muted); }
.privacy-band { margin-top: 44px; display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 24px; border: 1px solid var(--line); padding: 22px 26px; color: #d8eeea; background: #142b27; }
.privacy-band p { margin: 5px 0 0; color: #aac4bf; font-size: 13px; }
.privacy-band a { font-size: 12px; text-decoration: underline; }
.privacy-zero { font: 700 40px "Cascadia Mono", Consolas, monospace; }
.privacy-zero small { margin-left: 4px; font-size: 13px; }
.balance-compact { min-height: 112px; display: grid; grid-template-columns: 220px 220px 1fr; border: 1px solid var(--line); background: var(--panel); }
.balance-compact > div { padding: 20px 24px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.balance-compact span { color: var(--muted); font-size: 12px; }
.balance-compact strong { margin-top: 6px; font: 700 24px "Cascadia Mono", Consolas, monospace; }
.balance-compact > p { margin: 0; padding: 24px; align-self: center; color: var(--muted); }
.table-wrap { width: 100%; overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 800px; font-size: 12px; }
th { padding: 11px 13px; color: var(--muted); background: #e3e9e7; font-size: 10px; letter-spacing: .07em; text-align: left; white-space: nowrap; }
td { border-bottom: 1px solid var(--line); padding: 13px; vertical-align: middle; }
tbody tr:hover { background: rgba(255,255,255,.5); }
td small, td code { display: block; margin-top: 4px; color: var(--muted); }
td a { color: var(--teal-dark); text-decoration: underline; text-underline-offset: 3px; }
.number { font-family: "Cascadia Mono", Consolas, monospace; }
.positive { color: var(--teal); }
.negative { color: var(--red); }
.entry-type { font-weight: 800; }
.empty-cell { height: 100px; color: var(--muted); text-align: center; }
.pagination { margin-top: 16px; display: flex; justify-content: flex-end; gap: 10px; align-items: center; font-size: 12px; }
.pagination a { border: 1px solid var(--line); padding: 6px 10px; background: var(--panel); }
.filter-bar { margin-bottom: 18px; display: flex; align-items: center; gap: 10px; border-block: 1px solid var(--line); padding: 12px 0; }
.filter-bar label { font-size: 12px; font-weight: 800; }
.filter-bar select, .filter-bar button { min-height: 36px; border: 1px solid var(--line-strong); padding-inline: 11px; background: var(--panel); }
.filter-bar button { color: white; background: var(--teal-dark); cursor: pointer; }
.filter-bar a { color: var(--muted); font-size: 12px; text-decoration: underline; }
.record-notice { margin-top: -10px; font-size: 13px; }
.record-table { min-width: 1420px; }
.record-table td { vertical-align: top; }
.snapshot-cell { width: 188px; }
.record-snapshot-link { display: block; width: 160px; border: 1px solid var(--line-strong); background: #17211f; text-decoration: none; }
.record-snapshot { display: block; width: 160px; height: 90px; object-fit: contain; }
.snapshot-empty { width: 160px; height: 90px; display: grid; place-items: center; border: 1px dashed var(--line-strong); color: var(--muted); background: #e3e9e7; }
.record-value { display: block; max-width: 260px; overflow-wrap: anywhere; font: 11px/1.5 "Cascadia Mono", Consolas, monospace; }
.input-record-cell { min-width: 220px; }
.input-record-cell summary { color: var(--teal-dark); font-weight: 800; cursor: pointer; }
.compact-input-list { margin: 10px 0 0; border-top: 1px solid var(--line); }
.compact-input-list div { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 8px; border-bottom: 1px solid var(--line); padding: 5px 0; }
.compact-input-list dt { color: var(--muted); }
.compact-input-list dd { margin: 0; overflow-wrap: anywhere; font-weight: 700; }
.coupon-entry { display: grid; grid-template-columns: minmax(260px, .8fr) 1.2fr; gap: 40px; border: 1px solid var(--line-strong); border-left: 5px solid var(--amber); padding: 32px; background: var(--panel); box-shadow: var(--shadow); }
.coupon-entry h2 { margin: 6px 0; }
.coupon-entry p { margin: 0; color: var(--muted); }
.coupon-entry form { align-self: center; }
.coupon-entry form > label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 800; }
.coupon-entry form > div { display: grid; grid-template-columns: 1fr auto; }
.coupon-entry input { min-height: 48px; min-width: 0; border: 1px solid var(--line-strong); padding: 10px 14px; font-family: "Cascadia Mono", Consolas, monospace; text-transform: uppercase; }
.coupon-entry button, .ops-search button { border: 0; padding: 0 22px; color: white; background: var(--teal-dark); font-weight: 800; cursor: pointer; }
.notice-line { margin-bottom: 18px; border-left: 3px solid var(--teal); padding: 10px 16px; background: var(--teal-soft); }
.notice-line p { margin: 3px 0 0; color: var(--ink-2); font-size: 12px; }
.onboarding-notice { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; margin-bottom: 24px; border: 1px solid var(--line-strong); border-left: 5px solid var(--teal); padding: 20px 24px; background: var(--teal-soft); }
.onboarding-notice span { display: block; margin-bottom: 5px; color: var(--teal-dark); font: 800 10px "Cascadia Mono", Consolas, monospace; letter-spacing: .12em; }
.onboarding-notice strong { display: block; font-size: 17px; }
.onboarding-notice p { margin: 5px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.65; }
.onboarding-notice .secondary-button { white-space: nowrap; }
.identity-strip { display: grid; grid-template-columns: 2fr 1fr 1fr; border: 1px solid var(--line); background: var(--panel); }
.identity-strip > div { padding: 22px 24px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.identity-strip > div:last-child { border: 0; }
.identity-strip span, .identity-strip small { color: var(--muted); font-size: 12px; }
.identity-strip strong { margin: 7px 0 3px; }
.section-footnote { color: var(--muted); font-size: 12px; }
.message-stack { margin-top: 16px; }
.message { margin: 0 0 8px; border-left: 4px solid var(--teal); padding: 12px 16px; background: white; box-shadow: 0 4px 12px rgba(0,0,0,.05); }
.message-error { border-left-color: var(--red); }
.portal-footer { border-top: 1px solid var(--line); padding: 26px 0; color: var(--muted); background: #e4eae8; font-size: 11px; }
.footer-row { display: flex; justify-content: space-between; gap: 24px; }
.footer-row a { text-decoration: underline; }

/* Google portal login */
.login-body { min-height: 100vh; background: #0c1715; }
.login-frame { min-height: 100vh; display: grid; grid-template-columns: minmax(440px, 1.25fr) minmax(420px, .75fr); }
.login-scope { min-height: 100vh; padding: 42px clamp(34px, 6vw, 92px); position: relative; overflow: hidden; color: white; background: radial-gradient(circle at 62% 42%, rgba(19, 112, 100, .45), transparent 19%), linear-gradient(135deg, #07110f 10%, #102d28 100%); }
.portal-brand.inverse { position: relative; z-index: 2; color: white; }
.portal-brand.inverse .brand-scope { box-shadow: inset 0 0 0 5px #0c1b18; }
.scope-grid { position: absolute; inset: 0; opacity: .17; background-image: linear-gradient(rgba(136,206,194,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(136,206,194,.35) 1px, transparent 1px); background-size: 46px 46px; mask-image: linear-gradient(to bottom, black, transparent 88%); }
.scope-grid::before { content: ""; position: absolute; width: min(48vw, 620px); aspect-ratio: 1; left: 42%; top: 44%; transform: translate(-50%,-50%); border: 1px solid #70aa9f; border-radius: 50%; box-shadow: 0 0 0 80px rgba(112,170,159,.1), 0 0 0 160px rgba(112,170,159,.06), inset 0 0 70px rgba(70,210,188,.15); }
.scope-readout { position: absolute; top: 38px; right: 42px; display: grid; gap: 5px; color: #8eb7b0; font: 10px "Cascadia Mono", Consolas, monospace; letter-spacing: .1em; text-align: right; }
.login-scope-copy { position: absolute; z-index: 2; left: clamp(34px, 6vw, 92px); right: clamp(34px, 8vw, 130px); bottom: 10vh; }
.login-scope-copy > p { color: #6fd4c3; font: 700 11px "Cascadia Mono", Consolas, monospace; letter-spacing: .16em; }
.login-scope-copy h1 { max-width: 720px; margin: 12px 0 26px; font-size: clamp(34px, 5vw, 64px); line-height: 1.08; letter-spacing: -.05em; }
.login-scope-copy ul { display: grid; gap: 8px; margin: 0; padding: 0; color: #b5cbc7; list-style: none; font-size: 13px; }
.login-scope-copy li::before { content: "—"; margin-right: 10px; color: #62bbaa; }
.login-panel { min-height: 100vh; display: grid; place-items: center; padding: 44px; background: #f2f5f4; }
.login-panel-inner { width: min(100%, 410px); }
.logout-notice { margin: 0 0 24px; border: 1px solid var(--teal); border-left-width: 4px; padding: 13px 15px; color: var(--teal-dark) !important; background: var(--teal-soft); font-size: 13px; font-weight: 700; line-height: 1.6; }
.login-panel h2 { margin: 11px 0 10px; font-size: 32px; letter-spacing: -.04em; }
.login-panel p { color: var(--muted); }
.google-button { width: 100% !important; max-width: 320px !important; min-width: 0 !important; min-height: 44px; margin: 32px 0 24px; overflow: hidden; }
.google-button [role="button"], .google-button iframe { width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
.login-rule { height: 1px; margin: 30px 0 20px; background: var(--line); }
.fine-print { font-size: 12px; line-height: 1.7; }
.text-link { color: var(--teal-dark); font-size: 13px; font-weight: 800; }
.result-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--paper); }
.result-panel { width: min(560px, 100%); border-top: 4px solid var(--teal); padding: 36px; background: white; box-shadow: var(--shadow); }
.result-code { display: block; margin-top: 55px; color: var(--teal); font: 700 11px "Cascadia Mono", Consolas, monospace; letter-spacing: .13em; }
.result-panel h1 { margin: 10px 0; font-size: 34px; letter-spacing: -.04em; }
.result-panel p { color: var(--muted); line-height: 1.8; }
.result-actions { margin-top: 30px; display: flex; gap: 10px; }

/* Operations */
.ops-body { --paper: #e8ecea; --panel: #f4f6f5; --teal: #187c70; }
.ops-body .portal-header { color: #d7e2df; border-bottom-color: #263733; background: #101715; }
.ops-body .brand-scope { box-shadow: inset 0 0 0 5px #101715; }
.ops-body .portal-brand small, .ops-body .account-chip, .ops-body .account-chip button { color: #94aaa5; }
.ops-body .portal-nav { border-color: #2b3b37; background: #17211f; }
.ops-body .nav-row a { color: #aebeba; }
.ops-body .nav-row a[aria-current="page"] { color: white; border-color: var(--amber); }
.ops-body .nav-note { color: #d6a754; }
.ops-heading { border-left: 4px solid var(--amber); padding-left: 18px; }
.read-only-badge { border: 1px solid #8a641f; padding: 7px 10px; color: #6e4b0c; background: var(--amber-soft); font: 700 10px "Cascadia Mono", Consolas, monospace; letter-spacing: .12em; }
.admin-action-badge { border: 1px solid var(--teal-dark); padding: 7px 10px; color: white; background: var(--teal-dark); font: 700 10px "Cascadia Mono", Consolas, monospace; letter-spacing: .12em; }
.ops-search { border: 1px solid var(--line-strong); padding: 22px; background: #f7f8f7; }
.ops-search label { display: block; margin-bottom: 8px; font-weight: 800; }
.ops-search > div { display: grid; grid-template-columns: 1fr auto; }
.ops-search input { min-height: 48px; min-width: 0; border: 1px solid var(--line-strong); padding: 10px 14px; font-family: "Cascadia Mono", Consolas, monospace; }
.ops-search p { margin: 9px 0 0; color: var(--muted); font-size: 11px; }
.ops-filter-grid { margin-top: 14px; display: grid; grid-template-columns: auto minmax(280px, 1fr) auto minmax(160px, .35fr) auto; align-items: center; gap: 10px; border: 1px solid var(--line-strong); padding: 16px 18px; background: #f7f8f7; }
.ops-filter-grid label { font-size: 12px; font-weight: 800; }
.ops-filter-grid input, .ops-filter-grid select { min-height: 42px; min-width: 0; border: 1px solid var(--line-strong); padding: 8px 12px; background: var(--panel); }
.ops-filter-grid input { font-family: "Cascadia Mono", Consolas, monospace; }
.ops-filter-grid button, .admin-submit-row button { min-height: 42px; border: 0; padding: 0 20px; color: white; background: var(--teal-dark); font-weight: 800; cursor: pointer; }
.ops-metrics { margin-top: 14px; background: #dfe5e3; }
.split-results, .ops-grid { min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.ops-grid > *, .split-results > * { min-width: 0; }
.split-results h3 { border-bottom: 1px solid var(--line); padding-bottom: 8px; font-size: 13px; }
.result-row, .trace-row { min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); padding: 10px 4px; font-size: 12px; }
.result-row > span:first-child, .trace-row > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.result-row code, .result-row small, .trace-row small { margin-top: 3px; color: var(--muted); }
.trace-state { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font: 700 12px "Cascadia Mono", Consolas, monospace; }
.breadcrumb { display: flex; gap: 8px; margin-bottom: 22px; color: var(--muted); font-size: 12px; }
.breadcrumb a { color: var(--teal-dark); text-decoration: underline; }
.ops-balance { grid-template-columns: 190px 190px 190px 1fr; }
.ops-user-summary { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
.ops-user-summary > p { grid-column: 1 / -1; border-top: 1px solid var(--line); padding: 14px 20px; }
.ops-user-table td strong, .ops-user-table td small { display: block; }
.ops-user-table td small { margin-top: 4px; color: var(--muted); }
.table-action { display: inline-flex; min-height: 30px; align-items: center; border: 1px solid var(--teal-dark); padding: 0 10px; color: var(--teal-dark); background: transparent; font-weight: 800; cursor: pointer; }
.table-action:hover, .table-action:focus-visible { color: white; background: var(--teal-dark); }
.coupon-admin-grid { grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); align-items: start; }
.ops-coupon-form { padding-top: 4px; }
.ops-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ops-form-grid label { min-width: 0; display: flex; flex-direction: column; gap: 7px; font-size: 12px; font-weight: 800; }
.ops-form-grid label > span { color: var(--ink-2); }
.ops-form-grid input, .ops-form-grid textarea { width: 100%; min-height: 42px; border: 1px solid var(--line-strong); padding: 9px 11px; background: #fff; }
.ops-form-grid textarea { min-height: 86px; resize: vertical; }
.ops-form-grid label:last-child { grid-column: 1 / -1; }
.ops-form-grid .delivery-toggle { grid-column: 1 / -1; display: grid; grid-template-columns: 22px 1fr; align-items: start; gap: 10px; border: 1px solid var(--line); padding: 13px 14px; background: var(--teal-soft); }
.ops-form-grid .delivery-toggle input { width: 18px; min-height: 18px; margin-top: 2px; accent-color: var(--teal-dark); }
.ops-form-grid .delivery-toggle > span { display: flex; flex-direction: column; gap: 3px; }
.ops-form-grid .delivery-toggle small { color: var(--muted); font-weight: 500; }
.ops-form-grid .has-error input, .ops-form-grid .has-error textarea { border-color: #9e3b2d; }
.ops-form-grid label small, .form-error { color: #8b2f23; font-size: 11px; }
.form-error { margin-bottom: 14px; border-left: 3px solid #9e3b2d; padding: 10px 12px; background: #f8e8e5; }
.form-error ul { margin: 0; padding-left: 16px; }
.admin-submit-row { margin-top: 20px; display: flex; justify-content: space-between; align-items: center; gap: 24px; border-top: 1px solid var(--line); padding-top: 18px; }
.admin-submit-row p { max-width: 620px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.coupon-policy-panel ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 12px; line-height: 1.9; }
.issued-coupon-panel { margin-bottom: 28px; display: grid; grid-template-columns: minmax(300px, .7fr) minmax(0, 1.3fr); gap: 28px; border: 1px solid #8a641f; border-left: 5px solid var(--amber); padding: 24px; background: var(--amber-soft); }
.issued-coupon-panel h2 { margin: 6px 0; }
.issued-coupon-panel p { margin: 0; color: #705521; font-size: 12px; line-height: 1.7; }
.issued-coupon-panel textarea { width: 100%; min-height: 180px; border: 1px solid #9d7a36; padding: 14px; color: #242d2a; background: #fffdf7; font: 700 13px/1.8 "Cascadia Mono", Consolas, monospace; resize: vertical; }
.section-intro { margin: -6px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.inbox-coupon-section { border-top: 3px solid var(--teal); }
.inbox-coupon-section form { margin: 0; }
.coupon-delivery-panel { border-top: 3px solid var(--teal-dark); }
.issued-code-table { min-width: 1120px; }
.coupon-target strong, .coupon-target small { display: block; }
.coupon-target small { margin-top: 4px; color: var(--muted); }
.ops-delivery-form { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: end; }
.ops-delivery-form label { min-width: 0; display: flex; flex-direction: column; gap: 7px; color: var(--ink-2); font-size: 12px; font-weight: 800; }
.ops-delivery-form label:nth-of-type(3), .ops-delivery-form .form-error { grid-column: 1 / -1; }
.ops-delivery-form input, .ops-delivery-form textarea { width: 100%; min-height: 42px; border: 1px solid var(--line-strong); padding: 9px 11px; background: #fff; }
.ops-delivery-form textarea { min-height: 70px; resize: vertical; }
.ops-delivery-form .has-error input, .ops-delivery-form .has-error textarea { border-color: #9e3b2d; }
.ops-delivery-form label small { color: #8b2f23; font-size: 11px; }
.ops-delivery-form button { justify-self: end; min-height: 42px; border: 0; padding: 0 18px; color: #fff; background: var(--teal-dark); font-weight: 800; cursor: pointer; }
.job-trace-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line-strong); background: var(--panel); }
.job-trace-strip > div { min-height: 110px; padding: 20px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.job-trace-strip > div:last-child { border: 0; }
.job-trace-strip span, .job-trace-strip small { color: var(--muted); font-size: 11px; }
.job-trace-strip strong { margin: 8px 0 4px; font-family: "Cascadia Mono", Consolas, monospace; font-size: 18px; }
.job-trace-strip.job-trace-six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.job-trace-strip .trace-compact { overflow-wrap: anywhere; font-size: 12px; }
.record-evidence-grid { display: grid; grid-template-columns: minmax(440px, 1.3fr) minmax(300px, .7fr); gap: 28px; align-items: start; }
.evidence-frame { min-width: 0; border: 1px solid var(--line); padding: 12px; background: #17211f; }
.evidence-frame a, .evidence-frame img { display: block; width: 100%; }
.evidence-frame img { height: auto; aspect-ratio: 16 / 9; object-fit: contain; }
.evidence-frame p { margin: 9px 0 0; color: #b8cbc7; font-size: 11px; }
.evidence-empty { min-height: 280px; display: grid; place-items: center; color: #b8cbc7; }
.input-detail-list { border-top: 1px solid var(--line); }
.state-timeline { margin: 0; padding: 12px 0 8px; display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; }
.state-timeline li { position: relative; }
.state-timeline li::after { content: ""; position: absolute; height: 2px; left: 18px; right: -18px; top: 8px; background: var(--teal); }
.state-timeline li:last-child::after { display: none; }
.state-timeline li > span { position: relative; z-index: 2; display: block; width: 17px; height: 17px; border: 3px solid var(--paper); outline: 2px solid var(--teal); border-radius: 50%; background: var(--teal); }
.state-timeline li > div { margin-top: 16px; display: flex; flex-direction: column; }
.state-timeline time { margin-top: 4px; color: var(--muted); font: 11px "Cascadia Mono", Consolas, monospace; }
.state-timeline .inactive { color: var(--muted); }
.state-timeline .inactive::after { background: var(--line); }
.state-timeline .inactive > span { outline-color: var(--line-strong); background: var(--paper); }
.detail-list { margin: 0; }
.detail-list > div { min-height: 42px; display: grid; grid-template-columns: 140px 1fr; align-items: center; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); font-size: 11px; }
.detail-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-family: "Cascadia Mono", Consolas, monospace; }
.risk-score { display: inline-flex; align-items: center; min-height: 30px; border: 1px solid currentColor; padding: 5px 9px; font: 700 11px "Cascadia Mono", Consolas, monospace; }
.risk-low { color: #4b6560; background: #e4ebe9; }
.risk-medium { color: #805c17; background: var(--amber-soft); }
.risk-high { color: #8e3228; background: #f6e3e0; }
.risk-principle { margin-bottom: 28px; display: grid; grid-template-columns: 150px 1fr; gap: 18px; border: 1px solid #c4a05d; border-left: 4px solid var(--amber); padding: 18px 22px; background: var(--amber-soft); }
.risk-principle strong { font: 700 11px "Cascadia Mono", Consolas, monospace; letter-spacing: .12em; }
.risk-principle p { margin: 0; color: #705521; font-size: 12px; line-height: 1.7; }
.evidence-list dd { overflow-wrap: anywhere; white-space: normal; font-size: 11px; }
.evidence-list > div { grid-template-columns: minmax(220px, 1.2fr) minmax(0, 1fr); }
.decision-panel { display: grid; grid-template-columns: 110px 1fr; gap: 18px; align-items: start; }
.decision-panel div { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.decision-panel time { color: var(--muted); font: 11px "Cascadia Mono", Consolas, monospace; }
.decision-panel p { flex-basis: 100%; margin: 0; color: var(--muted); line-height: 1.6; }
.allocation-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; border-bottom: 1px solid var(--line); padding: 10px 0; font-size: 12px; }
.immutable-notice { margin-top: 30px; border: 1px solid #c4a05d; border-left: 4px solid var(--amber); padding: 18px 22px; background: var(--amber-soft); }
.immutable-notice p { margin: 4px 0 0; color: #705521; font-size: 12px; }

/* Billing and annual contract */
.balance-chip { min-width: 190px; border-left: 3px solid var(--teal); padding: 8px 0 8px 18px; display: flex; flex-direction: column; }
.balance-chip span { color: var(--muted); font-size: 12px; }
.balance-chip strong { margin-top: 3px; font: 700 23px "Cascadia Mono", Consolas, monospace; }
.payment-gate { margin-bottom: 34px; display: grid; grid-template-columns: auto 1fr; gap: 15px; border: 1px solid #d5b87b; border-left: 4px solid var(--amber); padding: 18px 22px; background: var(--amber-soft); }
.payment-gate p { margin: 4px 0 0; color: #705521; font-size: 13px; line-height: 1.7; }
.gate-lamp { width: 10px; height: 10px; margin-top: 5px; border: 2px solid white; outline: 1px solid var(--amber); border-radius: 50%; background: var(--amber); }
.billing-plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); background: var(--panel); }
.billing-plan { min-width: 0; min-height: 405px; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); padding: 24px; display: flex; flex-direction: column; }
.billing-plan.is-recommended { position: relative; background: linear-gradient(180deg, var(--teal-soft), var(--panel) 45%); }
.billing-plan.is-recommended::before { content: ""; position: absolute; inset: -1px; border-top: 4px solid var(--teal); pointer-events: none; }
.plan-topline { min-height: 28px; display: flex; justify-content: space-between; gap: 12px; color: var(--teal-dark); font: 700 12px "Cascadia Mono", Consolas, monospace; letter-spacing: .07em; }
.plan-topline strong { color: white; padding: 3px 7px; background: var(--teal-dark); font: 800 11px "IBM Plex Sans KR", sans-serif; letter-spacing: 0; }
.billing-plan h3 { margin: 20px 0 5px; font-size: 21px; }
.plan-benefit { width: fit-content; margin: 0 0 12px; border: 1px solid var(--teal); padding: 4px 8px; color: var(--teal-dark); background: var(--teal-soft); font-size: 12px; font-weight: 800; }
.plan-benefit strong { font: 800 18px/1 "Cascadia Mono", Consolas, monospace; letter-spacing: -.04em; }
.plan-credit { margin: 0; font: 700 38px/1.1 "Cascadia Mono", Consolas, monospace; letter-spacing: -.05em; }
.plan-credit small { margin-left: 4px; color: var(--muted); font-size: 16px; letter-spacing: 0; }
.plan-price { margin: 8px 0 20px; color: var(--muted); font-size: 14px; }
.billing-plan dl { margin: 0 0 22px; border-top: 1px solid var(--line); }
.billing-plan dl div { min-height: 38px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); font-size: 12px; }
.billing-plan dt { color: var(--muted); }
.billing-plan dd { margin: 0; font-weight: 800; text-align: right; }
.plan-action { min-height: 42px; margin-top: auto; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--teal-dark); color: var(--teal-dark); font-size: 13px; font-weight: 800; }
.plan-action:hover, .plan-action:focus-visible { color: white; background: var(--teal-dark); }
.custom-top-up { margin-top: 16px; display: grid; grid-template-columns: minmax(260px, 1fr) auto minmax(210px, .5fr) auto; gap: 18px; align-items: center; border: 1px solid var(--line); padding: 20px 22px; background: rgba(255,255,255,.35); }
.custom-top-up p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.custom-top-up label { color: var(--muted); font-size: 12px; font-weight: 800; }
.money-input { min-height: 44px; display: grid; grid-template-columns: 1fr auto; border: 1px solid var(--line-strong); background: white; }
.money-input input { min-width: 0; width: 100%; border: 0; padding: 8px 12px; background: transparent; font-family: "Cascadia Mono", Consolas, monospace; }
.money-input span { display: grid; place-items: center; border-left: 1px solid var(--line); padding: 0 12px; color: var(--muted); }
.annual-contract-card { display: grid; grid-template-columns: minmax(230px, 1fr) minmax(250px, .9fr) minmax(360px, 1.5fr) auto; gap: 30px; align-items: center; border: 1px solid var(--teal-dark); border-left: 7px solid var(--teal-dark); padding: 30px; color: #e2f0ed; background: #12332d; }
.annual-contract-title > span { color: #75d7c6; font: 700 12px "Cascadia Mono", Consolas, monospace; letter-spacing: .1em; }
.annual-contract-title h3 { margin: 7px 0 5px; color: white; font-size: 25px; }
.annual-contract-title p, .annual-credit p { margin: 0; color: #aecbc5; font-size: 13px; }
.annual-credit { border-left: 1px solid #3a5e57; padding-left: 28px; }
.annual-credit > span { color: #9ebbb5; font-size: 12px; }
.annual-credit strong { display: block; margin: 5px 0; color: white; font: 700 34px/1 "Cascadia Mono", Consolas, monospace; }
.annual-credit strong small { margin-left: 4px; font-size: 15px; }
.annual-credit.annual-unlimited strong { font-size: 76px; line-height: .8; letter-spacing: -.08em; }
.annual-credit.annual-unlimited p { color: #75d7c6; font-weight: 700; }
.annual-metrics { margin: 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #3a5e57; border-left: 1px solid #3a5e57; }
.annual-metrics div { min-height: 60px; border-right: 1px solid #3a5e57; border-bottom: 1px solid #3a5e57; padding: 9px 12px; }
.annual-metrics dt { color: #8fada7; font-size: 11px; }
.annual-metrics dd { margin: 5px 0 0; color: white; font-weight: 800; }
.annual-contract-card .primary-button { border-color: #7ae0cd; color: #09231e; background: #7ae0cd; white-space: nowrap; }
.billing-policy-note { margin: 34px 0 0; border-left: 3px solid var(--line-strong); padding: 9px 15px; color: var(--muted); font-size: 13px; }
.billing-policy-note a { color: var(--teal-dark); text-decoration: underline; }
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 28px; align-items: start; }
.checkout-sheet { border-top: 3px solid var(--ink); background: var(--panel); }
.checkout-sheet-head { min-height: 140px; padding: 28px 32px; display: flex; flex-direction: column; justify-content: flex-end; border: 1px solid var(--line); border-top: 0; background: linear-gradient(125deg, #e1ebe8, #f8faf9 58%); }
.checkout-sheet-head > span { color: var(--teal); font: 700 12px "Cascadia Mono", Consolas, monospace; letter-spacing: .09em; }
.checkout-sheet-head h2 { margin: 9px 0 0; font-size: 31px; letter-spacing: -.04em; }
.order-lines { margin: 0; border: 1px solid var(--line); border-top: 0; padding: 16px 32px; }
.order-lines > div { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.order-lines > div:last-child { border-bottom: 0; }
.order-lines dt { color: var(--muted); }
.order-lines dd { margin: 0; font: 700 17px "Cascadia Mono", Consolas, monospace; }
.order-lines .order-total-credit { min-height: 72px; color: var(--teal-dark); }
.order-lines .order-total-credit dt { color: inherit; font-weight: 800; }
.order-lines .order-total-credit dd { font-size: 27px; }
.contract-notice { border: 1px solid #c6a55c; border-top: 0; padding: 20px 26px; background: var(--amber-soft); }
.contract-notice p { margin: 5px 0 0; color: #6f5521; font-size: 13px; line-height: 1.7; }
.checkout-payment { position: sticky; top: 142px; border: 1px solid var(--line-strong); padding: 28px; background: white; }
.checkout-payment > span { color: var(--muted); font-size: 13px; }
.checkout-payment > strong { display: block; margin: 8px 0 12px; font: 700 clamp(25px, 3vw, 38px)/1.1 "Cascadia Mono", Consolas, monospace; letter-spacing: -.04em; }
.checkout-payment > p, .checkout-payment > small { color: var(--muted); font-size: 12px; line-height: 1.7; }
.checkout-payment > small { display: block; margin-top: 18px; }
.check-row { margin-top: 13px; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: 13px; }
.check-row input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--teal-dark); }
.check-row a { color: var(--teal-dark); text-decoration: underline; }
.payment-submit { width: 100%; margin-top: 20px; }
button.payment-submit:disabled { border-color: #9eaaa7; color: #eef2f1; background: #9eaaa7; cursor: not-allowed; }
.provider-locked { margin-top: 20px; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; border: 1px solid #d4bc86; padding: 14px; background: var(--amber-soft); }
.provider-locked .gate-lamp { grid-row: 1 / 3; }
.provider-locked p { margin: 0; color: #705521; font-size: 12px; }
.cancel-order { margin-top: 12px; }
.cancel-order button { width: 100%; min-height: 40px; border: 0; color: var(--muted); background: transparent; cursor: pointer; text-decoration: underline; }
.status-large { min-height: 34px; padding: 5px 12px; font-size: 12px; }

@media (max-width: 1050px) {
  .balance-rail { grid-template-columns: 280px 1fr; }
  .rail-action { grid-column: 1 / -1; min-height: 90px; border-top: 1px solid var(--line); border-left: 0; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-strip > div:nth-child(2) { border-right: 0; }
  .metric-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .login-frame { grid-template-columns: 1fr; }
  .login-scope { min-height: 54vh; }
  .login-panel { min-height: 46vh; }
  .scope-readout { display: none; }
  .ops-grid { grid-template-columns: 1fr; gap: 0; }
  .ops-filter-grid { grid-template-columns: auto 1fr auto 180px; }
  .ops-filter-grid button { grid-column: 1 / -1; }
  .coupon-admin-grid { grid-template-columns: 1fr; }
  .ops-user-summary { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .job-trace-strip { grid-template-columns: 1fr 1fr; }
  .job-trace-strip.job-trace-six { grid-template-columns: 1fr 1fr; }
  .job-trace-strip > div:nth-child(2) { border-right: 0; }
  .job-trace-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .billing-plan-grid { grid-template-columns: 1fr 1fr; }
  .annual-contract-card { grid-template-columns: 1fr 1fr; }
  .annual-contract-card .primary-button { width: 100%; }
  .custom-top-up { grid-template-columns: 1fr auto minmax(210px, .6fr); }
  .record-evidence-grid { grid-template-columns: 1fr; }
  .custom-top-up > div { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .portal-shell { width: min(100% - 28px, 1460px); }
  .header-row { min-height: 62px; }
  .portal-brand small, .account-chip > span { display: none; }
  .nav-row { gap: 22px; }
  .nav-note, .nav-separator { display: none; }
  .portal-main { padding-top: 34px; padding-bottom: 58px; }
  .page-heading { display: block; }
  .page-heading > a, .page-heading > .read-only-badge, .page-heading > .admin-action-badge, .page-heading > .status { margin-top: 18px; }
  .balance-rail { grid-template-columns: 1fr; }
  .balance-primary { min-height: 155px; }
  .balance-rail dl { padding: 22px 16px; grid-template-columns: 1fr; gap: 16px; }
  .balance-rail dl div { border-left: 0; border-bottom: 1px solid var(--line); padding: 0 0 13px; }
  .balance-rail dl div:last-child { border: 0; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-strip > div { min-height: 90px; padding: 14px; }
  .metric-strip strong { font-size: 27px; }
  .job-lane li { grid-template-columns: 16px 46px 1fr; gap: 12px; }
  .lane-main { grid-template-columns: 1fr; }
  .lane-main code { grid-column: 1; }
  .lane-meta { grid-column: 2 / -1; justify-content: flex-start; padding-left: 58px; }
  .privacy-band { grid-template-columns: 90px 1fr; }
  .privacy-band a { grid-column: 2; }
  .balance-compact, .identity-strip, .ops-balance { grid-template-columns: 1fr; }
  .balance-compact > div, .identity-strip > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .coupon-entry { grid-template-columns: 1fr; gap: 24px; padding: 24px 18px; }
  .coupon-entry form > div { grid-template-columns: 1fr; }
  .coupon-entry button { min-height: 44px; }
  .onboarding-notice { grid-template-columns: 1fr; padding: 20px 18px; }
  .onboarding-notice .secondary-button { justify-self: start; }
  .footer-row { flex-direction: column; }
  .split-results { grid-template-columns: 1fr; }
  .login-scope { min-height: 500px; padding: 28px; }
  .login-scope-copy { left: 28px; right: 28px; bottom: 50px; }
  .login-scope-copy h1 { font-size: 37px; }
  .login-panel { min-height: 430px; padding: 34px 24px; }
  .job-trace-strip { grid-template-columns: 1fr; }
  .job-trace-strip.job-trace-six { grid-template-columns: 1fr; }
  .job-trace-strip > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .state-timeline { grid-template-columns: 1fr; gap: 24px; }
  .state-timeline li { display: grid; grid-template-columns: 20px 1fr; gap: 12px; }
  .state-timeline li::after { width: 2px; height: auto; left: 8px; right: auto; top: 16px; bottom: -24px; }
  .state-timeline li > div { margin-top: 0; }
  .detail-list > div { grid-template-columns: 110px 1fr; }
  .evidence-list > div { grid-template-columns: 1fr; align-items: start; gap: 5px; padding: 10px 0; }
  .risk-principle, .decision-panel { grid-template-columns: 1fr; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar label { display: grid; grid-template-columns: 84px 1fr; align-items: center; }
  .ops-filter-grid { grid-template-columns: 1fr; }
  .ops-filter-grid label { margin-top: 4px; }
  .ops-filter-grid button { grid-column: auto; }
  .ops-form-grid { grid-template-columns: 1fr; }
  .ops-form-grid label:last-child { grid-column: auto; }
  .admin-submit-row { align-items: stretch; flex-direction: column; }
  .issued-coupon-panel { grid-template-columns: 1fr; }
  .ops-delivery-form { grid-template-columns: 1fr; }
  .ops-delivery-form label:nth-of-type(3), .ops-delivery-form .form-error { grid-column: auto; }
  .ops-delivery-form button { width: 100%; }
  .balance-chip { margin-top: 18px; }
  .billing-plan-grid, .checkout-layout { grid-template-columns: 1fr; }
  .billing-plan { min-height: auto; }
  .custom-top-up { grid-template-columns: 1fr; }
  .custom-top-up > div { grid-column: auto; }
  .custom-top-up .secondary-button { width: 100%; }
  .annual-contract-card { grid-template-columns: 1fr; padding: 24px 20px; }
  .annual-credit { border-top: 1px solid #3a5e57; border-left: 0; padding: 20px 0 0; }
  .annual-metrics { grid-template-columns: 1fr 1fr; }
  .checkout-payment { position: static; }
  .checkout-sheet-head, .order-lines { padding-right: 20px; padding-left: 20px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* License operations */
.license-ops-grid { grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr); }
.license-row { min-height: 72px; display: grid; grid-template-columns: minmax(220px, 1fr) 150px auto; align-items: center; gap: 20px; border-top: 1px solid var(--line); padding: 12px 4px; }
.license-row:hover, .license-row:focus-visible { background: rgba(255, 255, 255, .52); }
.license-row > span:first-child { min-width: 0; display: flex; flex-direction: column; }
.license-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.license-row small { color: var(--muted); font-size: 11px; }
.seat-mini { display: grid; grid-template-columns: repeat(3, 22px) 1fr; align-items: center; gap: 5px; }
.seat-mini i { width: 22px; height: 12px; border: 1px solid var(--line-strong); background: transparent; }
.seat-mini i.is-active { border-color: var(--teal); background: var(--teal); }
.seat-mini small { margin: 0 0 0 5px; color: var(--ink-2); white-space: nowrap; }
.table-seats { width: 125px; }
.metric-word { font-family: inherit !important; font-size: 24px !important; }
.license-filter { margin-bottom: 36px; }
.form-section { max-width: 980px; }
.license-issue-form textarea, .license-control-panel textarea { resize: vertical; }
.issued-license-panel { margin-bottom: 38px; display: grid; grid-template-columns: minmax(0, 1fr) auto; border: 1px solid var(--teal-dark); background: #dff0ec; }
.issued-license-panel > div { min-width: 0; padding: 28px; }
.issued-license-panel > div > span { color: var(--teal-dark); font: 700 11px "Cascadia Mono", Consolas, monospace; letter-spacing: .1em; }
.issued-license-panel h2 { margin: 10px 0; font: 700 clamp(22px, 4vw, 36px) "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }
.issued-license-panel p { margin: 0; color: var(--ink-2); }
.issued-license-panel dl { min-width: 270px; margin: 0; border-left: 1px solid #acd1c9; padding: 22px 26px; }
.issued-license-panel dl div { display: flex; justify-content: space-between; gap: 24px; padding: 8px 0; border-bottom: 1px solid #c4dfd9; }
.issued-license-panel dt { color: var(--muted); }
.issued-license-panel dd { margin: 0; font-weight: 800; }
.license-seat-rack { display: grid; grid-template-columns: minmax(210px, .8fr) repeat(3, minmax(210px, 1fr)); border: 1px solid var(--line-strong); background: var(--panel); }
.rack-heading, .device-slot { min-height: 258px; padding: 24px; }
.rack-heading { color: #dcece8; background: var(--teal-dark); }
.rack-heading span, .device-slot > span { display: block; color: #a9d2cb; font: 700 10px "Cascadia Mono", Consolas, monospace; letter-spacing: .12em; }
.rack-heading strong { display: block; margin: 24px 0 8px; font: 700 34px "Cascadia Mono", Consolas, monospace; }
.rack-heading p { color: #b8d6d1; font-size: 12px; }
.device-slot { border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.device-slot > span { color: var(--teal); }
.device-slot > strong { margin: 13px 0 18px; font-size: 17px; }
.device-slot dl { margin: 0; font-size: 11px; }
.device-slot dl div { display: grid; grid-template-columns: 76px 1fr; gap: 10px; margin-bottom: 5px; }
.device-slot dt { color: var(--muted); }
.device-slot dd { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; }
.device-slot form { margin-top: auto; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.device-slot form label { color: var(--muted); font-size: 10px; }
.device-slot form input { width: 100%; min-height: 32px; margin-top: 4px; border: 1px solid var(--line); padding: 5px 8px; background: white; }
.device-slot form button { min-height: 32px; border: 1px solid var(--red); padding: 5px 9px; color: var(--red); background: transparent; cursor: pointer; }
.device-slot.is-empty { justify-content: center; border-left-style: dashed; color: var(--muted); background: #f0f4f3; }
.device-slot.is-empty > span { color: var(--line-strong); }
.device-slot.is-empty > strong { color: var(--muted); }
.device-slot.is-empty p { font-size: 12px; }
.license-detail-metrics { margin-top: 20px; }
.detail-note { max-width: 900px; color: var(--ink-2); }
.license-control-panel { border-top-color: var(--amber); }
.license-control-panel form { display: grid; grid-template-columns: minmax(180px, 240px) minmax(280px, 1fr) auto; gap: 16px; align-items: end; }
.license-control-panel label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; }
.license-control-panel select, .license-control-panel textarea { width: 100%; min-height: 42px; border: 1px solid var(--line-strong); padding: 8px 10px; color: var(--ink); background: white; }
.license-control-panel > p { margin: 12px 0 0; color: var(--muted); font-size: 12px; }

@media (max-width: 1120px) {
  .license-seat-rack { grid-template-columns: 1fr 1fr; }
  .device-slot:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .device-slot:nth-child(4) { border-top: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .license-row { grid-template-columns: 1fr auto; }
  .license-row .seat-mini { grid-column: 1 / -1; }
  .issued-license-panel { grid-template-columns: 1fr; }
  .issued-license-panel dl { border-top: 1px solid #acd1c9; border-left: 0; }
  .license-seat-rack { grid-template-columns: 1fr; }
  .rack-heading, .device-slot { min-height: 0; }
  .device-slot, .device-slot:nth-child(3), .device-slot:nth-child(4) { border-top: 1px solid var(--line); border-left: 0; }
  .license-control-panel form { grid-template-columns: 1fr; }
}
