/* Theme navigation shares the buyer site's search and heading typography. */
.hero-search-buttons > button,
.theme-dialog,
.theme-dialog button,
.theme-link {
  border-radius: 0;
}
.hero-search-buttons > button {
  justify-content: flex-start;
}
.hero-search-buttons > [data-theme-open] {
  padding-inline: 0;
}
.hero-search-buttons > [data-theme-open] span {
  word-break: keep-all;
}
.theme-dialog {
  box-sizing: border-box;
  width: min(640px, calc(100% - 32px));
  max-width: none;
  max-height: 88vh;
  max-height: 88dvh;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  text-align: start;
}
.theme-dialog[open] {
  display: flex;
  flex-direction: column;
}
.theme-dialog .hero-dialog-heading {
  flex: none;
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 20px 12px 24px;
}
.theme-dialog .hero-dialog-heading h2 {
  color: var(--ink);
}
.theme-dialog-scroll {
  overflow-y: auto;
  overscroll-behavior-y: contain;
  min-height: 0;
  padding: 20px 24px 24px;
  scrollbar-gutter: stable;
}
.theme-dialog .theme-group h3,
.home-theme-nav .theme-group h3 {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
}
.theme-dialog .theme-group h3 {
  display:flex;
  align-items:center;
  gap:12px;
  color:var(--ink);
}
.theme-dialog .theme-group h3::after {
  content:"";
  flex:1;
  height:1px;
  background:var(--line);
}
.theme-dialog .theme-group h3 svg,
.home-theme-nav .theme-group h3 svg {
  width:20px;
  height:20px;
  flex:0 0 20px;
  color:var(--green);
}
.theme-popup-groups {
  display: grid;
  gap: 20px;
}
.theme-link-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.theme-link-grid > li {
  min-width: 0;
  margin: 0;
}
.theme-link {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  align-items: baseline;
  gap: 0 .3em;
  box-sizing: border-box;
  min-height: 48px;
  height: 100%;
  padding: 9px 11px;
  border: 1px solid #c7d6cd;
  color: var(--green);
  background: white;
  font-size: .9375rem;
  line-height: 1.45;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.theme-popup-groups .theme-link {
  justify-content:space-between;
  align-items:center;
  color:var(--ink);
  font-weight:600;
}
.theme-count {
  font-weight:400;
  color: #4e6257;
  font-size: .875rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.theme-link:hover { background: #f1f6f3; }
.theme-link:focus-visible,
.theme-dialog button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}
.home-theme-nav .theme-group {
  display:grid;
  grid-template-columns: minmax(180px, 24%) 1fr;
  gap:clamp(16px, 3vw, 40px);
  align-items:start;
  padding-block:18px;
  border-bottom:1px solid var(--line);
}
.home-theme-nav .theme-group h3 {
  display:flex;
  align-items:center;
  gap:10px;
  margin:0;
  min-height:44px;
  color:var(--ink);
}
.home-theme-nav .theme-link-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px 8px; }
.home-theme-nav .theme-link, .home-theme-all {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  min-height:44px;
  font-variant-numeric:tabular-nums;
  text-decoration:none;
}
.home-theme-nav .theme-link {
  flex-wrap:nowrap;
  padding:9px 12px;
  background:#f3f6f4;
  border:0;
  color:var(--ink);
  font-weight:500;
}
.home-theme-nav .theme-link::after, .home-theme-all::after {
  content:"";
  flex:none;
  width:6px;
  height:6px;
  border:solid var(--green);
  border-width:1.5px 1.5px 0 0;
  transform:rotate(45deg);
}
.home-theme-all {
  width:fit-content;
  margin:8px 0 0 auto;
  gap:10px;
  padding:0 6px;
  color:var(--green);
  font-weight:600;
}
.home-theme-nav a:hover, .home-theme-nav a:focus-visible {
  color:var(--green);
  background:#e8f1eb;
  text-decoration:underline;
  text-underline-offset:3px;
}
.home-theme-all:focus-visible { outline:2px solid var(--green); outline-offset:2px; }
:root.theme-dialog-open { overflow: hidden; }
:root.theme-dialog-open body {
  position: fixed;
  top: var(--theme-body-top);
  left: 0;
  width: 100%;
  overflow: hidden;
}
@media (max-width: 720px) {
  .theme-dialog {
    position: fixed;
    inset: auto 0 0;
    margin: 0;
    width: 100%;
    border-width: 1px 0 0;
  }
  .theme-dialog[open] { animation: theme-sheet-in .18s ease-out; }
  .theme-dialog .hero-dialog-heading {
    padding: 8px max(12px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  }
  .theme-dialog-scroll {
    scrollbar-gutter: auto;
    padding: 15px max(12px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }
  .theme-popup-groups .theme-link {
    justify-content:flex-start;
    align-items:baseline;
    gap:0;
    min-height:44px;
    padding:6px 8px;
    font-size:.875rem;
  }
  .theme-popup-groups .theme-count { font-size:.8125rem; }
  .theme-dialog .theme-group h3 { gap:8px; margin-bottom:8px; }
  .theme-popup-groups { gap:16px; }
  .home-theme-nav .theme-group { grid-template-columns:1fr; gap:8px; padding-block:14px; }
  .home-theme-nav .theme-group h3 { min-height:32px; }
  .home-theme-nav .theme-link-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .home-theme-nav .theme-link { padding-inline:10px; font-size:.875rem; }
}
@media (max-width:389px) {
  .theme-dialog-scroll {
    padding-inline:max(6px, env(safe-area-inset-left)) max(6px, env(safe-area-inset-right));
  }
  .theme-popup-groups .theme-link-grid {
    display:flex;
    flex-wrap:wrap;
    gap:6px 4px;
  }
  .theme-popup-groups .theme-link-grid > li {
    flex:0 1 calc(50% - 2px);
    min-width:max-content;
  }
  .theme-popup-groups .theme-link {
    flex-wrap:nowrap;
    justify-content:center;
    align-items:center;
    padding-inline:3px;
    white-space:nowrap;
  }
  .theme-popup-groups .theme-count { font-feature-settings:"palt"; }
}
@keyframes theme-sheet-in { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) {
  .theme-dialog[open] { animation: none; }
}

.theme-page {
  padding-top: 22px;
  padding-bottom: 48px;
}
.theme-page *,
.theme-page *::before,
.theme-page *::after {
  border-radius: 0 !important;
}
.theme-page .page-intro { margin-block: 12px 20px; padding: 0; }
.theme-page .page-intro h1 { margin: 0 0 6px; font-size: 1.375rem; line-height: 1.45; }
.theme-page .page-intro p:not(.area-label) { margin: 0; color: var(--muted); line-height: 1.65; }
.theme-page .page-intro .area-label { margin: 0 0 4px; }
.theme-page #results { scroll-margin-top: 6rem; }
.theme-directory .page-intro { margin-bottom: 24px; }
.theme-directory-groups { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(16px,2.4vw,32px); align-items:start; }
.directory-category { min-width: 0; }
.directory-photo { display:block; width:100%; height:auto; aspect-ratio:8 / 3; object-fit:contain; border-radius:0; }
.directory-category h2 { display:flex; align-items:center; gap:10px; font-size:1.0625rem; line-height:1.5; margin:0; color:var(--ink); padding:14px 0 12px; border-bottom:2px solid var(--green); }
.directory-category h2 svg { width:22px; height:22px; flex:none; color:var(--green); }
.directory-category ul { list-style:none; margin:0; padding:0; }
.directory-category li { margin:0; padding:0; border-bottom:1px solid var(--line); }
.directory-link { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:48px; padding:9px 6px; color:var(--ink); text-decoration:none; }
.directory-link:hover,.directory-link:focus-visible { background:#eff6f1; color:var(--green); text-decoration:underline; }
.directory-count { color:var(--green); font-variant-numeric:tabular-nums; font-weight:600; white-space:nowrap; }
.directory-count small { margin-left:3px; font-weight:400; }
.directory-all { margin:28px 0 0; }
@media(max-width:760px) {
  .theme-page .page-intro h1 {font-size:1.25rem;}
  .theme-directory-groups {grid-template-columns:1fr;gap:28px;}
  .directory-category h2 {padding:10px 0;font-size:1rem;}
  .directory-category h2 svg {width:19px;height:19px;}
}
.theme-related {
  margin-top: clamp(32px, 5vw, 64px);
  border-top: 2px solid var(--green);
}
.related-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding-inline:clamp(16px, 2.8vw, 32px);
  background:#f7f5ee;
}
.related-heading h2 { margin:0; font-size:clamp(1.125rem, 2vw, 1.375rem); line-height:1.4; }
.related-heading img { display:block; width:clamp(120px, 26vw, 220px); height:auto; mix-blend-mode:multiply; }
.related-choices {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px 12px;
  padding:0;
  margin:16px 0 12px;
  list-style:none;
}
.related-choice, .related-all {
  display:flex;
  align-items:center;
  gap:10px;
  min-height:52px;
  padding:10px 14px;
  box-sizing:border-box;
  text-decoration:none;
}
.related-choice { border:1px solid #cbdad1; color:var(--ink); }
.related-name { flex:1; font-weight:600; line-height:1.5; }
.related-choice svg, .related-all svg { flex:none; width:16px; height:16px; color:var(--green); }
.related-choice:hover, .related-choice:focus-visible { background:#eff6f1; border-color:var(--green); }
.related-all { width:fit-content; min-height:44px; margin-left:auto; font-weight:600; color:var(--green); }
.related-tools { display:flex; flex-wrap:wrap; gap:0 20px; border-top:1px solid var(--line); }
.related-tools a { display:inline-flex; align-items:center; min-height:44px; color:var(--muted); font-size:.875rem; text-underline-offset:3px; }
.theme-related a:focus-visible { outline:2px solid var(--green); outline-offset:2px; }
@media(max-width:720px) {
  .related-choices { grid-template-columns:1fr; gap:6px; margin-top:12px; }
  .related-choice { padding-inline:12px; }
  .related-all { justify-content:center; width:100%; }
  .related-tools { justify-content:center; gap:0 14px; }
}
@media (max-width: 600px) {
  .theme-page .kitami-breadcrumb { gap: 4px 7px; }
}

/* These shared navigation controls also appear on the new theme pages. */
body:has(main.theme-page) :is(.header, .mobile-contacts, .site-footer, .favorite-feedback),
body:has(main.theme-page) :is(.header, .mobile-contacts, .site-footer) * {
  border-radius: 0 !important;
}

#hero-area { padding: 0; overflow: hidden; max-height: min(88dvh, 740px); }
#hero-area form { display: flex; flex-direction: column; max-height: inherit; }
#hero-area .hero-dialog-heading, #hero-area .hero-dialog-actions {
  flex: none; padding: 10px 20px; margin: 0;
}
#hero-area .hero-dialog-heading { border-bottom: 1px solid var(--line); }
.area-dialog-body { padding: 16px 20px 20px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.area-dialog-body h3 { margin: 0 0 10px; font-size: 1rem; }
.area-features { margin-bottom: 22px; }
.area-feature-row {
  display: grid; grid-template-columns: minmax(58px, .8fr) repeat(2, minmax(0, 1fr));
  align-items: center; gap: 8px; padding-block: 6px; border-top: 1px solid var(--line);
}
.area-feature-row h4 { margin: 0; font-size: .9375rem; }
.area-feature-row a {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
  border: 1px solid #c2d5c9; border-radius: 0; color: var(--green); background: #f1f6f2;
  font-size: .9375rem; font-weight: 600; text-decoration: none;
}
.area-feature-row a:is(:hover, :focus-visible) { background: #e1ede5; border-color: var(--green); }
.area-feature-row svg { width: 16px; height: 16px; flex: none; }
#hero-area .hero-area-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 6px; }
#hero-area .hero-area-options span { display: grid; place-items: center; padding: 4px; text-align: center; border-radius: 0; }
@media (max-width: 600px) {
  #hero-area .hero-dialog-heading, #hero-area .hero-dialog-actions { padding: 8px 12px; }
  .area-dialog-body { padding: 12px; }
  .area-feature-row { gap: 5px; }
}
