:root {
  --primary: #6c5ce7;
  --primary-dark: #5a4bd1;
  --bg: #0f0f1a;
  --card: #1a1a2e;
  --card-hover: #252540;
  --text: #e8e8f0;
  --text-muted: #9b9bb5;
  --border: #2a2a45;
  --success: #00e676;
  --danger: #ff5252;
  --radius: 12px;
}

[data-theme="light"] {
  --bg: #f5f5fa;
  --card: #fff;
  --card-hover: #eeeef5;
  --text: #1a1a2e;
  --text-muted: #6b6b85;
  --border: #d0d0e0;
  --success: #00c853;
  --danger: #ff1744;
}

html {
  overscroll-behavior: none;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overscroll-behavior: none;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

nav .logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 28px;
  width: 96px;
  display: block;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.logo-white {
  background-image: url("logo.png");
}

.logo-black {
  display: none;
  background-image: url("logo-black.png");
}

[data-theme="light"] .logo-white {
  display: none;
}

[data-theme="light"] .logo-black {
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 6px;
  transition: 0.2s;
  cursor: pointer;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--card-hover);
}

.simple-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  margin: 0 auto;
  justify-content: center;
}

.simple-nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: 0.2s;
  cursor: pointer;
  white-space: nowrap;
}

.simple-nav-links a:hover {
  color: var(--text);
  background: var(--card-hover);
}

/* ── Hamburger ── */
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  border-radius: 6px;
  transition: 0.2s;
}

.hamburger:hover {
  background: var(--card-hover);
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 260px;
  height: 100dvh;
  height: 100vh;
  background: var(--card);
  border-right: 1px solid var(--border);
  z-index: 300;
  transition: left 0.3s ease;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  padding-top: 14px;
}

body.no-scroll {
  overflow: hidden;
}

html:has(.sidebar.open) {
  overflow: hidden;
  overscroll-behavior: none;
}

.sidebar.open {
  left: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 18px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.sidebar-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.sidebar-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 4px;
}

.sidebar-close:hover {
  color: var(--text);
}

.sidebar a {
  display: block;
  padding: 10px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: 0.2s;
  cursor: pointer;
}

.sidebar a:hover {
  background: var(--card-hover);
  color: var(--text);
}

.sidebar a.active {
  color: var(--primary);
  background: rgb(108, 92, 231, 0.1);
  border-right: 3px solid var(--primary);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgb(0, 0, 0, 0.5);
  z-index: 250;
}

.sidebar-overlay.open {
  display: block;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.hero {
  text-align: center;
  padding: 60px 0;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.hero h1 span {
  color: var(--primary);
}

.hero p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--text);
  transition: 0.2s;
  cursor: pointer;
  display: block;
}

.card:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
}

.card .icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.card h2 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.card-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.card-form h2 {
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

/* DID algorithm selectors — match form-group select but compact for inline use */
#did-algo-select,
#sdid-algo-select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}

#did-algo-select:focus,
#sdid-algo-select:focus {
  border-color: var(--primary);
}

.btn {
  display: inline-block;
  padding: 10px 28px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.2s;
  touch-action: manipulation;
}

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

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

.btn-sm {
  display: inline-block;
  padding: 5px 14px;
  background: var(--card, #f0f0f0);
  color: var(--text, #333);
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: 0.2s;
  touch-action: manipulation;
}

.btn-sm:hover {
  opacity: 0.85;
}

.tab-btn {
  flex: 1;
  background: var(--card-hover);
  color: var(--text-muted);
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
}

.result {
  margin-top: 10px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 400px;
  overflow: auto;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.78rem;
}

.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: auto;
}

.badge-success {
  background: rgb(0, 230, 118, 0.15);
  color: var(--success);
}

.badge-muted {
  background: rgb(155, 155, 181, 0.15);
  color: var(--text-muted);
}

.badge-warning {
  background: rgb(255, 193, 7, 0.15);
  color: #ffc107;
}

.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 12px auto;
}

.rt-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 4px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.2s;
}

.rt-check:hover {
  border-color: var(--primary);
}

.rt-check input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
  margin: 0;
}

.rt-check span {
  font-size: 0.85rem;
  line-height: 1.3;
}

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

.awm-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.awm-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.awm-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 3px;
}

.awm-progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 3em;
  text-align: right;
}

.c2pa-type-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.c2pa-type-card {
  cursor: pointer;
  user-select: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: 0.2s;
  overflow: hidden;
}

.c2pa-type-card:hover {
  border-color: var(--primary);
  background: var(--card-hover);
}

.c2pa-type-card:has(input:checked) {
  border-color: var(--primary);
  background: rgb(108, 92, 231, 0.12);
}

