/* =============================================================
   TinyTools landing — styles layered on Improve Digital tokens
   ============================================================= */

:root {
  /* Playful category tints */
  --tt-pdf:       #7c3aed;   /* purple */
  --tt-pdf-soft:  #efe8ff;
  --tt-image:     #ea580c;   /* orange */
  --tt-image-soft:#ffede0;
  --tt-conv:      #0e9488;   /* teal */
  --tt-conv-soft: #d9f5f1;
  --tt-file:      #2563eb;   /* blue */
  --tt-file-soft: #e4ecff;

  --tt-highlight: #ea580c;

  /* Card style toggle (set by Tweaks): flat | gradient | outline */
  --tt-card-radius: 14px;

  /* Hero canvas background */
  --tt-hero-bg: radial-gradient(1200px 600px at 50% -10%, color-mix(in oklab, var(--id-brand-blue) 8%, transparent), transparent 60%), var(--id-bg);
}

:root[data-theme="dark"] {
  --tt-pdf-soft:  #2a1e45;
  --tt-image-soft:#3a1d0f;
  --tt-conv-soft: #0f2b28;
  --tt-file-soft: #162749;
  --tt-hero-bg: radial-gradient(1200px 600px at 50% -10%, color-mix(in oklab, var(--id-brand-blue) 18%, transparent), transparent 60%), var(--id-bg);
}

body {
  font-size: 15px;
  background: var(--tt-hero-bg);
  min-height: 100vh;
}

/* ---------- Utility ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--id-text-muted); }
.stack > * + * { margin-top: var(--g, 12px); }
button { font: inherit; }

/* ---------- Top nav ---------- */
.nav-top {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklab, var(--id-surface) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--id-border);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--id-text); }
.brand-logo .mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  display: grid; place-items: center; color: white; font-weight: 700;
  box-shadow: 0 6px 16px -6px color-mix(in oklab, #2563eb 70%, transparent);
}
.brand-logo .name { font-weight: 800; font-size: 18px; letter-spacing: -0.01em; line-height: 1; }
.brand-logo .name small { display: block; font-size: 10px; font-weight: 500; color: var(--id-text-muted); letter-spacing: 0.05em; margin-top: 2px; text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 14px;
  color: var(--id-text); cursor: pointer; position: relative;
  background: transparent; border: none;
}
.nav-link:hover { background: var(--id-surface-sunken); text-decoration: none; }
.nav-link svg { opacity: 0.6; }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--id-border); background: var(--id-surface);
  color: var(--id-text); cursor: pointer; transition: all 180ms var(--id-ease);
}
.icon-btn:hover { background: var(--id-surface-sunken); border-color: var(--id-border-strong); }

.nav-search {
  display: flex; align-items: center; gap: 8px; height: 36px;
  padding: 0 12px; border-radius: 10px;
  background: var(--id-surface-sunken); border: 1px solid transparent;
  min-width: 220px; transition: all 180ms var(--id-ease);
}
.nav-search:focus-within { background: var(--id-surface); border-color: var(--id-brand-blue); box-shadow: var(--id-shadow-focus); }
.nav-search input { background: transparent; border: none; outline: none; flex: 1; font-size: 14px; color: var(--id-text); }
.nav-search svg { color: var(--id-text-muted); }

.btn-signin {
  height: 36px; padding: 0 16px; border-radius: 10px;
  background: var(--id-brand-blue); color: white; border: none;
  font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background 180ms var(--id-ease);
}
.btn-signin:hover { background: var(--id-brand-blue-hover); }

/* Nav dropdown */
.nav-dropdown {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(-4px);
  width: 520px; padding: 14px;
  background: var(--id-surface); border: 1px solid var(--id-border);
  border-radius: 14px; box-shadow: var(--id-shadow-lg);
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px;
  opacity: 0; pointer-events: none; transition: all 180ms var(--id-ease);
}
.nav-link.open .nav-dropdown { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.nav-dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border-radius: 8px; cursor: pointer; color: var(--id-text); font-weight: 500;
}
.nav-dropdown-item:hover { background: var(--id-surface-sunken); }
.nav-dropdown-item .dot { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }

/* ---------- Recent bar ---------- */
.recent-bar { display: flex; align-items: center; gap: 14px; padding: 14px 0 0; font-size: 13px; }
.recent-bar .label { font-weight: 700; color: var(--id-text); }
.recent-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px;
  background: var(--id-brand-blue-soft); color: var(--id-brand-blue);
  border-radius: 999px; font-weight: 600; font-size: 12px; cursor: pointer;
  border: 1px solid color-mix(in oklab, var(--id-brand-blue) 20%, transparent);
}
.recent-chip:hover { background: color-mix(in oklab, var(--id-brand-blue) 12%, var(--id-surface)); }

/* ---------- Hero ---------- */
.hero { padding: 48px 0 24px; position: relative; }
.hero-title {
  font-size: clamp(40px, 6vw, 72px); font-weight: 800;
  line-height: 1.02; letter-spacing: -0.035em;
  text-align: center; margin: 0 auto 20px; max-width: 900px;
  text-wrap: balance;
}
.hero-title .hl {
  display: inline-block; padding: 0 16px;
  background: var(--tt-highlight); color: white;
  border-radius: 8px;
  transform: rotate(-1.2deg);
  margin: 0 4px;
}
.hero-sub {
  text-align: center; font-size: 18px; color: var(--id-text-muted);
  max-width: 560px; margin: 0 auto 12px; line-height: 1.5;
}

