/* GEO Audit themes */
:root,
html[data-theme="dark"] {
  --bg: #070a0f;
  --bg-elevated: #10161f;
  --bg-soft: #161e29;
  --surface: rgba(24, 33, 44, 0.92);
  --surface-2: rgba(18, 24, 33, 0.96);
  --input-bg: rgba(11, 15, 20, 0.75);
  --input-bg-focus: rgba(11, 15, 20, 0.95);
  --card-bg: rgba(11, 15, 20, 0.4);
  --soft-bg: rgba(11, 15, 20, 0.45);
  --footer-bg: rgba(11, 15, 20, 0.35);
  --table-bg: rgba(7, 10, 15, 0.35);
  --table-head: rgba(22, 30, 41, 0.95);
  --table-sticky: rgba(16, 22, 31, 0.98);
  --line: rgba(125, 211, 252, 0.12);
  --line-strong: rgba(125, 211, 252, 0.22);
  --text: #eef5ff;
  --text-soft: #cbd5e1;
  --muted: #93a4b8;
  --accent: #2dd4bf;
  --accent-dim: rgba(45, 212, 191, 0.16);
  --accent-2: #7dd3fc;
  --warn: #fbbf24;
  --fail: #fb7185;
  --ok: #34d399;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  --radius: 16px;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --atmosphere-a: rgba(45, 212, 191, 0.12);
  --atmosphere-b: rgba(103, 232, 249, 0.08);
  --atmosphere-base: linear-gradient(180deg, #0b0f14 0%, #0d131b 50%, #0a1018 100%);
  --chip-bg: rgba(18, 24, 33, 0.7);
  --placeholder: #64748b;
  --toggle-off: #334155;
  --list-item-bg: rgba(24, 33, 44, 0.75);
  --list-item-border: rgba(148, 163, 184, 0.08);
}

html[data-theme="light"] {
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --bg-soft: #f4f6f8;
  --surface: rgba(255, 255, 255, 0.98);
  --surface-2: #ffffff;
  --input-bg: #ffffff;
  --input-bg-focus: #ffffff;
  --card-bg: #ffffff;
  --soft-bg: #f4f6f8;
  --footer-bg: #f4f6f8;
  --table-bg: #ffffff;
  --table-head: #f4f6f8;
  --table-sticky: #fafbfc;
  --line: rgba(15, 23, 42, 0.1);
  --line-strong: rgba(15, 23, 42, 0.18);
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --accent: #0f766e;
  --accent-dim: rgba(15, 118, 110, 0.1);
  --accent-2: #0e7490;
  --warn: #b45309;
  --fail: #be123c;
  --ok: #047857;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
  --atmosphere-a: rgba(15, 118, 110, 0.06);
  --atmosphere-b: rgba(14, 116, 144, 0.05);
  --atmosphere-base: linear-gradient(180deg, #ffffff 0%, #fafbfc 55%, #f4f6f8 100%);
  --chip-bg: #f4f6f8;
  --placeholder: #94a3b8;
  --toggle-off: #cbd5e1;
  --list-item-bg: #f4f6f8;
  --list-item-border: rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

body {
  position: relative;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 12% -10%, var(--atmosphere-a), transparent 55%),
    radial-gradient(700px 420px at 100% 0%, var(--atmosphere-b), transparent 50%),
    var(--atmosphere-base);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 75%);
}

.app {
  width: min(920px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1.25rem 0 3.5rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
  margin: 0 0 1.35rem;
  padding: 0.7rem 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  animation: rise 0.5s ease both;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.brand {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-sub {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-status {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-right: 0.35rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  background: var(--chip-bg);
}

.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #475569;
}

.chip.on::before { background: var(--ok); }
.chip.off::before { background: #64748b; }

.intro {
  margin-bottom: 1.1rem;
  animation: rise 0.55s ease 0.05s both;
}

.intro h1 {
  margin: 0;
  max-width: none;
  width: 100%;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.3;
  text-align: left;
  white-space: nowrap;
}

.intro p {
  margin: 0.55rem 0 0;
  max-width: none;
  width: 100%;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: left;
}

.panel {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
  padding: 0.15rem;
  animation: rise 0.6s ease 0.08s both;
}

.panel-section {
  padding: 1rem 1.05rem 1.05rem;
}

.panel-section + .panel-section {
  border-top: 1px solid var(--line);
}

.section-label {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.9rem;
}

.step-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  padding-top: 0.2rem;
}

.section-label h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-label p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.field-row .field {
  margin-bottom: 0;
}

.field.grow {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.field.field-friendly {
  flex: 0 1 10rem;
  min-width: 7.5rem;
  max-width: 14rem;
  margin-bottom: 0;
}

.field label,
.upload-title {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

input[type="url"],
input[type="text"] {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  padding: 0.7rem 0.8rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input[type="url"]:focus,
input[type="text"]:focus {
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--input-bg-focus);
}

input[type="url"].is-invalid,
input[type="text"].is-invalid {
  border-color: color-mix(in srgb, var(--fail) 65%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--fail) 18%, transparent);
}

input[type="url"].is-warn,
input[type="text"].is-warn {
  border-color: color-mix(in srgb, var(--warn) 70%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 18%, transparent);
}

.upload-card.is-invalid {
  border-color: color-mix(in srgb, var(--fail) 55%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--fail) 22%, transparent);
}

input::placeholder { color: var(--placeholder); }

.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.upload-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 96px;
  padding: 0.85rem 0.9rem 0.95rem;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--soft-bg);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.upload-card:hover {
  border-color: rgba(45, 212, 191, 0.45);
  background: rgba(45, 212, 191, 0.05);
  transform: translateY(-1px);
}

.upload-card.compact {
  min-height: 0;
  width: min(240px, 38vw);
  flex: 0 0 auto;
  justify-content: center;
  padding: 0.65rem 0.75rem;
}

.upload-card input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-hint {
  color: var(--placeholder);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.upload-filename {
  margin-top: auto;
  padding-top: 0.55rem;
  color: var(--accent-2);
  font-family: var(--mono);
  font-size: 0.72rem;
  word-break: break-all;
}

.upload-filename:empty::before {
  content: attr(data-empty);
  color: var(--placeholder);
}

.upload-card.has-file {
  border-style: solid;
  border-color: rgba(45, 212, 191, 0.35);
  background: rgba(45, 212, 191, 0.06);
}

.competitor-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.competitor-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.65rem;
}

.competitor-row .field.grow {
  flex: 1 1 12rem;
  min-width: 10rem;
}

.competitor-row .field.field-friendly {
  flex: 0 1 9rem;
  min-width: 7rem;
  max-width: 12rem;
}

.competitor-color-btn {
  appearance: none;
  flex: 0 0 auto;
  width: 2.05rem;
  height: 2.05rem;
  margin-bottom: 0.05rem;
  padding: 0;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--soft-bg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.competitor-color-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.competitor-color-btn:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.competitor-color-btn.has-color {
  border-style: solid;
  border-color: color-mix(in srgb, var(--line-strong) 40%, transparent);
}

.competitor-color-swatch {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 4px;
  background:
    linear-gradient(45deg, #cbd5e1 25%, transparent 25%) 0 0 / 8px 8px,
    linear-gradient(-45deg, #cbd5e1 25%, transparent 25%) 0 4px / 8px 8px,
    linear-gradient(45deg, transparent 75%, #cbd5e1 75%) 4px -4px / 8px 8px,
    linear-gradient(-45deg, transparent 75%, #cbd5e1 75%) 4px 0 / 8px 8px,
    #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.competitor-color-btn.has-color .competitor-color-swatch {
  background: var(--competitor-swatch, #64748b);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.18);
}

.panel-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.95rem 1.05rem 1.05rem;
  border-top: 1px solid var(--line);
  background: var(--footer-bg);
  border-radius: 0 0 var(--radius) var(--radius);
}

.audit-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 16rem;
  min-width: 0;
}

.toggle {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.7rem;
  cursor: pointer;
  user-select: none;
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-ui {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--toggle-off);
  position: relative;
  flex: 0 0 auto;
  margin-top: 0.1rem;
  transition: background 0.18s ease;
}

.toggle-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: transform 0.18s ease;
}

.toggle input:checked + .toggle-ui {
  background: rgba(45, 212, 191, 0.35);
}

.toggle input:checked + .toggle-ui::after {
  transform: translateX(18px);
  background: var(--accent);
}

.toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.toggle-text strong {
  font-size: 0.88rem;
  font-weight: 600;
}

.toggle-text small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
  max-width: 36rem;
}

.btn-primary,
.btn-secondary {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  border-radius: 10px;
  padding: 0.78rem 1.15rem;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn-primary {
  color: #041016;
  background: linear-gradient(135deg, var(--accent), #5eead4);
}

.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-secondary {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line-strong);
}

.btn-secondary:hover {
  border-color: rgba(103, 232, 249, 0.45);
  background: rgba(103, 232, 249, 0.06);
}

.btn-secondary:disabled { opacity: 0.55; cursor: not-allowed; }

.status-line {
  margin: 0;
  padding: 0 1.05rem 1rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.status-warn {
  color: var(--fail);
  font-size: 0.78rem;
}

.audit-status,
.slides-status {
  margin: 0 1.05rem 1rem;
}

.slides-progress-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-bg);
  padding: 0.85rem 1rem;
}

.slides-progress-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.slides-spinner {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-top-color: var(--accent);
  animation: slides-spin 0.7s linear infinite;
  flex: 0 0 auto;
}

.slides-progress-phase {
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  flex: 1 1 auto;
  min-width: 0;
}

.slides-progress-hint {
  font-family: var(--font);
  font-size: 0.78rem;
  color: var(--muted);
  flex: 0 0 auto;
  white-space: nowrap;
  opacity: 0.9;
}

.slides-progress-elapsed {
  font-family: var(--font);
  font-size: 0.82rem;
  color: var(--muted);
  flex: 0 0 auto;
}

.slides-pace-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px dashed color-mix(in srgb, var(--line) 80%, transparent);
}

.slides-pace-line-soft {
  color: var(--muted);
  font-size: 0.8rem;
}

.cat-fun-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--soft-bg);
  border-radius: 999px;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.cat-fun-btn-idle {
  animation: cat-btn-nudge 1.8s ease-in-out infinite;
}

.cat-fun-btn:hover {
  transform: scale(1.08);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-dim);
  animation: none;
}

.cat-fun-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  animation: none;
}

@keyframes cat-btn-nudge {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  12% { transform: translateY(-2px) rotate(-6deg) scale(1.04); }
  24% { transform: translateY(0) rotate(5deg) scale(1.02); }
  36% { transform: translateY(-1px) rotate(-3deg) scale(1.03); }
  48%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
}

.cat-face {
  display: block;
}

.cat-fun-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.cat-fun-overlay[hidden] {
  display: none !important;
}

.cat-fun-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 15, 0.55);
  backdrop-filter: blur(2px);
}

