/* Tattoo Removal Tracker — website theme.
 * The phone app's Inkwasher brand theme v2, token for token
 * (app/src/index.css): near-black ground, deep-jade glow on the
 * header band, ink-jade cards with a faint light edge, bone-white
 * Archivo type, IBM Plex Mono micro-labels in mist, fully-rounded
 * jade pill buttons. Single dark theme, like the app. */

:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --surface: #14201b;
  --surface2: #1c2a24;
  --text: #f7f4ed;
  --dim: rgba(255, 255, 255, 0.65);
  --text-3: rgba(255, 255, 255, 0.42);
  --border: rgba(255, 255, 255, 0.08);
  --accent: #1f4d3d;
  --accent-lift: #2e7d5f;
  --accent-deep: #163829;
  --accent-soft: rgba(31, 77, 61, 0.38);
  --accent-line: rgba(143, 179, 161, 0.4);
  --mist: #8fb3a1;
  --mist-soft: rgba(143, 179, 161, 0.16);
  --danger: #8c4a4f;
  --danger-text: #d89fa3;
  --danger-soft: rgba(140, 74, 79, 0.22);
  --radius: 16px;
  --font-sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: clip;
}

a { color: var(--mist); text-decoration: none; }
a:hover { text-decoration: underline; }

.micro-label {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* The site's deep-jade radial glow — header band only, as in the app. */
.hero-glow {
  background: radial-gradient(
    130% 105% at 50% 0%,
    rgba(31, 77, 61, 0.6) 0%,
    rgba(22, 56, 41, 0.38) 42%,
    rgba(11, 11, 11, 0) 76%
  );
}

/* ------------------------------ header ------------------------------ */

.app-header {
  position: relative;
  padding: 20px 20px 8px;
}
.app-header .glow {
  position: absolute;
  inset: 0 0 auto 0;
  height: 288px;
  pointer-events: none;
}
.header-inner {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.header-inner img.logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
}
.header-title { line-height: 1.15; }
.header-title h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.header-title .byline {
  color: var(--mist);
  font-size: 12px;
}
.header-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sync-pill {
  font-size: 13px;
  color: var(--dim);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 9999px;
  padding: 6px 12px;
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sync-pill.error { color: var(--danger-text); border-color: var(--danger); }

/* ------------------------------ layout ------------------------------ */

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px 64px;
  position: relative;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card + .card { margin-top: 16px; }
.card h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
}
.card h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
}
.muted { color: var(--dim); }
.faint { color: var(--text-3); }
.small { font-size: 14px; }
.error-text { color: var(--danger-text); }

/* ------------------------------ buttons ----------------------------- */

.btn {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid transparent;
  padding: 10px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-lift); }
.btn-primary:active:not(:disabled) { background: var(--accent-lift); }
.btn-quiet {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border);
}
.btn-quiet:hover:not(:disabled) { border-color: var(--accent-line); }
.btn-ghost { background: transparent; color: var(--mist); }
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger-text);
  border-color: var(--danger);
}
.btn-small { padding: 6px 14px; font-size: 14px; }

/* ------------------------------- forms ------------------------------ */