/* Decorative floaters around hero */
.hero-deco { position: absolute; pointer-events: none; inset: 0; overflow: visible; }
.hero-deco span { position: absolute; display: block; }
.hero-deco .d1 { top: 10%; left: 8%; width: 18px; height: 18px; background: #fbbf24; transform: rotate(20deg); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.hero-deco .d2 { top: 20%; right: 10%; width: 14px; height: 14px; background: #ec4899; border-radius: 4px; transform: rotate(15deg); }
.hero-deco .d3 { top: 40%; left: 16%; width: 10px; height: 10px; background: #22c55e; border-radius: 999px; }
.hero-deco .d4 { top: 70%; right: 14%; width: 12px; height: 12px; background: #60a5fa; border-radius: 999px; }
.hero-deco .d5 { top: 60%; left: 6%; width: 16px; height: 16px; background: #a78bfa; border-radius: 3px; transform: rotate(25deg); }
.hero-deco .d6 { top: 28%; right: 22%; width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 16px solid #f59e0b; }
.hero-deco .d7 { top: 78%; left: 40%; width: 22px; height: 22px; background: linear-gradient(135deg, #a78bfa, #60a5fa); border-radius: 4px; transform: rotate(45deg); box-shadow: 0 6px 16px -4px rgba(124,58,237,.4); }

/* ---------- Category cards (big hero row) ---------- */
.cat-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  margin: 40px 0 0;
}
.cat-card {
  position: relative; cursor: pointer;
  border-radius: 20px; overflow: hidden;
  padding: 22px; min-height: 200px;
  display: flex; flex-direction: column; justify-content: space-between;
  color: white; background: var(--cat-bg, #2563eb);
  box-shadow: 0 10px 28px -14px color-mix(in oklab, var(--cat-bg, #2563eb) 60%, transparent);
  transition: transform 280ms var(--id-ease), box-shadow 280ms var(--id-ease);
  isolation: isolate;
}
.cat-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(140deg, var(--cat-bg) 0%, color-mix(in oklab, var(--cat-bg) 75%, black) 100%);
}
.cat-card::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px;
  border-radius: 50%; background: rgba(255,255,255,0.08);
  z-index: -1;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -16px color-mix(in oklab, var(--cat-bg, #2563eb) 70%, transparent); }
.cat-card .cat-head { display: flex; align-items: flex-start; justify-content: space-between; }
.cat-card .cat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,255,255,0.18);
  display: grid; place-items: center; color: white;
  backdrop-filter: blur(4px);
}
.cat-card .cat-count {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
  background: rgba(0,0,0,0.22); border-radius: 999px; font-size: 11px; font-weight: 600;
}
.cat-card .cat-title { font-size: 22px; font-weight: 800; letter-spacing: -0.015em; margin-top: 24px; }
.cat-card .cat-sub { font-size: 13px; opacity: 0.85; margin-top: 2px; }
.cat-card .cat-arrow {
  position: absolute; right: 18px; bottom: 18px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.2); display: grid; place-items: center;
  color: white; transition: transform 220ms var(--id-ease), background 220ms;
}
.cat-card:hover .cat-arrow { transform: translateX(3px); background: rgba(255,255,255,0.35); }
.cat-card .cat-featured {
  position: relative;
  margin-top: 16px;
  background: var(--id-surface); color: var(--id-text);
  border-radius: 12px; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px;
}
.cat-card .cat-featured .lab { color: var(--id-text-muted); font-weight: 600; }
.cat-card .cat-featured .tool { color: var(--cat-bg); font-weight: 700; }

/* ---------- Popular tools section ---------- */
.popular { padding: 72px 0 48px; }
.popular-head { text-align: center; margin-bottom: 36px; }
.popular-head h2 { font-size: clamp(32px, 4vw, 44px); font-weight: 800; letter-spacing: -0.025em; margin: 0 0 8px; }
.popular-head p { color: var(--id-text-muted); font-size: 16px; margin: 0; }

/* Filter pills */
.filter-row {
  display: flex; justify-content: center; margin: 0 auto 32px;
  background: var(--id-surface); border: 1px solid var(--id-border);
  border-radius: 999px; padding: 6px; gap: 2px;
  width: fit-content; box-shadow: var(--id-shadow-sm);
  flex-wrap: wrap;
}
.filter-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  font-weight: 600; font-size: 14px; cursor: pointer;
  background: transparent; border: none; color: var(--id-text-muted);
  transition: all 180ms var(--id-ease);
  white-space: nowrap;
}
.filter-pill:hover { color: var(--id-text); }
.filter-pill.active {
  background: var(--id-brand-blue); color: white;
  box-shadow: 0 4px 12px -4px color-mix(in oklab, var(--id-brand-blue) 60%, transparent);
}
.filter-pill .fpc-icon { display: grid; place-items: center; }

/* Tools grid */
.tools-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.tool-card {
  background: var(--id-surface);
  border: 1px solid var(--id-border);
  border-radius: var(--tt-card-radius);
  padding: 18px;
  cursor: pointer;
  transition: transform 180ms var(--id-ease), box-shadow 180ms var(--id-ease), border-color 180ms;
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 140px;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--id-shadow-md);
  border-color: var(--id-border-strong);
}

/* Card style: gradient — uses tint at low alpha so it reads on both light & dark */
.tool-card.tc-gradient {
  background:
    linear-gradient(140deg,
      color-mix(in oklab, var(--tc-tint) 14%, var(--id-surface)) 0%,
      var(--id-surface) 65%);
  border-color: color-mix(in oklab, var(--tc-tint) 22%, var(--id-border));
}
:root[data-theme="dark"] .tool-card.tc-gradient {
  background:
    linear-gradient(140deg,
      color-mix(in oklab, var(--tc-tint) 22%, var(--id-surface)) 0%,
      var(--id-surface) 70%);
  border-color: color-mix(in oklab, var(--tc-tint) 30%, var(--id-border));
}
.tool-card.tc-outline {
  border-color: color-mix(in oklab, var(--tc-tint) 40%, var(--id-border));
  border-width: 1.5px;
}
.tool-card .tc-head { display: flex; align-items: flex-start; gap: 12px; }
.tool-card .tc-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--tc-soft, var(--id-brand-blue-soft));
  color: var(--tc-tint, var(--id-brand-blue));
}
.tool-card .tc-name {
  font-size: 15px; font-weight: 700; color: var(--id-text); letter-spacing: -0.01em; line-height: 1.2;
}
.tool-card .tc-cat {
  font-size: 11px; font-weight: 600; color: var(--tc-tint);
  text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px;
}
.tool-card .tc-desc { font-size: 13px; color: var(--id-text-muted); line-height: 1.45; margin-top: 2px; flex: 1; }
.tool-card .tc-badge {
  position: absolute; top: 12px; right: 12px;
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  background: linear-gradient(135deg, #fbbf24, #ea580c); color: white;
  border-radius: 999px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* Empty state */
.empty-state { text-align: center; padding: 48px; color: var(--id-text-muted); grid-column: 1 / -1; }
.empty-state .em-icon { width: 48px; height: 48px; margin: 0 auto 12px; color: var(--id-text-subtle); }

/* ---------- Footer ---------- */
.footer {
  margin-top: 96px;
  background: var(--id-surface);
  border-top: 1px solid var(--id-border);
  padding: 56px 0 28px;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--id-text-muted); margin: 0 0 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li a { display: block; padding: 4px 0; color: var(--id-text); font-size: 14px; }
.footer-blurb { font-size: 13px; color: var(--id-text-muted); line-height: 1.55; margin-top: 12px; max-width: 280px; }
.footer-bottom { border-top: 1px solid var(--id-border); padding-top: 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--id-text-muted); font-size: 13px; }
.footer-social { display: flex; gap: 8px; }
.footer-links { display: inline-flex; align-items: center; gap: 8px; }
.footer-links a { color: var(--id-text-muted); text-decoration: none; transition: color .12s; }
.footer-links a:hover { color: var(--id-brand-blue); }
.footer-sep { opacity: 0.45; }

/* Static legal/contact pages */
.legal-shell {
  position: fixed; inset: 0; z-index: 90;
  background: var(--id-bg, var(--id-surface));
  overflow: auto; padding: 28px 20px 60px;
}
.legal-head {
  display: flex; align-items: flex-start; gap: 18px;
  max-width: 760px; margin: 0 auto 24px;
}
.legal-h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 4px; color: var(--id-text); }
.legal-sub { margin: 0; font-size: 13px; color: var(--id-text-muted); }
.legal-body { max-width: 760px; margin: 0 auto; color: var(--id-text); line-height: 1.65; font-size: 15px; }
.legal-body section { margin-bottom: 28px; }
.legal-body h2 { font-size: 19px; font-weight: 700; margin: 0 0 12px; color: var(--id-text); border-top: 1px solid var(--id-border); padding-top: 18px; }
.legal-body section:first-child h2 { border-top: 0; padding-top: 0; }
.legal-body p { margin: 0 0 10px; }
.legal-body ul { margin: 0 0 10px; padding-left: 22px; }
.legal-body li { margin-bottom: 6px; }
.legal-body code { background: var(--id-surface-alt); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.legal-body a { color: var(--id-brand-blue); }
.legal-foot {
  max-width: 760px; margin: 32px auto 0;
  padding-top: 20px; border-top: 1px solid var(--id-border);
  font-size: 13px; color: var(--id-text-muted);
}

/* Standardised tool error block (used via window.ToolError) */
.tool-error {
  display: flex; gap: 14px; padding: 16px;
  background: #fef3f2; border: 1px solid #fbcfc7; border-radius: 10px;
  color: #7a1f12;
}
[data-theme="dark"] .tool-error { background: rgba(200, 50, 31, 0.12); border-color: rgba(200, 50, 31, 0.3); color: #f7b3a8; }
.te-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: #c8321f; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.te-body { flex: 1; min-width: 0; }
.te-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.te-msg { font-size: 13px; word-break: break-word; }
.te-hint { font-size: 12px; opacity: 0.85; margin-top: 4px; }
.te-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.te-foot { margin-top: 10px; font-size: 12px; opacity: 0.75; }
.te-foot a { color: inherit; text-decoration: underline; }

/* Sign-in modal — single page (Google + email/password) */
.signin-body { display: flex; flex-direction: column; gap: 14px; }

.signin-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 14px;
  background: #fff; color: #1f1f1f;
  border: 1px solid #dadce0; border-radius: 8px;
  font: inherit; font-weight: 500; font-size: 14px;
  cursor: pointer;
  transition: background .12s, box-shadow .12s, border-color .12s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.signin-google:hover:not(:disabled) {
  background: #f8faff; border-color: #c8d6f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.signin-google:active:not(:disabled) { background: #eef2fb; }
.signin-google:disabled { opacity: 0.6; cursor: not-allowed; }
[data-theme="dark"] .signin-google { background: #fff; color: #1f1f1f; }

.signin-divider {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--id-text-muted);
  margin: 2px 0;
}
.signin-divider::before, .signin-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--id-border);
}

.signin-form { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.signin-cta { margin-top: 4px; justify-content: center; }

.signin-links {
  display: flex; gap: 8px; justify-content: center;
  font-size: 13px; flex-wrap: wrap;
}

.signin-info {
  margin-top: 4px; padding: 10px 12px;
  background: #e7f4ee; color: #10805a;
  border: 1px solid #b8e2cc; border-radius: 6px; font-size: 13px;
}
[data-theme="dark"] .signin-info { background: rgba(16,128,90,0.18); border-color: rgba(16,128,90,0.3); color: #5fd1a4; }

.signin-legal {
  margin-top: 4px; font-size: 11px; text-align: center; line-height: 1.5;
}

/* Language switcher (footer) */
.lang-switcher { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--id-text-muted); }
.lang-switcher-label { opacity: 0.7; }
.lang-switcher-sep { opacity: 0.45; }
.lang-switcher-btn {
  background: transparent; border: 0; padding: 2px 6px; cursor: pointer;
  font: inherit; color: var(--id-text-muted); letter-spacing: 0.04em; font-weight: 600;
  border-radius: 4px; transition: color .12s, background .12s;
}
.lang-switcher-btn:hover { color: var(--id-text); background: var(--id-surface-alt, rgba(127,127,127,0.08)); }
.lang-switcher-btn.active { color: var(--id-brand-blue); }
.lang-switcher-btn:focus-visible { outline: 2px solid var(--id-brand-blue); outline-offset: 2px; }

/* ---------- Modal (tool) ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: color-mix(in oklab, black 55%, transparent);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  padding: 24px; overflow-y: auto;
  animation: fadeIn 200ms var(--id-ease);
}
.modal {
  background: var(--id-surface); border-radius: 20px;
  width: 100%; max-width: 720px; max-height: 90vh;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5);
  animation: slideUp 280ms var(--id-ease);
}
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--id-border); display: flex; align-items: center; gap: 14px; }
.modal-head .mh-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.modal-head .mh-name { font-size: 20px; font-weight: 800; letter-spacing: -0.015em; line-height: 1.1; }
.modal-head .mh-desc { font-size: 13px; color: var(--id-text-muted); margin-top: 2px; }
.modal-head .mh-close { margin-left: auto; width: 36px; height: 36px; border-radius: 10px; border: none; background: var(--id-surface-sunken); display: grid; place-items: center; cursor: pointer; color: var(--id-text); }
.modal-head .mh-close:hover { background: var(--id-gray-200); }
.modal-head .mh-fav {
  width: 36px; height: 36px; border-radius: 10px;
  border: none; background: var(--id-surface-sunken);
  display: grid; place-items: center; cursor: pointer;
  color: var(--id-text-muted); transition: all 180ms var(--id-ease);
}
.modal-head .mh-fav:hover { color: var(--tt-highlight); background: color-mix(in oklab, var(--tt-highlight) 12%, var(--id-surface-sunken)); }
.modal-head .mh-fav.active { color: var(--tt-highlight); background: color-mix(in oklab, var(--tt-highlight) 18%, var(--id-surface-sunken)); }
.modal-body { padding: 28px 24px; overflow-y: auto; flex: 1; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--id-border-strong);
  border-radius: 16px; padding: 48px 24px;
  text-align: center; cursor: pointer;
  transition: all 200ms var(--id-ease);
  background: var(--id-surface-alt);
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--id-brand-blue);
  background: var(--id-brand-blue-soft);
}
.dropzone .dz-icon {
  width: 64px; height: 64px; border-radius: 16px;
  background: var(--id-brand-blue-soft); color: var(--id-brand-blue);
  display: grid; place-items: center; margin: 0 auto 14px;
}
.dropzone h3 { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.dropzone p { margin: 0; color: var(--id-text-muted); font-size: 13px; }
.dropzone .dz-btn {
  margin-top: 16px; display: inline-block;
  padding: 10px 20px; background: var(--id-brand-blue); color: white;
  border-radius: 10px; font-weight: 600; font-size: 14px;
}

/* Compress UI */
.cmp-slider-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.cmp-slider-row .cmp-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.cmp-slider-row .cmp-label .val { color: var(--id-brand-blue); font-variant-numeric: tabular-nums; }
input[type="range"].cmp-slider { width: 100%; accent-color: var(--id-brand-blue); height: 4px; }

.cmp-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.cmp-side { background: var(--id-surface-alt); border: 1px solid var(--id-border); border-radius: 12px; padding: 12px; text-align: center; }
.cmp-side .cmp-ttl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--id-text-muted); font-weight: 700; margin-bottom: 8px; }
.cmp-side img { width: 100%; height: 180px; object-fit: contain; border-radius: 8px; background: repeating-conic-gradient(#ffffff 0 25%, #f1f3f6 0 50%) 50%/20px 20px; }
.cmp-side .cmp-size { font-size: 18px; font-weight: 800; margin-top: 8px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.cmp-side.after .cmp-size { color: var(--id-success); }
.cmp-side .cmp-meta { font-size: 11px; color: var(--id-text-muted); margin-top: 2px; }

.cmp-stats { display: flex; gap: 10px; margin-top: 14px; }
.cmp-stat { flex: 1; background: var(--id-brand-blue-soft); color: var(--id-brand-blue); border-radius: 10px; padding: 10px 14px; text-align: center; }
.cmp-stat.success { background: var(--id-success-soft); color: var(--id-success); }
.cmp-stat .sv { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.cmp-stat .sl { font-size: 11px; font-weight: 600; opacity: 0.9; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 1px; }

.cmp-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 10px;
  font-weight: 600; font-size: 14px; cursor: pointer;
  border: 1px solid transparent; transition: all 180ms var(--id-ease);
}
.btn-primary { background: var(--id-brand-blue); color: white; border-color: var(--id-brand-blue); }
.btn-primary:hover { background: var(--id-brand-blue-hover); border-color: var(--id-brand-blue-hover); }
.btn-secondary { background: var(--id-surface); color: var(--id-text); border-color: var(--id-border-strong); }
.btn-secondary:hover { background: var(--id-surface-sunken); }

/* ---------- Coming soon panel inside modal for non-working tools ---------- */
.coming-soon { text-align: center; padding: 24px; }
.coming-soon .cs-icon {
  width: 80px; height: 80px; border-radius: 20px;
  display: grid; place-items: center; margin: 0 auto 16px;
  font-size: 36px;
}
.coming-soon h3 { margin: 0 0 8px; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.coming-soon p { margin: 0 auto; color: var(--id-text-muted); max-width: 360px; font-size: 14px; line-height: 1.5; }
.coming-soon .cs-hint {
  margin-top: 16px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--id-brand-blue); font-weight: 600;
  background: var(--id-brand-blue-soft); padding: 8px 14px; border-radius: 999px;
}

/* ---------- Mini tools (QR, password, counter, color picker) ---------- */
.mini-tool { display: block; }
.mini-grid { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
@media (max-width: 640px) { .mini-grid { grid-template-columns: 1fr; } }

.mini-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--id-text-muted); margin-bottom: 6px; }
.mini-input {
  width: 100%; font: inherit; font-size: 14px; color: var(--id-text);
  background: var(--id-surface-alt); border: 1px solid var(--id-border-strong);
  border-radius: 10px; padding: 10px 12px; outline: none;
  transition: border-color 180ms, box-shadow 180ms;
}
.mini-input:focus { border-color: var(--id-brand-blue); box-shadow: var(--id-shadow-focus); }
.mini-textarea { min-height: 110px; resize: vertical; font-family: var(--id-font-sans); line-height: 1.5; }
.mini-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.mini-field {}
.mini-color { width: 100%; height: 40px; border: 1px solid var(--id-border-strong); border-radius: 10px; background: none; cursor: pointer; padding: 3px; }

/* QR right column */
.qr-wrap { border: 1px solid var(--id-border); border-radius: 14px; padding: 16px; display: grid; place-items: center; }

/* Password */
.pw-display {
  display: flex; align-items: center; gap: 8px;
  background: var(--id-surface-alt); border: 1px solid var(--id-border-strong);
  border-radius: 12px; padding: 12px 14px;
}
.pw-text {
  flex: 1; font-family: var(--id-font-mono); font-size: 16px;
  color: var(--id-text); letter-spacing: 0.02em;
  word-break: break-all; min-height: 24px;
}
.pw-actions { display: flex; gap: 6px; }
.pw-strength { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; font-weight: 700; }
.pw-bar { flex: 1; height: 6px; background: var(--id-surface-sunken); border-radius: 999px; overflow: hidden; }
.pw-fill { height: 100%; border-radius: 999px; transition: width 220ms var(--id-ease), background 220ms; }
.pw-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.pw-opt { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; cursor: pointer; color: var(--id-text); }
.pw-opt input { width: 18px; height: 18px; accent-color: var(--id-brand-blue); }

/* Word counter */
.wc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.wc-stat { background: var(--id-surface-alt); border: 1px solid var(--id-border); border-radius: 12px; padding: 14px; text-align: center; }
.wc-v { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--id-text); font-variant-numeric: tabular-nums; }
.wc-l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--id-text-muted); font-weight: 700; margin-top: 2px; }

/* Color picker */
.cp-stage { border: 1px solid var(--id-border); border-radius: 12px; overflow: hidden; background: repeating-conic-gradient(#fff 0 25%, #f1f3f6 0 50%) 50% / 20px 20px; }
.cp-canvas { display: block; width: 100%; cursor: crosshair; }
.cp-picked { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 10px 14px; background: var(--id-surface-alt); border: 1px solid var(--id-border); border-radius: 12px; }
.cp-swatch { width: 48px; height: 48px; border-radius: 10px; border: 1px solid var(--id-border-strong); }
.cp-hex { font-family: var(--id-font-mono); font-size: 18px; font-weight: 700; color: var(--id-text); }
.cp-hint { font-size: 11px; color: var(--id-text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.cp-palette { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 8px; }
.cp-chip { aspect-ratio: 1 / 1; border-radius: 10px; border: 1px solid rgba(0,0,0,0.08); cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; position: relative; transition: transform 160ms; }
.cp-chip:hover { transform: scale(1.06); }
.cp-chip span { font-family: var(--id-font-mono); font-size: 10px; font-weight: 700; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.5); background: rgba(0,0,0,0.3); padding: 2px 5px; border-radius: 4px; }

/* ---------- Featured Tool (Tool of the Month) ---------- */
.featured-tool {
  position: relative;
  margin: 40px 0 0;
  padding: 36px 40px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 36px;
  align-items: center;
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  background:
    radial-gradient(420px 240px at 92% 10%, color-mix(in oklab, var(--tt-image) 22%, transparent), transparent 70%),
    linear-gradient(135deg,
      color-mix(in oklab, var(--tt-image) 8%, var(--id-surface)) 0%,
      var(--id-surface) 70%);
  border: 1px solid color-mix(in oklab, var(--tt-image) 28%, var(--id-border));
  box-shadow:
    0 1px 2px rgba(234, 88, 12, 0.06),
    0 24px 60px -28px color-mix(in oklab, var(--tt-image) 55%, transparent);
  transition: transform 0.22s var(--id-ease), box-shadow 0.22s var(--id-ease);
}
.featured-tool:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 2px rgba(234, 88, 12, 0.08),
    0 32px 72px -28px color-mix(in oklab, var(--tt-image) 70%, transparent);
}

.ft-label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--tt-image); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em;
  margin-bottom: 18px;
  box-shadow: 0 6px 14px -4px color-mix(in oklab, var(--tt-image) 65%, transparent);
}
.ft-title {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 800; letter-spacing: -0.025em; line-height: 1.05;
  margin: 0 0 14px;
  background: linear-gradient(135deg, var(--id-text) 0%, var(--tt-image) 130%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ft-desc {
  font-size: 15px; line-height: 1.55; color: var(--id-text-muted);
  margin: 0 0 22px; max-width: 460px;
}
.ft-ctas { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ft-btn {
  background: var(--tt-image); border-color: var(--tt-image); color: #fff;
  padding: 12px 22px; font-size: 14px; font-weight: 600;
  border-radius: 10px;
  box-shadow: 0 14px 28px -12px color-mix(in oklab, var(--tt-image) 75%, transparent);
}
.ft-btn:hover { background: color-mix(in oklab, var(--tt-image) 90%, black); border-color: color-mix(in oklab, var(--tt-image) 90%, black); }
.ft-meta {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--id-text-muted);
}

.ft-visual {
  position: relative;
  min-height: 220px;
  display: flex; align-items: center; justify-content: center;
}
.ft-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid color-mix(in oklab, var(--tt-image) 35%, transparent);
  animation: ft-pulse 3.2s ease-in-out infinite;
  pointer-events: none;
}
.ft-ring-1 { width: 140px; height: 140px; }
.ft-ring-2 { width: 200px; height: 200px; animation-delay: 0.8s; border-color: color-mix(in oklab, var(--tt-image) 22%, transparent); }
.ft-ring-3 { width: 260px; height: 260px; animation-delay: 1.6s; border-color: color-mix(in oklab, var(--tt-image) 14%, transparent); }
@keyframes ft-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.96); }
  50%      { opacity: 1;   transform: scale(1.04); }
}
.ft-core {
  width: 108px; height: 108px; border-radius: 50%;
  background: var(--tt-image); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 24px 56px -18px color-mix(in oklab, var(--tt-image) 75%, transparent),
    inset 0 -6px 20px rgba(0, 0, 0, 0.12);
  position: relative; z-index: 1;
}
.ft-chip {
  position: absolute; z-index: 2;
  padding: 5px 11px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  background: var(--id-surface); color: var(--id-text);
  border: 1px solid var(--id-border);
  box-shadow: var(--id-shadow-sm);
  white-space: nowrap;
}
.ft-chip-top { top: 14%; right: 6%; }
.ft-chip-bot { bottom: 14%; left: 4%; background: var(--tt-image); color: #fff; border-color: var(--tt-image); }

@media (max-width: 820px) {
  .featured-tool { grid-template-columns: 1fr; padding: 28px; gap: 22px; }
  .ft-visual { min-height: 180px; }
  .ft-ring-1 { width: 110px; height: 110px; }
  .ft-ring-2 { width: 160px; height: 160px; }
  .ft-ring-3 { width: 210px; height: 210px; }
  .ft-core { width: 86px; height: 86px; }
  .ft-core svg { width: 42px; height: 42px; }
}
@media (max-width: 520px) {
  .featured-tool { padding: 24px; border-radius: 18px; }
  .ft-chip-top, .ft-chip-bot { display: none; }
}

/* ---------- Keyboard hint ---------- */
.kbd-hint {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: 8px; font-size: 11px;
}
kbd {
  font-family: var(--id-font-mono); font-size: 11px;
  padding: 2px 6px; background: var(--id-surface-sunken);
  border: 1px solid var(--id-border); border-radius: 4px;
  color: var(--id-text-muted); font-weight: 600;
}

/* ---------- Favorites button on tool card ---------- */
.tc-fav {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; border-radius: 8px;
  border: none; background: transparent;
  display: grid; place-items: center; cursor: pointer;
  color: var(--id-text-subtle); opacity: 0;
  transition: all 160ms var(--id-ease);
}
.tool-card:hover .tc-fav, .tc-fav.active { opacity: 1; }
.tc-fav:hover { background: var(--id-surface-sunken); color: var(--tt-highlight); }
.tc-fav.active { color: var(--tt-highlight); }
.tool-card.has-badge .tc-fav { right: 104px; }

/* ---------- Try-now hint ---------- */
.try-pill {
  position: absolute; bottom: 12px; right: 12px;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; color: var(--id-success);
  background: var(--id-success-soft); padding: 3px 8px;
  border-radius: 999px; opacity: 0; transform: translateY(4px);
  transition: all 180ms var(--id-ease);
}
.tool-card:hover .try-pill { opacity: 1; transform: translateY(0); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float { 0%,100% { transform: translateY(0) rotate(var(--r, 0)); } 50% { transform: translateY(-8px) rotate(var(--r, 0)); } }
.hero-deco span { animation: float 4s ease-in-out infinite; }
.hero-deco .d2 { animation-delay: 0.3s; }
.hero-deco .d3 { animation-delay: 0.8s; }
.hero-deco .d4 { animation-delay: 1.2s; }
.hero-deco .d5 { animation-delay: 0.5s; }
.hero-deco .d6 { animation-delay: 1.6s; }
.hero-deco .d7 { animation-delay: 0.9s; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .cat-row { grid-template-columns: repeat(2, 1fr); }
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .nav-search { min-width: 140px; }
  .nav-links { display: none; }
}
@media (max-width: 640px) {
  .cat-row { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-search { display: none; }
  .hero { padding: 32px 0 16px; }
  .cmp-preview { grid-template-columns: 1fr; }
}

/* ---------- Signed-in user menu ---------- */
.user-menu { position: relative; }
.user-menu-trigger {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px 6px 6px;
}
.user-menu-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  object-fit: cover; margin-right: 6px; vertical-align: middle;
}
.user-menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 280px;
  background: var(--id-surface);
  border: 1px solid var(--id-border);
  border-radius: 14px;
  box-shadow: var(--id-shadow-lg);
  padding: 6px;
  z-index: 50;
  animation: um-in 0.14s ease-out;
}
@keyframes um-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.user-menu-header {
  display: flex; gap: 12px; align-items: center;
  padding: 12px; border-radius: 10px;
  background: var(--id-surface-alt);
  margin-bottom: 4px;
}
.user-menu-avatar-lg {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; flex: 0 0 auto;
}
.user-menu-avatar-fallback {
  background: var(--id-brand-blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
}
.user-menu-name {
  font-weight: 700; font-size: 14px; color: var(--id-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-menu-email {
  font-size: 12px; color: var(--id-text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-menu-section { padding: 4px 2px; }
.user-menu-section + .user-menu-section {
  border-top: 1px solid var(--id-border);
  margin-top: 4px; padding-top: 6px;
}
.user-menu-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--id-text-muted);
  padding: 4px 10px 6px;
}
.user-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  background: transparent; border: none;
  color: var(--id-text); font-size: 13px; font-weight: 500;
  border-radius: 8px; cursor: pointer;
  transition: background 0.1s ease;
  text-align: left;
}
.user-menu-item:hover { background: var(--id-surface-alt); }
.user-menu-item:disabled { opacity: 0.5; cursor: not-allowed; }
.user-menu-item-danger { color: var(--id-danger); }
.user-menu-item-danger:hover { background: var(--id-danger-soft); }

.user-menu-keybox {
  padding: 10px 12px; background: var(--id-surface-alt);
  border: 1px solid var(--id-border); border-radius: 10px;
  margin: 4px 2px;
}
.user-menu-key {
  display: block;
  padding: 8px 10px; background: var(--id-surface);
  border: 1px solid var(--id-border); border-radius: 6px;
  font-family: var(--id-font-mono); font-size: 11px;
  color: var(--id-text);
  word-break: break-all; overflow-wrap: anywhere;
  user-select: all;
}

/* ---------- Spotlight: Face Recognition ---------- */
/* Öne çıkması için photo-finder kartı grid'de iki kolon kaplar,
   turuncu renklerde yumuşak gradient, animasyonlu "NEW" ribbon,
   kenar parıltısı. Sadece geniş ekranlarda span; dar ekranda normal. */
@media (min-width: 701px) {
  .tools-grid .tool-card[data-id="photo-finder"] {
    grid-column: span 2;
    min-height: 180px;
  }
}
.tool-card[data-id="photo-finder"] {
  position: relative;
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--tt-image) 10%, var(--id-surface)) 0%,
    var(--id-surface) 60%);
  border: 1px solid color-mix(in oklab, var(--tt-image) 35%, var(--id-border));
  box-shadow:
    0 1px 2px rgba(234, 88, 12, 0.08),
    0 18px 44px -22px color-mix(in oklab, var(--tt-image) 70%, transparent);
  overflow: hidden;
}
.tool-card[data-id="photo-finder"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(360px 140px at 100% 0%, color-mix(in oklab, var(--tt-image) 22%, transparent), transparent 70%),
    radial-gradient(260px 120px at 0% 100%, color-mix(in oklab, var(--tt-image) 12%, transparent), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.tool-card[data-id="photo-finder"] > * { position: relative; z-index: 1; }
.tool-card[data-id="photo-finder"] .tc-icon {
  background: var(--tt-image);
  color: #fff;
  box-shadow: 0 8px 20px -8px var(--tt-image);
}
.tool-card[data-id="photo-finder"] .tc-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.tool-card[data-id="photo-finder"] .tc-desc {
  font-size: 13px;
  line-height: 1.55;
  max-width: 540px;
}
/* Featured (sparkle) rozetini yeni bir "NEW · AI" ribbon ile değiştir */
.tool-card[data-id="photo-finder"] .tc-badge {
  background: var(--tt-image);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 12px -4px var(--tt-image);
  animation: pfglow 2.4s ease-in-out infinite;
}
.tool-card[data-id="photo-finder"] .tc-badge::after {
  content: ' · AI';
  font-weight: 700;
  opacity: 0.85;
}
.tool-card[data-id="photo-finder"]:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 2px rgba(234, 88, 12, 0.08),
    0 26px 56px -22px color-mix(in oklab, var(--tt-image) 80%, transparent);
}
.tool-card[data-id="photo-finder"] .try-pill {
  background: var(--tt-image);
  color: #fff;
  border-color: transparent;
}
@keyframes pfglow {
  0%, 100% { box-shadow: 0 4px 12px -4px var(--tt-image); }
  50%      { box-shadow: 0 4px 20px -2px var(--tt-image); }
}

/* Dark mode tweaks */
:root[data-theme="dark"] .tool-card[data-id="photo-finder"] {
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--tt-image) 24%, var(--id-surface)) 0%,
    var(--id-surface) 55%);
}

