/* QR 스튜디오: industrial label palette. Ink and signal yellow carry the identity; everything else stays quiet. */

:root {
  --ink: #141b24;
  --ink-2: #333d4a;
  --ink-soft: #5d6878;
  --mute: #8a94a2;
  --line: #e3e7ec;
  --line-strong: #cfd5dd;
  --bg: #f3f5f8;
  --bg-2: #eaedf1;
  --paper: #ffffff;
  --signal: #ffc21a;
  --signal-hover: #ffcc3d;
  --signal-tint: #fff4cf;
  --danger: #c4321c;
  --danger-tint: #fdeeea;
  --ok: #17845a;
  --ok-tint: #e5f4ec;
  --warn: #a86a00;
  --warn-tint: #fff3d9;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --float: 0 1px 2px rgb(20 27 36 / 0.05), 0 12px 32px -14px rgb(20 27 36 / 0.22);
  --checker: repeating-conic-gradient(#e6e9ee 0 25%, #f8f9fb 0 50%);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  /* A faint dot grid, like a cutting mat on a label maker's desk. */
  background: radial-gradient(circle at 1px 1px, rgb(20 27 36 / 0.07) 1px, transparent 0) 0 0 / 22px 22px, var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  /* Korean wraps between words, not inside them. */
  word-break: keep-all;
  overflow-wrap: break-word;
}

*, *::before, *::after { box-sizing: border-box; }

/* Scrollbars in the app's greys. Standard properties where supported (they inherit into every
   scrolling box); WebKit pseudo-elements only for browsers without them, since Chrome ignores
   the pseudo-elements once scrollbar-color is set. */
html { scrollbar-color: #bcc4ce transparent; scrollbar-width: thin; }
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 10px; background: #bcc4ce padding-box; }
  ::-webkit-scrollbar-thumb:hover { background-color: var(--mute); }
}
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; }
h1, h2, p { margin: 0; }
h1 { font-size: 1.75rem; line-height: 1.2; font-weight: 750; letter-spacing: -0.025em; }
h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.015em; }
a { color: inherit; }
img { max-width: 100%; display: block; }
b { font-weight: 650; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-soft); }
.hint { color: var(--ink-soft); font-size: 0.84rem; line-height: 1.5; }

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* --- Form controls --- */

input, select, textarea, button { font: inherit; color: inherit; }

input:not([type="radio"], [type="checkbox"], [type="range"], [type="color"], [type="file"]),
select, textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 96px; }
select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6878' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
}
input::placeholder, textarea::placeholder { color: var(--mute); }
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: var(--mute); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgb(255 194 26 / 0.5); }
[aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgb(196 50 28 / 0.14) !important; animation: shake 0.32s; }

.field { display: grid; gap: 6px; min-width: 0; }
.field > span:first-child, .field-label { font-size: 0.86rem; font-weight: 650; color: var(--ink-2); }
output { font-weight: 500; color: var(--ink-soft); margin-left: 4px; font-variant-numeric: tabular-nums; }

input[type="range"] {
  --p: 50%;
  appearance: none;
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(var(--ink), var(--ink)) 0 / var(--p) 100% no-repeat, var(--bg-2);
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--bg-2); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--ink); }
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 0 1px 3px rgb(20 27 36 / 0.25);
  transition: transform 0.15s var(--ease);
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgb(255 194 26 / 0.6); }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; width: fit-content; }
.switch input {
  appearance: none;
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  margin: 0;
  border-radius: 12px;
  background: var(--line-strong);
  cursor: pointer;
  transition: background 0.2s;
}
.switch input::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(20 27 36 / 0.3);
  transition: transform 0.22s var(--ease-spring);
}
.switch input:checked { background: var(--ink); }
.switch input:checked::before { transform: translateX(16px); }

/* Segmented radio control. The real radio covers each option, so clicks and keyboard both work. */
.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: var(--bg-2); border-radius: 11px; width: fit-content; max-width: 100%; }
.seg label { position: relative; display: flex; }
.seg input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 8px;
  font-weight: 550;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.seg span b { font-weight: 600; color: var(--mute); font-variant-numeric: tabular-nums; }
