:root {
  --bg-0: #0a0a12;
  --bg-1: #12121e;
  --bg-2: #1a1a2b;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(255, 255, 255, 0.09);
  --text-0: #f2f1f8;
  --text-1: #b9b6cc;
  --text-2: #7c7891;
  --accent-1: #b378ff;
  --accent-2: #ff7ac6;
  --accent-grad: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --general: #7aa7ff;
  --character: #ff8fd6;
  --rating-general: #58d68d;
  --rating-sensitive: #f4d03f;
  --rating-questionable: #ff9f43;
  --rating-explicit: #ff5e7a;
  --radius: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg-0);
  color: var(--text-0);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: relative;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 400px at 15% -5%, rgba(179, 120, 255, 0.25), transparent 60%),
    radial-gradient(500px 350px at 100% 10%, rgba(255, 122, 198, 0.18), transparent 60%),
    var(--bg-0);
}

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 28px clamp(20px, 5vw, 64px) 12px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 22px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.main-nav a {
  color: var(--text-1);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.15s ease;
}

.main-nav a:hover {
  color: var(--text-0);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  color: var(--text-1);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}

.nav-dropdown-btn:hover {
  color: var(--text-0);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 180px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--bg-1);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  z-index: 50;
}

.nav-dropdown-menu a {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-0);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.nav-dropdown-menu a:hover {
  background: rgba(179, 120, 255, 0.12);
}

.nav-menu-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-2);
}

.lang-switcher {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.lang-btn:hover {
  border-color: var(--accent-1);
  color: var(--text-0);
}

.lang-caret {
  font-size: 10px;
  opacity: 0.7;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--bg-1);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  z-index: 50;
}

.lang-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--text-1);
  font-size: 13px;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
}

.lang-option:hover {
  background: rgba(179, 120, 255, 0.12);
  color: var(--text-0);
}

.lang-option.is-active {
  color: var(--text-0);
  font-weight: 700;
}

.lang-option.is-active::before {
  content: "✓";
  color: var(--accent-2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  font-size: 28px;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-text h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-text .accent {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-2);
}

.model-pill {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--text-1);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.model-pill:hover {
  border-color: var(--accent-1);
  color: var(--text-0);
}

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 20px;
  padding: 12px clamp(20px, 5vw, 64px) 40px;
  align-items: start;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(16px);
}

/* ---------- Dropzone ---------- */

.dropzone {
  position: relative;
  border: 1.5px dashed var(--panel-border);
  border-radius: var(--radius);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  outline: none;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent-1);
  background: rgba(179, 120, 255, 0.05);
}

.dropzone.dragover {
  border-color: var(--accent-2);
  background: rgba(255, 122, 198, 0.08);
}

.dropzone-empty {
  text-align: center;
  padding: 32px 20px;
}

.dropzone-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.dropzone-title {
  font-weight: 600;
  margin: 0 0 6px;
}

.dropzone-sub {
  color: var(--text-2);
  font-size: 13px;
  margin: 0 0 18px;
}

.dropzone-sub kbd {
  background: var(--bg-2);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.dropzone-preview {
  width: 100%;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dropzone-preview img {
  max-width: 100%;
  max-height: 360px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.hidden {
  display: none !important;
}

/* ---------- Buttons ---------- */

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease, filter 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

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

.btn-primary {
  background: var(--accent-grad);
  color: #0a0a12;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-1);
}

.btn-ghost:hover {
  border-color: var(--accent-2);
  color: var(--text-0);
}

.btn-small {
  padding: 7px 14px;
  font-size: 12px;
}

/* ---------- Loading / status ---------- */

.loading-overlay {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(179, 120, 255, 0.08);
  border: 1px solid rgba(179, 120, 255, 0.25);
  font-size: 13px;
  color: var(--text-1);
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-2);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status-banner {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: rgba(255, 94, 122, 0.12);
  border: 1px solid rgba(255, 94, 122, 0.35);
  color: #ffb3c0;
}

/* ---------- Controls ---------- */

.controls {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.control-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}

.control-value {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent-2);
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent-2);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent-2);
  cursor: pointer;
}

.control-row-inline {
  flex-direction: row;
  align-items: center;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-1);
  cursor: pointer;
  user-select: none;
}

.switch-label input {
  display: none;
}

.switch {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--panel-border);
  position: relative;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform 0.15s ease, background 0.15s ease;
}

.switch-label input:checked + .switch {
  background: rgba(179, 120, 255, 0.35);
  border-color: var(--accent-1);
}

.switch-label input:checked + .switch::after {
  transform: translateX(16px);
  background: var(--accent-2);
}

/* ---------- Rating ---------- */

.rating-block {
  margin-top: 24px;
}

.block-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  margin: 0 0 10px;
}

.rating-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rating-placeholder {
  font-size: 13px;
  color: var(--text-2);
}

.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-1);
}

.rating-badge.top {
  color: #0a0a12;
}

.rating-badge[data-rating="general"].top { background: var(--rating-general); }
.rating-badge[data-rating="sensitive"].top { background: var(--rating-sensitive); }
.rating-badge[data-rating="questionable"].top { background: var(--rating-questionable); }
.rating-badge[data-rating="explicit"].top { background: var(--rating-explicit); }

.rating-badge .pct {
  font-family: "JetBrains Mono", monospace;
  opacity: 0.85;
}