label.field {
  display: block;
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--dim);
}
label.field > span { display: block; margin-bottom: 6px; }
input[type="text"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  font-family: var(--font-sans);
  padding: 10px 12px;
}
textarea { min-height: 76px; resize: vertical; }
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-lift);
  flex: none;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 15px;
  cursor: pointer;
}
.wavelength-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.wave-chip {
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 14px;
  cursor: pointer;
}
.wave-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------------------------- client list --------------------------- */

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 14px 0;
}
.toolbar .search { flex: 1 1 220px; }
.toolbar select { width: auto; flex: 0 1 auto; }
.selection-bar {
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 14px;
}
.selection-bar.on { display: flex; }

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.client-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: var(--text);
  font-family: var(--font-sans);
}
.client-card:hover { border-color: var(--accent-line); }
.client-card .thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface2);
  flex: none;
}
.client-card .thumb-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: var(--accent-deep);
  color: var(--mist);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  flex: none;
}
.client-card .meta { min-width: 0; flex: 1; }
.client-card .name {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-card .sub {
  font-size: 14px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-card .pick { flex: none; }

/* ------------------------------ profile ----------------------------- */

.profile-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.profile-head .thumb {
  width: 84px; height: 84px; border-radius: 14px; object-fit: cover;
  background: var(--surface2); flex: none;
}
.profile-head .thumb-placeholder {
  width: 84px; height: 84px; border-radius: 14px; background: var(--accent-deep);
  color: var(--mist); display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 800; flex: none;
}
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  border-radius: 9999px;
  padding: 3px 10px;
  margin-left: 8px;
  vertical-align: middle;
}
.badge-wine { background: var(--danger-soft); color: var(--danger-text); border: 1px solid var(--danger); }
.badge-mist { background: var(--mist-soft); color: var(--mist); border: 1px solid var(--accent-line); }

.tattoo-row {
  display: flex; gap: 14px; align-items: center; width: 100%;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; margin-top: 10px;
  color: var(--text); cursor: pointer; text-align: left; font-family: var(--font-sans);
}
.tattoo-row:hover { border-color: var(--accent-line); }
.tattoo-row .thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--surface); flex: none; }
.tattoo-row .thumb-placeholder {
  width: 52px; height: 52px; border-radius: 10px; background: var(--accent-deep);
  color: var(--mist); display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; flex: none;
}

.file-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.file-row:last-child { border-bottom: none; }
.file-row .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------ timeline ---------------------------- */

.session-block { margin-top: 18px; }
.session-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.session-head h3 { margin: 0; }
.photo-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.photo-tile {
  position: relative;
  width: 220px;
  max-width: 44vw;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 0;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-chip {
  position: absolute;
  left: 6px; top: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 9999px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-align: left;
  pointer-events: none;
}
.photo-chip span { display: block; white-space: nowrap; }
.settings-line { color: var(--mist); font-size: 14px; margin-top: 8px; }
.note-line { color: var(--dim); font-size: 15px; margin-top: 6px; white-space: pre-wrap; }

/* --------------------------- photo viewer --------------------------- */

.viewer {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0, 0, 0, 0.94);
  display: none;
  flex-direction: column;
}
.viewer.on { display: flex; }
.viewer-stage {
  flex: 1; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.viewer-stage img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}
.viewer-bar {
  display: flex; gap: 8px; align-items: center; justify-content: center;
  padding: 12px; flex-wrap: wrap;
}
.watermark {
  position: absolute;
  right: 14px; bottom: 14px;
  background: rgba(10, 10, 10, 0.45);
  border-radius: 10px;
  padding: 8px 12px;
  pointer-events: none;
  text-align: left;
}
.watermark .wm-1 { color: #fff; font-weight: 700; font-size: 19px; line-height: 1.25; }
.watermark .wm-2 { color: var(--mist); font-weight: 700; font-size: 15px; letter-spacing: 0.04em; }
.viewer .photo-chip { left: 14px; top: 14px; font-size: 12px; padding: 4px 10px; }

/* ------------------------------ dialogs ----------------------------- */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.66);
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.sheet-backdrop.on { display: flex; }
.sheet {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 22px;
}
@media (min-width: 720px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 20px; }
}
.sheet h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.sheet-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.sheet-actions .spacer { flex: 1; }

/* ------------------------------ sign-in ----------------------------- */

.signin-wrap {
  max-width: 440px;
  margin: 6vh auto 0;
  text-align: center;
}
.signin-wrap img.logo { width: 96px; height: 96px; border-radius: 24px; }
.signin-wrap h1 { font-size: 28px; font-weight: 800; margin: 16px 0 2px; }
.signin-card { margin-top: 22px; text-align: left; }
/* Sign-in: a themed pill (jade, Google G mark) sits on the dark
 * card; the REAL Google button renders invisibly on top of it,
 * filling it exactly, so taps land on Google's own control while
 * the GIS iframe's white background can never show. */
.gis-holder { position: relative; height: 48px; margin: 18px 0 6px; }
.google-btn {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--accent); color: #fff;
  border-radius: 999px;
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 15px; font-weight: 600; letter-spacing: 0.01em;
  pointer-events: none;
}
.google-g {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; flex: none;
}
.gis-real {
  position: absolute; inset: 0;
  opacity: 0.001;
  border-radius: 999px; overflow: hidden;
}
.gis-real iframe { width: 100% !important; height: 100% !important; }

