@font-face {
  font-family: 'CambayDevanagari';
  src: url('../fonts/CambayDevanagari-Regular.ttf') format('truetype');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --surface-hover: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;
  --accent: #0f766e;
  --accent-light: #f0fdfa;
  --warning-bg: #fffbeb;
  --warning-border: #d97706;
  --warning-text: #92400e;
  --danger-bg: #fef2f2;
  --danger-border: #dc2626;
  --danger-text: #991b1b;
  --border: #cbd5e1;
  --control-border: #64748b;
  --on-primary: #ffffff;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'CambayDevanagari', 'Noto Sans Devanagari', sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1120;
  --surface: #1e293b;
  --surface-alt: #0f172a;
  --surface-hover: #334155;
  --text: #f8fafc;
  --text-muted: #cbd5e1;
  --primary: #60a5fa;
  --primary-hover: #93c5fd;
  --primary-light: #1e3a8a;
  --accent: #2dd4bf;
  --accent-light: #134e4a;
  --warning-bg: #451a03;
  --warning-border: #f59e0b;
  --warning-text: #fde68a;
  --danger-bg: #450a0a;
  --danger-border: #f87171;
  --danger-text: #fecaca;
  --border: #334155;
  --control-border: #94a3b8;
  --on-primary: #0f172a;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.55);
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

main, section, article, aside, header, footer, nav, form, fieldset {
  max-width: 100%;
  min-width: 0;
}

code, pre, kbd, samp {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86em;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
  max-width: 100%;
}
a { color: var(--primary); text-underline-offset: 2px; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  background: var(--primary);
  color: var(--on-primary);
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 1000;
  text-decoration: none;
  font-weight: 700;
}
.skip-link:focus {
  top: 12px;
  outline: 3px solid #f59e0b;
}

.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  min-width: 0;
}

/* Header & Responsive Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 8px;
  padding: 8px 0;
  position: relative;
  flex-wrap: wrap;
}
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.brand-badge {
  background: var(--primary);
  color: #ffffff;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 700;
  white-space: nowrap;
}
[data-theme="dark"] .brand-badge {
  color: #0f172a;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.mobile-nav-toggle {
  display: none;
  background: var(--surface-alt);
  border: 1px solid var(--control-border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 11px;
  border-radius: 8px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav-link:hover,
.nav-link:focus-visible {
  background: var(--surface-alt);
  color: var(--primary);
}
.btn-icon {
  background: var(--surface-alt);
  border: 1px solid var(--control-border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 11px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  white-space: nowrap;
}
.btn-icon:hover,
.btn-icon:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}
.theme-control { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: .85rem; font-weight: 600; }
.theme-select { min-height: 44px; max-width: 124px; padding: 8px; border: 1px solid var(--control-border); border-radius: 8px; font: inherit; color: var(--text); background: var(--surface-alt); }
.error-theme { display: flex; justify-content: flex-end; padding-top: 16px; }
.error-page-box { max-width: 580px; width: calc(100% - 32px); margin: 48px auto; text-align: center; }

/* Mobile Drawer Navigation (< 900px) — Ensures 390px, 360px, and 320px have zero overflow or crowding */
@media (max-width: 900px) {
  .mobile-nav-toggle {
    display: inline-flex;
  }
  .brand-link {
    font-size: 0.98rem;
    gap: 6px;
  }
  .brand-badge {
    font-size: 0.66rem;
    padding: 2px 6px;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0 0 12px 12px;
    box-shadow: var(--shadow-lg);
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    z-index: 120;
  }
  .main-nav.is-open {
    display: flex;
  }
  .main-nav .nav-link,
  .main-nav .btn-icon {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 14px;
    min-height: 44px;
    font-size: 0.95rem;
    white-space: normal;
  }
}

/* Hero & Search */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 58%, #0f766e 100%);
  color: #ffffff;
  padding: 36px 0 32px;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: clamp(1.45rem, 3.5vw, 2.3rem);
  margin: 0 0 10px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}