.cat-fun-stage {
  position: relative;
  z-index: 1;
  width: min(22rem, 100%);
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.1rem 1.1rem;
  text-align: center;
}

.cat-fun-close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.45rem;
}

.cat-fun-scene {
  min-height: 9.5rem;
  display: grid;
  place-items: center;
  margin: 0.35rem 0 0.7rem;
}

.cat-fun-caption {
  margin: 0;
  font-family: var(--font);
  font-size: 0.92rem;
  color: var(--text-soft);
}

.cat-anim {
  position: relative;
  width: 8rem;
  height: 8rem;
  display: grid;
  place-items: center;
}

.cat-anim-body {
  width: 5.5rem;
  height: 5.5rem;
  z-index: 1;
}

/* Pet: hand strokes + hearts */
.cat-anim-pet .cat-anim-body {
  animation: cat-pet-bob 1.1s ease-in-out infinite;
}

.cat-hand {
  position: absolute;
  top: 0.2rem;
  left: 0.4rem;
  font-size: 1.7rem;
  z-index: 2;
  transform-origin: 70% 70%;
  animation: cat-pet-hand 1.1s ease-in-out infinite;
}

.cat-heart {
  position: absolute;
  color: #fb7185;
  font-size: 1rem;
  opacity: 0;
  animation: cat-heart-rise 1.4s ease-out infinite;
}

