:root, [data-theme="light"] {
  --color-bg: #f5f3ee;
  --color-surface: #f9f8f5;
  --color-border: #d4d0c8;
  --color-text: #1e1c17;
  --color-text-muted: #6b6860;
  --color-primary: #1a6b3a;
  --color-primary-hover: #145730;
  --color-primary-highlight: #c8ddd0;
  --radius-full: 9999px;
  --radius-lg: 1rem;
  --shadow-md: 0 4px 16px rgba(30, 28, 23, 0.1);
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
}
[data-theme="dark"] {
  --color-bg: #131210;
  --color-surface: #191814;
  --color-border: #333028;
  --color-text: #e8e4db;
  --color-text-muted: #908c83;
  --color-primary: #4fa86d;
  --color-primary-hover: #3d9259;
  --color-primary-highlight: #1f3829;
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
.shell-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: color-mix(in oklch, var(--color-bg) 88%, transparent);
  border-bottom: 1px solid var(--color-border);
}
.shell-nav-inner, .shell-main {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}
.shell-nav-inner {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.shell-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
}
.shell-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.shell-link, .shell-cta, .locale-card, .tool-card {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}
.shell-link, .shell-cta {
  border-radius: var(--radius-full);
  padding: 0.65rem 1rem;
}
.shell-cta {
  display: inline-flex;
  font-weight: 700;
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.shell-cta:hover { background: var(--color-primary-hover); }
.theme-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}
.shell-main { padding: 3rem 0 5rem; }
.shell-hero {
  padding: 2rem 0 1.5rem;
}
.shell-hero h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.05;
}
.shell-hero p {
  margin: 0 0 1.5rem;
  max-width: 42rem;
  color: var(--color-text-muted);
}
.shell-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}
.shell-card {
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}
.locale-grid, .tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.locale-card, .tool-card {
  display: block;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
}
.locale-card span, .tool-card h2 {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}
.locale-card small { color: var(--color-text-muted); }
.shell-copy ul {
  padding-left: 1.2rem;
}
.shell-copy li + li { margin-top: 0.5rem; }
.inline-link {
  color: var(--color-primary);
  font-weight: 700;
}
.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.tool-panel,
.tool-output,
.tool-source-box,
.tool-note-box,
.tool-group-card {
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}
.tool-panel h2,
.tool-output h2,
.tool-source-box h2,
.tool-note-box h2 {
  margin: 0 0 0.85rem;
  font-size: 1.1rem;
}
.tool-form-grid {
  display: grid;
  gap: 0.9rem;
}
.tool-field-block {
  display: grid;
  gap: 0.35rem;
}
.tool-field-block label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tool-field-block select,
.tool-field-block input {
  width: 100%;
  min-height: 2.9rem;
  border-radius: 0.9rem;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  padding: 0.75rem 0.9rem;
  font: inherit;
}
.tool-helper {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.92rem;
}
.tool-list {
  margin: 0;
  padding-left: 1.15rem;
}
.tool-list li + li {
  margin-top: 0.55rem;
}
.tool-summary {
  margin: 0 0 1rem;
  color: var(--color-text-muted);
}
.tool-columns {
  display: grid;
  gap: 1rem;
}
.tool-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 700;
}
.tool-links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tool-links li + li {
  margin-top: 0.65rem;
}
.tool-links a {
  color: var(--color-primary);
  font-weight: 700;
}
.tool-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.tool-checklist-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  background: var(--color-bg);
}
.tool-checklist-item.is-complete {
  border-color: color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
}
.tool-check-toggle {
  min-width: 5.7rem;
  min-height: 2.2rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 700;
}
.tool-checklist-item.is-complete .tool-check-toggle {
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  border-color: color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
}
.tool-check-copy {
  display: grid;
  gap: 0.2rem;
}
.tool-check-copy strong {
  font-size: 0.96rem;
}
.tool-check-copy span {
  color: var(--color-text-muted);
  font-size: 0.82rem;
}
.tool-source-box p,
.tool-note-box p,
.tool-group-card p {
  margin: 0 0 0.85rem;
  color: var(--color-text-muted);
}
.tool-group-intro {
  margin-bottom: 1rem;
}
.tool-group-grid {
  display: grid;
  gap: 1rem;
}
.tool-group-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}
.tool-subsection + .tool-subsection {
  margin-top: 1rem;
}
.tool-mini-heading {
  margin: 0 0 0.55rem;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text);
}
.tool-inline-note {
  margin-top: 1rem;
  padding: 1rem;
  box-shadow: none;
}
.tool-inline-note h4,
.tool-inline-note p:last-child {
  margin-bottom: 0;
}
.tool-source-box > div p + p {
  margin-top: 0.75rem;
}
.tool-role-grid {
  display: grid;
  gap: 0.75rem;
}
.tool-role-card {
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  background: var(--color-bg);
  overflow: hidden;
}
.tool-role-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  font-weight: 700;
}
.tool-role-summary::-webkit-details-marker {
  display: none;
}
.tool-role-toggle {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.tool-role-body {
  padding: 0 1rem 1rem;
}
.tool-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.55rem 0 0.9rem;
}
.tool-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.tool-empty {
  color: var(--color-text-muted);
}
.ad-shell {
  margin: 1.5rem 0;
  padding: 0.85rem;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: color-mix(in oklch, var(--color-surface) 88%, var(--color-bg));
}
.ad-label {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.ad-placeholder {
  min-height: 96px;
  max-width: 728px;
  margin: 0 auto;
  padding: 1rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: 0.9rem;
  background: var(--color-bg);
  display: grid;
  gap: 0.25rem;
  place-items: center;
  text-align: center;
}
.ad-placeholder strong {
  font-size: 0.96rem;
}
.ad-placeholder span {
  color: var(--color-text-muted);
  font-size: 0.84rem;
}
.ad-live-slot {
  display: none;
  width: min(100%, var(--ad-max-width, 728px));
  min-height: var(--ad-height, 90px);
  margin: 0 auto;
}
.waypoint-ad-unit {
  width: 100%;
  min-height: var(--ad-height, 90px);
}
.ad-shell[data-ad-status="live"] .ad-placeholder {
  display: none;
}
.ad-shell[data-ad-status="live"] .ad-live-slot {
  display: block;
}
@media (max-width: 768px) {
  .shell-nav-inner, .shell-main { width: min(1120px, calc(100% - 1rem)); }
  .tool-layout { grid-template-columns: 1fr; }
}

/* === MOBILE NAV (SHELL PAGES) === */
.shell-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px; height: 38px;
  border-radius: 9999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  padding: 0;
}
.shell-hamburger span {
  display: block;
  width: 16px; height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 180ms ease, opacity 180ms ease;
}
.shell-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.shell-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.shell-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.shell-mobile-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 110;
}
.shell-mobile-overlay.open { display: block; }

