:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #172033;
  background: #f3f6fa;
  font-synthesis: none;
  --navy-950: #071b35;
  --navy-900: #0b2545;
  --navy-800: #12365e;
  --blue-700: #1769aa;
  --blue-600: #1976bd;
  --blue-100: #e8f2fb;
  --teal-600: #0c8a7a;
  --green-600: #178154;
  --amber-600: #b66a0a;
  --red-600: #b42318;
  --slate-700: #344054;
  --slate-500: #667085;
  --slate-300: #d0d5dd;
  --slate-200: #e4e9ef;
  --slate-100: #f2f4f7;
  --white: #fff;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 5%);
  --shadow-md: 0 10px 30px rgb(15 35 64 / 8%);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100vh; margin: 0; background: linear-gradient(180deg, #eef3f8 0, #f7f9fc 300px, #f7f9fc 100%); }
a { color: var(--blue-700); text-decoration: none; }
a:hover { color: #0d4f86; }
button, input, select, textarea { font: inherit; }

.site-header { position: sticky; top: 0; z-index: 20; min-height: 72px; color: white; background: linear-gradient(110deg, var(--navy-950), var(--navy-800)); box-shadow: 0 1px 0 rgb(255 255 255 / 10%); }
.header-inner { width: min(1240px, calc(100% - 40px)); min-height: 72px; margin: 0 auto; display: flex; align-items: center; gap: 38px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: white; flex: 0 0 auto; }
.brand:hover { color: white; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(145deg, #36b6a4, #147fa5); box-shadow: inset 0 1px 0 rgb(255 255 255 / 30%); font-size: 1.1rem; font-weight: 800; }
.brand-copy { display: grid; line-height: 1.1; }
.brand-copy strong { font-size: .98rem; letter-spacing: .03em; }
.brand-copy small { margin-top: 5px; color: #a9bdd3; font-size: .63rem; letter-spacing: .16em; }
.main-nav { display: flex; align-self: stretch; align-items: center; gap: 6px; flex: 1; }
.main-nav a { padding: 10px 14px; color: #d7e2ef; border-radius: 8px; font-size: .9rem; font-weight: 600; }
.main-nav a:hover { color: white; background: rgb(255 255 255 / 9%); }
.main-nav a.is-active { color: white; background: rgb(255 255 255 / 14%); box-shadow: inset 0 -2px 0 #4cc4b0; }
.account-menu { display: flex; align-items: center; gap: 9px; }
.account-avatar { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgb(255 255 255 / 22%); border-radius: 50%; background: rgb(255 255 255 / 10%); font-size: .75rem; font-weight: 800; }
.account-name { color: #d7e2ef; font-size: .82rem; }
.text-button { border: 0; padding: 6px; color: #a9bdd3; background: transparent; cursor: pointer; }
.text-button:hover { color: white; }

.container { width: min(1180px, calc(100% - 40px)); margin: 38px auto 64px; }
.site-footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 22px 0 30px; border-top: 1px solid var(--slate-200); display: flex; justify-content: space-between; color: #8793a5; font-size: .75rem; }
.message-stack { margin-bottom: 18px; }
.message { padding: 14px 16px; border: 1px solid #c9dceb; border-radius: 10px; background: #ecf5fc; color: #174d73; box-shadow: var(--shadow-sm); }
.message + .message { margin-top: 9px; }
.message.error, .error { border-color: #f5c2bd; color: #912018; background: #fff2f0; }
.message.success { border-color: #b7e2ce; color: #14643f; background: #edf9f3; }
.message.warning { border-color: #f0d39d; color: #7b4c08; background: #fff8e9; }

.page-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin: 0 0 28px; }
.page-hero.compact { align-items: center; margin-bottom: 24px; }
.page-hero h1 { margin: 2px 0 8px; color: var(--navy-950); font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; letter-spacing: -.035em; }
.page-hero.compact h1 { font-size: clamp(1.8rem, 3vw, 2.45rem); }
.hero-copy { max-width: 680px; margin: 0; color: var(--slate-500); font-size: 1rem; line-height: 1.7; }
.eyebrow { margin: 0 0 7px; color: var(--teal-600); font-size: .7rem; font-weight: 800; letter-spacing: .13em; }
.breadcrumb { display: flex; gap: 9px; margin-bottom: 18px; color: #8994a5; font-size: .78rem; }
.breadcrumb a { color: var(--slate-500); }
.context-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 20px; }
.context-actions a { padding: 7px 10px; border: 1px solid var(--slate-300); border-radius: 7px; color: var(--slate-700); background: white; font-size: .72rem; font-weight: 750; }
.context-actions a:hover { border-color: #aeb8c5; color: var(--navy-900); text-decoration: none; }
.security-chip { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border: 1px solid #bdded8; border-radius: 999px; color: #176b5e; background: #eef9f7; font-size: .8rem; font-weight: 650; white-space: nowrap; }
.security-chip span { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: #d6f0eb; }

.button, button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 9px; padding: 10px 16px; cursor: pointer; font-weight: 700; line-height: 1.2; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.button:hover, button:hover { text-decoration: none; transform: translateY(-1px); }
.button-primary, button:not(.text-button):not(.link-button) { color: white; background: linear-gradient(135deg, var(--blue-700), #12578f); box-shadow: 0 5px 14px rgb(23 105 170 / 20%); }
.button-primary:hover { color: white; background: linear-gradient(135deg, #1877bc, #0f4f84); }
.button-secondary { border-color: var(--slate-300); color: var(--slate-700); background: white; box-shadow: var(--shadow-sm); }
.button-secondary:hover { color: var(--navy-900); border-color: #aeb8c5; }
.button-danger { color: white; background: var(--red-600); }
.button-danger:hover { color: white; background: #951d14; }
.button-large { padding: 12px 20px; }
.button-block { width: 100%; }
.link-button { border: 0; color: white; background: transparent; box-shadow: none; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 22px; }
.metric-card { position: relative; min-height: 135px; padding: 20px; overflow: hidden; border: 1px solid var(--slate-200); border-radius: 13px; background: rgb(255 255 255 / 92%); box-shadow: var(--shadow-sm); }
.metric-card::after { content: ""; position: absolute; right: -25px; bottom: -32px; width: 95px; height: 95px; border-radius: 50%; background: #edf3f8; }
.metric-card.metric-success::after { background: #e2f4ec; }
.metric-card.metric-warning::after { background: #fdf0d6; }
.metric-label { display: block; color: var(--slate-500); font-size: .76rem; font-weight: 700; }
.metric-card strong { position: relative; z-index: 1; display: block; margin: 12px 0 1px; color: var(--navy-950); font-size: 2rem; line-height: 1; }
.metric-card small { position: relative; z-index: 1; color: #8b96a6; font-size: .72rem; }

.workflow-strip { display: grid; grid-template-columns: 230px 1fr; gap: 28px; margin-bottom: 22px; padding: 21px 24px; border: 1px solid #cbd9e6; border-radius: 13px; color: white; background: linear-gradient(120deg, #0e2c4e, #173f66); box-shadow: var(--shadow-md); }
.workflow-strip h2 { margin: 0; font-size: 1.2rem; }
.workflow-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.workflow-steps li { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-left: 1px solid rgb(255 255 255 / 13%); }
.workflow-steps li > span { color: #65cabb; font: 800 .72rem/1 ui-monospace, monospace; }
.workflow-steps div { display: grid; gap: 3px; }
.workflow-steps strong { font-size: .83rem; }
.workflow-steps small { color: #adc0d3; font-size: .68rem; }

.content-grid, .grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.detail-grid { grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); margin-bottom: 20px; }
.panel, .card { margin-bottom: 20px; padding: 22px; border: 1px solid var(--slate-200); border-radius: 13px; background: white; box-shadow: var(--shadow-sm); }
.panel-header, .card-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.panel-header h2, .card h2 { margin: 0; color: var(--navy-950); font-size: 1.08rem; }
.panel-note { color: #8b96a6; font-size: .72rem; }
.danger-text { color: var(--red-600); }
.table-wrap { margin: 0 -7px -7px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid #edf0f4; text-align: left; vertical-align: middle; }
th { color: #7b8797; font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
td { color: var(--slate-700); font-size: .82rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfd; }
.row-subtitle { display: block; margin-top: 3px; color: #98a2b3; font-size: .66rem; font-weight: 400; }
.table-action { text-align: right; }
.table-action a { font-weight: 700; }
.empty-state { padding: 34px 20px; border: 1px dashed var(--slate-300); border-radius: 10px; text-align: center; background: #fbfcfd; }
.empty-state strong { color: var(--navy-900); }
.empty-state p { margin: 7px 0 0; color: var(--slate-500); font-size: .82rem; }
.status-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 9px; border-radius: 999px; color: #475467; background: #f2f4f7; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.status-badge::before { content: ""; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #98a2b3; }
.status-parsed, .status-draft { color: #14643f; background: #eaf8f1; }
.status-parsed::before, .status-draft::before { background: #219d69; }
.status-needs_review { color: #8a5509; background: #fff5df; }
.status-needs_review::before { background: #df8b16; }
.status-failed { color: #99251b; background: #fff0ee; }
.status-failed::before { background: #d83c2e; }
.status-parsing, .status-generating { color: #135b8c; background: #e9f4fb; }
.status-parsing::before, .status-generating::before { background: #2183c3; }
.status-large { padding: 9px 14px; font-size: .82rem; }
.count-pill { min-width: 27px; display: inline-grid; place-items: center; padding: 4px 7px; border-radius: 999px; background: #edf1f5; font-size: .72rem; font-weight: 800; }
.count-warning { color: #8a5509; background: #fff0ce; }

.import-form { display: grid; gap: 18px; }
.form-section { display: grid; grid-template-columns: 52px 1fr; gap: 20px; margin: 0; padding: 24px; }
.section-number { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--teal-600); background: #e8f7f4; font: 800 .8rem/1 ui-monospace, monospace; }
.section-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 0 0 5px; color: var(--navy-950); font-size: 1.08rem; }
.section-heading p { margin: 0; color: var(--slate-500); font-size: .8rem; }
.required-note { color: #a36a18; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.field-group label, .upload-field label { display: block; margin-bottom: 7px; color: var(--slate-700); font-size: .78rem; font-weight: 800; }
.period-field { max-width: 280px; }
input, select, textarea { width: 100%; border: 1px solid #c7d0da; border-radius: 9px; padding: 10px 11px; color: #172033; background: white; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #3b87bd; box-shadow: 0 0 0 3px rgb(25 118 189 / 12%); }
input[type="month"] { min-height: 44px; }
input[type="file"] { padding: 8px; color: var(--slate-500); font-size: .72rem; background: #fbfcfd; }
input[type="file"]::file-selector-button { margin-right: 9px; border: 0; border-radius: 6px; padding: 7px 10px; color: var(--navy-800); background: #e7eff7; font-weight: 800; cursor: pointer; }
.field-help { display: block; margin-top: 6px; color: #8b96a6; font-size: .68rem; }
.upload-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.upload-field { position: relative; min-height: 205px; padding: 17px; border: 1px solid #d9e0e7; border-radius: 11px; background: #fcfdff; }
.upload-field:hover { border-color: #b7c8d8; background: #fafdff; }
.upload-field.has-error, .field-group.has-error { border-color: #e09a92; background: #fff8f7; }
.upload-type { width: 28px; height: 28px; display: grid; place-items: center; margin-bottom: 17px; border-radius: 8px; color: #1c628d; background: #e5f1f8; font: 800 .7rem/1 ui-monospace, monospace; }
.upload-field > p { min-height: 34px; margin: 0 0 12px; color: #7d8998; font-size: .72rem; line-height: 1.5; }
.field-errors, .errorlist { margin: 8px 0 0; padding: 0; color: var(--red-600); list-style: none; font-size: .72rem; line-height: 1.5; }
.field-errors li::before, .errorlist li::before { content: "!"; display: inline-grid; place-items: center; width: 15px; height: 15px; margin-right: 5px; border-radius: 50%; color: white; background: var(--red-600); font-size: .6rem; font-weight: 900; }
.inline-note { display: flex; gap: 14px; margin-top: 15px; padding: 11px 13px; border-radius: 8px; color: #496274; background: #eef5f9; font-size: .72rem; }
.inline-note strong { color: #174d73; }
.form-alert { padding: 14px 16px; border: 1px solid #efb4ad; border-radius: 10px; color: #94251b; background: #fff3f1; }
.form-alert p { margin: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 11px; }

.batch-hero { margin-bottom: 20px; }
.batch-metrics { margin-bottom: 20px; }
.recovery-alert { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 17px; margin-bottom: 20px; padding: 17px 19px; border: 1px solid #f0b8b2; border-radius: 12px; color: #762018; background: linear-gradient(90deg, #fff4f2, #fffafa); }
.recovery-alert p { margin: 4px 0; font-size: .83rem; }
.recovery-alert small { color: #98645f; }
.recovery-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--red-600); font-weight: 900; }
.source-list { display: grid; gap: 2px; }
.source-item { display: grid; grid-template-columns: 38px 1fr auto; gap: 13px; align-items: center; padding: 14px 4px; border-bottom: 1px solid #edf0f4; }
.source-item:last-child { border-bottom: 0; }
.source-letter { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: #1a678f; background: #e9f3f9; font: 800 .72rem/1 ui-monospace, monospace; }
.source-item strong { color: var(--navy-900); font-size: .8rem; }
.source-item p { margin: 4px 0; overflow-wrap: anywhere; color: var(--slate-500); font-size: .74rem; }
.source-item code { color: #8b96a6; font-size: .66rem; }
.source-state { color: var(--green-600); font-size: .68rem; font-weight: 800; }
.next-step-panel { text-align: center; }
.next-step-panel .panel-header { text-align: left; }
.next-step-panel h3 { margin: 10px 0 6px; color: var(--navy-900); }
.next-step-panel > p { min-height: 48px; margin: 0 0 18px; color: var(--slate-500); font-size: .8rem; line-height: 1.6; }
.success-symbol, .failed-symbol, .processing-symbol { width: 52px; height: 52px; display: grid; place-items: center; margin: 18px auto 0; border-radius: 50%; color: white; background: var(--green-600); font-size: 1.5rem; font-weight: 800; }
.failed-symbol { background: var(--red-600); }
.processing-symbol { background: var(--blue-600); }
.link-list { display: grid; }
.link-list a { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--slate-200); }
.link-list a:last-child { border-bottom: 0; }

.card.narrow { max-width: 440px; margin: 70px auto; }
.card.narrow-wide { max-width: 760px; margin: 24px auto; }
.page-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.one-time-password { padding: 18px; border: 1px solid #b8d2e8; border-radius: 9px; text-align: center; background: #eef5fb; font: 700 2.4rem/1.2 ui-monospace, monospace; letter-spacing: .35em; }
dt { margin-top: 12px; color: var(--slate-500); font-weight: 700; }
dd { margin: 4px 0 0; }
code, pre { overflow-wrap: anywhere; white-space: pre-wrap; }
h1 { color: var(--navy-950); }
.muted { color: var(--slate-500); }
.status-pass { color: var(--green-600); }
.status-fail { color: var(--red-600); }

.report-hero { align-items: center; }
.report-change-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; margin-bottom: 20px; padding: 17px 19px; border: 1px solid #b7e2ce; border-radius: 13px; color: #155d3d; background: linear-gradient(100deg, #edf9f3, #f9fdfb); box-shadow: var(--shadow-sm); }
.report-change-banner strong { color: #0f5132; font-size: .93rem; }
.report-change-banner p { margin: 5px 0 0; color: #4b6d5e; font-size: .78rem; line-height: 1.55; }
.report-change-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green-600); font-weight: 900; }
.report-change-warning { border-color: #f0d39d; color: #7b4c08; background: linear-gradient(100deg, #fff8e9, #fffdf8); }
.report-change-warning strong { color: #7b4c08; }
.report-change-warning p { color: #876c43; }
.report-change-warning .report-change-icon { background: var(--amber-600); }
.report-metrics .metric-card strong { font-size: clamp(1.35rem, 2.2vw, 1.85rem); font-variant-numeric: tabular-nums; }
.report-version-card { border-top: 3px solid var(--blue-700); }
.report-version-card .eyebrow { margin-bottom: 4px; }
.report-version-meta { display: grid; grid-template-columns: minmax(120px, .35fr) minmax(180px, .65fr) minmax(300px, 2fr); gap: 12px; margin-top: 18px; }
.report-version-meta > div { display: grid; gap: 5px; padding: 13px 15px; border-radius: 9px; background: #f7f9fb; }
.report-version-meta span { color: var(--slate-500); font-size: .68rem; font-weight: 800; }
.report-version-meta strong { color: var(--navy-900); font-size: .9rem; }
.report-version-meta code { color: var(--slate-700); font-size: .68rem; }

.rule-page-hero { margin-bottom: 20px; }
.rule-guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px; }
.rule-guide article { display: flex; gap: 13px; padding: 16px 17px; border: 1px solid #dbe4ec; border-radius: 12px; background: rgb(255 255 255 / 82%); }
.rule-guide article > span { flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: #176b5e; background: #e5f5f1; font-size: .72rem; font-weight: 900; }
.rule-guide strong { color: var(--navy-900); font-size: .82rem; }
.rule-guide p { margin: 5px 0 0; color: var(--slate-500); font-size: .72rem; line-height: 1.55; }
.rule-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rules-panel { padding-bottom: 10px; }
.rule-list { display: grid; }
.rule-item { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 17px; padding: 20px 3px; border-top: 1px solid #edf0f4; }
.rule-item:first-child { border-top: 0; }
.rule-order { width: 50px; height: 55px; display: grid; place-items: center; align-content: center; border-radius: 10px; color: #315d7b; background: #edf5fa; }
.rule-order span { font-size: .6rem; font-weight: 800; }
.rule-order strong { margin-top: 2px; font-size: 1.1rem; line-height: 1; }
.rule-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.rule-heading h3 { margin: 0; font-size: 1rem; }
.rule-technical-id { margin: 4px 0 0; color: #98a2b3; font: .64rem/1.4 ui-monospace, monospace; }
.rule-status { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.rule-status-on { color: #14643f; background: #eaf8f1; }
.rule-status-off { color: #99251b; background: #fff0ee; }
.rule-status-future { color: #8a5509; background: #fff5df; }
.rule-flow { display: grid; grid-template-columns: minmax(0, 1.35fr) 24px minmax(240px, .8fr); gap: 12px; align-items: center; margin-top: 14px; }
.rule-flow > div { min-height: 76px; padding: 12px 14px; border-radius: 9px; background: #f7f9fb; }
.rule-flow > div:last-child { background: #f0f8f5; }
.rule-flow span { color: var(--slate-500); font-size: .65rem; font-weight: 800; }
.rule-flow p { margin: 5px 0 0; color: var(--slate-700); font-size: .78rem; line-height: 1.55; }
.rule-flow b { color: #7aa4be; text-align: center; }
.rule-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; color: #8b96a6; font-size: .68rem; }
.rule-meta a { font-weight: 750; }
.rule-history { margin-top: 11px; border-top: 1px dashed #d8e0e7; padding-top: 10px; }
.rule-history summary, .technical-details > summary { color: var(--blue-700); cursor: pointer; font-size: .72rem; font-weight: 750; }
.rule-history > div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rule-history a, .version-links a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #e1e7ed; border-radius: 8px; color: var(--slate-700); background: #fafbfd; font-size: .7rem; }
.rule-history small, .version-links small { color: #98a2b3; font-size: .62rem; }
.rule-explanation-grid .card { border-top: 3px solid #d9e7f1; }
.condition-group { margin-top: 17px; }
.condition-group > strong { color: #315d7b; font-size: .72rem; }
.condition-group ul, .action-list { margin: 9px 0 0; padding-left: 20px; color: var(--slate-700); font-size: .82rem; line-height: 1.75; }
.action-list li::marker { color: var(--green-600); }
.rule-status-box { display: flex; align-items: center; gap: 12px; margin-top: 21px; padding: 13px; border-radius: 9px; background: #f7f9fb; }
.rule-status-box small { color: var(--slate-500); }
.technical-details { padding: 17px 22px; }
.technical-details[open] > summary { margin-bottom: 18px; }
.technical-meta { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 15px; }
.technical-meta span { padding: 6px 9px; border-radius: 7px; color: var(--slate-500); background: var(--slate-100); font: .68rem/1.4 ui-monospace, monospace; }
.technical-details h3 { color: var(--navy-900); font-size: .8rem; }
.technical-details pre { max-height: 360px; margin: 0; overflow: auto; padding: 14px; border-radius: 9px; color: #405266; background: #f7f9fb; font-size: .68rem; }
.version-links { display: flex; flex-wrap: wrap; gap: 9px; }

.rule-help { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-bottom: 22px; overflow: hidden; border: 1px solid #cbd9e6; border-radius: 13px; background: #dbe4ec; box-shadow: var(--shadow-sm); }
.rule-help > div { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 11px; padding: 16px 18px; background: white; }
.rule-help > div > span { grid-row: 1 / 3; width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: #176b5e; background: #e4f5f1; font-size: .72rem; font-weight: 900; }
.rule-help strong { color: var(--navy-900); font-size: .82rem; }
.rule-help small { margin-top: 4px; color: var(--slate-500); font-size: .69rem; line-height: 1.45; }
.business-rule-list { display: grid; gap: 12px; }
.business-rule { display: grid; grid-template-columns: 76px minmax(0, 1fr) 145px; gap: 18px; align-items: start; padding: 18px; border: 1px solid var(--slate-200); border-radius: 12px; background: #fcfdff; }
.business-rule:hover { border-color: #bfd0df; background: white; box-shadow: var(--shadow-sm); }
.rule-title-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rule-title-line h3 { margin: 0; color: var(--navy-950); font-size: 1rem; }
.rule-business-copy .rule-flow { margin-top: 13px; }
.rule-example { margin: 11px 0 0; padding: 9px 11px; border-left: 3px solid #5aa899; color: var(--slate-600); background: #f2f8f6; font-size: .72rem; line-height: 1.55; }
.rule-example strong { margin-right: 7px; color: #176b5e; }
.rule-example-card { border-left: 3px solid #5aa899; }
.rule-example-card p:last-child { margin-bottom: 0; color: var(--slate-700); line-height: 1.7; }
.decision-form { margin-top: 20px; }
.review-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-bottom: 20px; overflow: hidden; border: 1px solid #d8e0e8; border-radius: 8px; background: #d8e0e8; box-shadow: var(--shadow-sm); }
.review-summary-item { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 19px; border-top: 3px solid #98a2b3; background: white; }
.review-summary-item > div { display: grid; gap: 5px; }
.review-summary-item span { color: var(--navy-900); font-size: .82rem; font-weight: 800; }
.review-summary-item small { color: var(--slate-500); font-size: .68rem; }
.review-summary-item strong { color: var(--navy-950); font-size: 1.7rem; line-height: 1; font-variant-numeric: tabular-nums; }
.review-summary-open { border-top-color: #d88b18; background: #fffaf0; }
.review-summary-open strong { color: #9a5b08; }
.review-summary-kept { border-top-color: #8793a5; background: #f8fafc; }
.review-summary-resolved { border-top-color: var(--green-600); background: #f3faf6; }
.review-summary-resolved strong { color: var(--green-600); }
.pending-review-section { margin-bottom: 20px; }
.pending-review-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 11px; }
.pending-review-header .eyebrow { margin-bottom: 4px; }
.pending-review-header h2 { margin: 0; color: var(--navy-950); font-size: 1.12rem; }
.pending-review-header > span { min-width: 48px; padding: 6px 10px; border-radius: 999px; color: #8a5509; background: #ffedc7; text-align: center; font-size: .72rem; font-weight: 800; }
.pending-review-list { display: grid; gap: 10px; }
.pending-review-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 18px 18px 18px 22px; border: 1px solid #e7c98f; border-left: 5px solid #d88b18; border-radius: 8px; background: #fffaf0; box-shadow: var(--shadow-sm); }
.pending-review-content { min-width: 0; }
.pending-review-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 9px; }
.pending-review-meta time { color: var(--slate-500); font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pending-review-meta strong { color: #8a5509; font-size: .82rem; font-variant-numeric: tabular-nums; }
.pending-review-item h3 { margin: 0; overflow-wrap: anywhere; color: var(--navy-900); font-size: .9rem; line-height: 1.5; }
.pending-review-item p { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; margin: 8px 0 0; color: var(--slate-600); font-size: .74rem; line-height: 1.55; }
.pending-review-item p span { color: #8a5509; font-weight: 800; white-space: nowrap; }
.pending-review-action { min-width: 94px; min-height: 40px; border-radius: 7px; }
.pending-review-empty { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border: 1px solid #c7e2d4; border-radius: 8px; color: #14643f; background: #f1faf5; }
.pending-review-empty span { color: #5d7468; font-size: .74rem; }
.review-card { padding-bottom: 14px; }
.review-card .card-title { margin-bottom: 18px; }
.review-card .eyebrow { margin-bottom: 4px; }
.review-table-wrap { margin: 0 -9px -3px; }
.review-table { min-width: 1180px; table-layout: fixed; }
.review-table th { white-space: nowrap; }
.review-table th:nth-child(1) { width: 92px; }
.review-table th:nth-child(2) { width: 72px; }
.review-table th:nth-child(3) { width: 98px; }
.review-table th:nth-child(4) { width: 240px; }
.review-table th:nth-child(5) { width: 260px; }
.review-table th:nth-child(6) { width: 112px; }
.review-table th:nth-child(7) { width: 100px; }
.review-table th:nth-child(8) { width: 214px; }
.review-table th:nth-child(9) { width: 92px; }
.review-row td { padding-top: 16px; padding-bottom: 16px; vertical-align: top; transition: background .12s ease; }
.review-row-open td { border-bottom-color: #eed9ac; background: #fffbf1; }
.review-row-open td:first-child { box-shadow: inset 4px 0 #d88b18; }
.review-row-open:hover td { background: #fff6df; }
.review-row-kept td { background: #fafbfc; }
.review-row-kept td:first-child { box-shadow: inset 4px 0 #8793a5; }
.review-row-resolved td:first-child { box-shadow: inset 3px 0 #67a98b; }
.review-date, .review-amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.review-date { color: var(--slate-700); font-weight: 700; }
.review-amount { color: var(--navy-900); text-align: right; font-weight: 800; }
.review-text { overflow-wrap: anywhere; line-height: 1.55; }
.review-item { color: var(--navy-900); }
.review-reason { color: #5d6675; }
.review-note { color: var(--slate-700); }
.review-category { color: var(--navy-900); font-weight: 750; }
.review-direction, .review-status, .review-type { display: inline-flex; align-items: center; width: fit-content; white-space: nowrap; border-radius: 999px; font-size: .68rem; font-weight: 800; }
.review-direction { padding: 4px 8px; color: #475467; background: #f2f4f7; }
.review-direction-debit { color: #99251b; background: #fff0ee; }
.review-direction-credit { color: #176b5e; background: #eaf8f4; }
.review-type { margin-right: 7px; padding: 4px 8px; vertical-align: middle; }
.review-type-tax { border: 1px solid #e8bd72; color: #874f07; background: #fff0cd; }
.review-status { gap: 6px; padding: 5px 9px; }
.review-status::before { content: ""; width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.review-status-open { color: #995b08; background: #ffedc7; }
.review-status-kept { color: #5f6b7b; background: #edf0f4; }
.review-status-resolved { color: #14643f; background: #e7f6ee; }
.review-action { text-align: right; white-space: nowrap; }
.review-table th:last-child, .review-table td:last-child { position: sticky; right: 0; z-index: 2; background: white; box-shadow: -8px 0 12px -12px rgb(16 24 40 / 45%); }
.review-table thead th:last-child { z-index: 3; }
.review-row-kept td:last-child { background: #fafbfc; }
.review-action .button { min-width: 78px; min-height: 35px; padding: 8px 10px; border-radius: 7px; font-size: .7rem; }
.button-attention { color: white; background: #b66a0a; box-shadow: 0 4px 12px rgb(182 106 10 / 20%); }
.button-attention:hover { color: white; background: #965608; }
.review-report-link { display: inline-flex; padding: 8px 4px; font-size: .72rem; font-weight: 750; }
.rule-links { display: grid; justify-items: end; gap: 12px; font-size: .72rem; }
.rule-links > a { font-weight: 800; }
.rule-links .rule-history { width: 100%; }
.rule-links .rule-history ul { margin: 7px 0 0; padding: 8px; border-radius: 8px; background: var(--slate-100); list-style: none; }
.rule-links .rule-history li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 2px; }
.rule-links .rule-history li span, .rule-no-history { color: #98a2b3; font-size: .64rem; }
.rule-toggle-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.history-notice { display: grid; gap: 6px; padding: 12px 15px; border: 1px solid #f0d39d; border-radius: 10px; color: #7b4c08; background: #fff8e9; font-size: .78rem; }
.result-card { border-top-color: var(--green-600) !important; }
.result-list { margin: 9px 0 0; padding-left: 20px; color: var(--slate-700); font-size: .82rem; line-height: 1.75; }
.result-list li::marker { color: var(--green-600); }
.fail-closed-note { margin: 17px 0 0; padding: 12px 14px; border-radius: 9px; color: #73541f; background: #fff7e7; font-size: .75rem; line-height: 1.55; }
.rule-version-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; }
.rule-version-facts > div { padding: 12px 13px; border-radius: 9px; background: #f7f9fb; }
.rule-version-facts dt { margin: 0; font-size: .67rem; }
.rule-version-facts dd { color: var(--navy-900); font-size: .8rem; }
.version-browser { margin-top: 14px; }
.version-browser summary { cursor: pointer; color: var(--blue-700); font-size: .7rem; font-weight: 750; }
.version-browser > div { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.version-browser a { padding: 6px 9px; border-radius: 7px; background: var(--slate-100); font-size: .7rem; }
.version-browser .current-version-link { color: #14643f; background: #eaf8f1; }

.audit-hero { margin-bottom: 18px; }
.audit-guide { margin-top: 0; margin-bottom: 20px; }
.audit-table { min-width: 980px; }
.audit-table th { white-space: nowrap; }
.audit-table td { vertical-align: top; }
.audit-table td > strong { color: var(--navy-900); }
.audit-time { white-space: nowrap; color: var(--slate-500); font-variant-numeric: tabular-nums; }
.audit-result { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.audit-result-success { color: #14643f; background: #eaf8f1; }
.audit-result-failed { color: #99251b; background: #fff0ee; }
.audit-result-neutral { color: #475467; background: #f2f4f7; }
.audit-explanation { min-width: 245px; }
.audit-explanation ul { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.audit-explanation li { display: grid; grid-template-columns: minmax(85px, auto) 1fr; gap: 8px; color: var(--slate-500); font-size: .68rem; }
.audit-explanation li strong { color: var(--slate-700); overflow-wrap: anywhere; text-align: right; }
.audit-technical { margin-top: 9px; }
.audit-technical summary { color: var(--blue-700); cursor: pointer; font-size: .66rem; font-weight: 700; }
.audit-technical p { margin: 8px 0; color: var(--slate-500); font-size: .64rem; line-height: 1.5; }
.audit-technical pre { max-height: 180px; margin: 0; overflow: auto; padding: 9px; border-radius: 7px; color: #526276; background: #f7f9fb; font-size: .62rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 13px; color: var(--slate-500); font-size: .75rem; }

@media (max-width: 760px) {
  .report-change-banner { grid-template-columns: auto 1fr; }
  .report-change-banner > .status-badge { grid-column: 1 / -1; width: fit-content; }
  .report-version-meta { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-strip { grid-template-columns: 1fr; }
  .upload-grid { grid-template-columns: 1fr; }
  .upload-field { min-height: 0; }
  .detail-grid { grid-template-columns: 1fr; }
  .account-name { display: none; }
  .rule-guide { grid-template-columns: 1fr; }
  .rule-help { grid-template-columns: 1fr; }
  .rule-flow { grid-template-columns: 1fr; }
  .rule-flow b { transform: rotate(90deg); }
}

@media (max-width: 760px) {
  .header-inner { width: min(100% - 24px, 1180px); gap: 16px; }
  .brand-copy { display: none; }
  .main-nav { gap: 0; overflow-x: auto; }
  .main-nav a { padding: 9px; font-size: .75rem; white-space: nowrap; }
  .account-avatar { display: none; }
  .container { width: min(100% - 24px, 1180px); margin-top: 25px; }
  .page-hero { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid, .grid.two { grid-template-columns: 1fr; }
  .workflow-steps { grid-template-columns: 1fr; }
  .workflow-steps li { border-left: 0; border-top: 1px solid rgb(255 255 255 / 12%); }
  .form-section { grid-template-columns: 1fr; }
  .section-number { width: 36px; height: 36px; }
  .recovery-alert { grid-template-columns: auto 1fr; }
  .recovery-alert .button { grid-column: 1 / -1; }
  .site-footer { width: min(100% - 24px, 1180px); }
  .rule-metrics { grid-template-columns: 1fr; }
  .rule-item { grid-template-columns: 1fr; }
  .rule-order { width: 44px; height: 44px; }
  .rule-heading { align-items: flex-start; }
  .rule-meta { flex-direction: column; }
  .business-rule { grid-template-columns: 52px 1fr; }
  .rule-links { grid-column: 2; justify-items: start; }
  .rule-version-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-summary { grid-template-columns: 1fr; }
  .review-summary-item { min-height: 76px; }
  .pending-review-item { grid-template-columns: 1fr; gap: 14px; }
  .pending-review-action { width: 100%; }
}

@media (max-width: 480px) {
  .metric-grid { grid-template-columns: 1fr; }
  .account-menu { display: none; }
  .page-hero h1 { font-size: 2rem; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .site-footer { display: grid; gap: 6px; }
  .business-rule { grid-template-columns: 1fr; }
  .rule-links { grid-column: 1; }
  .rule-version-facts { grid-template-columns: 1fr; }
}
