#app {
  color: #0e302e;
  padding-bottom: 30px;
  --ink: #163731;
  --brand: #18504c;
  --deep: #0e302e;
  --line: #d6e3dc;
  --quiet: #4b635e;
  --white: #fff;
}
#app *, #app *::before, #app *::after { box-sizing: border-box; }
#app [hidden] { display: none !important; }
#app a { color: var(--brand); text-underline-offset: .18em; }
#app button, #app input, #app select { font: inherit; }
#app button { cursor: pointer; }
#app button:disabled { cursor: default; opacity: .55; }
#app button, #app a, #app input, #app select { -webkit-tap-highlight-color: transparent; }
#app :focus-visible { outline: 3px solid #29908c; outline-offset: 4px; }
#app h1, #app h2, #app h3, #app p, #app figure { margin: 0; }
#app h1, #app h2, #app h3 { letter-spacing: -.035em; }
#app p { line-height: 1.55; }
#app section { padding: 0; }
#app img { display: block; max-width: 100%; height: auto; }
#app .wrap { width: min(1240px, 88%); margin: auto; }
#app .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#app .crumb { display: inline-block; margin-bottom: 12px; color: var(--brand); font-size: .9rem; text-decoration: underline; }
#app .global-form { display: flex; padding: 5px; align-items: stretch; background: white; border-radius: 12px; }
#app .search-field { position: relative; display: flex; flex: 1; min-width: 0; }
#app .global-form input { width: 100%; min-width: 0; min-height: 50px; border: 0; background: transparent; border-radius: 7px; padding: 0 12px 0 43px; color: var(--ink); }
#app .global-form input::placeholder { color: #506a62; opacity: 1; }
#app .global-form input:focus-visible { outline-offset: -3px; }
#app .lens { position: absolute; pointer-events: none; top: 16px; left: 14px; width: 15px; height: 15px; border: 2px solid var(--brand); border-radius: 50%; }
#app .lens::after { content: ""; position: absolute; width: 8px; height: 2px; background: var(--brand); transform: rotate(45deg); left: 10px; top: 11px; }
#app .primary, #app .secondary, #app .subtle { border-radius: 8px; padding: 9px 15px; font-weight: 700; min-height: 42px; }
#app .primary { border: 1px solid var(--brand); background: var(--brand); color: #fff; padding-inline: clamp(12px,2vw,25px); }
#app .primary:hover { background: #236f65; }
#app .secondary { background: #edf6f0; border: 1px solid #c8ded4; color: var(--brand); }
#app .subtle { background: #fff; border: 1px solid var(--line); color: var(--brand); }
#app .search-hint { color: var(--quiet); font-size: .9rem; }
#app .block { margin: 45px 0; }
#app h2 { font-size: clamp(1.65rem,3vw,2.18rem); line-height: 1.15; }
#app h3 { font-size: 1.22rem; }
#app .block > h2 { margin-bottom: 19px; }
#app .featured-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 14px; }
#app .featured { background: white; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
#app .featured > a:first-child { display: block; text-decoration: none; }
#app .featured img { width: 100%; aspect-ratio: 1.6; object-fit: contain; background: #fff; }
#app .featured > a:first-child div { padding: 10px 14px 5px; }
#app .featured strong { display: block; font-size: 1.1rem; }
#app .featured span { display: block; color: var(--quiet); margin-top: 3px; font-size: .87rem; font-style: italic; }
#app .crop-index { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
#app .crop-index a { display: block; background: white; min-height: 68px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; text-decoration: none; }
#app .crop-index a:hover, #app .featured:hover, #app .search-result-list a:hover { border-color: #6cae9a; }
#app .crop-index small { display: block; margin-top: 3px; color: var(--quiet); font-style: italic; }
#app .about { display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px; margin-block: 54px 24px; padding: 27px; background: #e8f2ed; border: 1px solid var(--line); border-radius: 16px; }
#app .about p { margin-top: 10px; }#app .sources { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
#app .bbch-cta { display: flex; flex-wrap: wrap; gap: 12px 25px; padding: 12px 0 35px; }
#app #search-results { margin-block: 38px 55px; scroll-margin-top: 18px; }
#app #search-results h2 { margin-bottom: 15px; }
#app .search-result-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
#app .search-result-list a { text-decoration: none; background: white; border: 1px solid var(--line); border-radius: 8px; display: flex; gap: 12px; align-items: center; padding: 13px; }
#app .search-result-list strong, #app .search-result-list small { display: block; }
#app .search-result-list small { color: var(--quiet); margin-block: 2px; }
#app .code { display: inline-flex; width: fit-content; justify-content: center; align-items: center; white-space: nowrap; min-width: 54px; min-height: 35px; border-radius: 8px; padding: 5px 9px; font-weight: 800; background: #deeee5; color: #174b40; font-variant-numeric: tabular-nums; }
#app .more { margin-top: 16px; }
#app .muted { color: var(--quiet); }
#app .stage-heading { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
#app .controls { display: grid; grid-template-columns: 1fr minmax(0,.55fr); gap: 14px; margin-top: 17px; }
#app .controls label { display: grid; gap: 5px; font-size: .92rem; font-weight: 700; }
#app .controls input, #app .controls select { width: 100%; min-width: 0; min-height: 46px; border: 1px solid #a7beb4; color: var(--ink); background: white; border-radius: 8px; padding: 8px 12px; }
#app .compare-bar { display: flex; align-items: center; flex-wrap: wrap; margin-block: 12px 20px; gap: 8px 13px; font-size: .9rem; }
#app .phase-group { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 11px; margin-bottom: 15px; }
#app .phase-group h3 { background: #e9f3ee; padding: 13px 16px; }
#app .stage-row { display: grid; grid-template-columns: 1fr auto; align-items: center; }
#app .stage-row + .stage-row { border-top: 1px solid #edf1ee; }
#app .stage-row > a { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 13px; align-items: center; min-height: 66px; padding: 8px 14px; text-decoration: none; }
#app .stage-row > a:hover { background: #f2f8f4; }
#app .stage-row small { display: block; color: var(--quiet); margin-top: 3px; }
#app .compare-check { display: flex; gap: 6px; align-items: center; min-height: 44px; padding-right: 14px; font-size: .85rem; }
#app .compare-check input { accent-color: var(--brand); width: 18px; height: 18px; }
#app .gallery { margin-top: 15px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
#app .gallery figure, #app .stage-detail figure { border: 1px solid var(--line); background: white; border-radius: 10px; overflow: hidden; }
#app .image-button { border: 0; display: block; width: 100%; background: #fff; padding: 0; cursor: zoom-in; }
#app .gallery img { height: 195px; width: 100%; object-fit: contain; }
#app figcaption { padding: 10px 12px; }
#app figcaption p, #app figcaption small { color: var(--quiet); font-size: .87rem; }
#app figcaption strong { font-size: .9rem; display: block; margin-bottom: 3px; }
#app .source { font-size: .9rem; }
#app dialog { border: 1px solid var(--line); border-radius: 16px; padding: 17px 23px 23px; max-height: 88dvh; width: min(900px, calc(100% - 24px)); color: var(--ink); }
#app dialog::backdrop { background: #102b27a8; }
#app .dialog-bar { display: flex; justify-content: end; margin-bottom: 8px; }
#app #dialog-body > figure img { width: 100%; max-height: 65vh; object-fit: contain; }
#app .stage-detail h2, #app .stage-detail h3 { margin-block: 12px 4px; }
#app .stage-detail p { margin-top: 8px; }
#app .stage-detail figure { margin-top: 14px; }
#app .stage-detail img { width: 100%; max-height: 500px; object-fit: contain; }
#app .condition { padding: 8px 11px; border-left: 3px solid #29908c; background: #e8f2ed; }
#app .detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
#app .comparison { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,230px),1fr)); gap: 13px; margin-top: 14px; }
#app .comparison .stage-detail { background: #f3f8f5; border-radius: 10px; padding: 12px; }
@media(max-width: 920px) {
  #app .featured-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  #app .crop-index { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media(max-width: 650px) {
  #app .feature-grid, #app .crop-index, #app .gallery { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #app .featured-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #app .about, #app .search-result-list, #app .controls { grid-template-columns: 1fr; }
  #app .about { padding: 18px; gap: 18px; }
  #app .stage-row > a { gap: 6px; padding-inline: 8px; }
  #app .compare-check { padding-right: 7px; }
  #app .compare-check span { display: none; }
  #app .gallery img { height: 135px; }
}