.seg label:hover span { color: var(--ink); }
.seg input:checked + span { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgb(20 27 36 / 0.12), 0 0 0 1px rgb(20 27 36 / 0.05); }
.seg input:checked + span b { color: var(--ink-soft); }
.seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 1px; }
.seg input:disabled { cursor: not-allowed; }
.seg input:disabled + span { opacity: 0.4; }
.seg-fill { display: flex; width: 100%; }
.seg-fill label { flex: 1; }
.seg-fill span { flex: 1; justify-content: center; padding: 7px 4px; }

/* Visual shape picker */
.shape-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px 8px; }
.shape-grid-sm { grid-template-columns: repeat(2, 84px); }
.flip { display: grid; gap: 6px; margin-top: 8px; padding: 12px; border-radius: 12px; background: var(--bg); animation: rise-in 0.25s var(--ease); }
.shape-opt { position: relative; display: grid; gap: 4px; justify-items: center; align-content: start; cursor: pointer; }
.shape-opt input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.shape-thumb {
  width: 100%;
  aspect-ratio: 1;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s var(--ease);
}
.shape-thumb svg { display: block; width: 100%; height: 100%; }
.shape-name { font-size: 0.78rem; color: var(--ink-soft); text-align: center; line-height: 1.3; }
.shape-opt:hover .shape-thumb { border-color: var(--mute); }
.shape-opt input:checked ~ .shape-thumb { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink), 0 0 0 3px var(--signal-tint); }
.shape-opt input:checked ~ .shape-name { color: var(--ink); font-weight: 650; }
.shape-opt input:focus-visible ~ .shape-thumb { outline: 2px solid var(--ink); outline-offset: 2px; }
.shape-opt:active .shape-thumb { transform: scale(0.96); }

/* --- Buttons --- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.12s var(--ease), box-shadow 0.15s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { cursor: progress; }
.btn-primary { background: var(--signal); color: var(--ink); box-shadow: inset 0 -2px 0 rgb(0 0 0 / 0.08); }
.btn-primary:hover { background: var(--signal-hover); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }
.btn-ghost { background: var(--paper); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a92a17; }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 0.92rem; }

.is-busy .icon { animation: spin 0.8s linear infinite; }
.btn.is-done { background: var(--ok); color: #fff; }
.btn.is-done .icon { stroke-dasharray: 30; animation: draw 0.45s var(--ease) both; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s var(--ease);
}
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.danger:hover { background: var(--danger-tint); color: var(--danger); }
.icon-btn-dark { color: #aeb7c3; }
.icon-btn-dark:hover { background: rgb(255 255 255 / 0.08); color: #fff; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 650;
  white-space: nowrap;
}
.chip-warn { background: var(--warn-tint); color: var(--warn); animation: pop-in 0.25s var(--ease-spring); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 3px 9px 3px 7px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font-size: 0.8rem;
  font-weight: 650;
  white-space: nowrap;
}
.badge .icon { width: 14px; height: 14px; stroke-width: 2.2; }
.badge-dynamic { background: var(--signal); border-color: transparent; }

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink-2);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}
.avatar-lg { width: 56px; height: 56px; font-size: 1.4rem; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.card-title { margin-bottom: 14px; }

/* --- Login --- */