/* ---------- Tool tier badges (premium / pro) ---------- */
.tc-tier {
  position: absolute; top: 10px; right: 10px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.1em;
  background: var(--id-brand-blue); color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.tc-tier-premium { background: #2563eb; }
.tc-locked .tc-icon { opacity: 0.7; }
.tc-locked::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 60%, color-mix(in oklab, var(--id-text) 3%, transparent) 100%);
  border-radius: inherit; pointer-events: none;
}
.tool-card.has-badge .tc-tier { top: 38px; }

/* "Sign in required" badge — only shown on free tools when the user is
   anonymous. Distinct from premium/pro lock so they don't get confused. */
.tc-auth-badge {
  position: absolute; top: 10px; right: 10px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.1em;
  background: color-mix(in oklab, var(--id-text) 78%, transparent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.tool-card.has-badge .tc-auth-badge { top: 38px; }
.tool-card.tc-auth { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--id-text) 18%, transparent); }

/* ---------- Paywall ---------- */
.paywall {
  max-width: 480px !important; width: 100%;
  padding: 0 !important; overflow: hidden;
  border-radius: 18px;
}
.paywall-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  background: var(--id-surface) !important;
}
.paywall-hero {
  padding: 40px 32px 28px; text-align: center;
  border-bottom: 1px solid var(--id-border);
}
.paywall-tier-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em;
  margin-bottom: 16px;
}
.paywall-icon {
  width: 72px; height: 72px; border-radius: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 12px 28px -10px rgba(0,0,0,.2);
}
.paywall-title { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 6px; color: var(--id-text); }
.paywall-sub { font-size: 14px; color: var(--id-text-muted); margin: 0; }
.paywall-body { padding: 28px 32px 24px; }
.paywall-price { text-align: center; margin-bottom: 20px; }
.paywall-amount { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; color: var(--id-text); }
.paywall-period { display: block; margin-top: 4px; font-size: 13px; color: var(--id-text-muted); }
.paywall-features { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.paywall-feature { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--id-text); }
.paywall-actions { display: flex; flex-direction: column; gap: 8px; }
.paywall-cta { width: 100%; justify-content: center; padding: 13px 22px !important; font-size: 14px !important; }

/* ---------- Dashboard (shared shell) ---------- */
.dash-shell {
  display: grid; grid-template-columns: 260px 1fr;
  min-height: 100vh; background: var(--id-bg);
}
.dash-side {
  background: var(--id-surface);
  border-right: 1px solid var(--id-border);
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 8px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.dash-back {
  display: flex; align-items: center; gap: 6px;
  background: transparent; border: none; padding: 6px 10px;
  font-size: 12px; color: var(--id-text-muted);
  font-weight: 600; cursor: pointer; border-radius: 8px;
  align-self: flex-start;
}
.dash-back:hover { background: var(--id-surface-alt); color: var(--id-text); }
.dash-side-head {
  display: flex; gap: 10px; align-items: center;
  padding: 12px; border-radius: 12px;
  background: var(--id-surface-alt);
  margin: 4px 0 8px;
}
.dash-avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.dash-side-name { font-weight: 700; font-size: 13px; color: var(--id-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-side-email { font-size: 11px; color: var(--id-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-admin-badge {
  width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--id-brand-blue), #7c3aed);
  color: #fff; display: flex; align-items: center; justify-content: center;
}
.dash-nav { display: flex; flex-direction: column; gap: 2px; }
.dash-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  background: transparent; border: none; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--id-text);
  text-align: left; width: 100%;
  transition: background 0.1s ease, color 0.1s ease;
}
.dash-nav-item:hover { background: var(--id-surface-alt); }
.dash-nav-item.on {
  background: var(--id-brand-blue-soft); color: var(--id-brand-blue); font-weight: 600;
}
.dash-admin-link { margin-top: auto; background: var(--id-surface-alt); color: var(--id-text); }
.dash-nav-badge {
  margin-left: auto; font-size: 9px; font-weight: 800; letter-spacing: 0.1em;
  color: var(--id-brand-blue);
}

.dash-main { padding: 32px 40px; max-width: 1100px; }
.dash-hero {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px; border-radius: 16px; margin-bottom: 22px;
  background: linear-gradient(135deg, var(--id-brand-blue-soft), var(--id-surface));
  border: 1px solid var(--id-border);
}
.dash-greeting { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--id-text); }
.dash-sub { color: var(--id-text-muted); font-size: 14px; margin: 4px 0 0; }
.dash-avatar-lg { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }

.dash-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 22px;
}
.dash-kpi {
  background: var(--id-surface); border: 1px solid var(--id-border);
  border-radius: 12px; padding: 14px 16px;
  display: flex; gap: 12px; align-items: center;
}
.dash-kpi-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--id-brand-blue-soft); color: var(--id-brand-blue);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.dash-kpi-value { font-size: 22px; font-weight: 800; color: var(--id-text); letter-spacing: -0.02em; line-height: 1; }
.dash-kpi-label { font-size: 12px; color: var(--id-text-muted); margin-top: 2px; }

