:root {
  color-scheme: light;
  --ink: #24373c;
  --muted: #6b7d80;
  --line: #d8d7cf;
  --paper: #fbfaf6;
  --canvas: #f0eee7;
  --oak: #c99f72;
  --oak-dark: #9a6c49;
  --blue: #496976;
  --blue-pale: #dce7e7;
  --rust: #b96348;
  --green: #427262;
  --shadow: 0 18px 50px rgba(42, 62, 62, .09);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); min-width: 0; overflow-x: hidden; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, svg:focus-visible { outline: 3px solid rgba(185, 99, 72, .42); outline-offset: 2px; }

.site-shell { width: min(1440px, 100%); margin: 0 auto; padding: 0 28px 30px; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid rgba(36, 55, 60, .1); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: #fff; font-size: 19px; }
.brand strong { display: block; font-size: 16px; letter-spacing: .02em; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.top-actions, .button-row, .hero-pills, .canvas-tools, .canvas-legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.button { border: 1px solid transparent; border-radius: 8px; min-height: 42px; padding: 9px 13px; color: var(--ink); background: transparent; font-weight: 700; font-size: 14px; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-quiet { color: var(--blue); min-height: 38px; }
.button-quiet:hover { background: var(--blue-pale); }
.button-primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 5px 12px rgba(73, 105, 118, .16); }
.button-primary:hover { background: #365762; }
.button-secondary { background: #fff; border-color: #bdc9c8; color: var(--blue); }
.button-secondary:hover { border-color: var(--blue); background: #f3f7f6; }
.button-danger { background: #fff6f3; border-color: #e4b5a5; color: var(--rust); }
.button-danger:hover { background: #fbe9e3; }
.text-button { padding: 4px 0; border: 0; background: transparent; font-size: 13px; font-weight: 700; }
.danger-text { color: var(--rust); }
.danger-text:hover { text-decoration: underline; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--muted); font-size: 22px; line-height: 1; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .94fr); gap: clamp(32px, 7vw, 110px); align-items: center; padding: 64px 0 72px; }
.eyebrow, .section-kicker { margin: 0 0 12px; color: var(--rust); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.hero h1 { max-width: 620px; margin: 0; color: var(--ink); font-size: clamp(2.5rem, 5.1vw, 5rem); line-height: 1.08; letter-spacing: -.055em; font-weight: 800; }
.hero h1 em { color: var(--blue); font-style: normal; }
.hero-lede { max-width: 570px; margin: 25px 0 27px; color: #5f7073; font-size: 16px; line-height: 1.9; }
.hero-pills span { padding: 7px 10px; border: 1px solid #d8dfdd; border-radius: 999px; color: var(--blue); background: rgba(255, 255, 255, .62); font-size: 12px; font-weight: 700; }
.hero-visual { position: relative; min-width: 0; }
.hero-visual::before { content: ""; position: absolute; z-index: -1; inset: 20px -16px -18px 32px; border: 1px solid #d9d0c0; border-radius: 4px; transform: rotate(2.5deg); }
.hero-visual img { display: block; width: 100%; aspect-ratio: 1.7; object-fit: cover; border-radius: 4px; box-shadow: var(--shadow); }
.hero-caption { display: flex; justify-content: space-between; margin-top: 13px; color: var(--muted); font-size: 11px; letter-spacing: .13em; text-transform: uppercase; }
.hero-caption span:first-child { color: var(--rust); font-weight: 800; }

.workspace { display: grid; grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(250px, 300px); gap: 18px; align-items: start; }
.panel, .canvas-panel { border: 1px solid var(--line); background: rgba(255, 255, 255, .73); border-radius: 12px; box-shadow: 0 4px 20px rgba(42, 62, 62, .035); }
.panel { padding: 19px 18px; }
.panel-heading, .block-heading, .canvas-heading, .selected-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-heading { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .canvas-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.panel-heading .section-kicker, .canvas-heading .section-kicker { margin-bottom: 5px; }
.step-dot { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--blue); background: var(--blue-pale); font-size: 11px; font-weight: 800; }
.control-block { padding: 18px 0; border-bottom: 1px solid var(--line); }
.control-block:last-child { border-bottom: 0; padding-bottom: 4px; }
.block-heading { margin-bottom: 12px; }
.block-heading h3 { margin: 0; font-size: 14px; }
.unit-note, .saved-state { color: var(--muted); font-size: 11px; font-weight: 700; }
.saved-state { color: var(--rust); }
.field { display: grid; gap: 6px; margin-bottom: 11px; }
.field > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.field input, .field select { min-width: 0; width: 100%; min-height: 44px; padding: 9px 10px; border: 1px solid #cdd5d2; border-radius: 7px; color: var(--ink); background: #fff; font-size: 16px; }
.field input::placeholder { color: #a5b0ae; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.span-two, .add-button { grid-column: 1 / -1; width: 100%; }
.button-row.compact { margin-top: 3px; }
.button-row.compact .button { flex: 1 1 110px; }
.plan-cleanup-row { display: flex; gap: 8px 14px; flex-wrap: wrap; margin-top: 8px; }
.plan-cleanup-row .text-button { min-height: 44px; padding: 8px 0; }
.field-help { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.add-button { margin-top: 3px; }

.canvas-panel { min-width: 0; padding: 20px; background: #eeece4; }
.canvas-heading { margin-bottom: 16px; }
.canvas-heading h2 { color: var(--ink); }
.canvas-heading h2 span { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.canvas-tools { justify-content: flex-end; }
.keyboard-hint { color: var(--muted); font-size: 11px; }
.plan-stage { width: 100%; padding: 30px 24px 56px 48px; border: 1px solid #d8d2c4; border-radius: 8px; background: #e6e2d8; overflow: hidden; }
#plan-svg { display: block; width: 100%; height: auto; max-height: 720px; overflow: visible; touch-action: none; }
.room-paper { fill: #fcfbf7; filter: url(#soft-shadow); }
.room-grid { opacity: .76; }
.grid-line { fill: none; stroke: #e3e1d8; stroke-width: .8; }
.room-outline { fill: none; stroke: var(--blue); stroke-width: 3; }
.dimension-labels line { stroke: #9baba9; stroke-width: 1; stroke-dasharray: 2 3; }
.dimension-labels text { fill: #597178; font-size: 12px; font-weight: 800; }
.plan-object { cursor: grab; outline: none; }
.plan-object:active { cursor: grabbing; }
.object-shape { stroke: #526b71; stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.plan-object.furniture .object-shape { fill: #cfaa7c; }
.plan-object.door .object-shape { fill: #c4d2d1; stroke: #71888a; }
.plan-object.window .object-shape { fill: #acd3dc; stroke: #4c8491; }
.plan-object.is-selected .object-shape { stroke: var(--rust); stroke-width: 4; stroke-dasharray: 8 4; }
.plan-object.is-out .object-shape { fill: #f1c8ba; stroke: var(--rust); stroke-dasharray: 5 3; }
.plan-object.is-overlap .object-shape { stroke: #bd654c; }
.object-label { fill: #293f45; font-size: 13px; font-weight: 800; pointer-events: none; paint-order: stroke; stroke: rgba(255, 255, 255, .56); stroke-width: 3px; }
.object-size { fill: var(--rust); font-size: 10px; font-weight: 800; pointer-events: none; }
.door-swing { fill: none; stroke: #567077; stroke-width: 1.4; vector-effect: non-scaling-stroke; pointer-events: none; }
.window-line { stroke: #2f7484; stroke-width: 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.empty-canvas { fill: #829397; font-size: 16px; font-weight: 800; pointer-events: none; }
.canvas-legend { margin: 13px 2px 0; color: var(--muted); font-size: 11px; }
.canvas-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-swatch { display: inline-block; width: 12px; height: 12px; border: 1px solid #6c7c80; border-radius: 3px; }
.furniture-swatch { background: var(--oak); }.door-swatch { background: #c4d2d1; }.window-swatch { background: #acd3dc; }
.legend-line { display: inline-block; width: 16px; border-top: 3px dashed var(--rust); }
.canvas-help { min-height: 18px; margin: 12px 2px 0; color: var(--muted); font-size: 12px; }

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.metric-card { min-width: 0; padding: 11px 10px; border-radius: 8px; background: #f0f4f1; }
.metric-card span, .metric-card small { display: block; color: var(--muted); font-size: 11px; }
.metric-card strong { display: block; margin: 4px 0; color: var(--blue); font-size: 18px; letter-spacing: -.03em; overflow-wrap: anywhere; }
.metric-card strong.metric-warning { color: var(--rust); }.metric-wide { grid-column: 1 / -1; background: #edf1f0; }
.check-section, .selected-section, .items-section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.check-list { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.check-list li { display: flex; align-items: flex-start; gap: 7px; color: #5a6e70; font-size: 12px; line-height: 1.45; }
.check-list li span { display: grid; place-items: center; flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 900; }
.check-ok span { color: var(--green); background: #d9e9df; }.check-error span { color: var(--rust); background: #f6ddd4; }.check-warning span { color: #997128; background: #f8ebc9; }.check-neutral span { color: var(--muted); background: #e7ebe8; }
.selected-card { min-height: 80px; padding: 11px; border-radius: 8px; background: #f5f1e8; }
.selected-title { justify-content: flex-start; }.selected-title strong { max-width: 125px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }.selected-kind { margin-left: auto; color: var(--muted); font-size: 10px; }
.selected-dot, .item-row-marker { display: inline-block; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 3px; background: var(--oak); }.selected-dot.door, .item-row-marker.door { background: #a8c1c1; }.selected-dot.window, .item-row-marker.window { background: #8dc3d0; }
.selected-dl { display: grid; gap: 6px; margin: 11px 0; }.selected-dl div { display: flex; justify-content: space-between; gap: 8px; }.selected-dl dt { color: var(--muted); font-size: 11px; }.selected-dl dd { margin: 0; color: var(--ink); font-size: 12px; font-weight: 800; text-align: right; }.inline-warning { margin: 8px 0; color: var(--rust); font-size: 11px; font-weight: 800; }
.selected-card .button { flex: 1 1 90px; min-height: 38px; padding: 7px 8px; font-size: 12px; }.selected-card .field-help { margin-top: 9px; }
.empty-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.item-list { display: grid; gap: 6px; max-height: 272px; overflow-y: auto; }
.item-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 46px; padding: 7px 8px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink); text-align: left; }
.item-row:hover, .item-row.is-active { border-color: #c6d4d1; background: #eef4f2; }.item-row-copy { min-width: 0; flex: 1; }.item-row-copy strong, .item-row-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.item-row-copy strong { font-size: 12px; }.item-row-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }.item-row-state { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 900; }.item-row-state.good { color: var(--green); background: #d9e9df; }.item-row-state.bad { color: var(--rust); background: #f6ddd4; }

.notice { display: flex; gap: 12px; align-items: flex-start; max-width: 800px; margin: 30px auto 20px; padding: 17px 19px; border: 1px solid #e0d4c3; border-radius: 9px; background: #f8f1e6; color: #59696b; }.notice-icon { display: grid; place-items: center; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: var(--oak); color: #fff; font-size: 13px; font-weight: 900; }.notice strong { color: var(--ink); font-size: 13px; }.notice p { margin: 5px 0 0; font-size: 11px; line-height: 1.7; }
footer { display: flex; justify-content: space-between; gap: 15px; padding-top: 6px; color: #859294; font-size: 11px; }
footer a, .notice a { color: #315e68; text-underline-offset: 2px; }
.status-line { position: fixed; z-index: 10; right: 20px; bottom: 18px; max-width: min(420px, calc(100% - 40px)); padding: 10px 13px; border: 1px solid #c6d4d1; border-radius: 8px; background: #eef6f3; color: var(--blue); box-shadow: 0 8px 24px rgba(42, 62, 62, .1); font-size: 12px; line-height: 1.5; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }.status-line:not(:empty) { opacity: 1; transform: translateY(0); }.status-line.error { border-color: #e4b5a5; background: #fff1ed; color: #994f3b; }.status-line.warning { border-color: #ead8a6; background: #fff8de; color: #826624; }.status-line.success { border-color: #b9d9c8; background: #ecf8f0; color: #3d6d5a; }

@media (max-width: 1100px) {
  .site-shell { padding-left: 18px; padding-right: 18px; }
  .workspace { grid-template-columns: minmax(200px, 230px) minmax(0, 1fr); }
  .inspector-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }.inspector-panel .panel-heading { grid-column: 1 / -1; }.inspector-panel .metrics { grid-column: 1; }.inspector-panel .check-section { grid-column: 1; }.inspector-panel .selected-section { grid-column: 2; grid-row: 2 / span 2; }.inspector-panel .items-section { grid-column: 2; }
}
@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 15px 0; }.top-actions { width: 100%; }.top-actions .button { flex: 1 1 100px; padding-left: 7px; padding-right: 7px; }
  .hero { grid-template-columns: 1fr; gap: 34px; padding: 42px 0 48px; }.hero h1 { font-size: clamp(2.5rem, 11vw, 4rem); }.hero-visual { max-width: 650px; }
  .workspace { grid-template-columns: 1fr; }.controls-panel, .inspector-panel { grid-column: auto; }.inspector-panel { display: block; }.inspector-panel .selected-section, .inspector-panel .items-section { grid-column: auto; grid-row: auto; }
  .canvas-panel { order: -1; }.keyboard-hint { display: none; }
}
@media (max-width: 420px) {
  .site-shell { padding: 0 12px 22px; }.topbar { min-height: auto; }.brand small { display: none; }.top-actions { gap: 4px; }.top-actions .button { min-height: 42px; font-size: 12px; }
  .hero { padding-top: 32px; }.hero h1 { font-size: 2.45rem; }.hero-lede { margin-top: 18px; font-size: 15px; line-height: 1.75; }.hero-pills { gap: 5px; }.hero-pills span { padding: 6px 8px; font-size: 10px; }.hero-visual::before { inset: 12px -5px -10px 15px; }
  .panel, .canvas-panel { border-radius: 9px; padding: 15px; }.plan-stage { padding: 22px 12px 48px 28px; }.canvas-heading h2 { font-size: 18px; }.canvas-heading h2 span { display: block; margin-top: 4px; font-size: 11px; }.canvas-legend { gap: 6px; font-size: 10px; }
  .field-grid { gap: 6px; }.button { padding-left: 10px; padding-right: 10px; }.metrics { gap: 6px; }.metric-card strong { font-size: 16px; }.notice { margin-top: 22px; padding: 14px; }.notice p { font-size: 11px; } footer { flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
@media print {
  body { background: #fff; }.site-shell { width: 100%; padding: 0; }.topbar, .hero, .controls-panel, .inspector-panel, .canvas-legend, .canvas-help, .notice, footer, .status-line { display: none !important; }.workspace { display: block; }.canvas-panel { border: 0; box-shadow: none; padding: 0; background: #fff; }.canvas-heading { margin-bottom: 12px; }.plan-stage { border: 0; background: #fff; padding: 0 30px 30px; }.canvas-tools { display: none; }
}

/* SOU100 Stage A: first-view */
.hero { padding: 28px 0 32px; gap: clamp(20px, 4vw, 56px); }
.hero h1 { max-width: 620px; font-size: clamp(2rem, 3.6vw, 3.4rem); line-height: 1.12; letter-spacing: -.04em; word-break: auto-phrase; }
.hero-lede { margin: 12px 0; line-height: 1.55; }
.hero-visual { max-width: 440px; }
.hero-visual img { max-height: 260px; }
.hero-steps { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; counter-reset: stage; padding: 0; margin: 12px 0 0; }
.hero-steps li { counter-increment: stage; position: relative; padding-left: 1.35rem; font-size: .86rem; line-height: 1.4; }
.hero-steps li::before { content: counter(stage); position: absolute; left: 0; top: .08em; font-weight: 800; }
.hero-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 12px; padding: 9px 17px; border: 2px solid #203c34; border-radius: 999px; background: #203c34; color: #fff; font-weight: 750; line-height: 1.25; text-decoration: none; }
.hero-cta:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px #203c34; }
.hero-privacy { margin: 8px 0 0; font-size: .78rem; line-height: 1.45; }
@media (max-width: 640px) {
  .hero { padding: 18px 0 16px; gap: 10px; }
  .hero-visual { display: none; }
  .hero h1 { font-size: clamp(1.8rem, 8vw, 2.2rem); line-height: 1.15; }
  .hero-lede { margin: 8px 0; font-size: .96rem; line-height: 1.45; }
  .hero-steps { flex-direction: column; gap: 4px; margin-top: 8px; }
  .hero-steps li { font-size: .84rem; }
  .hero-cta { margin-top: 9px; }
  .workspace .panel-heading .section-kicker { display: none; }
  .workspace .panel-heading h2 { font-size: 1.15rem; }
  .workspace .panel-heading { margin-bottom: .7rem; }
}