.c2pa-type-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  cursor: pointer;
}

.c2pa-type-card input[type="checkbox"] {
  accent-color: var(--primary);
  margin: 0;
  width: 14px;
  height: 14px;
}

.c2pa-type-name {
  font-size: 0.85rem;
}

.c2pa-type-fields {
  display: none;
  padding: 0 14px 10px;
  gap: 6px;
  flex-direction: column;
}

.c2pa-type-card:has(input:checked) .c2pa-type-fields {
  display: flex;
}

.c2pa-type-fields .c2pa-field {
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
}

.c2pa-type-fields .c2pa-ingredient-wrap {
  margin-top: 2px;
}

.c2pa-type-fields .c2pa-ingredient-wrap input {
  font-size: 0.75rem;
}

.dnt-card {
  margin-top: 6px;
}

.c2pa-links-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
}

.c2pa-link {
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

/* footer moved below */
#md-output {
  font-family: inherit;
  white-space: normal;
}

.meta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.meta-table td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.meta-table td:first-child {
  color: var(--text-muted);
  white-space: nowrap;
  width: 120px;
}

.meta-table code {
  font-size: 0.7rem;
  word-break: break-all;
}

/* ── Nav Search ── */
.nav-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 180px;
  flex-shrink: 0;
  margin: 0 4px;
  transition: width 0.3s ease;
}

.nav-search.focused {
  width: 220px;
}

.nav-search input {
  width: 100%;
  padding: 6px 14px;
  border: 1px solid transparent;
  background: var(--card-hover);
  border-radius: 20px;
  color: var(--text);
  font-size: 0.8rem;
  outline: none;
  height: 30px;
  cursor: text;
  transition: border-color 0.3s ease;
}

.nav-search.focused input,
.nav-search input:focus {
  border-color: var(--border);
  padding-right: 32px;
}

.nav-search .search-btn {
  position: absolute;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  opacity: 0.4;
  transition: 0.2s;
  font-size: 0;
}

.nav-search.focused .search-btn {
  opacity: 0.8;
}

.nav-search .search-btn::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  position: absolute;
  top: 4px;
  left: 4px;
}

.nav-search .search-btn::after {
  content: "";
  display: block;
  width: 6px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 1px;
  position: absolute;
  bottom: 6px;
  right: 3px;
  transform: rotate(45deg);
}

.nav-search.focused .search-btn::before {
  border-color: var(--primary);
}

.nav-search.focused .search-btn::after {
  background: var(--primary);
}

.nav-search .search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 360px;
  max-width: calc(100vw - 40px);
  max-height: 360px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgb(0, 0, 0, 0.4);
  z-index: 1000;
}

.nav-search.focused .search-results {
  display: block;
}

.search-result-item {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: 0.2s;
  cursor: pointer;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--card-hover);
}

.search-result-title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.search-result-snippet {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 404 Page ── */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  padding: 40px 20px;
}

.error-code {
  font-size: 8rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary), #a78bfa, #ec4899);
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: glow404 3s ease-in-out infinite;
}

@keyframes glow404 {
  0%,
  100% {
    filter: drop-shadow(0 0 20px rgb(108, 92, 231, 0.3));
  }

  50% {
    filter: drop-shadow(0 0 40px rgb(108, 92, 231, 0.6));
  }
}

.error-title {
  font-size: 1.4rem;
  color: var(--text);
  margin: 8px 0 6px;
}

.error-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 400px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.error-search {
  width: 100%;
  max-width: 400px;
  margin-bottom: 28px;
}

.error-search input {
  width: 100%;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: 0.2s;
}

.error-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(108, 92, 231, 0.15);
}

.error-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 400px;
}

.error-links a {
  padding: 8px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  transition: 0.2s;
}

.error-links a:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.error-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
}

.error-shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.05;
  animation: floatShape 20s ease-in-out infinite;
}

.error-shape:nth-child(1) {
  width: 300px;
  height: 300px;
  background: var(--primary);
  top: -50px;
  left: -50px;
  animation-delay: 0s;
}

.error-shape:nth-child(2) {
  width: 200px;
  height: 200px;
  background: #a78bfa;
  bottom: -30px;
  right: -30px;
  animation-delay: -5s;
}

.error-shape:nth-child(3) {
  width: 150px;
  height: 150px;
  background: #ec4899;
  top: 50%;
  left: 60%;
  animation-delay: -10s;
}

@keyframes floatShape {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(30px, -30px) scale(1.1);
  }

  50% {
    transform: translate(-20px, 20px) scale(0.9);
  }

  75% {
    transform: translate(20px, 30px) scale(1.05);
  }
}

