:root {
  --pink-primary: #d5aa13;
  --pink-hover: #bd9000;
  --pink-deep: #705400;
  --pink-light: #fffbea;
  --pink-soft: #f6db5e;
  --pink-badge: #fff3ad;
  --pink-gradient: linear-gradient(135deg, #f6db5e 0%, #e5b923 100%);
  --pink-subtle-grad: linear-gradient(180deg, #fffef7 0%, #fff7cc 100%);

  --kyobashi: #d36f84;
  --nihonbashi: #8b6cac;
  --tsukishima: #3f9991;

  --ink: #352f25;
  --ink-secondary: #5c5140;
  --muted: #81734f;
  --line: #ead77f;
  --line-light: #f4e9b2;
  --paper: #fffefa;
  --wash: #fff9dc;

  --shadow-sm: 0 4px 14px rgba(118, 86, 34, 0.08);
  --shadow-md: 0 8px 26px rgba(118, 86, 34, 0.12);
  --shadow-lg: 0 18px 46px rgba(91, 67, 30, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 999px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  background-image:
    radial-gradient(circle at 10% 20%, rgba(246, 219, 94, 0.22) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(246, 219, 94, 0.16) 0%, transparent 40%);
  font-family: "M PLUS Rounded 1c", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button, input, select {
  font-family: inherit;
  font-size: inherit;
}
button, select, input[type="checkbox"] { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(213, 170, 19, 0.42);
  outline-offset: 2px;
}
a {
  color: var(--pink-deep);
  text-underline-offset: 0.25em;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--pink-hover);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* Material Symbols Rounded Styling */
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 450, 'GRAD' 0, 'opsz' 24;
}

.icon-inline {
  font-size: 1.15em;
  vertical-align: -0.18em;
  margin-right: 4px;
}
.icon-inline-sm {
  font-size: 0.95em;
  vertical-align: -0.15em;
  margin-right: 3px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(118, 86, 34, 0.08);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.15;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: var(--pink-gradient);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(118, 86, 34, 0.28);
  transform: rotate(-3deg);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand:hover .brand-mark {
  transform: rotate(0deg) scale(1.06);
}
.brand-mark .material-symbols-rounded {
  font-size: 28px;
  color: #ffffff;
  font-variation-settings: 'FILL' 1, 'wght' 600;
}
.brand strong, .brand small { display: block; }
.brand strong {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.brand small {
  margin-top: 3px;
  color: var(--pink-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--pink-soft);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  color: var(--pink-deep);
  background: var(--pink-light);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.18s ease;
}
.text-button:hover {
  background: var(--pink-soft);
  color: var(--pink-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.text-button .material-symbols-rounded {
  font-size: 18px;
  color: var(--pink-primary);
}

/* App Shell */
.app-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: clamp(24px, 3.5vw, 48px);
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 34px clamp(18px, 4vw, 56px) 120px;
}

/* Filter Panel (Sidebar) */
.filter-panel {
  position: sticky;
  top: 76px;
  align-self: start;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
  scrollbar-color: #d8d4cb transparent;
}
.filter-panel::-webkit-scrollbar {
  width: 5px;
}
.filter-panel::-webkit-scrollbar-thumb {
  background: #d8d4cb;
  border-radius: 999px;
}
.filter-panel::-webkit-scrollbar-thumb:hover {
  background: #bab5aa;
}
.mobile-filter-button,
.mobile-filter-close,
.filter-backdrop,
.mobile-primary-filters {
  display: none;
}
.filter-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-light);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  color: var(--pink-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.eyebrow .material-symbols-rounded {
  font-size: 15px;
}
.filter-heading h2 {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}
.reset-button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  border-radius: var(--radius-full);
  padding: 5px 10px;
  color: var(--muted);
  background: #f5efe2;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.15s ease;
}
.reset-button:hover {
  color: var(--pink-deep);
  background: var(--pink-soft);
}
.reset-button .material-symbols-rounded {
  font-size: 15px;
}

fieldset {
  margin: 0;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--line-light);
}
fieldset:last-child {
  border: 0;
  padding-bottom: 0;
}
legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
#filter-panel legend {
  margin-bottom: -8px;
}
.legend-icon {
  color: var(--pink-primary);
  font-size: 18px;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
#filter-panel .legend-row legend,
.legend-row legend {
  margin-bottom: 0 !important;
}
.legend-action-button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: 0;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--pink-deep);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.legend-action-button:hover {
  background: rgba(224, 76, 122, 0.08);
}
.legend-action-button .material-symbols-rounded {
  font-size: 14px;
}

/* Segmented Buttons */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  border-radius: var(--radius-md);
  background: #fff3bd;
  border: 1px solid var(--line-light);
}
.segmented button {
  border: 0;
  border-radius: calc(var(--radius-md) - 3px);
  padding: 7px 5px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  transition: all 0.15s ease;
}
.segmented button.is-active {
  color: var(--pink-deep);
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(118, 86, 34, 0.14);
}
.category-segmented {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.category-segmented button {
  padding-inline: 2px;
  font-size: 12px;
}
.age-segmented {
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
}
.age-segmented button {
  min-height: 34px;
  padding-inline: 3px;
  font-size: 12px;
}
.age-segmented button[data-age="57d"],
.age-segmented button[data-age="7m"],
.age-segmented button[data-age="age1"],
.age-segmented button[data-age="age2"] {
  grid-column: span 3;
}
.age-segmented button[data-age="age3"],
.age-segmented button[data-age="age4"],
.age-segmented button[data-age="age5"] {
  grid-column: span 2;
}

/* Admission difficulty controls */
.admission-settings {
  display: grid;
  gap: 12px;
}
.score-control {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  background: #fff8d9;
}
.score-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 800;
}
.score-heading output {
  flex: none;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  color: #6d5000;
  background: #f6db5e;
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.score-control input[type="range"] {
  width: 100%;
  accent-color: #c29400;
  cursor: pointer;
}
.score-scale {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}
.score-scale span { text-align: center; white-space: nowrap; }
.score-scale .standard-score { color: #795b00; font-size: 10px; font-weight: 900; }
.difficulty-help-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 8px 12px;
  margin-top: 8px;
  border: 1.5px dashed #d5aa13;
  border-radius: var(--radius-md);
  background: #fffdf5;
  color: #7b5b00;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}
.difficulty-help-button:hover {
  background: #fff8dc;
  border-style: solid;
  transform: translateY(-1px);
}
.difficulty-help-button .material-symbols-rounded {
  font-size: 16px;
  color: #c29400;
}
.difficulty-dialog {
  width: min(680px, calc(100% - 24px));
  max-height: min(88dvh, 88vh, 850px);
}
.difficulty-dialog .dialog-close {
  position: absolute;
  top: 24px;
  right: 28px;
  float: none;
}
.difficulty-dialog h2 {
  font-size: 22px;
  margin-bottom: 16px;
  padding-right: 44px;
}
.difficulty-explanation p { margin: 0 0 8px; }
.difficulty-explanation p:last-child { margin-bottom: 0; }
.difficulty-explanation ul { margin: 0 0 8px; padding-left: 18px; }
.difficulty-explanation li + li { margin-top: 5px; }
.difficulty-explanation h4 {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 2px 0 10px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}
.difficulty-explanation h4 .material-symbols-rounded {
  flex: none;
  color: #c29400;
  font-size: 18px;
}
.difficulty-rule {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid;
  border-radius: 10px;
}
.difficulty-rule h5 {
  display: flex;
  align-items: center;
  margin: 0 0 5px;
  font-size: 13px;
  font-weight: 900;
}
.difficulty-rule ul { margin-bottom: 0; }
.rule-easy { color: #2e7d32; background: #e8f5e9; border-color: #a5d6a7; }
.rule-normal { color: #1565c0; background: #e3f2fd; border-color: #90caf9; }
.rule-hard { color: #c62828; background: #ffebee; border-color: #ffcdd2; }
.rule-nodata { color: #616161; background: #f1f1f1; border-color: #bdbdbd; }
.difficulty-question {
  margin: 14px 0 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}
.difficulty-explanation hr {
  margin: 14px 0;
  border: 0;
  border-top: 1px solid #ddd3bd;
}
.difficulty-explanation .difficulty-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}

.admission-summary {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #e5c74b;
  border-radius: var(--radius-lg);
  background: rgba(255, 252, 231, 0.9);
  box-shadow: var(--shadow-sm);
}
.admission-summary-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 800;
}
.admission-summary-heading > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.admission-summary-heading .material-symbols-rounded {
  color: #c29400;
  font-size: 18px;
}
.admission-summary-heading small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.admission-summary-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.admission-summary-counts > button {
  appearance: none;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.admission-summary-counts > button:hover { transform: translateY(-1px); filter: saturate(1.08); }
.admission-summary-counts > button.is-active {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px currentColor, 0 5px 12px rgba(82, 63, 23, 0.2);
  transform: translateY(-1px);
}
.admission-summary-counts > button:focus-visible { outline: 3px solid rgba(34, 93, 166, 0.35); outline-offset: 2px; }
.difficulty-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: currentColor;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  vertical-align: -1px;
}
.admission-summary-counts strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  font-weight: 900;
}
.summary-easy { color: #2e7d32; background: #e8f5e9; border-color: #a5d6a7 !important; }
.summary-normal { color: #1565c0; background: #e3f2fd; border: 1.5px solid #90caf9 !important; }
.summary-hard { color: #c62828; background: #ffebee; border-color: #ffcdd2 !important; }
.summary-nodata { color: #616161; background: #f1f1f1; border-color: #bdbdbd !important; }

/* Checkbox Row */
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-secondary);
  transition: background 0.12s ease;
}
.check-row:hover {
  background: var(--pink-light);
  color: var(--ink);
}
.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  accent-color: var(--pink-primary);
}
.check-row .item-icon {
  color: var(--pink-primary);
  font-size: 18px;
  opacity: 0.9;
}
.area-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}
.kyobashi { background: var(--kyobashi); box-shadow: 0 0 6px rgba(211, 111, 132, 0.28); }
.nihonbashi { background: var(--nihonbashi); box-shadow: 0 0 6px rgba(139, 108, 172, 0.28); }
.tsukishima { background: var(--tsukishima); box-shadow: 0 0 6px rgba(63, 153, 145, 0.28); }

.top-area-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  background: #fff3bd;
}
.top-filter-chip {
  position: relative;
  min-width: 0;
}
.top-filter-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.top-filter-chip-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  padding: 0 4px;
  border: 1.5px solid transparent;
  border-radius: calc(var(--radius-md) - 3px);
  color: var(--ink-secondary);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  transition: all 0.15s ease;
  position: relative;
  z-index: 1;
}
.top-filter-chip input:checked + .top-filter-chip-body {
  color: var(--ink);
  background: #ffffff;
  border-color: rgba(118, 86, 34, 0.2);
  box-shadow: 0 2px 6px rgba(118, 86, 34, 0.12);
  z-index: 2;
}
.top-filter-chip input[value="京橋"]:checked + .top-filter-chip-body { color: var(--kyobashi); border-color: rgba(211, 111, 132, 0.35); }
.top-filter-chip input[value="日本橋"]:checked + .top-filter-chip-body { color: var(--nihonbashi); border-color: rgba(139, 108, 172, 0.35); }
.top-filter-chip input[value="月島"]:checked + .top-filter-chip-body { color: var(--tsukishima); border-color: rgba(63, 153, 145, 0.35); }
.top-filter-chip input:focus-visible + .top-filter-chip-body {
  outline: 3px solid rgba(213, 170, 19, 0.28);
  outline-offset: 2px;
}

.select-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
select {
  width: 100%;
  min-height: 44px;
  padding: 8px 32px 8px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: #fff;
  font-weight: 600;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
select:focus {
  border-color: var(--pink-primary);
  box-shadow: 0 0 0 3px rgba(213, 170, 19, 0.15);
}

/* Results Panel */
.results-panel { min-width: 0; }
.intro-row {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 20px;
  margin-bottom: 12px;
}
.intro-row h1 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: clamp(26px, 3.8vw, 40px);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.result-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--pink-light);
  border: 1px solid var(--pink-soft);
  color: var(--pink-deep);
}
.meta-icon {
  font-size: 22px;
  color: var(--pink-primary);
}
.result-meta strong {
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--pink-deep);
}
.result-meta span {
  font-size: 13px;
  font-weight: 800;
}

/* Search Row */
.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 18px;
  border: 2px solid var(--pink-soft);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s ease;
}
.search-box:focus-within {
  border-color: var(--pink-primary);
  box-shadow: 0 4px 18px rgba(118, 86, 34, 0.16);
}
.search-icon {
  color: var(--pink-primary);
  font-size: 24px;
}
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
  font-weight: 600;
}
.search-box input::placeholder {
  color: #bfaab3;
}
.sort-box {
  position: relative;
  flex: 0 0 230px;
  width: 230px;
}
.sort-controls {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}
.sort-controls .sort-box {
  flex-basis: 210px;
  width: 210px;
}
.sort-controls .sort-direction-box {
  flex-basis: 210px;
  width: 210px;
}
.sort-label {
  position: absolute;
  top: 5px;
  left: 14px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  pointer-events: none;
}
.sort-icon {
  font-size: 13px;
  color: var(--pink-primary);
}
.sort-box select {
  height: 54px;
  padding-top: 18px;
  border: 2px solid var(--pink-soft);
  border-radius: var(--radius-lg);
  background: #ffffff;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.sort-direction-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 54px;
  padding: 18px 6px 5px;
  border: 2px solid var(--pink-soft);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}