.hero p {
  color: #e2e8f0;
  margin: 0 0 20px;
  max-width: 780px;
  font-size: 1rem;
  overflow-wrap: break-word;
}
.search-bar-wrap {
  display: flex;
  gap: 10px;
  max-width: 740px;
  width: 100%;
  flex-wrap: wrap;
}
.search-input {
  flex: 1 1 220px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 13px 16px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  min-height: 48px;
}
.search-input::placeholder { color: var(--text-muted); opacity: 1; }
.search-input:focus {
  outline: 3px solid #93c5fd;
  border-color: #1d4ed8;
}
.hero-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  max-width: 100%;
}
.hero-pill {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 7px 12px;
  border-radius: 99px;
  font-size: 0.82rem;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.hero-pill:hover,
.hero-pill:focus-visible {
  background: rgba(255, 255, 255, 0.28);
}

/* Category Filter Bar */
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 100%;
  padding: 16px 0 12px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.cat-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 15px;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  flex-shrink: 0;
}
.cat-tab.active,
.cat-tab:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}
[data-theme="dark"] .cat-tab.active,
[data-theme="dark"] .cat-tab:hover {
  color: #0f172a;
}

/* Saved & Recent Tool Chips — Must wrap cleanly inside .panel on 390px/360px/320px viewports! */
.saved-tool-chip,
#saved-favourites-list .cat-tab,
#recent-tools-list .cat-tab {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  max-width: 100%;
  min-width: 0;
  flex-shrink: 1;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}
.saved-tool-chip:hover,
.saved-tool-chip:focus-visible {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}
[data-theme="dark"] .saved-tool-chip:hover,
[data-theme="dark"] .saved-tool-chip:focus-visible {
  color: #0f172a;
}

/* Cards & Grids */
.section-block {
  margin: 28px 0;
  max-width: 100%;
  min-width: 0;
}
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.section-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0;
  overflow-wrap: break-word;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 14px;
  width: 100%;
  max-width: 100%;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.tool-card:hover,
.tool-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}
.tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.tool-id-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}
[data-theme="dark"] .tool-id-badge {
  color: #93c5fd;
}
.tool-p0-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent);
  display: inline-block;
}
.tool-card h3 {
  font-size: 1.02rem;
  margin: 0 0 6px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.tool-card-hindi {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 8px;
  font-family: 'CambayDevanagari', var(--font);
  overflow-wrap: anywhere;
}
.tool-card p {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 14px 0 6px;
  font-size: 0.86rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.breadcrumbs a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.breadcrumbs a:hover {
  text-decoration: underline;
}

/* Tool Page Layout — Uses minmax(0, 1fr) so grid children never expand document width past viewport */
.tool-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin: 12px 0 32px;
  width: 100%;
  max-width: 100%;
}
@media (min-width: 960px) {
  .tool-workspace {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: start;
  }
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
  max-width: 100%;
  width: 100%;
  overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  .panel {
    padding: 14px;
  }
}
.tool-header-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  max-width: 100%;
}
.tool-header-bar > div {
  min-width: 0;
  max-width: 100%;
}
.tool-title {
  font-size: clamp(1.25rem, 2.6vw, 1.72rem);
  margin: 4px 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.tool-subtitle-hi {
  font-size: 0.96rem;
  color: var(--text-muted);
  margin: 0 0 6px;
  font-weight: 600;
  font-family: 'CambayDevanagari', var(--font);
  overflow-wrap: anywhere;
}
.privacy-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.79rem;
  font-weight: 700;
  background: var(--accent-light);
  color: var(--accent);
  padding: 5px 11px;
  border-radius: 12px;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

/* Form Controls */
.form-group {
  margin-bottom: 14px;
  max-width: 100%;
  min-width: 0;
}
.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 6px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.form-control {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  min-height: 44px;
  text-overflow: ellipsis;
}
select.form-control,
input[type="file"].form-control {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.form-control:focus {
  outline: 3px solid var(--primary);
  border-color: var(--primary);
  background: var(--surface);
}
.form-control::placeholder { color: var(--text-muted); opacity: 1; }
input[type="file"]::file-selector-button { background: var(--surface); color: var(--text); border: 1px solid var(--control-border); border-radius: 5px; padding: 5px 8px; margin-right: 8px; font: inherit; cursor: pointer; }
textarea.form-control {
  min-height: 104px;
  resize: vertical;
  white-space: pre-wrap;
}

.preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
  padding: 10px 12px;
  background: var(--surface-alt);
  border-radius: 8px;
  align-items: center;
  max-width: 100%;
}
.preset-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  border: 1px solid transparent;
  min-height: 44px;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  text-decoration: none;
}
.preset-bar .btn {
  text-align: left;
  justify-content: flex-start;
}
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}
[data-theme="dark"] .btn-primary {
  color: #0f172a;
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--control-border);
}
.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
  min-height: 40px;
}
@media (max-width: 768px) {
  .btn-sm {
    min-height: 44px;
    padding: 8px 12px;
  }
}
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  max-width: 100%;
}

