:root {
  --brand: #0E6B63;
  --brand-dark: #0A524C;
  --brand-weak: #E7F2F1;
  --text: #1E2A2D;
  --muted: #5A6A6E;
  --border: #D3DCDE;
  --border-strong: #A9B7BA;
  --bg: #F3F5F6;
  --surface: #FFFFFF;
  --danger: #C62828;
  --danger-weak: #FDECEC;
  --warn: #9A5B00;
  --warn-line: #E39A1B;
  --warn-weak: #FFF4E0;
  --success: #2E7D32;
  --success-weak: #E8F5E9;
  --info-weak: #EEF3F4;
  --h: 40px;
  --radius: 8px;
  --bar-h: 68px;
  --header-h: 56px;
  --footer-h: 28px;
  --bottom-h: calc(var(--bar-h) + var(--footer-h)); /* 操作バー＋フッター */
  --nav-h: 0px; /* 1200px未満で上部に固定するステップの高さ（JSで設定） */
  --sticky-top: calc(var(--header-h) + var(--nav-h) + 16px);
}
html { scroll-padding-top: calc(var(--header-h) + var(--nav-h) + 16px); scroll-padding-bottom: calc(var(--bottom-h) + 16px); }
@media (pointer: coarse) { :root { --h: 44px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  padding-bottom: calc(var(--footer-h) + 16px);
}
body.has-bar { padding-bottom: calc(var(--bottom-h) + 16px); }
h1, h2, h3 { margin: 0; line-height: 1.4; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.app-header {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(24px, calc((100% - var(--content-max)) / 2 + 24px));
  background: var(--brand); color: #fff;
}
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; }
.brand-mark { width: 26px; height: auto; display: block; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-dept { font-size: 12px; opacity: .85; }
.user-menu-wrap { position: relative; }
.user-menu-btn { height: 36px; display: flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid rgba(255,255,255,.4); border-radius: 18px; background: transparent; color: #fff; cursor: pointer; }
.user-menu-btn:hover { background: rgba(255,255,255,.12); }
.user-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 6px; }
.user-menu button { display: block; width: 100%; text-align: left; height: var(--h); padding: 0 12px; border: 0; background: none; border-radius: 6px; cursor: pointer; }
.user-menu button:hover { background: var(--bg); }

/* 利用規約・著作権表示（デモシステムの社内ルール）。画面の最下部に固定し、操作バーはその上に積む */
.app-footer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 26; height: var(--footer-h); display: flex; justify-content: center; align-items: center; gap: 16px; background: var(--surface); border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.app-footer a { color: var(--muted); }

/* layout */
:root { --content-max: 1440px; }
#app { padding: 24px; max-width: var(--content-max); margin: 0 auto; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.case-layout { display: grid; grid-template-columns: 1fr; gap: 20px; }
.case-layout.is-wide { grid-template-columns: 260px minmax(0, 1fr); align-items: start; }
.case-main { min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; margin-bottom: 16px; }
.page-head h1 { font-size: 20px; }
.page-head .sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.guide-slot { width: 280px; height: 40px; flex-shrink: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* sidebar / steps */
.case-layout.is-wide #case-nav { position: sticky; top: calc(var(--header-h) + 24px); z-index: 5; }
.case-layout:not(.is-wide) #case-nav { position: sticky; top: var(--header-h); z-index: 20; margin: -24px -24px 0; padding: 8px 24px; background: var(--bg); border-bottom: 1px solid var(--border); }
.case-layout:not(.is-wide) .steps.horizontal { padding: 4px; }
.case-layout:not(.is-wide) .steps.horizontal .step { min-height: 40px; padding: 2px 10px; }
.design-side .card { padding: 16px; }
.design-side { gap: 12px; }
.design-side .card-title { margin-bottom: 8px; }
.design-side .kv.lines { gap: 4px 12px; margin-top: 8px; }
.design-side .kv.lines dt, .design-side .kv.lines dd { padding-bottom: 4px; }
.design-side .cov-list li { padding: 4px 0; }
.premium-meta { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.design-side .note { margin-top: 2px !important; }
.design-side .premium-total { font-size: 26px; }
.premium-meta strong { color: var(--text); font-weight: 500; }
.sidebar { display: flex; flex-direction: column; gap: 16px; }
.case-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.case-summary .cs-no { font-size: 12px; color: var(--muted); }
.case-summary .cs-name { font-weight: 700; font-size: 15px; margin: 2px 0 10px; word-break: break-all; }
.case-summary dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12px; }
.case-summary dt { color: var(--muted); }
.case-summary dd { margin: 0; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps.vertical { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.step { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--text); }
.step:hover { background: var(--bg); }
.step.is-current { background: var(--brand-weak); font-weight: 700; }
.step .step-num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; border: 1px solid var(--border-strong); background: #fff; flex-shrink: 0; font-weight: 700; }
.step.is-current .step-num { background: var(--brand); border-color: var(--brand); color: #fff; }
.step .step-label { flex: 1; }
.step-st { font-size: 12px; font-weight: 400; white-space: nowrap; }
.step-st.done { color: var(--success); }
.step-st.doing { color: var(--warn); }
.step-st.todo { color: var(--muted); }
.steps.horizontal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; }
.steps.horizontal .step { min-height: 44px; }
.steps.horizontal .step-label { font-size: 13px; }
.steps.horizontal .step-text { display: flex; flex-direction: column; line-height: 1.3; }
.steps.horizontal .step-st { font-size: 11px; }
.topnav { display: flex; flex-direction: column; gap: 4px; }
.topnav .case-line { font-size: 12px; color: var(--muted); }
.topnav .case-line strong { color: var(--text); font-size: 14px; margin-right: 8px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-title .aside { margin-left: auto; font-weight: 400; }
.card-desc { margin: -6px 0 12px; color: var(--muted); font-size: 12px; }

/* forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field > .label, fieldset.field > legend { font-weight: 500; font-size: 14px; padding: 0; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.opt { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 4px; }
.req { display: inline-block; font-size: 11px; font-weight: 700; color: var(--danger); margin-left: 4px; }
.hint { font-size: 12px; color: var(--muted); }
.err { font-size: 12px; color: var(--danger); min-height: 0; }
.err:empty { display: none; }
.input, select.input, textarea.input {
  height: var(--h); width: 100%;
  padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 6px;
  background: #fff;
}
textarea.input { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; }
.input:focus, select.input:focus, textarea.input:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.input.is-invalid, fieldset.is-invalid .radio-row { border-color: var(--danger); }
.input.is-invalid { background: #FFFBFB; }
.input:disabled { background: #F1F3F4; color: #8A979A; }
.input-unit { display: flex; align-items: center; gap: 8px; }
.input-unit .input { flex: 1; min-width: 0; text-align: right; }
.input-unit .unit { white-space: nowrap; color: var(--muted); }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { display: inline-flex; align-items: center; gap: 8px; min-height: var(--h); padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 6px; background: #fff; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-weak); }
.choice:has(input:focus-visible) { outline: 2px solid var(--brand); }
.choice input { margin: 0; accent-color: var(--brand); width: 16px; height: 16px; }
.check { display: flex; align-items: center; gap: 10px; min-height: var(--h); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); flex-shrink: 0; }
.readonly-value { min-height: var(--h); display: flex; align-items: center; padding: 0 12px; background: var(--bg); border-radius: 6px; }
.age-box { padding: 10px 14px; border-radius: 6px; background: var(--info-weak); }
.age-box strong { font-size: 16px; }

/* buttons */
.btn { height: var(--h); padding: 0 18px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 500; white-space: nowrap; text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-secondary { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-secondary:hover:not(:disabled) { background: var(--brand-weak); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); }
.btn-danger-outline { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger-outline:hover { background: var(--danger-weak); }
.btn-link { background: none; border: 0; color: var(--brand); text-decoration: underline; padding: 0 4px; cursor: pointer; height: auto; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn:disabled { background: #D9DFE1; color: #7D8A8D; border-color: #D9DFE1; cursor: not-allowed; }
.btn:focus-visible, .step:focus-visible, .tab:focus-visible, tr.row-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* badges & tags */
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-brand { background: var(--brand); color: #fff; }
.badge-warn { background: var(--warn-line); color: #fff; }
.badge-success { background: var(--success); color: #fff; }
.badge-muted { background: #6C7B7F; color: #fff; }
.tag { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; border: 1px solid var(--border-strong); color: var(--text); background: #fff; white-space: nowrap; }
.tag-brand { border-color: var(--brand); color: var(--brand); }
.tag-warn { border-color: var(--warn-line); color: var(--warn); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* banners */
.banner { padding: 12px 16px; border-radius: var(--radius); border: 1px solid; margin-bottom: 16px; }
.banner ul { margin: 6px 0 0; padding-left: 20px; }
.banner.warn { background: var(--warn-weak); border-color: var(--warn-line); color: #5E3A00; }
.banner.success { background: var(--success-weak); border-color: #8BC48F; color: #1B5E20; }
.banner.info { background: var(--info-weak); border-color: var(--border); }
.banner.danger { background: var(--danger-weak); border-color: var(--danger); color: #8E1B1B; }
.banner strong { font-weight: 700; }

/* list */
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { font-size: 12px; color: var(--muted); font-weight: 500; background: #FAFBFB; white-space: nowrap; }
.table td.r, .table th.r { text-align: right; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: #F7FAFA; }
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.case-name { font-weight: 700; }
.case-meta { font-size: 12px; color: var(--muted); }

/* intent */
.intent-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.intent-group { border: 0; margin: 0 0 8px; padding: 0; }
.intent-group legend { font-weight: 700; padding: 0; margin-bottom: 2px; }
.intent-group .check { padding-left: 4px; }
.reco-item { border: 1px solid var(--border); border-radius: 6px; padding: 12px; margin-bottom: 10px; }
.reco-item.is-reco { border-color: var(--brand); }
.reco-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.reco-name { font-weight: 700; }

/* design */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; height: 44px; padding: 0 16px; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; color: var(--muted); text-decoration: none; margin-bottom: -1px; background: transparent; cursor: pointer; }
.tab:hover { color: var(--text); background: #fff; }
.tab.is-active { background: #fff; color: var(--text); font-weight: 700; border-color: var(--border); }
.tab.tab-add { color: var(--brand); }
.product-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.product-card { display: flex; flex-direction: column; gap: 10px; }
.product-card.is-reco { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.product-card h3 { font-size: 16px; }
.product-card dl { margin: 0; display: grid; grid-template-columns: 96px 1fr; gap: 4px 12px; font-size: 13px; }
.product-card dt { color: var(--muted); }
.product-card dd { margin: 0; }
.product-card .pick { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.block-reason { font-size: 12px; color: var(--warn); }
.design-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.design-side, .intent-side { position: sticky; top: var(--sticky-top); max-height: calc(100vh - var(--sticky-top) - var(--bottom-h) - 6px); overflow-y: auto; }
.design-label { font-size: 12px; color: var(--muted); margin: -8px 0 8px; }
.design-actions { display: flex; justify-content: flex-start; padding-top: 8px; }
.design-head { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; }
.design-head .p-name { font-size: 17px; font-weight: 700; }
.variant-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.variant-line .v-name { font-weight: 700; }
.rider-table { width: 100%; border-collapse: collapse; }
.rider-table th, .rider-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.rider-table th { font-size: 12px; color: var(--muted); font-weight: 500; }
.rider-table td.r, .rider-table th.r { text-align: right; white-space: nowrap; }
.rider-table tr.is-off .rider-name { color: var(--muted); }
.rider-table .input-unit { max-width: 200px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: var(--h); }
.switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 12px; background: #B9C4C6; position: relative; margin: 0; cursor: pointer; flex-shrink: 0; transition: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { left: 19px; }
.switch input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.premium-total { font-size: 28px; font-weight: 700; line-height: 1.2; }
.premium-total small { font-size: 14px; font-weight: 500; margin-left: 2px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 12px 0 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; }
.kv.lines dt, .kv.lines dd { padding-bottom: 6px; border-bottom: 1px dashed var(--border); }
.note { font-size: 12px; color: var(--muted); margin-top: 12px; }
.cov-list { list-style: none; margin: 0; padding: 0; }
.cov-list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.cov-ok { color: var(--success); font-weight: 700; white-space: nowrap; }
.cov-ng { color: var(--warn); font-weight: 700; white-space: nowrap; }

/* review */
.design-sum { border: 1px solid var(--border); border-radius: 6px; padding: 14px 16px; margin-bottom: 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; }
.design-sum h3 { font-size: 15px; }
.design-sum dl { margin: 6px 0 0; display: grid; grid-template-columns: 110px 1fr; gap: 2px 12px; font-size: 13px; }
.design-sum dt { color: var(--muted); }
.design-sum dd { margin: 0; }
.design-sum .sum-total { text-align: right; }
.review-table td, .review-table th { padding: 10px 12px; }
.review-table td.c, .review-table th.c { text-align: center; }
details.more { margin-top: 12px; }
details.more summary { cursor: pointer; color: var(--brand); min-height: var(--h); display: flex; align-items: center; }
.doc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.doc-row:last-child { border-bottom: 0; }

/* bottom bar */
.bar { position: fixed; left: 0; right: 0; bottom: var(--footer-h); z-index: 25; height: var(--bar-h); background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -2px 8px rgba(0,0,0,.05); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 max(24px, calc((100% - var(--content-max)) / 2 + 24px)); }
.bar-left, .bar-right { display: flex; align-items: center; gap: 8px; }
.bar-total { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; margin-right: 8px; }
.bar-total .lbl { font-size: 12px; color: var(--muted); }
.bar-total strong { font-size: 20px; }
.bar-reason { font-size: 12px; color: var(--warn); max-width: 420px; text-align: right; }
.bar-reason a { color: var(--warn); font-weight: 700; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(15, 30, 32, .45); display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: var(--surface); border-radius: 10px; width: 560px; max-width: 100%; max-height: calc(100vh - 48px); display: flex; flex-direction: column; box-shadow: 0 16px 48px rgba(0,0,0,.25); }
.modal.wide { width: 860px; }
.modal.paper-modal { width: 900px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; }
.modal-close { width: 36px; height: 36px; border: 0; background: none; border-radius: 6px; font-size: 20px; cursor: pointer; color: var(--muted); }
.modal-close:hover { background: var(--bg); }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.cs-results { margin-top: 16px; }
.cs-results .table th, .cs-results .table td { padding: 8px 10px; font-size: 13px; }
.empty { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 6px; }
.variant-option { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border-strong); border-radius: 6px; margin-bottom: 10px; cursor: pointer; }
.variant-option:has(input:checked) { border-color: var(--brand); background: var(--brand-weak); }
.variant-option input { margin-top: 4px; accent-color: var(--brand); width: 16px; height: 16px; }

/* toast */
#toast-root { position: fixed; top: calc(var(--header-h) + 12px); right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; width: 380px; max-width: calc(100vw - 32px); }
.toast { background: #23302F; color: #fff; padding: 12px 16px; border-radius: 8px; box-shadow: 0 8px 20px rgba(0,0,0,.2); border-left: 4px solid #6FC1B8; font-size: 13px; }
.toast.error { border-left-color: #FF8A80; }

/* done */
.done-card { max-width: 720px; margin: 24px auto; text-align: center; }
.done-icon { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; background: var(--success); color: #fff; display: grid; place-items: center; font-size: 28px; }
.done-card .kv { text-align: left; max-width: 520px; margin: 20px auto; grid-template-columns: 120px 1fr; }
.done-card .kv dd { text-align: left; }

/* paper (preview & print) */
.paper-wrap { background: #E9ECED; padding: 20px; border-radius: 6px; }
.paper { width: 100%; max-width: 794px; min-height: 1000px; margin: 0 auto; background: #fff; padding: 48px 52px; box-shadow: 0 2px 10px rgba(0,0,0,.12); color: #111; font-size: 12.5px; line-height: 1.7; }
.paper h1 { font-size: 20px; text-align: center; margin: 12px 0 16px; letter-spacing: .1em; }
.paper h2 { font-size: 14px; margin: 18px 0 8px; padding-left: 8px; border-left: 4px solid var(--brand); }
.paper .doc-top { display: flex; justify-content: space-between; font-size: 12px; }
.paper .doc-to { display: flex; justify-content: space-between; align-items: flex-end; margin: 8px 0 12px; border-bottom: 1px solid #333; padding-bottom: 6px; }
.paper .doc-to .to { font-size: 16px; font-weight: 700; }
.paper table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.paper th, .paper td { border: 1px solid #999; padding: 5px 8px; text-align: left; vertical-align: top; }
.paper th { background: #F1F4F4; font-weight: 500; width: 30%; }
.paper td.r { text-align: right; }
.paper .highlight { border: 2px solid var(--brand); padding: 12px 14px; border-radius: 4px; background: #F5FAF9; }
.paper .highlight h2 { margin-top: 0; border: 0; padding: 0; color: var(--brand); }
.paper .foot { margin-top: 28px; padding-top: 8px; border-top: 1px solid #999; font-size: 11px; color: #555; text-align: center; }
.paper .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.paper .sign div { border: 1px solid #999; height: 72px; padding: 6px 8px; font-size: 11px; }
.paper .stamp { display: inline-block; border: 1px solid #C62828; color: #C62828; padding: 0 6px; font-size: 11px; }
#print-area { display: none; }

/* responsive */
@media (max-width: 1099px) {
  .design-grid { grid-template-columns: 1fr; }
  .design-side, .intent-side { position: static; max-height: none; overflow: visible; }
  .intent-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .form-grid, .form-grid.cols-3, .product-cards { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .guide-slot { display: none; }
  #app { padding: 16px; }
  .case-layout:not(.is-wide) #case-nav { margin: -16px -16px 0; padding: 10px 16px; }
  .bar { padding: 0 12px; }
  .header-dept { display: none; }
}

@media print {
  body.printing > *:not(#print-area) { display: none !important; }
  body.printing { background: #fff; padding: 0; }
  body.printing #print-area { display: block; }
  #print-area .paper { box-shadow: none; max-width: none; min-height: 0; padding: 0; page-break-after: always; break-after: page; }
  #print-area .paper:last-child { page-break-after: auto; break-after: auto; }
  @page { size: A4; margin: 16mm 14mm; }
}
