:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #dfe3eb;
  --line-strong: #c7ceda;
  --surface: #ffffff;
  --surface-soft: #f5f7fa;
  --canvas: #eef1f5;
  --navy: #162b4d;
  --navy-2: #23446f;
  --orange: #d86d32;
  --orange-soft: #fff1e8;
  --blue-soft: #eaf2ff;
  --green: #1f7a55;
  --red: #b94040;
  --shadow: 0 16px 42px rgba(30, 45, 70, 0.09);
  --radius: 16px;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 5% 0%, rgba(216, 109, 50, 0.09), transparent 25rem),
    var(--canvas);
  color: var(--ink);
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }

.app-shell { min-height: 100vh; }

.topbar {
  min-height: 76px;
  padding: 12px clamp(20px, 4vw, 64px);
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 3px solid var(--orange);
}

.brand {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: .02em; }
.brand small { margin-top: 2px; color: #b9c6d9; font-size: 12px; }

.internal-badge {
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  color: #c7d1df;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
}

.topbar-nav { display: flex; align-items: center; gap: 8px; }
.topbar-nav a {
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #c7d1df;
  text-decoration: none;
  font-size: 12px;
  font-weight: 750;
}
.topbar-nav a:hover, .topbar-nav a.is-active { border-color: rgba(255,255,255,.28); color: #fff; background: rgba(255,255,255,.08); }

main { padding: 38px clamp(18px, 4vw, 64px) 64px; }

.hero {
  max-width: 1500px;
  margin: 0 auto 24px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}
.eyebrow, .step-label {
  margin: 0 0 7px;
  color: var(--orange);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
}
.hero h1 { margin: 0; font-size: clamp(30px, 4vw, 46px); line-height: 1.1; letter-spacing: -.025em; }
.hero-copy { max-width: 640px; margin: 12px 0 0; color: var(--muted); font-size: 16px; }
.hero-note {
  min-width: 230px;
  padding: 14px 18px;
  border-left: 3px solid var(--orange);
  background: rgba(255,255,255,.58);
}
.hero-note span, .hero-note small { display: block; color: var(--muted); font-size: 11px; }
.hero-note strong { display: block; margin: 3px 0; font-size: 13px; }

.workspace-grid {
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(420px, .76fr) minmax(560px, 1.24fr);
  align-items: start;
  gap: 22px;
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(206, 213, 224, .9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.control-panel { padding: 24px; }
.result-panel { min-height: 690px; padding: 24px 0 0; overflow: hidden; }
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.result-heading { padding: 0 24px; }
.panel-heading h2 { margin: 0; font-size: 21px; }

.text-button, .mini-button {
  border: 0;
  background: transparent;
  color: var(--navy-2);
  font-weight: 700;
}
.text-button { padding: 6px 0; font-size: 12px; border-bottom: 1px solid var(--line-strong); }
.mini-button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.mini-button:hover:not(:disabled), .text-button:hover { color: var(--orange); }

fieldset { padding: 0 0 22px; margin: 0 0 22px; border: 0; border-bottom: 1px solid var(--line); }
fieldset:last-of-type { margin-bottom: 0; }
legend { padding: 0; font-weight: 750; font-size: 14px; }
legend > span { display: inline-grid; place-items: center; width: 26px; height: 22px; margin-right: 8px; border-radius: 7px; background: var(--navy); color: white; font-size: 10px; }
.legend-row { display: flex; align-items: center; justify-content: space-between; }
.field-help { margin: 7px 0 13px; color: var(--muted); font-size: 12px; }

.field-grid, .filter-row, .export-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.full-row { grid-column: 1 / -1; }
label > span { display: block; margin-bottom: 6px; color: #475467; font-size: 12px; font-weight: 650; }

select, input[type="text"], input[type="date"] {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  outline: none;
}
select:focus, input:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(35,68,111,.1); }

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--navy-2);
  font-family: Consolas, monospace;
}

.template-file {
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-soft);
}
.template-file input { width: 100%; color: var(--ink); }
.template-file input::file-selector-button {
  margin-right: 10px;
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--navy-2);
  font-weight: 700;
  cursor: pointer;
}
.template-file small { display: block; margin-top: 8px; color: var(--muted); }