/* ------------------------------- misc ------------------------------- */

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--dim);
}
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--accent-line);
  border-radius: 9999px; padding: 10px 18px; font-size: 14px;
  z-index: 80; display: none; max-width: 92vw; text-align: center;
}
.toast.on { display: block; }
.toast.error { border-color: var(--danger); color: var(--danger-text); }
.progress-line { font-size: 14px; color: var(--dim); margin-top: 8px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 15px; }
.kv-row .k { color: var(--dim); }

@media (max-width: 720px) {
  .header-inner img.logo { width: 44px; height: 44px; border-radius: 12px; }
  .header-title h1 { font-size: 20px; }
  main { padding: 8px 14px 56px; }
  .photo-tile { width: 46vw; }
  .client-grid { grid-template-columns: 1fr; }
}

/* -------------------- shared render pieces ---------------------- */
/* Session-label chip (the app's PhotoLabelChip): IBM Plex Mono
 * semibold uppercase on rgba(0,0,0,0.6), in the photo's OWN corner. */
.photo-label-chip {
  position: absolute; z-index: 4;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  color: #fff; background: rgba(0, 0, 0, 0.6);
  border-radius: 999px; padding: 2px 8px;
  pointer-events: none; user-select: none;
}
.photo-label-chip .chip-line { display: block; white-space: nowrap; }
.photo-label-chip.corner-tl { left: 6px; top: 6px; }
.photo-label-chip.corner-tr { right: 6px; top: 6px; }
.photo-label-chip.corner-bl { left: 6px; bottom: 6px; }

/* Pill watermark overlay (the app's WatermarkOverlay): sizes
 * itself off the stage width with container-query units. */
