/* Shared shell, themes, and paywall styling */
:root {
  --yst-shell-bg: rgba(8, 12, 30, 0.82);
  --yst-shell-card: rgba(10, 18, 44, 0.9);
  --yst-shell-line: rgba(158, 174, 255, 0.2);
  --yst-shell-ink: #eef3ff;
  --yst-shell-muted: #a3afd6;
  --yst-shell-accent: #6a5bff;
  --yst-shell-accent-2: #8a6bff;
}

html[data-yst-theme="obsidian"] {
  --yst-shell-bg: rgba(8, 12, 30, 0.82);
  --yst-shell-card: rgba(10, 18, 44, 0.9);
  --yst-shell-line: rgba(158, 174, 255, 0.22);
  --yst-shell-ink: #eef3ff;
  --yst-shell-muted: #a3afd6;
  --yst-shell-accent: #6a5bff;
  --yst-shell-accent-2: #8a6bff;
  --bg: #040a21;
  --ink: #eef3ff;
  --muted: #a3afd6;
  --panel: rgba(10, 18, 44, 0.92);
  --line: rgba(158, 174, 255, 0.2);
  --accent: #6a5bff;
  --accent2: #8a6bff;
  --brand: #6a5bff;
  --brand-2: #8a6bff;
}

html[data-yst-theme="copper"] {
  --yst-shell-bg: rgba(26, 16, 17, 0.84);
  --yst-shell-card: rgba(42, 22, 25, 0.9);
  --yst-shell-line: rgba(255, 194, 140, 0.24);
  --yst-shell-ink: #fff4e8;
  --yst-shell-muted: #e8bf9f;
  --yst-shell-accent: #f06f32;
  --yst-shell-accent-2: #ff9550;
  --bg: #12090a;
  --ink: #fff4e8;
  --muted: #e8bf9f;
  --panel: rgba(42, 22, 25, 0.92);
  --line: rgba(255, 194, 140, 0.2);
  --accent: #f06f32;
  --accent2: #ff9550;
  --brand: #f06f32;
  --brand-2: #ff9550;
}

html[data-yst-theme="ice"] {
  --yst-shell-bg: rgba(5, 22, 37, 0.84);
  --yst-shell-card: rgba(8, 31, 53, 0.9);
  --yst-shell-line: rgba(103, 199, 255, 0.25);
  --yst-shell-ink: #e6f7ff;
  --yst-shell-muted: #9bcde3;
  --yst-shell-accent: #1ea9f5;
  --yst-shell-accent-2: #53c3ff;
  --bg: #03121f;
  --ink: #e6f7ff;
  --muted: #9bcde3;
  --panel: rgba(8, 31, 53, 0.92);
  --line: rgba(103, 199, 255, 0.2);
  --accent: #1ea9f5;
  --accent2: #53c3ff;
  --brand: #1ea9f5;
  --brand-2: #53c3ff;
}

html[data-yst-theme="obsidian"] body {
  background: radial-gradient(1200px 640px at 8% -20%, rgba(106, 91, 255, 0.2), transparent 62%),
    radial-gradient(900px 520px at 98% -12%, rgba(70, 87, 226, 0.26), transparent 64%),
    #040a21 !important;
}

html[data-yst-theme="copper"] body {
  background: radial-gradient(1200px 640px at 8% -20%, rgba(240, 111, 50, 0.22), transparent 62%),
    radial-gradient(900px 520px at 98% -12%, rgba(255, 149, 80, 0.24), transparent 64%),
    #12090a !important;
}

html[data-yst-theme="ice"] body {
  background: radial-gradient(1200px 640px at 8% -20%, rgba(30, 169, 245, 0.2), transparent 62%),
    radial-gradient(900px 520px at 98% -12%, rgba(83, 195, 255, 0.24), transparent 64%),
    #03121f !important;
}

.yst-shell-navbar,
.navbar.yst-shell-navbar,
#yst-shell-header.yst-shell-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2100;
  background: linear-gradient(90deg, rgba(7, 12, 33, 0.92), rgba(18, 22, 64, 0.9));
  border-bottom: 1px solid var(--yst-shell-line);
  box-shadow: 0 16px 34px rgba(2, 6, 20, 0.4);
  backdrop-filter: blur(18px) saturate(130%);
}

.yst-nav-inner,
.nav-inner.yst-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 11px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  color: var(--yst-shell-ink);
}

.yst-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--yst-shell-ink);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 12px;
}

.yst-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid var(--yst-shell-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--yst-shell-accent), var(--yst-shell-accent-2));
  color: #f6f7ff;
  font-size: 10px;
  font-weight: 900;
}