.dash-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .dash-row { grid-template-columns: 1fr; } }
.dash-card { background: var(--id-surface); border: 1px solid var(--id-border); border-radius: 14px; padding: 18px; }
.dash-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dash-card-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--id-text); }
.dash-linkbtn { background: none; border: none; font-size: 12px; color: var(--id-brand-blue); font-weight: 600; cursor: pointer; }
.dash-empty { padding: 16px 0; color: var(--id-text-muted); font-size: 13px; text-align: center; }
.dash-empty-lg {
  padding: 60px 24px; text-align: center; color: var(--id-text-muted);
  background: var(--id-surface-alt); border-radius: 12px; border: 1px dashed var(--id-border);
}

.dash-mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.dash-mini-card {
  display: flex; gap: 8px; align-items: center;
  padding: 10px; border: 1px solid var(--id-border); border-radius: 10px;
  background: var(--id-surface); cursor: pointer; text-align: left;
  transition: border-color 0.1s ease, transform 0.1s ease;
}
.dash-mini-card:hover { border-color: var(--id-brand-blue); transform: translateY(-1px); }
.dash-mini-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.dash-mini-body { min-width: 0; flex: 1; }
.dash-mini-name { font-size: 13px; font-weight: 600; color: var(--id-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 4px; align-items: center; }
.dash-mini-cat { font-size: 11px; color: var(--id-text-muted); }

.dash-h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; color: var(--id-text); margin: 0 0 4px; }
.dash-h3 { font-size: 16px; font-weight: 700; color: var(--id-text); margin: 0 0 12px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 18px; }
.dash-full-card {
  position: relative; padding: 16px; border-radius: 14px;
  background: var(--id-surface); border: 1px solid var(--id-border);
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.dash-full-card:hover { transform: translateY(-2px); border-color: var(--id-brand-blue); box-shadow: var(--id-shadow-md); }
.dash-full-star {
  position: absolute; top: 10px; right: 10px; background: transparent; border: none; cursor: pointer;
  color: var(--tt-image); padding: 4px;
}
.dash-full-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.dash-full-name { font-size: 14px; font-weight: 700; color: var(--id-text); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.dash-full-desc { font-size: 12px; color: var(--id-text-muted); line-height: 1.4; }

.dash-table { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.dash-row-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--id-border);
  border-radius: 10px; background: var(--id-surface); cursor: pointer;
  transition: border-color 0.1s ease;
}
.dash-row-item:hover { border-color: var(--id-brand-blue); }
.dash-row-icon { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.dash-row-title { font-size: 13px; font-weight: 600; color: var(--id-text); display: flex; align-items: center; gap: 6px; }
.dash-row-sub { font-size: 11px; color: var(--id-text-muted); }

.dash-form { display: flex; flex-direction: column; gap: 14px; max-width: 460px; }

/* Tier chips */
.dash-tier-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.1em;
}
.dash-tier-free { background: var(--id-surface-alt); color: var(--id-text-muted); border: 1px solid var(--id-border); }
.dash-tier-premium { background: var(--id-brand-blue); color: #fff; }

.dash-sub-card {
  padding: 24px; border-radius: 14px; background: var(--id-surface); border: 1px solid var(--id-border);
  margin-top: 14px;
}
.dash-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
@media (max-width: 900px) { .dash-tiers { grid-template-columns: 1fr; } }
.dash-tier-box {
  padding: 18px; border-radius: 14px; background: var(--id-surface); border: 1px solid var(--id-border);
}
.dash-tier-box-on { border-color: var(--id-brand-blue); box-shadow: 0 0 0 3px var(--id-brand-blue-soft); }
.dash-tier-box ul { margin: 12px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.65; color: var(--id-text); }

.dash-keybox {
  padding: 16px; background: var(--id-surface-alt);
  border: 1px dashed var(--id-brand-blue); border-radius: 12px; margin-bottom: 16px;
}

/* ---------- Admin panel specific ---------- */
.dash-side-admin { border-right-color: var(--id-brand-blue); }

.admin-section { margin-top: 22px; }
.admin-section-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 8px 0; margin-bottom: 6px;
}

.admin-pricing-table {
  border: 1px solid var(--id-border); border-radius: 12px; overflow: hidden;
  background: var(--id-surface);
}
.admin-pricing-row {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px; padding: 12px 14px; align-items: center;
  border-bottom: 1px solid var(--id-border);
}
.admin-pricing-row:last-child { border-bottom: none; }
.admin-pricing-head { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--id-text-muted); background: var(--id-surface-alt); }
.admin-tool-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }

.admin-users-table {
  display: flex; flex-direction: column;
  border: 1px solid var(--id-border); border-radius: 12px; overflow: hidden;
  background: var(--id-surface);
}
.admin-users-row {
  display: grid; grid-template-columns: 2fr 1fr 0.8fr 1.4fr 1.6fr;
  gap: 10px; padding: 12px 14px; align-items: center;
  border-bottom: 1px solid var(--id-border);
}
.admin-users-row:last-child { border-bottom: none; }
.admin-users-head { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--id-text-muted); background: var(--id-surface-alt); }
.admin-role-chip {
  padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: 0.1em;
}
.admin-role-user { background: var(--id-surface-alt); color: var(--id-text-muted); }
.admin-role-admin { background: #fef3dc; color: #b8700a; }

.admin-bars { display: flex; flex-direction: column; gap: 6px; }
.admin-bar-row { display: grid; grid-template-columns: 180px 1fr 140px; gap: 10px; align-items: center; font-size: 12px; }
.admin-bar-label { color: var(--id-text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-bar-track { height: 6px; background: var(--id-surface-alt); border-radius: 3px; overflow: hidden; }
.admin-bar-fill { height: 100%; background: linear-gradient(90deg, var(--id-brand-blue), #7c3aed); }
.admin-bar-v { font-family: var(--id-font-mono); font-size: 12px; color: var(--id-text); text-align: right; }

/* Tool management grid */
.admin-tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-top: 14px; }
.admin-tool-card { background: var(--id-surface); border: 1px solid var(--id-border); border-radius: 12px; padding: 14px; }
.admin-tool-card[data-hidden="1"] { opacity: 0.55; border-style: dashed; }
.admin-tool-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.admin-tool-icon { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.admin-tool-form .mini-label { display: block; margin-top: 8px; }
.admin-tool-form .mini-input { width: 100%; box-sizing: border-box; margin-top: 4px; }
.admin-tool-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-tool-toggles { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--id-border); }

/* Function/key tables (denser than pricing table, 7 cols) */
.admin-fn-row {
  display: grid; grid-template-columns: 1.5fr 1.5fr repeat(5, 1fr);
  gap: 10px; align-items: center; padding: 10px 14px; font-size: 12px;
  border-bottom: 1px solid var(--id-border);
}
.admin-fn-row:last-child { border-bottom: none; }
.admin-fn-head { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--id-text-muted); background: var(--id-surface-alt); }
.admin-warn { color: #c8321f; font-weight: 700; }

/* Sparkline / time-series bars */
.admin-spark { display: flex; align-items: flex-end; gap: 2px; height: 100px; padding: 6px 0; }
.admin-spark-col { flex: 1 1 0; min-width: 4px; height: 100%; display: flex; align-items: flex-end; }
.admin-spark-bar {
  width: 100%; background: var(--id-brand-blue); border-radius: 2px 2px 0 0;
  position: relative; min-height: 2px;
}
.admin-spark-complete { width: 100%; background: #10805a; border-radius: 2px 2px 0 0; position: absolute; bottom: 0; left: 0; }
.admin-legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

@media (max-width: 900px) {
  .dash-shell { grid-template-columns: 1fr; }
  .dash-side { position: static; height: auto; }
  .dash-main { padding: 20px; }
  .admin-pricing-row { grid-template-columns: 1fr; padding: 12px; }
  .admin-users-row { grid-template-columns: 1fr; }
  .admin-fn-row { grid-template-columns: 1fr; gap: 4px; padding: 12px; }
  .admin-tool-grid-2 { grid-template-columns: 1fr; }
}

/* =============================================================
   Face Recognition — dedicated /face-recognition landing page
   ============================================================= */

:root {
  --tt-face: #ea580c;
  --tt-face-soft: #ffede0;
  --tt-face-deep: #c2410c;
}
:root[data-theme="dark"] {
  --tt-face-soft: #3a1d0f;
}

.nav-link.nav-link-face {
  background: linear-gradient(135deg, color-mix(in oklab, var(--tt-face) 18%, transparent), transparent);
  border: 1px solid color-mix(in oklab, var(--tt-face) 30%, transparent);
  padding: 6px 12px;
  gap: 6px;
}
.nav-link.nav-link-face:hover {
  background: color-mix(in oklab, var(--tt-face) 14%, var(--id-surface));
  border-color: color-mix(in oklab, var(--tt-face) 50%, transparent);
}
.nav-link.nav-link-face.is-active {
  background: var(--tt-face); color: white; border-color: var(--tt-face);
}
.nav-link.nav-link-face.is-active svg { color: white !important; }

.fr-page { padding-bottom: 56px; }

/* HERO — tighter so the tool below stays in view */
.fr-hero {
  position: relative;
  margin: 24px 0 0;
  padding: 44px 32px 36px;
  border-radius: 22px;
  text-align: center;
  background:
    radial-gradient(800px 320px at 50% 0%, color-mix(in oklab, var(--tt-face) 22%, transparent), transparent 70%),
    linear-gradient(180deg,
      color-mix(in oklab, var(--tt-face) 5%, var(--id-surface)) 0%,
      var(--id-surface) 100%);
  border: 1px solid color-mix(in oklab, var(--tt-face) 20%, var(--id-border));
  overflow: hidden;
}
.fr-hero-deco { position: absolute; inset: 0; pointer-events: none; }
.fr-hero-deco span { position: absolute; display: block; }
.fr-hero-deco .fhd-1 { top: 14%; left: 8%;  width: 14px; height: 14px; background: var(--tt-face); border-radius: 999px; opacity: .5; }
.fr-hero-deco .fhd-2 { top: 24%; right: 12%; width: 22px; height: 22px; background: #f59e0b; border-radius: 4px; transform: rotate(20deg); opacity: .55; }
.fr-hero-deco .fhd-3 { top: 64%; left: 14%; width: 12px; height: 12px; background: #2563eb; border-radius: 999px; opacity: .5; }
.fr-hero-deco .fhd-4 { top: 70%; right: 18%; width: 18px; height: 18px; background: #ec4899; border-radius: 4px; transform: rotate(45deg); opacity: .55; }
.fr-hero-deco .fhd-5 { top: 8%;  right: 30%; width: 10px; height: 10px; background: var(--tt-face); border-radius: 999px; opacity: .65; }
.fr-hero-deco .fhd-6 { top: 80%; left: 32%;  width: 16px; height: 16px; background: #a78bfa; border-radius: 4px; transform: rotate(15deg); opacity: .45; }

.fr-hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--tt-face); color: white;
  font-size: 10px; font-weight: 800; letter-spacing: 0.12em;
  margin-bottom: 16px;
  box-shadow: 0 6px 18px -6px color-mix(in oklab, var(--tt-face) 65%, transparent);
}
.fr-hero-title {
  font-size: clamp(34px, 5.2vw, 60px); font-weight: 800;
  line-height: 1.04; letter-spacing: -0.03em;
  margin: 0 0 14px; max-width: 820px; margin-inline: auto;
  text-wrap: balance;
}
.fr-hero-title .hl {
  display: inline-block; padding: 0 14px;
  background: var(--tt-face); color: white;
  border-radius: 8px;
  transform: rotate(-1.2deg);
  margin: 0 4px;
}
.fr-hero-sub {
  font-size: 15px; color: var(--id-text-muted);
  max-width: 580px; margin: 0 auto 22px; line-height: 1.55;
}
.fr-hero-sub em { font-style: italic; color: var(--tt-face); font-weight: 700; }
.fr-hero-ctas {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 22px;
}
.fr-btn-primary {
  background: var(--tt-face); border-color: var(--tt-face);
  padding: 12px 22px; font-size: 15px; font-weight: 700;
  box-shadow: 0 14px 28px -12px color-mix(in oklab, var(--tt-face) 70%, transparent);
}
.fr-btn-primary:hover { background: var(--tt-face-deep); border-color: var(--tt-face-deep); }
.fr-btn-secondary { padding: 12px 22px; font-size: 15px; font-weight: 600; }

.fr-hero-stats {
  display: inline-flex; gap: 22px;
  padding: 12px 22px; border-radius: 14px;
  background: var(--id-surface); border: 1px solid var(--id-border);
  box-shadow: var(--id-shadow-sm);
  flex-wrap: wrap; justify-content: center;
}
.fhs { text-align: center; }
.fhs-v { font-size: 22px; font-weight: 800; color: var(--tt-face); letter-spacing: -0.02em; line-height: 1; }
.fhs-l { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--id-text-muted); margin-top: 3px; font-weight: 700; }

/* Section heading */
.fr-h2 {
  font-size: clamp(22px, 2.4vw, 30px); font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.2;
  text-align: center; margin: 0 0 22px;
  text-wrap: balance;
}
.fr-h2 strong { color: var(--tt-face); }
.fr-h3 {
  font-size: 18px; font-weight: 800; letter-spacing: -0.015em;
  margin: 0 0 14px; line-height: 1.25; color: var(--id-text);
}

/* USE CASES — horizontal chip strip, no big card padding */
.fr-cases { margin-top: 48px; }
.fr-case-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
@media (max-width: 900px) { .fr-case-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .fr-case-strip { grid-template-columns: 1fr; } }
.fr-case-chip {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px;
  background: var(--id-surface); border: 1px solid var(--id-border);
  border-radius: 12px;
  font-size: 13px;
  transition: border-color 180ms, transform 180ms;
}
.fr-case-chip:hover { transform: translateY(-2px); border-color: var(--id-border-strong); }
.fr-case-chip strong { font-size: 14px; font-weight: 800; color: var(--id-text); }
.fr-case-chip span { color: var(--id-text-muted); }
.fr-case-dot {
  width: 8px; height: 8px; border-radius: 999px;
  margin-bottom: 4px;
}

/* HOW + PRIVACY — single combined section, 2 columns */
.fr-how-priv { margin-top: 48px; }
.fr-how-priv-grid {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px;
  align-items: stretch;
}
@media (max-width: 760px) { .fr-how-priv-grid { grid-template-columns: 1fr; } }

.fr-how-col, .fr-priv-col {
  padding: 22px 24px;
  background: var(--id-surface); border: 1px solid var(--id-border);
  border-radius: 14px;
}

.fr-step-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.fr-step-list li {
  display: grid; grid-template-columns: 28px 1fr; gap: 12px;
  align-items: start;
  font-size: 14px; line-height: 1.55;
  color: var(--id-text-muted);
}
.fr-step-list li strong { color: var(--id-text); }
.fr-step-num {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--tt-face-soft); color: var(--tt-face);
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px;
}

.fr-priv-col {
  background: linear-gradient(155deg, color-mix(in oklab, var(--tt-face) 7%, var(--id-surface-alt)) 0%, var(--id-surface-alt) 100%);
  border-color: color-mix(in oklab, var(--tt-face) 24%, var(--id-border));
}
.fr-priv-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--tt-face); color: white;
  font-size: 10px; font-weight: 800; letter-spacing: 0.12em;
  margin-bottom: 12px;
}
.fr-priv-sub {
  font-size: 14px; color: var(--id-text-muted); line-height: 1.55;
  margin: 0 0 14px;
}
.fr-priv-bullets {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--id-text);
}
.fr-priv-bullets li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--id-surface); border: 1px solid var(--id-border); border-radius: 8px;
}
.fr-priv-bullets li svg { color: var(--tt-face); flex-shrink: 0; }

