/* ==========================================================================
   Design tokens compartilhados (ver docs/DESIGN_SYSTEM.md).
   Novas telas devem consumir estes var() em vez de repetir valores inline.
   ========================================================================== */
:root {
  /* superfícies */
  --ct-bg: #0b0e17;
  --ct-panel: #101827;
  --ct-panel-soft: rgba(16, 24, 39, 0.7);
  --ct-panel-2: #17233a;
  --ct-line: rgba(148, 178, 209, 0.14);
  /* acento (teal) */
  --ct-accent: #5eead4;
  --ct-accent-strong: #0d9488;
  --ct-accent-ink: #04231e;
  --ct-accent-grad: linear-gradient(135deg, #5eead4, #0d9488);
  /* texto */
  --ct-text: #f4f7fb;
  --ct-soft: #c7d3e3;
  --ct-muted: #94a7c0;
  /* estado */
  --ct-danger: #f87171;
  --ct-danger-ink: #fca5a5;
  --ct-warn: #f5c86b;
  /* forma */
  --ct-radius-control: 10px;
  --ct-radius-card: 15px;
  --ct-radius-pill: 999px;
  --ct-shadow-card: 0 30px 80px rgba(0, 0, 0, 0.35);
  /* tipografia */
  --ct-font-title: 'Outfit', sans-serif;
  --ct-font-body: 'Inter', sans-serif;
}

html[data-theme="light"] {
  --ct-bg: #f3f7f5;
  --ct-panel: #ffffff;
  --ct-panel-soft: rgba(255, 255, 255, 0.94);
  --ct-panel-2: #eef4f2;
  --ct-line: rgba(18, 32, 51, 0.14);
  --ct-text: #122033;
  --ct-soft: #33445a;
  --ct-muted: #526273;
}

html {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.theme-toggle {
  width: 76px;
  height: 38px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 999px;
  padding: 3px;
  background: #111827;
  color: #f4f7fb;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: rgba(13, 148, 136, 0.72);
  outline: 0;
}

.theme-toggle-floating {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.28);
}

.theme-toggle-track {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
  position: relative;
  border-radius: inherit;
}

.theme-toggle-icon {
  z-index: 1;
  width: 16px;
  height: 16px;
  color: rgba(248, 250, 252, 0.7);
  pointer-events: none;
}

.theme-toggle-thumb {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #0d9488;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease, background 0.18s ease;
}

html[data-theme="light"] .theme-toggle {
  background: #ffffff;
  color: #122033;
  border-color: rgba(18, 32, 51, 0.2);
  box-shadow: 0 10px 28px rgba(18, 32, 51, 0.12);
}

html[data-theme="light"] .theme-toggle-icon {
  color: rgba(18, 32, 51, 0.68);
}

html[data-theme="light"] .theme-toggle-thumb {
  transform: translateX(36px);
  background: #f7c948;
}

html[data-theme="light"] body {
  background: #f3f7f5;
  color: #122033;
}

html[data-theme="light"] body:not(.home-body) {
  background:
    radial-gradient(circle at 18% 0%, rgba(13, 148, 136, 0.08), transparent 28%),
    linear-gradient(145deg, #f8fbfa 0%, #eef4f2 100%);
}

html[data-theme="light"] aside {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: rgba(18, 32, 51, 0.12);
}

html[data-theme="light"] aside .brand,
html[data-theme="light"] aside .nav a,
html[data-theme="light"] aside .logout {
  color: #122033;
}

html[data-theme="light"] aside .nav a.active {
  color: #04231e;
}

html[data-theme="light"] .package,
html[data-theme="light"] .panel,
html[data-theme="light"] .item,
html[data-theme="light"] .rep,
html[data-theme="light"] .field,
html[data-theme="light"] .note,
html[data-theme="light"] .collab,
html[data-theme="light"] .waiting-box {
  background: #ffffff;
  border-color: rgba(18, 32, 51, 0.14);
  color: #122033;
  box-shadow: 0 16px 44px rgba(18, 32, 51, 0.09);
}

html[data-theme="light"] .muted,
html[data-theme="light"] .empty,
html[data-theme="light"] .message,
html[data-theme="light"] .item span,
html[data-theme="light"] .note p {
  color: #526273;
}

html[data-theme="light"] input:not([type="range"]):not([type="file"]):not([type="checkbox"]):not([type="radio"]),
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: #ffffff;
  color: #122033;
  border-color: rgba(18, 32, 51, 0.18);
}

html[data-theme="light"] .check,
html[data-theme="light"] .btn.secondary,
html[data-theme="light"] button.secondary,
html[data-theme="light"] .ghost {
  background: #f3f7f5;
  color: #122033;
  border-color: rgba(18, 32, 51, 0.16);
}

html[data-theme="light"] body.home-body {
  background:
    radial-gradient(circle at 78% 10%, rgba(13, 148, 136, 0.12), transparent 28%),
    linear-gradient(145deg, #eef8f5 0%, #f8fbfa 52%, #eef2f7 100%);
}

html[data-theme="light"] body.home-body .brand {
  color: #122033;
}

html[data-theme="light"] body.home-body .nav a {
  color: #65758a;
}

html[data-theme="light"] body.home-body .nav a:hover {
  color: #122033;
}

html[data-theme="light"] body.home-body .nav a.primary {
  color: #04231e;
  background: #0d9488;
}

html[data-theme="light"] body.home-body .btn-secondary {
  color: #122033;
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(18, 32, 51, 0.14);
}

html[data-theme="light"] body.home-body .hero-summary {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(18, 32, 51, 0.12);
  box-shadow: 0 24px 70px rgba(18, 32, 51, 0.12);
}

html[data-theme="light"] body.home-body .hero-summary h2,
html[data-theme="light"] body.home-body .summary-card strong,
html[data-theme="light"] body.home-body .workflow-step strong {
  color: #122033;
}

html[data-theme="light"] body.home-body .hero-summary p,
html[data-theme="light"] body.home-body .summary-card span,
html[data-theme="light"] body.home-body .workflow-step span,
html[data-theme="light"] body.home-body .card p {
  color: #526273;
}

html[data-theme="light"] body.home-body .summary-card,
html[data-theme="light"] body.home-body .workflow-step,
html[data-theme="light"] body.home-body .card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(18, 32, 51, 0.12);
  color: #122033;
}

html[data-theme="light"] body.home-body .tag {
  color: #08725f;
  background: rgba(13, 148, 136, 0.1);
  border-color: rgba(13, 148, 136, 0.28);
}

html[data-theme="light"] .hero-grid .brand,
html[data-theme="light"] .hero-grid h1,
html[data-theme="light"] .hero-grid .hero-title {
  color: #122033;
}

html[data-theme="light"] .hero-summary {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(18, 32, 51, 0.12);
  box-shadow: 0 24px 70px rgba(18, 32, 51, 0.12);
}

html[data-theme="light"] .hero-summary h2,
html[data-theme="light"] .workflow-step strong,
html[data-theme="light"] .summary-card strong {
  color: #122033;
}

html[data-theme="light"] .hero-summary p,
html[data-theme="light"] .workflow-step span,
html[data-theme="light"] .summary-card span {
  color: #526273;
}

html[data-theme="light"] .workflow-step,
html[data-theme="light"] .summary-card {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(18, 32, 51, 0.12);
}

html[data-theme="light"] .hero-proof span,
html[data-theme="light"] .tag {
  color: #08725f;
  background: rgba(13, 148, 136, 0.1);
  border-color: rgba(13, 148, 136, 0.28);
}

html[data-theme="light"] .btn-secondary {
  color: #122033;
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(18, 32, 51, 0.16);
}

html[data-theme="light"] body.home-body .tool-native .intro-panel,
html[data-theme="dark"] body.home-body .tool-native .intro-panel,
html[data-theme="light"] body .app-shell .intro-panel,
html[data-theme="dark"] body .app-shell .intro-panel {
  color: #f4f7fb;
}

html[data-theme="light"] body.home-body .tool-native .intro-panel h1,
html[data-theme="light"] body.home-body .tool-native .intro-panel .subtitle,
html[data-theme="light"] body.home-body .tool-native .intro-panel .quick-stats span,
html[data-theme="light"] body.home-body .tool-native .intro-panel .quick-stats strong,
html[data-theme="light"] body .app-shell .intro-panel h1,
html[data-theme="light"] body .app-shell .intro-panel .subtitle,
html[data-theme="light"] body .app-shell .intro-panel .quick-stats span,
html[data-theme="light"] body .app-shell .intro-panel .quick-stats strong {
  color: #f4f7fb;
}

html[data-theme="light"] body .app-shell {
  color: #122033;
}

html[data-theme="dark"] body .app-shell {
  color: #f4f7fb;
}

html[data-theme="light"] body .app-shell .source-card,
html[data-theme="light"] body .app-shell .mixer-section {
  background: #ffffff;
  color: #122033;
  border-color: rgba(18, 32, 51, 0.14);
}

html[data-theme="dark"] body .app-shell .source-card {
  background: #111b2c;
  color: #f4f7fb;
  border-color: rgba(148, 163, 184, 0.38);
}

html[data-theme="dark"] body .app-shell .mixer-section {
  background: #142033;
  color: #f4f7fb;
}

html[data-theme="light"] body .app-shell .source-card h2,
html[data-theme="light"] body .app-shell .source-card label,
html[data-theme="light"] body .app-shell .dropzone-title,
html[data-theme="light"] body .app-shell .url-field {
  color: #122033;
}

html[data-theme="dark"] body .app-shell .source-card h2,
html[data-theme="dark"] body .app-shell .source-card label,
html[data-theme="dark"] body .app-shell .dropzone-title,
html[data-theme="dark"] body .app-shell .url-field {
  color: #f4f7fb;
}

html[data-theme="light"] body .app-shell .dropzone,
html[data-theme="light"] body .app-shell .status,
html[data-theme="light"] body .app-shell .url-input-shell,
html[data-theme="light"] body .app-shell .sample-panel {
  background: #f3f7f5;
  border-color: rgba(18, 32, 51, 0.14);
}

html[data-theme="dark"] body .app-shell .dropzone,
html[data-theme="dark"] body .app-shell .status,
html[data-theme="dark"] body .app-shell .url-input-shell,
html[data-theme="dark"] body .app-shell .sample-panel {
  background: #132033;
  border-color: rgba(148, 163, 184, 0.28);
}

html[data-theme="light"] body .app-shell .dropzone-note,
html[data-theme="light"] body .app-shell .rights-note,
html[data-theme="light"] body .app-shell .source-meta,
html[data-theme="light"] body .app-shell .sample-panel span,
html[data-theme="light"] body .app-shell .status {
  color: #526273;
}

html[data-theme="dark"] body .app-shell .dropzone-note,
html[data-theme="dark"] body .app-shell .rights-note,
html[data-theme="dark"] body .app-shell .source-meta,
html[data-theme="dark"] body .app-shell .sample-panel span,
html[data-theme="dark"] body .app-shell .status {
  color: #b9c7d8;
}

html[data-theme="light"] body .app-shell .source-tabs {
  background: rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] body .app-shell .source-tabs {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] body .app-shell .source-tab {
  color: #44566b;
}

html[data-theme="dark"] body .app-shell .source-tab {
  color: #c9d5e6;
}

html[data-theme="light"] body .app-shell .source-tab.active,
html[data-theme="dark"] body .app-shell .source-tab.active {
  color: #04231e;
  background: #8ee7dd;
}

html[data-theme="dark"] body .app-shell .source-tab:disabled {
  color: rgba(201, 213, 230, 0.5);
}

html[data-theme="light"] body .app-shell input[type="range"],
html[data-theme="dark"] body .app-shell input[type="range"] {
  background: transparent;
  border: 0;
  box-shadow: none;
}

html[data-theme="light"] body .app-shell .mixer-section h2,
html[data-theme="light"] body .app-shell .mixer-section label,
html[data-theme="light"] body .app-shell .mixer-section .channel {
  color: #122033;
}

html[data-theme="dark"] body .app-shell .mixer-section h2,
html[data-theme="dark"] body .app-shell .mixer-section label {
  color: #f4f7fb;
}

@media (max-width: 760px) {
  .theme-toggle {
    width: 68px;
    height: 34px;
  }

  .theme-toggle-thumb {
    width: 26px;
    height: 26px;
  }

  html[data-theme="light"] .theme-toggle-thumb {
    transform: translateX(32px);
  }

  .theme-toggle-floating {
    right: 10px;
    bottom: 10px;
  }
}

/* ── Light theme contrast fixes for dashboard elements ── */

html[data-theme="light"] .pill {
  color: #07594d;
  background: rgba(13, 148, 136, 0.12);
  border-color: rgba(13, 148, 136, 0.3);
}

html[data-theme="light"] .share,
html[data-theme="light"] .share a {
  color: #08725f;
}

html[data-theme="light"] .counter {
  color: #3b5068;
}

html[data-theme="light"] .counter.warn {
  color: #b42318;
}

html[data-theme="light"] .message.error {
  color: #b42318;
}

html[data-theme="light"] .danger,
html[data-theme="light"] button.danger {
  background: rgba(180, 35, 24, 0.08);
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.22);
}

