/* Liberty Beer palette (libertybeer.it): crema background, carta cards, nero text and header, oro accent,
   oro scuro links, salvia for free tables */
:root { --bg: #F6F1DF; --card: #FBF8EE; --text: #151411; --muted: #5E584C; --line: #E3DAC0;
  --accent: #C7A42E; --on-accent: #151411; --link: #7A6212; --head: #151411; --head-text: #F6F1DF; --head-muted: #B9AF95;
  --res: #EFE0A8; --res-line: #C7A42E;
  --red: #B3261E; --red-bg: #F6DCD3; --yellow: #7A6212; --yellow-bg: #F1E2A8; --green: #3E7D63; --green-bg: #DCEDE3; }
@media (prefers-color-scheme: dark) { :root { --bg: #151411; --card: #2A2722; --text: #F6F1DF; --muted: #B9AF95; --line: #3D3830;
  --accent: #C7A42E; --on-accent: #151411; --link: #D9BC55; --head: #0D0C0A; --head-text: #F6F1DF; --head-muted: #B9AF95;
  --res: #4A3E16; --res-line: #C7A42E;
  --red: #F08A7E; --red-bg: #4A2420; --yellow: #E3C65C; --yellow-bg: #463A14; --green: #8FC9B0; --green-bg: #1F3A2F; } }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Jost", "Futura", "Helvetica Neue", Arial, system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.4; }
a { color: inherit; }
main a:not(.btn):not(.ghost):hover { color: var(--link); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* dark header as on libertybeer.it, gold for the brand and the current tab */
header { position: sticky; top: 0; z-index: 10; background: var(--head); color: var(--head-text); border-bottom: 2px solid var(--accent); }
.bar, main { max-width: 1200px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.bar { display: flex; align-items: center; gap: 12px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.brand { font-weight: 600; font-size: 1.1rem; text-decoration: none; letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
  display: inline-flex; align-items: center; gap: 8px; }
.brand img { width: 32px; height: 32px; }
.tabs { display: flex; gap: 2px; }
.tabs a { padding: 6px 12px; color: var(--head-muted); text-decoration: none; border-radius: 999px; }
.tabs a:hover { color: var(--head-text); }
.tabs a.on { color: var(--on-accent); background: var(--accent); font-weight: 600; }
.who { margin-left: auto; color: var(--head-muted); font-size: .9rem; }
header .ghost { color: var(--head-text); border-color: var(--head-muted); }
header .ghost:hover { border-color: var(--accent); color: var(--accent); }
main { padding-top: 16px; padding-bottom: 40px; }
h1 { font-size: 1.35rem; margin: 0 0 12px; font-weight: 600; }
.hours { font-size: .95rem; font-weight: 500; color: var(--muted); margin-left: 8px; }
.hours.shut { color: var(--red); font-weight: 700; }
h1 small { font-size: .8rem; color: var(--link); text-transform: uppercase; letter-spacing: .05em; margin-left: 6px; }
h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 28px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--red); background: var(--red-bg); padding: 8px 12px; border-radius: 8px; font-weight: 600; }
.warn { color: var(--red); font-weight: 600; }
.btn, .ghost, .danger { font: inherit; font-weight: 600; min-height: 36px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn { background: var(--accent); color: var(--on-accent); border: 2px solid var(--accent); }
.btn:hover { filter: brightness(1.08); }
.ghost { background: none; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
.danger { background: none; color: var(--red); border: 1px solid var(--red); }
input, select, textarea { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; }
/* day pager */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.pager > a:not(.btn) { min-width: 40px; height: 36px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.pager form { display: flex; gap: 6px; }
.pager .btn { margin-left: auto; }
.summary { margin: 0 0 12px; }
/* day grid: tables down, time across; scrolls sideways inside its box, never the page */
.gridwrap, .listwrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.grid { border-collapse: collapse; table-layout: fixed; min-width: 100%; font-size: .85rem; }
.grid th, .grid td { border-left: 1px dashed var(--line); height: 34px; padding: 0; min-width: 26px; }
.grid thead th { font-weight: 500; color: var(--muted); text-align: left; padding-left: 4px; border-left: 1px solid var(--line); height: 26px; }
.grid tbody tr { border-top: 1px solid var(--line); }
.grid th.t { position: sticky; left: 0; background: var(--card); text-align: left; padding: 0 10px; white-space: nowrap; width: 90px; z-index: 1; }
.grid th.t small { color: var(--muted); font-weight: 400; }
.grid td.res { padding: 2px; }
/* empty cell = link to a new reservation at that table and time */
.grid td.slot a { display: block; height: 34px; }
.grid td.slot a:hover, .grid td.slot a:focus-visible { background: var(--res); outline: 1px dashed var(--res-line); outline-offset: -1px; }
.grid td.res a { display: block; height: 100%; padding: 6px 8px; background: var(--res); border: 1px solid var(--res-line); border-radius: 6px;
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid td.res.over a { border-color: var(--red); border-width: 2px; }
.grid tr.free th.t { color: var(--red); }
/* lists */
.list { border-collapse: collapse; width: 100%; font-size: .92rem; }
.list th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 8px 10px; }
.list td { padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.list td.when { font-weight: 700; white-space: nowrap; }
.list td.when small { font-weight: 400; color: var(--muted); }
.list td.num { font-weight: 700; text-align: right; }
.list tr:target { background: var(--res); }
.list tr.cancelled td { color: var(--muted); text-decoration: line-through; }
.list.log td:first-child { white-space: nowrap; }
.tag { display: inline-block; padding: 1px 8px; margin: 0 4px 2px 0; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: .8rem; font-weight: 600; }
.notes { white-space: pre-line; font-size: .85rem; }
/* reservation form */
.res-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 16px; max-width: 900px; }
.res-form label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.res-form input, .res-form select, .res-form textarea { color: var(--text); font-weight: 400; }
.res-form .wide { grid-column: 1 / -1; }
.res-form fieldset { border: 1px solid var(--line); border-radius: 8px; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.res-form legend { font-size: .85rem; font-weight: 600; color: var(--muted); padding: 0 4px; }
.res-form label.check { flex-direction: row; align-items: center; font-weight: 500; color: var(--text); font-size: .95rem; }
.res-form fieldset label.wide { flex-basis: 100%; }
/* table choices: free green, shared for a short time yellow with the busy time, chosen but busy red */
.tablelist { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
label.tbl { flex-direction: row; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border: 1px solid var(--line);
  border-radius: 10px; color: var(--text); font-weight: 500; font-size: .95rem; cursor: pointer; background: var(--card); }
.tbl span { display: flex; flex-direction: column; line-height: 1.2; }
.tbl b { font-weight: 400; font-size: .8rem; color: var(--muted); }
.tbl small { font-size: .8rem; font-weight: 600; }
label.tbl.free { border-color: var(--green); background: var(--green-bg); }
label.tbl.partial { border-color: var(--yellow); background: var(--yellow-bg); }
label.tbl.partial small { color: var(--yellow); }
label.tbl.busy, label.tbl.gone { border-color: var(--red); background: var(--red-bg); }
label.tbl.busy small, label.tbl.gone small { color: var(--red); }
label.tbl.none { border-style: dashed; }
.tbl:has(input:checked) { outline: 2px solid var(--accent); outline-offset: 1px; font-weight: 700; }
.tablelist p { flex-basis: 100%; margin: 2px 0 0; }
.res-form .actions { display: flex; gap: 16px; align-items: center; }
/* the field an error is about: red, message under it */
.res-form label.bad, .res-form fieldset.bad legend { color: var(--red); }
.res-form label.bad input, .res-form label.bad textarea { border: 2px solid var(--red); background: var(--red-bg); }
.res-form fieldset.bad { border: 2px solid var(--red); }
.fielderr { color: var(--red); font-weight: 700; font-size: .85rem; }
.res-form label.force { flex-direction: row; align-items: center; gap: 6px; color: var(--red); font-size: .95rem; align-self: end; }
form.status { margin-top: 16px; }
.search { display: flex; gap: 8px; margin-bottom: 16px; }
.search input { flex: 1; max-width: 400px; }
/* login */
.login { max-width: 320px; margin: 10vh auto; display: flex; flex-direction: column; gap: 10px; }
.login h1 { text-align: center; }
@media (max-width: 600px) {
  .who { display: none; }
  .grid th.t { width: 70px; padding: 0 6px; }
  .list th:nth-child(7), .list td:nth-child(7) { display: none; }
}