.cat-heart.h1 { left: 1.1rem; animation-delay: 0s; }
.cat-heart.h2 { left: 3.4rem; animation-delay: 0.35s; }
.cat-heart.h3 { left: 5.4rem; animation-delay: 0.7s; }

@keyframes cat-pet-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(4px) rotate(2deg); }
}

@keyframes cat-pet-hand {
  0%, 100% { transform: translate(0, 0) rotate(-18deg); }
  50% { transform: translate(18px, 10px) rotate(12deg); }
}

@keyframes cat-heart-rise {
  0% { opacity: 0; transform: translateY(18px) scale(0.6); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-42px) scale(1.15); }
}

/* Spank: playful slap */
.cat-anim-spank .cat-butt {
  position: relative;
  font-size: 4.2rem;
  line-height: 1;
  animation: cat-spank-wiggle 0.55s ease-in-out infinite;
}

.cat-butt-tail {
  position: absolute;
  right: -0.55rem;
  top: 0.35rem;
  font-size: 1.4rem;
  color: var(--accent);
  animation: cat-tail-swish 0.55s ease-in-out infinite;
}

.cat-spank-hand {
  position: absolute;
  right: -0.2rem;
  top: 1.1rem;
  font-size: 2rem;
  z-index: 2;
  transform-origin: 80% 20%;
  animation: cat-spank-hand 0.55s ease-in-out infinite;
}