/* ── Search results page ── */
#page-search .search-result-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
}

#page-search .search-result-item:hover {
  background: var(--card-hover);
  transform: translateY(-1px);
}

#page-search .search-result-title {
  font-size: 0.95rem;
}

#page-search .search-result-snippet {
  font-size: 0.8rem;
  white-space: normal;
  margin-top: 4px;
}

@media (width <= 640px) {
  nav {
    padding: 8px 14px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .sidebar {
    width: 220px;
    left: -240px;
  }

  .nav-search.focused {
    width: 140px;
  }

  .nav-search .search-results {
    width: calc(100vw - 40px);
    left: auto;
    right: 0;
  }

  .error-code {
    font-size: 5rem;
  }
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgb(0, 0, 0, 0.6);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 420px;
  width: 90%;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-close:hover {
  color: var(--text);
}

.dl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.dl-option {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 8px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.8rem;
  transition: 0.2s;
  text-align: center;
}

.dl-option:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.dl-icon {
  display: block;
  font-size: 1.3rem;
  margin-bottom: 4px;
}

/* ── Static pages (About, Privacy, Contact, Social) ── */
.static-page {
  max-width: 650px;
  margin: 0 auto;
}

.static-page h2 {
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 16px;
}

.static-page h3 {
  font-size: 1rem;
  color: var(--text);
  margin: 20px 0 8px;
}

.static-page p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 12px;
}

.static-page ul {
  margin: 12px 0 16px 20px;
}

.static-page ul li {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.static-page ul li strong {
  color: var(--text);
}

.static-page a {
  color: var(--primary);
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: 0.2s;
  cursor: pointer;
}

.contact-card:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
}

.contact-icon {
  font-size: 1.8rem;
}

.contact-title {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.contact-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.social-section-title {
  font-size: 1rem;
  margin: 0 0 4px;
  color: var(--text-muted);
  font-weight: 600;
}

.social-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: 0.2s;
  cursor: pointer;
}

.social-card:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
}

.social-icon {
  font-size: 2.2rem;
}

.social-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.social-handle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Theme Toggle ── */
.theme-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1.1rem;
  transition: 0.2s;
  color: var(--text-muted);
}

.theme-btn:hover {
  background: var(--card-hover);
  color: var(--text);
  border-color: var(--primary);
}

#themeToggle {
  position: fixed;
  top: 76px;
  right: 12px;
  z-index: 999;
  background: var(--card);
  box-shadow: 0 2px 8px rgb(0, 0, 0, 0.15);
}

html[dir="rtl"] #themeToggle {
  right: auto;
  left: 12px;
}

/* ── File Drop Zone ── */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
  position: relative;
}

.file-drop-zone:hover {
  border-color: var(--primary);
  background: rgb(108, 92, 231, 0.04);
}

.file-drop-zone.drag-over {
  border-color: var(--primary);
  background: rgb(108, 92, 231, 0.08);
  transform: scale(1.01);
}

.file-drop-zone input[type="file"] {
  display: none;
}

.file-drop-zone .dz-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 6px;
}

.file-drop-zone .dz-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.file-drop-zone .dz-text strong {
  color: var(--primary);
}

.file-drop-zone .dz-file {
  display: none;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text);
  margin-top: 8px;
  background: rgb(108, 92, 231, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
  word-break: break-all;
}

.file-drop-zone.has-file .dz-icon,
.file-drop-zone.has-file .dz-text {
  display: none;
}

.file-drop-zone.has-file .dz-file {
  display: inline-flex;
}

.file-drop-zone.has-file {
  border-style: solid;
  border-color: var(--success);
}

/* ── Back button (circular) ── */
.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card-hover);
  border: 1px solid var(--border);
  color: var(--primary);
  text-decoration: none;
  font-size: 1.25rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.back-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: scale(1.08);
}

.back-btn:hover .back-arrow {
  transform: translateX(-3px);
}

html[dir="rtl"] .back-btn:hover .back-arrow {
  transform: translateX(3px) scaleX(-1);
}

.back-btn:active {
  transform: scale(0.92);
}

.back-btn-label {
  display: none;
  font-size: 0.85rem;
  color: var(--primary);
}

@media (width >= 768px) {
  .back-btn-label {
    display: inline;
  }
}

