  :root {
    --sign: #5b3a29;      /* 観光案内標識の茶色（探す） */
    --route: #2e6a44;     /* 案内標識の緑（決めた・回る） */
    --fest: #c0402a;      /* 祭りの朱色（イベント） */
    --night: #2d3d5c;     /* 夜の藍色（車中泊） */
    --sign-line: #ffffff;
    --here: #1a73e8;      /* 現在地の青 */
    --ink: #22262a;
    --sub: #6b7075;
    --line: #e7e3dd;
    --tint: #f6f2ec;
    --star: #a8760a;
    --paper: #ffffff;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  [hidden] { display: none !important; }
  html, body { height: 100%; }
  body {
    font-family: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
    color: var(--ink);
    background: #e5e3df;
  }
  button { font: inherit; color: inherit; }

  .map-wrap { position: fixed; inset: 0; }
  #map { width: 100%; height: 100%; }

  /* 上部：観光標識風のプレート */
  .sign {
    position: fixed; z-index: 10;
    top: calc(12px + env(safe-area-inset-top, 0px)); left: 12px; right: 12px;
    max-width: 520px; margin: 0 auto;
    background: var(--sign); color: var(--sign-line);
    border-radius: 8px;
    outline: 2px solid var(--sign-line); outline-offset: -6px;
    padding: 14px 20px;
    box-shadow: 0 3px 12px rgba(40, 25, 15, .35);
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  }
  .sign h1 { font-size: 20px; font-weight: 700; letter-spacing: .08em; }
  .sign { align-items: center; }
  .sign-main { min-width: 0; }
  .ctx {
    display: block; max-width: 100%; margin-top: 3px; padding: 2px 8px;
    border: none; border-radius: 4px; background: rgba(255, 255, 255, .16); color: #fff;
    font-size: 13px; font-weight: 700; text-align: left; cursor: pointer;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .ctx:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
  #status { font-size: 13px; font-weight: 500; opacity: .9; text-align: right; }

  /* 下部シート共通 */
  .sheet {
    position: fixed; z-index: 10;
    left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    max-width: 520px; margin: 0 auto;
    background: var(--paper); border-radius: 12px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .22);
  }
  .sheet-head {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--line);
  }
  .sheet-head .title { font-size: 15px; font-weight: 700; }
  .ghost-btn {
    font-size: 14px; font-weight: 700; color: var(--sign);
    background: var(--paper); border: 1.5px solid var(--sign); border-radius: 6px;
    padding: 6px 12px; cursor: pointer; flex: none;
  }
  .list { list-style: none; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .list li + li { border-top: 1px solid var(--line); }
  .empty { padding: 20px; font-size: 15px; line-height: 1.8; color: var(--sub); }

  /* 範囲設定 */
  .panel { padding: 16px 20px; }
  .panel-head { display: flex; justify-content: space-between; align-items: baseline; }
  .panel-head label { font-size: 15px; font-weight: 700; }
  #radiusLabel { font-size: 24px; font-weight: 700; color: var(--sign); font-variant-numeric: tabular-nums; }
  #radius { width: 100%; height: 32px; margin-top: 6px; accent-color: var(--sign); cursor: pointer; }
  .scale { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--sub); margin-top: -2px; }
  .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
  .chip {
    font-size: 14px; font-weight: 700; padding: 7px 13px; border-radius: 6px;
    border: 1.5px solid var(--sign); background: var(--paper); color: var(--sign); cursor: pointer;
  }
  .chip[aria-pressed="true"] { background: var(--sign); color: #fff; }
  .chip.sub { border-color: #9aa0a6; border-style: dashed; color: var(--sub); }
  .chip.sub[aria-pressed="true"] { background: var(--sub); border-color: var(--sub); border-style: solid; color: #fff; }
  .kw { margin-top: 12px; }
  .kw input {
    display: block; width: 100%; height: 42px; padding: 0 12px;
    border: 1.5px solid #cfc8bf; border-radius: 8px; background: #fff;
    font: inherit; font-size: 16px; color: var(--ink);
  }
  .kw input:focus { outline: none; border-color: var(--sign); box-shadow: 0 0 0 3px rgba(91, 58, 41, .2); }

  /* 標識風の大ボタン */
  .plate-btn {
    display: block; width: 100%; height: 50px; margin-top: 12px;
    border: none; border-radius: 8px; background: var(--sign); color: #fff;
    outline: 2px solid #fff; outline-offset: -6px;
    font-size: 17px; font-weight: 700; letter-spacing: .06em; cursor: pointer;
  }
  .plate-btn.green { background: var(--route); margin-top: 0; }
  .plate-btn:disabled { opacity: .45; cursor: default; }

  /* 検索結果 */
  .results { display: flex; flex-direction: column; max-height: 50vh; }
  .item {
    display: flex; gap: 12px; align-items: flex-start; width: 100%;
    background: none; border: none; text-align: left; padding: 12px 16px 12px 20px; cursor: pointer;
  }
  .item[aria-expanded="true"] { background: var(--tint); }
  .num {
    flex: none; width: 26px; height: 26px; border-radius: 50%;
    background: var(--sign); color: #fff; font-size: 13px; font-weight: 700;
    display: grid; place-items: center; margin-top: 1px;
  }
  .name { display: block; font-size: 16px; font-weight: 700; line-height: 1.45; }
  .meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 13px; color: var(--sub); margin-top: 2px; }
  .star { color: var(--star); font-weight: 700; }
  .tag { color: var(--route); font-weight: 700; }
  .detail { background: var(--tint); padding: 2px 20px 14px 58px; font-size: 14px; line-height: 1.7; }
  .detail a { color: var(--here); font-weight: 700; }
  .add-btn {
    display: block; margin-bottom: 8px;
    font-size: 14px; font-weight: 700; padding: 8px 16px; border-radius: 6px;
    border: 1.5px solid var(--route); background: var(--route); color: #fff; cursor: pointer;
  }
  .add-btn.added { background: var(--paper); color: var(--route); }

  /* 候補ボックス */
  .cands { display: flex; flex-direction: column; max-height: 72vh; }
  .cands .list { flex: 1 1 auto; min-height: 140px; }
  .cands .sheet-head .title { color: var(--route); }
  .cand-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; }
  .cand-num {
    flex: none; width: 28px; height: 28px; border-radius: 7px;
    background: var(--route); color: #fff; font-size: 14px; font-weight: 700;
    display: grid; place-items: center;
  }
  .cand-name {
    flex: 1; min-width: 0; background: none; border: none; text-align: left; cursor: pointer; padding: 2px 4px;
  }
  .cand-name { display: block; width: 100%; }
  .cand-name .name {
    font-size: 15px; line-height: 1.4; overflow: hidden; word-break: break-all;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;   /* 長い名前は2行まで */
  }
  .icon-btn {
    flex: none; width: 38px; height: 38px; border-radius: 8px;
    border: 1.5px solid var(--line); background: var(--paper); font-size: 14px; cursor: pointer;
  }
  .icon-btn:disabled { opacity: .3; cursor: default; }
  .cands-foot { padding: 14px 16px 12px; border-top: 1px solid var(--line); }
  .opt-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 10px; }
  .ghost-btn.green { color: var(--route); border-color: var(--route); padding: 8px 12px; }
  .ghost-btn:disabled { opacity: .5; cursor: default; }
  .fix { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
  .fix input { width: 18px; height: 18px; accent-color: var(--route); }
  .opt-note { font-size: 13px; line-height: 1.6; color: var(--route); margin: -2px 0 10px; }
  .opt-note.warn { color: #9a5b00; }
  .foot-note { font-size: 13px; color: var(--sub); margin-top: 8px; text-align: center; line-height: 1.6; }
  .foot-note.warn { color: #b3261e; }
  .text-btn {
    display: block; margin: 6px auto 0; background: none; border: none;
    font-size: 13px; color: var(--sub); text-decoration: underline; cursor: pointer; padding: 4px 8px;
  }

  /* 浮いているボタン（位置はJSで調整） */
  .locate {
    position: fixed; z-index: 10; right: 16px; bottom: 200px;
    width: 56px; height: 56px; border-radius: 50%;
    border: none; background: var(--paper); cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
    display: grid; place-items: center;
  }
  .locate svg { width: 26px; height: 26px; fill: var(--sign); }
  .cand-fab {
    position: fixed; z-index: 10; left: 16px; bottom: 200px;
    height: 48px; padding: 0 16px 0 12px; border-radius: 24px;
    border: none; background: var(--paper); color: var(--route);
    font-size: 15px; font-weight: 700; cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
    display: flex; align-items: center; gap: 8px;
  }
  .cand-fab .count {
    min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px;
    background: var(--route); color: #fff; font-size: 14px; display: grid; place-items: center;
  }
  .locate:active, .cand-fab:active { transform: scale(.96); }

  .locate:focus-visible, .cand-fab:focus-visible, #radius:focus-visible, .chip:focus-visible,
  .ghost-btn:focus-visible, .item:focus-visible, .add-btn:focus-visible, .icon-btn:focus-visible,
  .cand-name:focus-visible, .text-btn:focus-visible { outline: 3px solid var(--here); outline-offset: 2px; }
  .plate-btn:focus-visible { box-shadow: 0 0 0 3px var(--here); }

  /* 地図上のピン */
  .here {
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--here); border: 3px solid #fff;
    box-shadow: 0 0 0 7px rgba(26, 115, 232, .22);
  }
  .pin {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--sign); color: #fff; border: 2px solid #fff;
    font: 700 13px "Zen Kaku Gothic New", "Hiragino Sans", "Meiryo", sans-serif;
    display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
    transition: transform .12s;
  }
  .pin.active { background: #fff; color: var(--sign); border: 3px solid var(--sign); transform: scale(1.3); }
  .epin {
    width: 30px; height: 30px; border-radius: 7px;
    background: var(--fest); color: #fff; border: 2px solid #fff;
    font: 700 13px "Zen Kaku Gothic New", "Hiragino Sans", "Meiryo", sans-serif;
    display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
    transition: transform .12s;
  }
  .epin.active { background: #fff; color: var(--fest); border: 3px solid var(--fest); transform: scale(1.3); }

  /* スポット／イベントの切り替え */
  .seg { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 12px; border: 1.5px solid var(--sign); border-radius: 8px; overflow: hidden; }
  .seg button { height: 38px; border: none; background: var(--paper); color: var(--sign); font-size: 15px; font-weight: 700; cursor: pointer; }
  .seg button + button { border-left: 1.5px solid var(--sign); }
  .seg button[aria-pressed="true"] { background: var(--sign); color: #fff; }
  .seg button:focus-visible { outline: 3px solid var(--here); outline-offset: -3px; }
  .plate-btn.fest { background: var(--fest); }
  .plate-btn.night { background: var(--night); }
  .chip.night { border-color: var(--night); color: var(--night); }
  .chip.night[aria-pressed="true"] { background: var(--night); color: #fff; }
  .chip.fest { border-color: var(--fest); color: var(--fest); }
  .chip.fest[aria-pressed="true"] { background: var(--fest); color: #fff; }

  /* イベント一覧 */
  .events { display: flex; flex-direction: column; max-height: 55vh; }
  .events .sheet-head .title { color: var(--fest); }
  .ev-sub { display: block; font-size: 12px; font-weight: 500; color: var(--sub); margin-top: 1px; }
  .ev-date { flex: none; width: 46px; text-align: center; line-height: 1.25; color: var(--fest); font-weight: 700; margin-top: 1px; }
  .ev-date .d { display: block; font-size: 18px; }
  .ev-date .w { display: block; font-size: 12px; }
  .events .detail { padding-left: 78px; }
  .detail p + p { margin-top: 4px; }
  .ev-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 8px; }
  .ev-actions .add-btn { margin: 0; }
  .badge { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 4px; border: 1px solid currentColor; line-height: 1.7; }
  .badge.high { color: var(--route); }
  .badge.low { color: #9a5b00; }
  .badge.kids { color: var(--here); }
  .ev-note { font-size: 12px; color: var(--sub); line-height: 1.6; padding: 10px 16px 12px 20px; border-top: 1px solid var(--line); }
  .cpin {
    width: 30px; height: 30px; border-radius: 7px;
    background: var(--route); color: #fff; border: 2px solid #fff;
    font: 700 14px "Zen Kaku Gothic New", "Hiragino Sans", "Meiryo", sans-serif;
    display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  }
  @media (prefers-reduced-motion: reduce) { .pin { transition: none; } }

  /* ログイン画面 */
  .login {
    position: fixed; inset: 0; z-index: 30; background: #e5e3df;
    display: grid; place-items: center; overflow-y: auto;
    padding: calc(24px + env(safe-area-inset-top, 0px)) 20px calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .login-box { width: 100%; max-width: 380px; }
  .login .sign { position: static; margin: 0 0 16px; justify-content: center; }
  .login .sign h1 { font-size: 26px; }
  .login-card { background: var(--paper); border-radius: 12px; padding: 22px 20px 18px; box-shadow: 0 3px 14px rgba(0, 0, 0, .14); }
  .login-card label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
  .login-card input {
    display: block; width: 100%; height: 48px; padding: 0 14px; margin-bottom: 16px;
    border: 1.5px solid #cfc8bf; border-radius: 8px; background: #fff;
    font: inherit; font-size: 16px; color: var(--ink);
  }
  .login-card input:focus { outline: none; border-color: var(--sign); box-shadow: 0 0 0 3px rgba(91, 58, 41, .2); }
  .login-card .plate-btn { margin-top: 4px; }
  #loginMsg { font-size: 14px; line-height: 1.7; color: #b3261e; margin-top: 10px; }
  #loginMsg:empty { display: none; }
  .login-note { font-size: 13px; color: var(--sub); text-align: center; margin-top: 14px; line-height: 1.7; }
  .who { font-size: 12px; color: var(--sub); text-align: center; margin-top: 8px; }
  .diag-btn { display: block; margin: 12px auto 0; background: none; border: none; font-size: 13px; color: var(--sign); text-decoration: underline; cursor: pointer; padding: 4px 8px; }
  .diag { list-style: none; margin-top: 12px; padding: 12px 14px; background: var(--tint); border-radius: 8px; font-size: 13px; line-height: 1.7; }
  .diag li { padding-left: 1.4em; text-indent: -1.4em; }
  .diag li + li { margin-top: 4px; }
  .diag li.ok::before { content: "✓ "; color: var(--route); font-weight: 700; }
  .diag li.ng::before { content: "✕ "; color: #b3261e; font-weight: 700; }
  .diag li.ng { color: #8c1d18; font-weight: 700; }
  .diag li.info { color: var(--sub); }
  .diag li.info::before { content: "・"; }
  .raw { font-size: 11px; color: var(--sub); margin-top: 6px; word-break: break-all; }
  .text-btn.inline { display: inline; margin: 0 0 0 6px; font-size: 12px; }

  #error {
    display: none; position: fixed; z-index: 20;
    left: 16px; right: 16px; top: calc(108px + env(safe-area-inset-top, 0px));
    max-width: 520px; margin: 0 auto;
    background: var(--paper); border-radius: 10px; border-left: 6px solid #c5221f;
    padding: 14px 16px; font-size: 15px; line-height: 1.7;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .25); cursor: pointer;
  }

  /* 地名で移動 */
  .ph-left { display: flex; align-items: baseline; gap: 4px; }
  .link-btn { background: none; border: none; padding: 2px 6px; font-size: 13px; font-weight: 700; color: var(--here); text-decoration: underline; cursor: pointer; }
  .link-btn:focus-visible { outline: 3px solid var(--here); outline-offset: 2px; }

  /* 日にちのタブ（プラン） */
  .day-tabs { flex: none; display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px; border-bottom: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
  .day-tab {
    flex: none; min-height: 36px; line-height: 1.4; padding: 6px 12px; border-radius: 6px; border: 1.5px solid var(--route);
    background: var(--paper); color: var(--route); font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
  }
  .day-tab[aria-selected="true"] { background: var(--route); color: #fff; }
  .day-tab .n { font-weight: 500; opacity: .85; margin-left: 4px; }
  .day-tab:focus-visible { outline: 3px solid var(--here); outline-offset: 2px; }

  /* プランの行（日を移す） */
  .cand-body { flex: 1; min-width: 0; }
  .day-sel {
    margin: 4px 0 0 4px; padding: 3px 6px; max-width: 100%;
    border: 1px solid #cfc8bf; border-radius: 6px; background: #fff; font: inherit; font-size: 13px; color: var(--ink);
  }

  /* プランの選択・作成 */
  .plans { display: flex; flex-direction: column; max-height: 70vh; }
  .plan-item { display: flex; align-items: center; gap: 8px; padding-right: 12px; }
  .plan-row {
    flex: 1; min-width: 0; display: flex; gap: 10px; align-items: flex-start;
    background: none; border: none; text-align: left; padding: 12px 8px 12px 20px; cursor: pointer;
  }
  .plan-row .mark { flex: none; width: 20px; color: var(--route); font-weight: 700; }
  .plan-row[aria-pressed="true"] { background: var(--tint); }
  .plan-row:focus-visible { outline: 3px solid var(--here); outline-offset: -3px; }
  .plans-foot { padding: 12px 16px 14px; border-top: 1px solid var(--line); }
  .plans-foot .plate-btn { margin-top: 0; }
  .plan-form { padding: 14px 16px; border-top: 1px solid var(--line); overflow-y: auto; }
  .pf-label { display: block; font-size: 13px; font-weight: 700; margin: 0 0 4px; }
  .pf-input {
    display: block; width: 100%; height: 44px; padding: 0 12px; margin-bottom: 12px;
    border: 1.5px solid #cfc8bf; border-radius: 8px; background: #fff; font: inherit; font-size: 16px; color: var(--ink);
  }
  .pf-input:focus { outline: none; border-color: var(--route); box-shadow: 0 0 0 3px rgba(46, 106, 68, .2); }
  .pf-dates { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
  .pf-start { min-width: 0; }
  .pf-date {
    -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%;
    line-height: 44px; text-align: left; margin-bottom: 0;
  }
  .pf-date::-webkit-date-and-time-value { text-align: left; }
  .stepper { display: flex; align-items: center; height: 44px; border: 1.5px solid #cfc8bf; border-radius: 8px; overflow: hidden; }
  .step-btn { width: 44px; height: 100%; border: none; background: var(--tint); color: var(--route); font-size: 22px; font-weight: 700; cursor: pointer; }
  .step-btn:disabled { opacity: .35; cursor: default; }
  .step-btn:focus-visible { outline: 3px solid var(--here); outline-offset: -3px; }
  #pfDays { min-width: 64px; text-align: center; font-size: 16px; font-weight: 700; }
  .pf-range { margin: 10px 0 12px; padding: 10px 12px; background: var(--tint); border-radius: 8px; font-size: 14px; line-height: 1.7; }
  .pf-range .span { font-weight: 700; font-size: 15px; }
  .pf-range .cross { color: var(--fest); font-weight: 700; margin-left: 6px; }
  .pf-range .days { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 13px; color: var(--sub); }
  .pf-range .days b { color: var(--route); font-weight: 700; }
  .pf-msg { font-size: 13px; color: #b3261e; min-height: 1em; margin-bottom: 8px; }
  .pf-msg:empty { display: none; }
  .pf-btns { display: flex; gap: 10px; align-items: center; }
  .pf-btns .plate-btn { flex: 1; margin-top: 0; }
  .pf-btns .ghost-btn { height: 50px; }

  /* 候補・行程の下部（よく使うボタンだけ表に出す） */
  .foot-row { display: flex; gap: 8px; align-items: stretch; }
  .foot-row .plate-btn { flex: 1; margin-top: 0; min-width: 0; font-size: 16px; }
  .foot-row .ghost-btn { flex: none; height: 50px; }
  .more { margin-top: 4px; text-align: center; }
  .more summary { display: inline-block; list-style: none; cursor: pointer; font-size: 13px; color: var(--sub); padding: 6px 10px; }
  .more summary::-webkit-details-marker { display: none; }
  .more summary::after { content: " ▾"; }
  .more[open] summary::after { content: " ▴"; }
  .more summary:focus-visible { outline: 3px solid var(--here); outline-offset: 2px; }
  .more .fix { justify-content: center; margin: 4px 0 6px; }