.login { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100dvh; }
.login-hero {
  display: grid;
  place-items: center;
  padding: 48px;
  background:
    radial-gradient(circle at 1px 1px, rgb(255 255 255 / 0.07) 1px, transparent 0) 0 0 / 22px 22px,
    var(--ink);
  color: #fff;
}
.login-hero-inner { width: min(420px, 100%); display: grid; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-light .brand-mark { outline: 1px solid rgb(255 255 255 / 0.18); border-radius: 8px; }
.hero-qr { width: min(300px, 70vw); aspect-ratio: 1; margin: 18px 0 8px; }
.hero-qr svg { width: 100%; height: 100%; overflow: visible; }
.hero-dot { fill: #fff; transform-box: fill-box; transform-origin: center; animation: dot-in 0.55s var(--ease-spring) both; animation-delay: var(--d); }
.hero-eye { fill: none; stroke: var(--signal); stroke-width: 1; animation: eye-in 0.7s var(--ease) both; }
.hero-eye-dot { fill: var(--signal); transform-box: fill-box; transform-origin: center; animation: dot-in 0.5s 0.35s var(--ease-spring) both; }
.hero-title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 750; line-height: 1.25; letter-spacing: -0.03em; }
.hero-text { color: #aeb7c3; max-width: 34ch; }

.login-side { display: grid; place-items: center; padding: 32px 24px; background: var(--paper); }
.login-form { width: min(360px, 100%); display: grid; gap: 16px; animation: rise-in 0.5s 0.1s var(--ease) both; }
.login-form h1 { font-size: 1.6rem; }
.login-form .muted { margin-top: -8px; }

/* --- App shell --- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  view-transition-name: topbar;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 60px;
  padding: var(--safe-top) 24px 0;
  background: var(--ink);
  color: #fff;
}
.nav { position: relative; display: flex; gap: 2px; flex: 1; align-self: stretch; view-transition-name: nav; }
.nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: #aeb7c3;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s;
}
.nav a:hover, .nav a[aria-current="page"] { color: #fff; }
.nav a .icon { width: 18px; height: 18px; }
.nav-indicator {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  opacity: 0;
  border-radius: 3px 3px 0 0;
  background: var(--signal);
  transition: transform 0.32s var(--ease), width 0.32s var(--ease), opacity 0.2s;
  pointer-events: none;
}
.topbar :focus-visible { outline-color: var(--signal); }
.who { display: flex; align-items: center; gap: 10px; color: #dde2e8; font-weight: 550; }

main { max-width: 1240px; margin: 0 auto; padding: 32px 24px 64px; }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { flex: 1; min-width: 220px; display: grid; gap: 4px; }

/* --- List --- */

.list-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; margin-left: auto; }
.search .icon { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--mute); pointer-events: none; }
.search input { padding-left: 40px; }
.sort { width: auto; min-width: 150px; }