/* Results Area */
.result-banner {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  max-width: 100%;
  min-width: 0;
}
.result-primary-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}
[data-theme="dark"] .result-primary-label {
  color: #93c5fd;
}
.result-primary-value {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-family: inherit;
  max-width: 100%;
}
.error-banner {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  padding: 14px 16px;
  border-radius: 10px;
  font-weight: 700;
  margin-bottom: 16px;
  display: none;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 135px), 1fr));
  gap: 10px;
  margin-bottom: 16px;
  width: 100%;
  max-width: 100%;
}
.summary-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 0;
  max-width: 100%;
}
.summary-card-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.summary-card-val {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text);
  margin-top: 2px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  width: 100%;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
}
.data-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.data-table th,
.data-table td {
  padding: 9px 11px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.data-table th {
  background: var(--surface-alt);
  font-weight: 700;
}
.data-table tr:last-child td {
  border-bottom: none;
}

.notes-box {
  background: var(--warning-bg);
  border-left: 4px solid var(--warning-border);
  color: var(--warning-text);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-top: 12px;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Interactive Local File Studio */
.file-studio-box {
  margin-top: 18px;
  padding: 15px;
  border: 2px dashed var(--primary);
  border-radius: 10px;
  background: var(--surface-alt);
  max-width: 100%;
  min-width: 0;
}
.file-studio-title {
  font-weight: 800;
  font-size: 0.95rem;
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}
.canvas-preview-wrap {
  margin-top: 12px;
  text-align: center;
  overflow: auto;
  max-height: 360px;
  max-width: 100%;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}
.canvas-preview-wrap canvas,
.canvas-preview-wrap svg {
  max-width: 100%;
  height: auto;
}

/* Ad-Ready Placeholder (Disabled by Default, Strictly Separated) */
.ad-slot-container {
  margin: 32px 0;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  background: var(--surface-alt);
  display: none;
}
.ad-slot-container[data-ad-enabled="true"] {
  display: block;
}

/* Documentation & Guide Content */
.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (max-width: 480px) {
  .guide-card {
    padding: 15px;
  }
}
.guide-card h2 {
  font-size: 1.22rem;
  margin-top: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  overflow-wrap: anywhere;
}
.guide-card h3 {
  font-size: 1.04rem;
  margin: 18px 0 6px;
  overflow-wrap: anywhere;
}
.guide-card ul,
.guide-card ol {
  padding-left: 20px;
  max-width: 100%;
}
.guide-card li {
  margin-bottom: 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.faq-item:last-child {
  border-bottom: none;
}
.faq-q {
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.faq-a {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

/* Tool shortcuts, original guides and user-controlled sharing. */
.tool-action-bar { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 16px; }
.tool-action { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:10px 15px; border:1px solid var(--control-border); border-radius:12px; background:var(--surface); color:var(--text); font:inherit; font-size:.88rem; font-weight:650; cursor:pointer; }
.tool-action:hover, .tool-action[aria-pressed="true"] { border-color:var(--primary); background:var(--surface-alt); color:var(--primary); }
.tool-action svg, .tool-dialog svg, .share-tool-card svg { width:19px; height:19px; flex-shrink:0; }
.tool-guide { min-width:0; }
.guide-toc { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:14px 0 20px; }
.guide-toc > span { font-size:.84rem; font-weight:700; margin-right:4px; }
.guide-toc a { display:inline-flex; align-items:center; min-height:44px; padding:8px 12px; border:1px solid var(--border); border-radius:999px; background:var(--surface); font-size:.84rem; }
.tool-guide section, .tool-guide h2[id] { scroll-margin-top:110px; }
.guide-overview { border-top:3px solid var(--primary); }
.guide-section-heading { display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.guide-section-heading h2 { border:0; padding:0; margin:0; font-size:clamp(1.08rem,2vw,1.35rem); }
.guide-step-mark { flex-shrink:0; display:grid; place-items:center; width:35px; height:35px; border:1px solid var(--border); border-radius:10px; background:var(--surface-alt); color:var(--primary); font-size:.8rem; font-weight:800; }
.guide-intro { font-size:1.02rem; line-height:1.75; }
.guide-processing, .guide-reference { color:var(--text-muted); font-size:.91rem; }
.guide-pair, .tool-suggestions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; margin-bottom:24px; }
.guide-pair > .guide-card, .tool-suggestions > .guide-card { margin-bottom:0; }
.guide-points { line-height:1.75; }
.guide-points li::marker, .guide-instructions li::marker { color:var(--primary); font-weight:700; }
.guide-instructions li { margin-bottom:12px; padding-left:5px; line-height:1.7; }
.guide-audience { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 28px; }
.guide-audience li { padding:7px 0; }
.guide-hindi { margin-top:16px; padding:14px 16px; background:var(--surface-alt); border-left:3px solid var(--primary); border-radius:10px; font-size:.9rem; }
.guide-hindi p { margin-bottom:0; color:var(--text-muted); }
.guide-check { padding:14px 16px; background:var(--surface-alt); border:1px solid var(--border); border-radius:12px; margin:20px 0; }
.guide-check h3 { margin-top:0; }
.guide-check p { margin-bottom:0; font-size:.92rem; line-height:1.7; }
.guide-reference { padding-top:4px; }
.example-inputs { max-width:100%; overflow-wrap:anywhere; word-break:break-word; }
.example-inputs span { display:block; margin-bottom:7px; }
.tool-faq { border-bottom:1px solid var(--border); border-radius:8px; }
.tool-faq:last-child { border:0; }
.tool-faq[open] { background:var(--surface-alt); }
.tool-faq summary { cursor:pointer; padding:16px 12px; font-weight:650; line-height:1.55; }
.tool-faq summary::marker { color:var(--primary); }
.tool-faq p { color:var(--text-muted); margin:0; padding:0 14px 18px; line-height:1.75; }
.share-tool-card { display:flex; align-items:center; justify-content:space-between; gap:20px; background:var(--surface-alt); border:1px solid var(--border); border-radius:var(--radius); padding:24px; margin:0 0 24px; }
.share-tool-card h2 { margin:0 0 8px; font-size:1.2rem; }
.share-tool-card p { margin:0; color:var(--text-muted); max-width:68ch; }
.share-tool-card .btn { flex-shrink:0; }
.suggestion-list { list-style:none; padding:0 !important; margin:0; }
.suggestion-list li { margin:0; border-bottom:1px solid var(--border); }
.suggestion-list li:last-child { border-bottom:0; }
.suggestion-list a { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 0; min-height:48px; font-weight:650; line-height:1.5; }
.suggestion-list small { display:block; margin-top:4px; color:var(--text-muted); font-size:.79rem; font-weight:400; }
.tool-dialog { width:min(560px,calc(100% - 28px)); max-width:calc(100% - 28px); max-height:calc(100vh - 28px); max-height:calc(100dvh - 28px); overflow:auto; border:1px solid var(--control-border); border-radius:20px; padding:24px; background:var(--surface); color:var(--text); box-shadow:0 24px 85px rgba(0,0,0,.35); }
.tool-dialog::backdrop { background:rgba(2,6,23,.65); }
.tool-dialog [hidden] { display:none !important; }
.tool-dialog.inline-dialog { position:static; margin:20px auto; box-shadow:none; }
.dialog-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.dialog-heading h2 { margin:4px 0 14px; font-size:1.45rem; line-height:1.3; }
.guide-eyebrow { color:var(--primary); font-size:.77rem; font-weight:700; }
.dialog-close { display:grid; place-items:center; flex-shrink:0; min-width:44px; min-height:44px; padding:0; border:1px solid var(--control-border); border-radius:50%; background:var(--surface-alt); color:var(--text); font-size:1.6rem; cursor:pointer; }
.dialog-tool-name { font-size:.96rem; font-weight:650; margin:0 0 12px; }
.dialog-note { color:var(--text-muted); font-size:.87rem; line-height:1.65; }
.social-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:18px 0; }
.social-option { display:flex; align-items:center; gap:10px; min-height:54px; padding:12px; border:1px solid var(--control-border); border-radius:12px; background:var(--surface-alt); color:var(--text); font:inherit; font-size:.88rem; font-weight:650; text-decoration:none; cursor:pointer; }
.social-option:hover { color:var(--primary); border-color:var(--primary); text-decoration:none; }
.social-option > span[aria-hidden="true"]:last-child { margin-left:auto; }
.social-mark { display:grid; place-items:center; width:22px; height:22px; flex-shrink:0; color:var(--primary); font-size:1.1rem; font-weight:800; }
.share-link-field { font-size:.84rem; }
.dialog-status { min-height:1.5em; font-size:.87rem; line-height:1.6; margin:12px 0 0; }
.feedback-email { margin:8px 0; }
.tool-dialog textarea { margin-bottom:12px; }
@media (max-width:600px) {
  .guide-pair, .tool-suggestions { grid-template-columns:minmax(0,1fr); gap:16px; }
  .guide-audience { grid-template-columns:minmax(0,1fr); }
  .share-tool-card { flex-direction:column; align-items:flex-start; padding:18px; }
  .share-tool-card .btn { width:100%; }
  .tool-dialog { padding:18px; border-radius:16px; }
  .dialog-heading h2 { font-size:1.23rem; }
  .tool-action-bar { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
  .tool-action { min-width:0; padding:10px 5px; gap:5px; font-size:.8rem; overflow-wrap:anywhere; }
  .tool-action svg { width:16px; height:16px; }
}
@media (max-width:360px) {
  .social-option { gap:7px; padding:11px 9px; font-size:.84rem; }
  .social-option > span[aria-hidden="true"]:last-child { display:none; }
}

/* Reviewer & Footer */
.reviewer-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 24px 0;
  max-width: 100%;
  flex-wrap: wrap;
}
.reviewer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 36px 0 28px;
  margin-top: 44px;
  max-width: 100%;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 24px;
  margin-bottom: 24px;
  width: 100%;
  max-width: 100%;
}
.footer-col {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.footer-col h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col li {
  margin-bottom: 6px;
}
.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}
.footer-col a:hover {
  color: var(--primary);
  text-decoration: underline;
}
.toast-msg {
  position: fixed;
  bottom: 20px;
  right: 20px;
  left: auto;
  max-width: calc(100vw - 32px);
  background: #0f172a;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 999;
  display: none;
  overflow-wrap: anywhere;
}

.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.58; cursor: not-allowed; }
.pdf-queue-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 6px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 4px; font-size: 0.82rem; max-width: 100%; }
.pdf-queue-label { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.pdf-queue-actions { display: inline-flex; gap: 4px; flex-shrink: 0; }
