/* Plate. Tokens first, then base, layout, queue, add form, controls. */

:root {
  --plate: #EDF0F3;
  --card: #FFFFFF;
  --card-2: #F5F7F9;
  --ink: #1C2430;
  --ink-2: #5B6572;
  --ink-3: #8B95A1;
  --line: #D5DBE2;
  --line-strong: #B9C2CC;
  --hot: #C8641A;
  --hot-bg: #FBF0E6;
  --hot-line: #EBC7A6;
  --done: #2F7A4F;
  --danger: #B3261E;
  --danger-bg: #FBEAE8;
  --focus: #2B6CB0;
  --shadow: 0 1px 2px rgba(28, 36, 48, 0.05), 0 10px 30px -18px rgba(28, 36, 48, 0.25);
  --radius-surface: 14px;
  --radius-control: 9px;
  --font: 'Funnel Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --plate: #13171C;
    --card: #1B2128;
    --card-2: #222932;
    --ink: #E7ECF1;
    --ink-2: #9AA5B1;
    --ink-3: #6E7A87;
    --line: #2A323B;
    --line-strong: #3B4552;
    --hot: #E8863A;
    --hot-bg: #2A2019;
    --hot-line: #4A3323;
    --done: #62C48A;
    --danger: #F08B83;
    --danger-bg: #33201E;
    --focus: #82B4F2;
    --shadow: none;
  }
}

/* Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--plate);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
  padding: 0 16px calc(24px + env(safe-area-inset-bottom));
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -48px; background: var(--ink); color: var(--card);
  padding: 8px 12px; border-radius: var(--radius-control); z-index: 10;
}
.skip:focus { top: 12px; }
.muted { color: var(--ink-3); font-weight: 500; }

/* Layout ---------------------------------------------------------------- */
.top, .main, .foot { max-width: 640px; margin: 0 auto; }
.top { padding: 22px 0 8px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand {
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none;
  font-size: 22px; font-weight: 700; letter-spacing: -0.01em;
}
.brand-ring {
  width: 22px; height: 22px; border-radius: 50%; position: relative;
  background: conic-gradient(#C12E1F 0 16.6%, #FEC600 0 33.3%, #00AE42 0 50%, #0086D6 0 66.6%, #5E43B7 0 83.3%, #F55A74 0);
}
.brand-ring::after {
  content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--plate);
}
.tagline { color: var(--ink-2); font-size: 15px; margin-top: 4px; }
.main { padding-top: 18px; min-height: 40vh; }
.loading { color: var(--ink-2); padding: 24px 0; }
.foot {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 28px 0 8px; color: var(--ink-2); font-size: 14px;
}
.link {
  background: none; border: 0; padding: 6px 4px; color: var(--ink-2);
  text-decoration: underline; text-underline-offset: 3px; border-radius: 4px;
}
.link:hover { color: var(--ink); }
.admin-chip { display: inline-flex; align-items: center; gap: 10px; }
.admin-chip::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--done);
}

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-control);
  border: 1px solid transparent; font-weight: 600; font-size: 15px; text-decoration: none;
  white-space: nowrap; transition: background-color 120ms ease, border-color 120ms ease, opacity 120ms ease;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--ink); color: var(--plate); }
.btn-primary:hover:not(:disabled) { opacity: 0.9; }
.btn-quiet { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-quiet:hover:not(:disabled) { background: var(--card-2); }
.btn-danger { color: var(--danger); }
.btn-danger[data-armed] { background: var(--danger-bg); border-color: var(--danger); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; }
.btn-wide { width: 100%; height: 48px; font-size: 16px; }

/* Spool rings ------------------------------------------------------------ */
.ring {
  --c: var(--line-strong);
  display: inline-block; flex: none; border-radius: 50%; position: relative;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(28, 36, 48, 0.14);
}
.ring::after {
  content: ''; position: absolute; inset: 34%; border-radius: 50%; background: var(--card);
  box-shadow: 0 0 0 1px rgba(28, 36, 48, 0.08);
}
.ring-sm { width: 14px; height: 14px; }
.ring-md { width: 28px; height: 28px; }
.ring-lg { width: 40px; height: 40px; }
.ring-xl { width: 64px; height: 64px; }
.ring-any { background: transparent; box-shadow: none; border: 2px dashed var(--line-strong); }
.ring-any::after { display: none; }
@media (prefers-color-scheme: dark) {
  .ring { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.12); }
  .ring::after { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.10); }
}

