:root {
  color-scheme: light;
  --ink: #172a3e;
  --muted: #506373;
  --teal: #13695e;
  --teal-dark: #0b5047;
  --mint: #e4f2ed;
  --line: #dce5e8;
  --ground: #f3f7f7;
  --paper: #fff;
  --warn: #79501d;
  --warn-bg: #f7ecd8;
  --danger: #942e35;
  --radius: 8px;
  --body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 280px; min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); font: 15px/1.65 var(--body); }
main { flex: 1; }
h1, h2, h3, p, dl, dd, blockquote { margin: 0; }
h1, h2, h3 { line-height: 1.24; }
ol { margin: 0; padding: 0; }
a { color: var(--teal-dark); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex="0"]:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .6; }
small { font-size: .84em; }
.shell { width: min(1140px, calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 5; top: 6px; left: 12px; padding: .45rem .8rem; background: var(--paper); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.text-warn { color: var(--warn); }

.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.header-inner { min-height: 68px; padding-block: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 1.08rem; font-weight: 750; text-decoration: none; white-space: nowrap; }
.brand-mark { display: grid; gap: 3px; width: 29px; height: 29px; place-content: center; border-radius: 5px; background: var(--teal-dark); }
.brand-mark i { display: block; position: relative; width: 15px; height: 3px; border: 1px solid white; border-radius: 1px; }
.brand-mark i::after { position: absolute; content: ""; top: 0; right: 1px; width: 1px; height: 1px; background: white; }
.site-nav { display: flex; align-items: center; gap: clamp(.7rem, 2.5vw, 1.65rem); font-size: .9rem; }
.site-nav a:not(.button), .text-button { color: var(--muted); text-decoration: none; white-space: nowrap; }
.site-nav a[aria-current="page"] { color: var(--teal-dark); font-weight: 750; }
.site-nav a:not(.button):hover, .text-button:hover { color: var(--teal-dark); text-decoration: underline; }
.text-button { min-height: 36px; padding: 0; border: 0; background: none; }
.footer-inner { min-height: 80px; align-items: start; padding-block: 24px; font-size: .88rem; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); background: var(--paper); }
.footer-meta { display: inline-block; padding-top: .2rem; }

.button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 9px; padding: .55rem .95rem; border: 1px solid var(--teal-dark); border-radius: 5px; background: var(--teal-dark); color: white; font-size: .93rem; font-weight: 700; line-height: 1.35; text-decoration: none; }
.button:hover { background: var(--teal); border-color: var(--teal); }
.button-outline { color: var(--teal-dark); background: var(--paper); border-color: #a8c1bb; }
.button-outline:hover { background: var(--mint); border-color: var(--teal); }
.button-small { min-height: 37px; padding: .42rem .7rem; font-size: .86rem; }
.status-pill { display: inline-flex; align-items: center; gap: .45em; padding: .15rem .55rem; border-radius: 3px; background: var(--ground); color: var(--muted); font-size: .82rem; font-weight: 700; white-space: nowrap; }
.status-pill i { width: 7px; height: 7px; background: currentColor; border-radius: 50%; }
.status-good { background: var(--mint); color: var(--teal-dark); }
.status-warn { background: var(--warn-bg); color: var(--warn); }

.review-hero { padding-block: clamp(45px, 7vw, 94px); background: var(--ground); border-bottom: 1px solid var(--line); }
.hero-layout { display: grid; grid-template-columns: 1.06fr .94fr; align-items: center; gap: clamp(35px, 7vw, 94px); }
.eyebrow { display: flex; align-items: center; gap: .65rem; margin-bottom: 21px; color: var(--teal-dark); font-size: .86rem; font-weight: 750; letter-spacing: .065em; }
.eyebrow-line { width: 18px; height: 2px; flex: 0 0 18px; background: var(--teal); }
.hero-copy h1 { font-size: clamp(2.5rem, 5.6vw, 5rem); font-weight: 800; letter-spacing: -.055em; line-height: 1.12; }
.hero-description { max-width: 33em; margin-top: 24px; color: var(--muted); font-size: 1.02rem; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .85rem; margin-top: 27px; }
.call-receipt { min-width: 0; padding: 25px 26px 19px; background: var(--ink); color: #eff6fc; border: 1px solid #0c1c2e; border-radius: var(--radius); box-shadow: 0 13px 29px -19px #152f43a6; }
.receipt-top, .receipt-meta, .receipt-footer { display: flex; justify-content: space-between; gap: .5rem; }
.receipt-top { align-items: start; }
.receipt-kicker, .receipt-meta dt { color: #aebdcb; font-size: .76rem; }
.receipt-title { font-size: 1.22rem; font-weight: 750; }
.receipt-tag { padding: .1rem .47rem; border: 1px solid #70869a; border-radius: 3px; color: #e2edf7; font-size: .75rem; white-space: nowrap; }
.receipt-meta { margin-top: 18px; padding-block: 11px; border-block: 1px solid #425367; }
.receipt-meta dd { color: #f2f8ff; font-size: .88rem; font-weight: 650; }
.receipt-meta > div:first-child dd { font-family: var(--mono); }
.call-flow { list-style: none; margin-block: 8px 9px; }
.call-flow li { position: relative; display: grid; grid-template-columns: 21px 1fr auto; align-items: center; gap: 10px; min-height: 45px; padding: 4px 5px; }
.call-flow li:not(:last-child)::after { content: ""; position: absolute; top: 33px; bottom: -11px; left: 15px; width: 1px; background: #72859a; }
.call-step { display: grid; z-index: 1; width: 21px; height: 21px; place-items: center; border: 1px solid #879aaf; border-radius: 50%; background: var(--ink); color: #e5eef7; font: .75rem/1 var(--mono); }
.call-flow small { display: inline; margin-left: .5rem; color: #b3c1cf; font-size: .77rem; }
.call-result { color: #c3cfdb; font-size: .78rem; white-space: nowrap; }
.call-complete { border-radius: 4px; background: #213d44; }
.call-complete .call-step { border-color: #93dac4; color: #c7f3e6; background: #213d44; }
.call-complete .call-result, .receipt-footer > span { color: #c7f3e6; font-weight: 700; }
.receipt-footer { justify-content: start; align-items: center; padding-top: 12px; border-top: 1px solid #425367; color: #dbf2eb; font-size: .86rem; }
.receipt-footer small { margin-left: auto; color: #b3c1cf; }

.workflow-section { padding-block: 55px 68px; scroll-margin-top: 20px; }
.section-intro { margin-bottom: 22px; }
.section-intro h2 { font-size: clamp(1.4rem, 3.2vw, 2.2rem); margin-bottom: 9px; letter-spacing: -.025em; }
.section-intro p, .workflow-steps p, .script-box p { color: var(--muted); }
.workflow-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; border-block: 1px solid var(--line); }
.workflow-steps li { min-width: 0; padding: 19px 23px 22px; }
.workflow-steps li:first-child { padding-left: 0; }
.workflow-steps li + li { border-left: 1px solid var(--line); }
.step-number { display: block; margin-bottom: 8px; font: .88rem/1.5 var(--mono); color: var(--teal-dark); font-weight: 700; }
.workflow-steps h3, .script-box h2 { margin-bottom: 8px; font-size: 1.08rem; }
.script-box { display: grid; grid-template-columns: minmax(12em, .73fr) minmax(0, 1.27fr); gap: 22px; margin-top: 30px; padding: 20px 23px; border-radius: 5px; background: var(--mint); }
.script-box blockquote { padding-left: 17px; border-left: 2px solid #6ea196; color: var(--teal-dark); font-size: 1.02rem; }

.console-page { background: var(--ground); }
.workspace { padding-block: 36px 58px; }
.narrow-workspace { max-width: 760px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 21px; }
.page-heading h1, .login-panel h1 { font-size: clamp(1.8rem, 4vw, 2.55rem); letter-spacing: -.045em; }
.page-heading p { margin-top: 7px; color: var(--muted); }
.back-link { display: inline-block; margin-bottom: 14px; font-size: .88rem; font-weight: 650; }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-heading { padding: 18px 20px 13px; }
.panel-heading h2, .detail-panel h2 { font-size: 1.12rem; }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stats-grid div { padding: .65rem 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.stats-grid dt { color: var(--muted); font-size: .84rem; font-weight: 650; }
.stats-grid dd { color: var(--ink); font: 1.65rem/1.35 var(--mono); font-weight: 700; }
.table-wrap { overflow-x: auto; }
.table-hint { display: none; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .7rem .95rem; border-top: 1px solid var(--line); vertical-align: top; }
th { background: #f7f9fa; color: var(--muted); font-size: .78rem; font-weight: 700; white-space: nowrap; }
td { font-size: .88rem; }
td:first-child, th:first-child { padding-left: 20px; }
td:last-child, th:last-child { padding-right: 20px; }
tbody tr:hover { background: #f8fbfa; }
.ticket-cell { min-width: 155px; }
.ticket-cell a { font-weight: 750; }
.table-secondary { display: block; margin-top: .12rem; color: var(--muted); font-size: .82em; }
.empty-state { padding: 1.8rem 20px; border-top: 1px solid var(--line); color: var(--muted); }
.filters { display: grid; grid-template-columns: minmax(10rem, 1.6fr) repeat(5, minmax(6.7rem, 1fr)); align-items: end; gap: .65rem; padding: 0 20px 15px; }
.filters .form-field { gap: .18rem; }
.filters input, .filters select { min-height: 37px; padding: .35rem .5rem; font-size: .84rem; }
.filters label { font-size: .8rem; }
.filter-actions { grid-column: 1 / -1; }

.form-field { display: grid; min-width: 0; gap: .35rem; align-content: start; }
.form-field label { color: var(--ink); font-weight: 650; }
.form-field input:not([type="checkbox"]), .form-field select, .form-field textarea { width: 100%; min-width: 0; min-height: 43px; padding: .47rem .65rem; border: 1px solid #abbfc7; border-radius: 4px; color: var(--ink); background: var(--paper); }
.form-field textarea { min-height: 103px; resize: vertical; }
.form-field [aria-invalid="true"] { border-color: var(--danger); }
.checkbox-field { padding-block: .35rem; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; min-height: 32px; width: fit-content; }
.checkbox-label input { margin: 0; width: 1rem; height: 1rem; accent-color: var(--teal-dark); }
.helptext { color: var(--muted); }
.errorlist { margin: 0; padding: 0 0 0 1rem; color: var(--danger); font-size: .85rem; }
.editor-form, .stack-form { display: grid; gap: 1rem; }
.editor-form { padding: clamp(16px, 3vw, 24px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.editor-form > .errorlist, .editor-form > .form-actions, .editor-form > .form-field:has(textarea) { grid-column: 1 / -1; }
.form-actions, .filter-actions { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.inline-action { margin-block: .75rem 0; }
.login-section { display: grid; place-items: center; padding-block: clamp(36px, 8vw, 90px); }
.login-panel { width: min(100%, 440px); padding: clamp(19px, 4vw, 34px); }
.login-panel > p { margin-block: .5rem 1.6rem; }

.detail-heading { align-items: start; }
.detail-heading .detail-reference { margin: 0 0 5px; font-size: .85rem; }
.detail-reference span { font-family: var(--body); }
.detail-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); align-items: start; }
.detail-column { display: grid; min-width: 0; gap: 16px; }
.detail-panel { padding: clamp(16px, 3vw, 22px); overflow-wrap: anywhere; }
.detail-panel h2 { margin-bottom: .7rem; }
.detail-panel h3 { margin-top: 1rem; font-size: .96rem; }
.detail-panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .7rem; margin-bottom: .3rem; }
.detail-panel-heading h2 { margin-bottom: .4rem; }
.detail-panel .stack-form { margin-top: 1rem; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem 1rem; }
.facts dt { color: var(--muted); font-size: .83rem; }
.facts dd .status-pill { margin-left: .35rem; }
.multiline { white-space: pre-line; margin-top: .3rem; }
.next-notice { padding: .8rem; background: var(--ground); border: 1px solid var(--line); border-radius: 5px; }
.next-notice span, .next-notice strong { display: block; }
.next-notice .form-actions { margin-top: .55rem; }
.audit-list { list-style: none; margin-top: .65rem; }
.audit-list li { padding-block: .45rem; border-top: 1px solid var(--line); }
.audit-list li div { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .55rem; }
.audit-list time, .audit-list p { color: var(--muted); font-size: .82rem; }
.audit-list time { font-family: var(--mono); white-space: nowrap; }
.notice-list li { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.notice-list li > span { white-space: nowrap; color: var(--teal-dark); }
.alerts { margin-top: 13px; }
.alert { margin-bottom: .5rem; padding: .5rem .75rem; border-left: 3px solid var(--teal); background: var(--mint); color: var(--teal-dark); }
.alert.error, .alert.warning { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }

@media (max-width: 940px) {
  .hero-layout { gap: 2rem; }
  .call-flow small { display: block; margin: 0; }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .shell { width: calc(100% - 36px); }
  .header-inner, .footer-inner { flex-wrap: wrap; }
  .header-inner { column-gap: 1rem; row-gap: .1rem; }
  .hero-layout, .detail-layout { grid-template-columns: 1fr; }
  .hero-description { margin-top: 18px; }
  .call-flow small { display: inline; margin-left: .4rem; }
  .workflow-section { padding-block: 34px 44px; }
  .workflow-steps, .script-box { grid-template-columns: 1fr; }
  .workflow-steps li, .workflow-steps li:first-child { padding: .8rem 0; }
  .workflow-steps li + li { border-left: 0; border-top: 1px solid var(--line); }
  .script-box { gap: .9rem; }
  .workspace { padding-block: 24px 38px; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .stats-grid div { padding: .5rem .65rem; }
  .stats-grid dt { font-size: .76rem; }
  .table-hint { display: block; padding: .25rem 20px .55rem; color: var(--muted); font-size: .78rem; }
}

@media (max-width: 440px) {
  .site-nav { flex-basis: 100%; flex-wrap: wrap; }
  .site-nav a:not(.button) { display: inline-flex; min-height: 36px; align-items: center; }
  .page-heading { flex-wrap: wrap; align-items: start; }
  .call-receipt { padding: 16px; }
  .call-flow small { display: block; margin: 0; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-form { grid-template-columns: minmax(0, 1fr); }
}

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