#app .observation-note {
  margin: 0 0 16px;
  padding: 12px 15px;
  border-left: 3px solid #29908c;
  border-radius: 0 8px 8px 0;
  background: #e8f2ed;
}
#app .photo-credit { color: var(--quiet); font-size: .79rem; line-height: 1.3; font-weight: 400; }
#app .featured.crop-photo img { object-fit: cover; }
#app .featured .photo-credit { display: block; padding: 0 14px 11px; overflow-wrap: anywhere; }
#app .field-text { display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.4; }
#app .source-plates { padding: 12px 16px; margin-top: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
#app .source-plates summary { color: var(--brand); cursor: pointer; font-weight: 700; }
#app .source-plates p { margin-top: 8px; }
#app .stage-detail .source-plates .gallery { grid-template-columns: repeat(auto-fit,minmax(min(100%,230px),1fr)); }
#app .stage-detail .source-plates figure { margin-top: 0; }

#app .load-error {
  margin-block: 24px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

#app .stage-links { display: flex; gap: 1rem; flex-wrap: wrap; }
#app .ctgb-panel { margin-block: 1.25rem; padding: 1rem 1.2rem; border: 1px solid #d9c19e; border-left: 4px solid #ef7c28; border-radius: 8px; background: #fffbf4; }
#app .ctgb-panel h2, #app .ctgb-panel p { margin: 0 0 .65rem; }
#app .ctgb-card { padding: .85rem; margin-block: .85rem; border: 1px solid #e8dcc8; border-radius: 7px; background: #fff; }
#app .ctgb-card h3 { margin: 0 0 .35rem; }
#app .ctgb-card h3 span, #app .ctgb-scope { color: var(--quiet); font-weight: 500; font-size: .93rem; }
#app .ctgb-card small { display: block; margin-top: .4rem; color: var(--quiet); }
#app .stage-row small.ctgb-badge, #app .search-result-list small.ctgb-badge { display: inline-block; width: fit-content; font-weight: 700; color: #67440e; background: #fff0d6; padding: .15rem .45rem; border-radius: 5px; }
#app .ctgb-register { margin: 1rem 0; padding: .8rem .9rem; border: 1px solid #e8dcc8; border-radius: 7px; background: #fff; }
#app .ctgb-register summary { cursor: pointer; font-weight: 700; }
#app .ctgb-register[open] summary { margin-bottom: .65rem; }
#app .ctgb-register label { display: block; font-weight: 600; margin: .7rem 0 .3rem; }
#app .ctgb-register input { max-width: 28rem; width: 100%; min-height: 44px; border: 1px solid #849994; padding: .55rem .65rem; margin-bottom: .65rem; border-radius: 6px; }
#app .ctgb-register li + li { margin-top: .35rem; }
#app .bbch-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 5px; }
#app .bbch-links a { color: var(--brand); text-decoration: underline; display: inline-flex; align-items: center; min-height: 44px; }
#app .results-header { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; justify-content: space-between; margin-bottom: 14px; }
#app .results-header h2#results-heading { margin: 0; scroll-margin-top: 20px; }
#app .results-header .subtle { min-height: 44px; }
#app .bbch-cta { align-items: center; justify-content: space-between; padding: 22px 27px; background: #e8f2ed; border-radius: 16px; }
#app .bbch-cta h2 { font-size: clamp(1.2rem,2vw,1.55rem); }
#app .bbch-cta a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
@media (max-width: 650px) {
  #app .crumb { margin-bottom: 12px; }
  #app #search-results { margin-block: 24px 36px; }
  #app .results-header .subtle { padding-inline: 10px; }
}
#app .result-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; color: var(--quiet); }
#app .result-summary a { font-weight: 700; }
#app #search-regulations { scroll-margin-top: 20px; }

