:root {
    color-scheme: dark;
    --background: #161615;
    --surface: #212120;
    --text: #f7f5ee;
    --muted: #c1beb4;
    --line: #5e5b51;
    --accent: #f8ac73;
    --success: #c6e59a;
}
:root[data-theme="light"] {
    color-scheme: light;
    --background: #faf7ef;
    --surface: #fffdf8;
    --text: #221e19;
    --muted: #5c5447;
    --line: #b2a697;
    --accent: #963f15;
    --success: #375e20;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); font: 1rem/1.55 system-ui, sans-serif; }
main { width: min(100% - 2rem, 66rem); margin: clamp(1.5rem, 7vw, 4rem) auto; }
header { display: flex; justify-content: space-between; gap: .75rem; align-items: start; margin-bottom: 2rem; }
h1, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 6vw, 2.8rem); line-height: 1.1; letter-spacing: -.04em; }
p { color: var(--muted); margin-top: .5rem; }
button, input, select { color: var(--text); font: inherit; }
button, input, select { border: 1px solid var(--line); border-radius: .5rem; background: var(--background); padding: .48rem .65rem; }
button { cursor: pointer; }
button:hover:not(:disabled), summary:hover { border-color: var(--accent); color: var(--accent); }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.icon { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; flex: none; padding: 0; }
button.icon svg { width: 1.25rem; height: 1.25rem; }
#calculator, details { background: var(--surface); border: 1px solid var(--line); border-radius: .8rem; padding: .85rem; margin: 0 0 .75rem; min-width: 0; }
label { display: flex; flex-direction: column; gap: .2rem; font-size: .9rem; min-width: 0; }
input, select { width: 100%; min-width: 0; }
.actions { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem; margin-top: .65rem; }
summary { cursor: pointer; }
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 38rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .45rem .3rem; border-bottom: 1px solid var(--line); }
th { white-space: nowrap; }
th button { background: transparent; border-color: transparent; padding: .25rem .3rem; font-weight: 650; }
th button::after { content: "↕"; margin-left: .3rem; color: var(--muted); }
th[aria-sort="ascending"] button::after { content: "↑"; color: var(--accent); }
th[aria-sort="descending"] button::after { content: "↓"; color: var(--accent); }
td input { padding: .42rem .5rem; }
td[data-result] { white-space: nowrap; padding-inline: .6rem; }
.name-cell { width: 38%; }
.pizza-detail { display: block; padding: .15rem .5rem 0; color: var(--muted); }
.remove { padding: .15rem .5rem; font-size: 1.25rem; }
td.best { color: var(--success); font-weight: 700; }
[hidden] { display: none !important; }
