:root {
  --dt-primary: #06b6d4;
  --dt-primary-dark: #0891b2;
  --dt-primary-light: #22d3ee;
  --dt-primary-bg: #cffafe;
  --dt-success: #10b981;
  --dt-surface: #ffffff;
  --dt-surface-2: #f9fafb;
  --dt-surface-3: #f3f4f6;
  --dt-border: #e5e7eb;
  --dt-border-strong: #d1d5db;
  --dt-text: #111827;
  --dt-text-2: #6b7280;
  --dt-text-3: #9ca3af;
  --dt-radius-sm: 8px;
  --dt-radius: 12px;
  --dt-radius-lg: 16px;
  --dt-shadow: 0 1px 3px rgba(0,0,0,0.1);
  --dt-shadow-hover: 0 10px 15px -3px rgba(0,0,0,0.1);
  --dt-font-body: 'Inter', sans-serif;
  --dt-font-mono: 'JetBrains Mono', monospace;
  --dt-transition: all 0.3s ease;
}

[data-theme="dark"] {
  --dt-primary: #22d3ee;
  --dt-primary-dark: #06b6d4;
  --dt-primary-light: #67e8f9;
  --dt-primary-bg: #164e63;
  --dt-success: #34d399;
  --dt-surface: #1f2937;
  --dt-surface-2: #111827;
  --dt-surface-3: #374151;
  --dt-border: #374151;
  --dt-border-strong: #4b5563;
  --dt-text: #f9fafb;
  --dt-text-2: #d1d5db;
  --dt-text-3: #9ca3af;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--dt-font-body);
  background: var(--dt-surface-2);
  color: var(--dt-text);
  line-height: 1.5;
  transition: var(--dt-transition);
}
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--dt-surface);
  border-bottom: 1px solid var(--dt-border);
  backdrop-filter: blur(10px);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 2rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--dt-text);
}
.logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--dt-primary), var(--dt-primary-dark));
  border-radius: var(--dt-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
}
/* Breadcrumb */
.breadcrumb-nav { margin: 1.5rem 0 1rem; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  font-size: 0.875rem;
  color: var(--dt-text-3);
}
.breadcrumb li + li::before { content: "›"; margin-right: 0.5rem; }
.breadcrumb a { color: var(--dt-primary); text-decoration: none; }

/* Hero */
.hero-section {
  margin: 2rem 0 3rem;
  animation: fadeInUp 0.6s ease-out;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--dt-primary-bg);
  color: var(--dt-primary);
  padding: 0.35rem 1rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--dt-primary);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}
#categoryTitle {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.gradient-text {
  background: linear-gradient(135deg, var(--dt-primary), var(--dt-primary-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-description {
  font-size: 1.125rem;
  color: var(--dt-text-2);
  max-width: 700px;
  margin-bottom: 1.5rem;
}
.trust-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--dt-success);
  font-weight: 500;
}

/* Tool Navigation */
.tool-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding: 0.75rem 1rem;
  background: var(--dt-surface);
  border: 1px solid var(--dt-border);
  border-radius: var(--dt-radius);
}
.tool-nav-btn {
  background: none;
  border: 1px solid var(--dt-border);
  color: var(--dt-text-2);
  font-family: var(--dt-font-body);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: var(--dt-radius-sm);
  cursor: pointer;
  transition: var(--dt-transition);
}
.tool-nav-btn:hover, .tool-nav-btn.active {
  background: var(--dt-primary);
  border-color: var(--dt-primary);
  color: white;
}

/* Tool Grid */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

/* Cards */
.dt-card {
  background: var(--dt-surface);
  border: 1px solid var(--dt-border);
  border-radius: var(--dt-radius-lg);
  padding: 1.5rem;
  transition: var(--dt-transition);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.4s ease-out;
}
.dt-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--dt-primary), var(--dt-primary-light));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.dt-card:hover::before { transform: scaleX(1); }
.dt-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--dt-shadow-hover);
}
.dt-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--dt-border);
}
.dt-card-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--dt-primary-bg), transparent);
  border-radius: var(--dt-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.dt-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--dt-text);
  flex: 1;
}

/* Focus Modal */
.dt-focus-btn {
  padding: 0.42rem 0.92rem;
  font-size: 0.78rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--dt-primary), var(--dt-primary-dark));
  color: white;
  border: none;
  cursor: pointer;
}
.dt-focus-btn.is-hidden { display: none; }
.dt-focus-inline-close { display: none; }
.dt-focus-inline-close.active {
  display: inline-flex;
  padding: 0.42rem 0.92rem;
  font-size: 0.78rem;
  border-radius: 999px;
  background: var(--dt-surface-3);
  color: var(--dt-text);
  border: 1px solid var(--dt-border);
  cursor: pointer;
}
.dt-focus-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: var(--dt-transition);
}
.dt-focus-overlay.active { opacity: 1; pointer-events: auto; }
.dt-focus-host {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.dt-focus-host.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.dt-card.is-focused {
  position: relative;
  width: min(950px, 90vw);
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--dt-shadow-hover);
  pointer-events: auto;
  transform: none;
}
body.dt-modal-open { overflow: hidden; }