/* TOOL */
.fr-tool {
  margin-top: 56px;
  scroll-margin-top: 24px;       /* breathing room when CTA scrolls into view */
}
.fr-tool.fr-tool-top { margin-top: 32px; }
.fr-tool-head { text-align: center; margin-bottom: 18px; }
.fr-tool-sub { font-size: 14px; color: var(--id-text-muted); margin: 0; }
.fr-frame {
  background: var(--id-surface);
  border: 1px solid var(--id-border-strong);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 44px -22px color-mix(in oklab, var(--tt-face) 50%, transparent);
  /* Stable minimum so the warm/loading state has presence; iframe can grow
     past this once it posts its content height. */
  min-height: clamp(560px, 70vh, 880px);
}
.fr-frame iframe {
  width: 100%;
  /* The iframe content posts its scrollHeight via postMessage and the
     parent JSX overrides height inline. The 70vh fallback keeps the warm
     state filling the card while we wait for the first measurement. */
  height: 70vh;
  min-height: 100%;
  border: 0;
  display: block;
  background: var(--id-surface);
}
.fr-frame-warm, .fr-frame-down {
  padding: 48px 24px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.fr-warm-icon {
  width: 72px; height: 72px; border-radius: 20px;
  background: var(--tt-face-soft); color: var(--tt-face);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  animation: fr-pulse 1.6s ease-in-out infinite;
  box-shadow: var(--id-shadow-md);
}
@keyframes fr-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(0.94); opacity: 0.65; }
}
.fr-warm-title {
  font-size: 18px; font-weight: 800; color: var(--id-text);
  letter-spacing: -0.01em; margin-bottom: 8px;
}
.fr-warm-sub {
  font-size: 14px; color: var(--id-text-muted);
  max-width: 460px; margin: 0 auto; line-height: 1.55;
}
.fr-warm-actions { margin-top: 18px; }
.fr-admin-hint {
  margin: 22px auto 0; max-width: 460px;
  text-align: left; font-size: 12px;
  background: var(--id-surface-alt); border: 1px dashed var(--id-border);
  border-radius: 10px; padding: 10px 14px;
}
.fr-admin-hint summary { cursor: pointer; font-weight: 700; color: var(--id-text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; }
.fr-admin-hint pre {
  margin: 8px 0; padding: 8px 10px;
  background: var(--id-surface); border-radius: 6px;
  font-family: var(--id-font-mono); font-size: 11px; color: var(--id-text);
}

/* FAQ — compact */
.fr-faq { margin-top: 48px; }
.fr-faq-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
@media (max-width: 760px) { .fr-faq-grid { grid-template-columns: 1fr; } }
.fr-faq-item {
  padding: 12px 16px;
  background: var(--id-surface); border: 1px solid var(--id-border);
  border-radius: 10px;
  transition: border-color 180ms;
}
.fr-faq-item[open] { border-color: var(--id-border-strong); }
.fr-faq-item summary {
  cursor: pointer;
  font-size: 14px; font-weight: 700;
  color: var(--id-text);
  list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  padding-right: 6px;
}
.fr-faq-item summary::-webkit-details-marker { display: none; }
.fr-faq-item summary::after {
  content: '+';
  font-size: 20px; font-weight: 300;
  color: var(--tt-face);
  transition: transform 180ms;
}
.fr-faq-item[open] summary::after { content: '−'; }
.fr-faq-item p {
  margin: 8px 0 0; font-size: 13px; color: var(--id-text-muted);
  line-height: 1.55;
}
.fr-faq-item code {
  font-family: var(--id-font-mono); font-size: 11px;
  background: var(--id-surface-alt); padding: 1px 5px; border-radius: 4px;
  color: var(--id-text);
}

/* ---------- Mobile responsive (≤ 640 px) ---------- */
@media (max-width: 640px) {
  .fr-page { padding-bottom: 40px; }

  .fr-hero {
    margin-top: 16px;
    padding: 32px 18px 26px;
    border-radius: 16px;
  }
  .fr-hero-title { font-size: 32px; line-height: 1.05; margin-bottom: 12px; }
  .fr-hero-title .hl { padding: 0 8px; }
  .fr-hero-sub { font-size: 14px; margin-bottom: 18px; }
  .fr-hero-tag {
    font-size: 9px; padding: 4px 10px;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
  }
  .fr-hero-ctas { flex-direction: column; gap: 8px; margin-bottom: 18px; }
  .fr-hero-ctas .btn { width: 100%; justify-content: center; }
  .fr-hero-stats {
    width: 100%;
    gap: 0;
    padding: 12px;
    flex-wrap: nowrap;
    justify-content: space-around;
  }
  .fr-hero-stats .fhs { flex: 1; min-width: 0; }
  .fr-hero-stats .fhs-v { font-size: 18px; }
  .fr-hero-stats .fhs-l { font-size: 9px; letter-spacing: 0.06em; }

  .fr-tool { margin-top: 32px; }
  .fr-tool.fr-tool-top { margin-top: 24px; }
  .fr-tool-head { margin-bottom: 12px; }

  .fr-frame {
    min-height: 0;
    border-radius: 12px;
  }
  .fr-frame iframe {
    min-height: 70vh !important;
    height: 70vh !important;
  }

  .fr-cases, .fr-how-priv, .fr-faq { margin-top: 36px; }

  .fr-h2 { font-size: 22px; margin-bottom: 16px; }
  .fr-h3 { font-size: 16px; margin-bottom: 12px; }

  .fr-how-col, .fr-priv-col { padding: 18px 18px; border-radius: 12px; }

  .fr-step-list li {
    grid-template-columns: 26px 1fr;
    gap: 10px; font-size: 13px;
  }

  .fr-priv-bullets li { font-size: 12px; padding: 7px 10px; }

  .fr-faq-item { padding: 10px 14px; }
  .fr-faq-item summary { font-size: 13px; }
  .fr-faq-item p { font-size: 12px; }

  .fr-case-chip { padding: 12px 14px; }
  .fr-case-chip strong { font-size: 13px; }
  .fr-case-chip span { font-size: 12px; }
}

/* Very small (≤ 380 px) — stack hero stats vertically */
@media (max-width: 380px) {
  .fr-hero-stats { flex-direction: column; gap: 8px; }
  .fr-hero-stats .fhs { width: 100%; }
}

/* Hide secondary nav links on very narrow screens to avoid wrap */
@media (max-width: 540px) {
  .nav-link.nav-link-face,
  .nav-link.nav-link-sports {
    padding: 6px 10px;
    font-size: 12px;
  }
  .nav-link.nav-link-face span,
  .nav-link.nav-link-sports span { display: none; }
}

/* ---------- Cookie consent banner ---------- */
.cc-overlay {
  position: fixed;
  inset: auto 0 0 0;
  padding: 16px;
  display: grid;
  place-items: end center;
  pointer-events: none;
  z-index: 200;
}
.cc-banner {
  pointer-events: auto;
  width: 100%;
  max-width: 720px;
  background: var(--id-surface);
  border: 1px solid var(--id-border-strong);
  border-radius: 16px;
  padding: 18px 22px;
  box-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.35), 0 8px 16px -8px rgba(15, 23, 42, 0.18);
  animation: ccSlide 240ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes ccSlide {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cc-head {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: flex-start;
}
.cc-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--id-brand-blue-soft);
  color: var(--id-brand-blue);
  flex-shrink: 0;
}
.cc-title {
  font-size: 15px; font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--id-text);
}
.cc-sub {
  margin-top: 4px;
  font-size: 13px; line-height: 1.5;
  color: var(--id-text-muted);
}
.cc-close {
  background: transparent; border: none; cursor: pointer;
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--id-text-muted);
  transition: background 140ms;
}
.cc-close:hover { background: var(--id-surface-sunken); color: var(--id-text); }

.cc-toggles {
  margin-top: 16px;
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border);
  border-radius: 12px;
}
.cc-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--id-border);
  background: var(--id-surface);
  cursor: pointer;
  transition: border-color 140ms, background 140ms;
}
.cc-toggle.cc-on {
  border-color: color-mix(in oklab, var(--id-brand-blue) 35%, var(--id-border));
  background: color-mix(in oklab, var(--id-brand-blue) 5%, var(--id-surface));
}
.cc-toggle.cc-toggle-locked {
  opacity: 0.85;
  cursor: not-allowed;
  background: var(--id-surface-sunken);
}
.cc-toggle input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--id-brand-blue);
  cursor: pointer;
}
.cc-toggle.cc-toggle-locked input { cursor: not-allowed; }
.cc-toggle-text { display: flex; flex-direction: column; gap: 2px; }
.cc-toggle-text strong {
  font-size: 13px; font-weight: 700; color: var(--id-text);
}
.cc-toggle-text small {
  font-size: 12px; color: var(--id-text-muted); line-height: 1.4;
}

.cc-actions {
  margin-top: 16px;
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center;
}
.cc-link {
  font-size: 12px; color: var(--id-text-muted); text-decoration: underline;
}
.cc-link:hover { color: var(--id-text); }
.cc-spacer { flex: 1; }
.cc-btn {
  padding: 8px 14px;
  font-size: 13px; font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid;
  transition: all 140ms;
}
.cc-btn-ghost {
  background: var(--id-surface);
  color: var(--id-text-muted);
  border-color: var(--id-border);
}
.cc-btn-ghost:hover {
  color: var(--id-text); border-color: var(--id-border-strong);
}
.cc-btn-primary {
  background: var(--id-brand-blue);
  color: white;
  border-color: var(--id-brand-blue);
  box-shadow: 0 4px 12px -4px color-mix(in oklab, var(--id-brand-blue) 60%, transparent);
}
.cc-btn-primary:hover {
  background: var(--id-brand-blue-hover);
  border-color: var(--id-brand-blue-hover);
}
.cc-btn-link {
  background: transparent; border: none; color: var(--id-text-muted);
  font-size: 12px; cursor: pointer; text-decoration: underline;
  padding: 6px 8px;
}
.cc-btn-link:hover { color: var(--id-text); }

@media (max-width: 600px) {
  .cc-overlay { padding: 8px; }
  .cc-banner  { padding: 16px; border-radius: 12px; }
  .cc-actions { flex-direction: column; align-items: stretch; }
  .cc-spacer  { display: none; }
  .cc-link    { order: 99; text-align: center; margin-top: 4px; }
  .cc-btn     { width: 100%; padding: 10px; }
  .cc-head    { grid-template-columns: 32px 1fr; }
  .cc-head .cc-close { display: none; }
}

/* ---------- Top-level error boundary fallback ---------- */
.mm-error-fallback {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
  background: var(--id-bg);
}
.mm-error-card {
  max-width: 540px; width: 100%;
  padding: 32px;
  background: var(--id-surface);
  border: 1px solid var(--id-border-strong);
  border-radius: 16px;
  text-align: center;
  box-shadow: var(--id-shadow-md);
}
.mm-error-icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: color-mix(in oklab, #c8321f 12%, var(--id-surface-alt));
  color: #c8321f;
}
.mm-error-card h2 {
  margin: 0 0 8px; font-size: 22px; font-weight: 800;
  letter-spacing: -0.01em;
}
.mm-error-card p {
  margin: 0 0 16px; color: var(--id-text-muted);
  font-size: 14px; line-height: 1.5;
}
.mm-error-msg {
  text-align: left;
  background: var(--id-surface-sunken);
  border: 1px solid var(--id-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--id-font-mono);
  font-size: 12px; line-height: 1.5;
  color: var(--id-text);
  max-height: 160px; overflow: auto;
  margin: 0 0 18px;
  white-space: pre-wrap; word-break: break-word;
}
.mm-error-actions {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}

/* =============================================================
   Sports — dedicated /#sports landing page + per-tool styling
   ============================================================= */

:root {
  --tt-sport: #16a34a;
  --tt-sport-soft: #dcfce7;
  --tt-sport-deep: #15803d;
}
:root[data-theme="dark"] {
  --tt-sport-soft: #14271c;
}

/* Sports nav link in TopNav: subtle pill with brand-green accent. */
.nav-link.nav-link-sports {
  background: linear-gradient(135deg, color-mix(in oklab, var(--tt-sport) 18%, transparent), transparent);
  border: 1px solid color-mix(in oklab, var(--tt-sport) 30%, transparent);
  padding: 6px 12px;
  gap: 6px;
}
.nav-link.nav-link-sports:hover {
  background: color-mix(in oklab, var(--tt-sport) 14%, var(--id-surface));
  border-color: color-mix(in oklab, var(--tt-sport) 50%, transparent);
}
.nav-link.nav-link-sports.is-active {
  background: var(--tt-sport);
  color: white;
  border-color: var(--tt-sport);
}
.nav-link.nav-link-sports.is-active svg { color: white !important; }

