@import url("./palette.css");
:root{font-family:system-ui,-apple-system,"Apple SD Gothic Neo","Malgun Gothic",sans-serif;color:var(--ink);background:var(--bg)}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer}h1,h2,h3,p{margin-top:0}.shell{max-width:1220px;margin:auto;padding:24px}.top{display:flex;align-items:center;justify-content:space-between;gap:18px}.brand{font-weight:900;color:var(--ink);font-size:1.2rem}.hero{background:var(--wash);border:1px solid var(--line);border-radius:22px;padding:34px;margin:22px 0}.hero h1{font-size:clamp(2rem,4vw,3.4rem);letter-spacing:-.06em;margin-bottom:10px}.hero p{font-size:1.1rem;max-width:760px;line-height:1.5}.badge{display:inline-block;border-radius:99px;background:#fff;padding:6px 12px;color:#354d7e;font-weight:700;font-size:.83rem}.actions{display:flex;flex-wrap:wrap;gap:8px}.btn{border:1px solid #a9b8d4;background:white;border-radius:10px;padding:10px 15px;color:var(--ink);font-weight:700}.btn.primary{background:var(--ink);border-color:var(--ink);color:white}.btn.danger{color:#953a29}.grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px}.panel{min-width:0;background:#fff;border:1px solid var(--line);border-radius:18px;padding:22px;margin-bottom:18px;box-shadow:0 5px 18px #0f152410}.panel h2{font-size:1.3rem}.panel h3{font-size:1rem;margin:15px 0 8px}.hint,.small{color:var(--muted);font-size:.9rem;line-height:1.5}.notice{padding:12px 15px;border-radius:10px;background:#fff4d9;border:1px solid #eddb9f;color:#654d11;margin-bottom:16px}.notice.red{background:#fff0eb;border-color:#e6c3b5;color:#743c2d}.row{display:flex;gap:10px;align-items:end;flex-wrap:wrap}.field{display:flex;flex-direction:column;gap:5px;min-width:0;flex:1}.field label{font-size:.85rem;font-weight:700}.field input,.field select{width:100%;min-height:40px;border:1px solid #a9b8d4;border-radius:8px;padding:8px 10px;background:#fff}.field input:focus,.field select:focus{outline:2px solid var(--active);outline-offset:1px}.subgrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.homehead{display:flex;justify-content:space-between;align-items:center}.source{font-size:.78rem;color:var(--muted);background:var(--wash);border-radius:5px;padding:3px 7px}.statgrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.stat{min-width:0;border:1px solid var(--line);border-radius:12px;padding:14px;background:var(--bg)}.stat b{display:block;font-size:1.3rem;margin-top:5px;overflow-wrap:anywhere}.stat small{color:var(--muted)}.tablewrap{overflow:auto}table{width:100%;border-collapse:collapse;min-width:650px}th,td{text-align:left;border-bottom:1px solid var(--line);padding:10px 8px;vertical-align:top}th{background:var(--wash);font-size:.85rem}td input,td select{width:100%;min-width:70px;border:1px solid #a9b8d4;border-radius:7px;padding:7px}td .tiny{font-size:.75rem;color:var(--muted)}.pill{display:inline-block;border-radius:99px;padding:4px 9px;background:var(--wash);font-size:.8rem}.pill.warn{background:#fff0d6}.route-title{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}.toggle{display:inline-flex;border:1px solid #a9b8d4;border-radius:10px;overflow:hidden}.toggle button{border:0;background:white;padding:9px 14px}.toggle button.active{background:var(--ink);color:white}.compare{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}.compare article{min-width:0;background:var(--wash);border:1px solid var(--line);border-radius:13px;padding:16px}.bar{height:13px;background:var(--wash);border-radius:99px;overflow:hidden}.bar span{display:block;height:100%;background:var(--active)}.unknown{color:#865525}.map{width:100%;height:240px;border:0;border-radius:10px;background:var(--wash)}.mapempty{height:130px;border:1px dashed #a9b8d4;display:grid;place-items:center;border-radius:10px;color:var(--muted)}.footer{font-size:.82rem;color:var(--muted);padding:18px 4px 40px}a{color:#3058a4}.print-only{display:none}@media(max-width:780px){.shell{padding:12px}.grid,.compare{grid-template-columns:1fr}.statgrid{grid-template-columns:1fr 1fr}.subgrid{grid-template-columns:1fr 1fr}.hero{padding:22px}.panel{padding:17px}}@media(max-width:480px){.statgrid,.subgrid{grid-template-columns:1fr}.top{align-items:flex-start;flex-direction:column}}@media print{@page{size:A4;margin:13mm}body{background:white;color:black}.shell{max-width:none;padding:0}.top,.hero .actions,.controls,.edit-only,.map,.mapempty{display:none!important}.hero,.panel{box-shadow:none;border:0;padding:0;margin:0 0 15px;break-inside:avoid}.hero{background:none}.hero h1{font-size:24pt}.grid,.compare{grid-template-columns:1fr 1fr}.print-only{display:block}.notice{border:1px solid #777;background:none}.tablewrap{overflow:visible}table{min-width:0;font-size:8pt}th,td{padding:4px}.stat{padding:8px}input,select{border:0!important;padding:0!important;appearance:none}.route-edit{display:none}.footer{padding:0}.page-break{break-before:page}}
@media print{.shell>.top,.shell>.notice,.shell>.grid,.shell>section:not(.hero):not(#report){display:none!important}.hero,#report{break-inside:auto!important}.hero h1{font-size:18pt}.hero p{font-size:9pt}.compare article{break-inside:avoid}.statgrid{grid-template-columns:repeat(2,1fr)}}
.twin{border:1px solid var(--accent)}.twin-heading{display:flex;justify-content:space-between;align-items:start;gap:20px}.twin-heading h2{font-size:1.6rem;margin:16px 0 10px}.twin-layout{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(280px,1fr);gap:22px}.twin-svg{width:100%;border-radius:16px;margin-top:14px;display:block}.assistant{background:var(--wash);border-radius:16px;padding:18px}.assistant textarea{width:100%;padding:10px;border:1px solid #a9b8d4;border-radius:10px;font:inherit;margin:8px 0}.bubble{padding:12px;background:white;border-radius:10px;margin:8px 0;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}.bubble.user{background:var(--accent)}.life-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.life-item{border:1px solid var(--line);border-radius:12px;padding:15px;display:grid;gap:8px}.life-item small{color:var(--muted)}.coordinate-row{display:flex;gap:12px;align-items:end;flex-wrap:wrap;padding:12px 0}.coordinate-row label{display:grid;font-size:.85rem}.coordinate-row input{max-width:210px;min-height:36px}.twin select{padding:8px;border-radius:8px;border:1px solid #a9b8d4}.twin input[type=range]{max-width:180px}#messages{max-height:330px;overflow:auto}@media(max-width:850px){.twin-layout{grid-template-columns:1fr}.life-list{grid-template-columns:1fr}.twin-heading{display:block}}@media print{body .shell>section#twin.panel{display:block!important}.twin-layout{display:block}.assistant,#scene,.twin-layout>.small{display:none}.twin{break-inside:auto}.life-list{grid-template-columns:1fr 1fr}.life-item{break-inside:avoid}}
#game-scene{height:480px;overflow:hidden;border-radius:22px;background:var(--wash);touch-action:none}#game-scene canvas{display:block;width:100%;height:100%}.twin{background:var(--bg)}.twin-heading h2{letter-spacing:-1px}.life-list{gap:12px}.life-item{border-radius:16px;background:var(--wash);padding:18px}.twin-layout{grid-template-columns:minmax(0,2fr) minmax(260px,1fr)}@media(max-width:760px){#game-scene{height:360px}.twin-layout{grid-template-columns:1fr}}@media print{#game-scene{display:none}}
#game-scene{position:relative}.map-status{position:absolute;top:12px;left:12px;max-width:calc(100% - 24px);padding:7px 10px;background:#fbfcfeef;color:var(--ink);border-radius:12px;font-size:12px;pointer-events:none}.map-credit{position:absolute;bottom:8px;right:8px;background:#fffe;padding:4px 7px;border-radius:6px;font-size:11px;color:var(--ink)}
.map-navigation{position:absolute;right:12px;top:48px;display:grid;gap:6px}.map-navigation button{width:36px;height:36px;border:1px solid #a9b8d4;border-radius:10px;background:var(--bg);color:var(--ink);font-size:21px;cursor:pointer}.map-navigation button:focus-visible{outline:3px solid var(--active);outline-offset:2px}


:root { accent-color: var(--active); }
button:focus-visible, a:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--active);
  outline-offset: 2px;
}
#report td:nth-child(2) .bar span { background: var(--accent); }
@media (max-width: 600px) {
  .shell { padding: 16px; }
  .hero h1, .hero p { word-break: keep-all; }
  .row > .field { flex-basis: 135px; }
  .field input, .field select, .btn, .toggle button { min-height: 44px; }
}

/* Guided house comparison */
.flow { max-width: 880px; padding: 20px clamp(16px, 4vw, 40px) 36px; }
.flow-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding: 4px 0 16px; }
.flow-head a { font-size: 1.25rem; font-weight: 850; color: var(--ink); text-decoration: none; }
.flow-head span, .step-tip { color: var(--muted); }
.flow-head span, .step-track { font-size: .88rem; }
.step-track { display: flex; gap: 7px; list-style: none; margin: 26px 0 24px; padding: 0; }
.step-track li { flex: 1; border-top: 3px solid var(--line); padding-top: 8px; color: var(--muted); }
.step-track li[aria-current] { border-color: var(--active); color: var(--ink); font-weight: 800; }
.step-track span { font-variant-numeric: tabular-nums; margin-right: 3px; }
.flow h1 { font-size: clamp(1.65rem, 4vw, 2.5rem); letter-spacing: -.055em; line-height: 1.2; margin-bottom: 8px; }
.step-tip { line-height: 1.55; margin-bottom: 20px; word-break: keep-all; }
.flow .grid { gap: 12px; }
.flow .grid .panel { margin-bottom: 0; }
.home-entry h2 { margin: 0 0 12px; }
.home-entry .field + .field, .trip-entry + .trip-entry { margin-top: 10px; }
.flow .field input, .flow .field select { display: block; margin-top: 4px; color: var(--ink); font-weight: 400; }
.flow summary { cursor: pointer; color: #354d7e; font-weight: 650; padding: 12px 0; }
.flow details[open] > summary { margin-bottom: 6px; }
.home-entry details { border-top: 1px solid var(--line); margin-top: 14px; }
.home-entry details:not([open]) summary { padding-bottom: 0; }
.flow-options { margin: 14px 0; border-bottom: 1px solid var(--line); }
.flow-options[open] { padding-bottom: 14px; }
.example-note { color: #634b18; background: #fff5df; padding: 10px 14px; border-radius: 10px; }
.example-note button, .flow-back { color: #354d7e; background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; }
.entry-error { color: #943927; margin: 6px 0 0; }
.entry-error:empty { display: none; }
.step-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 16px; }
.flow-back { margin-right: auto; padding: 10px 0; }
.step-actions .btn { min-height: 48px; padding-inline: 22px; }
.place-list table { min-width: 0; }
.place-list td { padding: 8px 4px; }
.place-list td input { min-width: 0; }
.place-list th:nth-child(2) { width: 25%; }
.place-list .btn { white-space: nowrap; }
@media (max-width: 600px) {
  .flow { padding-bottom: calc(94px + env(safe-area-inset-bottom)); }
  .flow input, .flow select, .flow textarea { font-size: 16px; }
  .flow .panel { padding: 15px; }
  .step-track { margin: 18px 0; }
  .step-actions { position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
  .step-actions .btn { flex: 1; }
  .flow input, .flow summary { scroll-margin-bottom: 100px; }
}
@media print {
  .step-track, .flow-head, .step-actions, .flow-options, #step-title, .step-tip { display: none; }
  .flow { padding: 0; }
}

.step-actions a.btn { display: grid; place-items: center; text-decoration: none; }
.schedule-entry + .schedule-entry, .routine-report article + article { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.schedule-form .text-action { border: 0; background: transparent; color: #354d7e; font-weight: 650; padding: 10px 0; }
.routine-report ul { padding: 0; list-style: none; }
.routine-report li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; background: var(--wash); border-radius: 10px; padding: 12px; margin: 6px 0; }
.routine-report .check { line-height: 1.6; margin: 0; }
.routine-report .check b { display: block; }
#family-report { overflow-wrap: anywhere; }
@media print { .flow.shell > section#family-report { display: block !important; } }
.route-matches .btn { display:block; text-align:left; margin-top:8px; }
.routine-report details input { width:100%; min-height:44px; margin:6px 0; padding:8px; }
.routine-report details[open] { padding-bottom:12px; }

.living-overview > .small{margin:0 0 12px}
.living-overview > div{padding:14px 0 4px;border-top:1px solid var(--line,#dae3f5)}
.living-overview > div + div{margin-top:12px}
.living-overview h2{font-size:18px;margin:0 0 5px}
.living-overview .metric{font-size:clamp(24px,5vw,32px);font-weight:800;color:#304e92;letter-spacing:-.04em;margin:0}
.living-overview p,.living-overview small{overflow-wrap:anywhere}
.living-overview small{display:block;color:#515e75}

.lease-panel { overflow-wrap: anywhere; }
.lease-panel .field { max-width: 28rem; }
.lease-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); gap: .75rem; margin: 1rem 0; }
.lease-cards article { min-width: 0; padding: 1rem; background: #fffaf4; border: 1px solid #dfcfc6; border-radius: 1rem; }
.lease-panel h3 { margin: 1.2rem 0 .35rem; }
.lease-cards h3 { margin-top: .25rem; }
.lease-cards p { margin: .45rem 0; }
.lease-panel small { display: block; line-height: 1.55; }

.family-week {overflow-wrap:break-word}
.family-week h3 {margin:1.6rem 0 .6rem}
.family-week .case-label {color:#6b438a;font-weight:700;margin:0 0 .35rem}
.family-week label {display:block;font-weight:650}
.family-week select {display:block;width:100%;margin:.35rem 0 .7rem;min-height:44px}
.family-week .month-pair,.family-week .heat-inputs {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem}
.family-week .month-pair>div {border-radius:.8rem;padding:.85rem .65rem;background:#f5effa}
.family-week .month-pair strong {display:block;font-size:clamp(.96rem,4vw,1.45rem);margin-top:.25rem;color:#402752}
.family-week .difference {font-weight:750}
.family-week table {width:100%;min-width:0;table-layout:fixed;border-collapse:collapse;font-size:.88rem;line-height:1.45}
.family-week caption {text-align:left;font-weight:700;padding:.7rem 0}
.family-week td,.family-week th {padding:.55rem .22rem;white-space:normal;word-break:keep-all;text-align:right}
.family-week th:first-child {text-align:left;width:30%}
.family-week article {padding:.9rem 0;border-top:1px solid #dfd5e5}
.family-week article p {margin:.55rem 0}
.family-week details {margin:.8rem 0}
.family-week summary {cursor:pointer;padding:.5rem 0;font-weight:700}
