/* ==========================================================================
   Google Play PolicyHub - Modern Design System & Accessible Styles
   ========================================================================== */

:root {
  /* Touch target sizes conforming to modern web guidance (WCAG 2.5.5 / 2.5.8) */
  --target-size: 28px;

  /* Color Palette - Dark Theme */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(31, 41, 55, 0.95);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;

  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.25);
  
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.14);

  --bg-code: #0d1117;
  --bg-code-header: #161b22;
  --text-code: #e6edf3;
  --text-code-title: #c9d1d9;
  --border-code: rgba(255, 255, 255, 0.08);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Monaco, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

[data-theme="light"] {
  /* Crisp Clean White Theme */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border-color: #e2e8f0;
  --border-focus: #2563eb;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.15);

  --success: #059669;
  --success-bg: #ecfdf5;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;

  --bg-code: #f8fafc;
  --bg-code-header: #edf2f7;
  --text-code: #0f172a;
  --text-code-title: #334155;
  --border-code: #cbd5e1;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 12px 28px -4px rgba(0, 0, 0, 0.1);
}

/* Base Resets, Modern Fluid Typography & Touch Sizing */
@media (pointer: coarse) {
  :root {
    --target-size: 44px;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:where(button, select, textarea, input:not([type="checkbox"], [type="radio"]), [role="button"], nav a) {
  min-block-size: var(--target-size);
}

:where(label:has(input[type="checkbox"], input[type="radio"])) {
  min-block-size: var(--target-size);
  display: inline-flex;
}

img, svg {
  max-inline-size: 100%;
  block-size: auto;
}

html {
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  overflow-x: hidden;
}

h1, h2, h3 {
  text-wrap: balance;
}

p, li {
  text-wrap: pretty;
}

:where(a, code) {
  overflow-wrap: anywhere;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 3.5vw, 1.5rem);
  padding-left: max(clamp(1rem, 3.5vw, 1.5rem), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(1rem, 3.5vw, 1.5rem), env(safe-area-inset-right, 0px));
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==========================================================================
   Header & Theme Toggle
   ========================================================================== */
.app-header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background-color: var(--border-color);
}

[data-theme="dark"] .light-icon { display: inline-block; }
[data-theme="dark"] .dark-icon { display: none; }
[data-theme="light"] .light-icon { display: none; }
[data-theme="light"] .dark-icon { display: inline-block; }

/* ==========================================================================
   Hero Banner
   ========================================================================== */
.hero-banner {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border-color);
  padding-block: 2.5rem 2rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  background-color: var(--accent-glow);
  color: var(--accent-primary);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.hero-heading {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.hero-text {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 650px;
}

.hero-stats {
  display: flex;
  gap: 1.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  justify-content: space-around;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-number {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--accent-primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ==========================================================================
   Tabs Navigation (Following modern-web-guidance accessible pattern)
   ========================================================================== */
.tabs-nav-container {
  margin-top: 1.5rem;
}

.tabs-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

.tabs-list [role="tab"] {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color var(--transition-fast);
}

.tabs-list [role="tab"]:hover {
  color: var(--text-primary);
}

/* Mandatory WCAG 1.4.1 Accessible underline border */
.tabs-list [role="tab"][aria-selected="true"] {
  color: var(--accent-primary);
}

.tabs-list [role="tab"][aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0 -2px 0;
  border-block-end: 3px solid var(--accent-primary);
  border-radius: 3px 3px 0 0;
}

.tabs-list [role="tab"]:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

/* Panels */
.tab-panel {
  display: block;
}

.tab-panel[hidden] {
  display: none !important;
}

/* ==========================================================================
   Cards & Layouts
   ========================================================================== */
.main-content {
  flex: 1;
  padding-block: 2rem 4rem;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.section-heading {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Panel 1: Policies Knowledge Hub Styles
   ========================================================================== */
.policies-toolbar-card {
  margin-bottom: 1.75rem;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.search-component {
  flex: 1;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.85rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input:focus-visible {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.count-badge {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.category-chips-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.chips-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.category-chips-list {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.chip-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip-button:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

.chip-button.active {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

/* Policy Card Grid */
.policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 1.5rem;
}

.policy-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
}

.policy-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: var(--shadow-md);
}

.policy-card.severity-critical {
  border-left: 4px solid var(--danger);
}

.policy-card.severity-high {
  border-left: 4px solid var(--warning);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.policy-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.severity-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.severity-critical {
  background-color: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.severity-high {
  background-color: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.65rem;
}

.card-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  flex: 1;
}

.policy-highlights {
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-color);
}

.policy-highlights strong {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.rule-snippet {
  color: var(--text-secondary);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
  gap: 0.5rem;
}

.console-tag {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   Panel 2: Compliance Checker Styles
   ========================================================================== */
.checker-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* Accessible Form Styles */
.accessible-form .form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.form-label .required {
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.form-control:focus-visible {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* modern-web-guidance: :user-invalid styling */
.form-control:user-invalid {
  border-color: var(--danger);
}

.form-helper {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

.form-fieldset {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  background-color: rgba(255, 255, 255, 0.01);
}

.fieldset-legend {
  font-size: 0.95rem;
  font-weight: 700;
  padding-inline: 0.5rem;
  color: var(--text-primary);
}

.fieldset-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.custom-checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.custom-checkbox-card:hover {
  background-color: var(--bg-card-hover);
  border-color: rgba(59, 130, 246, 0.3);
}

.custom-checkbox-card input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.checkbox-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.checkbox-risk {
  font-size: 0.78rem;
  color: var(--text-secondary);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.perm-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.mini-severity {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
}

.mini-severity.critical {
  background-color: var(--danger-bg);
  color: var(--danger);
}

.mini-severity.high {
  background-color: var(--warning-bg);
  color: var(--warning);
}

.mini-severity.medium {
  background-color: var(--accent-glow);
  color: var(--accent-primary);
}

/* Compliance Audit Output */
.audit-verdict-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.75rem;
}

.verdict-pass {
  background-color: var(--success-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.verdict-warning {
  background-color: var(--warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.verdict-fail {
  background-color: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.verdict-icon {
  font-size: 2.25rem;
}

.verdict-content {
  flex: 1;
}

.verdict-badge {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.verdict-pass .verdict-badge { color: var(--success); }
.verdict-warning .verdict-badge { color: var(--warning); }
.verdict-fail .verdict-badge { color: var(--danger); }

.verdict-title {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 0.35rem;
}

.verdict-summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.compliance-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 1rem;
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.gauge-score {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
}

.gauge-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.audit-section {
  margin-bottom: 1.75rem;
}

.audit-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.violations-list, .warnings-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.violation-card {
  background-color: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 0.88rem;
}

.viol-desc {
  margin-block: 0.35rem;
  color: var(--text-secondary);
}

.viol-solution {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.solution-tag {
  color: var(--success);
}

.warning-item {
  background-color: var(--warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
}

.warn-action {
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 0.35rem;
  color: var(--text-primary);
}

.blueprint-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.blueprint-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.88rem;
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.blueprint-check {
  color: var(--success);
  font-weight: bold;
}

.applicable-policies-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.applicable-policy-card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.app-pol-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.severity-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
}

.severity-pill.critical { background-color: var(--danger-bg); color: var(--danger); }
.severity-pill.high { background-color: var(--warning-bg); color: var(--warning); }

.console-sub-pill {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.app-pol-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.app-pol-summary {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Panel 3: Prompt Rewriter & Optimizer Styles
   ========================================================================== */
.rewriter-layout {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr;
  gap: 2rem;
  align-items: start;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.65rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.badge-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  background-color: var(--accent-glow);
  color: var(--accent-primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
  white-space: nowrap;
}

.badge-pill.pass {
  background-color: var(--success-bg);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.3);
}

.form-row {
  display: flex;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.col-half {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.label-with-samples {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
}

.prompt-textarea {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  resize: vertical;
  min-height: 140px;
  line-height: 1.5;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.prompt-textarea.input-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-bg);
}

.textarea-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
}

.ai-settings-card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ai-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.switch-container {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.88rem;
}

.engine-badge {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.api-key-group {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
}

.api-key-group.hidden {
  display: none;
}

.input-with-button {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}

.form-label-sm {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-helper-sm {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Rewritten Output View */
.rewritten-output-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.audit-summary-box {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.audit-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.detected-risks-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.risk-notice-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--warning);
}

.risk-badge-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
}

.risk-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  margin-right: 0.4rem;
}

.risk-tag.critical { background-color: var(--danger-bg); color: var(--danger); }
.risk-tag.high { background-color: var(--warning-bg); color: var(--warning); }

.risk-rule {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.mitigations-row {
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.mitigation-bullets {
  list-style: none;
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mitigation-bullets li {
  color: var(--success);
  font-size: 0.82rem;
}

.code-output-block {
  background-color: var(--bg-code, #0d1117);
  border: 1px solid var(--border-code, var(--border-color));
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.code-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background-color: var(--bg-code-header, #161b22);
  border-bottom: 1px solid var(--border-code, var(--border-color));
}

.code-output-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-code-title, #c9d1d9);
}

.code-pre {
  padding: 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-code, #e6edf3);
  max-height: 480px;
}

.store-listing-kit-card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.listing-kit-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.listing-field {
  margin-bottom: 1.25rem;
}

.field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.field-counter {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.field-counter.over-limit {
  color: var(--danger);
  font-weight: bold;
}

.field-display {
  padding: 0.75rem 1rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
}

.field-display-pre {
  padding: 1rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  white-space: pre-wrap;
  color: var(--text-secondary);
  line-height: 1.55;
  max-height: 250px;
  overflow-y: auto;
}

.console-checklist-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.85rem;
}

.console-checklist-box ul {
  list-style: none;
  margin-top: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.console-checklist-box li {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-primary);
}

/* ==========================================================================
   Panel 4: Checklist Manager Styles
   ========================================================================== */
.checklist-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-box {
  width: 280px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.progress-numbers {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.progress-percent {
  color: var(--accent-primary);
}

.progress-track {
  height: 8px;
  background-color: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  transition: width var(--transition-normal);
}

.checklist-content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
}

.checklist-cat-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--accent-primary);
}

.checklist-items-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checklist-item-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.checklist-item-row:hover {
  background-color: var(--bg-card-hover);
}

.checklist-item-row.is-done {
  opacity: 0.65;
  background-color: var(--success-bg);
  border-color: rgba(16, 185, 129, 0.2);
}

.checklist-checkbox {
  margin-top: 0.25rem;
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--success);
  cursor: pointer;
}

.item-text-wrapper {
  display: flex;
  flex-direction: column;
}

.item-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.checklist-item-row.is-done .item-title {
  text-decoration: line-through;
}

.item-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.item-official-link {
  font-size: 0.75rem;
  color: var(--accent-primary);
  text-decoration: none;
  margin-top: 0.35rem;
}

.item-official-link:hover {
  text-decoration: underline;
}

.checklist-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* ==========================================================================
   Buttons & Micro-interactions
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.primary-btn {
  background-color: var(--accent-primary);
  color: #ffffff;
}

.primary-btn:hover {
  background-color: var(--accent-primary-hover);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.secondary-btn {
  background-color: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.secondary-btn:hover {
  background-color: var(--border-color);
}

.secondary-btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  background-color: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.text-btn {
  background: transparent;
  color: var(--accent-primary);
  padding: 0;
  font-size: 0.85rem;
}

.text-btn:hover {
  text-decoration: underline;
}

.text-btn-sm {
  background: transparent;
  border: none;
  color: var(--accent-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.text-btn-sm:hover {
  text-decoration: underline;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 0.95rem 1.5rem;
  font-size: 1rem;
}

.output-actions {
  display: flex;
  gap: 0.5rem;
}

.output-actions.hidden {
  display: none;
}

.copy-success {
  background-color: var(--success) !important;
  color: #ffffff !important;
}

/* Empty & Loading States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3.5rem 1.5rem;
}

.empty-icon {
  font-size: 2.75rem;
  margin-bottom: 1rem;
  opacity: 0.75;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 480px;
  margin-bottom: 1.25rem;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  text-align: center;
}

.spinner {
  width: 2.75rem;
  height: 2.75rem;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1.25rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Modal Dialog (Native <dialog> with modern-web-guidance)
   ========================================================================== */
.modal-dialog {
  border: none;
  border-radius: var(--radius-lg);
  background-color: var(--bg-card);
  color: var(--text-primary);
  max-width: 720px;
  width: 90vw;
  max-height: 85vh;
  margin: auto;
  box-shadow: var(--shadow-lg);
  padding: 0;
  overflow: hidden;
}

.modal-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}

.modal-dialog-content {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
}

.modal-close-btn:hover {
  background-color: var(--border-color);
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
}

.modal-policy-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.policy-badges {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.modal-policy-title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.modal-policy-summary {
  color: var(--text-secondary);
  font-size: 1rem;
}

.modal-section {
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.rejection-title {
  color: var(--danger);
}

.callout-box {
  background-color: var(--bg-tertiary);
  border-left: 4px solid var(--accent-primary);
  padding: 1rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.action-list, .rejection-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.action-list li, .rejection-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.9rem;
}

.check-icon {
  color: var(--success);
  font-weight: bold;
}

.warn-icon {
  color: var(--danger);
  font-weight: bold;
}

.console-section {
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1rem;
  border: 1px solid var(--border-color);
}

.console-path code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--accent-primary);
}

mark.highlight {
  background-color: rgba(245, 158, 11, 0.35);
  color: inherit;
  padding: 0.1rem 0.2rem;
  border-radius: 3px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding-block: 2rem;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-left p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.footer-links a {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Panel 5: Policy & Legal Creator Styles
   ========================================================================== */
.policy-gen-layout {
  display: grid;
  grid-template-columns: 1.15fr 1.35fr;
  gap: 2rem;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.doc-type-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
  width: 100%;
  max-width: 100%;
}

.doc-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.doc-chip-btn:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

.doc-chip-btn.active {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

.doc-type-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.view-mode-tabs {
  display: flex;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 3px;
  border: 1px solid var(--border-color);
  gap: 3px;
  max-width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap;
}

.view-mode-btn {
  padding: 0.35rem 0.65rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.view-mode-btn.active {
  background-color: var(--bg-card);
  color: var(--accent-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.policy-actions-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-block: 0.85rem 1.25rem;
  width: 100%;
  max-width: 100%;
}

.document-output-viewport {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--bg-primary);
  margin-bottom: 1.5rem;
  max-width: 100%;
  box-sizing: border-box;
}

.document-paper {
  background-color: #ffffff;
  color: #1e293b;
  padding: clamp(1rem, 3.5vw, 2.25rem);
  max-height: 600px;
  overflow-y: auto;
  overflow-x: hidden;
  line-height: 1.7;
  font-size: 0.92rem;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
}

.document-paper h1 {
  font-size: 1.5rem;
  color: #0f172a;
  margin-top: 0;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.5rem;
  overflow-wrap: break-word;
}

.document-paper h2 {
  font-size: 1.15rem;
  color: #0f172a;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.35rem;
  overflow-wrap: break-word;
}

.document-paper h3 {
  font-size: 1rem;
  color: #1e293b;
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  overflow-wrap: break-word;
}

.document-paper p,
.document-paper li {
  color: #334155;
  margin-bottom: 0.5rem;
  overflow-wrap: break-word;
}

.document-paper ul {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.document-paper hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin-block: 1.25rem;
}

.document-paper code {
  font-family: var(--font-mono);
  background-color: #f1f5f9;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.88em;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.document-code-view {
  max-height: 600px;
  overflow-y: auto;
  max-width: 100%;
  box-sizing: border-box;
}

.document-code-view.hidden,
.document-paper.hidden {
  display: none !important;
}

.console-link-guidance-box {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 1.15rem;
  color: #1e3a8a;
  font-size: 0.85rem;
  max-width: 100%;
  box-sizing: border-box;
}

.console-link-guidance-box h4 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: #1e40af;
}

.console-link-guidance-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.console-link-guidance-box li code {
  background-color: #dbeafe;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: #1e3a8a;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   SEO Content Sections, Accordion FAQ & Playbooks
   ========================================================================== */
.seo-content-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.step-card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  position: relative;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.step-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
}

.step-num {
  display: inline-block;
  font-size: 1.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  margin-bottom: 0.75rem;
  line-height: 1;
}

.step-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.step-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.playbooks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.playbook-item {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.playbook-item h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--text-primary);
}

.playbook-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Accordion FAQ (Modern Web Guidance Pattern) */
.accordion.seo-faq-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-tertiary);
  margin-bottom: 0.85rem;
  overflow: hidden;
  transition: border-color var(--transition-fast);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.faq-item[open] {
  border-color: var(--accent-primary);
  background-color: var(--bg-card);
}

.faq-item summary:where(:not([aria-disabled="true"])) {
  cursor: pointer;
  padding: 1.1rem 1.25rem;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  user-select: none;
  gap: 0.5rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--accent-primary);
  transition: transform var(--transition-fast);
  line-height: 1;
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "−";
  transform: rotate(180deg);
}

.faq-item summary:hover {
  color: var(--accent-primary);
}

.faq-content {
  padding: 0 1.25rem 1.25rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  border-top: 1px solid var(--border-color);
  padding-top: 0.85rem;
  overflow-wrap: break-word;
}

.faq-content code {
  font-family: var(--font-mono);
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--accent-primary);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   White / Light Theme Overrides & Refinements
   ========================================================================== */
[data-theme="light"] .app-header {
  background-color: #ffffff;
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .hero-banner {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .hero-stats {
  background-color: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .card,
[data-theme="light"] .policy-card,
[data-theme="light"] .checklist-category-card,
[data-theme="light"] .checklist-item-row,
[data-theme="light"] .custom-checkbox-card,
[data-theme="light"] .store-listing-kit-card,
[data-theme="light"] .audit-summary-box,
[data-theme="light"] .console-checklist-box {
  background-color: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .form-control,
[data-theme="light"] .search-input {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .form-control:focus-visible,
[data-theme="light"] .search-input:focus-visible {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

[data-theme="light"] .form-fieldset {
  background-color: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .policy-highlights,
[data-theme="light"] .applicable-policy-card,
[data-theme="light"] .blueprint-list li,
[data-theme="light"] .ai-settings-card,
[data-theme="light"] .progress-box,
[data-theme="light"] .console-section {
  background-color: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .callout-box {
  background-color: #eff6ff;
  border-left-color: #2563eb;
  color: #1e3a8a;
}

[data-theme="light"] .field-display,
[data-theme="light"] .field-display-pre {
  background-color: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .modal-close-btn {
  background-color: #f1f5f9;
  border-color: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .modal-close-btn:hover {
  background-color: #e2e8f0;
}

[data-theme="light"] .modal-dialog::backdrop {
  background-color: rgba(15, 23, 42, 0.45);
}

[data-theme="light"] .chip-button {
  background-color: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
}

[data-theme="light"] .chip-button:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .chip-button.active {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

[data-theme="light"] .custom-checkbox-card:hover {
  background-color: #f8fafc;
  border-color: #93c5fd;
}

[data-theme="light"] .policy-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #93c5fd;
}

[data-theme="light"] .app-footer {
  background-color: #ffffff;
  border-top-color: #e2e8f0;
}

[data-theme="light"] .step-card,
[data-theme="light"] .playbook-item,
[data-theme="light"] .faq-item {
  background-color: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .faq-item[open] {
  background-color: #f8fafc;
  border-color: #93c5fd;
}

/* ==========================================================================
   Responsive Breakpoints for All Device Categories (Desktop, Tablet, Mobile)
   ========================================================================== */

/* Universal Responsive Safety Guards */
.checker-layout,
.rewriter-layout,
.policy-gen-layout,
.hero-inner,
.policy-grid,
.steps-grid,
.playbooks-grid {
  min-width: 0;
  max-width: 100%;
}

.checker-layout > *,
.rewriter-layout > *,
.policy-gen-layout > *,
.card,
.checker-input-card,
.checker-results-card,
.rewriter-input-pane,
.rewriter-output-pane,
.policy-gen-form-card,
.policy-gen-output-card {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.form-control,
select.form-control,
textarea.form-control,
input.form-control,
.search-input {
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.btn {
  max-width: 100%;
  box-sizing: border-box;
}

/* 1. Laptops and Standard Desktops (1024px - 1180px) */
@media (max-width: 1180px) {
  .hero-inner {
    grid-template-columns: 1.4fr 1fr;
    gap: 1.5rem;
  }

  .checker-layout {
    grid-template-columns: 1.1fr 1fr;
    gap: 1.5rem;
  }

  .rewriter-layout {
    grid-template-columns: 1fr 1.15fr;
    gap: 1.5rem;
  }

  .policy-gen-layout {
    grid-template-columns: 1fr 1.15fr;
    gap: 1.5rem;
  }
}

/* 2. Tablets in Portrait and Landscape (768px - 1024px) */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .hero-stats {
    width: 100%;
  }

  .checker-layout,
  .rewriter-layout,
  .policy-gen-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
  }

  .policy-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  }
}

/* 3. Phablets and Handhelds (481px - 767px) */
@media (max-width: 768px) {
  .header-inner {
    height: auto;
    min-height: 4rem;
    padding-block: 0.75rem;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .brand-subtitle {
    font-size: 0.72rem;
  }

  .brand-logo {
    width: 2.35rem;
    height: 2.35rem;
  }

  .hero-banner {
    padding-block: 2rem 1.5rem;
  }

  .hero-heading {
    font-size: clamp(1.4rem, 4.5vw, 1.85rem);
  }

  .hero-text {
    font-size: 0.95rem;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 1.25rem 0.75rem;
    gap: 0.75rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.72rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .col-half {
    width: 100%;
    max-width: 100%;
  }

  .search-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .count-badge {
    align-self: flex-start;
  }

  .checklist-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .progress-box {
    width: 100%;
  }

  .audit-verdict-banner {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .compliance-gauge {
    width: 100%;
  }

  .pane-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .label-with-samples {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .ai-toggle-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .output-actions {
    flex-direction: column;
    width: 100%;
  }

  .output-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .policy-actions-bar {
    flex-direction: column;
    width: 100%;
  }

  .policy-actions-bar .btn {
    width: 100%;
    justify-content: center;
  }

  .view-mode-tabs {
    width: 100%;
    display: flex;
  }

  .view-mode-btn {
    flex: 1;
    text-align: center;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* 4. Small Mobile Phones (320px - 480px) */
@media (max-width: 480px) {
  .container {
    padding-inline: 0.75rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .stat-item {
    flex-direction: row;
    justify-content: space-between;
    padding-inline: 0.5rem;
  }

  .tabs-list [role="tab"] {
    padding: 0.65rem 0.75rem;
    font-size: 0.82rem;
  }

  .card {
    padding: 1rem 0.75rem;
    border-radius: var(--radius-md);
  }

  .policy-card {
    padding: 1rem 0.75rem;
  }

  .form-fieldset {
    padding: 0.85rem 0.65rem;
  }

  .custom-checkbox-card {
    padding: 0.75rem 0.65rem;
    gap: 0.5rem;
  }

  .checkbox-title {
    font-size: 0.85rem;
  }

  .checkbox-risk {
    font-size: 0.75rem;
  }

  .mini-severity {
    font-size: 0.6rem;
    padding: 0.08rem 0.35rem;
  }

  .modal-dialog {
    width: calc(100vw - 1rem);
    max-height: 92dvh;
    margin: 1rem auto;
  }

  .modal-body {
    padding: 1.15rem 0.75rem;
  }

  .modal-close-btn {
    top: 0.65rem;
    right: 0.65rem;
    width: 1.85rem;
    height: 1.85rem;
    font-size: 1.2rem;
  }

  .document-paper {
    padding: 1rem 0.75rem;
    font-size: 0.85rem;
  }

  .code-pre {
    padding: 0.75rem;
    font-size: 0.75rem;
  }

  .btn {
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
  }

  .btn-lg {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .field-display,
  .field-display-pre {
    font-size: 0.8rem;
    padding: 0.65rem 0.75rem;
  }

  .doc-chip-btn {
    width: 100%;
    justify-content: center;
  }
}