#app .bbch-intro { padding-block: clamp(24px,4vw,52px) 0; }
#app .bbch-intro h1 { max-width: 18ch; font-size: clamp(2.5rem, 5.15vw, 4.8rem); font-weight: 800; line-height: 1.03; letter-spacing: -.05em; color: #0e302e; }
#app .bbch-eyebrow { text-transform: uppercase; font-size: .78rem; font-weight: 800; letter-spacing: .12em; color: #18504c; margin-bottom: 14px; }
#app .bbch-lead { margin-top: 12px; color: var(--quiet); font-size: clamp(1rem, 1.5vw, 1.18rem); }
#app .bbch-methods { max-width: 760px; margin-top: 20px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: clamp(14px,2vw,22px); }
#app .bbch-search, #app .photo-pilot { display: grid; gap: 10px; min-width: 0; }
#app .bbch-mode { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: 11px; background: #e8f2ed; }
#app .bbch-mode button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 6px 8px; border: 1px solid transparent; border-radius: 8px; color: var(--brand); background: transparent; font-size: .9rem; font-weight: 750; }
#app .bbch-mode button:hover { background: #fff; }
#app .bbch-mode button[aria-pressed="true"] { background: var(--brand); color: #fff; }
#app .bbch-mode svg { flex-shrink: 0; }
#app .photo-pilot { scroll-margin-top: 100px; }
#app:has(.bbch-mode [aria-controls="photo-pilot"][aria-pressed="true"]) #search-results { display: none; }
#app .global-form { border: 1px solid #b9cbc3; }
#app .photo-pilot form { display: grid; gap: 8px; min-width: 0; justify-items: start; padding: 0; margin: 0; border: 0; background: transparent; }
#app #bbch-photo-file:empty, #app #bbch-photo-challenge:empty { display: none; }
#app #bbch-photo-file { overflow-wrap: anywhere; }
#app #bbch-photo-data { color: var(--quiet); font-size: .85rem; }
#app #bbch-photo-crop { grid-template-columns: minmax(0,1fr) auto; align-items: end; }
#app #bbch-photo-crop select { width: 100%; min-width: 0; min-height: 48px; border: 1px solid #a7beb4; border-radius: 8px; padding: 8px; background: #fff; color: var(--ink); }
#app .photo-pilot .button { cursor: pointer; justify-content: center; text-align: center; min-height: 44px; }
#app .photo-pilot form:has(#bbch-image:focus-visible) label { outline: 3px solid #18504c; outline-offset: 3px; }
#app #bbch-photo-output:not(:empty) { padding: 14px; background: #fff; border-radius: 8px; }
@media (max-width: 760px) {
  #app .bbch-methods { margin-top: 16px; }
  #app .bbch-intro h1 { font-size: clamp(2rem,8.5vw,2.7rem); }
}
@media (max-width: 360px) {
  #app #bbch-photo-crop { grid-template-columns: minmax(0,1fr); }
}

#app .bbch-purpose { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 16px; max-width: 760px; }
#app .bbch-purpose label { font-weight: 750; }
#app .bbch-purpose select { min-height: 44px; max-width: 100%; padding: 8px 12px; border: 1px solid #a7beb4; border-radius: 8px; background: #fff; color: var(--ink); }
#app #bbch-purpose-note { color: var(--quiet); font-size: .9rem; }
#app .bbch-variant { font-size: .9rem; margin-top: 8px; }
#app .purpose-tag { color: var(--quiet); font-weight: 700; }