html[data-theme="light"] .history-copy span {
  color: #526273;
}

html[data-theme="light"] .plan-badge {
  color: #07594d;
  background: rgba(13, 148, 136, 0.1);
  border-color: rgba(13, 148, 136, 0.28);
}

html[data-theme="light"] .metric span,
html[data-theme="light"] .muted,
html[data-theme="light"] .empty {
  color: #526273;
}

html[data-theme="light"] .metric {
  background: #ffffff;
  border-color: rgba(18, 32, 51, 0.14);
}

html[data-theme="light"] .metric strong {
  color: #122033;
}

html[data-theme="light"] .compact-tool {
  background: rgba(18, 32, 51, 0.04);
  border-color: rgba(18, 32, 51, 0.12);
}

html[data-theme="light"] .compact-head span,
html[data-theme="light"] .compact-result span {
  color: #526273;
}

html[data-theme="light"] .nav a:hover,
html[data-theme="light"] .side-foot a:hover {
  background: rgba(18, 32, 51, 0.06);
  color: #122033;
}

html[data-theme="light"] .nav a.active {
  color: #04231e;
  background: linear-gradient(135deg, #5eead4, #0d9488);
}

html[data-theme="light"] .form-footer {
  background: rgba(18, 32, 51, 0.04);
  border-color: rgba(18, 32, 51, 0.12);
}

html[data-theme="light"] .rep {
  color: #122033;
}

html[data-theme="light"] .rep.active {
  border-color: rgba(13, 148, 136, 0.36);
  background: rgba(13, 148, 136, 0.08);
}

html[data-theme="light"] .rep span,
html[data-theme="light"] .item span {
  color: #526273;
}

html[data-theme="light"] .item strong,
html[data-theme="light"] .rep strong {
  color: #122033;
}

html[data-theme="light"] .top p {
  color: #526273;
}

html[data-theme="light"] .panel-head p {
  color: #526273;
}

html[data-theme="light"] label {
  color: #3b5068;
}

html[data-theme="light"] select option {
  background: #ffffff;
  color: #122033;
}

html[data-theme="light"] .lesson-check {
  background: rgba(18, 32, 51, 0.04);
}

html[data-theme="light"] button:disabled {
  background: #e2e8f0;
  color: #94a7c0;
}

html[data-theme="light"] .external-links summary {
  color: #3b5068;
}

html[data-theme="light"] .brand {
  color: #122033;
}

html[data-theme="light"] .brand img {
  filter: none;
}

html[data-theme="light"] aside {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: rgba(18, 32, 51, 0.12);
}

html[data-theme="light"] .nav a,
html[data-theme="light"] .side-foot a {
  color: #526273;
}