.yst-links {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.yst-links > a,
.yst-tools-toggle {
  color: var(--yst-shell-muted);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.02em;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px 0;
}

.yst-links > a:hover,
.yst-tools-toggle:hover,
.yst-links > a.yst-active {
  color: var(--yst-shell-ink);
}

.yst-tools-menu-wrap {
  position: relative;
}

.yst-tools-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 290px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--yst-shell-card);
  border: 1px solid var(--yst-shell-line);
  border-radius: 12px;
  padding: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 22px 42px rgba(2, 6, 20, 0.5);
}

.yst-tools-menu-wrap:hover .yst-tools-menu,
.yst-tools-menu-wrap:focus-within .yst-tools-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.yst-tools-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--yst-shell-ink);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.35;
}

.yst-tools-menu a small {
  display: block;
  color: var(--yst-shell-muted);
  margin-top: 2px;
}

.yst-tools-menu a:hover {
  background: rgba(134, 148, 255, 0.14);
}

.yst-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.yst-account-mini {
  color: var(--yst-shell-muted);
  font-size: 11px;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yst-theme-btn {
  border: 1px solid var(--yst-shell-line);
  background: rgba(138, 155, 255, 0.1);
  color: var(--yst-shell-ink);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-transform: uppercase;
}

.yst-shell-cta,
.nav-cta.yst-shell-cta,
a.nav-cta.yst-shell-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(120deg, var(--yst-shell-accent), var(--yst-shell-accent-2));
  color: #f8faff;
  border: 0;
  box-shadow: 0 8px 24px rgba(106, 91, 255, 0.4);
}

.yst-nav-inner .nav-cta:not(.yst-shell-cta),
.yst-nav-inner button.nav-cta:not(.yst-shell-cta) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 999px;
  padding: 7px 12px;
  border: 1px solid var(--yst-shell-line);
  background: rgba(156, 173, 255, 0.1);
  color: var(--yst-shell-ink);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.yst-shell-spacer,
.nav-spacer {
  height: 66px;
}

#yst-shell-footer {
  margin-top: 40px;
  border-top: 1px solid var(--yst-shell-line);
  background: rgba(7, 11, 28, 0.78);
}

#yst-shell-footer .yst-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  color: var(--yst-shell-muted);
  font-size: 12px;
}

#yst-shell-footer h4 {
  margin: 0 0 8px;
  color: var(--yst-shell-ink);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 11px;
}

#yst-shell-footer a {
  color: var(--yst-shell-muted);
  text-decoration: none;
}

#yst-shell-footer a:hover {
  color: var(--yst-shell-ink);
}

#yst-shell-footer .yst-footer-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
}

#yst-paywall-overlay {
  position: fixed;
  inset: 0;
  z-index: 2600;
  background: rgba(4, 6, 8, 0.78);
  backdrop-filter: blur(4px);
  display: none;
  place-items: center;
  padding: 16px;
}

#yst-paywall-overlay .yst-paywall-card {
  width: min(560px, 100%);
  background: var(--yst-shell-card);
  border: 1px solid var(--yst-shell-line);
  border-radius: 16px;
  padding: 20px;
  color: var(--yst-shell-ink);
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.45);
}

#yst-paywall-overlay h3 {
  margin: 0;
  font-size: 22px;
}

#yst-paywall-overlay p {
  color: var(--yst-shell-muted);
  line-height: 1.45;
  margin: 10px 0 0;
}

.yst-paywall-meta {
  margin-top: 12px;
  border: 1px solid var(--yst-shell-line);
  background: rgba(118, 136, 220, 0.08);
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
}

.yst-paywall-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.yst-paywall-actions a,
.yst-paywall-actions button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.yst-paywall-actions .yst-primary {
  background: linear-gradient(120deg, var(--yst-shell-accent), var(--yst-shell-accent-2));
  color: #f7fbff;
}

.yst-paywall-actions .yst-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--yst-shell-ink);
  border: 1px solid var(--yst-shell-line);
}

/* Unified tool-page visual system */
body[data-yst-page="tool"] {
  --bg: #040a21;
  --ink: #edf3ff;
  --muted: #a8b5de;
  --panel: rgba(10, 20, 49, 0.9);
  --panel-soft: rgba(14, 28, 66, 0.9);
  --line: rgba(150, 168, 255, 0.22);
  --accent: #6a5bff;
  --accent2: #8a6bff;
  --brand: #6a5bff;
  --brand-2: #8a6bff;
  background:
    radial-gradient(1200px 640px at 8% -20%, rgba(106, 91, 255, 0.2), transparent 62%),
    radial-gradient(900px 520px at 98% -12%, rgba(70, 87, 226, 0.26), transparent 64%),
    radial-gradient(circle at 1px 1px, rgba(150, 168, 255, 0.12) 1px, transparent 0),
    #040a21 !important;
  background-size: auto, auto, 42px 42px, auto !important;
  color: var(--ink) !important;
}

