/* Dashboard styling. Aimed at a shop owner on a phone behind the counter as much
   as a laptop in the office, so everything works down to 380px wide. */
:root {
  --brand: #0b4fa8;
  --brand-dark: #062f66;
  --brand-tint: #eaf1fb;
  --ink: #16202e;
  --muted: #64748b;
  --line: #dde5ef;
  --paper: #f6f8fc;
  --card: #ffffff;
  --ok: #12855a;
  --warn: #b25e00;
  --danger: #c62828;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 32, 56, .08), 0 8px 24px -12px rgba(16, 32, 56, .18);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
h1, h2, h3 { margin: 0 0 .4rem; line-height: 1.2; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.tight { gap: .35rem; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: .8rem; }
.hide { display: none !important; }

.loading-screen { display: grid; place-items: center; height: 100vh; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ------------------------------------------------------------------ login */
.login-wrap { display: grid; place-items: center; min-height: 100vh; padding: 1rem;
  background: radial-gradient(circle at 25% 15%, #12559f, #061a38 70%); }
.login-card { background: #fff; border-radius: 16px; padding: 2rem; width: min(420px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-card h1 { font-size: 1.5rem; }
.brand-mark { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.2rem; }
.brand-mark img { width: 40px; height: 40px; }

/* ----------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
/* The menu stays put while the page scrolls, so "Sign out" is always where it
   was rather than a screen and a half below the pictures. */
.sidebar {
  background: var(--brand-dark); color: #cfe0f7; padding: 1rem .7rem;
  display: flex; flex-direction: column; gap: .2rem;
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
}
.sidebar .brand { display: flex; align-items: center; gap: .5rem; color: #fff; font-weight: 700; padding: .4rem .5rem 1rem; }
.sidebar .brand img { width: 28px; height: 28px; }
.nav-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .7rem; border-radius: 9px; color: #cfe0f7;
  text-decoration: none; font-weight: 500; border: 0; background: none;
  width: 100%; text-align: left; cursor: pointer; font-size: .95rem;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: #fff; color: var(--brand-dark); font-weight: 650; }
.nav-icon { width: 20px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: .6rem .5rem 0; font-size: .8rem; color: #90b2df; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: .7rem 1.2rem; display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
}
.content { padding: 1.2rem; max-width: 1180px; width: 100%; }

.mobile-nav { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav {
    display: flex; gap: .3rem; overflow-x: auto; padding: .5rem .8rem;
    background: var(--brand-dark); position: sticky; top: 0; z-index: 25;
  }
  .mobile-nav .nav-item { width: auto; white-space: nowrap; padding: .45rem .7rem; font-size: .88rem; }
  .content { padding: .9rem; }
}

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--card); border: 1px solid #e8eef6; border-radius: var(--radius); padding: 1.1rem;
  box-shadow: 0 1px 2px rgba(16, 34, 62, .04), 0 6px 18px -10px rgba(16, 34, 62, .18);
}
.card + .card { margin-top: .9rem; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; margin-bottom: .7rem; flex-wrap: wrap; }
.grid { display: grid; gap: .9rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .85rem; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem .95rem; border-radius: 10px; border: 1.5px solid #dde5ef;
  background: #fff; color: var(--ink); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.btn:hover { border-color: #b9cce6; background: #f8fbff; }
.btn:focus-visible { outline: 0; box-shadow: 0 0 0 3.5px rgba(11, 79, 168, .18); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, #1560d6, var(--brand)); border-color: #0a4796; color: #fff;
  box-shadow: 0 1px 2px rgba(9, 40, 90, .3);
}
.btn.primary:hover { background: linear-gradient(180deg, #1257c4, #0a468f); border-color: #083b7d; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--brand-tint); }
.btn.danger { color: var(--danger); border-color: #f0cccc; }
.btn.danger:hover { background: #fff5f5; }
.btn.small { padding: .3rem .55rem; font-size: .85rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 9px 0 0 9px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 9px 9px 0; }

/* ----------------------------------------------------------------- forms
   Controls a shop owner will use on a phone with wet hands: big enough to hit,
   obvious when they have focus, and nothing that looks like a dialog box from
   twenty years ago. */
label.field { display: block; margin-bottom: .85rem; }
label.field > span { display: block; font-size: .82rem; font-weight: 650; color: #46556b; margin-bottom: .3rem; }
/* :where() so this counts for nothing in the specificity sums. Written as a
   chain of :not()s it outweighed every .class rule that tried to size a
   field - which is why the price box filled the screen on a phone. */
input:not(:where([type=checkbox], [type=radio], [type=color], [type=range], [type=file])),
select, textarea {
  width: 100%; padding: .62rem .75rem; border: 1.5px solid #dde5ef; border-radius: 10px;
  font: inherit; background: #fff; color: var(--ink);
  transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: #9fb0c6; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):hover,
select:hover, textarea:hover { border-color: #c6d4e6; }
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3.5px rgba(11, 79, 168, .16);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235a6b83' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2.2rem;
}
textarea { min-height: 84px; resize: vertical; }
input[type=color] { width: 46px; height: 36px; padding: 2px; border: 1.5px solid #dde5ef; border-radius: 9px; background: #fff; }

/* A tick you can actually hit, and see. */
.checkbox {
  display: inline-flex; align-items: center; gap: .5rem; font-size: .92rem;
  margin-bottom: .5rem; cursor: pointer; padding: .3rem .1rem;
}
.checkbox input[type=checkbox], .checkbox input[type=radio] {
  appearance: none; width: 20px; height: 20px; flex: 0 0 auto; margin: 0;
  border: 1.5px solid #c6d4e6; border-radius: 6px; background: #fff; cursor: pointer;
  display: grid; place-items: center; transition: background .12s, border-color .12s;
}
.checkbox input[type=radio] { border-radius: 50%; }
.checkbox input:checked { background: var(--brand); border-color: var(--brand); }
.checkbox input[type=checkbox]:checked::after {
  content: ''; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}
.checkbox input[type=radio]:checked::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.checkbox input:focus-visible { box-shadow: 0 0 0 3.5px rgba(11, 79, 168, .16); }

.hint { font-size: .82rem; color: var(--muted); margin-top: .25rem; line-height: 1.4; }

/* A group of settings reads as a panel with a heading, not a boxed legend. */
fieldset {
  border: 0; border-radius: 12px; min-inline-size: 0; padding: .9rem 1rem 1rem;
  margin: 0 0 1rem; background: #f7f9fc; box-shadow: inset 0 0 0 1px #e7edf6;
}
legend {
  display: block; width: 100%; padding: 0; margin: 0 0 .6rem;
  font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #6b7c95;
}
fieldset > *:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- tables */
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: .5rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; }
.table tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; margin: 0 -.4rem; padding: 0 .4rem; }

.price-input { width: 84px; text-align: right; font-variant-numeric: tabular-nums; }
.price-input.empty { color: var(--muted); }

/* ------------------------------------------------------------- item rows */
/* One row per item, in columns: grip, picture, name, price, buttons. Every row
   uses the same columns, so the price boxes and the buttons line up down the
   page however long the name above them happens to be. */
.item-row {
  display: grid;
  grid-template-columns: 18px 44px minmax(0, 1fr) 118px 104px;
  gap: .7rem; align-items: center;
  padding: .5rem .6rem; border-bottom: 1px solid var(--line);
}
.item-list { border-radius: 10px; overflow: hidden; }
.item-row:nth-child(even) { background: #fbfcfe; }
.item-row:hover { background: var(--brand-tint); }
.cell-grip { display: grid; place-items: center; }
.cell-pic { display: grid; place-items: center; }
.cell-name { min-width: 0; }
.name-line { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.cell-price { display: flex; align-items: center; gap: .3rem; justify-content: flex-end; }
.cell-price .price-input { width: 84px; }
.cell-actions { display: flex; gap: .35rem; justify-content: flex-end; }
@media (max-width: 760px) {
  .item-row { grid-template-columns: 18px 40px minmax(0, 1fr) auto; row-gap: .35rem; column-gap: .5rem; }
  .cell-price { grid-column: 4; justify-content: flex-end; }
  .cell-price .price-input { width: 4.6rem; padding: .45rem .5rem; }
  .cell-actions { grid-column: 3 / -1; justify-content: flex-end; }
}
.item-row:last-child { border-bottom: 0; }
.item-row.soldout { opacity: .55; }
.drag-handle { cursor: grab; color: #9aa8bb; padding: 0 .2rem; user-select: none; font-size: 1.1rem; }
.item-row.dragging { opacity: .4; background: var(--brand-tint); }
.item-row.drop-target { border-top: 2px solid var(--brand); }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--brand-tint); border: 1px solid var(--line); }
.thumb.placeholder { display: grid; place-items: center; color: #9aa8bb; font-size: 1.2rem; }

.pill { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 650; }
.pill.ok { background: #dff5ea; color: var(--ok); }
.pill.warn { background: #fdf0dc; color: var(--warn); }
.pill.off { background: #eef1f5; color: var(--muted); }
.pill.live { background: #dff5ea; color: var(--ok); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #c9d3e0; }
.dot.on { background: #21b26b; box-shadow: 0 0 0 3px rgba(33,178,107,.18); }
.dot.off { background: #cbd5e1; }

/* ------------------------------------------------------------ publish bar */
.publish-bar {
  display: flex; align-items: center; gap: .6rem; margin-left: auto; flex-wrap: wrap;
}
.save-state { font-size: .85rem; color: var(--muted); min-width: 90px; }
.save-state.dirty { color: var(--warn); font-weight: 600; }
.save-state.saved { color: var(--ok); }

/* -------------------------------------------------------------- previews */
.preview-frame {
  width: 100%; aspect-ratio: 16/9; border: 1px solid var(--line); border-radius: 10px;
  background: #061a38; overflow: hidden;
}
.preview-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.preview-frame.portrait { aspect-ratio: 9/16; max-width: 340px; }

/* ---------------------------------------------------------------- media */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .7rem; }
.media-tile { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; cursor: pointer; position: relative; }
.media-tile img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--brand-tint); }
.media-tile .media-name { padding: .35rem .5rem; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-tile.selected { outline: 3px solid var(--brand); }
.dropzone {
  border: 2px dashed #bccbdf; border-radius: 12px; padding: 1.6rem; text-align: center;
  color: var(--muted); background: #fbfdff; cursor: pointer;
}
.dropzone.over { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-dark); }

/* ---------------------------------------------------------------- modals */
.modal-back { position: fixed; inset: 0; background: rgba(10,22,40,.55); display: grid; place-items: center; z-index: 100; padding: 1rem; }
.modal-back { backdrop-filter: blur(2px); }
.modal {
  background: #fff; border-radius: 16px; width: min(760px, 100%); max-height: 90vh;
  overflow: auto; box-shadow: 0 24px 70px rgba(8, 20, 40, .38);
  animation: modalIn .16s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.99) } }
.modal-head {
  padding: 1.1rem 1.4rem .9rem; display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; background: #fff; z-index: 2; border-bottom: 1px solid #eef2f8;
}
.modal-head h2 { font-size: 1.15rem; margin: 0; }
.modal-body { padding: 1.2rem 1.4rem; }
.modal-foot {
  padding: .9rem 1.4rem 1.1rem; border-top: 1px solid #eef2f8;
  display: flex; justify-content: flex-end; gap: .6rem;
  position: sticky; bottom: 0; background: #fff; z-index: 2;
}

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; bottom: 1rem; right: 1rem; z-index: 200; display: flex; flex-direction: column; gap: .5rem; }
.toast {
  background: #16202e; color: #fff; padding: .7rem 1rem; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); font-size: .9rem; max-width: 340px;
  animation: toastIn .25s ease;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--ok); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) } }

.banner { padding: .7rem 1rem; border-radius: 10px; display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.banner.warn { background: #fdf0dc; color: #6b3d00; border: 1px solid #f0d6ab; }
.banner.info { background: var(--brand-tint); color: var(--brand-dark); border: 1px solid #cadcf5; }
.banner.danger { background: #fdeaea; color: #7a1c1c; border: 1px solid #f2c4c4; }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state .big { font-size: 2.4rem; margin-bottom: .4rem; }

.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tab { padding: .55rem .9rem; border: 0; background: none; font: inherit; font-weight: 550; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

.panel-chip {
  display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem;
  border: 1px solid var(--line); border-radius: 9px; background: #fff; margin-bottom: .4rem;
}
.panel-chip .type { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.span-input { width: 58px; }

/* Big tappable options instead of a dropdown.
   A native <select> opens an operating-system dialog, which is fine on a phone
   and miserable on a TV remote - and people do end up driving this from the TV
   while they set a screen up. These work with a finger, a mouse, a keyboard and
   a D-pad alike. */
.choice-list { display: flex; flex-direction: column; gap: .5rem; }
.choice {
  display: flex; align-items: center; gap: .75rem;
  padding: .8rem .9rem; border: 2px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer;
}
.choice:hover { border-color: #b3c9e6; background: #fbfdff; }
.choice input { width: 22px; height: 22px; flex: 0 0 auto; accent-color: var(--brand); }
.choice-body { display: flex; flex-direction: column; min-width: 0; }
.choice-title { font-weight: 650; font-size: 1rem; }
.choice-sub { font-size: .82rem; color: var(--muted); }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.choice:has(input:focus-visible) { outline: 3px solid #a9c8ef; outline-offset: 2px; }

/* ---- who can log in ---- */
.user-list { display: flex; flex-direction: column; }
.user-row {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem .1rem; border-bottom: 1px solid var(--line);
}
.user-row:last-child { border-bottom: 0; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 700; font-size: .82rem;
  background: var(--brand-tint); color: var(--brand-dark); letter-spacing: .02em;
}
.user-row .pill { flex: 0 0 auto; }

/* Picking several pictures at once. The tick is always visible, not a hover
   affordance — half the people using this are on a phone. */
.media-tile { position: relative; }
.media-pick {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  width: 28px; height: 28px; border-radius: 7px;
  background: rgba(255, 255, 255, .92); border: 1px solid var(--line);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 1px 3px rgba(16, 32, 56, .25);
}
.media-pick input { width: 17px; height: 17px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.media-tile.selected { outline: 3px solid var(--brand); outline-offset: -1px; }
.media-tile.selected .media-pick { background: var(--brand); border-color: var(--brand); }

.toast-undo {
  margin-left: .8rem; background: rgba(255,255,255,.18); color: #fff;
  border: 1px solid rgba(255,255,255,.35); border-radius: 7px;
  padding: .2rem .6rem; font: inherit; font-weight: 650; cursor: pointer;
}
.toast-undo:hover { background: rgba(255,255,255,.3); }

/* ---- layout template picker ---- */
.tpl-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.tpl {
  display: grid; grid-template-rows: auto auto 1fr; gap: .3rem;
  border: 2px solid var(--line); border-radius: 11px; padding: .7rem;
  cursor: pointer; background: #fff; color: var(--brand);
}
.tpl:hover { border-color: #b3c9e6; }
.tpl.picked { border-color: var(--brand); background: var(--brand-tint); }
.tpl input {
  position: absolute; opacity: 0; width: 1px; height: 1px;
  /* Hidden, but still focusable: the label does the clicking, the keyboard
     still reaches it, and the ring below shows where you are. */
}
.tpl:focus-within { outline: 3px solid #a9c8ef; outline-offset: 2px; }
.tpl-thumb { width: 100%; height: auto; display: block; border-radius: 5px; }
.tpl-name { font-weight: 650; color: var(--ink); font-size: .95rem; }
.tpl-blurb { font-size: .8rem; color: var(--muted); line-height: 1.35; }

.media-heading { font-size: .95rem; margin: .9rem 0 .5rem; color: var(--ink); }
.media-heading:first-child { margin-top: 0; }
/* With headings between them the outer box is a plain stack; each section
   inside it is the grid. Without this the whole library came out one tile wide. */
.media-grid.sections { display: block; }
.media-grid-inner { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.media-tile.unused { border-style: dashed; }
.media-use { width: calc(100% - 1rem); margin: 0 .5rem .5rem; }

/* ---- placing blocks on artwork ---- */
.placer {
  position: relative; width: 100%; aspect-ratio: 16/9;
  background-color: #0d1c33;
  border-radius: 10px; overflow: hidden; touch-action: none; user-select: none;
}
/* The real board, live, behind the blocks you are dragging: what you are
   arranging is the thing itself rather than a drawing of it. */
.placer-live { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.pbox-layer { position: absolute; inset: 0; }
/* A block you can grab, over a board you can read. The outline is faint on
   purpose: the prices underneath are the thing being judged, not the box. */
.pbox {
  position: absolute; border: 2px dashed rgba(255, 255, 255, .45);
  background: transparent; cursor: grab;
  border-radius: 6px; touch-action: none;
}
.pbox:hover { border-color: rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .06); }
.pbox.on { border-color: #ffd400; background: rgba(255, 212, 0, .12); border-style: solid; z-index: 2; }
/* Nothing in it yet, so nothing shows through: say so. */
.pbox.empty { background: rgba(11, 79, 168, .3); display: grid; place-items: center; }
.pbox-label {
  padding: 0 .4rem; max-width: 100%;
  font-size: .78rem; font-weight: 700; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8); pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pbox-grip {
  position: absolute; right: -7px; bottom: -7px; width: 20px; height: 20px;
  background: #ffd400; border: 2px solid #6b5200; border-radius: 5px;
  cursor: nwse-resize; touch-action: none;
}

/* A filtered-out choice must actually disappear. `display:flex` above beats the
   browser's own [hidden] rule, so the search box looked completely dead. */
.choice[hidden], .media-tile[hidden], .checkbox[hidden] { display: none !important; }

/* And once, for everything. Any element given a display by a rule of ours beats
   the browser's [hidden], which is how a hidden button stayed on screen. */
[hidden] { display: none !important; }

/* Big tappable choices - used for "these are products/backgrounds" and for
   moving pictures between tabs. Clients tap these; they don't use drop-downs. */
.pickrow { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; align-items: center; margin-top: .8rem; }
.pickrow-label { width: 100%; text-align: center; font-size: .85rem; color: var(--muted); margin-bottom: .1rem; }
.pickrow .pill { font: inherit; font-weight: 600; cursor: pointer; padding: .5rem .95rem; border-radius: 999px;
  border: 2px solid var(--line, #d9dee7); background: #fff; color: var(--muted); }
.pickrow .pill:hover { border-color: var(--brand); color: var(--brand); }
.pickrow .pill.on { border-color: var(--brand); background: var(--brand); color: #fff; }
.pickrow.big { gap: .6rem; }
.pickrow.big .pill { padding: .9rem 1.3rem; font-size: 1.05rem; }

/* Crop a background by dragging it, the way you would move a photo on a phone. */
.cropper {
  position: relative; width: 100%; max-width: 340px; aspect-ratio: 16/9;
  margin: .6rem 0; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; background: #061a38; cursor: grab; touch-action: none;
}
.cropper.dragging { cursor: grabbing; }
.cropper img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.cropper::after {
  content: 'Drag me'; position: absolute; left: 50%; bottom: .4rem; transform: translateX(-50%);
  font: 600 .7rem system-ui; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: rgba(6, 18, 38, .6); padding: .15rem .5rem; border-radius: 999px;
  pointer-events: none;
}

/* Settings on the left, the TV on the right, so a change can be seen as it is
   made rather than after saving and going back in. */
.settings-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .85fr); gap: 1rem; align-items: start; }
.settings-split .settings-preview { position: sticky; top: 0; }
.settings-split .settings-preview h3 { margin: 0 0 .4rem; font-size: .95rem; }
.settings-split .field input, .settings-split .field select, .settings-split input[type=search] { width: 100%; }
@media (max-width: 800px) {
  .settings-split { grid-template-columns: 1fr; }
  .settings-split .settings-preview { position: static; order: -1; }
}

/* Finished board designs, picked like pictures in a catalogue. */
.design-list { display: grid; gap: .7rem; }
.design {
  display: grid; grid-template-columns: auto 130px 1fr; gap: .8rem; align-items: start;
  border: 2px solid var(--line); border-radius: 12px; padding: .8rem; cursor: pointer; background: #fff;
}
.design.on { border-color: var(--brand); background: var(--brand-tint); }
.design input { width: 18px; height: 18px; margin-top: .2rem; }
.design-thumb { color: var(--brand); display: block; }
.design-thumb svg { width: 100%; height: auto; display: block; }
.design-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
@media (max-width: 700px) {
  .design { grid-template-columns: auto 1fr; }
  .design-thumb { display: none; }
}
.design-body .ok { color: var(--ok); font-weight: 600; }

/* The way most boards get made: start from the shop's own picture. */
.big-choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: .25rem;
  width: 100%; text-align: left; padding: .9rem 1.1rem; height: auto;
}
.big-choice b { font-size: 1.05rem; }
.big-choice span { font-weight: 400; opacity: .9; font-size: .85rem; line-height: 1.3; }

/* ---- the job, in steps ----------------------------------------------------
   Numbered down the side, because the first time anyone does this they need to
   be told what order to do it in - and afterwards they need to find the one
   thing that has changed. */
.nav-item.step { display: flex; align-items: flex-start; gap: .6rem; text-align: left; padding: .55rem .6rem; }
.nav-item.step .step-no {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff;
  display: grid; place-items: center; font-size: .82rem; font-weight: 700;
}
.nav-item.step.active .step-no { background: #fff; color: var(--brand-dark); }
.nav-item.step .step-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.nav-item.step .step-text b { font-size: .93rem; }
.nav-item.step .step-text i { font-style: normal; font-size: .72rem; opacity: .72; }
.nav-heading {
  margin: .9rem .6rem .25rem; font-size: .7rem; letter-spacing: .08em;
  text-transform: uppercase; opacity: .55;
}
.nav-item.small-item { font-size: .86rem; padding: .4rem .6rem; }

.step-foot { padding: 0 1.2rem 1.4rem; }
.btn.big { padding: .8rem 1.4rem; font-size: 1rem; }
.warn-hint { color: var(--warn, #9a6b00); }

/* ---- step 2: the boards, as pictures -------------------------------------- */
.board-list { display: grid; gap: .9rem; margin-top: .9rem; }
.board-card { display: grid; grid-template-columns: 260px 1fr; gap: 1rem; align-items: start; }
.board-shot {
  aspect-ratio: 16/9; border-radius: 10px; overflow: hidden;
  background: #0d1c33; display: grid; place-items: center;
}
.board-shot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.board-noart { color: #9db4d6; font-size: .85rem; }
.board-info h3 { margin: 0 0 .2rem; }
@media (max-width: 700px) { .board-card { grid-template-columns: 1fr; } }

/* The boxes we found, drawn on the picture, before a board is made from them. */
.found-shot { position: relative; border-radius: 10px; overflow: hidden; background: #0d1c33; }
.found-shot img { width: 100%; display: block; }
.found-box {
  position: absolute; border: 3px solid #ffd24a; border-radius: 6px;
  background: rgba(255, 210, 74, .16); box-shadow: 0 0 0 2px rgba(6, 18, 38, .45);
}
.found-box i {
  position: absolute; left: -2px; top: -2px; font-style: normal;
  background: #ffd24a; color: #12233f; font-weight: 700; font-size: .72rem;
  padding: .05rem .35rem; border-radius: 5px 0 6px 0;
}

/* Choosing the colour of the words, against the artwork you are looking at. */
.inks { gap: .4rem; flex-wrap: wrap; align-items: center; }
.ink-swatch {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--line); box-shadow: inset 0 0 0 2px #fff;
}
.ink-swatch.on { border-color: var(--brand); box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px var(--brand-tint); }

/* Lines that appear while a block is dragged, showing what it lined up with. */
.snap-line { position: absolute; background: #ffd24a; pointer-events: none; z-index: 5; box-shadow: 0 0 0 1px rgba(6,18,38,.35); }
.snap-line.v { top: 0; bottom: 0; width: 2px; margin-left: -1px; }
.snap-line.h { left: 0; right: 0; height: 2px; margin-top: -1px; }

/* Labels as things you tap, not a row of little squares. */
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.checkbox.chip {
  margin: 0; padding: .4rem .8rem; border: 1.5px solid #dde5ef; border-radius: 999px;
  background: #fff; font-weight: 600; font-size: .88rem; transition: all .12s;
}
.checkbox.chip:hover { border-color: #b9cce6; }
.checkbox.chip input { width: 16px; height: 16px; }
.checkbox.chip:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-dark); }

/* Every box out of the way, to look at the board as a customer will. */
.pbox-layer.hidden { opacity: 0; pointer-events: none; }

/* ---- signing up, and looking after other people's shops ------------------ */
.linky {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 650;
  color: var(--brand); cursor: pointer; text-decoration: underline;
}
.app.one-column { grid-template-columns: 1fr; }

.looking-after {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  padding: .6rem 1.2rem; background: #fff4d6; border-bottom: 1px solid #f0dfae;
  font-size: .9rem; color: #6b5108; flex-wrap: wrap;
}

.shop-list { display: grid; gap: .8rem; margin-top: .9rem; }
.shop-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.shop-main h3 { margin: 0 0 .2rem; }
.shop-actions { display: flex; gap: .5rem; align-items: center; }
.shop-actions select { width: auto; min-width: 130px; }
.pill.danger-pill { background: #fdecec; color: var(--danger); }

/* Checking a price list that was read off a photograph. One line per item, the
   way it is written on the board it came from: what it is, then what it costs.
   Without this every input takes the full width and each price drops onto a
   line of its own, which reads as a fault in the reading rather than in the
   stylesheet. */
.found-rows { gap: .4rem; }
.found-row { display: flex; gap: .5rem; flex-wrap: nowrap; align-items: center; }
.found-row input[data-name] { flex: 1 1 auto; min-width: 0; }
.found-row input[data-price] { flex: 0 0 5.6rem; width: 5.6rem; text-align: right; }
@media (max-width: 560px) {
  .found-row { flex-wrap: wrap; }
  .found-row input[data-price] { flex: 1 1 4.4rem; width: auto; }
}

/* Setting up a television, one step at a time. Numbered big enough to find
   your place again after looking up at the telly. */
.setup-card .setup-list { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: 1.1rem; }
/* Number, words, picture. The picture is on the right on a computer and under
   the words on a phone, which is where a thumb expects it. */
.setup-step {
  display: grid; gap: .75rem 1rem; align-items: start;
  grid-template-columns: 1.9rem minmax(0, 1fr) 210px;
  align-items: center;
}
.setup-picture { grid-column: 3; }
.setup-art {
  width: 100%; height: auto; display: block; background: #f6f9fd;
  border: 1px solid var(--line); border-radius: 12px;
}
@media (max-width: 820px) {
  .setup-step { grid-template-columns: auto minmax(0, 1fr); }
  .setup-picture { grid-column: 2; max-width: 320px; }
}
.setup-no {
  /* A grid cell will happily squash a circle into an oval: say both sizes. */
  width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .95rem;
}
/* Only the step's own heading is a block. A bold word inside the words - the
   button somebody is being told to press - stays in the line it belongs to. */
.setup-step .setup-title { display: block; font-size: 1.02rem; }
.setup-words { align-self: center; }
.setup-step .muted { margin-top: .12rem; }
.setup-step code, .setup-more code {
  background: #eef3fa; border-radius: 6px; padding: .05rem .35rem; font-size: .92em; word-break: break-all;
}
.setup-more { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.setup-more summary { cursor: pointer; font-weight: 700; }
.setup-more[open] summary { margin-bottom: .5rem; }
.setup-more .hint { margin-top: .7rem; }

/* The set-up guide sits above step one, marked out as the thing to do first
   rather than as a sixth step - because it is done once and then never again. */
.nav-item.guide { background: rgba(230, 168, 23, .12); border: 1px solid rgba(230, 168, 23, .35); }
.nav-item.guide.active { background: #f0b429; color: #24170a; border-color: #f0b429; }
.nav-item.guide.active .step-text i { opacity: .85; }
.guide-no { background: var(--gold, #e6a817) !important; color: #24170a !important; }
.setup-ask { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; background: #f6f9fd; }
.setup-ask b { font-size: 1.05rem; }
.setup-ask .row { margin-top: .8rem; }
.setup-answer { margin-bottom: .6rem; }