.sort-direction-toggle button {
  flex: 1;
  min-width: 0;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: calc(var(--radius-lg) - 7px);
  padding: 0 4px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.sort-direction-toggle button:hover {
  color: var(--ink);
  background: var(--pink-light);
}
.sort-direction-toggle button.is-active {
  color: var(--pink-deep);
  background: var(--pink-badge);
  border-color: rgba(213, 170, 19, 0.35);
  box-shadow: 0 1px 4px rgba(118, 86, 34, 0.12);
}
.sort-direction-toggle button:focus-visible {
  outline: 2px solid rgba(213, 170, 19, 0.4);
  outline-offset: 1px;
}

/* Quick Filters */
.quick-filters {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 10px;
  padding: 4px 2px;
}
.quick-filters button, .filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  color: var(--ink-secondary);
  background: #ffffff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(118, 86, 34, 0.06);
  transition: all 0.15s ease;
}
.quick-filters button .material-symbols-rounded {
  font-size: 16px;
  color: var(--pink-primary);
}
.quick-filters button:hover {
  border-color: var(--pink-soft);
  background: var(--pink-light);
  transform: translateY(-1px);
}
.quick-filters button.is-active {
  border-color: transparent;
  color: var(--ink);
  background: var(--pink-gradient);
  box-shadow: 0 4px 14px rgba(118, 86, 34, 0.24);
}
.quick-filters button.is-active .material-symbols-rounded {
  color: var(--ink);
}