/* Forms */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-bottom: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 1rem; }
input, select, textarea {
  width: 100%;
  font-family: var(--dt-font-body);
  font-size: 0.875rem;
  background: var(--dt-surface-2);
  border: 1.5px solid var(--dt-border);
  border-radius: var(--dt-radius-sm);
  padding: 0.6rem 0.75rem;
  color: var(--dt-text);
  transition: var(--dt-transition);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--dt-primary);
  box-shadow: 0 0 0 3px var(--dt-primary-bg);
}
select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}
label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dt-text-3);
  display: block;
  margin-bottom: 0.25rem;
}
textarea { resize: vertical; min-height: 80px; }

/* Buttons */
.inline-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0; align-items: center; }
.btn {
  padding: 0.6rem 1.25rem;
  border-radius: var(--dt-radius-sm);
  font-family: var(--dt-font-body);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--dt-transition);
  border: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--dt-primary), var(--dt-primary-dark));
  color: white;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--dt-shadow); }
.btn-secondary {
  background: var(--dt-surface-3);
  color: var(--dt-text-2);
  border: 1px solid var(--dt-border);
}
.btn-secondary:hover {
  background: var(--dt-surface);
  color: var(--dt-text);
  transform: translateY(-2px);
}

/* Result */
.result {
  background: var(--dt-surface-2);
  border-radius: var(--dt-radius);
  padding: 0.75rem;
  font-family: var(--dt-font-mono);
  font-size: 0.75rem;
  border: 1px solid var(--dt-border);
  margin-top: 0.5rem;
  word-break: break-word;
  white-space: pre-wrap;
}
.result-large { font-size: 1.25rem; font-weight: 700; color: var(--dt-primary); }

/* Ad Slots */
.ad-slot {
  background: linear-gradient(135deg, var(--dt-surface-3), var(--dt-surface));
  border: 2px dashed var(--dt-border-strong);
  border-radius: var(--dt-radius);
  padding: 2rem;
  text-align: center;
  color: var(--dt-text-3);
  font-weight: 500;
  margin-bottom: 1.25rem;
}

/* FAQ */
.faq-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--dt-border);
}
.faq-section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item {
  background: var(--dt-surface);
  border: 1px solid var(--dt-border);
  border-radius: var(--dt-radius-sm);
  overflow: hidden;
}
.faq-item[open] { border-color: var(--dt-primary); }
.faq-item summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::after { content: "+"; float: right; color: var(--dt-text-3); }
.faq-item[open] summary::after { content: "−"; color: var(--dt-primary); }
.faq-item p { padding: 0 1.25rem 1rem; color: var(--dt-text-2); line-height: 1.6; }

/* Footer */
.site-footer {
  background: var(--dt-surface);
  border-top: 1px solid var(--dt-border);
  margin-top: 4rem;
  padding: 1.5rem 0;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--dt-text-3);
}
.footer-grid a { color: var(--dt-primary); text-decoration: none; }

/* History Chips */
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
  max-height: 200px;
  overflow-y: auto;
}
.prompt-chip {
  background: var(--dt-surface-3);
  border: 1px solid var(--dt-border);
  border-radius: 100px;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-family: var(--dt-font-mono);
  cursor: pointer;
  transition: var(--dt-transition);
}
.prompt-chip:hover {
  background: var(--dt-primary-bg);
  border-color: var(--dt-primary);
  color: var(--dt-primary);
  transform: translateY(-2px);
}
.empty-hint { color: var(--dt-text-3); font-style: italic; padding: 1rem; text-align: center; }
.full-width { grid-column: 1 / -1; }

@media (max-width: 768px) {
  .container { padding: 0 1rem; }
  .tool-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
.dt-focus-host.active { padding: 0.5rem; }
  .dt-card.is-focused { width: 95vw; padding: 1rem; }
}
@media (max-width: 480px) {
  .inline-row { flex-direction: column; }
  .tool-nav-btn { font-size: 0.7rem; padding: 0.3rem 0.6rem; }
  .hero-description { font-size: 1rem; }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--dt-surface-3); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--dt-primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--dt-primary-dark); }

/* Production polish: hints, validation, advanced panels */
.dt-hint {
  font-size: 0.78rem;
  color: var(--dt-text-3);
  line-height: 1.45;
  margin: 0 0 0.75rem;
}
.dt-muted {
  font-size: 0.72rem;
  color: var(--dt-text-3);
}
.dt-error {
  display: block;
  font-size: 0.72rem;
  color: #dc2626;
  margin-top: 0.25rem;
}
[data-theme="dark"] .dt-error {
  color: #f87171;
}
input.dt-input-invalid,
select.dt-input-invalid {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}
.dt-advanced {
  margin: 0.75rem 0 0.5rem;
  padding: 0.5rem 0.65rem;
  background: var(--dt-surface-2);
  border: 1px dashed var(--dt-border);
  border-radius: var(--dt-radius-sm);
}
.dt-advanced summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--dt-primary-dark);
  list-style: none;
}
.dt-advanced summary::-webkit-details-marker { display: none; }
.dt-advanced summary::after {
  content: " ▾";
  font-size: 0.65rem;
  opacity: 0.7;
}
.dt-advanced[open] summary::after { content: " ▴"; }
.dt-advanced .grid-2,
.dt-advanced .inline-row {
  margin-top: 0.65rem;
}