.wm-overlay {
  position: absolute; inset: 0; z-index: 5;
  pointer-events: none; user-select: none;
  container-type: inline-size;
}
.wm-pill {
  position: absolute; right: 2.5cqw; bottom: 2.4cqw;
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 1cqw; padding: 1.5cqw; border-radius: 1.33cqw;
  background: rgba(10, 10, 10, 0.45);
  font-family: "Archivo", system-ui, sans-serif; text-align: right;
}
.wm-l1 { font-size: 2.6cqw; line-height: 1.05; font-weight: 700; color: #fff; white-space: nowrap; }
.wm-l2 { font-size: 2cqw; line-height: 1.05; font-weight: 700; color: var(--mist); white-space: nowrap; }

/* Technician logo overlay (Compare + Layout preview): draggable,
 * corner handle resizes; placement persists at drag-end. */
.cmp-logo { position: absolute; z-index: 6; cursor: grab; touch-action: none; }
.cmp-logo img { width: 100%; display: block; pointer-events: none; }
.cmp-logo-handle {
  position: absolute; right: -9px; bottom: -9px;
  width: 18px; height: 18px; border-radius: 5px;
  background: var(--accent-lift); border: 2px solid #fff;
  cursor: nwse-resize;
}

/* Unified small buttons used across Compare and Layouts. */
.cmp-btn {
  appearance: none; border: 1px solid transparent; background: transparent;
  color: var(--text); font: inherit; font-size: 14px; font-weight: 600;
  padding: 8px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap;
}
.cmp-btn:hover { background: rgba(255, 255, 255, 0.06); }
.cmp-btn.active { background: var(--accent); color: #fff; }
.cmp-btn.lit { background: var(--accent); color: #fff; }
.cmp-btn:disabled { opacity: 0.45; cursor: default; }
.cmp-btn.danger { color: var(--danger-text); }

/* ------------------------------ compare -------------------------- */
.compare-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: var(--bg); color: var(--text);
  display: flex; flex-direction: column;
}
.compare-overlay[hidden] { display: none; }
.cmp-topbar {
  position: relative;
  display: flex; align-items: center;
  margin: 10px 10px 0; padding: 4px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 16px;
}
.cmp-topbar > * + * { border-left: 1px solid var(--border); }
.cmp-topbar .cmp-btn { border-radius: 12px; }
/* Phone widths: the whole unified bar (✕ · Save · modes · Labels ·
   Share) must fit without anything hanging off the edge. */
@media (max-width: 560px) {
  .cmp-topbar { margin: 8px 8px 0; padding: 3px; border-radius: 14px; }
  .cmp-topbar .cmp-btn { font-size: 12.5px; padding: 7px 7px; border-radius: 10px; }
  .cmp-topbar .cmp-close { padding: 7px 9px; }
}
.cmp-top-spacer { flex: 1; border-left: none !important; }
.cmp-modes { display: flex; }
.cmp-save.dirty { background: var(--accent-lift); color: #fff; }
.cmp-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 12;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 12px; min-width: 210px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.cmp-pop-item {
  display: block; width: 100%; text-align: left;
  appearance: none; border: none; background: transparent; color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 8px 6px; border-radius: 8px; cursor: pointer;
}
.cmp-pop-item:hover { background: rgba(255, 255, 255, 0.06); }
.cmp-pickers {
  position: relative;
  display: flex; gap: 10px; padding: 10px;
}
.cmp-picker {
  flex: 1; appearance: none; cursor: pointer;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  font: inherit; font-size: 14px; font-weight: 600; padding: 9px 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cmp-picker-list {
  position: absolute; top: calc(100% - 2px); left: 10px; right: 10px; z-index: 12;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 6px; max-height: 46vh; overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.cmp-picker-row {
  display: block; width: 100%; text-align: left;
  appearance: none; border: none; background: transparent; color: var(--text);
  font: inherit; padding: 8px 10px; border-radius: 10px; cursor: pointer;
}
.cmp-picker-row:hover { background: rgba(255, 255, 255, 0.06); }
.cmp-picker-row.selected { background: var(--accent-soft); }
.cmp-picker-row-main { display: block; font-size: 14px; font-weight: 600; }
.cmp-picker-row-role { display: block; font-size: 12px; color: var(--dim); margin-top: 1px; }
.cmp-stage {
  position: relative; flex: 1; min-height: 0;
  background: var(--bg); overflow: hidden; touch-action: none;
  display: flex;
}
.cmp-stage.mode-side { flex-direction: row; }
.cmp-stage.mode-side.stacked { flex-direction: column; }
.cmp-pane {
  position: relative; flex: 1; min-width: 0; min-height: 0;
  background: #fff; overflow: hidden;
}
.cmp-stage.mode-slider .cmp-pane { position: absolute; inset: 0; }
/* Slider: the left (Before) pane paints ABOVE the right one and is
   clipped to the wipe position — otherwise the right photo covers
   it everywhere (DOM order alone puts the right pane on top). */
.cmp-stage.mode-slider [data-pane="left"] { z-index: 2; }
.cmp-photo { position: absolute; inset: 0; will-change: transform; }
.cmp-photo img {
  /* Sized in px to the cover fit by renderPane and centred; the
     framing transform on .cmp-photo does the rest. */
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: block; -webkit-user-drag: none; user-select: none;
}
.cmp-bar { position: absolute; background: #fff; z-index: 3; display: none; }
.cmp-bar[data-bar="top"] { top: 0; left: 0; right: 0; }
.cmp-bar[data-bar="bottom"] { bottom: 0; left: 0; right: 0; }
.cmp-bar[data-bar="left"] { left: 0; top: 0; bottom: 0; }
.cmp-bar[data-bar="right"] { right: 0; top: 0; bottom: 0; }
.cmp-chip-holder { position: absolute; inset: 0; pointer-events: none; }
.cmp-divider {
  position: absolute; z-index: 5; background: #fff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.cmp-chevrons {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  color: #fff; font-size: 24px; font-weight: 700; letter-spacing: 2px;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.65); white-space: nowrap;
}
.cmp-stage.axis-y .cmp-chevrons { transform: translate(-50%, -50%) rotate(90deg); }
.cmp-bottombar {
  display: flex; justify-content: center; gap: 8px;
  padding: 10px; background: var(--surface2);
  border-top: 1px solid var(--border);
}
.cmp-fallback {
  position: absolute; inset: 0; z-index: 20;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px; text-align: center;
}
.cmp-fallback[hidden] { display: none; }
.cmp-fallback .cmp-close { position: absolute; top: 12px; left: 12px; }
.cmp-anim {
  position: absolute; inset: 0; z-index: 30;
  background: rgba(0, 0, 0, 0.62);
  display: flex; align-items: flex-end; justify-content: center;
}
.cmp-anim[hidden] { display: none; }
.cmp-anim-card {
  background: var(--surface); color: var(--text);
  width: 100%; max-width: 640px; max-height: 94%;
  overflow-y: auto; border-radius: 18px 18px 0 0; padding: 16px;
}
.cmp-anim-head { display: flex; align-items: center; justify-content: space-between; }
.cmp-anim-head h3 { margin: 0; }
.cmp-anim-preview { width: 100%; display: block; border-radius: 12px; background: #fff; }
.cmp-anim-photos { max-height: 180px; overflow-y: auto; }

/* ------------------------------ layouts -------------------------- */
.layout-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: var(--bg); color: var(--text);
  overflow-y: auto; padding: 14px;
}
.layout-overlay[hidden] { display: none; }
.lay-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.lay-head h3 { margin: 0; font-size: 20px; }
.lay-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.lay-group-head { margin: 16px 0 8px; }
.lay-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 10px;
}
.lay-thumb {
  appearance: none; border: 1px solid var(--border); cursor: pointer;
  background: var(--surface2); border-radius: 12px; padding: 6px;
  color: var(--dim); font: inherit; font-size: 11px;
  display: flex; flex-direction: column; gap: 5px; align-items: stretch;
}
.lay-thumb svg {
  width: 100%; aspect-ratio: 1; display: block;
  background: var(--surface); border-radius: 7px;
}
.lay-thumb svg polygon { fill: var(--mist); opacity: 0.75; }
.lay-thumb span { text-align: center; line-height: 1.25; }
.lay-preview-wrap { position: relative; }
.lay-preview {
  width: 100%; display: block; border-radius: 12px;
  touch-action: none; background: var(--surface2);
}
.lay-label-row { display: flex; gap: 22px; padding: 10px 2px 2px; }
.lay-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.lay-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px; margin-bottom: 12px;
}
.lay-slider { display: block; margin: 10px 0; font-size: 13px; color: var(--dim); }
.lay-slider input { width: 100%; margin-top: 4px; accent-color: var(--accent-lift); }
.lay-btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.lay-photo-strip {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px;
}
.lay-photo-thumb {
  appearance: none; border: 2px solid transparent; border-radius: 12px;
  background: var(--surface2); padding: 0; cursor: pointer; flex: none;
  display: flex; flex-direction: column; align-items: center;
  color: var(--dim); font-size: 11px; overflow: hidden;
}
.lay-photo-thumb img { width: 56px; height: 56px; object-fit: cover; display: block; }
.lay-photo-thumb.active { border-color: var(--accent-lift); }
.lay-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.lay-swatch {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); cursor: pointer; appearance: none;
}
.lay-swatch.mini { width: 28px; height: 28px; }
.lay-swatch.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-lift); }
.lay-text-add { display: flex; gap: 8px; align-items: center; }
.lay-text-add input {
  flex: 1; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); padding: 9px 12px; font: inherit;
}
.lay-item {
  border-top: 1px solid var(--border); padding: 10px 0 2px; margin-top: 10px;
}
.lay-actions {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 12px 0;
}
.lay-name {
  flex: 1; min-width: 160px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); padding: 10px 12px; font: inherit;
}
.lay-ready-img { width: 100%; border-radius: 12px; display: block; margin: 10px 0; }

/* --------------------------- settings logo ----------------------- */
.logo-preview {
  margin: 12px 0; padding: 14px; border-radius: 12px;
  border: 1px solid var(--border);
  background:
    repeating-conic-gradient(rgba(255, 255, 255, 0.14) 0% 25%, rgba(0, 0, 0, 0.18) 0% 50%)
    50% / 18px 18px;
  display: flex; align-items: center; justify-content: center;
}
.logo-preview img { max-width: 100%; max-height: 130px; display: block; }
