:root { --bg: #f4f7f6; --fg: #1f2a28; --sub: #5d6b68; --line: #d9e2df; --pri: #1d5f4a; --pri2: #e3f1ec; --warn: #b06000; --danger: #c5221f; --card: #fff; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; font-size: 15px; }
#app { display: grid; grid-template-rows: 52px 1fr; grid-template-columns: 380px 1fr; height: 100vh; }
header { grid-column: 1 / 3; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--pri); color: #fff; }
header h1 { font-size: 17px; margin: 0; font-weight: 700; }
header .sp { flex: 1; }
#who { font-size: 13px; display: flex; align-items: center; gap: 8px; }
#side { overflow-y: auto; padding: 12px; border-right: 1px solid var(--line); background: var(--bg); }
#map { height: 100%; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.card h2 { font-size: 16px; margin: 0 0 8px; }
.card input[type=email], .card input[type=password], .card input[type=text] { width: 100%; font-size: 15px; padding: 9px 10px; margin: 6px 0; border: 1px solid var(--line); border-radius: 8px; }
.lb { display: block; margin: 6px 0; font-size: 14px; }
.lb select { font-size: 14px; padding: 4px 6px; margin-left: 6px; }
.chk { display: block; font-size: 13px; color: var(--sub); margin: 6px 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.b { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: #fff; color: var(--fg); border-radius: 8px; padding: 8px 12px; font-size: 14px; cursor: pointer; }
.b:hover { border-color: var(--pri); }
.b.pri { background: var(--pri); color: #fff; border-color: var(--pri); }
.b.on { background: var(--pri2); border-color: var(--pri); color: var(--pri); }
.b.sm { padding: 4px 8px; font-size: 13px; }
.b.danger { color: var(--danger); }
.b:disabled { opacity: .6; cursor: default; }
header .b { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.lnk { font-size: 13px; color: #1a73e8; }
.note { font-size: 13px; color: var(--sub); line-height: 1.6; margin: 8px 0; }
.warn { font-size: 13px; color: var(--warn); margin: 6px 0; }
.stat { font-size: 14px; margin: 8px 0; font-weight: 600; }
.tabs { display: flex; gap: 6px; margin-bottom: 6px; }
.tabs button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px; font-size: 14px; cursor: pointer; }
.tabs button.on { background: var(--pri); color: #fff; border-color: var(--pri); }
.tabs small { opacity: .8; font-size: 11px; }
.item { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.item .nm { font-weight: 600; font-size: 14px; word-break: break-all; display: flex; align-items: center; gap: 6px; }
.item .sub { font-size: 12px; color: var(--sub); margin: 3px 0; }
.item .acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; }
.foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 12px; color: var(--sub); }
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 2000; pointer-events: none; }
.toast { background: rgba(30,30,30,.9); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; max-width: 80vw; }
#narrow { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 2001; background: #fff8e1; border: 1px solid #f0c36d; border-radius: 8px; padding: 10px 14px; font-size: 14px; max-width: 92vw; }
#narrow[hidden] { display: none; }
.pin-ic span { display: block; width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,.5); }
.vx { background: #fff; border: 3px solid #1565c0; border-radius: 50%; }
.vx-s { border-color: #2e7d32; } .vx-g { border-color: #c62828; }
body.mode-draw #map, body.mode-pin #map { cursor: crosshair; }
.pin-pop textarea { width: 100%; height: 70px; font-size: 14px; }
.pin-colors { display: flex; gap: 10px; justify-content: center; margin: 6px 0; }
.pin-colors button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #999; cursor: pointer; }
.pin-colors button.on { box-shadow: 0 0 0 3px #333; }
.pin-btns { display: flex; justify-content: space-between; }
@media (max-width: 899px) { #app { grid-template-columns: 1fr; grid-template-rows: 52px 45vh 1fr; } #side { grid-row: 3; border-right: none; } #map { grid-row: 2; } }

/* パソコンでは .iwplan の読み込み（スマホ用）は出さない */
#plan-page [data-act=pl-import] { display: none !important; }
#plan-page .tp-in { max-width: 760px; }

/* ---- 計画書の画面（アプリの index.html から写した） ---- */
:root { --fs: 1; }
.rec-btn { min-height: 50px; border: 0; border-radius: 14px; font-size: calc(15px * var(--fs)); font-weight: bold; cursor: pointer; font-family: inherit; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px; }
.rec-btn.pri { background: #2f6b4f; color: #fff; min-height: 54px; }
.rec-btn.gray { background: #e9eee8; color: #1f2a24; }
.rec-btn.line { background: #fff; border: 1.5px solid #cfd6cf; color: #1f2a24; }
#plan-page { position: fixed; inset: 0; z-index: 3300; background: #fff; display: none; flex-direction: column; color: #1f2a24; }
#plan-page.show { display: flex; }
#plan-page .tp-in { gap: 14px; }
.pl-sec { font-size: calc(16px * var(--fs)); font-weight: bold; color: #2f6b4f; border-bottom: 2px solid #2f6b4f; padding: 10px 0 4px; display: flex; justify-content: space-between; align-items: baseline; }
.pl-sec .pl-cnt { font-size: calc(13px * var(--fs)); color: #4a5750; }
.pl-2 { display: flex; gap: 8px; align-items: flex-end; }
.pl-2 > * { flex: 1; min-width: 0; }
#plan-page .tp-input { font-size: 16px; font-weight: normal; }
#plan-page select.tp-input { appearance: auto; }
.pl-ta { min-height: 76px; resize: vertical; line-height: 1.5; }
.pl-card { border: 1.5px solid #dfe5de; border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: #fafcf9; }
.pl-cardhd { display: flex; justify-content: space-between; align-items: center; }
.pl-x { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #eef1ed; font-size: 20px; color: #4a5750; flex: none; cursor: pointer; }
.pl-chk { display: flex; gap: 8px; align-items: flex-start; font-size: calc(13px * var(--fs)); color: #4a5750; line-height: 1.5; }
.pl-chk input { width: 22px; height: 22px; flex: none; margin: 0; }
.pl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-chips .tp-lay { flex: 0 0 auto; }
.pl-small { min-height: 48px; margin: 0 !important; }
.pl-stats { font-size: calc(14px * var(--fs)); line-height: 1.7; }
.pl-tbl { width: 100%; border-collapse: collapse; font-size: calc(14px * var(--fs)); }
.pl-tbl th, .pl-tbl td { border-bottom: 1px solid #e3e8e2; padding: 7px 4px; text-align: left; }
.pl-tbl th { color: #4a5750; font-size: calc(12px * var(--fs)); }
.pl-tbl td small { color: #6b766f; }
.pl-warn { color: #c0392b; font-weight: bold; }
.pl-3 { display: flex; gap: 6px; }
.pl-3 > * { flex: 1; min-width: 0; padding-left: 4px !important; padding-right: 4px !important; }
.pl-draft { border-color: #e0a64a; background: #fff8ec; }
.pl-subbtns > .rec-btn { margin: 0 !important; line-height: 1.3; flex-direction: column; gap: 2px; padding: 10px 6px; }
.pl-subbtns > .rec-btn br { display: none; }
.pl-subbtns > .rec-btn small { display: block; }
.pl-subbtns small, [data-act=pl-eapp] small, [data-act=pl-mail] small, [data-act=pl-compass] small { font-weight: normal; font-size: .8em; opacity: .9; }
.pl-done { color: #2f6b4f; font-weight: bold; font-size: calc(15px * var(--fs)); padding: 6px 0; }
.pl-gcat { font-weight: bold; color: #4a5750; font-size: calc(13px * var(--fs)); margin: 10px 0 2px; }
.pl-g { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 0; border-bottom: 1px solid #eef1ed; }
.pl-g label { display: flex; align-items: center; gap: 10px; flex: 1 1 170px; min-height: 40px; font-size: calc(15px * var(--fs)); }
.pl-g label input { width: 24px; height: 24px; margin: 0; flex: none; }
.pl-g.on label span { font-weight: bold; }
.pl-gnote { flex: 1 1 140px; min-width: 0; min-height: 40px; border: 1px solid #d5dcd4; border-radius: 10px; padding: 6px 10px; font-size: 14px; font-family: inherit; color: #1f2a24; background: #fff; }
.tp-hd { flex: none; display: flex; align-items: center; justify-content: space-between; padding: calc(4px + env(safe-area-inset-top)) 6px 4px; border-bottom: 1px solid #e6ebe5; min-height: 52px; }
.tp-hd h2 { margin: 0; font-size: calc(17px * var(--fs)); }
.tp-ib { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: #1f2a24; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; padding: 0; }
.tp-done { min-width: 64px; height: 44px; border: 0; background: transparent; color: #2f6b4f; font-size: calc(16px * var(--fs)); font-weight: bold; cursor: pointer; font-family: inherit; }
.tp-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tp-note { display: flex; align-items: center; gap: 8px; background: #e8f2ec; color: #24543e; padding: 10px 16px; font-size: calc(13px * var(--fs)); }
.tp-in { display: flex; flex-direction: column; gap: 18px; padding: 16px 20px calc(28px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; box-sizing: border-box; }
.tp-k { font-size: calc(12px * var(--fs)); font-weight: bold; color: #4a5750; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tp-k span { font-weight: normal; font-size: calc(11.5px * var(--fs)); }
.tp-input { width: 100%; box-sizing: border-box; min-height: 48px; border: 1.5px solid #cfd6cf; border-radius: 12px; padding: 10px 12px; font-size: 17px; font-weight: bold; color: #1f2a24; font-family: inherit; background: #fff; }
.tp-sub { font-size: calc(12px * var(--fs)); color: #5b6760; line-height: 1.6; }
.tp-map { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid #e1e6df; }
.tp-map > div > svg:not(.leaflet-zoom-animated), .tp-map > svg { display: block; width: 100%; height: auto; }
.tp-map .leaflet-container { background: #eef0e4; }
.tp-attr { position: absolute; left: 6px; bottom: 4px; z-index: 500; font-size: 10px; color: #333; background: rgba(255,255,255,0.75); padding: 1px 5px; border-radius: 4px; pointer-events: none; }
.tp-mapbtn { z-index: 500;  position: absolute; right: 8px; bottom: 8px; min-height: 36px; padding: 0 12px; border-radius: 18px; border: 0; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.25); font-weight: bold; font-size: calc(13px * var(--fs)); cursor: pointer; font-family: inherit; color: #1f2a24; }
.tp-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: calc(12px * var(--fs)); color: #4a5750; margin-top: -10px; }
.tp-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.tp-ft { display: inline-flex; align-items: center; justify-content: center; gap: 1px; min-width: 38px; height: 24px; padding: 0 6px; border-radius: 12px; background: #fff3e6; border: 1.5px solid #c2410c; color: #9a3412; font-size: 12px; font-weight: bold; box-sizing: border-box; white-space: nowrap; }
.tp-ftpin { display: flex; align-items: center; justify-content: center; width: 40px; height: 24px; border-radius: 12px; background: #fff; border: 2px solid #c2410c; color: #9a3412; font-size: 12px; font-weight: bold; box-shadow: 0 1px 4px rgba(0,0,0,0.35); box-sizing: border-box; white-space: nowrap; }
.tp-bd { width: 44px; flex: none; display: flex; justify-content: center; }
.tp-kinds { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: calc(11.5px * var(--fs)); color: #4a5750; margin-bottom: 6px; }
.tp-kinds > span { display: inline-flex; align-items: center; gap: 6px; }
.tp-kinds .tp-dot { width: 20px; height: 20px; font-size: 11px; }
.tp-layers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -8px; }
.tp-lay { flex: 1 0 auto; min-height: 40px; padding: 0 10px; border: 1.5px solid #cfd6cf; border-radius: 20px; background: #fff; font-family: inherit; font-weight: bold; font-size: calc(13px * var(--fs)); color: #1f2a24; display: inline-flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; white-space: nowrap; }
.tp-lay.on { background: #2f6b4f; border-color: #2f6b4f; color: #fff; }
.tp-lay i { display: inline-block; font-style: normal; }
.tp-lay .lg-a { width: 12px; height: 12px; border-radius: 50%; background: #e8590c; border: 1.5px solid #fff; }
.tp-lay .lg-f { font-size: 13px; }
.tp-lay .lg-p { width: 12px; height: 12px; border-radius: 3px; background: #1d5fa8; border: 1.5px solid #fff; }
.tp-cover { border-radius: 14px; overflow: hidden; background: #eef0e4; }
.tp-cover img { display: block; width: 100%; height: 210px; object-fit: cover; }
.tp-noimg { width: 100%; height: 130px; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #6b756f; cursor: pointer; font-family: inherit; background: repeating-linear-gradient(45deg, #eef0e4, #eef0e4 12px, #e7eadc 12px, #e7eadc 24px); }
.tp-noimg span { font-size: calc(18px * var(--fs)); font-weight: bold; letter-spacing: 0.04em; }
.tp-noimg small { font-size: calc(12px * var(--fs)); }
.tp-phpin { width: 28px; height: 28px; border-radius: 8px; background: #1d5fa8; color: #fff; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 13px; box-sizing: border-box; }
.tp-phpin.on { background: #0b3d75; transform: scale(1.25); box-shadow: 0 0 0 3px rgba(29,95,168,0.35), 0 1px 4px rgba(0,0,0,0.45); }
.tp-legend i.ph { border-radius: 3px; background: #1d5fa8; width: 11px; height: 11px; }
.tp-pv { border: 1px solid #d5dfe9; border-radius: 14px; padding: 8px; background: #f5f8fb; margin-top: -8px; }
.tp-pv .pv-row { display: flex; align-items: center; gap: 6px; }
.tp-pv img { flex: 1; min-width: 0; height: 230px; object-fit: contain; background: #1f2a24; border-radius: 10px; }
.tp-placemsg { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #1d5fa8; color: #fff; border-radius: 12px; padding: 8px 8px 8px 14px; font-size: calc(13.5px * var(--fs)); font-weight: bold; margin-bottom: -8px; }
.tp-placemsg[hidden] { display: none; }
.tp-placemsg button { flex: none; min-height: 36px; padding: 0 14px; border: 0; border-radius: 18px; background: #fff; color: #1d5fa8; font-weight: bold; font-family: inherit; cursor: pointer; }
.tp-prof svg { display: block; width: 100%; height: 64px; background: #fbfaf6; border-radius: 8px; }
.tp-ax { display: flex; justify-content: space-between; font-size: calc(11px * var(--fs)); color: #5b6760; margin-top: 2px; }
.tp-stats { background: #f6f8f3; border-radius: 14px; padding: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 8px; }
.tp-stats .k { font-size: calc(11px * var(--fs)); color: #4a5750; }
.tp-stats .v { font-size: calc(19px * var(--fs)); font-weight: bold; font-variant-numeric: tabular-nums; }
.tp-stats .v small { font-size: calc(12px * var(--fs)); font-weight: normal; margin-left: 2px; }
.tp-stats .kc { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; border-top: 1px solid #e3e8e2; padding-top: 10px; }
.tp-stats .kc .kn { grid-column: 1 / -1; font-size: calc(11.5px * var(--fs)); color: #5b6760; }
.tp-stats .cap { grid-column: 1 / -1; font-size: calc(11.5px * var(--fs)); color: #5b6760; line-height: 1.5; }
.tp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hp-ph .tp-input { min-height: 40px; font-size: 15px; font-weight: normal; padding: 6px 10px; }
.hp-cr .tp-input { min-height: 42px; font-size: 15px; padding: 6px 10px; }
.hp-pick .rec-btn { flex-direction: column; gap: 0; padding: 8px 10px; line-height: 1.35; }
.tp-chip { min-height: 40px; border: 1.5px solid #cfd6cf; border-radius: 20px; background: #fff; color: #1f2a24; font-size: calc(13px * var(--fs)); padding: 0 12px; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 4px; box-sizing: border-box; }
.tp-chip.on { background: #2f6b4f; border-color: #2f6b4f; color: #fff; font-weight: bold; }
.tp-chip.dash { border-style: dashed; border-color: #9aa79f; }
.tp-row { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.tp-fl { border-radius: 10px; padding: 0 4px; margin: 0 -4px; cursor: pointer; }
.tp-fl.on { background: #fff4ea; }
.tp-t { width: 52px; flex: none; text-align: right; font-weight: bold; font-size: calc(14px * var(--fs)); font-variant-numeric: tabular-nums; line-height: 1.2; }
.tp-t small { display: block; font-size: calc(10.5px * var(--fs)); font-weight: normal; color: #5b6760; }
.tp-dot { width: 26px; height: 26px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: bold; background: #e8590c; }
.tp-dot.s, .tp-dot.e { background: transparent; }
.tp-dot.s::after, .tp-dot.e::after { content: ''; width: 14px; height: 14px; border-radius: 50%; background: #2f6b4f; box-shadow: 0 0 0 3px #d7e8de; }
.tp-dot.e::after { background: #1f2a24; box-shadow: 0 0 0 3px #d9dedb; }
.tp-mk { flex: 1; min-width: 0; min-height: 40px; border: 1.5px solid transparent; border-radius: 10px; padding: 6px 8px; font-size: calc(15px * var(--fs)); font-weight: bold; color: #1f2a24; background: #f6f8f3; font-family: inherit; box-sizing: border-box; }
.tp-mk.m:placeholder-shown { border: 1.5px dashed #e8590c; background: #fff7f2; }
.tp-seg { display: flex; align-items: center; gap: 10px; min-height: 26px; }
.tp-seg .ln { width: 44px; flex: none; display: flex; justify-content: center; }
.tp-seg .ln i { width: 3px; height: 26px; background: #f5c3a5; border-radius: 2px; }
.tp-seg .du { font-size: calc(12.5px * var(--fs)); color: #4a5750; }
.tp-add { display: flex; gap: 8px; }
.tp-add input { flex: 1; min-width: 0; min-height: 44px; border: 1.5px solid #cfd6cf; border-radius: 12px; padding: 0 12px; font-size: 16px; font-family: inherit; box-sizing: border-box; }
.tp-add button { min-width: 72px; border: 0; border-radius: 12px; background: #e9eee8; font-weight: bold; font-size: calc(14px * var(--fs)); cursor: pointer; font-family: inherit; color: #1f2a24; }
.tp-del { min-height: 44px; border: 0; background: transparent; color: #b42318; font-weight: bold; font-size: calc(14px * var(--fs)); cursor: pointer; font-family: inherit; }
.tp-year { background: #f6f8f3; border-radius: 14px; padding: 12px 14px; }
.tp-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border: 0; border-top: 1px solid #eef1ed; background: #fff; width: 100%; text-align: left; cursor: pointer; font-family: inherit; color: #1f2a24; }
.tp-li { display: flex; align-items: center; border-top: 1px solid #eef1ed; }
.tp-li .tp-item { border-top: 0; flex: 1; min-width: 0; }
.tp-pc { flex: none; width: 52px; display: flex; justify-content: center; align-items: center; min-height: 64px; cursor: pointer; }
.tp-pc input { width: 24px; height: 24px; margin: 0; }
.tp-pch { display: flex; justify-content: flex-end; margin-bottom: -10px; }
.tp-pch span { width: 52px; text-align: center; font-size: calc(10.5px * min(var(--fs), 1.25)); font-weight: bold; color: #4a5750; line-height: 1.25; }
.tp-item svg.th, .tp-item img.th { width: 64px; height: 64px; flex: none; border-radius: 12px; background: #eef0e4; }
.tp-item img.th { object-fit: cover; display: block; }
.tp-item .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tp-item .tx b { font-size: calc(15px * var(--fs)); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.tp-item .tx span { font-size: calc(12px * var(--fs)); color: #4a5750; }
.tp-item .tx em { font-style: normal; font-size: calc(13px * var(--fs)); color: #33403a; font-variant-numeric: tabular-nums; }
#of-box .rec-btn { flex-direction: column; gap: 2px; padding: 10px 12px; line-height: 1.35; }
#of-box .rec-btn small { font-weight: normal; font-size: calc(12px * var(--fs)); }
#of-box .rec-btn.line small { color: #4a5750; }
