html {
  color-scheme: light;
}

.settings-appearance {
  border: 1.5px solid #d4ccbe;
  border-radius: 0.76rem;
  background: #fffdf8;
  padding: 0.76rem;
  display: grid;
  gap: 0.55rem;
}

.settings-theme-toggle {
  width: 100%;
  min-height: 3.25rem;
  border: 0;
  background: transparent;
  color: #1e1d1c;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.settings-theme-copy {
  min-width: 0;
  display: grid;
  gap: 0.22rem;
}

.settings-theme-copy strong {
  font-size: 0.98rem;
  line-height: 1.15;
}

.settings-theme-copy small {
  color: #6f6a61;
  font-size: 0.78rem;
  line-height: 1.3;
}

.settings-theme-switch {
  width: 2.9rem;
  height: 1.62rem;
  flex: 0 0 auto;
  border: 1.5px solid #aaa398;
  border-radius: 999px;
  background: #d9d5ce;
  padding: 0.16rem;
  display: flex;
  align-items: center;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.settings-theme-switch-knob {
  width: 1.14rem;
  height: 1.14rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(30, 29, 28, 0.24);
  transform: translateX(0);
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.settings-theme-toggle[aria-checked="true"] .settings-theme-switch {
  border-color: #11795b;
  background: #11795b;
}

.settings-theme-toggle[aria-checked="true"] .settings-theme-switch-knob {
  transform: translateX(1.24rem);
}

.settings-theme-toggle:focus-visible {
  outline: 3px solid rgba(17, 121, 91, 0.2);
  outline-offset: 0.3rem;
  border-radius: 0.35rem;
}

html[data-mindfree-theme="dark"] {
  color-scheme: dark;
  --bg-1: #131510;
  --bg-2: #171b15;
  --ink: #f4efe6;
  --muted: #b7b0a5;
  --line: #454a40;
  --lane: rgba(29, 32, 27, 0.9);
  --bubble: #232720;
  --bubble-hover: #2b3028;
  --accent: #46c493;
  --dark-surface: #1c1f1a;
  --dark-surface-raised: #252922;
  --dark-surface-soft: #20231e;
  --dark-border: #454a40;
}

html[data-mindfree-theme="dark"],
html[data-mindfree-theme="dark"] body {
  background: #131510;
}

html[data-mindfree-theme="dark"] body:not(.dino-mode) {
  color: var(--ink);
  background: #131510;
}

html[data-mindfree-theme="dark"] body.mobile-page {
  background: #131510;
}

html[data-mindfree-theme="dark"] .brand-kicker,
html[data-mindfree-theme="dark"] .settings-capture-title,
html[data-mindfree-theme="dark"] .settings-contact-link,
html[data-mindfree-theme="dark"] .settings-capture-link,
html[data-mindfree-theme="dark"] .category-add-pill {
  color: var(--accent) !important;
}

html[data-mindfree-theme="dark"] :is(
  .filter-chip,
  .filter-chip-overflow,
  .header-quick-menu,
  .bubble,
  .lane-thought-placeholder,
  .archive-item,
  .settings-category-row,
  .settings-account,
  .settings-capture-guide,
  .settings-appearance,
  .settings-password-panel,
  .settings-row-color-wrap,
  .settings-row-action,
  .settings-actions button,
  .modal-card,
  .new-thought-lane-btn,
  .edit-thought-lane-btn,
  .coach-savage-action,
  .coach-savage-lane-choice,
  .coach-savage-move-back,
  .coach-chat-back,
  .coach-chat-message.is-assistant
) {
  border-color: var(--dark-border);
  background: var(--dark-surface-raised);
  color: var(--ink);
}

html[data-mindfree-theme="dark"] .filter-chip-placeholder {
  border-color: #596056;
  background: rgba(37, 41, 34, 0.48);
}

html[data-mindfree-theme="dark"] .filter-chip-add-candidate,
html[data-mindfree-theme="dark"] .filter-chip-control {
  border-color: #4f554b !important;
  background: #22261f !important;
  color: #aaa499 !important;
}

html[data-mindfree-theme="dark"] .header-quick-link:hover,
html[data-mindfree-theme="dark"] .filter-word:hover,
html[data-mindfree-theme="dark"] .settings-dots:hover {
  color: #fffaf0;
}

html[data-mindfree-theme="dark"] .board {
  border-color: #555b50;
  background: #191c17;
  box-shadow: 0 1.4rem 4rem rgba(0, 0, 0, 0.24);
}

html[data-mindfree-theme="dark"] .lane,
html[data-mindfree-theme="dark"] .inbox-top {
  border-color: #4b5147;
}

html[data-mindfree-theme="dark"] .lane-group-header {
  background: color-mix(in srgb, var(--lane-group-accent) 10%, #242820);
  color: color-mix(in srgb, var(--lane-group-accent) 58%, #d8d1c7);
}

html[data-mindfree-theme="dark"] .lane-group-header-no-label,
html[data-mindfree-theme="dark"] .inbox-bubble-category-label {
  color: #aba499;
}

html[data-mindfree-theme="dark"] .bubble {
  box-shadow: 0 0.18rem 0.55rem rgba(0, 0, 0, 0.16);
}

html[data-mindfree-theme="dark"] .bubble:hover {
  background: var(--bubble-hover);
}

html[data-mindfree-theme="dark"] .modal::backdrop {
  background: rgba(4, 5, 4, 0.72);
}

html[data-mindfree-theme="dark"] .modal-card {
  border-color: #555b50;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.42);
}

html[data-mindfree-theme="dark"] .modal-card p,
html[data-mindfree-theme="dark"] .settings-heading p,
html[data-mindfree-theme="dark"] .settings-left p,
html[data-mindfree-theme="dark"] .settings-right p,
html[data-mindfree-theme="dark"] .settings-theme-copy small,
html[data-mindfree-theme="dark"] .settings-account-field,
html[data-mindfree-theme="dark"] .settings-default-tag,
html[data-mindfree-theme="dark"] .settings-password-note,
html[data-mindfree-theme="dark"] .settings-category-status,
html[data-mindfree-theme="dark"] .app-footer-link {
  color: var(--muted) !important;
}

html[data-mindfree-theme="dark"] .settings-section-kicker {
  color: #969085 !important;
}

html[data-mindfree-theme="dark"] .settings-heading {
  border-color: #42473e;
}

html[data-mindfree-theme="dark"] .settings-divider {
  background: linear-gradient(to bottom, transparent, #4a5046 18%, #62685d 50%, #4a5046 82%, transparent);
}

html[data-mindfree-theme="dark"] :is(
  .modal-card input:not([type="radio"]):not([type="checkbox"]):not([type="color"]),
  .modal-card textarea,
  .modal-card select,
  .settings-account-field input,
  .settings-category-name,
  .add-category-card input[type="text"],
  .add-category-card select,
  .coach-chat-form textarea
) {
  border-color: #565c51;
  background: #181b16;
  color: var(--ink);
}

html[data-mindfree-theme="dark"] :is(input, textarea)::placeholder {
  color: #858b81;
  opacity: 1;
}

html[data-mindfree-theme="dark"] .settings-account-value,
html[data-mindfree-theme="dark"] .settings-capture-title,
html[data-mindfree-theme="dark"] .settings-shared-name,
html[data-mindfree-theme="dark"] .settings-theme-toggle,
html[data-mindfree-theme="dark"] .category-pill-picker .color-dot,
html[data-mindfree-theme="dark"] .new-thought-section-label,
html[data-mindfree-theme="dark"] #new-thought-form .color-fieldset legend {
  color: var(--ink) !important;
}

html[data-mindfree-theme="dark"] .settings-theme-switch {
  border-color: #656b60;
  background: #454a42;
}

html[data-mindfree-theme="dark"] .settings-theme-switch-knob {
  background: #f5f1e8;
}

html[data-mindfree-theme="dark"] .settings-theme-toggle[aria-checked="true"] .settings-theme-switch {
  border-color: var(--accent);
  background: #178460;
}

html[data-mindfree-theme="dark"] .settings-add-category-btn,
html[data-mindfree-theme="dark"] .modal-actions button,
html[data-mindfree-theme="dark"] .settings-capture-copy-email-btn {
  border-color: #5a6156;
}

html[data-mindfree-theme="dark"] .settings-row-action:hover,
html[data-mindfree-theme="dark"] .settings-actions button:hover,
html[data-mindfree-theme="dark"] .archive-action:hover {
  background: #30352d;
}

html[data-mindfree-theme="dark"] .settings-row-action-delete,
html[data-mindfree-theme="dark"] .archive-action-danger {
  border-color: #885f5f;
  background: #2f2020;
  color: #f0a5a5;
}

html[data-mindfree-theme="dark"] .color-radio:checked + .color-dot,
html[data-mindfree-theme="dark"] .color-radio:focus-visible + .color-dot {
  box-shadow: 0 0 0 2px var(--dark-surface-raised), 0 0 0 4px #d8d1c7;
}

html[data-mindfree-theme="dark"] .category-pill-picker .color-radio:checked + .color-dot .category-pill-dot,
html[data-mindfree-theme="dark"] .category-pill-picker .color-radio:focus-visible + .color-dot .category-pill-dot {
  box-shadow: 0 0 0 2px var(--dark-surface-raised), 0 0 0 3.5px color-mix(in srgb, var(--dot-color) 76%, #f4efe6);
}

html[data-mindfree-theme="dark"] :is(
  .system-invite-card,
  .system-inbox-card,
  .decision-review-card,
  .system-capture-modal-card,
  .coach-card,
  .coach-bubble-action,
  .coach-bubble-subject,
  .welcome-card,
  .capture-card,
  .auth-card,
  .tutorial-card
) {
  border-color: var(--dark-border);
  background: var(--dark-surface);
  color: var(--ink);
}

html[data-mindfree-theme="dark"] :is(
  .system-invite-body,
  .system-inbox-card-title,
  .system-inbox-card-body,
  .system-inbox-card-bullets,
  .decision-review-card h3,
  .coach-directive,
  .coach-bubble-subject
) {
  color: var(--ink);
}

html[data-mindfree-theme="dark"] .coach-savage-complete,
html[data-mindfree-theme="dark"] .coach-commit,
html[data-mindfree-theme="dark"] .coach-chat-message.is-user {
  background: #16825f;
  color: #fff;
}

html[data-mindfree-theme="dark"] .coach-savage-ignore,
html[data-mindfree-theme="dark"] .coach-feedback,
html[data-mindfree-theme="dark"] .coach-savage-move-back {
  color: #aaa399;
}

html[data-mindfree-theme="dark"] .coach-chat-prompts button,
html[data-mindfree-theme="dark"] .coach-capture-action {
  border-color: rgba(70, 196, 147, 0.42);
  background: rgba(29, 105, 78, 0.22);
  color: var(--accent);
}

html[data-mindfree-theme="dark"] body.mobile-page .settings-dots,
html[data-mindfree-theme="dark"] body.mobile-page .mobile-lane-nav,
html[data-mindfree-theme="dark"] body.mobile-page .mobile-lane-tab,
html[data-mindfree-theme="dark"] body.mobile-page .mobile-lane-add,
html[data-mindfree-theme="dark"] body.mobile-page .mobile-add-choice,
html[data-mindfree-theme="dark"] body.mobile-page .mobile-add-choice button,
html[data-mindfree-theme="dark"] body.mobile-page .mobile-more-menu-card,
html[data-mindfree-theme="dark"] body.mobile-page .mobile-bubble-move-card,
html[data-mindfree-theme="dark"] body.mobile-page .mobile-more-menu-actions button,
html[data-mindfree-theme="dark"] body.mobile-page .mobile-bubble-move-actions button {
  border-color: var(--dark-border);
  background: rgba(31, 35, 29, 0.97);
  color: var(--ink);
}

html[data-mindfree-theme="dark"] body.mobile-page .mobile-lane-tab.is-active,
html[data-mindfree-theme="dark"] body.mobile-page .new-thought-lane-btn.is-active,
html[data-mindfree-theme="dark"] body.mobile-page .edit-thought-lane-btn.is-active {
  border-color: #3fa77f;
  background: #1d392d;
  color: #8ee0bd;
}

html[data-mindfree-theme="dark"] body.mobile-page .mobile-add-choice-intro h3,
html[data-mindfree-theme="dark"] body.mobile-page .mobile-bubble-move-card h3,
html[data-mindfree-theme="dark"] body.mobile-page .mobile-lane-picker-label {
  color: var(--ink);
}

html[data-mindfree-theme="dark"] body.mobile-page .mobile-add-choice-intro p,
html[data-mindfree-theme="dark"] body.mobile-page .mobile-add-choice button small,
html[data-mindfree-theme="dark"] body.mobile-page .mobile-more-menu-email {
  color: var(--muted);
}

html[data-mindfree-theme="dark"] body.mobile-page #mobile-more-capture {
  border-color: rgba(70, 196, 147, 0.38);
  background: #1e2e25;
  color: #8ee0bd;
}

html[data-mindfree-theme="dark"] .app-footer-sep {
  color: #656a61;
}

@media (max-width: 900px) {
  .settings-appearance {
    padding: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .settings-theme-switch,
  .settings-theme-switch-knob {
    transition: none;
  }
}