.cat-bonk {
  position: absolute;
  top: 0.15rem;
  left: 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--warn);
  opacity: 0;
  animation: cat-bonk-pop 0.55s ease-in-out infinite;
}

@keyframes cat-spank-wiggle {
  0%, 100% { transform: rotate(0deg) translateX(0); }
  40% { transform: rotate(-8deg) translateX(-4px); }
  55% { transform: rotate(10deg) translateX(6px); }
}

@keyframes cat-spank-hand {
  0%, 100% { transform: rotate(25deg) translate(8px, -6px); }
  45% { transform: rotate(-20deg) translate(-10px, 8px); }
}

@keyframes cat-tail-swish {
  0%, 100% { transform: rotate(10deg); }
  50% { transform: rotate(-25deg); }
}

@keyframes cat-bonk-pop {
  0%, 35%, 100% { opacity: 0; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* Dance: glasses + notes */
.cat-anim-dance .cat-anim-body {
  animation: cat-dance-bounce 0.55s ease-in-out infinite;
}

.cat-glasses {
  position: absolute;
  top: 1.55rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.55rem;
  z-index: 2;
  animation: cat-dance-bounce 0.55s ease-in-out infinite;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.25));
}

.cat-note {
  position: absolute;
  color: var(--accent-2);
  font-size: 1.1rem;
  animation: cat-note-float 1.2s ease-in-out infinite;
}

.cat-note.n1 { left: 0.3rem; top: 1.2rem; animation-delay: 0s; }
.cat-note.n2 { right: 0.35rem; top: 0.6rem; animation-delay: 0.25s; }
.cat-note.n3 { left: 1.4rem; bottom: 0.4rem; animation-delay: 0.5s; }

@keyframes cat-dance-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-6deg); }
  50% { transform: translateX(-50%) translateY(-10px) rotate(6deg); }
}

.cat-anim-dance .cat-anim-body {
  animation-name: cat-dance-bounce-body;
}

@keyframes cat-dance-bounce-body {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-10px) rotate(6deg); }
}

@keyframes cat-note-float {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-8px); }
}

@media (max-width: 640px) {
  .slides-progress-head {
    flex-wrap: wrap;
  }
  .slides-progress-hint {
    order: 3;
    width: 100%;
    margin-left: 1.5rem;
  }
}

.slides-progress-bar {
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 80%, transparent);
  overflow: hidden;
  margin-bottom: 0.55rem;
}

.slides-progress-bar > i {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent) 35%, transparent),
    var(--accent),
    color-mix(in srgb, var(--accent) 35%, transparent)
  );
  animation: slides-indeterminate 1.35s ease-in-out infinite;
}

.slides-progress-msg {
  margin: 0;
  font-family: var(--font);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-line;
}

.audit-status.is-done .slides-progress-card,
.slides-status.is-done .slides-progress-card {
  border-color: color-mix(in srgb, var(--ok) 35%, var(--line));
}

.audit-status.is-error .slides-progress-card,
.slides-status.is-error .slides-progress-card {
  border-color: color-mix(in srgb, var(--fail) 40%, var(--line));
}

