/* =============================================================
   Finder UI — filter bar, controls, table, cards, trend view
   ============================================================= */

.hero-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted-label { font-size: 12px; color: var(--ink-3); font-weight: 600; }

/* ---- Filter bar ---- */
.filterbar { padding: 18px; }
.filterbar > * + * { margin-top: 16px; }

.fb-search {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  padding: 0 12px; background: var(--surface); color: var(--ink-3);
}
.fb-search:focus-within { border-color: var(--teal-500); box-shadow: 0 0 0 3px var(--teal-100); }
.fb-search input {
  border: 0; outline: 0; flex: 1; font-family: inherit; font-size: 15px;
  padding: 12px 0; background: transparent; color: var(--ink);
}
.fb-clear { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; padding: 4px; border-radius: 6px; display: grid; place-items: center; }
.fb-clear:hover { background: var(--surface-2); color: var(--ink); }

.fb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }

.select-wrap { position: relative; }
.select-wrap select {
  -webkit-appearance: none; appearance: none; width: 100%;
  font-family: inherit; font-size: 14.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); padding: 11px 38px 11px 13px; cursor: pointer;
}
.select-wrap select:focus { border-color: var(--teal-500); box-shadow: 0 0 0 3px var(--teal-100); outline: none; }
.select-wrap > svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%) rotate(90deg); color: var(--ink-3); pointer-events: none; }

/* ---- Segmented control ---- */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 3px; gap: 2px; }
.seg-btn {
  border: 0; background: transparent; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  padding: 7px 12px; border-radius: 7px; display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, color .15s; white-space: nowrap;
}
.seg-btn:hover { color: var(--teal-700); }
.seg-btn.is-on { background: var(--surface); color: var(--teal-700); box-shadow: var(--shadow-sm); }
.field-toggle { justify-content: flex-end; }

/* ---- Range chips ---- */
.fb-range { border-top: 1px dashed var(--line); padding-top: 16px; }
.fb-range-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.fb-range-year { display: flex; align-items: center; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-2); font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 13px; border-radius: var(--r-pill); cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; transition: all .15s;
}
.chip:hover { border-color: var(--teal-300); background: var(--teal-50); }
.chip.is-on { background: var(--teal-600); border-color: var(--teal-600); color: #fff; }

/* ---- Toolbar ---- */
.fb-toolbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; border-top: 1px dashed var(--line); padding-top: 16px; }
.fb-tool { display: flex; align-items: center; gap: 8px; }
.fb-reset { margin-left: auto; }

.sort-note { display: flex; align-items: flex-start; gap: 7px; font-size: 12.5px; color: var(--ink-3); margin: 14px 2px 0; }
.sort-note svg { flex: none; margin-top: 2px; }

/* ---- Empty ---- */
.empty { text-align: center; color: var(--ink-3); margin-top: 18px; display: grid; gap: 12px; justify-items: center; padding: 40px 18px; }
.empty p { margin: 0; }

/* ---- Pref links ---- */
.pref-link { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 600; color: var(--teal-700); }
.pref-link:hover { text-decoration: underline; }

/* =============================================================
   TABLE view
   ============================================================= */
.table-wrap { margin-top: 18px; overflow-x: auto; }
.rtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.rtable thead th {
  text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-3);
  letter-spacing: .04em; padding: 14px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); white-space: nowrap; position: sticky; top: 0;
}
.rtable thead th:first-child { border-top-left-radius: var(--r-lg); }
.rtable tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rtable tbody tr:last-child td { border-bottom: 0; }
.rtable tbody tr:hover { background: var(--teal-50); }
.cell-name { min-width: 200px; }
.cell-name span:first-child { font-weight: 600; color: var(--ink); }
.cell-note { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 3px; font-weight: 400; }
.cell-addr { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 3px; font-weight: 400; }
.cell-go a { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--teal-700); }
.cell-go a:hover { background: var(--teal-100); }

/* =============================================================
   CARD view
   ============================================================= */
.card-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.fcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.fcard:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.fcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.fcard-name { margin: 0 0 8px; font-size: 16px; color: var(--teal-900); font-weight: 700; line-height: 1.4; }
.fcard-addr { margin: 0 0 8px; font-size: 11.5px; color: var(--ink-3); display: flex; align-items: flex-start; gap: 4px; line-height: 1.45; }
.fcard-addr svg { flex: none; margin-top: 2px; }
.fcard-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fcard-note { margin: 0; font-size: 12.5px; color: var(--ink-3); background: var(--surface-2); padding: 8px 11px; border-radius: var(--r-sm); }
.fcard-link { margin-top: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 700; text-decoration: none; padding-top: 4px; }
.fcard-link:hover { text-decoration: underline; }

/* ---- Year progression (shared: card + trend) ---- */
.yprog { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.yprog > svg { color: var(--line-strong); flex: none; }
.yprog-item { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.yprog-label { font-size: 10.5px; font-weight: 700; color: var(--ink-3); letter-spacing: .05em; }

/* =============================================================
   TREND (レンジ重視) view
   ============================================================= */
.trend-list { margin-top: 18px; }
.trend-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.trend-row:last-child { border-bottom: 0; }
.trend-row:hover { background: var(--teal-50); }
.trend-id { min-width: 220px; flex: 1; }
.trend-name { font-size: 15.5px; font-weight: 700; color: var(--teal-900); text-decoration: none; }
.trend-name:hover { text-decoration: underline; }
.trend-addr { margin: 5px 0 0; font-size: 11.5px; color: var(--ink-3); display: flex; align-items: flex-start; gap: 4px; line-height: 1.45; }
.trend-addr svg { flex: none; margin-top: 2px; }
.trend-sub { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 7px; }
.trend-row .yprog { background: var(--surface-2); padding: 10px 14px; border-radius: var(--r-md); }

/* =============================================================
   Pref shortcuts
   ============================================================= */
.pref-shortcuts { margin-top: 24px; padding: 18px; background: var(--teal-50); border: 1px solid var(--line); border-radius: var(--r-lg); }
.pref-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pref-chip { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 7px 8px 7px 14px; font-size: 13.5px; font-weight: 600; color: var(--teal-800, var(--teal-700)); }
.pref-chip:hover { border-color: var(--teal-400, var(--teal-300)); background: var(--surface); box-shadow: var(--shadow-sm); }
.pref-chip-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); background: var(--teal-100); color: var(--teal-700); font-size: 12px; }

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 860px) {
  .fb-grid { grid-template-columns: 1fr 1fr; }
  .field-toggle { grid-column: 1 / -1; align-items: flex-start; }
}
@media (max-width: 640px) {
  .fb-grid { grid-template-columns: 1fr; }
  .fb-toolbar { gap: 12px; }
  .fb-tool { width: 100%; justify-content: space-between; }
  .fb-reset { margin-left: 0; width: 100%; justify-content: center; }
  .seg { width: 100%; }
  .seg-btn { flex: 1; justify-content: center; }
  .trend-row .yprog { width: 100%; }
}
