/* ============================================================================
   用地クラウド v2.1 — デザインシステム「Instrument」
   コンセプト: 地図と数字を正確に扱う"計器"。紙のような面(paper)にインクの文字、構造は深い紺、合図は金。
   原則:
   - 文字が主役: Geist(欧文・数字・等幅)+ Hiragino/Noto Sans JP(和文)。階層は太さ・サイズ・字間で作り、色は最小限
   - 面は 3段(page / surface / surface-2)。境界は髪の毛線(hairline)、影は浅く広く。角丸は 8 / 12 / 16 の3種
   - 動きは transform / opacity のみ・300ms未満・強い ease-out。押したら必ず応答。hover はポインタ環境だけ
   - 既存の ID / クラス名は維持(機能コードを変えずに見た目を刷新)
   ============================================================================ */
@font-face { font-family: "Geist Variable"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/vendor/fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono Variable"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/vendor/fonts/geist-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* 色: 紙とインク、構造の紺、合図の金、行動の朱 */
  --page: #f5f4ef; --surface: #ffffff; --surface-2: #faf9f6; --surface-3: #f0eee7;
  --ink: #15161c; --sub: #4f5058; --mut: #696a73; --faint: #b6b7be; --placeholder: #74757e;
  --line: rgba(21,22,28,.08); --line-2: rgba(21,22,28,.13); --line-3: rgba(21,22,28,.22);
  --navy: #142a52; --navy-2: #1d3b6e; --navy-ink: #0f1f3f; --navy-deep: #0a1428;
  --gold: #ffc83d; --gold-2: #e3ab1a; --gold-soft: rgba(255,200,61,.22);
  --org: #c8461f; --org-2: #b23c19; --org-soft: rgba(200,70,31,.12);
  --good: #146c38; --warn: #8a5700; --crit: #b42d2d; --info: #2456a4;
  --on-navy-good: #7fe0a3; --on-navy-bad: #ff9b7a;
  --good-bg: #e9f6ee; --warn-bg: #fff6df; --crit-bg: #fdecec; --info-bg: #e9f0fb;
  /* 形 */
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;
  --sh-sm: 0 1px 2px rgba(21,22,28,.04), 0 1px 1px rgba(21,22,28,.02);
  --sh-md: 0 10px 30px -14px rgba(21,22,28,.22), 0 2px 6px -2px rgba(21,22,28,.06);
  --sh-lg: 0 28px 70px -24px rgba(21,22,28,.38), 0 10px 24px -12px rgba(21,22,28,.14);
  --sh-glow: 0 0 0 1px rgba(255,255,255,.6) inset;
  /* 動き */
  --ease: cubic-bezier(.23, 1, .32, 1);          /* 強い ease-out(入場・応答) */
  --ease-io: cubic-bezier(.77, 0, .175, 1);      /* 画面内の移動 */
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);   /* シート・ドロワー */
  --t-press: 110ms; --t-fast: 150ms; --t: 220ms; --t-slow: 320ms;
  /* 文字 */
  --font: "Geist Variable", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI",
          "Yu Gothic", Meiryo, system-ui, sans-serif;
  --mono: "Geist Mono Variable", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--font); font-size: 14px;
  line-height: 1.6; font-feature-settings: "ss01"; letter-spacing: .005em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
b, strong, .n, .v { font-variant-numeric: tabular-nums; }
h1, h2, h3, .btn, label, .chip, .kpi .k, .pagehead .sub { font-feature-settings: "palt", "ss01"; }
h1, h2, h3 { letter-spacing: -.01em; line-height: 1.3; font-weight: 600; }
p { line-height: 1.8; }
a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 2px; }
::selection { background: rgba(255,200,61,.55); }
.shell { display: flex; min-height: 100vh; }
.eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--mut); font-weight: 500; }
code { font-family: var(--mono); font-size: .92em; background: var(--surface-3); border-radius: 5px; padding: 1px 5px; }

/* ---------- サイドバー(構造の面: 深い紺の素材) ---------- */
.side { width: 236px; flex: none; color: #fff; display: flex; flex-direction: column; gap: 16px; padding: 20px 14px 16px;
  position: sticky; top: 0; height: 100vh; isolation: isolate;
  background: linear-gradient(180deg, #11254d 0%, #0b1a39 100%); }
.side::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(560px 320px at -20% -10%, rgba(255,200,61,.16), transparent 60%), radial-gradient(420px 420px at 120% 110%, rgba(36,86,164,.35), transparent 60%); }
.side::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 1px; background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02)); }
.brand { display: flex; align-items: center; gap: 9px; padding: 2px 8px 6px; font-size: 16px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.brand svg { filter: drop-shadow(0 0 10px rgba(255,200,61,.45)); }
.brand em { flex: none; margin-left: auto; font-family: var(--mono); font-style: normal; font-size: 10px; letter-spacing: .04em; border: 1px solid rgba(255,255,255,.22); border-radius: var(--r-pill);
  padding: 2px 7px; color: rgba(255,255,255,.72); font-weight: 500; }
#nav { display: flex; flex-direction: column; gap: 1px; }
#nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px 8px 12px; border-radius: 10px;
  color: rgba(255,255,255,.72); font-size: 13.5px; font-weight: 500; text-decoration: none; letter-spacing: -.005em;
  transition: background var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-press) var(--ease); }
#nav a::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2.5px; border-radius: 3px; background: var(--gold);
  transform: scaleY(0); transition: transform var(--t) var(--ease); }
#nav a svg { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .7;
  transition: opacity var(--t-fast) ease; }
#nav a.active { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset; }
#nav a.active::before { transform: scaleY(1); }
#nav a.active svg { opacity: 1; }
#nav a:active { transform: scale(.985); }
@media (hover: hover) and (pointer: fine) {
  #nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
  #nav a:hover svg { opacity: 1; }
}
.nav-ext { margin-top: 4px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 10px; }
.nav-ext-head, .nav-group { font-size: 11px; color: rgba(255,255,255,.6); letter-spacing: .06em; padding: 10px 12px 4px; font-weight: 600; }
.nav-ext a { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 9px; color: rgba(255,255,255,.62); font-size: 12.5px; text-decoration: none;
  transition: background var(--t-fast) ease, color var(--t-fast) ease; }