.audit-status.is-done .slides-progress-msg,
.audit-status.is-error .slides-progress-msg,
.slides-status.is-done .slides-progress-msg,
.slides-status.is-error .slides-progress-msg {
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
}

@keyframes slides-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes slides-indeterminate {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .slides-spinner,
  .slides-progress-bar > i {
    animation: none;
  }

  .slides-progress-bar > i {
    width: 100%;
    transform: none;
    opacity: 0.65;
  }
}

.results {
  margin-top: 1rem;
  padding: 1rem 1.05rem 1.1rem;
  animation: rise 0.45s ease both;
}

.results-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.results-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.results-toolbar h2 {
  margin: 0.2rem 0 0;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.results-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-bg);
  padding: 0.85rem 0.9rem;
}

.card-block h3 {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.card-block p {
  margin: 0.3rem 0;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.score {
  display: inline-flex;
  margin-bottom: 0.55rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
}

.check-list,
.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.check-list li,
.plain-list li {
  margin: 0.28rem 0;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  background: var(--list-item-bg);
  border: 1px solid var(--list-item-border);
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.4;
}

.plain-list li strong {
  color: var(--text);
  font-weight: 600;
}

.plain-list .meta {
  color: var(--muted);
  font-size: 0.82em;
}

.badge {
  display: inline-block;
  min-width: 3rem;
  margin-right: 0.35rem;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  text-align: center;
  color: #041016;
}

.badge.pass { background: var(--ok); }
.badge.warn { background: var(--warn); }
.badge.fail,
.badge.error,
.badge.high { background: var(--fail); color: #1f0a10; }
.badge.medium { background: var(--warn); }
.badge.low { background: #94a3b8; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .upload-grid { grid-template-columns: 1fr; }
  .competitor-row {
    flex-direction: column;
    align-items: stretch;
  }
  .upload-card.compact { width: 100%; }
  .intro h1 {
    max-width: none;
    white-space: normal;
    font-size: 1.15rem;
  }
  .panel-footer { align-items: stretch; }
  .btn-primary { width: 100%; }
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.65rem;
  margin-top: 0.45rem;
}

.model-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft-bg);
  padding: 0.7rem 0.75rem;
}

.model-head {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.45rem;
}

.model-head strong {
  font-size: 0.9rem;
  color: var(--accent-2);
}

.model-head span {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
}

.model-block .plain-list li {
  margin: 0.2rem 0;
  padding: 0.35rem 0.45rem;
  font-size: 0.8rem;
}

.block-note {
  margin: 0 0 0.75rem !important;
  color: var(--muted) !important;
  font-size: 0.82rem !important;
}

.subhead {
  margin: 1rem 0 0.55rem !important;
  font-size: 0.88rem !important;
  color: var(--text);
}

.metric-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.metric-stack .table-wrap {
  margin: 0;
}

.metric-panel {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.metric-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.metric-panel-head .subhead {
  margin: 0 !important;
}

.section-mass-title {
  margin-top: 1.15rem !important;
}

.chart-toggle {
  appearance: none;
  flex: 0 0 auto;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.chart-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.chart-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.chart-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  padding: 0.75rem 0.85rem 0.85rem;
}

html[data-theme="dark"] .chart-panel {
  background: var(--bg-elevated);
}

.chart-canvas {
  width: 100%;
}

.chart-units {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1rem;
  margin-top: 0.65rem;
  align-items: start;
}

.chart-unit:only-child {
  grid-column: 1 / -1;
}

.chart-unit {
  min-width: 0;
}

.chart-unit-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
  position: relative;
  min-height: 1.6rem;
  padding-inline: 2.2rem 2.8rem;
}

.chart-unit:only-child .chart-unit-head {
  padding-inline: 0 2.8rem;
}

.chart-unit-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.chart-unit-actions {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

@media (hover: hover) and (pointer: fine) {
  .chart-unit-actions {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
  }

  .chart-unit:hover .chart-unit-actions,
  .chart-unit:focus-within .chart-unit-actions {
    opacity: 1;
    pointer-events: auto;
  }
}

.chart-copy,
.chart-copy-tag {
  appearance: none;
  position: static;
  transform: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.chart-copy-tag-icon {
  font-family: var(--mono, ui-monospace, Consolas, monospace);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
}

@media (max-width: 620px) {
  .chart-units {
    grid-template-columns: 1fr;
  }

  .chart-unit-head {
    padding-inline: 0 2.8rem;
    justify-content: flex-start;
  }

  .chart-unit-title {
    text-align: left;
  }
}

.chart-copy:hover,
.chart-copy-tag:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-dim);
}

.chart-copy.is-copied,
.chart-copy-tag.is-copied {
  border-color: var(--ok);
  color: var(--ok);
}

.chart-unit svg {
  display: block;
  margin-inline: auto;
  max-width: 100%;
}

.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-axis-label {
  fill: var(--muted);
  font-size: 10px;
  font-family: var(--font);
}

.chart-legend {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.35rem 0.55rem;
  margin-top: 0.45rem;
  overflow: hidden;
  max-width: 100%;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-soft);
  font-size: 0.72rem;
  white-space: nowrap;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.chart-legend-swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 3px;
  display: inline-block;
}