.export-option {
  min-height: 62px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
}
.export-option input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--orange); }
.export-option > span { margin: 0; }
.export-option strong { display: block; color: var(--ink); font-size: 13px; }
.export-option small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }

.metric-list { display: grid; gap: 9px; }
.metric-row { display: grid; grid-template-columns: 1fr 112px 34px; gap: 8px; align-items: center; }
.metric-row .remove-metric { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--muted); font-size: 19px; line-height: 1; }
.metric-row .remove-metric:hover:not(:disabled) { border-color: #e8b2b2; color: var(--red); background: #fff3f3; }

.period-card { padding: 14px; border: 1px solid var(--line); border-radius: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.period-a { background: var(--blue-soft); }
.period-b { background: var(--orange-soft); }
.period-title { grid-column: 1 / -1; font-size: 12px; font-weight: 750; }
.period-title span { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 6px; border-radius: 50%; background: var(--navy-2); color: #fff; }
.period-b .period-title span { background: var(--orange); }

.filter-row { grid-template-columns: 1fr 150px 1fr; }
.relation-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-actions { display: flex; align-items: end; justify-content: space-between; gap: 14px; padding-top: 22px; }
.limit-field { width: 130px; }

.button { height: 40px; padding: 0 16px; border-radius: 9px; font-weight: 750; border: 1px solid transparent; }
.button-primary { min-width: 160px; color: #fff; background: var(--orange); box-shadow: 0 8px 18px rgba(216,109,50,.22); }
.button-primary:hover:not(:disabled) { background: #c75f28; }
.button-secondary { color: var(--navy); background: #fff; border-color: var(--line-strong); }

.button-loader { display: none; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.dark-loader { border-color: rgba(22,43,77,.25); border-top-color: var(--navy); }
.button.is-loading .button-label { display: none; }
.button.is-loading .button-loader { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { min-height: 560px; padding: 80px 24px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.empty-state h3 { color: var(--ink); margin: 22px 0 5px; font-size: 17px; }
.empty-state p { max-width: 390px; margin: 0; font-size: 13px; }
.empty-chart { height: 86px; width: 132px; display: flex; align-items: end; justify-content: center; gap: 9px; border-bottom: 1px solid var(--line-strong); }
.empty-chart i { display: block; width: 18px; border-radius: 5px 5px 0 0; background: #d7dde6; }
.empty-chart i:nth-child(1) { height: 30%; }
.empty-chart i:nth-child(2) { height: 68%; background: #93a8c5; }
.empty-chart i:nth-child(3) { height: 48%; }
.empty-chart i:nth-child(4) { height: 85%; background: #e1a07d; }

.summary-cards { padding: 0 24px 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.summary-card { padding: 13px 14px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 11px; }
.summary-card span { display: block; color: var(--muted); font-size: 11px; }
.summary-card strong { display: block; margin-top: 5px; font-size: 20px; }
.summary-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.summary-card.positive strong { color: var(--green); }
.summary-card.negative strong { color: var(--red); }

.table-wrap { overflow: auto; max-height: 570px; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; white-space: nowrap; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: right; }
th { position: sticky; top: 0; z-index: 2; background: #f7f8fa; color: #475467; font-size: 11px; font-weight: 750; }
th:first-child, td:first-child, th.dimension, td.dimension { text-align: left; }
tbody tr:hover td { background: #fbfcfe; }
td.delta-positive { color: var(--green); font-weight: 700; }
td.delta-negative { color: var(--red); font-weight: 700; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 420px;
  padding: 13px 16px;
  border-radius: 10px;
  background: #1d2939;
  color: #fff;
  box-shadow: 0 14px 30px rgba(0,0,0,.22);
  font-size: 13px;
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}
.toast.is-visible { transform: translateY(0); opacity: 1; }
.toast.is-error { background: #8f2f2f; }

.material-hero { align-items: center; }
.material-workspace {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(340px, .8fr) minmax(460px, 1.2fr);
  gap: 22px;
  align-items: start;
}
.material-form, .material-guide { padding: 24px; }
.upload-card {
  position: relative;
  display: block;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-soft);
}
.upload-card strong, .upload-card small { display: block; margin-left: 42px; }
.upload-card strong { color: var(--ink); font-size: 14px; }
.upload-card small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.upload-step {
  position: absolute;
  left: 18px;
  top: 18px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}
.upload-card input { width: 100%; margin-top: 18px; }
.upload-card input::file-selector-button {
  margin-right: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--navy-2);
  font-weight: 700;
}
.file-status { display: block; margin-top: 10px; color: var(--navy-2); font-size: 11px; font-weight: 700; overflow-wrap: anywhere; }
.material-field { display: block; margin-top: 18px; }
.material-field > span { margin-bottom: 8px; color: var(--ink); font-size: 13px; }
.material-field > span b { display: inline-grid; place-items: center; width: 28px; height: 24px; margin-right: 8px; border-radius: 8px; background: var(--navy); color: #fff; font-size: 10px; }
.material-field small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.material-submit { width: 100%; margin-top: 22px; }
.rule-list { display: grid; gap: 16px; }
.rule-list article { display: grid; grid-template-columns: 34px 1fr; gap: 12px; }
.rule-list article > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--orange-soft); color: var(--orange); font-size: 12px; font-weight: 800; }
.rule-list strong { display: block; font-size: 13px; }
.rule-list p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.material-example { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--navy); }
.material-example > div { min-height: 150px; padding: 10px; display: flex; flex-direction: column; border-right: 2px solid var(--navy); }
.material-example > div:last-child { border-right: 0; }
.material-example b { padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 10px; }
.material-example span { margin: auto; color: var(--muted); font-size: 11px; }

.qc-page { max-width: 1640px; margin: 0 auto; }
.qc-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.qc-heading h1 { margin: 0; font-size: clamp(28px, 3vw, 40px); letter-spacing: -.025em; }
.qc-heading > div > p:last-child { max-width: 720px; margin: 10px 0 0; color: var(--muted); }
.qc-steps { display: flex; align-items: center; gap: 22px; margin: 0; padding: 0; list-style: none; }
.qc-steps li { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.qc-steps b { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; font-size: 10px; }

.qc-upload-panel { display: grid; grid-template-columns: 1fr minmax(260px, .7fr) auto; align-items: center; gap: 18px; padding: 18px 20px; }
.qc-upload-copy h2 { margin: 0; font-size: 18px; }
.qc-upload-copy p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.qc-upload-actions { display: grid; gap: 7px; }
.qc-upload-actions .button { width: 100%; }
.qc-drop { position: relative; min-height: 66px; padding: 12px 16px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface-soft); display: grid; align-content: center; }
.qc-drop.is-dragging { border-color: var(--navy-2); background: var(--blue-soft); box-shadow: 0 0 0 3px rgba(54, 98, 153, .12); }
.qc-drop strong, .qc-drop span { display: block; margin: 0; }
.qc-drop strong { color: var(--navy); font-size: 13px; }
.qc-drop span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.qc-drop input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }

.qc-file-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 9px; margin: 11px 0; }
.qc-file-card { min-width: 0; padding: 10px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 320px) auto; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.82); }
.qc-file-card.is-active { border-color: #91a8c7; background: var(--blue-soft); }
.qc-file-card > div, .qc-file-main { min-width: 0; }
.qc-file-card strong, .qc-file-card span { display: block; }
.qc-file-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.qc-file-card span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.qc-file-card > button:last-child { padding: 4px 0; border: 0; background: transparent; color: var(--red); font-size: 11px; }
.qc-file-main { padding: 0; border: 0; background: transparent; text-align: left; }
.qc-file-card label { min-width: 0; }
.qc-file-fields { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 7px; }
.qc-file-card label span { margin: 0 0 3px; font-size: 9px; }
.qc-file-card input { height: 32px; padding: 0 8px; font-size: 11px; }
.qc-file-style { padding: 5px 7px; border-radius: 6px; background: var(--surface-soft); text-align: center; }

.qc-validation { margin: 10px 0; padding: 10px 13px; border: 1px solid #e8c98f; border-radius: 9px; background: #fff9e8; color: #725116; font-size: 12px; }
.qc-validation.has-error { border-color: #e7aaaa; background: #fff0f0; color: #8f2f2f; }
.qc-validation span { display: block; }
.qc-validation span + span { margin-top: 4px; }

.qc-workspace { display: grid; grid-template-columns: 190px minmax(520px, 1fr) 330px; gap: 14px; align-items: start; }
.qc-style-sidebar, .qc-material-panel, .qc-preview-panel { min-width: 0; }
.qc-style-sidebar { padding: 14px 11px; }
.qc-panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.qc-panel-title > span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.qc-panel-title b { min-width: 24px; padding: 3px 6px; border-radius: 999px; background: var(--surface-soft); color: var(--navy); text-align: center; font-size: 11px; }
.qc-panel-title em { color: var(--green); font-size: 10px; font-style: normal; }
.qc-style-list { display: grid; gap: 4px; }
.qc-style-list button { width: 100%; padding: 9px; border: 0; border-radius: 8px; background: transparent; text-align: left; }
.qc-style-list button[aria-selected="true"] { background: var(--blue-soft); }
.qc-style-list strong, .qc-style-list span { display: block; }
.qc-style-list strong { font-size: 12px; }
.qc-style-list span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.qc-sidebar-note { margin-top: 16px; padding: 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.qc-sidebar-note strong, .qc-sidebar-note span { display: block; }
.qc-sidebar-note strong { margin-bottom: 6px; color: var(--ink); font-size: 11px; }
.qc-sidebar-note span + span { margin-top: 4px; }

.qc-material-panel { padding: 16px; overflow: hidden; }
.qc-material-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.qc-material-head h2 { margin: 0; font-size: 19px; }
.qc-head-actions { display: flex; gap: 7px; }
.button-small { height: 33px; min-width: 0; padding: 0 10px; font-size: 11px; }
.qc-product-tabs { margin-top: 12px; display: flex; gap: 16px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.qc-product-tabs button { padding: 9px 1px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 11px; white-space: nowrap; }
.qc-product-tabs button[aria-selected="true"] { border-bottom-color: var(--orange); color: var(--ink); font-weight: 750; }
.qc-product-tabs span { display: inline; margin-left: 3px; padding: 2px 5px; border-radius: 999px; background: var(--surface-soft); font-size: 9px; }
.qc-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 12px 0 9px; }
.qc-search { position: relative; flex: 1 1 180px; }
.qc-search > span { position: absolute; left: 10px; top: 10px; margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; }
.qc-search input { width: 100%; height: 34px; padding: 0 10px 0 48px; border: 1px solid var(--line-strong); border-radius: 8px; }
.qc-check { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.qc-check input { accent-color: var(--orange); }
.qc-table-wrap { overflow: auto; max-height: 580px; border: 1px solid var(--line); border-radius: 9px; }
.qc-table { min-width: 720px; white-space: normal; }
.qc-table th, .qc-table td { padding: 9px; text-align: left; vertical-align: middle; }
.qc-table th:first-child, .qc-table td:first-child { width: 34px; text-align: center; }
.qc-table td strong, .qc-table td > span { display: block; }
.qc-table td strong { font-size: 11px; }
.qc-table td > span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.qc-table tr.is-muted td:not(:first-child) { opacity: .48; }
.qc-colors { display: flex; flex-wrap: wrap; gap: 4px; }
.qc-color-chip { padding: 3px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); color: var(--ink); font-size: 9px; }
.qc-color-chip.is-missing { border-color: #e8c98f; background: #fff9e8; color: #725116; }
.qc-rule { display: inline-block; padding: 4px 6px; border-radius: 999px; background: #eaf8f1; color: var(--green); font-size: 9px; white-space: nowrap; }
.qc-rule.is-locked { background: var(--blue-soft); color: var(--navy-2); }
.qc-plm-status { display: block; width: max-content; margin-bottom: 4px; padding: 3px 6px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: 9px; }
.qc-plm-status.is-ok { background: #eaf8f1; color: var(--green); }
.qc-plm-status.is-warning { background: #fff9e8; color: #725116; }
.qc-link-button { margin-left: 4px; padding: 3px; border: 0; background: transparent; color: var(--navy-2); font-size: 9px; }
.qc-empty { padding: 30px !important; color: var(--muted); text-align: center !important; }

.qc-preview-panel { padding: 14px; }
.qc-summary { display: grid; grid-template-columns: repeat(4, 1fr); padding: 9px; border-radius: 9px; background: var(--surface-soft); text-align: center; }
.qc-summary b, .qc-summary span { display: block; }
.qc-summary b { font-size: 16px; }
.qc-summary span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.qc-sheet-tabs { display: flex; gap: 5px; margin: 10px 0 7px; overflow-x: auto; }
.qc-sheet-tabs button { padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); color: var(--muted); font-size: 9px; white-space: nowrap; }
.qc-sheet-tabs button[aria-selected="true"] { border-color: #91a8c7; background: var(--blue-soft); color: var(--navy); }
.qc-paper { padding: 8px; border: 1px solid #aab2bf; background: #fff; color: #1d2939; }
.qc-paper > header { padding: 4px 2px 7px; border-bottom: 2px solid #263b58; text-align: center; font-size: 9px; }
.qc-paper > header span { display: block; margin-top: 2px; font-size: 8px; font-weight: 400; }
.qc-paper-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 7px; }
.qc-paper-grid article { min-height: 112px; border: 1px solid #9ca5b3; }
.qc-paper-grid article header { padding: 4px; border-bottom: 1px solid #9ca5b3; background: #edf0f4; font-size: 8px; font-weight: 700; }
.qc-paper-grid article p { margin: 0; padding: 3px 4px 0; font-size: 7px; }
.qc-paper-grid article div { padding: 2px 4px 4px; }
.qc-paper-grid article div span { display: block; height: 8px; border-bottom: 1px solid #d0d4da; }
.qc-paper-grid article.is-empty { background: #fff; }
.qc-paper-empty { grid-column: 1 / -1; padding: 30px 8px; color: #667085; text-align: center; font-size: 10px; }
.qc-output-setting { margin-top: 11px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qc-output-setting > span { margin: 0; font-size: 11px; }
.qc-output-setting select { width: 82px; height: 34px; font-size: 11px; }
.qc-generate { width: 100%; margin-top: 11px; }
.qc-batch-summary { display: block; margin-top: 7px; color: var(--navy-2); text-align: center; font-size: 10px; font-weight: 700; }
.qc-output-note { display: block; margin-top: 6px; color: var(--muted); text-align: center; font-size: 9px; }

@media (max-width: 1240px) {
  .qc-workspace { grid-template-columns: 180px minmax(500px, 1fr); }
  .qc-preview-panel { grid-column: 1 / -1; }
  .qc-paper { max-width: 540px; margin: 0 auto; }
}

@media (max-width: 860px) {
  .qc-heading { align-items: flex-start; flex-direction: column; }
  .qc-upload-panel { grid-template-columns: 1fr; }
  .qc-workspace { grid-template-columns: 1fr; }
  .qc-preview-panel { grid-column: auto; }
  .qc-file-card { grid-template-columns: minmax(0, 1fr) minmax(220px, 300px) auto; }
}

@media (max-width: 600px) {
  .qc-steps { gap: 10px; }
  .qc-steps span { display: none; }
  .qc-file-card { grid-template-columns: 1fr auto; }
  .qc-file-fields { grid-column: 1 / -1; grid-row: 2; grid-template-columns: 1fr; }
  .qc-material-head { display: block; }
  .qc-head-actions { margin-top: 9px; flex-wrap: wrap; }
  .qc-paper-grid { grid-template-columns: 1fr; }
}

[hidden] { display: none !important; }

@media (max-width: 1120px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .material-workspace { grid-template-columns: 1fr; }
  .result-panel { min-height: 540px; }
  .empty-state { min-height: 400px; }
}

@media (max-width: 760px) {
  .topbar, .hero { align-items: flex-start; flex-direction: column; }
  .topbar { padding: 16px 18px; }
  .internal-badge { align-self: flex-start; }
  .topbar-nav { width: 100%; }
  main { padding: 26px 14px 46px; }
  .hero-note { width: 100%; }
  .control-panel { padding: 19px; }
  .three-columns, .field-grid, .filter-row, .export-grid { grid-template-columns: 1fr; }
  .period-card { grid-template-columns: 1fr 1fr; }
  .full-row { grid-column: auto; }
  .summary-cards { grid-template-columns: 1fr; }
  .result-heading { align-items: flex-start; }
}

@media (max-width: 460px) {
  .period-card { grid-template-columns: 1fr; }
  .period-title { grid-column: auto; }
  .metric-row { grid-template-columns: 1fr 90px 34px; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .limit-field, .button-primary { width: 100%; }
}
