/* =========================================================
   质鉴 · 质量智能管理平台 — 应用壳 / 多视图
   在原有检测实验室视觉之上增加固定侧栏与四视图
   ========================================================= */
:root {
  --shell-nav: #0e2634;
  --shell-nav-2: #0a1b26;
  --shell-yellow: #f2b705;
  --shell-cyan: #12a8b8;
  --shell-side: 220px;
}
body { overflow-x: hidden; }
.app-shell { min-height: 100vh; position: relative; z-index: 2; }

.shell-sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--shell-side); z-index: 120;
  display: flex; flex-direction: column; color: #eaf2f4;
  background:
    radial-gradient(circle at 0 0, rgba(242,183,5,.1), transparent 32%),
    linear-gradient(180deg, #123247, var(--shell-nav-2) 76%);
  border-right: 1px solid rgba(242,183,5,.18);
}
.shell-sidebar::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .4;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 22px 22px;
}
.shell-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 21px 18px 15px; }
.shell-mark { width: 36px; height: 36px; display: grid; place-items: center; background: var(--shell-yellow); color: #12222e; font-family: var(--sans); font-size: 19px; font-weight: 800; box-shadow: 4px 4px 0 rgba(242,183,5,.18); }
.shell-brand strong { display: block; font-family: var(--sans); font-size: 20px; letter-spacing: 4px; line-height: 1.1; }
.shell-brand small { display: block; font-family: var(--mono); font-size: 6.5px; color: rgba(234,242,244,.38); letter-spacing: .8px; margin-top: 3px; }
.shell-entity { position: relative; z-index: 1; margin: 0 15px 17px; padding: 9px 10px; border: 1px solid rgba(242,183,5,.16); background: rgba(242,183,5,.035); }
.shell-entity span { display: block; font-size: 9px; color: rgba(234,242,244,.72); }
.shell-entity b { display: block; font-family: var(--mono); font-size: 6.5px; font-weight: 400; color: rgba(234,242,244,.38); margin-top: 2px; }
.shell-nav { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2px; padding: 0 9px; }
.shell-nav button { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 9px; text-align: left; padding: 11px 10px; color: rgba(234,242,244,.58); border-left: 2px solid transparent; transition: .2s; }
.shell-nav button span { font-family: var(--mono); font-size: 7px; color: rgba(234,242,244,.3); }
.shell-nav button b { font-size: 12px; font-weight: 400; letter-spacing: .4px; }
.shell-nav button i { font-family: var(--mono); font-style: normal; font-size: 5.5px; color: rgba(234,242,244,.18); letter-spacing: .4px; }
.shell-nav button:hover { color: #fff; background: rgba(255,255,255,.04); }
.shell-nav button.active { color: var(--shell-yellow); border-left-color: var(--shell-yellow); background: linear-gradient(90deg, rgba(242,183,5,.12), transparent); }
.shell-nav button.active span { color: var(--shell-yellow); }
.shell-nav button.active i { color: rgba(242,183,5,.5); }
.shell-bottom { position: relative; z-index: 1; margin-top: auto; padding: 15px 13px 17px; }
.shell-ai { width: 100%; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; text-align: left; padding: 9px; border: 1px solid rgba(242,183,5,.24); background: rgba(242,183,5,.05); color: var(--shell-yellow); }
.shell-ai > span:first-child { font-size: 14px; }
.shell-ai b { display: block; font-size: 9px; font-weight: 400; color: #eaf2f4; }
.shell-ai small { display: block; font-size: 6px; color: rgba(234,242,244,.35); margin-top: 1px; }
.shell-ai em { font-style: normal; font-size: 12px; color: var(--shell-yellow); }
.shell-user { display: grid; grid-template-columns: 28px 1fr 8px; align-items: center; gap: 8px; margin-top: 13px; padding-top: 13px; border-top: 1px solid rgba(242,183,5,.13); }
.shell-avatar { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(242,183,5,.4); color: var(--shell-yellow); font-family: var(--sans); font-size: 13px; }
.shell-user b { display: block; font-size: 9px; font-weight: 400; color: #eaf2f4; }
.shell-user small { display: block; font-size: 6px; color: rgba(234,242,244,.32); margin-top: 1px; }
.shell-user i { width: 5px; height: 5px; border-radius: 50%; background: #4fd1a0; box-shadow: 0 0 0 3px rgba(79,209,160,.1); }

.shell-main { margin-left: var(--shell-side); min-width: 0; }
.shell-topbar { position: sticky; top: 0; z-index: 90; height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 26px; background: rgba(241,244,242,.92); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-strong); }
.shell-crumb { display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--muted); }
.shell-crumb span { font-family: var(--mono); font-size: 8px; }
.shell-crumb i { font-style: normal; color: var(--line-strong); }
.shell-crumb b { font-family: var(--sans); font-size: 14px; color: var(--ink); letter-spacing: .6px; }
.shell-actions { display: flex; align-items: center; gap: 13px; }
.shell-asof { font-family: var(--mono); font-size: 7px; color: var(--muted-2); }
.shell-role { display: flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 6.5px; color: var(--muted-2); }
.shell-role select { border: 1px solid var(--line); background: transparent; padding: 5px 7px; color: var(--ink); font-family: var(--body); font-size: 9px; outline: none; }
.shell-ai-top { display: flex; align-items: center; gap: 6px; border: 1px solid rgba(31,95,139,.3); padding: 6px 9px; color: var(--blue); font-size: 9px; background: rgba(31,95,139,.04); }
.shell-ai-top:hover { background: rgba(31,95,139,.1); }
.shell-top-avatar { width: 27px; height: 27px; display: grid; place-items: center; background: var(--blue-2); color: var(--shell-yellow); font-size: 12px; }

.shell-content { max-width: 1600px; margin: 0 auto; padding: 25px 27px 58px; }
.view { display: none; animation: qIn .32s ease; }
.view.active { display: block; }
@keyframes qIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.shell-view-head { display: grid; grid-template-columns: 1.08fr .92fr; gap: 36px; align-items: end; margin-bottom: 18px; }
.shell-side-copy { display: flex; align-items: flex-end; gap: 20px; padding-bottom: 3px; }
.shell-side-copy p { max-width: 470px; font-size: 10px; line-height: 1.85; color: var(--muted); }
.shell-stamp { flex: 0 0 auto; border-left: 1px solid var(--line-strong); padding-left: 15px; }
.shell-stamp span { display: block; font-family: var(--mono); font-size: 6.5px; color: var(--muted-2); }
.shell-stamp strong { font-family: var(--sans); font-size: 31px; line-height: 1.08; color: var(--red); letter-spacing: -1px; }
.shell-stamp em { display: block; font-style: normal; font-size: 7px; color: var(--muted-2); }

/* old inspection section embedded */
.inspection.embedded { max-width: none; margin: 0; padding: 0; }

/* overview */
.ov-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.ov-batch, .ov-mix, .ov-cost, .ov-alerts, .ov-approvals, .ov-audit { min-height: 190px; }
.ov-ai { grid-column: 1 / -1; }
.ov-batch-body { padding: 12px 14px 4px; }
.ov-batch-top { display: flex; align-items: flex-end; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.ov-batch-top b { font-family: var(--sans); font-size: 25px; letter-spacing: -.5px; }
.ov-batch-top span { font-family: var(--mono); font-size: 7px; color: var(--muted-2); }
.ov-batch-grid { display: grid; grid-template-columns: 1fr 1fr; border-left: 1px solid var(--line); margin-top: 8px; }
.ov-batch-grid div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 7px; }
.ov-batch-grid span { display: block; font-size: 6.5px; color: var(--muted-2); }
.ov-batch-grid b { display: block; font-family: var(--mono); font-size: 9px; font-weight: 400; margin-top: 1px; }
.ov-progress { margin-top: 9px; }
.ov-progress span { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 6.5px; color: var(--muted-2); }
.ov-progress i { display: block; height: 5px; background: rgba(31,95,139,.1); margin-top: 4px; }
.ov-progress i b { display: block; height: 100%; background: var(--shell-cyan); }
.ov-mix-body { padding: 9px 14px 4px; }
.mix-row { display: grid; grid-template-columns: 64px 1fr 34px; gap: 7px; align-items: center; margin-bottom: 6px; }
.mix-row span { font-size: 7.5px; color: var(--muted); }
.mix-track { height: 7px; background: rgba(23,39,50,.07); }
.mix-track i { display: block; height: 100%; background: var(--blue); }
.mix-row b { font-family: var(--mono); font-size: 7px; font-weight: 400; text-align: right; color: var(--ink); }
.ov-cost-body { padding: 11px 14px 2px; }
.ov-cost-top { display: flex; align-items: flex-end; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.ov-cost-top span { font-size: 7px; color: var(--muted-2); }
.ov-cost-top strong { font-family: var(--sans); font-size: 29px; line-height: 1; color: var(--red); }
.ov-cost-top strong small { font-family: var(--mono); font-size: 7px; color: var(--muted-2); }
.ov-cost-lines { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; padding-top: 7px; }
.ov-cost-lines div { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed rgba(23,39,50,.1); font-size: 7px; color: var(--muted); }
.ov-cost-lines b { font-family: var(--mono); font-size: 7px; font-weight: 400; color: var(--ink); }
.ov-link { display: flex; align-items: center; justify-content: space-between; margin: 6px 14px 10px; padding-top: 7px; border-top: 1px solid var(--line); font-size: 7.5px; color: var(--blue); }
.ov-alerts-body { padding: 4px 12px 8px; }
.ov-risk-row { display: grid; grid-template-columns: 8px 1fr auto; gap: 7px; align-items: start; padding: 7px 0; border-bottom: 1px solid rgba(23,39,50,.07); cursor: pointer; }
.ov-risk-row:last-child { border-bottom: 0; }
.ov-risk-row i { width: 6px; height: 6px; border-radius: 50%; margin-top: 3px; background: var(--red); }
.ov-risk-row i.warn { background: var(--yellow); }
.ov-risk-main b { display: block; font-size: 8.5px; font-weight: 500; }
.ov-risk-main span { display: block; font-family: var(--mono); font-size: 6.5px; color: var(--muted-2); margin-top: 1px; }
.ov-risk-row em { font-family: var(--mono); font-size: 6.5px; font-style: normal; color: var(--muted-2); }
.approval-list { padding: 4px 12px 8px; }
.approval-row { display: grid; grid-template-columns: 1fr auto; gap: 7px; align-items: center; padding: 7px 0; border-bottom: 1px solid rgba(23,39,50,.07); }
.approval-row:last-child { border-bottom: 0; }
.approval-main b { display: block; font-size: 8.5px; font-weight: 500; }
.approval-main span { display: block; font-family: var(--mono); font-size: 6.5px; color: var(--muted-2); margin-top: 1px; }
.approval-actions button { font-size: 7.5px; padding: 3px 6px; border: 1px solid var(--line); color: var(--muted); }
.approval-actions button.approve { color: var(--green); border-color: rgba(46,125,91,.35); }
.approval-actions button:disabled { opacity: .4; cursor: not-allowed; }
.empty { padding: 16px 0; text-align: center; font-size: 7.5px; color: var(--muted-2); }
.audit-list { display: grid; grid-template-columns: 1fr; padding: 3px 14px 8px; }
.audit-row { display: grid; grid-template-columns: 58px 1fr auto; gap: 7px; align-items: start; padding: 6px 0; border-bottom: 1px solid rgba(23,39,50,.07); }
.audit-time { font-family: var(--mono); font-size: 6.5px; color: var(--muted-2); padding-top: 2px; }
.audit-main b { display: block; font-size: 8px; font-weight: 500; }
.audit-main span { display: block; font-size: 6.5px; color: var(--muted-2); margin-top: 1px; }
.audit-status { font-family: var(--mono); font-size: 6px; padding: 2px 4px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.audit-status.good { color: var(--green); border-color: rgba(46,125,91,.3); }
.audit-status.warn { color: #b37f00; border-color: rgba(242,183,5,.35); }
.audit-status.blue { color: var(--blue); border-color: rgba(31,95,139,.3); }
.ov-ai-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; padding: 10px 14px 12px; }
.ov-ai-item { display: grid; grid-template-columns: 15px 1fr; gap: 5px; font-size: 8px; line-height: 1.65; color: var(--muted); }
.ov-ai-item i { font-family: var(--mono); font-style: normal; font-size: 6.5px; color: var(--blue); padding-top: 2px; }
.ov-ai-item b { color: var(--ink); font-weight: 500; }

/* inspection lower */
.inspection-lower { display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: 8px; margin-top: 8px; }
.inspection-lower .panel { min-height: 156px; }
.decision-progress-body { padding: 10px 14px 8px; }
.decision-total { display: flex; align-items: flex-end; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.decision-total span { font-size: 7px; color: var(--muted-2); }
.decision-total b { font-family: var(--sans); font-size: 23px; line-height: 1; color: var(--green); }
.decision-total b small { font-family: var(--mono); font-size: 7px; color: var(--muted-2); }
.decision-bar { display: flex; height: 9px; margin-top: 9px; background: rgba(23,39,50,.06); }
.decision-bar i { display: block; height: 100%; }
.decision-legend { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; margin-top: 7px; }
.decision-legend div { font-size: 7px; color: var(--muted); }
.decision-legend span { display: block; font-family: var(--mono); font-size: 8px; color: var(--ink); }
.recheck-body { padding: 3px 14px 7px; }
.recheck-row { display: grid; grid-template-columns: 1fr auto; gap: 7px; align-items: center; padding: 5px 0; border-bottom: 1px solid rgba(23,39,50,.06); }
.recheck-row:last-child { border-bottom: 0; }
.recheck-row b { display: block; font-size: 8px; font-weight: 500; }
.recheck-row span { display: block; font-family: var(--mono); font-size: 6.5px; color: var(--muted-2); }
.recheck-status { font-family: var(--mono); font-size: 6px; padding: 2px 4px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.recheck-status.warn { color: #b37f00; border-color: rgba(242,183,5,.35); }
.recheck-status.good { color: var(--green); border-color: rgba(46,125,91,.3); }
.trace-body { padding: 8px 14px 8px; }
.trace-step { display: grid; grid-template-columns: 9px 1fr auto; gap: 7px; align-items: start; padding: 4px 0; }
.trace-step i { width: 6px; height: 6px; border-radius: 50%; margin-top: 4px; background: var(--green); }
.trace-step i.pending { background: var(--yellow); }
.trace-step b { display: block; font-size: 8px; font-weight: 500; }
.trace-step span { display: block; font-family: var(--mono); font-size: 6.5px; color: var(--muted-2); }
.trace-step em { font-family: var(--mono); font-style: normal; font-size: 6px; color: var(--muted-2); }

/* spc lower */
.spc-lower { display: grid; grid-template-columns: 1.1fr 1fr .9fr; gap: 8px; margin-top: 8px; }
.spc-lower .panel { min-height: 205px; }
.matrix-body { padding: 9px 14px 8px; overflow-x: auto; }
.matrix-table { display: grid; grid-template-columns: 62px repeat(5, 1fr); gap: 3px; min-width: 330px; }
.matrix-table .mh { font-family: var(--mono); font-size: 6px; color: var(--muted-2); text-align: center; padding: 2px 0; }
.matrix-table .ml { font-size: 6.5px; color: var(--muted); padding: 5px 2px 2px; }
.matrix-cell { min-height: 22px; display: grid; place-items: center; font-family: var(--mono); font-size: 7px; color: var(--muted-2); background: rgba(31,95,139,.04); }
.matrix-cell.has { color: #fff; }
.trend-body { padding: 7px 12px 0; height: 160px; }
.trend-body svg { width: 100%; height: 100%; }
.window-body { padding: 8px 14px; }
.window-row { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 7px; align-items: center; padding: 5px 0; border-bottom: 1px dashed rgba(23,39,50,.1); }
.window-row span { font-size: 7px; color: var(--muted); }
.window-row b { font-family: var(--mono); font-size: 7px; font-weight: 400; color: var(--ink); }
.window-row em { font-family: var(--mono); font-style: normal; font-size: 6px; color: var(--muted-2); }
.window-bar { height: 4px; background: rgba(23,39,50,.08); position: relative; }
.window-bar i { display: block; height: 100%; background: var(--green); }
.window-bar i.warn { background: var(--yellow); }

/* cost */
.cost-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 8px; margin-top: 8px; align-items: start; }
.copq-panel { min-height: 250px; }
.copq-bars { padding: 10px 14px 2px; }
.copq-row { display: grid; grid-template-columns: 76px 1fr 64px; gap: 8px; align-items: center; margin-bottom: 8px; }
.copq-row span { font-size: 8px; color: var(--muted); }
.copq-track { height: 11px; background: rgba(23,39,50,.07); }
.copq-track i { display: block; height: 100%; background: var(--red); opacity: .72; }
.copq-row b { font-family: var(--mono); font-size: 7.5px; font-weight: 400; text-align: right; }
.copq-note { margin: 4px 14px 12px; padding: 8px 9px; border-left: 2px solid var(--yellow); background: rgba(242,183,5,.06); font-size: 7.5px; line-height: 1.65; color: var(--muted); }
.supplier-quality { min-height: 250px; }
.supplier-head, .supplier-row { display: grid; grid-template-columns: 1.3fr 1fr .7fr .8fr .6fr; gap: 7px; align-items: center; padding: 6px 14px; }
.supplier-head { border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 6px; color: var(--muted-2); }
.supplier-row { border-bottom: 1px solid rgba(23,39,50,.06); font-family: var(--mono); font-size: 7.5px; color: var(--muted); }
.supplier-row b { color: var(--ink); font-weight: 400; }
.supplier-row .bad { color: var(--red); }
.supplier-row .warn { color: #b37f00; }
.supplier-row .good { color: var(--green); }
.capa-panel { min-height: 300px; }
.capa-add { font-size: 7.5px; color: var(--blue); border: 1px solid rgba(31,95,139,.3); padding: 4px 7px; }
.capa-list { padding: 4px 14px 6px; }
.capa-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; padding: 8px 0; border-bottom: 1px solid rgba(23,39,50,.07); }
.capa-row:last-child { border-bottom: 0; }
.capa-main b { display: block; font-size: 8.5px; font-weight: 500; }
.capa-main span { display: block; font-family: var(--mono); font-size: 6.5px; color: var(--muted-2); margin-top: 1px; }
.capa-main em { display: block; font-style: normal; font-size: 7px; color: var(--muted); margin-top: 2px; }
.capa-actions { display: flex; gap: 4px; }
.capa-actions button { font-size: 7px; padding: 3px 5px; border: 1px solid var(--line); color: var(--muted); }
.capa-actions button.ok { color: var(--green); border-color: rgba(46,125,91,.3); }
.capa-actions button:disabled { opacity: .4; cursor: not-allowed; }
.capa-status { font-family: var(--mono); font-size: 6px; padding: 2px 4px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.capa-status.good { color: var(--green); border-color: rgba(46,125,91,.3); }
.capa-status.warn { color: #b37f00; border-color: rgba(242,183,5,.35); }
.capa-approvals-head { padding: 6px 14px 0; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 6.5px; color: var(--muted-2); letter-spacing: .5px; }
.approval-list.compact { max-height: 125px; overflow: auto; }
.cost-audit { min-height: 300px; }
.cost-audit .audit-list { grid-template-columns: 1fr; }

/* copilot */
.copilot-backdrop { position: fixed; inset: 0; z-index: 220; background: rgba(10,22,31,.4); opacity: 0; pointer-events: none; transition: .25s; }
.copilot-backdrop.open { opacity: 1; pointer-events: auto; }
.copilot { position: fixed; right: 0; top: 0; bottom: 0; width: min(390px, 92vw); z-index: 230; background: var(--card); border-left: 1px solid var(--line-strong); transform: translateX(100%); transition: transform .3s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; box-shadow: -20px 0 60px rgba(23,39,50,.22); }
.copilot.open { transform: none; }
.copilot-head { display: flex; align-items: center; gap: 9px; padding: 14px; border-bottom: 1px solid var(--line); background: var(--blue-2); color: #fff; }
.copilot-avatar { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(242,183,5,.45); color: var(--yellow); }
.copilot-head h3 { font-family: var(--sans); font-size: 14px; }
.copilot-head span { display: block; font-size: 6.5px; color: rgba(255,255,255,.5); margin-top: 1px; }
.copilot-head button { margin-left: auto; color: rgba(255,255,255,.7); font-size: 24px; line-height: 1; }
.chat-log { flex: 1; overflow: auto; padding: 13px; display: flex; flex-direction: column; gap: 9px; }
.chat-msg { max-width: 92%; padding: 8px 10px; font-size: 8px; line-height: 1.7; }
.chat-msg.ai { align-self: flex-start; background: rgba(31,95,139,.05); border-left: 2px solid var(--blue); color: var(--muted); }
.chat-msg.user { align-self: flex-end; background: var(--blue-2); color: #fff; }
.chat-msg b { color: var(--ink); }
.chat-msg.user b { color: #fff; }
.chat-cite { display: block; margin-top: 5px; font-family: var(--mono); font-size: 6px; color: var(--blue); border-top: 1px dashed var(--line); padding-top: 4px; }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 13px 9px; }
.chat-suggestions button { font-size: 7px; padding: 4px 6px; border: 1px solid var(--line); color: var(--muted); }
.chat-suggestions button:hover { border-color: var(--blue); color: var(--blue); }
.chat-form { display: flex; border-top: 1px solid var(--line); padding: 9px 11px; gap: 6px; }
.chat-form input { flex: 1; border: 1px solid var(--line); background: transparent; padding: 8px 9px; font-size: 8px; outline: none; }
.chat-form input:focus { border-color: var(--blue); }
.chat-form button { background: var(--blue-2); color: #fff; font-size: 8px; padding: 0 11px; }
.chat-note { padding: 0 13px 11px; font-size: 6px; line-height: 1.55; color: var(--muted-2); }

/* readability */
.shell-side-copy p { font-size: 10.5px; }
.shell-nav button b { font-size: 12.5px; }
.shell-view-head .eyebrow { font-size: 7.5px; }
.kpi span { font-size: 9px; }
.kpi em { font-size: 7px; }
.panel-head h2 { font-size: 13.5px; }
.panel-head span { font-size: 7.5px; }
.ov-risk-main b, .approval-main b, .capa-main b { font-size: 9px; }
.ov-risk-main span, .approval-main span, .capa-main span { font-size: 7px; }
.chat-msg { font-size: 9px; }

@media (max-width: 1240px) {
  :root { --shell-side: 200px; }
  .shell-content { padding: 22px 19px 50px; }
  .ov-grid { grid-template-columns: 1fr 1fr; }
  .ov-ai { grid-column: 1 / -1; }
  .cost-grid { grid-template-columns: 1fr; }
  .inspection-lower, .spc-lower { grid-template-columns: 1fr 1fr; }
  .trace-body, .window-panel { grid-column: 1 / -1; }
}
@media (max-width: 1020px) {
  :root { --shell-side: 0px; }
  .shell-sidebar { transform: translateX(-100%); }
  .shell-main { margin-left: 0; }
  .shell-view-head { grid-template-columns: 1fr; gap: 10px; }
  .shell-side-copy { align-items: flex-start; }
  .inspection-grid { grid-template-columns: 220px minmax(0, 1fr); }
  .defect-panel { grid-column: 1 / -1; }
  .ov-grid { grid-template-columns: 1fr 1fr; }
  .cost-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .shell-topbar { height: 56px; padding: 0 13px; }
  .shell-asof, .shell-role, .shell-ai-top { display: none; }
  .shell-content { padding: 17px 12px 40px; }
  .shell-view-head h1 { font-size: 39px; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .kpi:last-child { grid-column: 1 / -1; }
  .ov-grid { grid-template-columns: 1fr; }
  .ov-ai { grid-column: auto; }
  .ov-ai-body { grid-template-columns: 1fr; gap: 7px; }
  .inspection-grid { grid-template-columns: 1fr; }
  .defect-panel { grid-column: auto; }
  .inspection-lower, .spc-lower { grid-template-columns: 1fr; }
  .trace-body, .window-panel { grid-column: auto; }
  .supplier-head, .supplier-row { grid-template-columns: 1.4fr 1fr .7fr .8fr; }
  .supplier-head span:nth-child(5), .supplier-row span:nth-child(5) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