.chart-legend-star {
  flex: 0 0 auto;
  width: 0.72rem;
  height: 0.72rem;
  background: #facc15;
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
}

.ahrefs-block .data-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}

.ahrefs-block .data-table thead th:first-child,
.ahrefs-block .data-table tbody th:first-child,
.ahrefs-block .data-table tbody th[scope="row"] {
  width: 15.5rem;
  min-width: 15.5rem;
  max-width: 15.5rem;
  white-space: normal;
  line-height: 1.35;
  word-break: break-word;
}

.ahrefs-block .data-table thead th:not(:first-child),
.ahrefs-block .data-table tbody td {
  width: auto;
  min-width: 4.75rem;
}

.ahrefs-block .data-table thead th.col-target {
  min-width: 7.25rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--table-bg);
}

.table-unit {
  position: relative;
}

.table-unit-actions {
  position: absolute;
  right: 0.45rem;
  top: 0.45rem;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

@media (hover: hover) and (pointer: fine) {
  .table-unit-actions {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
  }

  .table-unit:hover .table-unit-actions,
  .table-unit:focus-within .table-unit-actions {
    opacity: 1;
    pointer-events: auto;
  }
}

.descr-unit {
  position: relative;
  margin-top: 0.15rem;
  padding: 0.7rem 2.4rem 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft-bg);
}

