/* Print queue. Phone first, one column, light and dark. */
:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --ink: #1b1a18;
  --muted: #6f6b64;
  --line: #e3dfd7;
  --stage: #dfdad0;
  --stage-glow: #ece8e0;
  --signal: #d9480f;
  --warn-ink: #7a4f00;
  --warn-bg: #fbf0d4;
  --bad-ink: #a32a2a;
  --bad-bg: #fbe5e2;
  --shadow: 0 1px 2px rgb(0 0 0 / 4%), 0 8px 24px rgb(0 0 0 / 5%);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141312;
    --surface: #1f1d1b;
    --ink: #f2efe9;
    --muted: #a39e95;
    --line: #302d2a;
    --stage: #2a2724;
    --stage-glow: #36322e;
    --signal: #ff7a3d;
    --warn-ink: #f2c66d;
    --warn-bg: #3a2f14;
    --bad-ink: #ff9d94;
    --bad-bg: #3d1f1c;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

body.has-tabs { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }

main { max-width: 34rem; margin: 0 auto; padding: 4px 16px 24px; }

a { color: inherit; text-decoration: none; }

h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; margin: 12px 0 16px; }
h2 { font-size: 20px; line-height: 1.2; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }

.bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 34rem;
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.brand { font-weight: 700; letter-spacing: -0.01em; }
.me {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.meta { color: var(--muted); font-size: 14px; }
.meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.section { font-size: 15px; margin: 24px 4px 10px; }

.card {
  background: var(--surface);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card.narrow { margin-top: 6vh; padding: 24px 20px; }
.card h1 { margin-top: 0; }

.stage {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 40%, var(--stage-glow), var(--stage) 70%);
  overflow: hidden;
}
.stage img { width: 100%; height: 100%; object-fit: contain; padding: 6%; }
.stage .blank { width: 36%; stroke: var(--muted); fill: none; stroke-width: 1; opacity: 0.5; }
.stage.big { aspect-ratio: 1; border-radius: 20px; margin-bottom: 16px; }

.hero .stage { margin-bottom: 14px; }
.hero h2 { margin-bottom: 2px; }
.hero progress, .card progress { margin: 14px 0 8px; }

progress {
  display: block;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--line);
  accent-color: var(--signal);
  appearance: none;
  -webkit-appearance: none;
}
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--signal); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--signal); border-radius: 999px; }

.setup { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
}
.chip.bad { color: var(--bad-ink); border-color: transparent; background: var(--bad-bg); }
.swatch { width: 12px; height: 12px; flex: none; margin-right: 6px; vertical-align: -1px; }
.chip .swatch { margin-right: 0; }
.swatch circle { stroke: var(--muted); stroke-width: 0.6; }

.plate h2 { margin-bottom: 14px; }

.rows, .grid, .list, .checks { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px;
  margin-bottom: 8px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.thumb {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  background: var(--stage);
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.thumb .blank { width: 50%; stroke: var(--muted); fill: none; stroke-width: 1; opacity: 0.5; }
.text { display: grid; gap: 2px; min-width: 0; }
.text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tags:empty { display: none; }
.tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); }
.tag.bad { background: var(--bad-bg); color: var(--bad-ink); }
.tag.busy::after { content: "…"; }

.note {
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: var(--line);
  color: var(--muted);
  font-size: 14px;
}
.note.warn { background: var(--warn-bg); color: var(--warn-ink); }
.note.bad { background: var(--bad-bg); color: var(--bad-ink); }

.flash {
  max-width: 32rem;
  margin: 4px auto 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
}
@media (max-width: 34rem) { .flash { margin-inline: 16px; } }

.empty { display: grid; gap: 16px; justify-items: center; padding: 56px 0; color: var(--muted); }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.primary {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  font-size: 17px;
}
.empty .primary { width: auto; padding: 0 24px; }
.danger { color: var(--bad-ink); }
.primary.danger { background: var(--bad-ink); color: var(--surface); }
button:disabled { opacity: 0.6; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

.form { display: grid; gap: 16px; }
.form > label, .form details > label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
input[type="text"], input[type="password"], input[type="number"], select {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}
input[type="color"] { width: 64px; height: 48px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
fieldset { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
legend { padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.pick {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-weight: 500;
}
.pick input { position: absolute; opacity: 0; }
.pick span:first-of-type { flex: 1; }
.pick:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pick:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 2px; }

.switch { display: flex !important; align-items: center; gap: 12px; font-weight: 500 !important; font-size: 16px !important; }
.switch input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  order: 2;
  width: 48px;
  height: 28px;
  margin: 0 0 0 auto;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  transition: background 0.15s;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(0 0 0 / 25%);
  transition: transform 0.15s;
}
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(20px); }

.file {
  display: grid !important;
  justify-items: center;
  gap: 4px !important;
  padding: 28px 16px;
  border: 1.5px dashed var(--muted);
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
}
.file input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file strong { font-size: 17px; word-break: break-word; }
.file:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 2px; }

details { border-top: 1px solid var(--line); padding-top: 12px; }
details > summary { font-weight: 600; cursor: pointer; min-height: 32px; }
details[open] > summary { margin-bottom: 14px; }
details > label + label, details > .form { margin-top: 14px; }
details > .switch + .switch { margin-top: 14px; }

.form.inline { grid-template-columns: 1fr auto; align-items: end; gap: 8px; margin-bottom: 12px; }
.form.inline button { height: 48px; }

.facts { margin: 16px 0; }
.facts div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }

.actions { display: grid; gap: 8px; }
.actions .quiet { width: 100%; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 40rem) { .grid { grid-template-columns: repeat(3, 1fr); } }
.tile a { display: grid; gap: 2px; }
.tile .stage { aspect-ratio: 1; margin-bottom: 6px; }
.tile strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile button { width: 100%; min-height: 36px; margin-top: 8px; font-size: 14px; }

.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.list button { min-height: 36px; font-size: 14px; white-space: nowrap; }

.checks { display: grid; gap: 10px; margin: 16px 0 20px; }
.checks li { padding-left: 20px; position: relative; }
.checks li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
}

.link {
  padding: 12px;
  margin: 8px 0;
  border-radius: 12px;
  background: var(--bg);
  font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}

dialog {
  width: 100%;
  max-width: 34rem;
  margin: auto auto 0;
  padding: 24px 16px calc(20px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  color: var(--ink);
}
dialog::backdrop { background: rgb(0 0 0 / 45%); }
dialog form { display: grid; gap: 8px; }
dialog .quiet { border: 0; }
@media (min-width: 40rem) { dialog { margin: auto; border-radius: 24px; padding-bottom: 20px; } }

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 8px 24px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabs a {
  display: grid;
  justify-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.tabs a[aria-current] { color: var(--ink); }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs .add {
  width: 56px;
  height: 56px;
  place-content: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-size: 0;
  box-shadow: 0 6px 16px rgb(0 0 0 / 18%);
}
.tabs .add[aria-current] { color: var(--bg); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
