:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  color: #25343e;
  background: #f4f3ef;
  font-synthesis: none;
  --ink: #25343e;
  --muted: #53616b;
  --blue: #185b80;
  --line: #c9ced1;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; }
header, main, footer { width: 100%; max-width: 1080px; margin: 0 auto; padding: 22px 28px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); text-decoration: none; font-size: 28px; font-weight: 750; min-height: 56px; display: flex; align-items: center; padding: 4px 8px; }
main { flex: 1; }
button, a, input, select, textarea { font: inherit; }
button, .button {
  border: 1px solid transparent; border-radius: 8px; background: var(--blue); color: #fff;
  min-height: 56px; padding: 14px 22px; cursor: pointer; font-weight: 650; line-height: 1.4;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  touch-action: manipulation;
}
button:hover, .button:hover { background: #124a69; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #a45010; outline-offset: 3px; }
.quiet { background: #e5edf2; border-color: #bfccd5; color: #204c67; }
.quiet:hover { background: #d6e4ed; }
.danger { background: #fff; color: #96332b; border-color: #cfaaa6; }
.danger:hover { background: #fae9e7; }
h1 { font-size: clamp(30px, 4vw, 36px); line-height: 1.2; margin: 0; font-weight: 750; overflow-wrap: anywhere; }
h2 { font-size: 23px; line-height: 1.3; margin: 0 0 10px; overflow-wrap: anywhere; }
p { line-height: 1.55; color: var(--muted); overflow-wrap: anywhere; }
.hero { padding: 10px 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.hero p { max-width: 680px; margin-bottom: 0; }
.count { font-size: 16px; color: var(--muted); }
.hero .count { margin: 8px 0 0; }
.hero > button { flex-shrink: 0; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 18px 0 24px; }
.toolbar input { flex: 1; min-width: 220px; }
.toolbar select { flex: 1; min-width: 180px; }
.searchbar { margin: 4px 0 22px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 20px; }
.region-list { display: grid; gap: 12px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.card > button { width: 100%; text-align: left; border-radius: 0; border: 0; background: transparent; color: inherit; padding: 0; display: block; }
.card > button:hover { background: #f1f6f9; }
.card:focus-within { outline: 3px solid #a45010; outline-offset: 3px; }
.card-body { padding: 20px; }
.card-body p { margin: 10px 0 0; }
.card h2 { margin: 10px 0; }
.region-card > button { display: flex; align-items: center; gap: 0; }
.region-thumb { width: 100px; min-width: 100px; height: 100px; margin: 16px 0 16px 16px; border-radius: 6px; background: #e9edef; display: flex; align-items: center; justify-content: center; color: #53616b; text-align: center; font-size: 15px; font-weight: 400; overflow: hidden; }
.region-thumb img { width: 100%; height: 100%; object-fit: cover; }
.region-card .card-body { min-width: 0; flex: 1; padding: 16px 20px; }
.region-card h2 { margin: 0 0 8px; }
.region-card p { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 16px; font-weight: 400; margin-top: 8px; }
.open-arrow { font-size: 34px; color: var(--blue); padding: 16px 24px 16px 0; }
.cover { height: 210px; background: #e9edef; display: flex; align-items: center; justify-content: center; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.badge { font-size: 16px; border-radius: 5px; background: #e8eef2; padding: 7px 11px; display: inline-block; }
.grade { background: #f8e5c6; color: #70420a; font-weight: 750; }
.empty { border: 1px solid var(--line); border-radius: 10px; padding: 28px; background: #fff; grid-column: 1 / -1; }
.empty h2 { margin: 0 0 8px; }
.empty p { margin: 0; }
.breadcrumb { margin: 0 0 14px; }
.breadcrumb button { background: #e5edf2; color: #204c67; border-color: #bfccd5; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
footer { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 14px; background: #f4f3eff5; border-top: 1px solid var(--line); font-size: 16px; padding-top: 12px; padding-bottom: max(12px,env(safe-area-inset-bottom)); }
footer button { flex-shrink: 0; }
dialog { border: 1px solid var(--line); border-radius: 12px; width: min(760px,calc(100% - 24px)); padding: 28px; max-height: 92dvh; color: var(--ink); background: #fff; }
dialog::backdrop { background: #172833a6; }
label { display: block; font-size: 18px; font-weight: 650; margin: 20px 0 8px; }
input, textarea, select { width: 100%; min-width: 0; border: 1px solid #8d9aa3; background: #fff; color: var(--ink); border-radius: 7px; padding: 13px 14px; min-height: 56px; font-size: 18px; }
input::placeholder, textarea::placeholder { color: #68757f; opacity: 1; }
textarea { min-height: 110px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: flex; align-items: center; gap: 14px; min-height: 56px; cursor: pointer; }
.check input { width: 26px; height: 26px; min-height: 26px; accent-color: var(--blue); flex-shrink: 0; }
.form-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.form-head h2 { margin: 0; font-size: 26px; }
#close { width: 56px; flex-shrink: 0; }
.help { font-size: 16px; line-height: 1.5; color: var(--muted); }
.photo { position: relative; width: 100%; background: #e9edef; border-radius: 8px; overflow: hidden; line-height: 0; }
.photo img { width: 100%; display: block; }
.photo svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.photo.editable { touch-action: manipulation; cursor: crosshair; }
.photo polyline { fill: none; stroke: var(--route-color, #ff6845); stroke-width: .7; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 1px #000); }
.line-colors { border: 0; padding: 0; margin: 20px 0; }
.line-colors legend { font-weight: 650; margin-bottom: 10px; }
.color-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.color-option { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px; margin: 0; border: 2px solid var(--line); border-radius: 8px; cursor: pointer; }
.color-option:has(input:checked) { border-color: var(--blue); background: #e5edf2; }
.color-option input { width: 22px; height: 22px; min-height: 22px; padding: 0; margin: 0; flex-shrink: 0; accent-color: var(--blue); }
.color-swatch { width: 24px; height: 24px; flex-shrink: 0; border: 1px solid #53616b; border-radius: 50%; }
.photo-routes { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.photo-routes button { text-align: left; justify-content: flex-start; }
.photo-routes button[aria-pressed=true] { border: 2px solid var(--blue); }
#same-photo { width: 100%; margin: 16px 0 0; }
.details { max-width: 760px; margin: auto; }
.details h1 { margin: 24px 0 16px; }
.offline-info { margin: 26px 0 0; font-size: 16px; }
#offline-ready { margin: 0 0 10px; color: #3f5a49; }
.install { border-top: 1px solid var(--line); }
.install summary { min-height: 56px; padding: 16px 0; cursor: pointer; color: #204c67; font-weight: 600; }
.install p { margin: 0 0 14px; }
.divider { border-top: 1px solid var(--line); margin: 24px 0; }
#toast { position: fixed; bottom: 95px; left: 50%; transform: translateX(-50%); background: #25343e; color: white; border-radius: 8px; padding: 14px 20px; max-width: 90%; z-index: 5; display: none; }
.coord { font-variant-numeric: tabular-nums; }
.note { border-left: 4px solid #648a9e; padding: 16px 20px; background: #eaf0f3; border-radius: 0 8px 8px 0; }
.note p { margin: 8px 0 16px; }
a { color: var(--blue); }
input[type=file] { font-size: 16px; padding: 8px; background: #f4f7f9; }
input[type=file]::file-selector-button { min-height: 48px; border: 1px solid #bfccd5; border-radius: 5px; padding: 10px 14px; font: inherit; font-weight: 650; background: #e5edf2; color: #204c67; cursor: pointer; margin-right: 10px; }
@media (max-width: 600px) {
  header, main, footer { padding-left: 16px; padding-right: 16px; }
  header { padding-top: max(12px,env(safe-area-inset-top)); padding-bottom: 12px; }
  main { padding-top: 20px; }
  .brand { padding-left: 0; }
  header button { font-size: 17px; padding: 12px 16px; }
  .hero { align-items: stretch; flex-direction: column; gap: 18px; padding: 0 0 18px; }
  .hero > button { width: 100%; min-height: 60px; font-size: 20px; }
  .two, .grid { grid-template-columns: 1fr; }
  .toolbar { gap: 12px; }
  .toolbar input, .toolbar select { flex-basis: 100%; }
  .actions button { flex: 1 1 auto; }
  .region-thumb { width: 76px; min-width: 76px; height: 86px; margin-left: 12px; font-size: 14px; }
  .region-card .card-body { padding: 14px; }
  .region-card h2 { font-size: 21px; }
  .open-arrow { padding-right: 14px; font-size: 28px; }
  .empty { padding: 24px 20px; }
  dialog { padding: 20px; }
  footer { font-size: 15px; }
  footer button { padding: 12px; font-size: 16px; }
  #save { width: 100%; min-height: 60px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
:where([hidden]){display:none!important}
.access{max-width:540px;margin:24px auto}
.access h1{font-size:clamp(27px,5vw,36px);margin:24px 0 16px}
.access-question{font-size:23px;line-height:1.5}
.access-buttons{display:grid;gap:14px;margin:24px 0}
.access-buttons button{width:100%;min-height:68px;font-size:23px}
.access-message{min-height:30px;font-size:18px;line-height:1.5}