/* Active Filter Chips */
.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 14px 0 10px;
}

/* Results Grid & Cards */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.nursery-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1.5px solid var(--line-light);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
.nursery-card:hover {
  transform: translateY(-3px);
  border-color: var(--pink-soft);
  box-shadow: var(--shadow-md);
}
.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 18px 0;
}
.area-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--area-color);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.38;
}
.area-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.category-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-main {
  flex: 1;
  width: 100%;
  border: 0;
  padding: 10px 18px 14px;
  color: inherit;
  background: transparent;
  text-align: left;
}
.nursery-name {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.38;
}
.nursery-operator, .nursery-address {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.nursery-operator .icon-inline-sm, .nursery-address .icon-inline-sm {
  flex: none;
  font-size: 15px;
  color: #c9afb9;
}
.operator-text, .address-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nursery-address { margin-top: 3px; }

/* Metric Grid */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.metric {
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--pink-light);
  border: 1px solid var(--pink-soft);
}
.metric-label {
  display: flex;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: normal;
}
.metric-icon {
  font-size: 13px;
  color: var(--pink-primary);
}
.metric strong {
  display: block;
  overflow: visible;
  margin-top: 3px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

/* Admission difficulty on cards and details */
.admission-status-slot:empty { display: none; }
.admission-status-box {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #ead680;
  border-radius: var(--radius-md);
  background: #fffdf3;
}
.difficulty-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.difficulty-header-main {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
}
.difficulty-header-icon {
  font-size: 16px;
  color: var(--pink-primary);
}
.difficulty-header-title {
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}
.difficulty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.badge-easy { color: #2e7d32; background: #e8f5e9; border-color: #a5d6a7; }
.badge-normal { color: #1565c0; background: #e3f2fd; border: 1.5px solid #90caf9; }
.badge-hard { color: #c62828; background: #ffebee; border-color: #ffcdd2; }
.badge-nodata { color: #616161; background: #f1f1f1; border-color: #bdbdbd; }
.badge-none { color: #757575; background: #f5f5f5; border-color: #e0e0e0; }
.difficulty-subtext {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: right;
}
.history-track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}
.history-item {
  min-width: 0;
  padding: 5px 4px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: #f7f3e9;
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
}
.history-item span { display: block; font-weight: 800; font-size: 10px; }
.history-item strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--ink-secondary);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-item.history-easy { color: #2e7d32; background: #e8f5e9; border: 1px solid #a5d6a7; }
.history-item.history-normal { color: #1565c0; background: #e3f2fd; border: 1px solid #90caf9; }
.history-item.history-hard { color: #c62828; background: #ffebee; border: 1px solid #ffcdd2; }
.history-item.history-no-data { color: #616161; background: #f1f1f1; border: 1px solid #d0d0d0; }
.history-item.latest { box-shadow: inset 0 0 0 2px #d5aa13; }

/* Feature Tags */
.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}
.feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid;
  transition: transform 0.15s ease;
}
.feature-tag .tag-icon {
  font-size: 13px;
}
.feature-tag.tag-available {
  color: #725100;
  background: #fff8d6;
  border-color: #f3d05b;
}
.feature-tag.tag-available .tag-icon {
  color: #b78103;
}
.feature-tag.tag-unavailable {
  color: #8c887d;
  background: #f5f4f0;
  border-color: #dedbd1;
  opacity: 0.72;
}
.feature-tag.tag-unavailable .tag-icon {
  color: #a39f94;
}

/* Fallback for legacy classnames */
.feature-tag.tag-garden,
.feature-tag.tag-age0,
.feature-tag.tag-bicycle,
.feature-tag.tag-stroller,
.feature-tag.tag-diaper,
.feature-tag.tag-contactApp,
.feature-tag.tag-evaluation,
.feature-tag.tag-medical {
  color: #725100;
  background: #fff8d6;
  border-color: #f3d05b;
}
.feature-tag.tag-garden .tag-icon,
.feature-tag.tag-age0 .tag-icon,
.feature-tag.tag-bicycle .tag-icon,
.feature-tag.tag-stroller .tag-icon,
.feature-tag.tag-diaper .tag-icon,
.feature-tag.tag-contactApp .tag-icon,
.feature-tag.tag-evaluation .tag-icon,
.feature-tag.tag-medical .tag-icon {
  color: #b78103;
}
/* Card Actions */
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px 12px 22px;
  border-top: 1px solid var(--line-light);
  background: #fffaf0;
}
.detail-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  color: #ffffff;
  background: var(--pink-deep);
  box-shadow: 0 3px 10px rgba(91, 67, 30, 0.18);
  font-size: 13px;
  font-weight: 800;
  transition: all 0.15s ease;
}
.detail-button:hover {
  background: var(--pink-hover);
  color: #ffffff;
  transform: translateX(2px);
}
.detail-button .material-symbols-rounded {
  font-size: 16px;
  color: #ffffff;
}
.compare-check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.compare-check input {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  accent-color: var(--pink-primary);
}
.compare-check .material-symbols-rounded {
  font-size: 16px;
}

/* Empty State */
.empty-state {
  margin-top: 20px;
  padding: 60px 20px;
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
}
.empty-icon {
  display: inline-block;
  color: var(--pink-soft);
  font-size: 54px;
  margin-bottom: 8px;
}
.empty-state h2 {
  margin: 4px 0;
  color: var(--ink);
  font-size: 20px;
}
.empty-state p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}
.empty-state button, .compare-dock button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: var(--radius-full);
  padding: 10px 20px;
  color: var(--ink);
  background: var(--pink-gradient);
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(118, 86, 34, 0.24);
  transition: all 0.15s ease;
}
.empty-state button:hover, .compare-dock button:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(118, 86, 34, 0.3);
}
.compare-dock button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Compare Dock */
.compare-dock {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(560px, calc(100% - 32px));
  padding: 12px 16px 12px 20px;
  border-radius: var(--radius-full);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--pink-soft);
  box-shadow: 0 12px 40px rgba(91, 67, 30, 0.2);
  transform: translateX(-50%);
  animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes slideUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
.compare-dock[hidden] { display: none; }
.compare-dock-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dock-icon {
  font-size: 28px;
  color: var(--pink-primary);
}
.compare-dock strong, .compare-dock span { display: block; }
.compare-dock strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--pink-deep);
}
.compare-dock span {
  color: var(--muted);
  font-size: 11px;
}