/* ── Language Dropdown ── */
.lang-dropdown {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.lang-btn {
  background: var(--card-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 6px 12px;
  transition: 0.2s;
  min-width: 80px;
  text-align: center;
}

.lang-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 140px;
  box-shadow: 0 4px 12px rgb(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: 0.2s;
  z-index: 1000;
}

.lang-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  padding: 8px 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  transition: 0.2s;
  border-bottom: 1px solid var(--border);
}

.lang-option:last-child {
  border-bottom: none;
}

.lang-option:hover {
  background: var(--card-hover);
  color: var(--primary);
}

.lang-option[data-lang="ar"] {
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.lang-option[data-lang="zh"] {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ── C2PA ── */
.c2pa-section {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
}

.c2pa-section h3 {
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.c2pa-details-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.c2pa-details-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.c2pa-details-table td:first-child {
  color: var(--text-muted);
  white-space: nowrap;
  width: 140px;
  font-size: 0.75rem;
}

.c2pa-details-table code {
  font-size: 0.7rem;
  word-break: break-all;
}

.c2pa-validation-list {
  list-style: none;
  padding: 0;
  margin: 6px 0;
}

.c2pa-validation-list li {
  font-size: 0.75rem;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.c2pa-validation-list li:last-child {
  border-bottom: none;
}

.c2pa-validation-list code {
  font-size: 0.7rem;
  color: var(--text);
}

.c2pa-validation-category {
  margin: 8px 0 4px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.c2pa-validation-category strong {
  color: var(--text);
}

.c2pa-validation-summary {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 4px 0 8px;
}

.c2pa-action-item {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.c2pa-action-item:last-child {
  border-bottom: none;
}

.c2pa-action-number {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.c2pa-action-content {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}

.c2pa-action-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgb(108, 92, 231, 0.15);
  color: var(--primary);
}

.c2pa-action-src {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--card);
  padding: 1px 6px;
  border-radius: 4px;
}

.c2pa-action-desc {
  width: 100%;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.c2pa-action-params {
  width: 100%;
}

.c2pa-action-params pre {
  font-size: 0.68rem;
  margin: 4px 0;
  padding: 6px;
  background: var(--card);
  border-radius: 4px;
  max-height: 100px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.c2pa-action-agent {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.c2pa-action-when {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.c2pa-action-reason {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  width: 100%;
}

.c2pa-assertion-item {
  padding: 8px;
  margin-bottom: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.c2pa-assertion-item strong {
  font-size: 0.78rem;
}

.c2pa-assertion-item pre {
  font-size: 0.7rem;
  margin-top: 4px;
  max-height: 120px;
  overflow: auto;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-all;
}

.c2pa-ingredient-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}

.c2pa-ingredient-item:last-child {
  border-bottom: none;
}

.c2pa-sig-info p {
  font-size: 0.8rem;
  margin: 2px 0;
}

.c2pa-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

.c2pa-no-data {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}

.c2pa-no-data strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--text);
}

.c2pa-error {
  color: var(--danger);
  padding: 12px;
  background: rgb(255, 82, 82, 0.08);
  border-radius: 8px;
}

.c2pa-success {
  text-align: center;
  padding: 16px;
  color: var(--success);
}

.c2pa-success strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.c2pa-verify-result {
  text-align: center;
  padding: 20px;
  border-radius: var(--radius);
}

.c2pa-verified {
  background: rgb(0, 230, 118, 0.08);
  border: 1px solid var(--success);
}

.c2pa-unverified {
  background: rgb(255, 193, 7, 0.08);
  border: 1px solid #ffc107;
}

.c2pa-verify-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0 auto 8px;
  background: var(--success);
  color: #000;
}

.c2pa-verify-icon-warn {
  background: #ffc107;
}

.c2pa-verify-result strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.c2pa-verify-result p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 4px 0;
}

.c2pa-gen-info {
  font-size: 0.8rem;
  padding: 4px 0;
}

.c2pa-manifest-list {
  list-style: none;
  padding: 0;
  margin: 4px 0;
}

.c2pa-manifest-list li {
  font-size: 0.78rem;
  padding: 2px 0;
  color: var(--text-muted);
}

footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  cursor: pointer;
}

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

.footer-copy {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.footer-social a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition:
    color 0.2s,
    background 0.2s;
}

.footer-social a:hover {
  color: var(--primary);
  background: var(--card-hover);
}

.footer-social-label {
  font-size: 0.85rem;
  opacity: 0.6;
}

/* ── Mode selection overlay ── */

/* ── Page loading spinner (standalone MPA) ── */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-page, var(--bg, #f5f7fa));
  transition: opacity 0.35s ease;
  pointer-events: auto;
}

#page-loader.page-loader--hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border, #e0e0e0);
  border-top-color: var(--primary, #2563eb);
  border-radius: 50%;
  animation: page-loader-spin 0.8s linear infinite;
}

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

.mode-select-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  overflow: hidden;
}

html:has(#modeSelect:not([style*="display: none"])),
body:has(#modeSelect:not([style*="display: none"])) {
  overflow: hidden;
}

.mode-select-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 24px;
  width: 100%;
  flex-shrink: 0;
}

.mode-select-box {
  max-width: 520px;
  width: 100%;
  text-align: center;
  padding: 0 0 40px;
  margin: auto;
}

.mode-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.mode-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--card);
  padding: 4px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-origin: content-box;
}

.mode-logo.logo-white {
  background-image: url("logo.png");
}

.mode-logo.logo-black {
  background-image: url("logo-black.png");
}

[data-theme="dark"] .mode-logo.logo-black {
  display: none;
}

.mode-select-box h1 {
  font-size: 1.6rem;
  margin: 0 0 4px;
}

.mode-subtitle {
  color: var(--text-muted);
  margin: 0 0 28px;
  font-size: 0.95rem;
}

.mode-tagline {
  max-width: 520px;
  margin: -20px auto 28px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.mode-cards {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.mode-card {
  flex: 1;
  padding: 28px 20px;
  border-radius: var(--radius);
  background: var(--card);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
  color: inherit;
  display: block;
}

.mode-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
}

.mode-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.mode-card-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.mode-card h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.mode-card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.mode-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.mode-links a {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration: none;
  transition: color 0.2s;
}

.mode-links a:hover {
  color: var(--primary);
}

.mode-social {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.mode-social a {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-decoration: none;
  transition: color 0.2s;
}

.mode-social a:hover {
  color: var(--primary);
}

.mode-social-label {
  font-size: 0.8rem;
  opacity: 0.5;
  line-height: 1.6;
}

/* ── Simplified mode ── */
#simplifiedMode {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.simple-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.simple-top-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.simple-logo-link {
  display: flex;
  align-items: center;
  margin-right: 4px;
}

.simple-logo {
  height: 24px;
  width: 80px;
}

.simple-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.simple-mode-switch {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  white-space: nowrap;
  transition: all 0.2s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.simple-mode-switch:hover {
  border-color: var(--primary);
  color: var(--text);
}

.simple-progress {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  justify-content: center;
  padding: 6px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.sp-step {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.sp-step.sp-active {
  color: var(--primary);
  font-weight: 600;
}

.sp-step.sp-done {
  color: var(--success);
}

.sp-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  transition: all 0.2s;
}

.sp-active .sp-dot {
  background: var(--primary);
  border-color: var(--primary);
}

.sp-done .sp-dot {
  background: var(--success);
  border-color: var(--success);
}

.sp-done .sp-dot::after {
  content: "✓";
  color: #000;
  font-weight: bold;
  font-size: 0.65rem;
}

.sp-line {
  width: 20px;
  height: 2px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 4px;
}

.sp-done + .sp-line {
  background: var(--success);
}

.sp-active + .sp-line {
  background: var(--primary);
}

.simple-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  overflow-y: auto;
}

.simple-card {
  max-width: 560px;
  width: 100%;
  text-align: center;
}

.simple-card h2 {
  font-size: 1.3rem;
  margin: 0 0 8px;
}

.simple-card > p {
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 0.9rem;
}

.simple-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--card);
}

.simple-step-counter {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.simple-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
}

.simple-upload-zone:hover,
.simple-upload-zone.drag-over {
  border-color: var(--primary);
  background: rgb(108, 92, 231, 0.05);
}

.simple-upload-zone.has-file {
  border-color: var(--success);
  border-style: solid;
}

.dz-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.dz-text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.simple-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--border);
  text-align: left;
}

