:root {
  --text: #1b1f23;
  --muted: #5a6470;
  --line: #d4d9de;
  --bg-subtle: #f5f6f7;
  --accent: #e31e24;
  --accent-dark: #b8151b;
  --note: #8a5a00;
  --note-bg: #fdf3dc;
  --note-line: #e6c97f;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 1rem; }

.site-header { background: var(--accent); color: #fff; margin-bottom: 2rem; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.5rem; }
.site-name { font-weight: 700; color: #fff; text-decoration: none; letter-spacing: .01em; }
.site-header nav { display: flex; align-items: center; gap: 1rem; font-size: .95rem; }
.site-header nav a, .site-header button.link { color: #fff; }
.site-header a:hover, .site-header button.link:hover { color: #fff; text-decoration-thickness: 2px; }
.site-header form { margin: 0; }
.site-header :focus-visible { outline-color: #fff; }

h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 2rem 0 .75rem; }
a { color: var(--accent-dark); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); }
.muted { color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; font-size: .9rem; color: var(--muted); }
td.num { text-align: right; white-space: nowrap; }

label { display: block; font-weight: 600; margin: 0 0 .3rem; }
label.inline { display: flex; align-items: center; gap: .4rem; font-weight: normal; margin: .75rem 0; }
input:not([type=checkbox]), select, textarea {
  width: 100%; max-width: 28rem; padding: .5rem .6rem; font: inherit;
  border: 1px solid #9aa4ae; border-radius: 3px; margin-bottom: .75rem;
}

button, .button {
  display: inline-block; padding: .5rem 1rem; font: inherit; font-weight: 600; cursor: pointer;
  color: #fff; background: var(--accent); border: 1px solid var(--accent); border-radius: 3px; text-decoration: none;
}
button:hover, .button:hover { color: #fff; background: var(--accent-dark); border-color: var(--accent-dark); }
button.secondary, .button.secondary { color: var(--text); background: #fff; border-color: #9aa4ae; }
button.secondary:hover, .button.secondary:hover { color: var(--text); background: var(--bg-subtle); border-color: #9aa4ae; }
button.link { padding: 0; color: var(--accent-dark); background: none; border: 0; font-weight: normal; text-decoration: underline; text-underline-offset: 2px; }
button.link:hover { background: none; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.dev-login { margin-top: 2.5rem; padding: 1rem; border: 1px dashed var(--line); background: var(--bg-subtle); }
.dev-login h2 { margin-top: 0; }

@media (max-width: 600px) {
  th, td { padding: .5rem .25rem; }
}

.errors { color: #9b1c1c; border: 1px solid #e5b9b9; background: #fbf1f1; padding: .6rem .8rem .6rem 2rem; }
.notice { border: 1px solid var(--line); background: var(--bg-subtle); padding: .6rem .8rem; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1.5rem; margin: 0 0 1.5rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
td.thumb { width: 72px; }
td.thumb img, .thumb-empty { display: block; width: 64px; height: 48px; object-fit: contain; border: 1px solid var(--line); background: #fff; }
.thumb-empty { background: var(--bg-subtle); }
td form { margin: 0; }
.details { white-space: pre-line; font-size: .9rem; margin-top: .25rem; }
tr.withdrawn td { color: var(--muted); }
tr.withdrawn strong { text-decoration: line-through; }

.table-scroll { overflow-x: auto; }
.wishlist { padding-left: 1.5rem; margin: 0 0 1.5rem; }
.wishlist li { border-bottom: 1px solid var(--line); padding: .4rem 0; }
.wish { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wishlist li.withdrawn .wish-name { color: var(--muted); text-decoration: line-through; }
.actions { display: flex; gap: .35rem; flex-shrink: 0; }
.actions form { margin: 0; }
button.small { padding: .2rem .6rem; font-weight: normal; }
button:disabled, button:disabled:hover { opacity: .4; cursor: default; background: #fff; }
.mobile-only { display: none; }
@media (max-width: 600px) {
  .thumb, .wide-only { display: none; }
  .mobile-only { display: block; }
}

.result { border: 1px solid var(--line); padding: 0 1rem .25rem; margin: 0 0 2rem; }
.result h2 { margin-top: 1rem; }
h3 { font-size: 1rem; margin: 1.5rem 0 .5rem; }
code { font-family: ui-monospace, monospace; font-size: .85rem; overflow-wrap: anywhere; }

main.wrap { padding-bottom: 3rem; }

table.selection tr.group th { padding-top: 1.25rem; color: var(--text); font-size: 1rem; }
table.selection tr.group label { margin: 0; font-weight: 600; }
td.pick { width: 2rem; padding-top: .75rem; }
.device-name { display: inline; margin: 0; font-weight: 600; cursor: pointer; }
table.selection td.price { font-weight: 600; padding-top: .6rem; }
table.selection .details { color: var(--muted); }
table.selection td.price.missing { color: var(--note); }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.tag { padding: .05rem .5rem; font-size: .85rem; font-weight: 600; color: var(--note); background: var(--note-bg); border: 1px solid var(--note-line); border-radius: 3px; }
.notice.attention { color: var(--note); background: var(--note-bg); border-color: var(--note-line); }
table.selection tr.device-row:has(input:not(:checked)) > td:not(.pick) { opacity: .45; }
.status-pending { color: var(--note); }
.actions { flex-wrap: wrap; }
.actions button { white-space: nowrap; }
.result-device { display: flex; gap: 1rem; align-items: flex-start; margin: .5rem 0 1rem; }
.result-device img { display: block; width: 120px; height: 90px; object-fit: contain; border: 1px solid var(--line); }
.result-price { font-weight: 600; margin-top: .35rem; }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1rem 0; }
.result-actions form { margin: 0; }
.confirm-dialog { width: calc(100% - 2rem); max-width: 26rem; padding: 1.25rem 1.5rem; color: var(--text); border: 1px solid var(--line); border-radius: 4px; }
.confirm-dialog::backdrop { background: rgba(27, 31, 35, .45); }
.confirm-dialog h3 { margin-top: 0; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
