:root {
  color-scheme: light;
  --paper: #f6f4ee;
  --surface: #fffefa;
  --surface-soft: #eeeee6;
  --ink: #223d34;
  --body: #384a42;
  --muted: #748077;
  --green: #285e49;
  --green-dark: #194631;
  --green-soft: #e6eee5;
  --line: #dfe3d8;
  --orange: #a9632b;
  --orange-soft: #fcf0df;
  --red: #a64135;
  --red-soft: #fff0ec;
  --blue: #466776;
  --shadow: 0 10px 36px rgba(43, 58, 41, .045);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-synthesis: none;
  font-weight: 400;
  line-height: 1.6;
  color: var(--body);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
button, input, select, textarea, a, summary { touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #cc9d5b; outline-offset: 3px; }
button:focus:not(:focus-visible) { outline: none; }
[hidden] { display: none !important; }
a { color: var(--green); text-underline-offset: .2em; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { color: var(--ink); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--green); }

.app-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px max(30px, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 250, .85);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 46px; border-radius: 13px; color: var(--surface); background: var(--green); font-size: 24px; line-height: 1; }
.brand-copy h1 { font-size: 21px; font-weight: 700; letter-spacing: .05em; line-height: 1.45; }
.brand-copy p { color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.header-actions, .action-row, .toolbar, .dialog-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.btn, .icon-btn { border: 1px solid var(--line); background: var(--surface); color: var(--body); border-radius: 10px; min-height: 44px; padding: 10px 16px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; text-decoration: none; transition: border-color .15s, background .15s, transform .15s; }
.btn:hover, .icon-btn:hover { border-color: #9baea0; background: #f8faf4; }
.btn:active, .icon-btn:active { transform: translateY(1px); }
.btn.primary { color: #fff; background: var(--green); border-color: var(--green); }
.btn.primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn.secondary { background: var(--green-soft); color: var(--green-dark); border-color: #cddccc; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--red); background: var(--red-soft); border-color: #efd7d0; }
.btn.small { padding: 8px 12px; font-size: 13px; }
.icon-btn { padding: 8px; width: 44px; flex: 0 0 44px; }

.app-main { width: min(1440px, 100%); padding: 30px; margin: 0 auto; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; column-gap: 24px; flex-wrap: wrap; margin-bottom: 23px; }
.eyebrow { color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 9px; }
.hero h2 { font-size: clamp(24px, 2.5vw, 36px); font-weight: 650; line-height: 1.4; letter-spacing: -.025em; }
.hero > p, .hero p:not(.eyebrow) { margin-top: 9px; font-size: 14px; color: var(--muted); }
.hero-meta { color: var(--muted); font-size: 12px; display: flex; flex-direction: column; gap: 4px; text-align: right; padding-bottom: 4px; }
.hero > .eyebrow, .hero > h2, .hero > p { flex-basis: 100%; }
.hero > .hero-meta { flex-direction: row; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; text-align: left; }
.save-status { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 12px; }
.save-status::before { content: ""; height: 6px; width: 6px; background: currentColor; border-radius: 50%; }
.status-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 22px; padding: 12px 16px; background: var(--green-soft); border: 1px solid #d9e3d4; border-radius: 11px; }
.status-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #536b5c; }
.status-item strong { color: var(--green-dark); font-size: 15px; }
.mobile-nav { display: none; }
.desktop-nav { width: max-content; margin-bottom: 18px; }
.workspace { display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); align-items: start; gap: 20px; }
.editor-panel, .plan-panel, .summary-panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.editor-panel { overflow: hidden; }
.plan-panel { position: sticky; top: 20px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 19px 21px 15px; }
.panel-head h2, .panel-head h3 { font-size: 17px; font-weight: 650; }
.panel-head p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.panel-head .eyebrow { margin-bottom: 2px; }
.room-tabs { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 20px 18px; border-bottom: 1px solid var(--line); }
.room-chip { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); padding: 9px 13px; font-size: 13px; white-space: nowrap; }
.room-chip.active { color: var(--green-dark); background: var(--green-soft); border-color: #7da28b; font-weight: 600; }
.room-chip.done::after { content: "✓"; color: var(--green); font-size: 11px; }
.editor-tabs { display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); padding: 0 13px; }
.editor-tabs::-webkit-scrollbar { display: none; }
.editor-tabs button { flex: 1 0 auto; min-height: 50px; padding: 12px 10px 11px; color: var(--muted); background: transparent; border: none; border-bottom: 2px solid transparent; font-size: 13px; }
.editor-tabs button.active { color: var(--green); border-bottom-color: var(--green); font-weight: 650; }
.editor-content { padding: 22px 21px; }
.room-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.room-head h2 { font-size: 23px; letter-spacing: -.025em; }
.room-head h3 { font-size: 19px; }
.editor-panel > .room-head { padding: 14px 20px 0; margin-bottom: 10px; }
.room-head p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 21px 0 12px; }
.section-title:first-child { margin-top: 0; }
.section-title h3 { font-size: 15px; font-weight: 650; }
.section-title p, .section-title small { font-size: 12px; color: var(--muted); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 12px; }
.field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label, .field > span:first-child { color: var(--body); font-size: 12px; font-weight: 600; }
.field label .muted, .field label small { font-weight: 400; }
.field input, .field select, .field textarea, .inline-fields input, .inline-fields select { min-width: 0; width: 100%; border: 1px solid #d5dcd1; border-radius: 9px; background: #fff; color: var(--ink); min-height: 48px; padding: 11px 12px; font-size: 16px; transition: border-color .15s, box-shadow .15s; }
.field input[type="number"], .field input[inputmode="decimal"] { font-variant-numeric: tabular-nums; font-size: 21px; font-weight: 550; line-height: 1.3; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #75967e; box-shadow: 0 0 0 3px #285e4910; outline: 0; }
.field input::placeholder, .field textarea::placeholder { color: #a0a99f; font-size: 14px; font-weight: 400; }
.field input:disabled { background: #f1f2ed; color: var(--muted); }
.field textarea { min-height: 88px; resize: vertical; line-height: 1.6; }
.field small, .field .help { color: var(--muted); font-size: 11px; }
.field .field-error { color: var(--red); }
.field input[aria-invalid="true"] { border-color: var(--red); background: var(--red-soft); }
.field.compact input, .field.compact select { min-height: 44px; padding: 8px 10px; font-size: 16px; }
.field.compact input[type="number"] { font-size: 18px; }
.inline-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.inline-fields > * { min-width: 0; flex: 1; }
.dimensions-fields { margin-top: 16px; }
.shape-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.shape-option { min-height: 70px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; background: #fff; border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 10px 6px; font-size: 12px; }
.shape-option svg { width: 26px; height: 23px; }
.shape-option strong { font-weight: 550; }
.shape-option.active { border-color: #6f957a; background: var(--green-soft); color: var(--green-dark); }
.help-note, .notice, .coordinate-hint { background: #f1f3ed; padding: 12px 13px; border-radius: 10px; font-size: 12px; color: #657262; line-height: 1.75; margin: 14px 0; }
.help-note strong, .notice strong { color: var(--ink); }
.notice.warning { color: #8c5b29; background: var(--orange-soft); border: 1px solid #f0ddbc; }
.notice.success { color: var(--green); background: var(--green-soft); border: 1px solid #cfdfc9; }
.notice.error { color: var(--red); background: var(--red-soft); }
.coordinate-hint { color: var(--blue); background: #edf2f3; }
.room-progress { margin-top: 17px; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.progress-track { height: 5px; flex: 1; background: #e7eae1; border-radius: 5px; overflow: hidden; }
.progress-track > span { display: block; height: 100%; background: var(--green); border-radius: inherit; transition: width .2s; }
.check-row, .toggle { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--body); cursor: pointer; }
.check-row input, .toggle input { height: 18px; width: 18px; flex: 0 0 18px; margin: 0; }
.check-list { display: flex; flex-direction: column; gap: 5px; }
.item-card { margin: 12px 0; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.item-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.item-heading h3, .item-heading h4, .item-heading strong { font-size: 14px; font-weight: 650; }
.item-heading p { color: var(--muted); font-size: 11px; }
.item-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.item-card .field-grid { gap: 10px; }
.chip, .badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; font-size: 10px; line-height: 1.6; font-weight: 500; color: var(--green); background: var(--green-soft); border-radius: 5px; white-space: nowrap; }
.chip.existing { color: var(--blue); background: #e9f0f2; }
.chip.planned { color: #9c692f; background: var(--orange-soft); }
.chip.warning { color: #9c692f; background: var(--orange-soft); }
.empty-state { padding: 32px 15px; text-align: center; color: var(--muted); font-size: 13px; border: 1px dashed #d8dfd1; border-radius: 12px; background: #f9faf5; margin: 15px 0; }
.empty-state strong { display: block; color: var(--body); margin-bottom: 7px; font-size: 15px; }
.empty-state .btn { margin-top: 14px; }
.point-kind-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 12px 0; }
.point-kind-grid button { min-height: 44px; background: #fff; border: 1px solid var(--line); border-radius: 8px; color: var(--body); font-size: 12px; padding: 8px; }
.point-kind-grid button.active { color: var(--green-dark); border-color: var(--green); background: var(--green-soft); }
.details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.onboarding { margin: 15px 0 20px; border: 1px solid var(--line); border-radius: 10px; background: #f9faf5; }
.onboarding summary { min-height: 44px; padding: 12px 14px; font-size: 12px; color: var(--green); font-weight: 600; cursor: pointer; }
.onboarding > :not(summary) { padding: 0 14px 14px; color: var(--muted); font-size: 12px; }
.onboarding ol { padding-left: 30px; }

.segmented { display: inline-flex; align-items: center; padding: 3px; background: #f0f2eb; border: 1px solid #e1e6db; border-radius: 9px; }
.segmented button { min-height: 44px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; padding: 7px 12px; white-space: nowrap; }
.segmented button.active { color: var(--green-dark); background: #fff; font-weight: 600; box-shadow: 0 1px 4px #243b2b12; }
.plan-toolbar { display: flex; align-items: center; flex-wrap: wrap; column-gap: 17px; row-gap: 0; border-top: 1px solid #eef0e8; border-bottom: 1px solid var(--line); padding: 2px 21px; background: #fcfcf7; }
.plan-toolbar .toggle { font-size: 11px; }
.plan-canvas { min-height: 400px; background: #fcfcf8; overflow: hidden; display: grid; place-items: center; padding: 14px; }
.plan-canvas svg { display: block; width: 100%; height: auto; max-height: min(71vh, 870px); user-select: none; -webkit-user-select: none; }
.plan-canvas svg [data-room-id] { cursor: pointer; }
.plan-canvas svg [data-furniture-id] { cursor: grab; touch-action: none; }
.plan-canvas svg [data-furniture-id]:active { cursor: grabbing; }
.plan-caption { padding: 13px 20px 16px; color: var(--muted); font-size: 11px; border-top: 1px solid #eef0e8; }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 16px; font-size: 10px; color: var(--muted); padding: 0 20px 16px; }
.legend > span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.workspace[data-view="summary"] { display: block; }
.workspace[data-view="summary"] > .editor-panel, .workspace[data-view="summary"] > .plan-panel { display: none; }
.summary-panel { grid-column: 1 / -1; padding: 24px; }
.summary-panel > .panel-head { padding: 0 0 20px; }
.summary-panel .section-title { margin-top: 26px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0 22px; }
.stat-card .number, .stat-card .label { display: block; }
.stat-card { padding: 20px 18px; border-radius: 11px; background: #f1f4ec; border: 1px solid #e0e6d7; }
.stat-card .number { color: var(--green-dark); font-size: 30px; font-weight: 650; line-height: 1.2; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-card .number small { font-size: 13px; font-weight: 400; letter-spacing: 0; }
.stat-card .label { margin-top: 7px; font-size: 11px; color: #75816e; }
.table-scroll { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
th { color: #71806f; font-weight: 500; background: #f5f6ef; white-space: nowrap; }
th, td { padding: 13px 15px; border-bottom: 1px solid #e9ece2; vertical-align: top; }
td { color: var(--body); font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbf6; }
td .btn.small { min-height: 44px; margin: -6px 0; }
.export-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 20px; border: 1px solid #d3ddcc; background: #f0f4ea; border-radius: 12px; margin-top: 23px; }
.export-card h3 { font-size: 16px; }
.export-card p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; height: 1px; width: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }

dialog, .modal { padding: 0; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); width: min(540px, calc(100% - 32px)); max-height: calc(100dvh - 48px); color: var(--body); box-shadow: 0 24px 90px #15352429; }
dialog::backdrop { background: #1c342b60; backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px 14px; }
.modal-head h2 { font-size: 20px; }
dialog > :not(.modal-head), .modal > :not(.modal-head) { margin-left: 24px; margin-right: 24px; }
dialog p, .modal p { font-size: 13px; color: var(--muted); }
dialog .dialog-actions, .modal .dialog-actions { margin: 18px 24px 24px; }
dialog .export-card { display: block; margin-top: 12px; padding: 15px; }
dialog .export-card .btn { margin-top: 12px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px); color: #fff; background: #264c3bed; border: 1px solid #ffffff25; border-radius: 11px; padding: 13px 20px; font-size: 13px; line-height: 1.6; box-shadow: 0 5px 25px #14312220; max-width: calc(100vw - 32px); z-index: 200; opacity: 0; pointer-events: none; transition: transform .18s, opacity .18s; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.print-report { display: none; }
#large-plan-dialog { width: min(1100px, calc(100% - 20px)); }
#large-plan-content { overflow: auto; max-height: 75dvh; background: #faf8f2; }
#large-plan-content svg { width: max(100%, 900px); height: auto; display: block; }

@media (min-width: 1500px) { .app-header { padding-left: calc((100vw - 1380px) / 2); padding-right: calc((100vw - 1380px) / 2); } }
@media (max-width: 1100px) {
  .app-header { padding: 16px 22px; gap: 12px; }
  .header-actions { gap: 6px; }
  .header-actions .btn { padding: 9px 12px; font-size: 12px; }
  .app-main { padding: 24px 20px; }
  .workspace { grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); gap: 15px; }
  .panel-head { padding-left: 17px; padding-right: 17px; }
  .editor-content { padding: 20px 17px; }
  .room-tabs { padding-left: 16px; padding-right: 16px; gap: 6px; }
  .room-chip { padding: 8px 10px; }
  .stats-grid { gap: 9px; }
}

@media (max-width: 780px) {
  .desktop-nav { display: none; }
  .app-header { min-height: 77px; padding: 13px 17px; gap: 10px; }
  .brand { gap: 9px; }
  .brand-mark { width: 39px; height: 39px; flex-basis: 39px; border-radius: 11px; font-size: 21px; }
  .brand-copy h1 { font-size: 18px; }
  .brand-copy p { font-size: 9px; letter-spacing: .06em; }
  .header-actions { gap: 3px; }
  .header-actions .btn { min-height: 44px; padding: 9px 10px; font-size: 12px; border-radius: 8px; }
  .header-actions .btn.ghost { padding-left: 6px; padding-right: 6px; }
  .app-main { padding: 22px 15px calc(94px + env(safe-area-inset-bottom, 0px)); }
  .hero { margin-bottom: 18px; align-items: flex-start; }
  .hero h2 { font-size: 25px; }
  .hero p:not(.eyebrow) { font-size: 12px; margin-top: 7px; }
  .eyebrow { font-size: 9px; margin-bottom: 7px; }
  .hero-meta { width: 100%; flex-direction: row; justify-content: space-between; margin-top: 14px; text-align: left; font-size: 10px; }
  .status-strip { gap: 6px 14px; padding: 10px 12px; margin-bottom: 16px; }
  .status-item { font-size: 10px; gap: 5px; }
  .status-item strong { font-size: 13px; }
  .workspace { display: block; }
  .workspace[data-view="measure"] > .plan-panel, .workspace[data-view="measure"] > .summary-panel,
  .workspace[data-view="plan"] > .editor-panel, .workspace[data-view="plan"] > .summary-panel,
  .workspace[data-view="summary"] > .editor-panel, .workspace[data-view="summary"] > .plan-panel { display: none; }
  .editor-panel, .plan-panel, .summary-panel { border-radius: 13px; }
  .plan-panel { position: static; }
  .panel-head { padding: 17px 17px 13px; gap: 9px; }
  .panel-head h2, .panel-head h3 { font-size: 16px; }
  .room-tabs { flex-wrap: nowrap; overflow-x: auto; padding: 0 16px 15px; scrollbar-width: none; scroll-padding-left: 16px; }
  .room-tabs::-webkit-scrollbar { display: none; }
  .room-chip { flex-shrink: 0; padding: 9px 13px; }
  .editor-tabs { padding: 0 8px; }
  .editor-tabs button { padding-left: 11px; padding-right: 11px; min-height: 49px; }
  .editor-content { padding: 21px 17px; }
  .field-grid { gap: 14px 11px; }
  .field input, .field select, .field textarea { min-height: 51px; font-size: 16px; }
  .field input[type="number"], .field input[inputmode="decimal"] { font-size: 23px; }
  .field label { font-size: 12px; }
  .help-note, .notice, .coordinate-hint { font-size: 11px; }
  .shape-option { min-height: 74px; }
  .item-card { padding: 14px; }
  .plan-canvas { min-height: 350px; padding: 8px; }
  .plan-canvas svg { max-height: none; }
  .plan-toolbar { padding-left: 16px; padding-right: 16px; column-gap: 13px; }
  .segmented button { min-height: 44px; padding: 8px 10px; }
  .summary-panel { padding: 19px 16px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 16px 14px; }
  .stat-card .number { font-size: 28px; }
  .export-card { padding: 17px; }
  .export-card .action-row { width: 100%; }
  .export-card .action-row .btn { flex: 1; }
  .table-scroll { margin-left: -1px; margin-right: -1px; }
  th, td { padding: 12px 11px; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; display: grid; grid-template-columns: repeat(3, 1fr); padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px)); gap: 7px; border-top: 1px solid #dbe2d4; background: rgba(255, 254, 250, .97); box-shadow: 0 -3px 24px #243b2b06; backdrop-filter: blur(12px); }
  .mobile-nav button { display: flex; justify-content: center; align-items: center; flex-direction: column; gap: 2px; min-height: 48px; border: 0; background: transparent; border-radius: 10px; font-size: 11px; color: var(--muted); font-weight: 500; }
  .mobile-nav button svg { width: 19px; height: 19px; }
  .mobile-nav button.active { color: var(--green-dark); background: var(--green-soft); }
  .toast { bottom: calc(85px + env(safe-area-inset-bottom, 0px)); width: max-content; max-width: calc(100vw - 32px); font-size: 12px; }
  dialog, .modal { max-height: calc(100dvh - 26px); }
  .modal-head { padding: 20px 19px 12px; }
  dialog > :not(.modal-head), .modal > :not(.modal-head) { margin-left: 19px; margin-right: 19px; }
  dialog .dialog-actions, .modal .dialog-actions { margin: 17px 19px 20px; }
}

@media (max-width: 390px) {
  .app-header { padding-left: 12px; padding-right: 12px; }
  .brand-mark { display: none; }
  .brand-copy h1 { font-size: 17px; }
  .brand-copy p { font-size: 8px; }
  .header-actions .btn { font-size: 11px; padding-left: 8px; padding-right: 8px; }
  .app-main { padding-left: 11px; padding-right: 11px; }
  .hero h2 { font-size: 23px; }
  .field-grid { column-gap: 9px; }
  .editor-content { padding-left: 14px; padding-right: 14px; }
  .point-kind-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@page { size: A4 landscape; margin: 12mm; }
@media print {
  :root { background: #fff; color: #1a3026; font-size: 10pt; }
  body { min-width: 0; background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body > :not(#export-report), .app-header, .app-main, .hero, .mobile-nav, .editor-panel, .header-actions, .action-row, .toolbar, dialog, .toast { display: none !important; }
  #export-report.print-report { display: block !important; width: 100%; }
  .print-page { display: block; break-after: page; page-break-after: always; break-inside: avoid; page-break-inside: avoid; padding: 0; }
  .print-page:last-child { break-after: auto; page-break-after: auto; }
  .print-page h1 { font-size: 18pt; margin-bottom: 2mm; }
  .print-page h2 { font-size: 15pt; margin: 3mm 0; }
  .print-page h3 { font-size: 11pt; margin: 3mm 0 2mm; }
  .print-page p { font-size: 9pt; color: #667568; margin-bottom: 3mm; }
  .print-page svg { display: block; width: 100%; height: 155mm; object-fit: contain; }
  .print-page table { font-size: 8pt; width: 100%; }
  .print-page th, .print-page td { padding: 2mm 2.5mm; }
  .print-page .table-scroll { overflow: visible; border: none; }
  .print-page .stats-grid { margin: 3mm 0; gap: 3mm; }
  .print-page .stat-card { padding: 3mm; }
  .print-page .stat-card .number { font-size: 18pt; }
  .print-page .notice { font-size: 8pt; padding: 2mm 3mm; margin: 3mm 0; }
  .print-page .muted { color: #667568; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; page-break-inside: avoid; }
}