.descr-unit-actions {
  position: absolute;
  right: 0.45rem;
  top: 0.45rem;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

@media (hover: hover) and (pointer: fine) {
  .descr-unit-actions {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
  }

  .descr-unit:hover .descr-unit-actions,
  .descr-unit:focus-within .descr-unit-actions {
    opacity: 1;
    pointer-events: auto;
  }
}

.descr-comment {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
}

.ahrefs-overview-panel {
  margin-top: 1rem;
}

.descr-unit-overview {
  background: var(--accent-dim);
  border-color: rgba(45, 212, 191, 0.35);
}

.overview-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.overview-body .overview-line {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.overview-body .overview-line strong {
  font-weight: 700;
  color: var(--text);
}

.overview-body .overview-list {
  margin: 0.15rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.overview-body .overview-list li {
  margin: 0.2rem 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  font-size: 0.82rem;
}

.data-table th,
.data-table td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid rgba(125, 211, 252, 0.08);
  text-align: right;
  white-space: nowrap;
}

.data-table thead th {
  background: var(--table-head);
  color: var(--muted);
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tbody th,
.data-table thead th:first-child {
  text-align: left;
  color: var(--text);
  font-weight: 500;
  position: sticky;
  left: 0;
  background: var(--table-sticky);
  z-index: 2;
}

.data-table thead th:first-child {
  z-index: 3;
}

.data-table tbody tr:hover td,
.data-table tbody tr:hover th {
  background: rgba(45, 212, 191, 0.05);
}

.data-table .col-target {
  color: var(--accent);
  font-weight: 600;
  background: rgba(45, 212, 191, 0.04);
}

.data-table thead .col-target {
  color: var(--accent);
}

.data-table tr.row-undetermined th,
.data-table tr.row-undetermined td {
  color: var(--muted);
  font-style: italic;
}

.metric-table .metric-section th {
  background: var(--soft-bg);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  padding-top: 0.7rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line-strong);
}

.metric-table tr.metric-group-start th,
.metric-table tr.metric-group-start td {
  border-top: 1px solid rgba(15, 118, 110, 0.22);
}

html[data-theme="dark"] .metric-table tr.metric-group-start th,
html[data-theme="dark"] .metric-table tr.metric-group-start td {
  border-top-color: rgba(45, 212, 191, 0.28);
}

.metric-table tr.metric-group-end th,
.metric-table tr.metric-group-end td {
  border-bottom: 1px solid rgba(15, 118, 110, 0.22);
}

.metric-table tr[class*="metric-group-"] th,
.metric-table tr[class*="metric-group-"] td {
  background: rgba(15, 118, 110, 0.045);
}

html[data-theme="dark"] .metric-table tr[class*="metric-group-"] th,
html[data-theme="dark"] .metric-table tr[class*="metric-group-"] td {
  background: rgba(45, 212, 191, 0.07);
}

.metric-table tr.metric-solo th,
.metric-table tr.metric-solo td {
  background: rgba(14, 116, 144, 0.05);
  border-top: 1px solid rgba(14, 116, 144, 0.2);
  border-bottom: 1px solid rgba(14, 116, 144, 0.2);
}

html[data-theme="dark"] .metric-table tr.metric-solo th,
html[data-theme="dark"] .metric-table tr.metric-solo td {
  background: rgba(125, 211, 252, 0.07);
  border-top-color: rgba(125, 211, 252, 0.22);
  border-bottom-color: rgba(125, 211, 252, 0.22);
}

.metric-table tr.metric-group-spam th,
.metric-table tr.metric-group-spam td {
  background: rgba(190, 18, 60, 0.045);
}

.metric-table tr.metric-group-spam.metric-group-start th,
.metric-table tr.metric-group-spam.metric-group-start td {
  border-top-color: rgba(190, 18, 60, 0.22);
}

.metric-table tr.metric-group-spam.metric-group-end th,
.metric-table tr.metric-group-spam.metric-group-end td {
  border-bottom-color: rgba(190, 18, 60, 0.22);
}

html[data-theme="dark"] .metric-table tr.metric-group-spam th,
html[data-theme="dark"] .metric-table tr.metric-group-spam td {
  background: rgba(251, 113, 133, 0.08);
}

.th-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 0.15rem;
}

.th-domain {
  display: block;
  color: inherit;
  font-size: 0.8rem;
}

.th-domain-target {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  max-width: 100%;
  white-space: normal;
}

.th-domain-target .chart-legend-star {
  flex: 0 0 auto;
  width: 0.7rem;
  height: 0.7rem;
}

.th-domain-target .th-domain-text {
  min-width: 0;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  line-height: 1.25;
  word-break: normal;
  overflow-wrap: anywhere;
}

.tabs {
  display: inline-flex;
  gap: 0.35rem;
  margin: 0 0 1.1rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--chip-bg);
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.55rem 0.9rem;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.tab:hover { color: var(--text); }

.tab.is-active {
  background: var(--accent-dim);
  color: var(--accent);
}

.tab-panel[hidden] { display: none !important; }

/* /placeholders: show catalog before/without ui.js (and while JS boots) */
html[data-page="placeholders"] #tab-audit {
  display: none !important;
}
html[data-page="placeholders"] #tab-placeholders {
  display: block !important;
}
html[data-page="placeholders"] #tab-placeholders[hidden] {
  display: block !important;
}
html[data-page="placeholders"] #tab-link-audit.is-active {
  background: transparent;
  color: var(--muted);
}
html[data-page="placeholders"] #tab-link-placeholders {
  background: var(--accent-dim);
  color: var(--accent);
}

.placeholders-panel {
  padding: 1rem 1.05rem 1.1rem;
}

.placeholders-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.placeholders-toolbar input[type="search"] {
  flex: 1 1 240px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.65rem 0.8rem;
  outline: none;
}