/* ---------- Result panel ---------- */

.result-panel {
  min-height: 500px;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.result-header h2 {
  margin: 0;
  font-size: 18px;
}

.tag-group {
  margin-bottom: 26px;
}

.tag-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-1);
  margin-bottom: 12px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot-general { background: var(--general); }
.dot-character { background: var(--character); }

.count-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-2);
  background: var(--bg-2);
  padding: 1px 8px;
  border-radius: 999px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
}

.empty-hint {
  font-size: 13px;
  color: var(--text-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.1s ease, opacity 0.15s ease;
  user-select: none;
}

.chip:hover {
  transform: translateY(-1px);
  opacity: 0.85;
}

.chip:active {
  transform: scale(0.96);
}

.chip.general {
  background: rgba(122, 167, 255, 0.14);
  border-color: rgba(122, 167, 255, 0.35);
  color: #cfe0ff;
}

.chip.character {
  background: rgba(255, 143, 214, 0.14);
  border-color: rgba(255, 143, 214, 0.35);
  color: #ffd6ef;
}

.chip .chip-conf {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  opacity: 0.65;
}

.chip .chip-remove {
  opacity: 0.5;
  font-size: 11px;
}

.hint-text {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 10px;
}

/* ---------- Prompt-only analyze page ---------- */

.tool-heading {
  margin: 0 0 8px;
  font-size: 20px;
}

.tool-subheading {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

.prompt-textarea {
  width: 100%;
  resize: vertical;
  min-height: 160px;
  margin-top: 8px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border);
  background: var(--bg-2);
  color: var(--text-0);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
}

.prompt-textarea:focus {
  outline: none;
  border-color: var(--accent-1);
}

.prompt-controls {
  margin: 16px 0;
}

#analyze-btn {
  width: 100%;
}

/* ---------- Category accordion ---------- */

.dot-category {
  background: var(--accent-1);
}

.view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  background: var(--bg-2);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
}

.view-toggle-btn {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.view-toggle-btn:hover {
  color: var(--text-0);
}

.view-toggle-btn.is-active {
  background: var(--accent-grad);
  color: #0a0a12;
}

.tag-view {
  margin-bottom: 26px;
}

.tag-view .tag-group {
  margin-bottom: 0;
}

.category-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-item {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

.category-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-label {
  flex: 1;
}

.category-item .chip-list {
  margin-top: 12px;
}

.category-copy-btn {
  margin-top: 10px;
}

/* ---------- Negative prompt ---------- */

.negative-prompt-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--panel-border);
}

.dot-negative {
  background: #ff6b6b;
}

.negative-prompt-hint {
  width: 100%;
  margin: 0 0 10px;
}

.negative-prompt-box {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border);
  background: var(--bg-2);
  color: var(--text-1);
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  line-height: 1.7;
  white-space: normal;
  margin-bottom: 12px;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--bg-2);
  border: 1px solid var(--accent-1);
  color: var(--text-0);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
}

/* ---------- Content sections (SEO / long-form copy) ---------- */

.content-section {
  padding: 20px clamp(20px, 5vw, 64px) 10px;
}

.content-inner {
  max-width: 920px;
  margin: 0 auto;
  border-top: 1px solid var(--panel-border);
  padding-top: 36px;
}

.content-inner h2 {
  font-size: 22px;
  margin: 0 0 14px;
}

.content-inner p {
  color: var(--text-1);
  line-height: 1.7;
  font-size: 14px;
  margin: 0 0 14px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.feature-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 18px;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.feature-card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
}

.step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.step-list li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #0a0a12;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.step-list h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.step-list p {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: "+";
  display: inline-block;
  width: 18px;
  color: var(--accent-2);
  font-weight: 800;
}

.faq-item[open] summary::before {
  content: "−";
}

.faq-item p {
  margin: 10px 0 0 18px;
  font-size: 13px;
  color: var(--text-2);
}

/* ---------- Legal pages ---------- */

.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px clamp(20px, 5vw, 64px) 60px;
}

.legal-title {
  font-size: 26px;
  margin: 10px 0 4px;
}

.legal-updated {
  color: var(--text-2);
  font-size: 13px;
  margin: 0 0 28px;
}

.legal-page h2 {
  font-size: 17px;
  margin: 28px 0 10px;
}

.legal-page p,
.legal-page li {
  color: var(--text-1);
  line-height: 1.7;
  font-size: 14px;
}

.legal-page ul {
  padding-left: 20px;
  margin: 0 0 14px;
}

.legal-page a {
  color: var(--accent-2);
}

.tools-grid {
  margin-top: 22px;
}

.tool-card {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

a.tool-card:hover {
  border-color: var(--accent-1);
  transform: translateY(-2px);
}

.tool-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(88, 214, 141, 0.18);
  color: var(--rating-general);
}

.tool-badge-soon {
  background: rgba(124, 120, 145, 0.2);
  color: var(--text-2);
}

.tool-card-disabled {
  opacity: 0.6;
}

.blog-post-date {
  display: block;
  margin-top: 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-2);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand-name {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ---------- Footer ---------- */

.footer {
  text-align: center;
  padding: 20px;
  color: var(--text-2);
  font-size: 12px;
}

.footer-links {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
}

.footer-links a {
  color: var(--text-2);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent-2);
}