.simple-file-icon {
  font-size: 2rem;
}

/* AI question */
.simple-ai-options {
  display: flex;
  gap: 16px;
}

.simple-ai-card {
  flex: 1;
  padding: 28px 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.simple-ai-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.ai-icon {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 8px;
}

.simple-ai-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

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

/* simplified results */
.simple-success {
  color: var(--success);
  font-size: 0.85rem;
}

.simple-error {
  color: var(--danger);
  font-size: 0.85rem;
}

.simple-done h2 {
  font-size: 1.6rem;
}

.simple-results-list {
  margin: 20px 0;
  text-align: left;
}

.simple-result-item {
  padding: 10px 14px;
  margin-bottom: 6px;
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.simple-done-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.simple-done-section {
  padding: 16px;
  margin-bottom: 12px;
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.simple-done-section h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.simple-done-section .btn {
  margin-top: 8px;
}

.simple-done-preview {
  margin-top: 8px;
}

.simple-done-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 4px;
}

.simple-done-fp {
  font-size: 0.8rem;
}

.simple-done-fp table {
  width: 100%;
}

.simple-done-fp td {
  padding: 2px 4px;
  word-break: break-all;
}

@media (width <= 480px) {
  .mode-select-overlay {
    padding: 12px;
    justify-content: flex-start;
    overflow-y: auto;
  }

  .mode-cards {
    flex-direction: column;
  }

  .simple-ai-options {
    flex-direction: column;
  }

  .simple-top {
    padding: 6px 10px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .simple-progress {
    font-size: 0.65rem;
    padding: 4px 6px;
    gap: 2px;
    width: 100%;
    box-sizing: border-box;
  }

  .sp-step {
    white-space: nowrap;
    flex-shrink: 1;
    gap: 3px;
    min-width: 0;
    padding: 4px 5px;
    font-size: 0.6rem;
  }

  .sp-step-text {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
    white-space: nowrap;
  }

  .sp-dot {
    width: 6px;
    height: 6px;
    font-size: 0.5rem;
    flex-shrink: 0;
  }

  .sp-line {
    min-width: 14px;
    width: 12px;
    margin: 0 2px;
  }

  .simple-top-right .lang-btn {
    padding: 10px 8px;
    font-size: 0.8rem;
    min-height: 44px;
  }

  .simple-top-left .theme-btn {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .simple-body {
    padding: 20px 12px;
  }

  /* mode selection overlay */
  .mode-select-box {
    padding: 56px 16px 32px;
  }

  .mode-select-box h1 {
    font-size: 1.3rem;
  }

  .mode-subtitle {
    font-size: 0.82rem;
    margin-bottom: 20px;
  }

  .mode-tagline {
    font-size: 0.76rem;
    margin-bottom: 20px;
  }

  .mode-logo {
    width: 56px;
    height: 56px;
  }

  .mode-card {
    padding: 16px;
  }

  .mode-card-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
  }

  .mode-card h2 {
    font-size: 0.9rem;
  }

  .mode-card p {
    font-size: 0.76rem;
  }

  .mode-select-bar {
    padding: 6px 10px;
  }

  /* simplified cards */
  .simple-card {
    padding: 20px 14px;
  }

  .simple-card h2 {
    font-size: 1.15rem;
  }

  .simple-card > p {
    font-size: 0.82rem;
  }

  /* upload zone */
  .simple-upload-zone {
    padding: 32px 16px;
    min-height: 120px;
  }

  .simple-upload-zone .dz-icon {
    font-size: 2.2rem;
  }

  .simple-upload-zone .dz-text {
    font-size: 0.85rem;
  }

  /* file info */
  .simple-file-info {
    padding: 10px;
    gap: 10px;
  }

  .simple-file-icon {
    font-size: 1.6rem;
  }

  .simple-file-info strong {
    font-size: 0.85rem;
  }

  .simple-file-info .badge {
    font-size: 0.7rem;
  }

  /* ai cards */
  .simple-ai-card {
    padding: 14px;
  }

  .simple-ai-card .ai-icon {
    font-size: 1.8rem;
  }

  .simple-ai-card h3 {
    font-size: 0.9rem;
  }

  .simple-ai-card p {
    font-size: 0.78rem;
  }

  /* navigation */
  .simple-nav {
    padding: 8px 12px 12px;
    gap: 8px;
  }

  .simple-step-counter {
    font-size: 0.78rem;
  }

  .simple-nav .btn {
    min-height: 40px;
    font-size: 0.82rem;
  }

  /* done section */
  .simple-done h2 {
    font-size: 1.3rem;
  }

  .simple-done-section {
    padding: 12px;
  }

  .simple-done-section h3 {
    font-size: 0.9rem;
  }

  .simple-done-section .btn {
    width: 100%;
    margin-top: 6px;
  }

  .simple-done-actions {
    flex-direction: column;
    gap: 8px;
  }

  .simple-done-actions .btn {
    width: 100%;
  }

  .simple-done-fp table {
    font-size: 0.7rem;
  }

  .simple-done-fp td {
    padding: 2px;
  }

  .simple-done-preview img {
    max-height: 150px;
  }

  /* watermark download inline area */
  .simple-wm-dl .btn {
    width: auto;
    display: inline-block;
  }

  /* C2PA links */
  .c2pa-link {
    font-size: 0.82rem;
    padding: 8px 10px;
  }

  /* language menu in simplified */
  .simple-top-right .lang-menu {
    right: 0;
    left: auto;
  }

  /* simplified mode switch button */
  .simple-mode-switch {
    font-size: 0.82rem;
    padding: 10px 12px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

@media (width <= 360px) {
  .mode-select-overlay {
    padding: 8px;
  }

  .mode-select-box {
    padding: 52px 10px 24px;
  }

  .mode-select-box h1 {
    font-size: 1.1rem;
  }

  .mode-tagline {
    font-size: 0.7rem;
    margin-bottom: 16px;
  }

  .mode-card {
    padding: 12px;
  }

  .simple-card {
    padding: 16px 10px;
  }

  .simple-card h2 {
    font-size: 1rem;
  }

  .simple-upload-zone {
    padding: 24px 12px;
    min-height: 100px;
  }

  .simple-body {
    padding: 16px 8px;
  }

  .simple-done h2 {
    font-size: 1.1rem;
  }

  .simple-top {
    padding: 4px 8px;
    gap: 4px;
  }

  .simple-progress {
    font-size: 0.6rem;
    padding: 3px 8px;
    gap: 1px;
  }

  .sp-step {
    padding: 3px;
    font-size: 0.55rem;
  }

  .sp-line {
    min-width: 10px;
  }

  .simple-done-section {
    padding: 10px;
  }
}

/* ── Simplified fingerprint / pixel-injection result table ── */
.simple-fp-result table,
.simple-pi-result table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.simple-fp-result td,
.simple-pi-result td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.simple-fp-result td:first-child,
.simple-pi-result td:first-child {
  white-space: nowrap;
  font-weight: 600;
  color: var(--text-muted);
  width: 90px;
}

.simple-fp-result td code,
.simple-pi-result td code {
  word-break: break-all;
  font-size: 0.65rem;
}

.simple-fp-result > div,
.simple-pi-result > div {
  font-weight: 700;
  font-size: 0.82rem;
  margin-top: 12px;
  padding: 6px 0 2px;
  border-top: 1px solid var(--border);
}

/* ── Simplified info fields (step 1) ── */
.simple-info-section {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.simple-info-section .form-group {
  margin-bottom: 8px;
}

.simple-info-section .form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.simple-info-field {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
}

.simple-social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.simple-social-grid input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.82rem;
  box-sizing: border-box;
}

.simple-artist-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.simple-phone-group {
  display: flex;
  gap: 6px;
}

.simple-phone-group select {
  width: 110px;
  flex-shrink: 0;
  padding: 8px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

.simple-phone-group input {
  flex: 1;
  min-width: 0;
}

@media (width <= 480px) {
  .simple-phone-group {
    flex-direction: column;
  }

  .simple-phone-group select {
    width: 100%;
  }
}

.simple-field-warn {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 2px;
  display: block;
}

/* ── Certificate section (done page) ── */
.simple-cert-section {
  text-align: center;
  border: 2px solid var(--primary);
}

.simple-cert-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.cert-btn {
  min-width: 100px;
  min-height: 44px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.cert-btn:hover {
  opacity: 0.85;
}

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

.cert-field {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.8rem;
}

.cert-field:focus {
  border-color: var(--primary);
  outline: none;
}

.cert-link {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.8rem;
}

.cert-link:focus {
  border-color: var(--primary);
  outline: none;
}

.cert-music-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}

.cert-music-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

@media (width <= 480px) {
  .simple-social-grid {
    grid-template-columns: 1fr;
  }

  .simple-cert-btns {
    flex-direction: column;
    align-items: center;
  }

  .cert-btn {
    width: 100%;
    max-width: 200px;
  }
}

/* ── Floating Music Player ── */

/* ══ Music player moved to Style/music-player.css ══ */

/* ── Progress bar ── */
.simple-progress-bar {
  height: 3px;
  background: var(--border);
  overflow: hidden;
}

.spb-fill {
  height: 100%;
  width: 0;
  background: var(--primary);
  animation: spb-anim 2s ease-in-out infinite;
}

@keyframes spb-anim {
  0% {
    width: 0;
    margin-left: 0;
  }

  50% {
    width: 60%;
    margin-left: 20%;
  }

  100% {
    width: 0;
    margin-left: 100%;
  }
}

.fp-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fp-progress-track {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.fp-progress-fill {
  width: 0%;
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.2s ease;
}

.fp-progress-pct {
  font-size: 0.75rem;
  min-width: 36px;
  text-align: right;
  color: var(--text-muted);
}

.fp-progress-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

@keyframes conv-progress-indeterminate {
  0% {
    width: 0;
    margin-left: 0;
  }

  50% {
    width: 50%;
    margin-left: 25%;
  }

  100% {
    width: 0;
    margin-left: 100%;
  }
}

/* ── Clear button ── */
.simple-clear-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  color: var(--text-muted);
}

.simple-clear-btn:hover {
  border-color: var(--danger);
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgb(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  opacity: 0.7;
}

.lightbox-close:hover {
  opacity: 1;
}

/* ── Floating AI Assistant ── */
.ast-bubble {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent, #6c5ce7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  font-size: 22px;
  box-shadow: 0 2px 12px rgb(0, 0, 0, 0.3);
  transition: transform 0.2s;
  touch-action: manipulation;
}

.ast-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgb(108, 92, 231, 0.6);
}

.ast-bubble:active {
  transform: scale(0.95);
}

.ast-bubble span {
  pointer-events: none;
}

.ast-panel {
  position: fixed;
  bottom: 90px;
  bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  left: 24px;
  left: calc(24px + env(safe-area-inset-left, 0px));
  width: 360px;
  max-width: calc(
    100vw - 48px - env(safe-area-inset-left, 0px) -
      env(safe-area-inset-right, 0px)
  );
  height: 480px;
  max-height: calc(100vh - 140px - env(safe-area-inset-bottom, 0px));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgb(0, 0, 0, 0.3);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transition: all 0.25s ease;
  overflow: hidden;
}

.ast-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.ast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--primary);
  color: #fff;
  flex-shrink: 0;
}

.ast-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.ast-header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.ast-clear-btn,
.ast-close-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 4px;
  opacity: 0.8;
  transition: opacity 0.2s;
  line-height: 1;
  border-radius: 4px;
}

.ast-clear-btn:hover,
.ast-close-btn:hover {
  opacity: 1;
  background: rgb(255, 255, 255, 0.15);
}

.ast-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

.ast-messages::-webkit-scrollbar {
  width: 4px;
}

.ast-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.ast-msg {
  display: flex;
  gap: 8px;
  max-width: 88%;
  animation: astFadeIn 0.2s ease;
}

@keyframes astFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ast-msg-bot {
  align-self: flex-start;
}

.ast-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ast-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  position: relative;
}

.ast-avatar::after {
  content: "🤖";
  font-size: 0.85rem;
}

.ast-content {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ast-msg-bot .ast-content {
  background: var(--bg);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.ast-msg-bot .ast-content strong {
  color: var(--primary);
}

.ast-msg-user .ast-content {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ast-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px 4px;
  flex-shrink: 0;
}

.ast-chip {
  background: rgb(108, 92, 231, 0.1);
  border: 1px solid rgb(108, 92, 231, 0.2);
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 0.75rem;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  touch-action: manipulation;
}

.ast-chip:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.ast-input-area {
  display: flex;
  gap: 8px;
  padding: 8px 14px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  align-items: flex-end;
}

.ast-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-size: 0.82rem;
  outline: none;
  resize: none;
  font-family: inherit;
  max-height: 80px;
  line-height: 1.4;
}

.ast-input:focus {
  border-color: var(--primary);
}

.ast-input::placeholder {
  color: var(--text-muted);
}

.ast-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ast-send-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.ast-send-btn:active {
  transform: scale(0.95);
}

.ast-typing {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ast-typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 8px 16px;
  background: var(--bg);
  border-radius: 12px;
}

.ast-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  display: block;
  animation: astTyping 1.4s infinite both;
}

.ast-typing-dots span:nth-child(1) {
  animation-delay: 0s;
}

.ast-typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.ast-typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes astTyping {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

html[dir="rtl"] .ast-msg-bot {
  align-self: flex-end;
}

html[dir="rtl"] .ast-msg-user {
  align-self: flex-start;
}

/* ── Bot / Automation block overlay ── */
.bot-block-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgb(15, 15, 26, 0.97);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  backdrop-filter: blur(8px);
}

.bot-block-overlay.active {
  display: flex;
}

.bot-block-content {
  text-align: center;
  max-width: 480px;
  padding: 40px 32px;
}

.bot-block-icon {
  font-size: 72px;
  margin-bottom: 20px;
}

.bot-block-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #f0f0f0;
}

.bot-block-text {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.bot-block-link {
  color: #a78bfa;
  text-decoration: underline;
  font-size: 14px;
  cursor: pointer;
}

.bot-block-link:hover {
  color: var(--primary-dark);
}

/* ── Help card for professional mode service guides ── */
.help-card {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.help-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  background: var(--card-hover);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  gap: 8px;
}

.help-card-header:hover {
  background: var(--border);
}

.help-card-toggle {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
  color: var(--text-muted);
  flex-shrink: 0;
}

.help-card.collapsed .help-card-toggle {
  transform: rotate(-90deg);
}

.help-card-body {
  padding: 12px 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.7;
  white-space: pre-line;
}

.help-card.collapsed .help-card-body {
  display: none;
}

/* Audio Watermark */
.awm-pre {
  background: var(--card, #1a1a2e);
  padding: 12px 16px;
  border-radius: 8px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  margin-top: 8px;
}

#awm-strength-group {
  display: none;
}

#awm-strength-ex-group {
  display: none;
}
