/* NSM Micro-Tools Hub — Clean-Room Design System */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #3730a3;
  --primary-hover: #312e81;
  --primary-soft: #eef2ff;
  --accent: #0f766e;
  --accent-soft: #ccfbf1;
  --success: #15803d;
  --success-soft: #dcfce7;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --container-max: 1180px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 16px;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.site-nav {
  display: none;
  align-items: center;
  gap: 18px;
}

.site-nav.is-open {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  padding: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.site-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--primary);
  text-decoration: none;
}

@media (min-width: 860px) {
  .nav-toggle {
    display: none;
  }
  .site-nav {
    display: flex;
    flex-direction: row;
    position: static;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
}

/* Buttons & Badges */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-subtle);
}

.btn-accent {
  background: var(--accent);
  color: #ffffff;
}

.btn-accent:hover:not(:disabled) {
  background: #0d5e57;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
}

.badge-live {
  background: var(--success-soft);
  color: var(--success);
}

.badge-play {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-roadmap {
  background: var(--surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-warn {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Main Layout & Hero */
main {
  padding-block: 28px 56px;
}

.hero {
  background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 28px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0 0 18px;
  color: var(--text-muted);
  max-width: 72ch;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.section {
  margin-block: 36px;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.section-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Grids & Cards */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.3;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-actions {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Tool Workspace */
.tool-header {
  margin-bottom: 20px;
}

.tool-header h1 {
  margin: 8px 0 6px;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
}

.tool-header p {
  margin: 0;
  color: var(--text-muted);
}

.tool-workspace {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 960px) {
  .tool-workspace {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.panel h2, .panel h3 {
  margin-top: 0;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  .form-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.9rem;
  margin-block: 10px;
}

.alert-info {
  background: var(--primary-soft);
  border-color: #c7d2fe;
  color: var(--primary);
}

.alert-success {
  background: var(--success-soft);
  border-color: #bbf7d0;
  color: var(--success);
}

.alert-warn {
  background: var(--warning-soft);
  border-color: #fde68a;
  color: var(--warning);
}

.alert-danger {
  background: var(--danger-soft);
  border-color: #fecaca;
  color: var(--danger);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-subtle);
  font-weight: 600;
}

/* Play CTA Strip */
.play-cta-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-block: 24px;
  padding: 20px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  border-radius: var(--radius-md);
}

.play-cta-card h2,
.play-cta-card p {
  margin: 0;
  color: #f8fafc;
}

.play-cta-card p {
  color: #cbd5e1;
  font-size: 0.93rem;
  margin-top: 4px;
}

.play-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* AdSense Zero-CLS Container */
.ad-slot {
  min-height: 118px;
  margin: 24px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  contain: layout style;
}

.ad-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* Content Sandwich */
.content-sandwich {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 24px;
}

.content-sandwich h2 {
  margin-top: 22px;
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.content-sandwich h2:first-child {
  margin-top: 0;
}

.content-sandwich details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 10px;
  background: var(--bg);
}

.content-sandwich summary {
  cursor: pointer;
  font-weight: 600;
}

.content-sandwich details p {
  margin: 8px 0 0;
  color: var(--text-muted);
}

/* Catalog Filters */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.is-hidden {
  display: none !important;
}

/* Tool-specific utilities */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 22px;
  text-align: center;
  background: var(--surface-subtle);
  cursor: pointer;
}

.dropzone.is-dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.timer-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.timer-display {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.qr-preview-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 16px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.qr-preview-box svg {
  max-width: 260px;
  height: auto;
  display: block;
}

.preview-img {
  max-width: 100%;
  max-height: 240px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  object-fit: contain;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-md);
}

/* Consent Banner */
.consent-banner {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 40;
  background: #0f172a;
  color: #f8fafc;
  border-top: 1px solid #334155;
  padding: 14px 16px;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.25);
}

.consent-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.consent-inner p {
  margin: 0;
  font-size: 0.88rem;
  color: #e2e8f0;
  max-width: 72ch;
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.consent-prefs {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #334155;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 0.88rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: 28px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 18px;
}

.footer-grid h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--text);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.footer-legal {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
}
