*{box-sizing:border-box}body{margin:0;background:#f2f5f4;color:#173b43;font:14px/1.65 system-ui,-apple-system,"Noto Sans JP",sans-serif}button,input,select{font:inherit}button,a,input,select{touch-action:manipulation}button{cursor:pointer;border:1px solid #ccd8d6;border-radius:9px;padding:9px 13px;background:white;color:#17535b;min-height:44px}button:hover{background:#e7f3ef}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #edb65b;outline-offset:2px}a{color:#146b74;text-underline-offset:3px}header{height:70px;background:#103d46;color:white;display:flex;justify-content:space-between;align-items:center;padding:0 28px;gap:12px}header>div{display:flex;align-items:center;gap:12px}header small{opacity:.7}.mark{font-size:34px;color:#8fe0ce}header button{background:transparent;color:white;border-color:#6d8f94}main{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(360px,.85fr);gap:22px;padding:22px;max-width:1800px;margin:auto}.map-section{position:sticky;top:16px;align-self:start}.search{display:flex;background:white;border-radius:12px;border:1px solid #d6e0dd;padding:7px;gap:6px;box-shadow:0 4px 22px #123c4610}.search input{flex:1;min-width:0;border:0;padding:8px;background:white}.search button:first-of-type,#applyKey,#connectMap{background:#146b65;color:white}.filters{display:flex;gap:8px;margin:12px 0;flex-wrap:wrap}select,input[type=date]{border:1px solid #cbd8d4;background:white;color:#254b50;border-radius:8px;min-height:44px;padding:8px;max-width:100%}.filters select{flex:1;min-width:120px}#map{height:calc(100vh - 305px);min-height:360px;max-height:800px;background:#dae7e7;border:1px solid #c3d6d5;border-radius:15px;overflow:hidden;position:relative}.map-empty{height:100%;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;padding:20px;background:radial-gradient(ellipse at 80% 10%,#c1dcd7,transparent),linear-gradient(140deg,#e6efeb,#d5e6e9)}.map-empty>span{font-size:48px;color:#4d8f8e}.map-empty h1{font-size:25px;margin:12px 0}.map-empty p{font-size:13px;color:#53747a}.map-tools{display:flex;flex-wrap:wrap;gap:14px;align-items:center;background:white;border:1px solid #dae3df;border-radius:10px;padding:9px 12px;margin-top:10px}.map-tools label{display:flex;align-items:center;min-height:44px}input[type=checkbox]{accent-color:#18746c;width:18px;height:18px;margin-right:6px}.legend{font-size:11px;display:flex;align-items:center;gap:5px;flex-wrap:wrap}.legend i{width:10px;height:10px;display:inline-block;border-radius:2px}.low{background:#2b9e9e}.mid{background:#ecb351}.high{background:#d85e40}#notice{border-left:3px solid #dfb45d;padding:10px 12px;background:#fffaec;color:#6d5e37;font-size:12px}.place{display:flex;align-items:center;justify-content:space-between;gap:8px}.place h1{font-size:27px;margin:2px 0}.place small,.muted,#coords{color:#688183;font-size:12px}.datebar,.links{display:flex;gap:12px;align-items:center;justify-content:space-between;margin:12px 0}.links a{font-size:12px}.panel{border:1px solid #dae4df;border-radius:13px;padding:20px;margin:15px 0;background:white}.panel h2{font-size:16px;margin:0 0 10px}.section-title{display:flex;justify-content:space-between;align-items:center;gap:10px}.section-title>span{font-size:11px;color:#57777a}.metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:0;margin-top:14px}.metric{padding:12px 6px;border-bottom:1px solid #ecf0ed}.metric label{font-size:11px;color:#688183;display:block}.metric strong{font-size:19px;display:block;font-weight:600;line-height:1.8}.metric small{font-size:10px;color:#688183}.source{font-size:11px;line-height:1.7;color:#708587;margin-bottom:0}.chart{margin:15px 0;min-height:145px;border-radius:8px;background:#f3f8f7;padding:8px}.chart.empty{display:flex;align-items:center;justify-content:center;color:#8b9e9d}.chart svg{display:block;width:100%;height:auto}.contour-options{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:15px}.contour-options label{display:flex;align-items:center;min-height:44px}.candidate,.saved{padding:12px 0;border-top:1px solid #e6edeb}.candidate p,.saved p{font-size:11px;color:#6a8385;margin:5px 0}.candidate button,.saved button{margin:4px 5px 0 0}.badge{display:inline-block;background:#f8edce;color:#80632c;border-radius:4px;font-size:10px;padding:2px 6px}dialog{border:0;border-radius:16px;width:min(620px,96vw);max-height:90dvh;padding:0;color:#21474d;box-shadow:0 20px 100px #103d4640}dialog::backdrop{background:#092c3d88}.dialog-head{display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;background:white;margin:0;padding:16px 22px;border-bottom:1px solid #e2e9e7}.dialog-head h2{font-size:18px;margin:0}.dialog-content{padding:0 22px 24px}.dialog-content h3{margin-top:28px;font-size:15px}.dialog-content label{display:block;margin:14px 0;font-size:12px}.dialog-content input{width:100%;padding:10px;border:1px solid #cddbd6;border-radius:7px;min-height:44px;background:#f7faf8}.sr{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}.active{background:#d8ede6!important;border-color:#258679!important}@media(max-width:850px){header{padding:0 14px;height:62px}header small{display:none}main{display:block;padding:12px}.map-section{position:static}#map{height:46dvh;min-height:290px}.panel{padding:16px}.place{padding-top:12px}.place h1{font-size:24px}.map-tools{gap:8px;font-size:12px}.map-tools button{margin-left:auto}.legend{font-size:10px}.metrics{grid-template-columns:repeat(3,1fr)}header button{font-size:12px;padding:8px}.search input{font-size:16px}button{min-height:44px}aside{padding-bottom:35px}}

#searchResults{display:flex;flex-direction:column;gap:5px;margin-top:6px}#searchResults button{text-align:left}#tideStationSelect{width:100%;margin:6px 0}#terrainRefresh{margin-bottom:10px}

/* Let long URLs/errors wrap inside grid/flex items; do not hide layout overflow. */
body{overflow-wrap:anywhere}
main>*,.panel,.place>div,.section-title>*,.dialog-head>*,.metric,.legend span{min-width:0;max-width:100%}
.metrics{grid-template-columns:repeat(3,minmax(0,1fr))}
.section-title,.datebar,.links,.place,.dialog-head{flex-wrap:wrap}
button,input,select{max-width:100%;min-width:0}
button{overflow-wrap:anywhere;white-space:normal}
#notice,#terrainInfo,#forecastLocation,#tideStation,#importStatus,.source,.candidate p{overflow-wrap:anywhere;word-break:normal}
.chart svg{max-width:100%}