.qr-list { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.qr-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px 150px 160px;
  align-items: center;
  gap: 16px;
  padding: 12px 12px 12px 14px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
}
.qr-item:last-child { border-bottom: 0; }
.qr-item:hover { background: #fafbfc; }
.qr-link { display: flex; align-items: center; gap: 14px; min-width: 0; text-decoration: none; border-radius: 10px; }
.qr-link:hover .qr-name { text-decoration: underline; text-underline-offset: 3px; }
.thumb {
  display: grid;
  place-items: center;
  flex: none;
  width: 58px;
  height: 58px;
  padding: 4px;
  border-radius: 10px;
  background: var(--checker) 0 0 / 10px 10px;
  color: var(--danger);
}
.thumb svg { display: block; width: 100%; height: auto; }
.qr-main { display: grid; gap: 2px; min-width: 0; }
.qr-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-target { display: flex; align-items: center; gap: 5px; min-width: 0; color: var(--ink-soft); font-size: 0.86rem; }
.qr-target .icon { width: 14px; height: 14px; color: var(--mute); }
.qr-target span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-meta { display: grid; justify-items: end; gap: 1px; font-size: 0.84rem; color: var(--ink-soft); }
.qr-meta time { font-variant-numeric: tabular-nums; color: var(--mute); }
.scans { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.scans .icon { width: 14px; height: 14px; }
.qr-actions { display: flex; justify-content: flex-end; gap: 2px; }

.empty { display: grid; justify-items: center; gap: 12px; padding: 64px 16px; text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
.empty .muted { max-width: 38ch; }
.empty .btn { margin-top: 8px; }
.empty-small { padding: 40px 16px; }
.mascot { width: 96px; height: 96px; }
.empty-small .mascot { width: 72px; height: 72px; }
.float { animation: float 3.2s ease-in-out infinite; }

/* --- Editor --- */

.editor-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.editor-head .back { width: 42px; height: 42px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); }
.editor-head .back:hover { border-color: var(--ink-soft); background: var(--paper); }
.editor-head .back .icon { transition: transform 0.18s var(--ease); }
.editor-head .back:hover .icon { transform: translateX(-2px); }
.editor-title { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.editor-title h1 { font-size: 1.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-head-actions { display: flex; align-items: center; gap: 6px; }

.editor-body { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 24px; align-items: start; }
.editor-form { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; min-width: 0; }

.tabs {
  position: relative;
  display: flex;
  gap: 2px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs [role="tab"] {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 54px;
  padding: 0 14px;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s;
}
.tabs [role="tab"] .icon { width: 18px; height: 18px; }
.tabs [role="tab"]:hover, .tabs [aria-selected="true"] { color: var(--ink); }
.tab-indicator {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  border-radius: 3px 3px 0 0;
  background: var(--ink);
  transition: transform 0.3s var(--ease), width 0.3s var(--ease);
}

.panel { display: grid; gap: 24px; padding: 24px; }
.panel:not([hidden]) { animation: panel-in 0.26s var(--ease); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }

.kind { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kind-option {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, opacity 0.15s;
}
.kind-option input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.kind-option:hover { border-color: var(--ink-soft); }
.kind-option:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #fcfcfd; }
.kind-option:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.kind-option:has(input:disabled), .kind-option:has(input:disabled) input { cursor: default; }
.kind-option:has(input:disabled:not(:checked)) { opacity: 0.4; }
.kind-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--bg-2); }
.kind-icon-dynamic { background: var(--signal); }
.kind-text { display: grid; gap: 2px; }
.kind-text small { color: var(--ink-soft); font-size: 0.84rem; line-height: 1.45; }

.short-url { display: grid; gap: 6px; padding: 14px 16px; border-radius: 12px; background: var(--signal-tint); animation: rise-in 0.3s var(--ease); }
.short-url-label { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 650; color: var(--ink-2); }
.short-url-label .icon { width: 16px; height: 16px; }
.short-url-row { display: flex; align-items: center; gap: 2px; min-width: 0; }
.short-url-value { flex: 1; min-width: 0; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-decoration: none; }
.short-url-value:hover { text-decoration: underline; }
.short-url .icon-btn:hover { background: rgb(20 27 36 / 0.07); }
.scan-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.scan-stats .chip { gap: 5px; padding: 4px 10px; background: rgb(255 255 255 / 0.7); color: var(--ink-2); font-size: 0.8rem; }
.scan-stats .icon { width: 14px; height: 14px; }

.type-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.type-opt { position: relative; display: flex; }
.type-opt input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.type-opt span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-soft);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.type-opt .icon { width: 16px; height: 16px; }
.type-opt:hover span { border-color: var(--ink-soft); color: var(--ink); }
.type-opt input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.type-opt input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.content-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.content-fields:not(:empty) { animation: panel-in 0.24s var(--ease); }
.content-fields .wide { grid-column: 1 / -1; }
.req { color: var(--danger); }

.logo-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.logo-option { position: relative; display: grid; gap: 5px; cursor: pointer; min-width: 0; }
.logo-option input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.logo-tile {
  position: relative;
  display: block;
  aspect-ratio: 1;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--checker) 0 0 / 12px 12px;
  color: var(--mute);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s var(--ease);
}
.logo-tile img { width: 100%; height: 100%; object-fit: contain; }
.logo-add .logo-tile { display: grid; place-items: center; }
.logo-none { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 8px; background: var(--paper); }
.logo-check {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.15s, transform 0.25s var(--ease-spring);
}
.logo-check .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.logo-option:hover .logo-tile { border-color: var(--mute); }
.logo-option input:checked ~ .logo-tile { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.logo-option input:checked ~ .logo-tile .logo-check { opacity: 1; transform: scale(1); }
.logo-option input:focus-visible ~ .logo-tile { outline: 2px solid var(--ink); outline-offset: 2px; }
.logo-option:active .logo-tile { transform: scale(0.96); }
.logo-caption { font-size: 0.8rem; text-align: center; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-add .logo-tile { background: var(--paper); border-style: dashed; border-color: var(--line-strong); color: var(--ink-soft); }
.logo-add:hover .logo-tile { color: var(--ink); background: var(--signal-tint); border-color: var(--ink-soft); }

.presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.preset {
  display: grid;
  gap: 6px;
  padding: 8px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s var(--ease);
}
.preset:hover { border-color: var(--ink-soft); }
.preset:active { transform: scale(0.96); }
.preset-thumb { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--checker) 0 0 / 10px 10px; }
.preset-thumb svg { display: block; width: 100%; height: 100%; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.swatch {
  --swatch: #000;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.swatch:hover { border-color: var(--ink-soft); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.swatch-chip { flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--swatch); box-shadow: inset 0 0 0 1px rgb(20 27 36 / 0.14); transition: background 0.15s; }
.swatch-text { display: grid; font-size: 0.84rem; font-weight: 600; color: var(--ink-2); line-height: 1.3; }
.hex { font-size: 0.78rem; font-weight: 500; color: var(--ink-soft); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.gradient-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; padding: 14px; border-radius: 12px; background: var(--bg); animation: rise-in 0.25s var(--ease); }

/* Preview panel. The stage's checkerboard is the one loud surface: it shows exactly where an export is transparent. */
.editor-preview {
  position: sticky;
  top: calc(76px + var(--safe-top));
  display: grid;
  gap: 16px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--float);
}
.stage {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 20px;
  border-radius: 14px;
  background: var(--checker) 0 0 / 20px 20px;
  overflow: hidden;
}
.mock { display: grid; place-items: center; width: 100%; height: 100%; }
.mock-head, .mock-card-text { display: none; }
.mock-switch { margin-top: -6px; }

/* Preview scenes: how the code will look where it is used. Purely visual; exports are unaffected. */
.stage[data-mock="card"] { background: linear-gradient(140deg, #e6eaef, #c9d0d9); }
.stage[data-mock="card"] .mock {
  height: auto;
  aspect-ratio: 1.75;
  grid-template-columns: minmax(0, 1fr) 40%;
  align-items: center;
  gap: 7%;
  padding: 7%;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 1px rgb(20 27 36 / 0.06), 0 22px 34px -16px rgb(20 27 36 / 0.45);
  rotate: -3deg;
  animation: mock-in 0.45s var(--ease-spring);
}
.stage[data-mock="card"] .mock-card-text { display: grid; gap: 8px; align-content: center; min-width: 0; }
.mock-card-text .brand-mark { width: 22px; height: 22px; margin-bottom: 6px; }
.mock-card-text b { font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock-card-text i { display: block; width: 85%; height: 5px; border-radius: 3px; background: var(--bg-2); }
.mock-card-text i + i { width: 60%; }
.stage[data-mock="card"] .preview { max-width: none; }

.stage[data-mock="label"] { background: radial-gradient(circle at 30% 18%, #5b6876, #27313c 72%); }
.stage[data-mock="label"] .mock {
  --screw: #8a929c 0 2.6px, #eef0f2 3px 4.6px, transparent 5px;
  width: 80%;
  height: auto;
  grid-template-rows: auto auto;
  place-items: stretch;
  gap: 7%;
  padding: 9% 10% 10%;
  border-radius: 10px;
  background:
    radial-gradient(circle at 12px 12px, var(--screw)),
    radial-gradient(circle at calc(100% - 12px) 12px, var(--screw)),
    radial-gradient(circle at 12px calc(100% - 12px), var(--screw)),
    radial-gradient(circle at calc(100% - 12px) calc(100% - 12px), var(--screw)),
    repeating-linear-gradient(90deg, rgb(255 255 255 / 0.22) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #eef0f3, #c2c8cf);
  box-shadow: inset 0 1px 0 #fff, 0 16px 30px -12px rgb(0 0 0 / 0.6);
  animation: mock-in 0.45s var(--ease-spring);
}
.stage[data-mock="label"] .mock-head { display: grid; gap: 7px; min-width: 0; }
.mock-stripe { height: 9px; border-radius: 2px; background: repeating-linear-gradient(-45deg, var(--signal) 0 7px, var(--ink) 7px 14px); }
.mock-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; font-weight: 750; letter-spacing: -0.01em; }
.stage[data-mock="label"] .preview { max-width: none; padding: 5%; border-radius: 6px; background: #fff; box-shadow: 0 1px 2px rgb(20 27 36 / 0.25); }
.stage[data-mock="label"] .preview-layer svg, .stage[data-mock="card"] .preview-layer svg { filter: none; }

.stage[data-mock="dark"] { background: radial-gradient(circle at 50% 38%, #3d4957, #121820 74%); }
.stage[data-mock="dark"] .preview-layer svg { filter: drop-shadow(0 14px 28px rgb(0 0 0 / 0.55)); }
.preview { position: relative; display: grid; width: 100%; max-width: 300px; aspect-ratio: 1; }
.preview-layer { grid-area: 1 / 1; display: grid; place-items: center; animation: fade-in 0.16s ease-out; }
.preview-layer svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 14px rgb(20 27 36 / 0.12)); }
.preview-empty { grid-area: 1 / 1; display: grid; place-items: center; align-content: center; gap: 10px; padding: 24px; text-align: center; color: var(--ink-soft); font-size: 0.9rem; }
.preview-empty .icon { width: 28px; height: 28px; color: var(--mute); }
.stage-badge { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 7px; background: var(--paper); font-size: 0.78rem; font-weight: 650; box-shadow: 0 1px 2px rgb(20 27 36 / 0.12); }
.stage-badge .icon { width: 14px; height: 14px; stroke-width: 2.2; }
.stage-badge.badge-dynamic { background: var(--signal); }
.preview-info { min-height: 1.4em; margin-top: -6px; font-size: 0.86rem; color: var(--ink-soft); white-space: pre-line; font-variant-numeric: tabular-nums; }

.safety { --tone: var(--ok); --tint: var(--ok-tint); display: grid; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--tint); transition: background 0.25s; }
.safety[data-level="1"] { --tone: var(--warn); --tint: var(--warn-tint); }
.safety[data-level="2"] { --tone: var(--danger); --tint: var(--danger-tint); }
.safety-head { display: flex; align-items: center; gap: 7px; font-size: 0.88rem; font-weight: 650; }
.safety-head .icon { width: 18px; height: 18px; color: var(--tone); }
.safety-head b { margin-left: auto; color: var(--tone); }
.safety-meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.safety-meter i { height: 5px; border-radius: 3px; background: rgb(20 27 36 / 0.1); transition: background 0.3s var(--ease); }
.safety[data-level="0"] .safety-meter i { background: var(--tone); }
.safety[data-level="1"] .safety-meter i:nth-child(-n + 2) { background: var(--tone); }
.safety[data-level="2"] .safety-meter i:first-child { background: var(--tone); }
.safety-notes { margin: 0; padding-left: 18px; font-size: 0.82rem; line-height: 1.5; color: var(--ink-2); }

.export { display: grid; gap: 12px; }
.export .hint { margin-top: -4px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* --- Logos page --- */

.dropzone {
  display: grid;
  margin-bottom: 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--paper);
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.dropzone.is-over { border-color: var(--ink); background: var(--signal-tint); transform: scale(1.005); }
.dropzone-idle { display: grid; justify-items: center; gap: 6px; padding: 32px 16px; text-align: center; cursor: pointer; }
.dropzone-idle .muted { font-size: 0.86rem; }
.dropzone-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 6px; border-radius: 16px; background: var(--signal); transition: transform 0.25s var(--ease-spring); }
.dropzone-icon .icon { width: 24px; height: 24px; }
.dropzone-idle:hover .dropzone-icon, .dropzone.is-over .dropzone-icon { transform: translateY(-3px); }
#logo-file:focus-visible + .dropzone-idle { outline: 2px solid var(--ink); outline-offset: -4px; border-radius: 14px; }
.dropzone-ready { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: end; gap: 16px; padding: 18px; animation: rise-in 0.25s var(--ease); }
.dropzone-preview { display: block; width: 96px; height: 96px; padding: 10px; border-radius: 12px; background: var(--checker) 0 0 / 12px 12px; }
.dropzone-preview img { width: 100%; height: 100%; object-fit: contain; }
.dropzone-actions { display: flex; gap: 8px; }

.logo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.logo-card { position: relative; display: grid; gap: 10px; padding: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
.logo-card-img { display: block; height: 120px; padding: 16px; border-radius: 10px; background: var(--checker) 0 0 / 12px 12px; }
.logo-card-img img { width: 100%; height: 100%; object-fit: contain; }
.logo-card-info { display: grid; gap: 1px; min-width: 0; padding-right: 36px; }
.logo-card-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-card-info .muted { font-size: 0.82rem; }
.logo-card .icon-btn { position: absolute; right: 10px; bottom: 12px; }

/* --- Users & account --- */

.user-form { margin-bottom: 16px; }
.user-form-row { display: grid; grid-template-columns: 1fr 1fr 160px auto; gap: 12px; align-items: end; }
.table-card { padding: 0; overflow: hidden; }
.users { width: 100%; border-collapse: collapse; }
.users th, .users td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.users tr:last-child td { border-bottom: 0; }
.users th { font-size: 0.8rem; font-weight: 650; color: var(--ink-soft); background: #fafbfc; }
.users .num { font-variant-numeric: tabular-nums; }
.user-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.users td > .user-cell { min-height: 36px; }
.role-select { width: auto; min-height: 36px; padding: 6px 34px 6px 12px; border-radius: 999px; font-size: 0.88rem; font-weight: 600; }
.users .row-actions { text-align: right; white-space: nowrap; }

.account { display: grid; grid-template-columns: 300px minmax(0, 420px); gap: 16px; align-items: start; }
.profile { display: flex; align-items: center; gap: 14px; }
.profile div { display: grid; }
.profile b { font-size: 1.1rem; }
.stack { display: grid; gap: 14px; }
.stack .card-title { margin-bottom: 0; }

/* --- Download menu (list) --- */

.download-menu {
  position: fixed;
  inset: var(--y, 0) auto auto var(--x, 0);
  width: 300px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 50px -18px rgb(20 27 36 / 0.4);
}
.download-menu:popover-open { display: grid; gap: 12px; animation: dialog-in 0.2s var(--ease-spring); }
.download-menu-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.download-menu .hint { margin-top: -4px; }

/* --- Dialog & toast --- */

.dialog {
  width: min(420px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 70px -20px rgb(20 27 36 / 0.45);
}
.dialog[open] { animation: dialog-in 0.24s var(--ease-spring); }
.dialog::backdrop { background: rgb(20 27 36 / 0.42); backdrop-filter: blur(3px); animation: fade-in 0.2s; }
.dialog-body { display: grid; gap: 10px; padding: 24px; }
.dialog-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; border-radius: 13px; background: var(--signal-tint); }
.dialog-icon.danger { background: var(--danger-tint); color: var(--danger); }
.dialog-body .field { margin-top: 6px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.dialog-actions:has(> [hidden]) { grid-template-columns: 1fr; }
.dialog-body p { overflow-wrap: anywhere; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: min(520px, calc(100% - 32px));
  padding: 12px 18px 12px 14px;
  border-radius: 13px;
  background: var(--ink);
  color: #fff;
  font-weight: 550;
  box-shadow: 0 16px 40px -12px rgb(20 27 36 / 0.5);
  translate: -50% 0;
  animation: toast-in 0.32s var(--ease-spring);
}
.toast .icon { color: var(--signal); stroke-width: 2.4; }
.toast-error { background: var(--danger); }
.toast-error .icon { color: #fff; }
.toast.is-leaving { animation: toast-out 0.2s var(--ease) forwards; }

/* --- Motion --- */

@keyframes fade-in { from { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.8); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes spin { to { rotate: 360deg; } }
@keyframes draw { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }
@keyframes shake { 25% { translate: -4px 0; } 50% { translate: 4px 0; } 75% { translate: -2px 0; } }
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes dot-in { from { opacity: 0; transform: scale(0); } }
@keyframes mock-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
@keyframes eye-in { from { opacity: 0; stroke-dasharray: 0 30; } to { stroke-dasharray: 30 0; } }

/* Page changes: View Transitions crossfade the content while the bars stay put and the nav marker slides. */
@supports (view-transition-name: none) {
  .nav-indicator { view-transition-name: nav-indicator; transition: opacity 0.2s; }
}
::view-transition-old(root) { animation: vt-out 0.16s var(--ease) both; }
::view-transition-new(root) { animation: vt-in 0.3s var(--ease) both; }
::view-transition-group(nav-indicator) { animation-duration: 0.32s; animation-timing-function: var(--ease); }
@keyframes vt-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Tablet: preview moves beside, then above, the form --- */

@media (max-width: 980px) {
  .editor-body { grid-template-columns: 1fr; }
  .editor-preview { order: -1; position: static; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .editor-preview .stage { grid-row: span 4; }
  .editor-preview .mock-switch { grid-column: 1; margin-top: 0; }
  .user-form-row { grid-template-columns: 1fr 1fr; }
  .account { grid-template-columns: 1fr; max-width: 520px; }
}

/* --- Phone: bottom tab bar, sticky editor actions --- */

@media (max-width: 760px) {
  h1 { font-size: 1.5rem; }
  .login { grid-template-columns: 1fr; }
  .login-hero { padding: calc(32px + var(--safe-top)) 24px 28px; }
  .login-hero-inner { justify-items: center; text-align: center; gap: 10px; }
  .hero-qr { width: 150px; margin: 10px 0 4px; }
  .hero-title { font-size: 1.35rem; }
  .hero-text { font-size: 0.92rem; }
  .login-side { align-items: start; padding: 28px 24px calc(28px + var(--safe-bottom)); }

  .topbar { gap: 12px; padding: var(--safe-top) 12px 0 16px; min-height: 56px; }
  .brand { flex: 1; }
  .who-name { display: none; }
  .nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    gap: 0;
    padding: 6px 4px calc(6px + var(--safe-bottom));
    background: rgb(255 255 255 / 0.94);
    backdrop-filter: saturate(1.6) blur(16px);
    border-top: 1px solid var(--line);
  }
  .nav a { flex: 1; flex-direction: column; justify-content: center; gap: 2px; padding: 4px 0; color: var(--mute); font-size: 0.7rem; font-weight: 650; }
  .nav a:hover { color: var(--ink-soft); }
  .nav a[aria-current="page"] { color: var(--ink); }
  .nav a .icon { width: 52px; height: 30px; padding: 5px 16px; border-radius: 15px; transition: background 0.25s var(--ease); }
  .nav a[aria-current="page"] .icon { background: var(--signal); }
  .nav-indicator { display: none; }
  body[data-view="editor"] .nav { display: none; }

  main { padding: 20px 16px calc(96px + var(--safe-bottom)); }
  .page-head { margin-bottom: 16px; }
  .page-head .btn { display: none; }
  .search { max-width: none; margin-left: 0; flex-basis: 100%; }
  .list-tools .seg { order: 2; }

  .qr-item { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 12px; }
  .qr-link { grid-column: 1 / -1; }
  .qr-meta { display: none; }
  .qr-actions { justify-self: end; }

  .editor-head { margin-bottom: 14px; }
  .editor-title h1 { font-size: 1.2rem; }
  .editor-head-actions .btn span { display: none; }
  .editor-head-actions .btn { width: 38px; padding: 0; }
  /* Phone order: what the code looks like, then the edit tabs, then export options. The panel dissolves so its parts can interleave with the form. */
  .editor-body { display: flex; flex-direction: column; gap: 14px; }
  .editor-preview { display: contents; }
  .editor-preview .stage { order: -3; width: min(100%, 340px); align-self: center; padding: 16px; border-radius: 18px; }
  .mock-switch { order: -3; margin-top: 0; }
  .preview-info { order: -2; margin: -4px 0 0; text-align: center; }
  .safety { order: -2; }
  .export { order: 1; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
  .actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: 10px 16px calc(10px + var(--safe-bottom));
    background: rgb(255 255 255 / 0.94);
    backdrop-filter: saturate(1.6) blur(16px);
    border-top: 1px solid var(--line);
  }
  .panel { padding: 18px 16px; gap: 20px; }
  .tabs { padding: 0 4px; }
  .tabs [role="tab"] { flex: 1; justify-content: center; padding: 0 8px; gap: 5px; }
  .kind { grid-template-columns: 1fr; }
  .shape-grid:not(.shape-grid-sm) { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
  .presets { grid-template-columns: repeat(4, 1fr); gap: 8px; }

  .dropzone-ready { grid-template-columns: 72px minmax(0, 1fr); }
  .dropzone-preview { width: 72px; height: 72px; }
  .dropzone-actions { grid-column: 1 / -1; justify-content: flex-end; }

  .user-form-row { grid-template-columns: 1fr; }
  .users thead { display: none; }
  .users tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .users tr:last-child { border-bottom: 0; }
  .users td { border: 0; padding: 4px 8px 4px 14px; }
  .users td.row-actions { padding: 0 6px 0 0; }
  .users td:nth-child(3), .users td:nth-child(4) { display: none; }

  .toast { bottom: calc(92px + var(--safe-bottom)); }
  .sort { flex: 1; min-width: 0; order: 3; }
  .content-fields { grid-template-columns: 1fr; }
  .download-menu {
    inset: auto 0 0 0;
    width: 100%;
    padding: 20px 16px calc(20px + var(--safe-bottom));
    border-radius: 20px 20px 0 0;
  }
  .download-menu::backdrop { background: rgb(20 27 36 / 0.35); }
  .download-menu:popover-open { animation: sheet-in 0.28s var(--ease); }
}
@keyframes sheet-in { from { transform: translateY(100%); } }