/* Dialogs */
dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(760px, calc(100% - 24px));
  max-height: min(88dvh, 88vh, 900px);
  overflow: auto;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: var(--shadow-lg);
}
.detail-dialog {
  overflow: hidden;
}
.detail-dialog #detail-content {
  max-height: calc(min(88dvh, 88vh, 900px) - 64px);
  overflow-y: auto;
  padding-right: 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.detail-dialog .dialog-close {
  position: absolute;
  top: 24px;
  right: 28px;
  float: none;
}
dialog::backdrop {
  background: rgba(61, 45, 52, 0.45);
  backdrop-filter: blur(6px);
}
.dialog-close {
  position: sticky;
  top: 0;
  z-index: 3;
  float: right;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: var(--radius-full);
  color: var(--pink-deep);
  background: var(--pink-light);
  font-size: 22px;
  line-height: 1;
  transition: all 0.15s ease;
}
.dialog-close:hover {
  background: var(--pink-soft);
  color: var(--pink-hover);
  transform: scale(1.08);
}
.dialog-kicker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--pink-primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
dialog h2 {
  margin: 6px 48px 10px 0;
  color: var(--ink);
  font-size: clamp(23px, 4.5vw, 32px);
  font-weight: 900;
  line-height: 1.3;
}
dialog h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 26px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}
dialog h3 .material-symbols-rounded {
  color: var(--pink-primary);
}
.detail-subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.detail-hero {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-light);
}
.detail-hero h2 {
  padding-right: 48px;
}
.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.detail-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-full);
  padding: 8px 16px;
  color: var(--ink);
  background: var(--pink-gradient);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(118, 86, 34, 0.22);
  transition: all 0.15s ease;
}
.detail-links a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(118, 86, 34, 0.28);
}
.detail-links a .material-symbols-rounded {
  font-size: 16px;
}
.detail-section { margin-top: 24px; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.detail-cell {
  padding: 10px 12px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  background: #fffbf2;
}
.cell-label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.cell-icon {
  font-size: 14px;
  color: var(--pink-primary);
}
.detail-cell strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.admission-detail-section {
  overflow: hidden;
  padding: 20px;
  border: 1.5px solid #e5c74b;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fff9d7 0%, #fffef8 72%);
}
.admission-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.admission-detail-kicker {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 3px;
  color: #a27800;
  font-size: 11px;
  font-weight: 800;
}
.admission-detail-heading h3 { margin: 0; }
.score-pill {
  flex: none;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  color: #6d5000;
  background: #f6db5e;
  font-size: 12px;
  font-weight: 900;
}
.admission-status-detail {
  margin-top: 14px;
  padding: 14px;
  background: #fff;
}
.admission-status-detail .age-label { font-size: 13px; }
.admission-status-detail .difficulty-badge { min-height: 30px; font-size: 12px; }
.admission-status-detail .history-track { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admission-status-detail .history-item { padding: 8px; font-size: 10px; }
.admission-status-detail .history-item strong {
  overflow: visible;
  font-size: 11px;
  text-overflow: clip;
  white-space: normal;
}
.difficulty-score-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}
.detail-difficulty-help { margin-top: 10px; background: rgba(255, 255, 255, 0.72); }

/* Evaluation Section in Dialog */
.evaluation-section {
  overflow: hidden;
  border: 1.5px solid #d2f0ee;
  border-radius: var(--radius-lg);
  padding: 20px;
  background: linear-gradient(135deg, #f7fdfc 0%, #fff 70%);
}
.evaluation-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.evaluation-heading h3 {
  margin: 2px 0 0;
  font-size: 18px;
  color: #1a6f76;
}
.evaluation-kicker {
  margin: 0;
  color: #21929c;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
}
.evaluation-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.evaluation-actions a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  border-radius: var(--radius-full);
  padding: 7px 14px;
  color: #fff;
  background: #249da6;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(36, 157, 166, 0.25);
  transition: all 0.15s ease;
}
.evaluation-actions a:hover {
  background: #1d828a;
  transform: translateY(-1px);
}
.evaluation-actions a .material-symbols-rounded {
  font-size: 15px;
}
.evaluation-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.evaluation-stats > div {
  border-radius: var(--radius-md);
  padding: 12px;
  background: #ffffff;
  border: 1px solid #d8f0ed;
}
.evaluation-stats span {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.evaluation-stats small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.evaluation-stats strong {
  display: block;
  margin: 3px 0;
  color: #1a6f76;
  font-size: 20px;
  font-weight: 900;
}
.evaluation-bar {
  height: 8px;
  overflow: hidden;
  margin: 12px 0 16px;
  border-radius: var(--radius-full);
  background: #e2f3f1;
}
.evaluation-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f6db5e, #8aa078);
}
.evaluation-comment {
  margin: 12px 0;
  border-left: 4px solid #249da6;
  border-radius: 4px var(--radius-md) var(--radius-md) 4px;
  padding: 12px 14px;
  background: #fff;
  border-top: 1px solid #d8f0ed;
  border-right: 1px solid #d8f0ed;
  border-bottom: 1px solid #d8f0ed;
}
.evaluation-comment strong {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #1a6f76;
  font-size: 13px;
  font-weight: 800;
}
.evaluation-comment p {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.7;
}
.evaluation-themes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.evaluation-theme {
  border-radius: var(--radius-md);
  padding: 12px;
}
.evaluation-theme.good {
  background: #eef9f8;
  border: 1px solid #cceee9;
}
.evaluation-theme.improve {
  background: #fff6ee;
  border: 1px solid #f9e2cf;
}
.evaluation-theme > strong {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}
.evaluation-theme div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.evaluation-theme span {
  border-radius: var(--radius-full);
  padding: 4px 8px;
  color: var(--ink);
  background: rgba(255,255,255,0.9);
  font-size: 10px;
  font-weight: 700;
  border: 1px solid rgba(0,0,0,0.04);
}
.evaluation-agency {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.evaluation-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}
.note {
  padding: 12px 14px;
  border-left: 4px solid var(--pink-primary);
  border-radius: 4px var(--radius-md) var(--radius-md) 4px;
  background: var(--pink-light);
  font-size: 13px;
}

/* Compare Table */
.compare-dialog {
  width: min(980px, calc(100% - 24px));
  overflow: hidden;
}
.compare-dialog .dialog-close {
  position: absolute;
  top: 28px;
  right: 32px;
}
.compare-scroll {
  max-height: calc(min(88vh, 900px) - 116px);
  overflow: auto;
  scrollbar-gutter: stable;
}
.compare-table {
  width: 100%;
  min-width: 820px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: visible;
}
.compare-table th, .compare-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-light);
  border-right: 1px solid var(--line-light);
  text-align: left;
  vertical-align: middle;
}
.compare-table th:last-child, .compare-table td:last-child {
  border-right: 0;
}
.compare-table tr:last-child th, .compare-table tr:last-child td {
  border-bottom: 0;
}
.compare-table th {
  color: var(--ink);
  background: #f8f0dc;
  font-weight: 800;
}
.compare-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 2px 0 var(--line-light);
}
.compare-table thead th:first-child { border-radius: var(--radius-md) 0 0 0; }
.compare-table thead th:last-child { border-radius: 0 var(--radius-md) 0 0; }
.table-th-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.table-icon {
  font-size: 16px;
  color: var(--pink-primary);
}
.compare-table th:first-child {
  width: 195px;
  min-width: 195px;
  white-space: nowrap;
}
.compare-table th:not(:first-child),
.compare-table td:not(:first-child) {
  width: 205px;
  min-width: 205px;
}
.compare-table td.compare-cell-highlight {
  color: #6d5000;
  background: #fff1a8;
  box-shadow: inset 0 0 0 2px rgba(213, 170, 19, 0.32);
  font-weight: 900;
}
.compare-actions-row th,
.compare-actions-row td {
  background: #fffaf0;
}
.compare-detail-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #d5aa13;
  border-radius: var(--radius-full);
  color: #ffffff;
  background: #806000;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  transition: background 0.15s ease, transform 0.15s ease;
}
.compare-detail-button:hover {
  background: #624a00;
  transform: translateY(-1px);
}
.compare-detail-button .material-symbols-rounded { font-size: 16px; }
.compare-detail-button:focus-visible {
  outline: 3px solid rgba(213, 170, 19, 0.35);
  outline-offset: 2px;
}