.nav-ext a svg { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
@media (hover: hover) and (pointer: fine) { .nav-ext a:hover { background: rgba(255,255,255,.07); color: #fff; } }
.side-foot { margin-top: auto; display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; padding: 9px 10px; font-size: 12.5px; transition: background var(--t-fast) ease, transform var(--t-press) var(--ease); }
.side-foot:active { transform: scale(.985); }
@media (hover: hover) and (pointer: fine) { .side-foot:hover { background: rgba(255,255,255,.11); } }
.side-foot small { display: block; opacity: .62; font-size: 10.5px; font-weight: 400; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(145deg, #ffd66a, #f2b31f); color: var(--navy-ink); display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex: none; box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 2px 6px -2px rgba(0,0,0,.4); }

/* ---------- レイアウト ---------- */
#main { flex: 1; min-width: 0; padding: 26px 32px 48px; max-width: 1480px; }
body[data-view="settings"] #main > *, body[data-view="register"] #main > *, body[data-view="touki"] #main > *, body[data-view="guide"] #main > * { max-width: 940px; }
#mapKeep { flex: 1; min-width: 0; padding: 26px 32px; }
.loading { color: var(--mut); padding: 40px 0; }
.loading::before { content: ""; display: block; height: 14px; width: 36%; border-radius: 6px; margin-bottom: 14px; background: linear-gradient(90deg, #ebe9e2 25%, #f5f4ef 50%, #ebe9e2 75%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.loading::after { content: ""; display: block; height: 140px; border-radius: 16px; background: linear-gradient(90deg, #ebe9e2 25%, #f5f4ef 50%, #ebe9e2 75%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.pagehead { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.pagehead h1 { font-size: 26px; margin: 0; font-weight: 600; letter-spacing: -.01em; }
.pagehead .sub { color: var(--mut); font-size: 12.5px; }
.pagehead .sub b { color: var(--sub); font-weight: 600; }
.pagehead .eyebrow { margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.pagehead .eyebrow .back { color: var(--navy); text-decoration: none; text-transform: none; letter-spacing: 0; font-family: var(--font); font-size: 12px; font-weight: 500; }
.pagehead .eyebrow .sep { color: var(--faint); }
.deal-head select { font-family: var(--mono); font-size: 12.5px; }
.spacer { flex: 1; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--sh-sm); position: relative; }
.card h2 { font-size: 15px; margin: 0 0 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; letter-spacing: -.005em; line-height: 24px; }
.card h2 .chip { font-weight: 500; font-size: 11.5px; }
.card h2 .chip:not([id]):not(.st) { background: transparent; padding: 0; color: var(--mut); border: none; font-feature-settings: "palt"; }
[role=button][tabindex="0"]:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
h1, h2, h3, .lead, .auth-copy p, .empty, .result-note, .gd-note, .desc { text-wrap: pretty; word-break: auto-phrase; }
.card h2 .chip.st.ok { background: var(--good-bg); color: var(--good); }
.card h2 .chip.st.todo { background: var(--warn-bg); color: var(--warn); }
h2 { font-size: 15px; margin: 0 0 12px; }
.card[onclick] { cursor: pointer; transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) ease, border-color var(--t-fast) ease; }
.card[onclick]:active { transform: scale(.992); }
@media (hover: hover) and (pointer: fine) { .card[onclick]:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--line-2); } }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid2 > *, .grid4 > * { min-width: 0; }
.muted { color: var(--mut); font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mb { margin-bottom: 14px; }
/* 画面切替の入場(段差で表示・操作は妨げない) */
.view-in > * { animation: fadeUp var(--t-slow) var(--ease) both; }
.view-in > *:nth-child(2) { animation-delay: 35ms; } .view-in > *:nth-child(3) { animation-delay: 70ms; }
.view-in > *:nth-child(4) { animation-delay: 105ms; } .view-in > *:nth-child(5) { animation-delay: 140ms; }
.view-in > *:nth-child(n+6) { animation-delay: 170ms; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
/* 空状態 */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 26px 12px; color: var(--mut); font-size: 12.5px; text-align: center;
  border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--surface-2); }
.empty b { color: var(--sub); font-weight: 600; }

/* ---------- ボタン・入力(押した瞬間に応答) ---------- */
.row:has(> input:not([type=checkbox]), > select, > .field) > .btn.sm { min-height: 36px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 8px 15px; font-size: 13px; min-height: 36px;
  font-weight: 600; cursor: pointer; font-family: inherit; color: var(--ink); background: var(--surface-3); line-height: 1.3; white-space: nowrap; letter-spacing: -.005em; text-decoration: none;
  transition: transform var(--t-press) var(--ease), background var(--t-fast) ease, filter var(--t-fast) ease, box-shadow var(--t-fast) ease, opacity var(--t-fast) ease, border-color var(--t-fast) ease; }
.btn.primary { background: linear-gradient(180deg, #c8461f 0%, #b23c19 100%); color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 8px 18px -10px rgba(200,70,31,.75), 0 1px 2px rgba(21,22,28,.08); }
.btn.navy { background: linear-gradient(180deg, #1c3a6b 0%, #142a52 100%); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.14) inset, 0 8px 18px -10px rgba(20,42,82,.6); }
.btn.ghost { background: var(--surface); border-color: var(--line-3); color: var(--navy); }
.btn.sm { padding: 5px 11px; font-size: 12px; border-radius: 9px; min-height: 30px; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
@media (hover: hover) and (pointer: fine) {
  .btn.primary:hover { filter: brightness(1.06); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 12px 22px -10px rgba(200,70,31,.8); }
  .btn.navy:hover { filter: brightness(1.08); }
  .btn.ghost:hover { background: var(--surface-2); border-color: var(--navy); }
  .btn:not(.primary):not(.navy):not(.ghost):hover { background: #e7e5de; }
}
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--info); outline-offset: 2px; }
input, select, textarea { font-family: inherit; font-size: 13px; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; background: #fff;
  color: var(--ink); width: 100%; box-shadow: 0 1px 2px rgba(21,22,28,.03) inset; transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(36,86,164,.16); }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--navy); box-shadow: none; }
input[type=file] { padding: 6px 8px; font-size: 12px; color: var(--sub); background: var(--surface-2); cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; font-size: 12px; color: var(--navy); background: #fff; border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 10px; margin-right: 10px; cursor: pointer; }
input[type=date], input[type=month] { font-family: var(--mono); font-size: 12.5px; }
input[type=number] { font-variant-numeric: tabular-nums; }
select { appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8c95' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
label { font-size: 12px; color: var(--mut); display: block; margin-bottom: 4px; font-weight: 500; letter-spacing: .02em; }
.field { margin-bottom: 11px; }
textarea { min-height: 72px; resize: vertical; line-height: 1.6; }
/* ファイル選択(標準の英語UIを隠して日本語ボタン+ファイル名) */
.file-pick { position: relative; display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; margin: 0; cursor: pointer; border: 1px dashed var(--line-2); border-radius: 10px; padding: 4px 10px 4px 4px; background: var(--surface-2); font-size: 12.5px; color: var(--sub); min-height: 36px; }
.file-pick input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.file-pick .fp-btn { flex: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 11px; font-weight: 600; color: var(--navy); font-size: 12.5px; }
.file-pick .fp-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pick.has { border-style: solid; border-color: var(--navy); background: #fff; color: var(--ink); }
.file-pick:focus-within { outline: 2px solid var(--gold-2); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .file-pick:hover { border-color: var(--navy); } }
.chk-inline { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink); cursor: pointer; margin: 0; flex-wrap: wrap; }
.chk-inline input { width: auto; margin: 0; accent-color: var(--navy); }
.pw-opt { margin: 4px 0 12px; padding: 10px 12px; background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 10px; }
.pw-opt #rg-pw-box { margin-top: 10px; }
button { font-family: inherit; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* ---------- チップ・グレード ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; border-radius: var(--r-pill); padding: 3px 10px; background: var(--surface-3); color: var(--sub);
  white-space: nowrap; border: 1px solid transparent; font-weight: 500; line-height: 1.5; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.grade { font-weight: 700; white-space: nowrap; flex: none; }
.grade.A, .grade.B { color: var(--good); }
.grade.C { color: var(--warn); }
.grade.D { color: var(--crit); }
.chip.outline-good { border-color: rgba(23,138,68,.35); color: var(--good); background: var(--good-bg); font-weight: 600; }
.chip.outline-crit { border-color: rgba(201,58,58,.35); color: var(--crit); background: var(--crit-bg); font-weight: 600; }
.chip.outline-warn { border-color: rgba(168,106,0,.35); color: var(--warn); background: var(--warn-bg); font-weight: 600; }

/* ---------- KPI ---------- */
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px 16px; overflow: hidden; }
.kpi .k { font-size: 12px; color: var(--mut); font-weight: 500; letter-spacing: .02em; }
.kpi .n { font-size: 36px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; color: var(--ink); margin-top: 4px; font-feature-settings: "tnum", "ss01"; }
.kpi .n small { font-family: var(--font); font-size: 14px; font-weight: 500; letter-spacing: 0; margin-left: 4px; color: var(--mut); }
.kpi .d { font-size: 12px; color: var(--sub); margin-top: 4px; line-height: 1.5; }
.kpi.alert { border-color: rgba(180,45,45,.3); background: linear-gradient(180deg, #fff 0%, #fff6f6 100%); }
.kpi.alert::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--crit); }
.kpi.alert .k, .kpi.alert .n { color: var(--crit); }
/* ダッシュボードの統計ストリップ(小さな数字の列)とデータ状態 */
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 0; }
.stat-strip > div { padding: 14px 20px 12px; border-right: 1px solid var(--line); min-width: 0; }
.stat-strip > div:last-child { border-right: none; }
.stat-strip .k { font-size: 12px; color: var(--mut); display: block; }
.stat-strip .n { font-size: 20px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; display: block; margin-top: 2px; }
.stat-strip .n small { font-size: 11px; font-weight: 500; color: var(--mut); letter-spacing: 0; margin-left: 3px; }
.stat-strip .d { font-size: 11.5px; color: var(--sub); display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sys { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.sys-row { min-width: 0; }
.sys-row { display: flex; align-items: center; gap: 10px; padding: 9px 6px; margin: 0 -6px; border-bottom: 1px solid var(--line); font-size: 12.5px; cursor: pointer; border-radius: 8px;
  transition: background var(--t-fast) ease; }
.sys-row:last-child { border-bottom: none; }
.sys-row .st { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 3px rgba(182,183,190,.18); }
.sys-row .st.on { background: var(--good); box-shadow: 0 0 0 3px rgba(23,138,68,.16); }
.sys-row .st.warn { background: var(--gold-2); box-shadow: 0 0 0 3px rgba(227,171,26,.2); }
.sys-row .t { font-weight: 600; flex: none; width: 9.5em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sys-row .d { color: var(--sub); font-size: 12px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sys-row .v { font-family: var(--mono); font-size: 11.5px; color: var(--mut); flex: none; }
.sys-row::after { content: "›"; color: var(--faint); font-size: 16px; line-height: 1; flex: none; margin-left: 2px; }
@media (hover: hover) and (pointer: fine) { .sys-row:hover { background: var(--surface-2); } }

/* ---------- アラート行 ---------- */
.alert-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--faint); border-radius: 10px; padding: 9px 12px;
  margin-bottom: 8px; background: var(--surface-2); transition: background var(--t-fast) ease, transform var(--t-press) var(--ease), border-color var(--t-fast) ease; }
.alert-row:active { transform: scale(.995); }
.alert-row.red { box-shadow: inset 3px 0 0 var(--crit); }
.alert-row.amber { box-shadow: inset 3px 0 0 var(--gold-2); }
.alert-row .dday { font-family: var(--mono); font-weight: 600; width: 54px; flex: none; font-size: 12.5px; letter-spacing: -.01em; }
.alert-row.red .dday { color: var(--crit); }
.alert-row.amber .dday { color: var(--warn); }
.alert-row .txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .alert-row:hover { background: var(--surface-3); border-color: var(--line-2); } }

/* ---------- 表 ---------- */
table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th { text-align: left; font-size: 12px; letter-spacing: .02em; color: var(--mut); font-weight: 600; border-bottom: 1px solid var(--line-2); padding: 8px 8px; }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.list thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
table.list td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tbody tr { transition: background var(--t-fast) ease; cursor: pointer; }
table.list tbody tr:last-child td { border-bottom: none; }
table.list td.dl-code { font-family: var(--mono); font-size: 12px; color: var(--sub); letter-spacing: -.01em; }
table.list td b { font-family: var(--mono); font-weight: 600; }
@media (hover: hover) and (pointer: fine) { table.list tbody tr:hover { background: #f4f2ec; } }
table.list tr.dim td:not(.dl-sel) { opacity: .5; }
table.list td.num + td:not(.num), table.list th.num + th:not(.num) { padding-left: 24px; }
table.list td.grade-col, table.list th.grade-col { text-align: center; }
table.list td.grade-col .gb { min-width: 64px; justify-content: center; }
@media (hover: hover) and (pointer: fine) { table.list tr.dim:hover td { opacity: 1; } }
.bulk[hidden] { display: none; }
.bulk { position: sticky; bottom: 18px; z-index: 5; margin: 14px auto 0; width: max-content; max-width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px;
  background: var(--navy-ink); color: #fff; border-radius: var(--r-pill); box-shadow: 0 12px 32px rgba(15,31,63,.35); font-size: 13px; animation: bulk-in .25s var(--ease); }
.bulk b { font-weight: 600; letter-spacing: -.005em; }
.bulk .vsep { width: 1px; height: 18px; background: rgba(255,255,255,.22); margin: 0 4px; }
.bulk .btn.ghost { background: transparent; border-color: rgba(255,255,255,.28); color: #fff; }
.bulk .btn.navy { background: var(--gold); color: var(--navy-ink); }
@keyframes bulk-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- 地図 ---------- */
.map-wrap { display: flex; gap: 0; height: 100vh; margin: -26px -32px; }
#map { flex: 1; min-width: 0; background: #e9e6d8; position: relative; }
.map-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--mut); font-size: 13px; text-align: center; padding: 40px; }
.chiban-lb { font-size: 10.5px; font-weight: 700; color: #6b4a17; pointer-events: none; white-space: nowrap;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; }
.pole-dot { width: 9px; height: 9px; border-radius: 50%; background: #4a3c28; border: 2px solid #fff; box-shadow: 0 0 0 1px #4a3c28; }
.map-panel { width: 440px; flex: none; background: rgba(255,255,255,.9); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-left: 1px solid var(--line); padding: 20px 22px; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 12px; }
.map-panel > * { min-width: 0; }
.map-panel .mp-head h2 { font-size: 16px; letter-spacing: -.02em; margin-top: 2px; }
.layer-panel { position: absolute; top: 14px; left: 14px; z-index: 5; width: 232px; background: rgba(255,255,255,.84);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,.75); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px;
  max-height: calc(100% - 28px); overflow-y: auto; box-shadow: var(--sh-md), 0 0 0 1px rgba(21,22,28,.05); }
.layer-panel > * { flex: none; }  /* 内容が高さを超えても各行を縮めない */
#measure-out { line-height: 1.45; overflow-wrap: anywhere; }
.lp-head { font-size: 12.5px; font-weight: 600; letter-spacing: -.005em; }
.lp-row { display: flex; align-items: center; gap: 8px; }
.lp-row > label { margin: 0; white-space: nowrap; flex: none; }
.lp-group { font-size: 11px; color: var(--sub); letter-spacing: .04em; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 9px; font-weight: 600; }
.lp-group .muted { font-weight: 400; font-size: 10.5px; letter-spacing: 0; }
.lp-sec .lp-group { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; padding-bottom: 6px; margin-top: 2px; }
.lp-sec .lp-group .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lp-tail { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; flex: none; }
.lp-tail .chev { width: 6px; height: 6px; border-right: 1.5px solid var(--mut); border-bottom: 1.5px solid var(--mut); transform: rotate(45deg); margin: -3px 5px 0 0; transition: transform var(--t) var(--ease); }
.lp-sec.closed .lp-tail .chev { transform: rotate(-45deg); margin-top: 2px; }
.lp-on { font-family: var(--mono); font-size: 10px; color: var(--navy); background: var(--gold-soft); border-radius: var(--r-pill); padding: 1px 7px; letter-spacing: 0; font-weight: 600; }
.lp-on:empty { display: none; }
.lp-sec.closed .lp-body { display: none; }
.lp-sec .lp-body { animation: fade-in .18s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: none; } }
.lp-sec .lp-group:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.lp-chk { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink); margin: 0 -6px; cursor: pointer; border-radius: 7px; padding: 3px 6px; white-space: nowrap;
  transition: background var(--t-fast) ease; }
.lp-chk input { width: auto; accent-color: var(--navy); }
.lp-chk .muted { font-size: 10.5px; margin-left: auto; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.lp-chk > input + * { flex: none; }
@media (hover: hover) and (pointer: fine) { .lp-chk:hover { background: rgba(21,22,28,.05); } }
.note-pin { width: 24px; height: 24px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); display: flex;
  align-items: center; justify-content: center; cursor: pointer; }
.score-hero { display: flex; align-items: center; gap: 10px; }
.score-hero .big { font-size: 34px; font-weight: 600; letter-spacing: -.03em; }
.hz { display: flex; flex-wrap: wrap; gap: 6px; }
.result-note { font-size: 10.5px; color: var(--mut); }
.pin { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid #fff; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.35); cursor: pointer; transition: transform var(--t-fast) var(--ease); font-family: var(--mono); }
@media (hover: hover) and (pointer: fine) { .pin:hover { transform: scale(1.12); } }
.maplibregl-popup-content { border-radius: 14px !important; box-shadow: var(--sh-lg) !important; padding: 12px 14px !important; font-family: var(--font); }
.maplibregl-popup-content { animation: popIn var(--t) var(--ease) both; transform-origin: bottom center; }
.maplibregl-popup-anchor-top .maplibregl-popup-content, .maplibregl-popup-anchor-top-left .maplibregl-popup-content,
.maplibregl-popup-anchor-top-right .maplibregl-popup-content { transform-origin: top center; }
.maplibregl-popup-anchor-left .maplibregl-popup-content { transform-origin: left center; }
.maplibregl-popup-anchor-right .maplibregl-popup-content { transform-origin: right center; }
@keyframes popIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.maplibregl-popup-close-button { font-size: 18px !important; padding: 2px 8px !important; color: var(--mut) !important; border-radius: 6px; }
.maplibregl-ctrl-group { border-radius: 12px !important; box-shadow: var(--sh-md), 0 0 0 1px rgba(21,22,28,.06) !important; overflow: hidden; background: rgba(255,255,255,.92) !important; }
.maplibregl-ctrl-group button { width: 32px !important; height: 32px !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }
.maplibregl-ctrl-scale { border-radius: 4px; font-family: var(--mono); font-size: 10px !important; background: rgba(255,255,255,.7) !important; border-color: var(--line-3) !important; }
.maplibregl-ctrl-attrib { font-family: var(--font); font-size: 10.5px !important; border-radius: 8px 0 0 0; }
.pop-btn { border: none; border-radius: 8px; padding: 7px 10px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; text-decoration: none; display: inline-flex; align-items: center;
  transition: transform var(--t-press) var(--ease), filter var(--t-fast) ease; }
.pop-btn:active { transform: scale(.96); }
.pop-btn.gold { background: var(--gold); color: var(--navy-ink); }
.pop-btn.navy { background: var(--navy); color: #fff; }
.pop-btn.line { background: #fff; color: var(--navy); border: 1px solid var(--line-3); padding: 6px 10px; }
.pop-btn.soft { background: var(--info-bg); color: var(--navy); }

/* 面積フィルタ・候補 */
.af-presets { display: flex; gap: 4px; flex-wrap: wrap; }
.af-presets button { background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-pill); font-size: 10.5px; padding: 2px 9px; cursor: pointer; color: var(--sub); font-family: inherit; font-weight: 500;
  transition: transform var(--t-press) var(--ease), background var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease; }
.af-presets button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.af-presets button:active { transform: scale(.96); }
.cand-dot { width: 18px; height: 18px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: pointer; }
.badge { display: inline-block; font-size: 10px; font-weight: 600; border-radius: var(--r-pill); padding: 1.5px 7px; margin-left: 4px; vertical-align: middle; letter-spacing: .01em; }
.badge.p { background: var(--info-bg); color: var(--info); }
.badge.m { background: #fdeee7; color: var(--org-2); }
.badge.v { background: var(--good-bg); color: var(--good); }
.badge.b { background: var(--surface-3); color: var(--sub); }
.badge.f { background: #eef8e6; color: #3b7d1e; }
.badge.ok { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--crit-bg); color: var(--crit); }
.info-btn { flex: none; border: 1px solid var(--line-2); background: #fff; color: var(--mut); border-radius: 50%; width: 18px; height: 18px; font-size: 10.5px; line-height: 1; font-family: var(--mono);
  cursor: help; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.pub-links summary { font-size: 12px; font-weight: 600; color: var(--navy); padding: 6px 0; }
.pub-links summary::before { content: "▸"; display: inline-block; margin-right: 6px; color: var(--mut); transition: transform var(--t-fast) var(--ease); }
.pub-links[open] summary::before { transform: rotate(90deg); }
.pub-group { font-size: 11px; color: var(--sub); letter-spacing: .04em; margin-top: 10px; font-weight: 600; }
.pub-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.pub-row small { display: block; color: var(--mut); font-size: 11px; }

/* ---------- モーダル(中央・原点は中心) ---------- */
#inq-modal, #inv-modal { position: fixed; inset: 0; background: rgba(15,22,38,.46); display: none; align-items: center; justify-content: center; z-index: 999;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
#inq-modal .inq-box, #inv-modal .inq-box { background: #fff; border-radius: 18px; width: min(660px, 92vw); padding: 18px 20px; box-shadow: var(--sh-lg);
  animation: modalIn var(--t) var(--ease) both; transform-origin: center; }
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }
#inq-modal .inq-head, #inv-modal .inq-head { display: flex; align-items: center; gap: 8px; }
#inq-text { width: 100%; height: 330px; font-size: 12.5px; line-height: 1.7; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; resize: vertical; }
.inq-btn { flex: none; background: var(--info-bg); color: var(--navy); border: 1px solid rgba(36,86,164,.22); border-radius: 6px; font-size: 10px; font-weight: 600; padding: 1px 6px; cursor: pointer;
  transition: transform var(--t-press) var(--ease), background var(--t-fast) ease; }
.inq-btn:active { transform: scale(.95); }
@media (hover: hover) and (pointer: fine) { .inq-btn:hover { background: #dde8f8; } }

/* ---------- かんばん ---------- */
.kb { display: flex; gap: 10px; align-items: flex-start; overflow-x: auto; padding: 2px 2px 14px; scroll-snap-type: x proximity; scrollbar-width: thin;
  mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
.kb.at-end { mask-image: none; -webkit-mask-image: none; }
.kb-col { flex: 0 0 232px; min-width: 0; background: var(--surface-3); border: 1px solid var(--line); border-radius: 16px; padding: 10px; scroll-snap-align: start; max-height: calc(100vh - 150px); display: flex; flex-direction: column; }
.kb-col > .kb-body { overflow-y: auto; min-height: 0; margin: 0 -4px; padding: 0 4px 2px; }
.kb-col.empty-col { flex-basis: 232px; }
.kb-col h3 { font-size: 12.5px; margin: 0 2px 8px; display: flex; gap: 8px; align-items: center; font-weight: 600; letter-spacing: -.005em; }
.kb-col h3 .ttl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kb-sum { font-family: var(--mono); font-size: 10.5px; color: var(--mut); margin: -4px 2px 8px; letter-spacing: .02em; }
.kb-col h3 .no { font-family: var(--mono); font-size: 10.5px; color: var(--mut); font-weight: 500; letter-spacing: .04em; }
.kb-col h3 .cnt { font-family: var(--mono); font-size: 10.5px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0 8px; color: var(--sub); font-weight: 500; margin-left: auto; }
.kb-col .muted.none { font-size: 11.5px; padding: 14px 4px 10px; text-align: center; color: var(--mut); border: 1px dashed var(--line-3); border-radius: 10px; }
.kb-col h3 .sum { font-family: var(--mono); font-size: 10.5px; color: var(--mut); font-weight: 500; }
.kb-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--sh-sm);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) ease, border-color var(--t-fast) ease; }
.kb-card:active { transform: scale(.985); }
@media (hover: hover) and (pointer: fine) { .kb-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--line-2); } }
.kb-card .addr { font-size: 12.5px; font-weight: 600; margin-bottom: 5px; letter-spacing: -.005em; }
.kb-card .meta { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.kb-card .meta .chip { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.kb-card .due { font-family: var(--mono); font-size: 10.5px; font-weight: 600; color: var(--warn); margin-top: 5px; }
.okr { width: 20px; height: 20px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center;
  justify-content: center; margin-left: auto; flex: none; }
.kb-card .due.red { color: var(--crit); }
.kb-card.crit { border-color: rgba(201,58,58,.45); }
.kb-card { position: relative; overflow: hidden; }
.kb-card .fuse { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--p, 100%); background: var(--navy); opacity: .55; border-radius: 0 2px 2px 0; transition: width var(--t-slow) var(--ease-io); }
.kb-card .fuse.amber { background: var(--gold-2); opacity: .9; }
.kb-card .fuse.red { background: var(--crit); opacity: .9; }

/* ---------- 案件詳細 ---------- */
.stepper { display: flex; align-items: center; gap: 0; flex-wrap: wrap; margin: 10px 0 18px; }
.step { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--mut); }
.step .b { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); color: var(--mut); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600;
  transition: background var(--t) ease, transform var(--t) var(--ease); font-family: var(--mono); }
.step.done .b { background: var(--navy); color: #fff; }
.step.done { color: var(--sub); }
.step.now { color: var(--navy); font-weight: 600; }
.step.now .b { background: var(--navy); color: #fff; width: 26px; height: 26px; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--gold-2); }
.step-line { width: 30px; height: 2px; background: var(--line-3); margin: 0 6px; border-radius: 2px; }
.step-line.done { background: var(--navy); }
.check-row { display: grid; grid-template-columns: 1.4fr .7fr 1.8fr; gap: 0; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; align-items: center; }
.finance { background: linear-gradient(160deg, #142a52 0%, #0f1f3f 100%); color: #fff; border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--sh-md); position: relative; overflow: hidden; }
.finance::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(420px 220px at 100% 0%, rgba(255,200,61,.18), transparent 60%); }
.finance .gold { color: var(--gold); }
.finance .g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.finance .g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 6px; }
.finance small { opacity: .72; font-size: 10.5px; display: block; }
.finance b.v { font-size: 19px; letter-spacing: -.02em; white-space: nowrap; display: block; }
.finance b.v.sm { font-size: 13px; letter-spacing: 0; }
.finance b.v.pess { color: #ffb37a; }
.finance b.v.opt { color: var(--on-navy-good); }
.finance .ng { font-size: 14px; color: var(--on-navy-bad); font-weight: 600; }
.c3 .ng, td .ng { font-size: inherit; color: var(--crit); }
.fin-wide { padding: 18px 22px 16px; margin-bottom: 18px; }
.fin-wide .fin-top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.fin-wide .fin-top > b { font-size: 14px; }
.fin-wide .fin-note { font-size: 11.5px; opacity: .78; }
.fin-wide .fin-note b { color: var(--gold); }
.fin-wide .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; }
.fin-wide .g3 > div { padding: 10px 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: var(--r); }
.fin-wide .g3 b.v { font-size: 22px; margin-top: 2px; }
.fin-wide .g4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 14px; }
.fin-wide .fin-foot { margin-top: 12px; opacity: .62; line-height: 1.6; }
.fin-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; }
.fin-fields .field { margin: 0; }
.countdown { border: 1px solid rgba(201,58,58,.45); border-radius: var(--r-lg); padding: 14px 16px; background: var(--surface); }
.bar { height: 7px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--crit); transition: width var(--t-slow) var(--ease-io); }
.timeline .t-row { display: flex; gap: 12px; margin-bottom: 12px; }
.timeline .t-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); margin-top: 7px; flex: none; box-shadow: 0 0 0 3px rgba(182,183,190,.18); }
.timeline .t-at { font-family: var(--mono); font-size: 10.5px; color: var(--mut); }
.res-hero { background: linear-gradient(135deg, #142a52, #1f4079); color: #fff; border-radius: 16px; padding: 16px 18px; box-shadow: var(--sh-md); position: relative; overflow: hidden; }
.res-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(360px 200px at 100% 0%, rgba(255,255,255,.14), transparent 60%); }
.res-hero.bad { background: linear-gradient(135deg, #6a1f1f, #8b2d2d); }
.res-hero.mid { background: linear-gradient(135deg, #6a5215, #8a6c1c); }
.res-hero .score { font-size: 40px; font-weight: 600; line-height: 1; letter-spacing: -.04em; }
.res-grade { font-size: 14.5px; font-weight: 600; }
.res-sub { font-size: 11.5px; opacity: .85; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-demo { font-size: 10.5px; opacity: .8; margin-bottom: 6px; }
.res-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.res-badge { font-size: 11px; font-weight: 600; border-radius: var(--r-pill); padding: 2.5px 10px; background: rgba(255,255,255,.14); }
.res-badge.b-crit { background: rgba(255,120,120,.28); }
.res-badge.b-warn { background: rgba(255,209,102,.3); }
.res-badge.b-good { background: rgba(110,220,140,.22); }
.res-note { margin-top: 8px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.1); border-radius: 8px; padding: 5px 10px; }
.res-note.strong { background: rgba(255,120,120,.25); }
.chk-stack { display: flex; flex-direction: column; gap: 8px; }
.chk-cat { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.chk-cat > summary { display: flex; align-items: center; gap: 8px; padding: 9px 13px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); user-select: none; }
.chk-cat > summary::before { content: "▸"; color: var(--mut); font-size: 10px; transition: transform var(--t-fast) var(--ease); }
.chk-cat[open] > summary::before { transform: rotate(90deg); }
.chk-cat .dots { margin-left: auto; display: flex; gap: 8px; font-size: 10.5px; font-weight: 600; }
.chk-row { padding: 8px 13px; border-top: 1px solid var(--line); }
.chk-row .l1 { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; }
.chk-row .l1 .mk { flex: none; width: 15px; text-align: center; font-weight: 800; }
.chk-row .l1 .sp { flex: 1; }
.chk-row .l2 { margin: 3px 0 0 22px; font-size: 11.5px; color: var(--sub); line-height: 1.65; overflow-wrap: anywhere; }
.chk-lnk { flex: none; font-size: 10.5px; font-weight: 600; }
button.chk-lnk { background: none; border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 8px; color: var(--navy); cursor: pointer; font: inherit; font-size: 10.5px; font-weight: 600;
  transition: transform var(--t-press) var(--ease), background var(--t-fast) ease; }
button.chk-lnk:active { transform: scale(.95); }
@media (hover: hover) and (pointer: fine) { button.chk-lnk:hover { background: var(--info-bg); } }
.touki-call { border: 1px solid #ead9a6; border-left: 3px solid var(--gold-2); background: #fffaeb; border-radius: 11px; padding: 11px 13px; font-size: 12.5px; }
.touki-call .tc-body { font-size: 11.5px; color: #6b5b28; line-height: 1.7; margin-top: 3px; }
.dd-g { font-size: 11px; letter-spacing: .04em; font-weight: 600; color: var(--navy); margin: 10px 0 4px; padding-top: 6px; border-top: 1px solid var(--line); }
.dd-g:first-child { border-top: none; padding-top: 0; margin-top: 2px; }
.hv-row { display: grid; grid-template-columns: 1.2fr .8fr 1fr 1.4fr; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.hv-row select, .hv-row input { padding: 6px 8px; font-size: 12px; }
.hv-res { font-weight: 600; }

/* ---------- メンバー・申請準備 ---------- */
.member-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--surface);
  transition: border-color var(--t-fast) ease, background var(--t-fast) ease; }
.member-row.on { border-color: rgba(23,138,68,.4); background: var(--good-bg); }
.prep-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink); padding: 6px 8px; margin: 0 -8px; border-radius: 8px; cursor: pointer;
  transition: background var(--t-fast) ease; }
.prep-item input { width: auto; accent-color: var(--navy); }
@media (hover: hover) and (pointer: fine) { .prep-item:hover { background: var(--surface-2); } }
.prep-bar { height: 7px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.prep-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2f7d3f, #15a34a); border-radius: 6px; transition: width var(--t-slow) var(--ease-io); }
.sub-dot { width: 14px; height: 14px; background: var(--navy); border: 2px solid #fff; border-radius: 3px; box-shadow: 0 1px 4px rgba(0,0,0,.4); cursor: pointer; position: relative; }
.sub-dot::after { content: "⚡"; position: absolute; inset: 0; font-size: 9px; line-height: 11px; text-align: center; color: var(--gold); }
.sub-dot.has-cap { background: var(--good); }
.sub-dot.no-cap { background: var(--crit); }
.cap3-strip { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--info-bg); border: 1px solid rgba(36,86,164,.16); border-radius: 10px; padding: 8px 12px; margin-top: 8px; }
.cap3-strip .c3-h { font-size: 11px; color: var(--sub); font-weight: 600; }
.cap3-strip .c3 small { display: block; font-size: 10px; color: var(--sub); }
.cap3-strip .c3 b { font-size: 13.5px; }
.cap3-strip .c3.pess b { color: #b04a00; }
.cap3-strip .c3.opt b { color: var(--good); }
.lay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.lay-grid label { font-size: 11.5px; color: var(--sub); font-weight: 600; display: flex; flex-direction: column; gap: 3px; }
.lay-grid input, .lay-grid select { padding: 7px 9px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; font-size: 13px; }
.lay-out { margin-top: 10px; }
.lay-res { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: var(--info-bg); border: 1px solid rgba(36,86,164,.16); border-radius: 10px; padding: 9px 12px; }
.lay-res small { display: block; font-size: 10.5px; color: var(--sub); }
.lay-res b { font-size: 16px; letter-spacing: -.01em; }

/* ---------- トースト(下から積み上げ・下へ抜ける・ホバーで一時停止) ---------- */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; pointer-events: none;
  width: min(92vw, 420px); align-items: center; }
.toast-item { pointer-events: auto; background: rgba(21,22,28,.94); color: #fff; border-radius: 12px; padding: 11px 16px; font-size: 13px; line-height: 1.5; box-shadow: var(--sh-lg);
  max-width: 100%; cursor: pointer; opacity: 1; transform: translateY(0); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform 400ms var(--ease), opacity 400ms ease; }
@supports (transition-behavior: allow-discrete) {
  .toast-item { @starting-style { opacity: 0; transform: translateY(100%); } }
}
.toast-item.out { opacity: 0; transform: translateY(8px); transition-duration: 200ms; }
.toast-item.err { background: rgba(201,58,58,.95); }
.toast-item.ok { background: rgba(23,138,68,.95); }
#toast.show { opacity: 1; }

/* ---------- 細部 ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cfccc1; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b6b2a4; border: 2px solid transparent; background-clip: content-box; }
.member-row .btn, .card .btn.sm { flex: none; }
.tso-row { display: grid; grid-template-columns: 1.3fr 1fr 2.2fr auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.tso-row input { padding: 6px 8px; font-size: 11.5px; }
.topic { border: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--info); border-radius: 10px; padding: 9px 12px 9px 14px; margin-bottom: 8px; background: var(--surface-2); }
.topic.unread { box-shadow: inset 3px 0 0 var(--org); }
.topic .t-title { font-size: 12.5px; font-weight: 600; }
.topic .t-body { font-size: 11.5px; color: var(--sub); white-space: pre-wrap; line-height: 1.6; margin-top: 3px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
.topic.open .t-body { display: block; -webkit-line-clamp: unset; }
.topic .t-more { font-size: 11px; color: var(--navy); font-weight: 600; cursor: pointer; margin-top: 4px; display: inline-block; }
.topic .t-meta { font-family: var(--mono); font-size: 10.5px; color: var(--mut); margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.scan-row { display: flex; gap: 8px; align-items: center; font-size: 11.5px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.scan-row .lv { flex: none; width: 52px; font-weight: 600; }

/* ---------- 画面幅の対応 ---------- */
/* 地図ページ: 左メニューをアイコンのみの細いレールにして地図を広く(デスクトップ) */
@media (min-width: 761px) and (max-width: 1500px) {
  body[data-view="map"] .side { width: 64px; padding-left: 8px; padding-right: 8px; }
  body[data-view="map"] .brand span, body[data-view="map"] .brand em, body[data-view="map"] .nav-ext, body[data-view="map"] .side-foot > div:not(.avatar) { display: none; }
  body[data-view="map"] .nav-group { font-size: 0; padding: 6px 0 0; border-top: 1px solid rgba(255,255,255,.1); margin-top: 6px; }
  body[data-view="map"] .brand { justify-content: center; padding: 2px 0 6px; }
  body[data-view="map"] #nav a { justify-content: center; padding: 10px 0; font-size: 0; gap: 0; }
  body[data-view="map"] #nav a svg { margin: 0; width: 20px; height: 20px; }
  body[data-view="map"] .side-foot { padding: 6px; justify-content: center; border-radius: 50%; width: 44px; margin-left: auto; margin-right: auto; }
  body[data-view="map"] .maplibregl-ctrl-bottom-left { left: 250px; }
}
@media (max-width: 1100px) {
  .grid4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip > div:nth-child(2n) { border-right: none; }
  .map-panel { width: 360px; }
  .fin-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin-wide .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 空容量まとめ(全列一覧) ---------- */
.gr-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.gr-filters select, .gr-filters input { padding: 6px 8px; font-size: 12px; width: auto; flex: 0 1 auto; }
.gr-filters select { max-width: 200px; padding-right: 26px; }
.gr-filters label.chk { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 12px; margin: 0; padding: 4px 6px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.gr-filters label.chk input { width: auto; margin: 0; }
.gr-filters input:not([type=checkbox]) { flex: 1 1 160px; min-width: 120px; }
.gr-filters input[type=checkbox] { width: 15px; height: 15px; flex: none; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-pill); overflow: hidden; background: #fff; padding: 2px; gap: 2px; }
.seg button { border: none; background: transparent; padding: 4px 11px; font-size: 12px; color: var(--sub); cursor: pointer; border-radius: var(--r-pill); font-family: inherit; font-weight: 500;
  transition: background var(--t-fast) ease, color var(--t-fast) ease; }
.seg button.on { background: var(--navy); color: #fff; }
.seg button:active { transform: scale(.97); }
.gr-wrap { overflow: auto; max-height: 68vh; border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; -webkit-overflow-scrolling: touch; }
.gr-table { font-size: 12px; min-width: 1500px; }
.gr-table th { white-space: nowrap; padding: 7px 7px; line-height: 1.25; text-transform: none; letter-spacing: 0; font-family: var(--font); font-size: 11px; }
.gr-table th small { display: block; font-weight: 400; font-size: 10px; color: var(--mut); }
.gr-table td { padding: 5px 7px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gr-table th.gr-name, .gr-table td.gr-name { position: sticky; left: 0; z-index: 2; background: inherit; box-shadow: 1px 0 0 var(--line); }
.gr-table thead th.gr-name { z-index: 4; }
.gr-table tbody tr { background: var(--surface); }
.gr-table td.num, .gr-table th.num { text-align: right; }
.gr-table th.num small { text-align: right; }
.gr-legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 11px; color: var(--mut); margin-top: 8px; }
.gr-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; border: 1px solid var(--line-2); }
.gr-table td.gr-name { white-space: normal; min-width: 120px; }
.gr-table td.gr-small { font-size: 11px; color: var(--sub); white-space: normal; min-width: 90px; max-width: 200px; }
.gr-table td.gr-note { font-size: 11px; color: var(--sub); max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.gr-table td.gr-tso { font-size: 11px; color: var(--sub); }
.gr-table tr.gr-ch, .gr-table tr.gr-ch td { background: #fffbea; }
.gr-table tr.gr-new, .gr-table tr.gr-new td { background: #eef5ff; }
.gr-pos { color: var(--good); font-weight: 600; }
.gr-zero { color: var(--crit); font-weight: 600; }
.gr-strong { font-size: 13px; }
.gr-mark { display: inline-block; font-family: var(--mono); font-size: 10px; font-weight: 600; border-radius: var(--r-pill); padding: 1px 7px; background: var(--warn-bg); color: var(--warn); white-space: nowrap; }
.gr-mark.up { background: var(--good-bg); color: var(--good); }
.gr-mark.down { background: var(--crit-bg); color: var(--crit); }
.gr-mark.new { background: var(--info-bg); color: var(--info); }
.gr-pubrow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.gr-pub { font-size: 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px 10px; color: var(--sub); }
.gr-pub em { font-style: normal; color: var(--org-2); font-weight: 600; }
.gr-detail .gr-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 12px; margin-top: 8px; }
.gr-detail .gr-kv div { border-bottom: 1px solid var(--line); padding: 4px 0; font-size: 12.5px; overflow-wrap: anywhere; }
.gr-detail .gr-kv small { display: block; color: var(--mut); font-size: 10.5px; }
.gr-verdict { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: var(--info-bg); color: var(--info); font-weight: 600; font-size: 12.5px; }
.gr-verdict.ok { background: var(--good-bg); color: var(--good); }
.gr-verdict.ng { background: var(--crit-bg); color: var(--crit); }

/* ---------- AIデータセンター用地 ---------- */
.dc-presets { display: grid; grid-template-columns: 1fr; gap: 8px; }
.dc-preset { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 10px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; background: var(--surface-2); font-size: 12px; }
.dc-preset > b { grid-column: 1 / -1; font-size: 13px; }
.dc-preset small { display: block; color: var(--mut); font-size: 10.5px; }
.pw-sub { min-width: 22px; height: 22px; padding: 0 4px; border-radius: 6px; background: #fff; border: 2px solid #8a887f; color: #151513; font-size: 10px; font-weight: 800; font-family: var(--mono);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.3); cursor: pointer; line-height: 1; }
.pw-sub.hv { background: #fff7e3; }
.pw-sub.sup { background: var(--good); color: #fff; border-color: #0b7a2d; }

/* ---------- 太陽光発電所の事業者調査 ---------- */
.sol-pin { width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: #5a3b00; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; }
.sol-dot { width: 12px; height: 12px; border-radius: 3px; background: #f2a900; border: 2px solid #fff; box-shadow: 0 0 0 1px #8a6d1c; cursor: pointer; }
.sol-dot.mid { width: 16px; height: 16px; }
.sol-dot.big { width: 22px; height: 22px; border-radius: 5px; }
.sol-site { width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: pointer; }
.sol-cand.exact { background: var(--good-bg); border-radius: 8px; }
.chk-cat-head { padding: 8px 13px; font-size: 12px; font-weight: 600; color: var(--sub); border-bottom: 1px solid var(--line); }
.gd-steps { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.gd-steps > div { display: flex; gap: 10px; align-items: flex-start; line-height: 1.6; }
.gd-steps .n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: var(--navy-ink); display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; font-family: var(--mono); }
.gd-steps > div > span:last-child { min-width: 0; }

/* ---------- ため池 ---------- */
.tk-hero { background: var(--info-bg); border: 1px solid rgba(36,86,164,.16); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-size: 12.5px; }
.tk-hero .btn.sm { padding: 5px 9px; }
.tk-legend { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 3px; vertical-align: middle; }

/* ---------- v2.1: 判定バッジ(判子)・契約の印・目標グリッド・FAB・設定の目次 ---------- */
.gb { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px 0 2px; border-radius: 8px; font-family: var(--mono); font-weight: 600; font-size: 12px; line-height: 1;
  font-variant-numeric: tabular-nums; white-space: nowrap; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink); vertical-align: middle; }
.gb i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; font-style: normal; color: #fff; background: var(--g, var(--mut)); font-size: 11.5px; }
.gb[data-g="A"], .gb[data-g="B"] { --g: var(--good); } .gb[data-g="C"] { --g: var(--warn); } .gb[data-g="D"] { --g: var(--crit); }
.gb.lg { height: 32px; font-size: 15px; padding: 0 12px 0 3px; border-radius: 10px; gap: 8px; }
.gb.lg i { width: 26px; height: 26px; border-radius: 7px; font-size: 14px; }
.gb.only { padding-right: 2px; }
.seal { display: inline-grid; place-items: center; padding: 3px 8px; color: var(--org); border: 2px solid currentColor; border-radius: 5px; font-weight: 700; font-size: 12px; letter-spacing: .08em;
  transform: rotate(-4deg); animation: stamp 220ms var(--ease) both; background: rgba(255,255,255,.7); }
@keyframes stamp { from { opacity: 0; transform: rotate(-4deg) scale(1.4); } to { opacity: 1; transform: rotate(-4deg) scale(1); } }
/* 1,000筆の目標グリッド */
.goal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; align-items: center; padding: 22px 24px; overflow: hidden; position: relative; }
.goal .gl { min-width: 0; }
.goal .n { font-size: 44px; font-weight: 600; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; margin: 6px 0 4px; }
.goal .n small { font-size: 15px; color: var(--mut); font-weight: 500; letter-spacing: 0; margin-left: 6px; }
.goal .legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--sub); margin-top: 10px; }
.goal .legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.pgrid { display: grid; grid-template-columns: repeat(50, 1fr); gap: 3px; }
.pgrid span { aspect-ratio: 1; border-radius: 1.5px; background: transparent; box-shadow: inset 0 0 0 1px #d9d6cc; transition: background var(--t) ease; }
.pgrid span.c { background: var(--navy); box-shadow: none; }
.pgrid span.a { background: #c99a12; box-shadow: none; }
.pgrid span.p { background: #8c9bb8; box-shadow: none; }
.fab { display: none; }
.toc { position: sticky; top: 24px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.toc a { display: block; padding: 7px 10px; border-radius: 8px; font-size: 12.5px; color: var(--sub); text-decoration: none; border-left: 2px solid transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toc a.on { color: var(--navy); font-weight: 600; background: var(--surface); border-left-color: var(--gold-2); }
@media (hover: hover) and (pointer: fine) { .toc a:hover { background: var(--surface); color: var(--navy); } }
.settings-wrap { display: grid; grid-template-columns: 212px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-wrap > div { min-width: 0; }
.settings-wrap .card { scroll-margin-top: 20px; }
.card > p.desc, .card .desc { max-width: 42em; font-size: 13px; color: var(--sub); line-height: 1.8; }
/* 判定の結論バー(案件詳細) */
.verdict { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; box-shadow: var(--sh-sm); }
.verdict .vd { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.verdict .vd small { font-size: 11px; color: var(--mut); }
.verdict .vd b { font-size: 14px; letter-spacing: -.01em; white-space: nowrap; }
.verdict .vsep { width: 1px; height: 28px; background: var(--line-2); }
.verdict.bad { border-color: rgba(180,45,45,.35); background: linear-gradient(90deg, #fff6f6, #fff); }
.verdict.ok { border-color: rgba(20,108,56,.35); background: linear-gradient(90deg, #f0f9f3, #fff); }
.chk-pass { display: flex; align-items: center; gap: 8px; padding: 8px 13px; border-top: 1px solid var(--line); font-size: 12px; color: var(--good); font-weight: 600; cursor: pointer; user-select: none; }
.chk-pass::after { content: "▾"; color: var(--mut); margin-left: auto; font-size: 11px; }
.chk-pass.open::after { content: "▴"; }
.chk-row.flag { background: var(--warn-bg); box-shadow: inset 3px 0 var(--gold-2); }
.chk-row.flag.crit { background: var(--crit-bg); box-shadow: inset 3px 0 var(--crit); }
.chk-hidden { display: none; }
.chk-hidden.open { display: block; }
/* デスクトップ: 案件詳細の右カラムを固定 */
/* 案件詳細: 主列(チェック・地権者・申請・書類・メモ) + 右の要約列 400px。右列は画面に収まるときだけ追従 */
@media (min-width: 761px) { .deal-grid { grid-template-columns: minmax(0, 1fr) 400px; } body[data-view="deal"] .grid2 > :last-child.sticky-ok { position: sticky; top: 24px; } }
@media (min-width: 761px) and (max-width: 1180px) { .deal-grid { grid-template-columns: minmax(0, 1fr) 340px; } }

/* ---------- スマホ用 下タブバー / その他シート(≤760px で表示) ---------- */
.tabbar { display: none; }
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(15,22,38,.42); display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.sheet[hidden] { display: none; }
.sheet-box { width: 100%; max-width: 560px; background: #fff; border-radius: 20px 20px 0 0; padding: 8px 14px calc(16px + env(safe-area-inset-bottom)); box-shadow: var(--sh-lg);
  animation: sheetIn var(--t) var(--ease) both; }
@keyframes sheetIn { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-handle { width: 36px; height: 4px; border-radius: 4px; background: #d2cfc4; margin: 2px auto 12px; }
.sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sheet-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 11px 4px; border-radius: 12px; text-decoration: none; color: var(--ink); font-size: 11.5px; font-weight: 500; background: var(--surface-3); }
.sheet-grid a.active { background: var(--info-bg); color: var(--navy); font-weight: 600; }
.sheet-grid a:active { transform: scale(.96); }
.sheet-grid svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sheet-me { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-3); font-size: 13px; }
.sheet-me .avatar { width: 30px; height: 30px; }
.sheet-me small { display: block; color: var(--mut); font-size: 11px; }
.sheet-me .btn { margin-left: auto; }
.lp-toggle { display: none; }
.sheet-grip { display: none; }

@media (max-width: 760px) {
  :root { --topbar-h: 52px; --tabbar-h: calc(58px + env(safe-area-inset-bottom)); }
  .shell { flex-direction: column; }
  .side { width: auto; height: var(--topbar-h); box-sizing: border-box; position: sticky; top: 0; z-index: 20; flex-direction: row; align-items: center; gap: 8px; padding: 0 12px; overflow: visible;
    background: rgba(13,27,58,.96); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
  .side::after { display: none; }
  .brand { padding: 0; font-size: 15px; gap: 7px; flex: 1; }
  .brand span { display: inline; }
  #nav { display: none; }
  .nav-ext { display: none; }
  .side-foot { margin-top: 0; padding: 4px; border-radius: 50%; background: transparent; border: none; gap: 0; }
  .side-foot > div { display: none; }
  .side-foot .avatar { width: 32px; height: 32px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,.94); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-top: 1px solid var(--line); padding: 5px 4px calc(5px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 5px 0 3px; border: none; background: none;
    font: inherit; font-size: 10.5px; font-weight: 500; color: var(--sub); text-decoration: none; border-radius: 10px; -webkit-tap-highlight-color: transparent; }
  .tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar .active { color: var(--navy); font-weight: 600; }
  .tabbar .active svg { stroke-width: 2.1; }
  .tabbar a:active, .tabbar button:active { transform: scale(.94); }
  #main { padding: 14px 14px calc(var(--tabbar-h) + 16px); }
  /* タップ領域: ボタン・入力は 42px 以上(インライン指定の小さいパディングでも効く) */
  .btn, .btn.sm, button.btn, a.btn, .row:has(> input:not([type=checkbox]), > select, > .field) > .btn.sm { min-height: 42px; }
  .file-pick { min-height: 42px; flex-basis: 100%; }
  input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select, .map-panel input, .layer-panel input, .gr-filters select, .gr-filters input:not([type=checkbox]) { min-height: 42px; }
  .map-panel .btn.primary, #btn-assess { min-height: 48px; }
  .info-btn { min-height: 0; width: 22px; height: 22px; font-size: 12px; position: relative; }
  .info-btn::after { content: ""; position: absolute; inset: -10px; }  /* 見た目は小さく、タップ領域は 42px */
  #mapKeep { padding: 0; }
  .grid2 { grid-template-columns: 1fr; }
  .grid4 { gap: 10px; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip > div { padding: 8px 12px; }
  .stat-strip > div:nth-child(2n) { border-right: none; }
  .card { padding: 14px 14px; border-radius: 14px; }
  .kpi { padding: 14px 14px 12px; }
  .kpi .n { font-size: 30px; }
  .pagehead { margin-bottom: 14px; }
  .pagehead h1 { font-size: 21px; }
  .pagehead .sub { font-size: 12px; }
  input, select, textarea { font-size: 16px; }   /* iOS のフォーカス時ズームを防ぐ */
  .btn { padding: 11px 16px; font-size: 14px; }
  .btn.sm { padding: 9px 12px; font-size: 12.5px; }
  .lp-chk { padding: 6px 6px; font-size: 13.5px; }
  .lp-chk input { width: 18px; height: 18px; }
  /* 地図: 画面いっぱい。レイヤーパネルは折りたたみ、判定パネルは下から出るシート(つまみで開閉) */
  .map-wrap { position: relative; margin: 0; height: calc(100dvh - var(--topbar-h) - env(safe-area-inset-top) - var(--tabbar-h)); flex-direction: column; overflow: hidden; }
  #map { position: relative; flex: 1; }
  .layer-panel { width: min(74vw, 300px); top: 10px; left: 10px; max-height: calc(100% - 92px); padding: 8px 12px 10px; }
  .layer-panel.collapsed { width: auto; max-height: none; padding: 0; overflow: hidden; border-radius: var(--r-pill); }
  .layer-panel.collapsed > * { display: none; }
  .layer-panel.collapsed > .lp-toggle { display: flex; }
  .lp-toggle { display: flex; align-items: center; gap: 6px; padding: 9px 13px; font-size: 13px; font-weight: 600; color: var(--navy); cursor: pointer; margin: -8px -12px 0; -webkit-tap-highlight-color: transparent; }
  .layer-panel.collapsed .lp-toggle { margin: 0; }
  .layer-panel .lp-head { display: none; }
  .lp-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
  .lp-toggle .x { margin-left: auto; opacity: .6; font-weight: 400; }
  .layer-panel.collapsed .lp-toggle .x { display: none; }
  .map-panel { position: absolute; left: 0; right: 0; bottom: 0; width: auto; max-height: 68dvh; border-left: none; border-top: 1px solid var(--line);
    border-radius: 20px 20px 0 0; box-shadow: var(--sh-lg); padding: 0 16px 18px; z-index: 6; gap: 10px; transition: max-height var(--t) var(--ease); }
  .map-panel::before { display: none; }
  .map-panel.peek { max-height: 62px; overflow: hidden; }
  .sheet-grip { display: flex; align-items: center; justify-content: center; gap: 8px; flex: none; margin: 0 -16px; padding: 10px 16px 6px; cursor: pointer; -webkit-tap-highlight-color: transparent; position: sticky; top: 0; background: rgba(255,255,255,.92); z-index: 2; }
  .sheet-grip::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; border-radius: 4px; background: #d2cfc4; transform: translateX(-50%); }
  .sheet-grip b { font-size: 13.5px; margin-top: 8px; }
  .sheet-grip .arr { margin-top: 8px; color: var(--mut); font-size: 12px; }
  .map-panel.peek .sheet-grip .arr::after { content: "▲ 開く"; }
  .map-panel:not(.peek) .sheet-grip .arr::after { content: "▼ 閉じる"; }
  .map-panel > .mp-head { display: none; }
  .lay-res { grid-template-columns: 1fr 1fr; }
  .hv-row { grid-template-columns: 1fr 1fr; }
  .tso-row { grid-template-columns: 1fr; }
  .check-row { grid-template-columns: 1fr; }
  #toast { bottom: calc(var(--tabbar-h) + 8px); }
  .bulk { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 10px); width: auto; margin: 0; justify-content: center; flex-wrap: wrap; z-index: 26; }
  body:has(#bulk:not([hidden])) .fab { display: none; }
  .tabbar a, .tabbar button { position: relative; }
  .tabbar .active::before { content: ""; position: absolute; top: 2px; left: 50%; width: 52px; height: 30px; transform: translateX(-50%); border-radius: 15px; background: var(--gold-soft); z-index: -1; }
  .tabbar .active { color: var(--navy-ink); }
  .fab { display: inline-flex; align-items: center; gap: 8px; position: fixed; right: 16px; bottom: calc(var(--tabbar-h) + 14px); z-index: 25; height: 50px; padding: 0 18px 0 16px; border-radius: 25px; border: none;
    background: linear-gradient(180deg, #c8461f 0%, #b23c19 100%); color: #fff; font: inherit; font-size: 14px; font-weight: 600; box-shadow: 0 12px 28px -10px rgba(200,70,31,.75), 0 2px 6px rgba(21,22,28,.18); cursor: pointer; }
  .fab svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2.4; stroke-linecap: round; }
  .fab:active { transform: scale(.95); }
  body:not([data-view="dash"]):not([data-view="pipeline"]):not([data-view="deals"]) .fab { display: none; }
  body[data-view="dash"] .pagehead .btn.primary, body[data-view="pipeline"] .pagehead .btn.primary { display: none; }
  .maplibregl-ctrl-group button { width: 44px !important; height: 44px !important; }
  .maplibregl-ctrl-zoom-in, .maplibregl-ctrl-zoom-out { display: none !important; }
  .map-panel, .layer-panel { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .map-panel.peek { max-height: 128px; }
  .map-panel.peek .sheet-grip { padding-bottom: 2px; }
  .map-panel.peek .sheet-grip b { font-size: 12.5px; }
  .map-panel .field input, .map-panel .field select { min-height: 44px; }
  .maplibregl-ctrl-attrib { font-size: 9.5px !important; }
  /* 案件詳細: 結論 → 期限 → チェックの順。ステップは8分割のバー */
  body[data-view="deal"] .grid2 > :last-child { order: -1; }
  .stepper { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; margin: 6px 0 16px; position: relative; padding-top: 18px; }
  .stepper::before { content: attr(data-now); position: absolute; top: 0; left: 0; font-size: 12px; font-weight: 600; color: var(--navy); }
  .stepper .step { display: block; height: 4px; border-radius: 2px; background: var(--line-3); font-size: 0; }
  .stepper .step.done { background: var(--navy); }
  .stepper .step.now { background: var(--gold-2); }
  .stepper .step .b { display: none; }
  .stepper .step-line { display: none; }
  .pagehead .spacer { display: none; }
  .deal-head .btn, .deal-head select { flex: 1 1 45%; width: auto; }
  .verdict { gap: 8px 12px; padding: 12px 14px; }
  .verdict .vsep { display: none; }
  .verdict .vd { flex: 1 1 100%; }
  .verdict .gb.lg + .vd { flex: 1 1 calc(100% - 96px); }
  .verdict .vd b { white-space: normal; }
  .verdict .seal { order: -1; margin-left: auto; }
  table.list { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  /* 案件一覧: 表 → 3行のコンパクトカード(住所 / 状態・判定・担当 / 面積・価格・管轄) */
  table.list.dl, table.list.dl tbody, table.list.dl td { display: block; white-space: normal; }
  table.list.dl thead { display: none; }
  table.list.dl tr { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 10px 42px; margin-bottom: 8px; background: var(--surface); }
  table.list.dl tr::before { content: ""; flex-basis: 100%; height: 0; order: 2; }
  table.list.dl td { border: none; padding: 0; display: flex; gap: 5px; align-items: center; font-size: 13px; min-width: 0; }
  table.list.dl td::before { content: attr(data-l); color: var(--mut); font-size: 10.5px; flex: none; }
  table.list.dl td.dl-addr { flex: 1 1 100%; order: 0; font-size: 14.5px; font-weight: 600; padding-right: 64px; line-height: 1.35; }
  table.list.dl td.dl-addr::before { content: none; }
  table.list.dl td[data-l="状態"], table.list.dl td[data-l="判定"], table.list.dl td[data-l="担当"] { order: 1; }
  table.list.dl td[data-l="状態"]::before, table.list.dl td[data-l="判定"]::before, table.list.dl td[data-l="担当"]::before { content: none; }
  table.list.dl td[data-l="担当"] { margin-left: auto; }
  table.list.dl td[data-l="面積"], table.list.dl td[data-l="価格"], table.list.dl td[data-l="管轄"] { order: 3; font-family: var(--mono); font-size: 12px; color: var(--sub); }
  table.list.dl td[data-l="手紙/返信"] { order: 4; flex-basis: 100%; }
  table.list.dl td.dl-sel { position: absolute; left: 11px; top: 11px; padding: 0; }
  table.list.dl td.dl-sel::before { content: none; }
  table.list.dl td.dl-sel input { width: 20px; height: 20px; }
  table.list.dl td.dl-code { position: absolute; right: 12px; top: 11px; font-family: var(--mono); font-size: 11px; color: var(--mut); }
  table.list.dl td.dl-code::before { content: none; }
  table.list.dl tr.dim { background: var(--surface-2); }
  /* パイプライン: 横スワイプで列を切替(次の列を少しのぞかせる) */
  .kb { gap: 10px; padding: 2px 14px 14px; margin: 0 -14px; scroll-snap-type: x mandatory; mask-image: none; -webkit-mask-image: none; scroll-padding: 0 14px; }
  .kb-col { flex: 0 0 84vw; max-height: none; scroll-snap-align: start; }
  .kb-col > .kb-body { overflow: visible; }
  .alert-row { flex-wrap: wrap; row-gap: 4px; }
  .alert-row .txt { white-space: normal; flex: 1 0 60%; }
  .alert-row .chip { order: 3; margin-left: 66px; }
  .pagehead .btn { width: 100%; }
  .pagehead .btn.sm { width: auto; flex: 1; }
  .member-row { flex-wrap: wrap; }
  .member-row > .row { width: 100%; justify-content: flex-start !important; }
  #inv-modal .inq-box, #inq-modal .inq-box { width: 94vw; max-height: 86dvh; overflow: auto; }
  .gr-wrap { max-height: 60vh; }
  .dc-preset { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gr-filters input { min-width: 0; width: 100%; }
  .settings-wrap { grid-template-columns: 1fr; }
  .toc { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; margin: 0 -14px; padding-left: 14px; padding-right: 14px; scrollbar-width: none; }
  .toc::-webkit-scrollbar { display: none; }
  .toc a { flex: none; overflow: visible; border-left: none; border-bottom: 2px solid transparent; border-radius: 0; padding: 6px 8px; }
  .toc a.on { border-bottom-color: var(--gold); background: transparent; }
  .fin-wide { padding: 14px 14px 12px; }
  .fin-wide .g3 { gap: 8px; }
  .fin-wide .g3 > div { padding: 8px 10px; }
  .fin-wide .g3 b.v { font-size: 16px; }
  .fin-wide .g4 { gap: 10px; }
  .fin-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
  .toc a { white-space: nowrap; border-left: none; border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0; }
  .toc a.on { border-bottom-color: var(--gold-2); }
  .goal { grid-template-columns: 1fr; gap: 14px; padding: 16px; }
  .goal .n { font-size: 36px; }
  .pgrid { gap: 2px; }
}
/* 画面の高さが小さい横向きスマホ */
@media (max-width: 760px) and (max-height: 430px) {
  .map-panel { max-height: 80dvh; }
}

/* ---------- 動きを減らす設定・透明度を減らす設定 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .view-in > * { animation: none; }
  .toast-item { transition: opacity 200ms ease; transform: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .layer-panel, .map-panel, .side, .tabbar { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .layer-panel { background: #fff; }
  .map-panel { background: #fff; }
}
@media print {
  .side, .layer-panel, #toast, .tabbar { display: none !important; }
  #main { padding: 0; }
}
