:root {
    color-scheme: light;
    --ink: #172c45;
    --blue: #15518c;
    --paper: #f3f7fc;
    --line: #cbdced;
    --soft: #e2effd;
    --accent: #0064b5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); font: 1rem/1.6 system-ui, sans-serif; }
a { color: var(--blue); text-underline-offset: .19em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
button, input { font: inherit; }
button { cursor: pointer; }
h1, h2, h3 { line-height: 1.15; }
h1, h2 { font-family: Georgia, serif; }
h1 { margin: 0 0 .7rem; font-size: clamp(2.3rem, 6vw, 4rem); font-weight: normal; overflow-wrap: anywhere; }
h2 { margin: 1.75rem 0 .65rem; font-size: 1.65rem; }
p { margin: 0 0 1rem; }
.shell { width: min(72rem, calc(100% - 2.5rem)); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: -10rem; background: white; padding: .5rem; z-index: 2; }
.skip:focus { top: .5rem; }
.site-header { background: #fbfdff; border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.header-inner { min-height: 4.5rem; padding-block: .55rem; }
.brand { font: 1.35rem Georgia, serif; text-decoration: none; white-space: nowrap; }
.brand strong { color: var(--accent); }
#nav { display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
#nav a { padding-block: .55rem; text-decoration: none; }
#nav a[aria-current] { text-decoration: underline; font-weight: 650; }
.nav-toggle, .secondary { color: var(--blue); background: #fbfdff; border: 1px solid #9ab5cf; border-radius: .35rem; padding: .45rem .7rem; }
.main { padding-block: clamp(2.4rem, 7vw, 5rem); min-height: 65vh; }
.hero { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: clamp(1.5rem, 6vw, 5rem); align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 7vw, 5.6rem); line-height: .95; }
.hero h1 em { display: block; color: var(--accent); font-style: normal; }
.hero-note { padding: clamp(1.2rem, 4vw, 2.6rem); background: var(--soft); border-top: 4px solid var(--blue); border-radius: .35rem; }
.hero-note h2 { margin-top: 0; }
.lead { font-family: Georgia, serif; font-size: 1.32rem; line-height: 1.45; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.button { display: inline-block; background: var(--blue); color: white; padding: .65rem .95rem; border-radius: .35rem; text-decoration: none; }
.button:hover { background: var(--accent); color: white; }
.reading { max-width: 43rem; }
.pairs { max-width: 38rem; }
.pairs div { display: grid; grid-template-columns: 1fr 2fr; padding: .65rem .85rem; margin-bottom: .35rem; background: var(--soft); }
.pairs dt { font-weight: 650; }
.pairs dd { margin: 0; }
.pairs dd span { color: var(--blue); font-size: .88rem; display: block; }
.site-footer { border-top: 1px solid var(--line); padding: 1rem 0; }
.selector { display: grid; grid-template-columns: minmax(13rem, 1fr) minmax(0, 3fr); align-items: start; gap: 1.5rem; margin-top: 1.5rem; }
.selection { padding: 1rem; position: sticky; top: .75rem; background: var(--soft); border-radius: .45rem; max-height: calc(100vh - 1.5rem); overflow: auto; }
.selection h2 { margin-top: 1rem; }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: .4rem; }
legend { font-weight: 700; margin-bottom: .3rem; padding: 0; }
fieldset label { display: block; }
fieldset button { justify-self: start; }
.chosen, .group ul { padding: 0; margin: 0; list-style: none; }
.chosen { display: grid; gap: .25rem; }
.chosen li { display: grid; justify-items: start; gap: .25rem; }
.chosen-plus { color: var(--accent); font-weight: 700; line-height: 1; padding-left: .7rem; }
.clear { margin-top: .7rem; }
.catalogue h2 { margin-top: 0; }
.search label { display: block; font-weight: 650; }
.search input { width: 100%; max-width: 27rem; padding: .55rem; border-radius: .35rem; border: 1px solid #7392ad; color: var(--ink); background: #fbfdff; }
.search-result { margin: .25rem 0 .75rem; }
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); align-items: start; gap: .85rem; }
.group { background: #fbfdff; border: 1px solid var(--line); border-radius: .45rem; overflow: clip; }
.food + .food { border-top: 1px solid var(--line); }
.food-row { display: grid; grid-template-columns: 1.15rem minmax(0, 1fr) auto; align-items: center; gap: .45rem; min-height: 2.8rem; padding: .4rem .75rem; width: 100%; text-align: left; }
.food button { color: var(--blue); background: transparent; border: 0; }
.food button:hover { background: var(--soft); }
.food button:focus-visible { outline-offset: -3px; }
.food-name { overflow-wrap: anywhere; }
.food-mark, .food-action { text-align: center; }
.food-action { width: 1.15rem; font-size: 1.15rem; font-weight: 700; }
.food-state small { color: var(--accent); text-align: right; }
.food-mark { color: #923232; font-size: 1.15rem; font-weight: 700; }
.is-selected .food-mark { color: #187044; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 46rem) {
    .hero, .selector, .pairs div { grid-template-columns: 1fr; }
    .selection { position: static; max-height: none; }
    #nav { width: 100%; }
    #nav.collapsed { display: none; }
}
.mobile-carta, .browse { display: none; }
@media (max-width: 46rem) {
    .mobile-carta { display: inline; font-size: .9rem; margin-left: auto; }
    .browse { display: block; margin: .65rem 0 0; }
}
@media (max-width: 24rem) {
    .header-inner { column-gap: .55rem; }
    .brand { font-size: 1.08rem; }
}

.brand .domain, .hero .domain { color: var(--blue); font-size: .56em; }
.site-footer .footer-inner { justify-content: end; }
.group h3 { margin: 0; font-size: 1rem; background: var(--soft); color: var(--blue); padding: .75rem; }
.main a, .site-footer a {
    border: 1px solid var(--blue);
    border-radius: .3rem;
    padding: .12em .38em;
    text-decoration: none;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}
.main a:not(.button):hover, .site-footer a:hover { background: var(--soft); }
.main .actions a, .main .button, .site-footer a { display: inline-block; padding: .6rem .9rem; }

.search-match > .food-row { background: #ffefbb; box-shadow: inset 3px 0 #a56b10; }
.search-match > .food-row:focus { outline: 2px solid var(--accent); outline-offset: -3px; }