/* Notice & Source list */
.notice-box {
  margin: 20px 0;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  color: #7d3545;
  background: var(--pink-light);
  border: 1px solid var(--pink-soft);
}
.notice-box strong {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.notice-box p { margin: 4px 0 0; }
.source-list {
  padding-left: 1.4em;
  line-height: 1.8;
}
.credit {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 28px;
  color: var(--pink-deep);
  font-size: 13px;
  font-weight: 700;
}

/* Footer */
footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 26px 18px;
  color: var(--ink-secondary);
  background: #ffffff;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
}
footer p {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}
footer button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  color: var(--pink-deep);
  background: var(--pink-light);
  font-weight: 800;
  transition: all 0.15s ease;
}
footer button:hover {
  background: var(--pink-soft);
  color: var(--pink-hover);
}

/* Responsive */
@media (max-width: 1040px) {
  .app-shell { grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
  .results-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body.filter-open { overflow: hidden; }
  .site-header { min-height: 64px; padding: 8px 16px; }
  .brand-mark { width: 40px; height: 40px; border-radius: 14px; }
  .brand strong { font-size: 17px; }
  .text-button { padding: 6px 12px; font-size: 12px; }
  .app-shell { display: flex; flex-direction: column; padding: 20px 14px 110px; }
  .mobile-primary-filters {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 253, 248, 0.8);
    box-shadow: var(--shadow-sm);
  }
  .age-segmented { grid-template-columns: repeat(6, 1fr); }
  .quick-filters { display: flex; }
  .top-filter-group {
    margin: 0;
    padding: 0;
    border: 0;
  }
  .top-filter-group legend { margin-bottom: 4px; }
  .top-area-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line-light);
    border-radius: var(--radius-md);
    background: #fff3bd;
  }
  .top-filter-chip { position: relative; min-width: 0; }
  .top-filter-chip input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
  }
  .top-filter-chip-body {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 36px;
    padding: 0 4px;
    border: 1.5px solid transparent;
    border-radius: calc(var(--radius-md) - 3px);
    color: var(--ink-secondary);
    background: transparent;
    font-size: 14px;
    font-weight: 800;
    transition: all 0.15s ease;
    position: relative;
    z-index: 1;
  }
  .top-filter-chip input:checked + .top-filter-chip-body {
    color: var(--ink);
    background: #ffffff;
    border-color: rgba(118, 86, 34, 0.2);
    box-shadow: 0 2px 6px rgba(118, 86, 34, 0.12);
    z-index: 2;
  }
  .top-filter-chip input[value="京橋"]:checked + .top-filter-chip-body { color: var(--kyobashi); border-color: rgba(211, 111, 132, 0.35); }
  .top-filter-chip input[value="日本橋"]:checked + .top-filter-chip-body { color: var(--nihonbashi); border-color: rgba(139, 108, 172, 0.35); }
  .top-filter-chip input[value="月島"]:checked + .top-filter-chip-body { color: var(--tsukishima); border-color: rgba(63, 153, 145, 0.35); }
  .top-filter-chip input:focus-visible + .top-filter-chip-body {
    outline: 3px solid rgba(213, 170, 19, 0.28);
    outline-offset: 2px;
  }
  .mobile-category { width: 100%; }
  .mobile-filter-button {
    position: sticky;
    top: 74px;
    z-index: 18;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 48px;
    margin-bottom: 16px;
    border: 1px solid var(--pink-primary);
    border-radius: var(--radius-md);
    color: var(--ink);
    background: var(--pink-gradient);
    box-shadow: 0 8px 20px rgba(91, 67, 30, 0.2);
    font-weight: 800;
  }
  .mobile-filter-button .material-symbols-rounded { font-size: 20px; }
  .filter-panel {
    position: fixed;
    inset: 10px 0 10px auto;
    z-index: 42;
    width: min(360px, calc(100% - 22px));
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    box-shadow: -12px 0 40px rgba(53, 47, 37, 0.22);
    transform: translateX(105%);
    visibility: hidden;
    transition: transform 0.24s ease, visibility 0.24s ease;
  }
  .filter-panel.is-open {
    transform: translateX(0);
    visibility: visible;
  }
  .filter-panel .primary-filter { display: none; }
  .filter-heading { padding-right: 42px; }
  .mobile-filter-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    color: var(--pink-deep);
    background: var(--pink-light);
  }
  .mobile-filter-close .material-symbols-rounded { font-size: 21px; }
  .filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 41;
    display: block;
    border: 0;
    padding: 0;
    background: rgba(53, 47, 37, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .filter-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }
  .results-panel { order: 1; }
  .search-row { grid-template-columns: 1fr; gap: 10px; }
  .results-toolbar { align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
  .results-toolbar .sort-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); width: 100%; margin-left: 0; }
  .results-toolbar .sort-box,
  .results-toolbar .sort-direction-box { width: 100%; min-width: 0; }
  .results-toolbar .sort-box select { height: 48px; }
  .results-toolbar .sort-direction-toggle {
    height: 48px;
    padding: 16px 5px 4px;
  }
  .results-toolbar .sort-direction-toggle button {
    height: 24px;
    font-size: 10px;
    padding: 0 2px;
  }
  .results-grid { grid-template-columns: 1fr; }
  .nursery-card:hover { transform: none; }
  .evaluation-heading { display: block; }
  .evaluation-stats { grid-template-columns: 1fr 1fr; }
  .evaluation-themes { grid-template-columns: 1fr; }
  dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    width: calc(100% - 16px);
    max-width: 600px;
    max-height: min(92dvh, 92vh);
    padding: 20px 14px 16px;
    border-radius: var(--radius-lg);
  }
  .detail-dialog {
    width: calc(100% - 16px);
    max-width: 600px;
    max-height: min(92dvh, 92vh);
    padding: 20px 14px 16px;
    overflow: hidden;
  }
  .detail-dialog #detail-content {
    max-height: calc(min(92dvh, 92vh) - 36px);
    overflow-y: auto;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .detail-dialog .dialog-close {
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    font-size: 20px;
  }
  .difficulty-dialog {
    width: calc(100% - 16px);
    max-height: min(92dvh, 92vh);
    padding: 20px 14px 16px;
  }
  .difficulty-dialog .dialog-close {
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    font-size: 20px;
  }
  .about-dialog {
    width: calc(100% - 16px);
    max-height: min(92dvh, 92vh);
    padding: 20px 14px 16px;
  }
  .about-dialog .dialog-close {
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    font-size: 20px;
  }
  .compare-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    width: calc(100% - 8px);
    padding: 20px 8px 10px;
  }
  .compare-dialog .dialog-close {
    top: 14px;
    right: 14px;
  }
  .compare-dialog h2 {
    max-width: calc(100% - 44px);
    font-size: 23px;
    line-height: 1.25;
  }
  .compare-scroll {
    overflow-x: hidden;
    scrollbar-gutter: auto;
  }
  .compare-table {
    width: 100%;
    min-width: 0;
    font-size: 11px;
  }
  .compare-table th,
  .compare-table td {
    min-width: 0;
    padding: 8px 4px;
    overflow-wrap: anywhere;
  }
  .compare-table th:first-child {
    width: 26%;
    min-width: 0;
    white-space: normal;
  }
  .compare-table th:not(:first-child),
  .compare-table td:not(:first-child) {
    width: 24.666%;
    min-width: 0;
  }
  .table-th-label {
    align-items: flex-start;
    gap: 3px;
  }
  .table-icon { font-size: 14px; }
  .compare-detail-button {
    min-height: 34px;
    padding: 5px 3px;
    font-size: 11px;
  }
  .compare-detail-button .material-symbols-rounded { display: none; }
  footer { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 480px) {
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
