:root {
    color-scheme: light;
    --paper: #fbfaf6;
    --panel: #f1eee6;
    --ink: #282a23;
    --muted: #64655b;
    --red: #ac3626;
    --red-dark: #842719;
    --rule: #d9d7cc;
    --field-rule: #a9a99b;
    --serif: "Baskervville", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    --sans: "DM Sans", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font: 1rem/1.55 var(--sans);
}
a { color: var(--red); text-underline-offset: 0.2em; }
a:hover { color: var(--red-dark); }
:focus-visible { outline: 3px solid #246697; outline-offset: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { touch-action: manipulation; }
img, svg { vertical-align: middle; }
h1, h2, h3, p { margin: 0; }
h1, h2, .brand { font-family: var(--serif); }
h1 {
    font-size: clamp(2.8rem, 5.4vw, 4.7rem);
    font-weight: 500;
    letter-spacing: -0.065em;
    line-height: 1.05;
    text-wrap: balance;
}
h2 { font-size: 1.75rem; font-weight: 550; letter-spacing: -0.04em; line-height: 1.22; }
h3 { font-size: 1rem; }
.accent { color: var(--red); }
.icon { flex: none; }
.wrap { width: min(78rem, calc(100% - 6rem)); margin-inline: auto; }
main.wrap { padding-bottom: 5rem; }
.skip-link { position: absolute; inset: 0 auto auto 0; z-index: 2; transform: translateY(-130%); padding: .65rem; background: white; }
.skip-link:focus { transform: translateY(0); }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.masthead { border-bottom: 1px solid var(--rule); }
.masthead-inner { min-height: 4.8rem; display: flex; align-items: center; gap: 3.5rem; }
.brand, .primary-nav a, .account-nav {
    text-decoration: none;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
}
.brand { gap: .6rem; font-size: 2rem; line-height: 1; font-weight: 700; letter-spacing: -.07em; white-space: nowrap; }
.primary-nav { display: flex; align-self: stretch; gap: 1.65rem; }
.primary-nav a { padding-inline: .08rem; position: relative; font-size: .95rem; }
.primary-nav [aria-current], .account-nav[aria-current], .primary-nav a:hover, .account-nav:hover { color: var(--red); }
.primary-nav [aria-current] { font-weight: 650; }
.primary-nav [aria-current]::after { content: ""; position: absolute; inset: auto 0 -1px; height: 3px; background: var(--red); }
.account-nav, .private-label { margin-left: auto; gap: .45rem; padding-block: .6rem; font-size: .925rem; }
.private-label { display: inline-flex; align-items: center; color: var(--muted); }
.private-label .icon { width: 1rem; }
.page-heading { padding: 3.35rem 0 2.45rem; overflow-wrap: anywhere; }
.page-heading .intro, .login-form .intro { margin-top: .75rem; }
.intro { color: var(--muted); font-size: 1.05rem; }
.page-heading .button { margin-top: 1.35rem; }
.journal-heading { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.journal-heading > div { min-width: 0; }
.journal-illustration { display: block; max-width: 100%; height: auto; }
.header-art { width: clamp(6rem, 12vw, 9rem); margin-right: 2rem; }
.button {
    display: inline-flex;
    gap: .5rem;
    align-items: center;
    justify-content: center;
    min-height: 2.8rem;
    border: 1px solid transparent;
    border-radius: .4rem;
    padding: .6rem 1.1rem;
    font-size: .94rem;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
}
.primary { color: #fff; background: var(--red); }
.primary:hover { color: #fff; background: var(--red-dark); }
.secondary { color: var(--ink); border-color: var(--field-rule); background: var(--paper); }
.secondary:hover { color: var(--ink); border-color: var(--ink); background: #f5f2ea; }
.notice { overflow-wrap: anywhere; padding: .8rem 1rem; background: #edf2e9; color: #34422f; margin-top: 1.5rem; border-left: 3px solid #526648; }
input:not([type=hidden], [type=checkbox]), select, textarea {
    width: 100%;
    min-width: 0;
    min-height: 2.85rem;
    border: 1px solid var(--field-rule);
    background: #fffefb;
    border-radius: .35rem;
    padding: .55rem .8rem;
}
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23535449' stroke-width='1.5'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E");
    background-position: right .8rem center;
    background-repeat: no-repeat;
    padding-right: 2.35rem;
    text-overflow: ellipsis;
}
textarea { resize: vertical; min-height: 6.5rem; }
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: .9rem;
    align-items: end;
    padding: 1.1rem 1.25rem 1.25rem;
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: .45rem;
}
.filter-field { width: 13.5rem; max-width: 100%; min-width: 0; }
label, .api-details h3 { display: block; font-weight: 600; font-size: .93rem; margin-bottom: .35rem; }
.filter-field label { font-size: .875rem; }
.filters .button, .filters select { min-height: 2.65rem; }
.restaurant-list { margin-top: 1.8rem; }
.list-head, .restaurant-row {
    display: grid;
    grid-template-columns: minmax(4.6rem, .85fr) minmax(0, 5fr) minmax(0, 2fr) 2.75rem;
    column-gap: 1.15rem;
    align-items: start;
}
.list-head {
    color: var(--muted);
    padding: 0 0 .7rem;
    border-bottom: 1px solid #a9a99b;
    text-transform: uppercase;
    font-size: .75rem;
    letter-spacing: .12em;
    font-weight: 650;
}
.restaurant-row { padding: 1.45rem 0; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.score, .unrated {
    display: inline-block;
    min-width: 3rem;
    max-width: 100%;
    text-align: center;
    padding: .23rem .35rem;
    color: var(--red);
    background: #f4e7de;
    border-radius: .3rem;
    font: 600 1.25rem/1.28 var(--serif);
    font-variant-numeric: lining-nums tabular-nums;
}
.unrated { color: var(--muted); background: var(--panel); font-weight: 400; }
.restaurant-row h2, .regions-list h2 { font-size: clamp(1.4rem, 2.15vw, 1.7rem); }
.entry h2 a, .region-entry h2 a { color: var(--ink); text-decoration: none; }
.entry h2 a:hover, .region-entry h2 a:hover { color: var(--red); text-decoration: underline; text-decoration-thickness: 1px; }
.icon-button {
    display: inline-grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border: 1px solid var(--field-rule);
    background: var(--paper);
    border-radius: .4rem;
    color: var(--ink);
}
.icon-button:hover { color: var(--red); border-color: var(--red); background: #f7eee6; }
.visit-meta { color: var(--muted); margin-top: .45rem; font-size: .9rem; }
.notes { margin-top: .4rem; white-space: pre-line; color: #585b50; }
.entry-tags { min-width: 0; padding-top: .15rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.tag-chip { display: inline-flex; align-items: center; gap: .2rem; max-width: 100%; overflow-wrap: anywhere; border-radius: .35rem; padding: .15rem .55rem; background: var(--panel); color: #4d5548; font-size: .875rem; }
.tag-list:not(:empty) + .tag-input-row { margin-top: .5rem; }
.tag-input-row { display: flex; align-items: center; gap: .5rem; }
.tag-input-row button { flex: none; }
.tag-chip button { flex: none; padding: .1rem .32rem; color: var(--muted); border: 0; background: transparent; font-size: 1.15rem; }
.tag-filter { position: relative; max-width: 100%; width: fit-content; }
.tag-filter summary { min-height: 2.65rem; padding: .45rem .8rem; border: 1px solid var(--field-rule); border-radius: .35rem; background: var(--paper); cursor: pointer; font-weight: 600; }
.tag-filter summary span { margin-left: .4rem; color: var(--muted); font-size: .875rem; font-weight: 400; }
.tag-filter fieldset { position: absolute; z-index: 3; top: 100%; left: 0; margin: .3rem 0 0; padding: .6rem; min-width: 0; width: min(16rem, 75vw); max-height: 45vh; overflow-y: auto; border: 1px solid var(--field-rule); border-radius: .35rem; background: var(--paper); box-shadow: 0 .3rem .8rem #282a231c; }
.tag-filter legend { float: left; width: 100%; padding: .15rem .3rem .4rem; font-size: .85rem; color: var(--muted); }
.tag-filter label { display: flex; align-items: baseline; gap: .55rem; margin: 0; padding: .35rem; cursor: pointer; overflow-wrap: anywhere; }
.tag-filter input { flex: none; accent-color: var(--red); }
.managed-tags { list-style: none; padding: 0; margin: 1.25rem 0 0; border-top: 1px solid var(--rule); }
.managed-tags li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .9rem 0; border-bottom: 1px solid var(--rule); }
.managed-tags strong, .tag-confirm { overflow-wrap: anywhere; }
.managed-tags p { color: var(--muted); font-size: .875rem; }
.managed-tags .notes { grid-column: 1 / -1; margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.tag-actions { display: flex; align-items: center; gap: .65rem; }
.tag-actions .button { padding-inline: .8rem; }
.region-tag, .map-link { display: inline-flex; align-items: baseline; gap: .3rem; font-size: .91rem; }
.region-tag { align-items: flex-start; color: #4d5548; }
.region-tag .icon, .map-link .icon { width: .97rem; }
.region-tag .icon { margin-top: .14rem; }
.map-link { align-items: center; font-weight: 550; text-decoration: none; }
.map-link:hover { text-decoration: underline; }
.blank-cell { color: var(--muted); font-size: .9rem; }
.empty { text-align: center; padding: 4rem 1rem; margin-top: 1.7rem; border-block: 1px solid var(--rule); }
.empty > .icon { width: 2rem; height: 2rem; color: var(--red); margin-bottom: .85rem; }
.empty p, .settings-panel p, .confirm p { margin-top: .6rem; color: var(--muted); }
.regions-list { padding: 0; list-style: none; border-top: 1px solid var(--field-rule); margin: 0; }
.regions-list li { display: flex; gap: 1rem; border-bottom: 1px solid var(--rule); padding: 1.4rem 0; overflow-wrap: anywhere; }
.region-symbol { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; background: #e9ecdf; color: #4a5742; border-radius: 50%; flex: none; }
.region-count { display: block; color: var(--muted); margin-top: .45rem; font-size: .875rem; }
.edit-region { margin-left: auto; display: grid; width: 2.75rem; height: 2.75rem; place-items: center; flex: none; }
.editor, .api-docs { max-width: 43rem; margin-inline: auto; }
.editor .page-heading { padding-bottom: 1.8rem; }
.editor h1 { font-size: clamp(2.55rem, 4.7vw, 3.9rem); }
.stack { display: grid; gap: 1.2rem; }
.field { min-width: 0; }
.field-note { color: var(--muted); font-size: .85rem; font-weight: 400; }
.help, .errorlist { margin: .3rem 0 0; font-size: .9rem; }
.help { color: var(--muted); }
.errorlist { color: #a12619; padding-left: 1.25rem; }
[aria-invalid=true] { border-color: #ac3626!important; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem; margin-top: .5rem; }
.text-button, .danger-link { color: var(--red); font-size: .94rem; background: none; border: 0; padding: .65rem .35rem; text-decoration: underline; text-underline-offset: .2em; }
.danger-link { margin-left: auto; }
.confirm, .settings-panel { border-top: 1px solid var(--rule); padding-top: 1.6rem; }
.settings-panel { padding-bottom: 1.75rem; }
.confirm .actions, .settings-panel .actions { margin-top: 1.35rem; }
.key-box, .api-details { margin-top: 1.35rem; padding: 1rem 1.15rem; border: 1px solid var(--rule); border-radius: .35rem; background: var(--panel); overflow-wrap: anywhere; }
.key-box input { margin-top: .6rem; font-family: monospace; }
.key-box p { margin: 0; }
.sign-out { border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.login-layout { padding-block: clamp(4rem, 11vh, 8rem); display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(2.5rem, 8vw, 7rem); }
.login-form { width: 100%; max-width: 26rem; margin-inline: auto; }
.login-form h1 { font-size: clamp(2.8rem, 5.1vw, 4.5rem); }
.login-form .stack { margin-top: 2.15rem; }
.login-form .primary { margin-top: .25rem; }
.login-art { background: #f5eddf; padding: 1.15rem; border-radius: .18rem; }
.art-frame {
    position: relative;
    aspect-ratio: 1.06;
    display: grid;
    align-items: center;
    padding: 1.5rem;
    border: 1px solid #c6afa0;
    background-image: radial-gradient(#c8b8a788 .75px, transparent .9px);
    background-size: .75rem .75rem;
}
.art-frame::before, .art-frame::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: .75rem;
    background: repeating-conic-gradient(#b8433380 0% 25%, transparent 0% 50%) 0 0 / .75rem .75rem;
}
.art-frame::before { top: 0; }
.art-frame::after { bottom: 0; }
.login-art .journal-illustration { width: min(82%, 23rem); justify-self: center; }
.api-docs { max-width: 58rem; padding-top: 3rem; overflow-wrap: anywhere; }
.api-docs h1 { margin-bottom: 1.4rem; }
.api-docs h2 { margin: 2rem 0 .8rem; }
.api-docs h3 { margin: 1rem 0 .4rem; }
.api-docs p, .api-docs ul, .api-docs ol { margin: .75rem 0; }
.api-docs table { display: block; overflow-x: auto; border-collapse: collapse; margin: 1rem 0; }
.api-docs :is(th, td) { padding: .5rem .8rem; border: 1px solid var(--rule); text-align: left; }
.api-docs th, .api-docs code, .api-docs pre { background: var(--panel); }
.api-docs code { padding: .1em .25em; border-radius: .2rem; }
.api-docs pre { padding: 1rem; overflow-x: auto; border: 1px solid var(--rule); border-radius: .35rem; }
.api-docs pre code { padding: 0; }
.restaurant-heading { padding: 2.5rem 0 2.25rem; overflow-wrap: anywhere; }
.parent-link { display: inline-block; margin-bottom: .65rem; font-size: .95rem; }
.restaurant-title, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.restaurant-title .button, .section-heading .button { flex: none; }
.restaurant-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.restaurant-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem 1.25rem; margin-top: 1.1rem; }
.detail-rating { color: var(--red-dark); padding: .22rem .65rem; border-radius: .32rem; background: #f4e7de; font-size: .92rem; }
.detail-rating strong { margin-left: .15rem; }
.restaurant-notes { max-width: 65ch; margin-top: 1rem; }
.section-jumps { display: none; }
.restaurant-sections { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: clamp(1.75rem, 5vw, 4rem); }
.restaurant-section { min-width: 0; scroll-margin-top: 1rem; border-top: 2px solid var(--ink); }
.section-heading { padding: 1.35rem 0 1.05rem; flex-wrap: wrap; }
.section-heading h2 { font-size: clamp(2rem, 3vw, 2.65rem); }
.section-count { color: var(--muted); font: 400 1rem/1.5 var(--sans); letter-spacing: 0; vertical-align: .17em; }
.section-heading .button { padding: .55rem .9rem; }
.visit-actions { display: flex; align-items: center; gap: .45rem; }
.section-sort { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; padding-bottom: 1.05rem; }
.section-sort > span { color: var(--muted); font-size: .91rem; }
.sort-choices { display: inline-flex; border-radius: .35rem; border: 1px solid var(--field-rule); }
.sort-choices :is(button, a) { color: var(--ink); border: 0; background: transparent; padding: .5rem .7rem; font-size: .9rem; text-decoration: none; }
.sort-choices :first-child { border-radius: .28rem 0 0 .28rem; }
.sort-choices :last-child { border-radius: 0 .28rem .28rem 0; }
.sort-choices :is(button, a):hover { background: var(--panel); }
.sort-choices :is(button[aria-pressed=true], a[aria-current=page]) { background: var(--ink); color: #fff; }
.detail-list { list-style: none; padding: 0; margin: 0; }
.detail-list > li, .section-empty { border-top: 1px solid var(--rule); padding-block: 1.15rem; }
.detail-list > li { display: grid; align-items: start; gap: .8rem; overflow-wrap: anywhere; }
.detail-list h3 { font: 600 1.35rem/1.3 var(--serif); letter-spacing: -.025em; }
.dish-row { grid-template-columns: 3.5rem minmax(0,1fr) auto; }
.dish-row .score, .dish-row .unrated { justify-self: start; }
.visit-row { grid-template-columns: minmax(0,1fr) auto; }
.visit-dishes { display: flex; flex-wrap: wrap; list-style: none; gap: .35rem; margin: .65rem 0 0; padding: 0; }
.visit-dishes li { max-width: 100%; background: var(--panel); border-radius: .25rem; padding: .15rem .55rem; font-size: .91rem; }
.section-empty { color: var(--muted); }
.dish-choices { border: 0; padding: 0; margin: 0; min-width: 0; }
.dish-choices legend { padding: 0; margin-bottom: .35rem; font-size: .93rem; font-weight: 600; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(13rem,100%),1fr)); gap: .5rem; }
.check-grid label {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 2.85rem;
    padding: .55rem .8rem;
    margin: 0;
    border: 1px solid var(--field-rule);
    border-radius: .35rem;
    font-weight: 400;
    cursor: pointer;
    overflow-wrap: anywhere;
}
.check-grid label:has(:checked) { background: #f6ece5; border-color: var(--red); }
.check-grid input { width: 1.1rem; height: 1.1rem; flex: none; margin: 0; accent-color: var(--red); }
@media (max-width: 52rem) {
    .filters .tag-filter { width: 16rem; }
    .restaurant-sections { grid-template-columns: minmax(0,1fr); gap: 2.2rem; }
    .section-jumps { display: flex; gap: 1.1rem; margin-top: 1rem; font-size: .95rem; }
}
@media (max-width: 48rem) {
    .wrap { width: calc(100% - 3rem); }
    .masthead-inner { gap: 1.75rem; }
    .header-art { margin-right: .75rem; }
    .list-head, .restaurant-row { grid-template-columns: 4.4rem minmax(0, 3.5fr) minmax(0, 1.4fr) 2.75rem; gap: .75rem; }
    .login-layout { gap: 2rem; }
}
@media (max-width: 56rem) {
    .masthead-inner { min-height: 3.9rem; flex-wrap: wrap; column-gap: 1rem; row-gap: 0; }
    .masthead-inner:has(.primary-nav) { padding-top: .8rem; }
    .brand { font-size: 1.8rem; }
    .brand img { width: 1.85rem; height: 1.85rem; }
    .primary-nav { order: 3; width: 100%; flex-wrap: wrap; gap: 0 clamp(.5rem, 2.5vw, 1.45rem); }
    .primary-nav a { padding-block: .72rem; }
    .account-nav, .private-label { font-size: .875rem; }
}
@media (max-width: 27rem) {
    .primary-nav { column-gap: .5rem; }
    .primary-nav a { font-size: .875rem; }
}
@media (max-width: 38rem) {
    .wrap { width: calc(100% - 2.25rem); }
    .page-heading { padding: 2.15rem 0 1.6rem; }
    .page-heading h1 { font-size: clamp(2.45rem, 8vw, 3rem); }
    .journal-heading { position: relative; display: block; }
    .journal-heading h1 { padding-right: 3rem; }
    .header-art { position: absolute; width: clamp(3.8rem, 15vw, 5.5rem); right: 0; bottom: 1.4rem; margin: 0; }
    .page-heading .intro { margin-top: .45rem; }
    .page-heading .button { margin-top: 1rem; }
    .filters { display: grid; grid-template-columns: minmax(0,1fr); padding: .8rem; gap: .7rem; }
    .filters .tag-filter { width: 100%; }
    .filters .tag-filter fieldset { position: static; width: 100%; box-shadow: none; }
    .filter-field { width: auto; display: grid; grid-template-columns: 3.5rem minmax(0,1fr); align-items: center; gap: .3rem; }
    .filter-field label { margin: 0; }
    .filters .button { grid-column: 1 / -1; min-height: 2.45rem; }
    .restaurant-list { margin-top: .6rem; }
    .list-head { display: none; }
    .restaurant-row { position: relative; grid-template-columns: 3.2rem minmax(0,1fr) auto; gap: .45rem .7rem; padding-block: 1.15rem; }
    .entry { grid-column: 2 / -1; grid-row: 1; }
    .entry h2 { padding-right: 3.45rem; min-height: 2.75rem; }
    .entry-edit { grid-column: 3; grid-row: 1; justify-self: end; }
    .restaurant-heading { padding: 1.75rem 0; }
    .restaurant-title { align-items: start; flex-direction: column; gap: .85rem; }
    .restaurant-title h1 { font-size: clamp(2.5rem, 8vw, 3rem); }
    .sort-choices :is(button, a) { min-height: 2.75rem; }
    .dish-row { grid-template-columns: 2.8rem minmax(0,1fr) auto; }
    .score-cell { grid-row: 1 / 3; }
    .score, .unrated { font-size: 1.1rem; min-width: 2.65rem; }
    .entry-tags { grid-column: 2 / -1; }
    .map-link { min-height: 2.5rem; padding: .45rem .3rem; margin: -.45rem -.3rem; }
    .login-layout { display: flex; flex-direction: column; gap: 2rem; padding: 2.5rem 0; }
    .login-art { width: min(100%, 26rem); padding: .55rem; }
    .art-frame { aspect-ratio: auto; height: 9rem; padding: 1.1rem; justify-items: center; }
    .login-art .journal-illustration { width: 6.35rem; }
    .login-form .stack { margin-top: 1.4rem; }
    .api-docs { padding-top: 2rem; }
}

@media (max-width: 23rem) {
    .filter-field { grid-template-columns: minmax(0,1fr); }
    .primary-nav { justify-content: space-between; gap: .35rem; }
    .primary-nav a { font-size: .875rem; }
}