/* Queue sections ----------------------------------------------------------- */
.queue { display: flex; flex-direction: column; gap: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 2px 10px; flex-wrap: wrap; }
.section h2, .section-finished h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.section-sum { color: var(--ink-2); font-size: 14px; }
.list {
  list-style: none; margin: 0; padding: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-surface);
  box-shadow: var(--shadow); overflow: hidden;
}
.list-printing { background: var(--hot-bg); border-color: var(--hot-line); }
.row + .row { border-top: 1px solid var(--line); }
.list-printing .row + .row { border-top-color: var(--hot-line); }

.row-main {
  display: grid; grid-template-columns: 26px 56px minmax(0, 1fr); column-gap: 12px; row-gap: 0;
  align-items: start; padding: 13px 14px 13px 10px; cursor: pointer;
}
.row-lead, .row-thumb { grid-row: 1 / span 5; }
.row-body { grid-column: 3; }
.row-time { grid-column: 3; justify-self: start; margin-top: 4px; }
.row-due, .row-delay, .row-removal { grid-column: 3; margin-top: 4px; }
.row-removal { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13.5px; color: var(--ink-2); }
.pill-ink { background: var(--ink-2); color: var(--card); }
.row-delay { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13.5px; color: var(--ink); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.5; }
.pill-hot { background: var(--hot); color: #fff; }
.delay-form { display: flex; flex-direction: column; gap: 8px; }
.row-main:hover { background: rgba(28, 36, 48, 0.025); }
@media (prefers-color-scheme: dark) { .row-main:hover { background: rgba(255, 255, 255, 0.03); } }
.row-lead { display: flex; justify-content: center; align-items: center; height: 56px; }
.pos { font-weight: 700; font-size: 14px; color: var(--ink-3); }
.pos-blank { width: 1px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--hot); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.7); opacity: 0.45; } }
.handle {
  width: 26px; height: 56px; border: 0; background: none; padding: 0; border-radius: 6px;
  cursor: grab; touch-action: none; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 5px;
}
.handle::before {
  content: ''; width: 9px; height: 14px;
  background-image: radial-gradient(circle, var(--line-strong) 1.4px, transparent 1.6px);
  background-size: 5px 5px; background-position: 0 0;
}
.handle:hover::before { background-image: radial-gradient(circle, var(--ink-2) 1.4px, transparent 1.6px); }
.handle:active { cursor: grabbing; }
.row-thumb {
  width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--plate);
  display: flex; align-items: center; justify-content: center;
}
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding-top: 1px; }
.row-title {
  font-weight: 600; font-size: 15px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.row-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--ink-2); font-size: 13.5px; }
.row-meta .who { font-weight: 600; color: var(--ink); }
.row-meta .fil { display: inline-flex; align-items: center; gap: 6px; }
.row-due { font-size: 13.5px; color: var(--ink-2); }
.row-due.is-late { color: var(--danger); font-weight: 600; }
.row-time { font-weight: 600; font-size: 14px; white-space: nowrap; }

