:root {
  color-scheme: light;
  --paper: #f7f4ec;
  --surface: #fffcf5;
  --ink: #263a2b;
  --muted: #596752;
  --line: #d7ddcb;
  --pale: #e7eddc;
  --green: #2b452f;
  --light-ink: #f8f6ec;
  --accent: #68764d;
  --alert: #8d3c27;
  --serif: Georgia, "Noto Serif", serif;
  font: 16px/1.45 system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
a { color: inherit; }
h1, h2, p { margin: 0; }
h1 { font-family: var(--serif); font-size: clamp(2.15rem, 8vw, 3.75rem); line-height: 1.02; letter-spacing: -.055em; font-weight: 500; }
h2 { font-size: 1rem; line-height: 1.3; }
:focus-visible { outline: 3px solid #825325; outline-offset: 3px; }
.icon { width: 1.25rem; height: 1.25rem; flex: none; }
.shell { width: min(100% - 2rem, 56rem); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.masthead { color: var(--light-ink); background: var(--ink); }
.masthead-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 650; text-decoration: none; line-height: 1.15; padding: .5rem 0; }
.brand > .icon { width: 1.875rem; height: 1.875rem; color: #d7dfbd; }
.brand small { display: block; margin-top: .2rem; color: #d7dfbd; font-size: .73rem; font-weight: 450; }
.progress { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .45rem .7rem; border: 1px solid #687c64; border-radius: 999px; font-size: .8rem; text-decoration: none; white-space: nowrap; }
.progress .icon { width: .95rem; height: .95rem; }

main { padding-block: 1rem 3.5rem; }
.message { padding-block: 1rem; min-height: 90px; }
.message button { margin-top: .75rem; }
.welcome { max-width: 27rem; margin-inline: auto; margin-block: 1rem 2rem; text-align: center; }
.welcome-photos { display: flex; align-items: end; justify-content: center; gap: .75rem; height: 173px; padding: 1.15rem; background: var(--pale); border: 1px solid var(--line); border-radius: 24px; margin-bottom: 1.5rem; }
.welcome-photos img { width: min(24%, 75px); height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.welcome-photos img:nth-child(odd) { height: 87%; }
.welcome form { margin-top: 1.15rem; text-align: left; }
.welcome label { display: block; font-size: .88rem; font-weight: 700; }
.welcome input, .notes textarea { width: 100%; padding: .75rem; border: 1px solid #aeb8a1; border-radius: 10px; background: var(--surface); color: var(--ink); }
.welcome input { margin-top: .35rem; }
.welcome p { color: var(--muted); font-size: .83rem; margin-block: .4rem .8rem; }
.welcome .form-status { min-height: 1.3rem; margin-bottom: 0; color: var(--alert); }
.primary { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .6rem 1rem; border: 1px solid var(--green); border-radius: 10px; color: var(--light-ink); background: var(--green); font-weight: 650; }
.primary:disabled { opacity: .7; cursor: wait; }
.welcome .primary { width: 100%; }

.beer-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; font-size: .8rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.icon-button { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; text-decoration: none; background: var(--surface); }
.icon-button[aria-disabled="true"] { color: #899081; }
.beer-layout { display: grid; gap: 1rem; }
.beer-portrait { display: grid; place-items: center; height: clamp(146px, 30vw, 227px); overflow: hidden; padding: .85rem; background: radial-gradient(ellipse at 50% 40%, #f9f9e9, var(--pale) 73%); border: 1px solid var(--line); border-radius: 24px; }
.beer-portrait img { display: block; width: min(100%, 256px); height: 100%; min-height: 0; object-fit: contain; mix-blend-mode: multiply; }
.beer-package { margin: .4rem 0 1rem; color: var(--muted); font-size: .87rem; }

.rating { padding: .85rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.rating-title { min-height: 35px; display: flex; justify-content: space-between; align-items: center; gap: .65rem; }
#score:not(:empty) { min-width: 3.5rem; border-radius: 999px; background: var(--pale); text-align: center; padding: .24rem .55rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.rating-controls { position: relative; display: grid; place-items: center; width: min(100%, 19rem); margin-inline: auto; }
.gesture-control { min-height: 158px; display: grid; grid-template-rows: 25px 29px 50px 29px 25px; justify-items: center; align-items: center; }
.gesture-number { display: grid; place-items: center; width: 36px; height: 25px; border-radius: 999px; font-weight: 650; font-variant-numeric: tabular-nums; }
.gesture-number.outer { visibility: hidden; }
.gesture-control[data-extended="true"] .gesture-number.outer { visibility: visible; }
.gesture-number[data-preview="true"]:not(.center) { background: var(--green); color: var(--light-ink); }
#grip { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 52px; height: 48px; translate: -50% -50%; border: 1px solid var(--green); border-radius: 16px; background: var(--pale); color: var(--green); touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; font-size: 1.45rem; font-weight: 750; }
#grip:active { cursor: grabbing; }
#grip[data-preview="true"] { color: var(--light-ink); background: var(--green); }
#expand { position: absolute; top: 50%; right: max(0px, calc(50% - 96px)); translate: 0 -50%; }
.gesture-help { min-height: 1.2rem; margin-top: .15rem; font-size: .77rem; color: var(--muted); text-align: center; text-wrap: pretty; }
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35rem; margin-top: .7rem; }
.scale button { min-width: 0; min-height: 46px; border: 1px solid #b8c2ac; border-radius: 8px; background: var(--surface); font-weight: 700; }
.scale button[aria-pressed="true"], .scale button[data-preview="true"] { background: var(--green); color: var(--light-ink); border-color: var(--green); }
.save-state { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; column-gap: .5rem; min-height: 2rem; margin-top: .15rem; color: var(--muted); font-size: .78rem; }
.save-state[data-error="true"] { color: var(--alert); }
.text-button { min-height: 44px; padding: .25rem .4rem; border: 0; background: none; font-weight: 700; text-decoration: underline; }

.notes { margin-top: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.notes summary { list-style: none; display: flex; align-items: center; gap: .5rem; padding: .7rem .85rem; cursor: pointer; font-size: .93rem; font-weight: 700; }
.notes summary::-webkit-details-marker { display: none; }
.note-toggle { margin-left: auto; }
.notes[open] .note-toggle { rotate: 180deg; }
.note-fields { padding: 0 .85rem .75rem; }
.notes textarea { display: block; min-height: 85px; resize: vertical; }
.note-visibility { min-height: 44px; display: flex; align-items: center; gap: .5rem; font-size: .86rem; width: fit-content; }
.note-visibility input { width: 18px; height: 18px; margin: 0; accent-color: var(--green); }

.others { margin-top: 1.25rem; }
.others h2 { margin-bottom: .4rem; }
.others p { color: var(--muted); font-size: .85rem; }
.others ul, .catalog ul { list-style: none; padding: 0; margin: 0; }
.others li { padding: .65rem .15rem; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; column-gap: 1rem; overflow-wrap: anywhere; }
.others li p { grid-column: 1 / -1; margin-top: .25rem; white-space: pre-wrap; }
.others li strong { font-weight: 650; }

.catalog { padding-top: .65rem; }
.catalog ul { display: grid; gap: .55rem; margin-top: 1rem; }
.catalog-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto 15px; align-items: center; column-gap: .6rem; min-height: 70px; padding: .42rem .6rem; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); text-decoration: none; }
.catalog-row img { width: 46px; height: 54px; padding: .15rem; object-fit: contain; background: var(--pale); border-radius: 7px; mix-blend-mode: multiply; }
.catalog-row span { min-width: 0; }
.catalog-row strong { display: block; font-size: .91rem; line-height: 1.2; overflow-wrap: break-word; }
.catalog-row small { display: block; margin-top: .2rem; font-size: .72rem; color: var(--muted); }
.catalog-row .icon { width: 15px; }
.catalog-score { font-size: .82rem; font-weight: 750; white-space: nowrap; }

@media (min-width: 45rem) {
  main { padding-top: 1.4rem; }
  .beer-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: stretch; gap: 1.8rem; }
  .beer-portrait { height: auto; min-height: 390px; padding: 1.75rem; }
  .beer-portrait img { width: 100%; max-height: 390px; }
  .beer-information { padding-top: .6rem; }
  .rating { padding-inline: 1.1rem; }
  .catalog ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (hover: hover) {
  .icon-button:not([aria-disabled="true"]):hover, .catalog-row:hover, .scale button:hover:not([aria-pressed="true"]) { background-color: var(--pale); }
  .progress:hover { background-color: #3e5541; }
  .primary:not(:disabled):hover { background-color: #405d41; }
}