/* ---------- Sports landing page ---------- */
.sports-page { padding-bottom: 64px; }

.sports-hero {
  position: relative;
  margin: 32px 0 0;
  padding: 56px 32px 44px;
  border-radius: 24px;
  text-align: center;
  background:
    radial-gradient(800px 320px at 50% 0%, color-mix(in oklab, var(--tt-sport) 22%, transparent), transparent 70%),
    linear-gradient(180deg,
      color-mix(in oklab, var(--tt-sport) 6%, var(--id-surface)) 0%,
      var(--id-surface) 100%);
  border: 1px solid color-mix(in oklab, var(--tt-sport) 22%, var(--id-border));
  overflow: hidden;
}
.sports-hero-deco { position: absolute; inset: 0; pointer-events: none; }
.sports-hero-deco span { position: absolute; display: block; }
.sports-hero-deco .sd1 { top: 18%; left: 8%;  width: 14px; height: 14px; background: #22c55e; border-radius: 999px; opacity: .6; }
.sports-hero-deco .sd2 { top: 30%; right: 12%; width: 22px; height: 22px; background: #f59e0b; border-radius: 4px; transform: rotate(20deg); opacity: .55; }
.sports-hero-deco .sd3 { top: 64%; left: 18%; width: 12px; height: 12px; background: #2563eb; border-radius: 999px; opacity: .5; }
.sports-hero-deco .sd4 { top: 76%; right: 20%; width: 18px; height: 18px; background: #ec4899; border-radius: 4px; transform: rotate(45deg); opacity: .55; }
.sports-hero-deco .sd5 { top: 12%; right: 32%; width: 10px; height: 10px; background: var(--tt-sport); border-radius: 999px; opacity: .65; }

.sports-hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--tt-sport); color: white;
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em;
  margin-bottom: 24px;
  box-shadow: 0 8px 22px -8px color-mix(in oklab, var(--tt-sport) 65%, transparent);
}
.sports-hero-title {
  font-size: clamp(40px, 6vw, 68px); font-weight: 800;
  line-height: 1.05; letter-spacing: -0.03em;
  margin: 0 0 16px;
}
.sports-hero-title .hl {
  display: inline-block; padding: 0 14px;
  background: var(--tt-sport); color: white;
  border-radius: 8px;
  transform: rotate(-1.2deg);
  margin: 0 4px;
}
.sports-hero-sub {
  font-size: 17px; color: var(--id-text-muted);
  max-width: 600px; margin: 0 auto 28px; line-height: 1.55;
}
.sports-hero-stats {
  display: inline-flex; gap: 28px;
  padding: 14px 24px; border-radius: 16px;
  background: var(--id-surface); border: 1px solid var(--id-border);
  box-shadow: var(--id-shadow-md);
}
.shs-item { text-align: center; }
.shs-v { font-size: 28px; font-weight: 800; color: var(--tt-sport); letter-spacing: -0.02em; line-height: 1; }
.shs-l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--id-text-muted); margin-top: 4px; font-weight: 700; }

/* Featured pace calculator block */
.sports-featured {
  margin-top: 36px;
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  border-radius: 20px;
  cursor: pointer;
  background:
    radial-gradient(360px 200px at 92% 12%, color-mix(in oklab, var(--tt-sport) 22%, transparent), transparent 70%),
    var(--id-surface);
  border: 1px solid color-mix(in oklab, var(--tt-sport) 26%, var(--id-border));
  box-shadow: 0 16px 40px -20px color-mix(in oklab, var(--tt-sport) 55%, transparent);
  transition: transform 0.22s var(--id-ease), box-shadow 0.22s var(--id-ease);
}
.sports-featured:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px -20px color-mix(in oklab, var(--tt-sport) 70%, transparent);
}
.sf-tag {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: var(--tt-sport); color: white;
  font-size: 10px; font-weight: 800; letter-spacing: 0.12em;
  margin-bottom: 12px;
}
.sf-title { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px; }
.sf-desc { color: var(--id-text-muted); margin: 0 0 18px; line-height: 1.55; max-width: 460px; }
.sf-cta { background: var(--tt-sport); border-color: var(--tt-sport); }
.sf-cta:hover { background: var(--tt-sport-deep); border-color: var(--tt-sport-deep); }
.sf-visual {
  position: relative; aspect-ratio: 1 / 1; min-height: 200px;
  display: grid; place-items: center;
}
.sf-ring {
  position: absolute; inset: 0; margin: auto; border-radius: 50%;
  border: 2px solid color-mix(in oklab, var(--tt-sport) 35%, transparent);
}
.sf-ring-1 { width: 80%; height: 80%; opacity: 0.6; }
.sf-ring-2 { width: 100%; height: 100%; opacity: 0.4; }
.sf-ring-3 { width: 60%; height: 60%; opacity: 0.85; border-style: dashed; }
.sf-core {
  width: 120px; height: 120px;
  background: var(--tt-sport); color: white;
  border-radius: 50%; display: grid; place-items: center;
  box-shadow: 0 20px 50px -16px color-mix(in oklab, var(--tt-sport) 70%, transparent);
  z-index: 1;
}

@media (max-width: 760px) {
  .sports-featured { grid-template-columns: 1fr; }
  .sf-visual { min-height: 180px; }
  .sports-hero-stats { gap: 18px; padding: 12px 16px; flex-wrap: wrap; }
}

/* Sub-category tile cards */
.sports-groups {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 36px;
}
@media (max-width: 960px) { .sports-groups { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .sports-groups { grid-template-columns: 1fr; } }

.sports-group-card {
  position: relative; text-align: left;
  padding: 22px 22px 56px;
  background: var(--id-surface);
  border: 1px solid var(--id-border);
  border-radius: 16px;
  cursor: pointer; overflow: hidden;
  transition: transform 0.18s var(--id-ease), box-shadow 0.18s var(--id-ease), border-color 0.18s;
  font-family: inherit; color: inherit;
}
.sports-group-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(280px 140px at 90% 10%, color-mix(in oklab, var(--sg-tint) 14%, transparent), transparent 70%);
  pointer-events: none;
}
.sports-group-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--sg-tint) 50%, var(--id-border));
  box-shadow: 0 16px 40px -20px color-mix(in oklab, var(--sg-tint) 50%, transparent);
}
.sgc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; position: relative; }
.sgc-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: color-mix(in oklab, var(--sg-tint) 18%, transparent);
  color: var(--sg-tint);
  display: grid; place-items: center;
}
.sgc-count { font-size: 11px; font-weight: 700; color: var(--id-text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.sgc-name { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; position: relative; }
.sgc-desc { font-size: 13px; color: var(--id-text-muted); margin-top: 4px; position: relative; }
.sgc-tools { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 14px; position: relative; }
.sgc-tag {
  font-size: 11px; padding: 3px 8px; border-radius: 6px;
  background: var(--id-surface-sunken); color: var(--id-text);
  border: 1px solid var(--id-border);
}
.sgc-arrow {
  position: absolute; bottom: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--sg-tint); color: white;
  display: grid; place-items: center;
  opacity: 0.85;
}

/* Filter row + grid header */
.sports-grid-section { margin-top: 44px; }
.sports-filter-row {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px;
  padding: 14px 16px;
  background: var(--id-surface); border: 1px solid var(--id-border);
  border-radius: 14px;
}

/* Why-athletes-love-it tip cards */
.sports-tips { margin-top: 56px; }
.sports-tips h2 {
  font-size: 24px; font-weight: 800; letter-spacing: -0.02em;
  margin: 0 0 20px; text-align: center;
}
.sports-tips-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
@media (max-width: 900px) { .sports-tips-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .sports-tips-grid { grid-template-columns: 1fr; } }
.st-card {
  padding: 20px; border-radius: 14px;
  background: var(--id-surface); border: 1px solid var(--id-border);
}
.st-ico {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--tt-sport-soft); color: var(--tt-sport);
  display: grid; place-items: center;
  margin-bottom: 12px;
}
.st-name { font-weight: 800; font-size: 15px; margin-bottom: 4px; }
.st-desc { font-size: 13px; color: var(--id-text-muted); line-height: 1.5; }

/* ---------- Inside the sports tool modals ---------- */
.sport-tool { display: block; }

.sport-tool-header {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border-strong);
  border-radius: 12px;
  margin-bottom: 18px;
}
.sth-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
}
.sth-title { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.sth-sub   { font-size: 13px; color: var(--id-text-muted); margin-top: 2px; }

.sport-mode-row {
  display: flex; gap: 6px; margin-bottom: 14px;
  align-items: center; flex-wrap: wrap;
}
.sport-mode-spacer { flex: 1; }
.sport-mode-btn {
  padding: 6px 14px; border-radius: 8px;
  background: var(--id-surface); border: 1px solid var(--id-border);
  color: var(--id-text-muted); font-weight: 600; font-size: 13px;
  cursor: pointer; transition: all 160ms;
}
.sport-mode-btn:hover { color: var(--id-text); }
.sport-mode-btn.active {
  background: var(--tt-sport); border-color: var(--tt-sport);
  color: white;
  box-shadow: 0 4px 10px -4px color-mix(in oklab, var(--tt-sport) 60%, transparent);
}

.sport-unit-toggle {
  display: inline-flex; padding: 3px;
  background: var(--id-surface-sunken);
  border-radius: 10px;
  border: 1px solid var(--id-border);
}
.sport-unit-toggle button {
  border: none; background: transparent;
  padding: 5px 14px; border-radius: 7px;
  font-weight: 700; font-size: 13px; color: var(--id-text-muted);
  cursor: pointer;
}
.sport-unit-toggle button.active {
  background: var(--id-surface); color: var(--tt-sport);
  box-shadow: var(--id-shadow-sm);
}

.sport-input-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-bottom: 18px;
}
@media (max-width: 720px) { .sport-input-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .sport-input-grid { grid-template-columns: 1fr; } }

.sport-results {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.sport-result-tile {
  padding: 16px;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border);
  border-radius: 12px;
  transition: border-color 180ms, box-shadow 180ms;
}
.srt-l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--id-text-muted); font-weight: 700; }
.srt-v { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--id-text); margin-top: 6px; font-variant-numeric: tabular-nums; }
.srt-s { font-size: 12px; color: var(--id-text-muted); margin-top: 4px; }

.sport-empty {
  padding: 24px;
  background: var(--id-surface-sunken);
  border: 1px dashed var(--id-border);
  border-radius: 12px;
  color: var(--id-text-muted);
  text-align: center;
  font-size: 13px;
}
.sport-empty-row { text-align: center; padding: 20px !important; color: var(--id-text-muted); }

.sport-helper {
  margin-top: 12px;
  padding: 12px 14px;
  background: color-mix(in oklab, var(--tt-sport) 6%, var(--id-surface-alt));
  border-left: 3px solid var(--tt-sport);
  border-radius: 8px;
  font-size: 13px; color: var(--id-text-muted); line-height: 1.55;
}
.sport-helper code {
  background: var(--id-surface); padding: 1px 6px;
  border-radius: 4px; font-size: 12px; margin: 0 2px;
}

.sport-zone-note {
  margin: 10px 0 0; padding: 12px 14px;
  border: 1px solid; border-radius: 8px;
  font-size: 14px; line-height: 1.5;
  background: var(--id-surface-alt);
}

.sport-details {
  margin-top: 14px;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border); border-radius: 10px;
  padding: 10px 14px;
}
.sport-details summary { cursor: pointer; font-weight: 600; font-size: 13px; }

/* Tables (race predictor, splits) */
.sport-table-wrap {
  border: 1px solid var(--id-border); border-radius: 12px;
  overflow: auto; margin-bottom: 18px;
  background: var(--id-surface);
}
.sport-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.sport-table th {
  text-align: left; padding: 10px 14px;
  background: var(--id-surface-sunken);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--id-text-muted); font-weight: 700;
  border-bottom: 1px solid var(--id-border);
}
.sport-table td { padding: 10px 14px; border-bottom: 1px solid var(--id-border); }
.sport-table tr:last-child td { border-bottom: none; }
.sport-table tr.sport-row-current td {
  background: color-mix(in oklab, var(--tt-sport) 8%, transparent);
  font-weight: 700;
}

/* Heart-rate zone bars */
.sport-zones { margin: 10px 0 18px; display: flex; flex-direction: column; gap: 6px; }
.sport-zone-row {
  display: grid;
  grid-template-columns: 130px 1fr 110px 1fr;
  gap: 12px; align-items: center;
  padding: 8px 12px;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border);
  border-radius: 10px;
  font-size: 13px;
}
@media (max-width: 720px) {
  .sport-zone-row { grid-template-columns: 110px 1fr 90px; }
  .szr-purpose { display: none; }
}
.szr-name { font-weight: 700; color: var(--z-color); }
.szr-bar { position: relative; height: 8px; background: var(--id-surface-sunken); border-radius: 999px; overflow: hidden; }
.szr-fill { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.szr-bpm { font-variant-numeric: tabular-nums; font-weight: 700; }
.szr-purpose { color: var(--id-text-muted); font-size: 12px; }

/* Training-load bars */
.sport-bars {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 10px; align-items: end;
  height: 160px;
  padding: 16px;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border);
  border-radius: 12px;
  margin-bottom: 16px;
}
.sport-bar-col { display: flex; flex-direction: column; align-items: center; height: 100%; gap: 4px; }
.sport-bar-bg { width: 100%; flex: 1; display: flex; align-items: flex-end; }
.sport-bar-fill { width: 100%; border-radius: 6px 6px 0 0; min-height: 2px; transition: height 220ms var(--id-ease); }
.sport-bar-l { font-size: 11px; color: var(--id-text-muted); font-weight: 700; }
.sport-bar-v { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* GPX components */
.gpx-svg-wrap {
  margin: 14px 0;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border);
  border-radius: 12px;
  padding: 14px;
  color: var(--id-text);
}
.gpx-svg-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--id-text-muted); font-weight: 700; margin-bottom: 8px;
}
.gpx-svg { width: 100%; height: auto; max-height: 360px; display: block; }

.gpx-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin: 10px 0 16px;
}
.gpx-stat {
  padding: 12px 14px;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border);
  border-radius: 10px;
}
.gpx-stat-l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--id-text-muted); font-weight: 700; }
.gpx-stat-v { font-size: 18px; font-weight: 800; color: var(--id-text); margin-top: 4px; font-variant-numeric: tabular-nums; }
.gpx-stat-s { font-size: 11px; color: var(--id-text-muted); margin-top: 2px; }