.row-details { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 200ms ease; }
.row.is-expanded .row-details { grid-template-rows: 1fr; }
.row-details-inner { overflow: hidden; }
.row.is-expanded .row-details-inner { padding: 0 14px 14px 48px; }
.row-facts { display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); font-size: 14px; margin-bottom: 12px; }
.row-facts .note { color: var(--ink); font-size: 15px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-actions .spacer { flex: 1; }
.row.is-new { animation: slide-in 420ms cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes slide-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.row.is-new .row-main { background: rgba(200, 100, 26, 0.08); }
.is-ghost { opacity: 0.35; }
.is-chosen .row-main { background: var(--card-2); }
.is-dragging { box-shadow: 0 12px 30px -10px rgba(28, 36, 48, 0.4); }

.list-finished .row-title { color: var(--ink-2); font-weight: 500; }
.list-finished .row-thumb { opacity: 0.7; }
.row-declined .row-title { text-decoration: line-through; text-decoration-color: var(--line-strong); }
.section-finished summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; padding: 0 2px 10px;
}
.section-finished summary::-webkit-details-marker { display: none; }
.section-finished summary::after {
  content: ''; width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
  transform: rotate(-45deg); margin-left: 2px; transition: transform 160ms ease;
}
.section-finished[open] summary::after { transform: rotate(45deg); }
.count { color: var(--ink-3); font-weight: 600; font-size: 14px; }

.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  padding: 40px 20px; background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--radius-surface);
}
.empty h2 { font-size: 19px; margin-top: 8px; }
.empty p { color: var(--ink-2); max-width: 32ch; }
.empty .btn { margin-top: 10px; }

.notice {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-surface);
  padding: 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.notice-slim { padding: 10px 14px; font-size: 14px; color: var(--ink-2); }

/* Add form ---------------------------------------------------------------- */
.add { display: flex; flex-direction: column; gap: 6px; padding-bottom: 12px; }
.add h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field-inline { flex-direction: row; align-items: center; justify-content: space-between; }
.label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.optional { font-size: 13px; color: var(--ink-3); }
.picked { font-size: 14px; color: var(--ink); font-weight: 600; }
.figure { font-size: 17px; font-weight: 700; }
.hint { font-size: 13.5px; color: var(--ink-2); }
.hint-ok { color: var(--done); }
.hint-warn { color: var(--hot); }
.hint-error, .error { color: var(--danger); font-size: 14px; font-weight: 500; }
.error-block { background: var(--danger-bg); padding: 10px 12px; border-radius: var(--radius-control); margin-bottom: 12px; }

input[type='url'], input[type='text'], input[type='number'], input[type='date'], input[type='password'], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: var(--radius-control);
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); font-size: 16px;
  transition: border-color 120ms ease;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px;
}
textarea { resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: 2px solid var(--focus); outline-offset: 1px; }
input[aria-invalid='true'] { border-color: var(--danger); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }

.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; min-width: 0; }
.link-row .btn { height: 46px; }

.preview {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-surface);
  box-shadow: var(--shadow); padding: 12px; margin-bottom: 22px;
}
.preview-media {
  width: 96px; height: 96px; border-radius: 10px; overflow: hidden; background: var(--plate);
  display: flex; align-items: center; justify-content: center;
}
.preview-media img { width: 100%; height: 100%; object-fit: cover; }
.preview-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.preview-body input { font-weight: 600; min-height: 42px; }
.preview-source { font-size: 13.5px; color: var(--ink-2); }
.preview-note { font-size: 13.5px; color: var(--hot); }

.profiles { display: flex; flex-direction: column; gap: 8px; }
.profile-opt { display: block; cursor: pointer; }
.profile-opt.is-static { cursor: default; }
.profile-card {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--card);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.profile-opt input:checked + .profile-card { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.profile-opt input:focus-visible + .profile-card { outline: 2px solid var(--focus); outline-offset: 2px; }
.profile-opt:not(.is-static):hover .profile-card { border-color: var(--ink-2); }
.profile-media { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--plate); display: flex; align-items: center; justify-content: center; }
.profile-media img { width: 100%; height: 100%; object-fit: cover; }
.profile-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.profile-title { font-weight: 600; font-size: 15px; line-height: 1.3; }
.profile-meta { font-size: 13.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 3px 10px; align-items: center; }
.profile-meta .strong { color: var(--ink); font-weight: 600; }
.profile-meta .fil { display: inline-flex; align-items: center; gap: 5px; }