body[data-yst-page="tool"] .page,
body[data-yst-page="tool"] .wrap {
  max-width: 1380px !important;
}

body[data-yst-page="tool"] .hero,
body[data-yst-page="tool"] .panel,
body[data-yst-page="tool"] .card,
body[data-yst-page="tool"] .topbar,
body[data-yst-page="tool"] .status,
body[data-yst-page="tool"] .insight,
body[data-yst-page="tool"] .table-wrap,
body[data-yst-page="tool"] .mini-table-wrap,
body[data-yst-page="tool"] .filter-grid,
body[data-yst-page="tool"] .grand-total,
body[data-yst-page="tool"] .tools-proof,
body[data-yst-page="tool"] .auth-card {
  background: var(--panel) !important;
  border: 1px solid var(--line) !important;
  color: var(--ink) !important;
  box-shadow: 0 16px 38px rgba(3, 8, 28, 0.45) !important;
}

body[data-yst-page="tool"] h1,
body[data-yst-page="tool"] h2,
body[data-yst-page="tool"] h3,
body[data-yst-page="tool"] h4,
body[data-yst-page="tool"] strong,
body[data-yst-page="tool"] .title,
body[data-yst-page="tool"] .metric-value,
body[data-yst-page="tool"] .signed-user,
body[data-yst-page="tool"] .brand {
  color: var(--ink) !important;
}

body[data-yst-page="tool"] .sub,
body[data-yst-page="tool"] label,
body[data-yst-page="tool"] .card .t,
body[data-yst-page="tool"] .card .s,
body[data-yst-page="tool"] .metric-note,
body[data-yst-page="tool"] .status,
body[data-yst-page="tool"] .table-note,
body[data-yst-page="tool"] .info-line {
  color: var(--muted) !important;
}

body[data-yst-page="tool"] input,
body[data-yst-page="tool"] select,
body[data-yst-page="tool"] textarea,
body[data-yst-page="tool"] .file,
body[data-yst-page="tool"] .inline-check {
  background: rgba(8, 16, 42, 0.86) !important;
  border: 1px solid rgba(150, 168, 255, 0.32) !important;
  color: var(--ink) !important;
}

body[data-yst-page="tool"] input:focus,
body[data-yst-page="tool"] select:focus,
body[data-yst-page="tool"] textarea:focus {
  outline: none !important;
  border-color: rgba(138, 107, 255, 0.75) !important;
  box-shadow: 0 0 0 3px rgba(138, 107, 255, 0.2) !important;
}

body[data-yst-page="tool"] .btn,
body[data-yst-page="tool"] button,
body[data-yst-page="tool"] .actions a,
body[data-yst-page="tool"] .yst-tool-actions a {
  background: rgba(21, 34, 76, 0.9) !important;
  border: 1px solid rgba(150, 168, 255, 0.3) !important;
  color: var(--ink) !important;
}

body[data-yst-page="tool"] .btn-primary,
body[data-yst-page="tool"] .btn.primary,
body[data-yst-page="tool"] .btn.a,
body[data-yst-page="tool"] .nav-cta.yst-shell-cta {
  background: linear-gradient(135deg, var(--accent), var(--accent2)) !important;
  border-color: transparent !important;
  color: #f8fbff !important;
}

body[data-yst-page="tool"] table th {
  background: rgba(17, 31, 72, 0.9) !important;
  color: #d8e3ff !important;
  border-color: var(--line) !important;
}

body[data-yst-page="tool"] table td {
  border-color: rgba(150, 168, 255, 0.18) !important;
  color: var(--ink) !important;
}

body[data-yst-page="tool"] .good,
body[data-yst-page="tool"] .ok {
  color: #4ade80 !important;
}

body[data-yst-page="tool"] .warn {
  color: #fbbf24 !important;
}

body[data-yst-page="tool"] .bad,
body[data-yst-page="tool"] .danger {
  color: #f87171 !important;
}

@media (max-width: 900px) {
  .yst-nav-inner,
  .nav-inner.yst-nav-inner {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .yst-right {
    justify-content: space-between;
  }

  #yst-shell-footer .yst-footer-inner {
    grid-template-columns: 1fr;
  }

  #yst-shell-footer .yst-footer-tools {
    grid-template-columns: 1fr;
  }
}