.shell-mobile-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(300px, 85vw);
  height: 100dvh;
  z-index: 120;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 260ms cubic-bezier(0.16,1,0.3,1);
}
.shell-mobile-drawer.open { transform: translateX(0); }
.shell-mobile-drawer[hidden] { display: flex; }
.shell-mobile-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem; min-height: 4rem;
  border-bottom: 1px solid var(--color-border);
}
.shell-mobile-drawer-close {
  width: 34px; height: 34px; border-radius: 9999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.shell-mobile-drawer-links {
  list-style: none; padding: 1rem; flex: 1;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.shell-mobile-drawer-links a {
  display: block; padding: 0.65rem 0.85rem;
  border-radius: 0.625rem;
  font-weight: 600; color: var(--color-text);
}
.shell-mobile-drawer-links a:hover { background: var(--color-surface-offset, #eeece7); }

@media (max-width: 768px) {
  .shell-hamburger { display: flex; }
  .shell-actions .shell-link:not(.shell-cta) { display: none; }
}

/* === SHARE & PRINT === */
.tool-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}
.tool-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.4rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
  text-decoration: none;
}
.tool-action-btn:hover { background: var(--color-surface-offset, #eeece7); }
.tool-action-btn.whatsapp { border-color: #25D366; color: #128C5E; }
.tool-action-btn.whatsapp:hover { background: #f0fdf4; }
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-left: 0.5rem;
}
@media print {
  .shell-nav, .tool-action-bar, .shell-hamburger, .scroll-top-btn, .ad-shell { display: none !important; }
  .tool-layout { grid-template-columns: 1fr !important; }
  .tool-panel { display: none !important; }
  .tool-output { box-shadow: none !important; border: 1px solid #ccc !important; }
}