.seg { display: flex; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-control); padding: 3px; gap: 2px; }
.seg-opt { flex: 1; }
.seg-opt span {
  display: block; text-align: center; padding: 9px 4px; border-radius: 6px; font-size: 15px; font-weight: 500;
  color: var(--ink-2); cursor: pointer; transition: background-color 120ms ease, color 120ms ease;
}
.seg-opt input:checked + span { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(28, 36, 48, 0.12); }
.seg-opt.is-out span { color: var(--ink-3); cursor: not-allowed; }
.seg-opt.is-out .tag { color: var(--hot); }
.seg-opt .tag { display: block; font-size: 11px; font-weight: 500; color: var(--ink-3); line-height: 1.2; margin-top: 2px; }
.seg-opt input:checked + span .tag { color: var(--ink-2); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }

.rings { display: flex; flex-wrap: wrap; gap: 14px 12px; padding: 4px 2px; }
.ring-opt { display: inline-flex; border-radius: 50%; cursor: pointer; }
.ring-opt .ring { transition: transform 120ms ease; }
.ring-opt:hover .ring { transform: scale(1.06); }
.ring-opt input:checked + .ring { outline: 2.5px solid var(--ink); outline-offset: 3px; }
.ring-opt input:focus-visible + .ring { outline: 2.5px solid var(--focus); outline-offset: 3px; }
.ring-opt.is-out { cursor: not-allowed; }
.ring-opt.is-out .ring { opacity: 0.3; filter: grayscale(1); }
.ring-opt.is-out:hover .ring { transform: none; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-control); overflow: hidden; background: var(--card); }
.stepper-btn { width: 44px; height: 44px; border: 0; background: none; font-size: 22px; font-weight: 500; color: var(--ink); }
.stepper-btn:hover:not(:disabled) { background: var(--card-2); }
.stepper-btn:disabled { color: var(--ink-3); cursor: default; }
.stepper-value { min-width: 40px; text-align: center; font-weight: 700; font-size: 17px; }