.placeholders-toolbar input[type="search"]:focus {
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.copy-toast {
  margin: 0;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  background: rgba(4, 120, 87, 0.14);
  border: 1px solid rgba(4, 120, 87, 0.35);
  color: var(--ok);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  animation: copy-toast-in 0.2s ease;
}

html[data-theme="dark"] .copy-toast {
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
}

@keyframes copy-toast-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.placeholders-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ph-group-title {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.ph-row {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-bg);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.ph-row:hover {
  border-color: rgba(45, 212, 191, 0.35);
  background: var(--accent-dim);
}

.ph-tag {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-2);
  word-break: break-all;
}

.ph-desc {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.4;
}

.ph-copy {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
  min-width: 7.5rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ph-copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ph-copy.is-copied {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.ph-row.copied {
  border-color: var(--ok);
  background: rgba(4, 120, 87, 0.1);
  box-shadow: 0 0 0 2px rgba(4, 120, 87, 0.2);
}

html[data-theme="dark"] .ph-row.copied {
  background: rgba(52, 211, 153, 0.14);
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.22);
}

.ph-row.copied .ph-tag {
  color: var(--ok);
}

@media (max-width: 720px) {
  .ph-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .ph-copy { justify-self: start; }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--muted);
  font: inherit;
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.35rem 0.65rem 0.35rem 0.45rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.theme-toggle-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15);
}

html[data-theme="light"] .theme-toggle-icon {
  background: linear-gradient(135deg, #0f766e, #f59e0b);
}

.theme-toggle-label::before {
  content: "Тёмная";
}

html[data-theme="light"] .theme-toggle-label::before {
  content: "Светлая";
}

.theme-toggle-label {
  font-size: 0;
}

.theme-toggle-label::before {
  font-size: 0.7rem;
}

.color-picker {
  position: relative;
  z-index: 60;
}

.color-picker-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--muted);
  font: inherit;
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.35rem 0.65rem 0.35rem 0.45rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.color-picker-toggle:hover,
.color-picker-toggle[aria-expanded="true"] {
  border-color: var(--line-strong);
  color: var(--text);
}

.color-picker-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--chart-primary, var(--accent));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  flex: 0 0 auto;
}

.color-picker-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 100;
  min-width: 11.5rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  max-height: min(70vh, 22rem);
  overflow: auto;
}

.color-picker-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  text-align: left;
}

.color-picker-option:hover,
.color-picker-option[aria-selected="true"] {
  background: var(--accent-dim);
  color: var(--text);
}

.color-picker-option-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.color-picker-sep {
  height: 1px;
  margin: 0.35rem 0.4rem;
  background: var(--line);
  list-style: none;
}

.color-picker-sample-swatch {
  background:
    conic-gradient(
      from 90deg,
      #dc2626,
      #ca8a04,
      #15803d,
      #1d4ed8,
      #7c3aed,
      #db2777,
      #dc2626
    );
}

.color-sample-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(92vw, 52rem);
  width: 100%;
}

.color-sample-dialog::backdrop {
  background: rgba(10, 14, 18, 0.62);
  backdrop-filter: blur(2px);
}

.color-sample-panel {
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem 1.05rem;
  color: var(--text);
}

.color-sample-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.color-sample-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.color-sample-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 8px;
}

.color-sample-close:hover {
  color: var(--text);
  background: var(--accent-dim);
}

.color-sample-hint {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.color-sample-hint kbd {
  font-family: var(--mono);
  font-size: 0.78em;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.05rem 0.3rem;
  background: var(--chip-bg);
}

.color-sample-stage {
  position: relative;
  min-height: 14rem;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 88%, var(--chip-bg));
  overflow: hidden;
  display: grid;
  place-items: center;
  outline: none;
}

.color-sample-stage:focus-visible {
  border-color: var(--accent);
}

.color-sample-canvas {
  display: block;
  max-width: 100%;
  max-height: 420px;
  width: auto;
  height: auto;
  cursor: crosshair;
}

.color-sample-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  padding: 1.5rem;
  pointer-events: none;
}

.color-sample-empty span {
  display: inline-block;
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}

.color-sample-loupe {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 6px 16px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 2;
  transform: translate(-50%, -50%);
}

.color-sample-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.75rem;
  min-height: 1.6rem;
}

.color-sample-preview {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  flex: 0 0 auto;
  background: transparent;
}

.color-sample-hex {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text);
}

.color-sample-meta-note {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
}

.color-sample-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.summary-pre {
  white-space: pre-wrap;
  font: inherit;
  margin: 0;
  color: var(--text-soft);
}