/* GPX merger row */
.gpx-merge-list { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.gpx-merge-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 10px 14px;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border);
  border-radius: 10px;
}
.gmr-num {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--tt-sport-soft); color: var(--tt-sport);
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
}
.gmr-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gmr-stats { font-size: 12px; color: var(--id-text-muted); font-variant-numeric: tabular-nums; }
.gmr-actions { display: flex; gap: 4px; }
.gmr-actions .icon-btn { width: 28px; height: 28px; }

/* Strip-GPS gallery */
.strip-gallery {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin: 14px 0;
}
.strip-card {
  position: relative;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border);
  border-radius: 12px; overflow: hidden;
}
.strip-card img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  display: block;
}
.strip-meta { padding: 8px 10px; }
.strip-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-size { font-size: 11px; color: var(--id-text-muted); }
.strip-dl {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px;
  background: rgba(0,0,0,0.6); color: white; border: none;
}

/* Race-bib preview thumbs */
.bib-preview {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin: 16px 0;
}
@media (max-width: 720px) { .bib-preview { grid-template-columns: repeat(2, 1fr); } }
.bib-thumb {
  background: var(--id-surface);
  border: 1px solid var(--id-border-strong);
  border-radius: 10px; overflow: hidden;
  text-align: center;
  padding-bottom: 14px;
}
.bib-stripe {
  color: white; padding: 6px 10px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em;
}
.bib-num {
  font-size: 56px; font-weight: 900; letter-spacing: -0.02em;
  margin: 16px 0 4px; color: var(--id-text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.bib-name { font-size: 13px; color: var(--id-text-muted); }
.bib-more {
  align-self: center; justify-self: center;
  padding: 22px; font-size: 13px; color: var(--id-text-muted);
  border: 1px dashed var(--id-border); border-radius: 10px;
  display: grid; place-items: center;
}

/* Sports filter pill (green active) override on sports page */
.sports-filter-row .filter-pill.active {
  color: white;
}

/* ---------- Activity Share Card ---------- */
.share-source-row {
  display: flex; align-items: stretch; gap: 12px;
}
.share-source-loaded {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border-strong);
  border-radius: 12px;
  font-size: 13px;
}
.share-source-loaded svg { color: var(--tt-sport); }

.share-preview-wrap {
  margin: 18px 0;
  display: grid; place-items: center;
}
.share-preview-stage {
  /* Checkerboard pattern so the user can see the alpha channel */
  background:
    linear-gradient(45deg, #cbd5e1 25%, transparent 25%),
    linear-gradient(-45deg, #cbd5e1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #cbd5e1 75%),
    linear-gradient(-45deg, transparent 75%, #cbd5e1 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0px;
  background-color: #f1f5f9;
  border: 1px solid var(--id-border-strong);
  border-radius: 12px;
  overflow: hidden;
  display: grid; place-items: center;
  padding: 16px;
}
:root[data-theme="dark"] .share-preview-stage {
  background-color: #0f172a;
  background-image:
    linear-gradient(45deg, #1e293b 25%, transparent 25%),
    linear-gradient(-45deg, #1e293b 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1e293b 75%),
    linear-gradient(-45deg, transparent 75%, #1e293b 75%);
}
.share-preview-canvas {
  display: block;
  height: auto;
  max-height: 600px;
  max-width: 100%;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,.18));
}

/* Constrain canvas display dimensions per aspect to keep preview reasonable. */
.share-aspect-story     .share-preview-canvas { width: 320px; }
.share-aspect-square    .share-preview-canvas { width: 380px; }
.share-aspect-landscape .share-preview-canvas { width: 540px; }
.share-aspect-postcard  .share-preview-canvas { width: 320px; }

.share-preview-meta {
  margin-top: 10px; text-align: center;
  font-size: 12px; color: var(--id-text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.share-meta-sep { margin: 0 8px; opacity: 0.4; }

.share-controls { margin-top: 6px; }
.share-ctl-group { margin-bottom: 12px; }
.share-pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.share-toggle-row {
  display: flex; flex-wrap: wrap; gap: 14px 22px;
  margin: 14px 0;
  padding: 12px 14px;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border);
  border-radius: 10px;
}
.share-toggle-row .pw-opt { font-size: 13px; }

.share-presets {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin-top: 4px;
}
.share-preset {
  padding: 4px 10px; border-radius: 999px;
  background: var(--id-surface); border: 1px solid var(--id-border);
  color: var(--id-text); font-weight: 600; font-size: 12px;
  cursor: pointer; transition: all 160ms;
}
.share-preset:hover {
  border-color: var(--tt-sport); color: var(--tt-sport);
}

@media (max-width: 600px) {
  .share-source-row { flex-direction: column; }
  .share-source-row .sport-mode-btn { align-self: stretch !important; margin-left: 0 !important; }
  .share-aspect-story     .share-preview-canvas { width: 240px; }
  .share-aspect-square    .share-preview-canvas { width: 260px; }
  .share-aspect-landscape .share-preview-canvas { width: 320px; }
}

/* ---------- Screenshot BG Remover ---------- */
.ssr-actions-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 16px;
}
.ssr-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: 14px;
}
@media (max-width: 720px) { .ssr-grid { grid-template-columns: 1fr; } }

.ssr-source-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 6px;
}
.ssr-mode-toggle {
  display: inline-flex; padding: 3px;
  background: var(--id-surface-sunken);
  border: 1px solid var(--id-border);
  border-radius: 8px;
}
.ssr-mode-toggle button {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border: none; background: transparent;
  border-radius: 6px;
  font-size: 12px; font-weight: 700; color: var(--id-text-muted);
  cursor: pointer;
  font-family: inherit;
}
.ssr-mode-toggle button.active {
  background: var(--id-surface);
  color: #fc4c02;
  box-shadow: var(--id-shadow-sm);
}

.ssr-source {
  position: relative;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border-strong);
  border-radius: 12px; overflow: hidden;
  padding: 8px;
  user-select: none;
  -webkit-user-select: none;
}
.ssr-source canvas {
  display: block; width: 100%; height: auto;
  max-height: 540px; object-fit: contain;
  border-radius: 8px;
}
.ssr-source.ssr-mode-pick canvas { cursor: crosshair; }
.ssr-source.ssr-mode-crop canvas { cursor: crosshair; }
.ssr-source.ssr-mode-crop canvas:hover { outline: 1px dashed rgba(252, 76, 2, 0.5); outline-offset: -1px; }

.ssr-crop-overlay {
  position: absolute;
  pointer-events: none;
  border: 2px dashed #fc4c02;
  background: rgba(252, 76, 2, 0.06);
  margin: 8px;
}
.ssr-drag-overlay {
  position: absolute;
  pointer-events: none;
  border: 2px solid #16a34a;
  background: rgba(22, 163, 74, 0.12);
  margin: 8px;
}

.ssr-source-hint {
  margin-top: 8px;
  font-size: 12px; color: var(--id-text-muted);
  line-height: 1.5;
}
.ssr-source-hint strong { color: var(--id-text); font-weight: 700; }

/* ---------- Sport tool: Save & history ---------- */
.sport-save-bar {
  display: flex; gap: 8px;
  margin: 18px 0 0;
  padding: 12px 14px;
  background: color-mix(in oklab, var(--tt-sport) 5%, var(--id-surface-alt));
  border: 1px solid color-mix(in oklab, var(--tt-sport) 22%, var(--id-border));
  border-radius: 12px;
}
.sport-save-bar .mini-input { flex: 1; }
.sport-save-bar .btn-primary {
  background: var(--tt-sport); border-color: var(--tt-sport);
  white-space: nowrap;
}
.sport-save-bar .btn-primary:hover { background: var(--tt-sport-deep); border-color: var(--tt-sport-deep); }
.sport-save-bar .btn-primary:disabled { background: var(--id-surface-sunken); border-color: var(--id-border); color: var(--id-text-muted); cursor: not-allowed; }

.sport-save-toast {
  margin-top: 8px;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: color-mix(in oklab, var(--tt-sport) 12%, transparent);
  border: 1px solid color-mix(in oklab, var(--tt-sport) 35%, transparent);
  color: var(--tt-sport-deep);
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
}
.sport-save-toast .dash-linkbtn { margin-left: auto; color: var(--tt-sport-deep); }

.sport-save-history {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--id-border);
  border-radius: 10px;
  background: var(--id-surface-alt);
}
.sport-save-history > summary {
  cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 13px;
}
.sport-save-history > summary > .cmp-meta { font-weight: 500; }

.sport-save-list {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 10px;
}
.sport-save-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  background: var(--id-surface);
  border: 1px solid var(--id-border);
  border-radius: 8px;
  font-size: 13px;
}
.sport-save-row .ssr-row-main { min-width: 0; }
.sport-save-row .ssr-row-label { font-weight: 700; color: var(--id-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sport-save-row .ssr-row-summary { color: var(--id-text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.sport-save-row .ssr-row-time { font-size: 11px; color: var(--id-text-muted); white-space: nowrap; }
.sport-save-row .icon-btn { width: 30px; height: 30px; }

@media (max-width: 540px) {
  .sport-save-bar { flex-direction: column; }
  .sport-save-bar .btn-primary { width: 100%; justify-content: center; }
  .sport-save-row { grid-template-columns: 1fr auto; row-gap: 4px; }
  .sport-save-row .ssr-row-time { grid-column: 1 / -1; order: 3; }
}

/* ---------- Dashboard: Saved section ---------- */
.dash-saves-groups { display: flex; flex-direction: column; gap: 14px; }
.dash-saves-group .dash-card-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.dash-saves-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.dash-save-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 10px 14px;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border);
  border-radius: 10px;
}
.dash-save-main { min-width: 0; }
.dash-save-label { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-save-summary { font-size: 12px; color: var(--id-text-muted); font-variant-numeric: tabular-nums; }
.dash-save-time { white-space: nowrap; font-size: 11px; }
.dash-save-actions { display: flex; gap: 4px; }
@media (max-width: 600px) {
  .dash-save-row { grid-template-columns: 1fr auto; row-gap: 4px; }
  .dash-save-time { grid-column: 1 / -1; order: 3; }
}

/* =============================================================
   Admin · Dashboards v2 — KPI cards, sparklines, charts, insights
   ============================================================= */

.adm-h2-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 4px;
}

/* ---------- KPI cards ---------- */
.mm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin: 10px 0 6px;
}
.mm-kpi-card {
  position: relative;
  padding: 14px 16px;
  background: var(--id-surface);
  border: 1px solid var(--id-border);
  border-radius: 12px;
  transition: border-color 160ms;
}
.mm-kpi-card:hover { border-color: var(--id-border-strong); }
.mm-kpi-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--kpi-accent, transparent);
  border-radius: 12px 0 0 12px;
}
.mm-kpi-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.mm-kpi-row-bottom { margin-top: 4px; }
.mm-kpi-l {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--id-text-muted);
}
.mm-kpi-v {
  font-size: 24px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--id-text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.mm-kpi-s {
  margin-top: 6px;
  font-size: 11px; color: var(--id-text-muted);
}

/* ---------- TrendDelta pill ---------- */
.mm-delta {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid;
  white-space: nowrap;
}
.mm-delta-up   { background: color-mix(in oklab, #10805a 12%, transparent); color: #10805a; border-color: color-mix(in oklab, #10805a 30%, transparent); }
.mm-delta-down { background: color-mix(in oklab, #c8321f 12%, transparent); color: #c8321f; border-color: color-mix(in oklab, #c8321f 30%, transparent); }
.mm-delta-zero { background: var(--id-surface-alt); color: var(--id-text-muted); border-color: var(--id-border); }

/* ---------- Sparkline ---------- */
.mm-sparkline { display: block; }

/* ---------- Time series chart ---------- */
.mm-tsc-wrap { color: var(--id-text); }
.mm-tsc { width: 100%; height: auto; max-height: 320px; display: block; }
.mm-tsc-legend {
  margin-top: 10px;
  display: flex; flex-wrap: wrap; gap: 12px 18px;
  font-size: 12px; color: var(--id-text-muted);
}
.mm-tsc-leg { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.mm-tsc-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

.mm-empty-chart {
  padding: 32px;
  text-align: center;
  color: var(--id-text-muted);
  font-size: 13px;
  background: var(--id-surface-alt);
  border: 1px dashed var(--id-border);
  border-radius: 10px;
}

/* ---------- Bar chart (vertical) ---------- */
.mm-barchart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
  gap: 6px;
  align-items: end;
  padding: 12px;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border);
  border-radius: 10px;
}
.mm-bar-col { display: flex; flex-direction: column; align-items: center; height: 100%; gap: 4px; }
.mm-bar-bg { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.mm-bar-fill { width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; }
.mm-bar-l { font-size: 10px; color: var(--id-text-muted); text-align: center; }
.mm-bar-v { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Donut chart ---------- */
.mm-donut-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  width: auto !important;  /* override the inline width: size */
}
.mm-donut { color: var(--id-text); flex-shrink: 0; }
.mm-donut-legend { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mm-donut-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.mm-donut-swatch { width: 10px; height: 10px; border-radius: 3px; }
.mm-donut-label  { color: var(--id-text); font-weight: 600; }
.mm-donut-pct    { color: var(--id-text-muted); font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- Health panel ---------- */
.adm-health-grid { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.adm-health-row {
  display: grid;
  grid-template-columns: 160px auto 1fr;
  gap: 12px; align-items: center;
  padding: 8px 12px;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border);
  border-radius: 10px;
  font-size: 13px;
}
.adm-health-l { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.adm-health-d { color: var(--id-text-muted); font-size: 12px; text-align: right; }
.mm-health {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid;
}
.mm-health-ok   { background: color-mix(in oklab, #10805a 12%, transparent); color: #10805a; border-color: color-mix(in oklab, #10805a 30%, transparent); }
.mm-health-warn { background: color-mix(in oklab, #b8700a 12%, transparent); color: #b8700a; border-color: color-mix(in oklab, #b8700a 30%, transparent); }
.mm-health-bad  { background: color-mix(in oklab, #c8321f 14%, transparent); color: #c8321f; border-color: color-mix(in oklab, #c8321f 30%, transparent); }
.mm-health-idle { background: var(--id-surface-alt); color: var(--id-text-muted); border-color: var(--id-border); }

/* ---------- Needs-attention panel ---------- */
.adm-attention { display: flex; flex-direction: column; gap: 6px; }
.adm-attn-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border);
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 140ms;
}
.adm-attn-row:hover { border-color: var(--id-border-strong); }
.adm-attn-tag {
  font-family: var(--id-font-mono);
  font-size: 10px; font-weight: 800;
  padding: 3px 8px; border-radius: 6px;
  text-align: center;
}
.adm-attn-warn { background: color-mix(in oklab, #b8700a 14%, var(--id-surface)); color: #b8700a; }
.adm-attn-bad  { background: color-mix(in oklab, #c8321f 14%, var(--id-surface)); color: #c8321f; }
.adm-attn-name { font-weight: 700; color: var(--id-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-attn-meta { color: var(--id-text-muted); font-size: 11px; white-space: nowrap; }

/* ---------- Tools insights (4-card row) ---------- */
.adm-insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.adm-insight-card {
  background: var(--id-surface);
  border: 1px solid;
  border-radius: 12px;
  padding: 12px 14px;
}
.adm-insight-head {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.adm-insight-empty { font-size: 12px; color: var(--id-text-muted); padding: 8px 0; }
.adm-insight-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
  counter-reset: ins;
}
.adm-insight-list li {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
}
.adm-insight-list li:hover { background: var(--id-surface-alt); }
.adm-insight-icon {
  width: 22px; height: 22px;
  border-radius: 6px;
  display: grid; place-items: center;
}
.adm-insight-name {
  font-weight: 600; color: var(--id-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.adm-insight-stat {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 11px;
  white-space: nowrap;
}

/* ---------- Toolbar (search/filter + actions) ---------- */
.adm-toolbar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--id-surface);
  border: 1px solid var(--id-border);
  border-radius: 10px;
}

@media (max-width: 720px) {
  .mm-donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .adm-health-row { grid-template-columns: 1fr auto; }
  .adm-health-d { grid-column: 1 / -1; text-align: left; }
}

/* ---------- Admin · SEO editor ---------- */
.seo-list {
  border: 1px solid var(--id-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--id-surface);
}
.seo-list-row {
  display: grid;
  grid-template-columns: 32px minmax(180px, 1fr) minmax(180px, 1.4fr) minmax(220px, 2fr) 100px 28px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--id-border);
  cursor: pointer;
  font-size: 13px;
  transition: background 140ms;
}
.seo-list-row:last-child { border-bottom: none; }
.seo-list-row:hover { background: var(--id-surface-alt); }
.seo-list-row.is-overridden {
  background: color-mix(in oklab, var(--id-brand-blue) 4%, var(--id-surface));
}
.seo-list-head {
  background: var(--id-surface-sunken);
  cursor: default;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 700; color: var(--id-text-muted);
}
.seo-list-head:hover { background: var(--id-surface-sunken); }

.seo-icon { display: grid; place-items: center; }
.seo-name { min-width: 0; }
.seo-label { font-weight: 700; color: var(--id-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seo-path  {
  font-family: var(--id-font-mono); font-size: 11px;
  color: var(--id-text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block;
}
.seo-cell { min-width: 0; }
.seo-text-1, .seo-text-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.4;
}
.seo-text-1 { color: var(--id-text); font-weight: 600; }
.seo-text-2 { color: var(--id-text-muted); }
.seo-state { display: flex; gap: 4px; align-items: center; }

@media (max-width: 900px) {
  .seo-list-row {
    grid-template-columns: 32px 1fr auto;
    grid-template-rows: auto auto auto;
    row-gap: 4px;
  }
  .seo-icon  { grid-row: 1 / span 3; }
  .seo-name  { grid-column: 2; grid-row: 1; }
  .atlr-cta  { grid-row: 1 / span 3; }
  .seo-cell  { grid-column: 2; }
  .seo-cell:first-of-type { grid-row: 2; }
  .seo-cell:last-of-type  { grid-row: 3; }
  .seo-state { grid-column: 2; grid-row: 1; justify-self: end; }
  .seo-list-head { display: none; }
}

/* SERP preview card inside the SEO modal */
.seo-modal .modal-body { padding: 18px 22px 22px; }

.seo-preview {
  margin-bottom: 18px;
  padding: 14px;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border);
  border-radius: 10px;
}
.seo-preview-l {
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--id-text-muted);
  margin-bottom: 8px;
}
.seo-preview-card {
  background: var(--id-surface);
  border: 1px solid var(--id-border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: 'Arial', sans-serif;
}
.seo-preview-url {
  font-size: 12px; color: #006621; margin-bottom: 4px;
}
.seo-preview-title {
  font-size: 18px; line-height: 1.3;
  color: #1a0dab;
  margin-bottom: 4px;
  text-decoration: underline;
  text-decoration-color: rgba(26, 13, 171, 0.4);
  /* Realistic SERP truncation */
  display: -webkit-box;
  -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}
.seo-preview-desc {
  font-size: 13px; line-height: 1.45;
  color: #4d5156;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
:root[data-theme="dark"] .seo-preview-url   { color: #4ade80; }
:root[data-theme="dark"] .seo-preview-title { color: #93c5fd; text-decoration-color: rgba(147, 197, 253, 0.4); }
:root[data-theme="dark"] .seo-preview-desc  { color: #cbd5e1; }

.seo-counter {
  margin-left: 8px;
  font-weight: 500;
  color: var(--id-text-muted);
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
}

/* =============================================================
   Admin · Tools list view (filters + list + detail modal)
   ============================================================= */

.admin-tool-counts {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 4px 0 14px;
  font-size: 12px; color: var(--id-text-muted);
}
.admin-tool-counts span {
  padding: 4px 10px; border-radius: 999px;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border);
}
.admin-tool-counts span strong { color: var(--id-text); margin-right: 3px; font-weight: 800; }
.admin-tool-counts .atc-prem  { background: color-mix(in oklab, #2563eb 8%, var(--id-surface-alt)); border-color: color-mix(in oklab, #2563eb 28%, var(--id-border)); color: #2563eb; }
.admin-tool-counts .atc-feat  { background: color-mix(in oklab, #ea580c 8%, var(--id-surface-alt)); border-color: color-mix(in oklab, #ea580c 28%, var(--id-border)); color: #ea580c; }
.admin-tool-counts .atc-live  { background: color-mix(in oklab, #16a34a 8%, var(--id-surface-alt)); border-color: color-mix(in oklab, #16a34a 28%, var(--id-border)); color: #16a34a; }
.admin-tool-counts .atc-hid,
.admin-tool-counts .atc-off   { color: #c8321f; }

.admin-filter-block {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 6px;
}
.admin-filter-l {
  width: 78px; flex-shrink: 0;
  font-size: 11px; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--id-text-muted);
}
.admin-filter-block .filter-row { padding: 4px 0; }

.admin-tool-list {
  margin-top: 14px;
  border: 1px solid var(--id-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--id-surface);
}
.admin-tool-list-row {
  display: grid;
  grid-template-columns: 32px minmax(220px, 2.4fr) minmax(120px, 1fr) minmax(120px, 1fr) minmax(140px, 1.1fr) 50px 28px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--id-border);
  cursor: pointer;
  transition: background 140ms;
  font-size: 13px;
}
.admin-tool-list-row:last-child { border-bottom: none; }
.admin-tool-list-row:hover { background: var(--id-surface-alt); }
.admin-tool-list-row.is-hidden { opacity: 0.5; }
.admin-tool-list-row.is-inactive { background: color-mix(in oklab, #c8321f 4%, var(--id-surface)); }

.admin-tool-list-head {
  background: var(--id-surface-sunken);
  cursor: default;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--id-text-muted);
}
.admin-tool-list-head:hover { background: var(--id-surface-sunken); }

.atlr-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
}
.atlr-name { min-width: 0; }
.atlr-title {
  font-weight: 700; color: var(--id-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.atlr-id {
  font-family: var(--id-font-mono);
  font-size: 11px; color: var(--id-text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}
.atlr-cat {
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.atlr-cat-dot {
  width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0;
}
.atlr-tier { font-variant-numeric: tabular-nums; }
.atlr-price {
  font-size: 11px; color: var(--id-text-muted);
  margin-top: 2px; font-weight: 600;
}
.atlr-status { display: flex; flex-wrap: wrap; gap: 4px; }

.atlr-chip {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 7px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.04em;
  border-radius: 6px;
  border: 1px solid;
}
.atlr-feat { background: color-mix(in oklab, #ea580c 14%, var(--id-surface)); color: #ea580c; border-color: color-mix(in oklab, #ea580c 30%, transparent); }
.atlr-live { background: color-mix(in oklab, #16a34a 14%, var(--id-surface)); color: #16a34a; border-color: color-mix(in oklab, #16a34a 30%, transparent); }
.atlr-hid  { background: color-mix(in oklab, #c8321f 12%, var(--id-surface)); color: #c8321f; border-color: color-mix(in oklab, #c8321f 30%, transparent); }
.atlr-off  { background: color-mix(in oklab, #c8321f 12%, var(--id-surface)); color: #c8321f; border-color: color-mix(in oklab, #c8321f 30%, transparent); }
.atlr-baked { background: var(--id-surface-sunken); color: var(--id-text-muted); border-color: var(--id-border); font-style: italic; }
.atlr-auth  { background: color-mix(in oklab, #475569 14%, var(--id-surface)); color: #475569; border-color: color-mix(in oklab, #475569 28%, transparent); }

.admin-tool-counts .atc-auth {
  background: color-mix(in oklab, #475569 8%, var(--id-surface-alt));
  border-color: color-mix(in oklab, #475569 24%, var(--id-border));
  color: #475569;
}

.atlr-sort {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--id-text-muted);
  text-align: center;
}
.atlr-cta {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--id-surface-sunken);
  color: var(--id-text-muted);
  transition: all 160ms;
}
.admin-tool-list-row:hover .atlr-cta {
  background: var(--id-brand-blue);
  color: #fff;
  transform: translateX(2px);
}

@media (max-width: 900px) {
  .admin-tool-list-row {
    grid-template-columns: 32px 1fr auto;
    grid-template-rows: auto auto;
    row-gap: 6px;
  }
  .atlr-icon  { grid-row: 1 / span 2; }
  .atlr-name  { grid-column: 2; grid-row: 1; }
  .atlr-cta   { grid-row: 1 / span 2; }
  .atlr-cat   { grid-column: 2; grid-row: 2; font-size: 11px; }
  .atlr-tier, .atlr-status, .atlr-sort {
    grid-column: 2; grid-row: 2;
    display: inline-flex;
  }
  .atlr-tier { justify-self: end; }
  .atlr-sort { display: none; }
  .admin-tool-list-head { display: none; }
}

/* ---------- Tool detail modal ---------- */
.modal.tool-detail .modal-body { padding: 18px 22px 22px; }

.td-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--id-border);
}
.td-section:last-child { border-bottom: none; }
.td-section-h {
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--id-text-muted);
  margin-bottom: 10px;
}

.td-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 600px) { .td-toggles { grid-template-columns: 1fr; } }
.td-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 160ms;
}
.td-toggle:hover { border-color: var(--id-border-strong); }
.td-toggle.on {
  background: color-mix(in oklab, var(--id-brand-blue) 8%, var(--id-surface-alt));
  border-color: color-mix(in oklab, var(--id-brand-blue) 35%, var(--id-border));
}
.td-toggle.td-auth.on {
  background: color-mix(in oklab, #475569 10%, var(--id-surface-alt));
  border-color: color-mix(in oklab, #475569 38%, var(--id-border));
}
.td-toggle.is-implicit {
  opacity: 0.85;
  background: color-mix(in oklab, #475569 6%, var(--id-surface-alt));
}
.td-toggle.is-implicit input { cursor: not-allowed; }
.td-toggle input { grid-row: 1 / span 2; accent-color: var(--id-brand-blue); width: 18px; height: 18px; cursor: pointer; }
.td-toggle > span:nth-of-type(1) { font-weight: 700; font-size: 14px; }
.td-toggle .td-toggle-help { font-size: 11px; color: var(--id-text-muted); }

.td-section.td-danger {
  background: color-mix(in oklab, #c8321f 4%, transparent);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 8px;
  border: 1px solid color-mix(in oklab, #c8321f 18%, var(--id-border));
}

/* ---------- Inline Sports config block (inside Tools tab) ---------- */
.admin-sports-block {
  margin-top: 22px;
  border: 1px solid color-mix(in oklab, var(--tt-sport) 22%, var(--id-border));
  border-radius: 14px;
  background: color-mix(in oklab, var(--tt-sport) 4%, var(--id-surface));
  overflow: hidden;
}
.admin-sports-block > summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  user-select: none;
}
.admin-sports-block > summary::-webkit-details-marker { display: none; }

.admin-sports-block .asb-icon {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--tt-sport-soft);
  color: var(--tt-sport);
}
.admin-sports-block .asb-title {
  font-weight: 800; font-size: 16px; letter-spacing: -0.01em;
}
.admin-sports-block .asb-sub {
  flex: 1;
  font-size: 12px; color: var(--id-text-muted);
}
.admin-sports-block .asb-chevron {
  color: var(--id-text-muted);
  transition: transform 200ms;
}
.admin-sports-block[open] .asb-chevron { transform: rotate(180deg); }

.admin-sports-body {
  padding: 4px 18px 22px;
  border-top: 1px solid color-mix(in oklab, var(--tt-sport) 18%, var(--id-border));
  background: var(--id-surface);
}

.ssr-preview { padding: 16px; min-height: 200px; }
.ssr-preview-canvas {
  display: block; max-width: 100%; height: auto;
  max-height: 540px;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.18));
}

.ssr-section { margin: 14px 0; }

.ssr-color-chips {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
}
.ssr-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 4px;
  background: var(--id-surface-alt);
  border: 1px solid var(--id-border-strong);
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.ssr-chip-swatch {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
  flex-shrink: 0;
}
.ssr-chip-hex { font-family: var(--id-font-mono); font-size: 11px; }
.ssr-chip-x {
  background: transparent; border: none; cursor: pointer;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 50%; color: var(--id-text-muted);
}
.ssr-chip-x:hover { background: var(--id-surface-sunken); color: #c8321f; }