.duo { display: flex; gap: 12px; }
.duo-item { display: flex; align-items: center; gap: 8px; flex: 1; font-size: 14px; color: var(--ink-2); }
.duo-item input { width: auto; flex: 1; min-width: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip span {
  display: inline-block; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-strong);
  font-size: 15px; font-weight: 500; cursor: pointer; transition: background-color 120ms ease, color 120ms ease;
}
.chip input:checked + span { background: var(--ink); color: var(--plate); border-color: var(--ink); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.step { display: flex; flex-direction: column; }
.step-back { margin-top: 10px; text-align: center; }
.chips-lg { margin-bottom: 22px; }
.chips-lg .chip span { padding: 12px 20px; font-size: 16px; }
.mini-preview {
  display: flex; gap: 12px; align-items: center; padding: 10px; margin-bottom: 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-surface);
}
.mini-media { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--plate); flex: none; display: flex; align-items: center; justify-content: center; }
.mini-media img { width: 100%; height: 100%; object-fit: cover; }
.mini-body { min-width: 0; }
.mini-title { font-weight: 600; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.asking { color: var(--ink-2); font-size: 15px; margin-bottom: 14px; }
.asking-name { color: var(--ink); font-weight: 700; }
.asking .link { padding: 0 2px; font-size: 14px; }

/* Family page --------------------------------------------------------------- */
.family { display: flex; flex-direction: column; gap: 14px; padding-bottom: 12px; }
.family h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.family .lead { max-width: 52ch; font-size: 14.5px; }
.family-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.family-row { display: flex; gap: 8px; align-items: center; }
.family-row input { flex: 1; min-width: 0; }
.family-empty { color: var(--ink-2); font-size: 14px; padding: 6px 0; }
.family-add { margin-top: 2px; margin-bottom: 8px; }
.family-add .btn { height: 46px; }
.notice .btn { flex: none; }
.fil .sub { font-size: 17px; font-weight: 700; margin-top: 8px; }
.fil-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fil-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.fil-row:last-child { border-bottom: 0; }
.fil-row input[type='text'] { min-width: 0; }
.fil-row .fil-sub { grid-column: 2 / 4; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fil-row .fil-sub select { width: auto; min-height: 38px; padding: 6px 32px 6px 10px; font-size: 14px; background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; }
.fil-row.is-out .swatch-wrap { opacity: 0.4; filter: grayscale(1); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background-color 120ms ease; flex: none; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--card); transition: transform 120ms ease; }
.switch input:checked + .switch-track { background: var(--done); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }
.swatch-wrap { position: relative; width: 44px; height: 44px; flex: none; border-radius: 50%; }
.swatch-wrap::after {
  content: ''; position: absolute; inset: 34%; border-radius: 50%; background: var(--card);
  box-shadow: 0 0 0 1px rgba(28, 36, 48, 0.08); pointer-events: none;
}
input[type='color'].swatch {
  width: 44px; height: 44px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: none;
  cursor: pointer; -webkit-appearance: none; appearance: none; overflow: hidden; display: block;
}
input[type='color'].swatch::-webkit-color-swatch-wrapper { padding: 0; }
input[type='color'].swatch::-webkit-color-swatch { border: 1px solid rgba(28, 36, 48, 0.18); border-radius: 50%; }
input[type='color'].swatch::-moz-color-swatch { border: 1px solid rgba(28, 36, 48, 0.18); border-radius: 50%; }
input[type='color'].swatch:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
@media (prefers-color-scheme: dark) {
  input[type='color'].swatch::-webkit-color-swatch { border-color: rgba(255, 255, 255, 0.22); }
  input[type='color'].swatch::-moz-color-swatch { border-color: rgba(255, 255, 255, 0.22); }
}
.foot { flex-wrap: wrap; }

/* Family gate --------------------------------------------------------------- */
.gate { display: flex; flex-direction: column; gap: 14px; max-width: 420px; padding: 8px 0 12px; }
.gate h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.gate .lead { font-size: 15px; }
.gate .field { margin-bottom: 4px; }
body.is-locked #add-link, body.is-locked .foot, body.is-locked .tagline { display: none; }

/* Toast and dialog ---------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px);
  background: var(--ink); color: var(--plate); padding: 10px 18px; border-radius: 10px; font-weight: 600;
  font-size: 14.5px; opacity: 0; pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; z-index: 20;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.dialog {
  border: 0; border-radius: var(--radius-surface); padding: 24px; background: var(--card); color: var(--ink);
  width: min(92vw, 380px); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.45);
}
.dialog::backdrop { background: rgba(28, 36, 48, 0.45); }
.dialog h2 { font-size: 20px; margin-bottom: 6px; }
.dialog .hint { margin-bottom: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* Wider screens ------------------------------------------------------------ */
@media (min-width: 560px) {
  .top { padding-top: 32px; }
  .brand { font-size: 24px; }
  .row-main { grid-template-columns: 28px 64px minmax(0, 1fr) auto; column-gap: 14px; padding: 14px 16px 14px 12px; }
  .row-thumb, .row-lead { width: 64px; height: 64px; }
  .row-lead { width: 28px; }
  .row-lead, .row-thumb { grid-row: 1 / span 4; }
  .row-time { grid-column: 4; grid-row: 1; justify-self: end; text-align: right; padding-top: 2px; margin-top: 0; }
  .row.is-expanded .row-details-inner { padding-left: 56px; }
  .row-title { font-size: 16px; }
  .preview { grid-template-columns: 120px minmax(0, 1fr); }
  .preview-media { width: 120px; height: 120px; }
}

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