@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700&display=swap");

:root {
  --bg: #f7f4ef;
  --surface: #ffffff;
  --ink: #1f1d1a;
  --muted: #6f6a62;
  --accent: #0f6b5f;
  --accent-2: #0b3b5a;
  --line: #e2ddd4;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(226, 221, 212, 0.9);
  --spinner-track: rgba(111, 106, 98, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(800px 400px at 20% -10%, rgba(15, 107, 95, 0.15), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(11, 59, 90, 0.12), transparent 60%),
    linear-gradient(180deg, #f7f4ef 0%, #f0ece6 100%);
  z-index: -1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px 8px;
}

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

.logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: white;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: var(--shadow);
}

.title h1 {
  margin: 0;
  font-size: 22px;
}

.title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.status {
  background: var(--surface);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8a949f;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  flex-shrink: 0;
}

.status[data-state="online"]::before {
  background: #24c26a;
  box-shadow: 0 0 8px rgba(36, 194, 106, 0.65);
}

.status[data-state="offline"]::before {
  background: #ff4d4f;
  box-shadow: 0 0 8px rgba(255, 77, 79, 0.65);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link {
  font-size: 13px;
  color: var(--accent-2);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}

.nav-link:hover {
  text-decoration: none;
  border-color: var(--accent-2);
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  padding: 16px 32px 48px;
}

.layout.layout-single {
  grid-template-columns: 1fr;
}

.content.content-wide {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.page-footer {
  display: flex;
  justify-content: center;
  padding: 22px 16px 34px;
  background: #f6eadb;
  border-top: 1px solid rgba(140, 110, 80, 0.22);
  color: #5a4630;
}

.footer-inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.footer-title {
  font-weight: 700;
  color: #4a3623;
}

.footer-sep {
  color: #a07c56;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}

.footer-link:hover {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

.terms-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  z-index: 999;
}

.terms-overlay.active {
  display: flex;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 20, 26, 0.45);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  z-index: 1000;
}

.confirm-overlay.active {
  display: flex;
}

.confirm-card {
  width: min(720px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  background:
    linear-gradient(140deg, rgba(15, 107, 95, 0.1), rgba(11, 59, 90, 0.06), transparent 62%),
    var(--surface);
  color: var(--ink);
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px 20px 20px;
  display: grid;
  gap: 14px;
  animation: fadeUp 0.25s ease both;
}

.confirm-head {
  display: grid;
  grid-template-columns: 1fr 44px;
  align-items: center;
}

.confirm-title {
  text-align: center;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.confirm-close {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}

.confirm-close:hover {
  background: rgba(15, 107, 95, 0.08);
  color: var(--ink);
}

.confirm-summary {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
}

.confirm-summary .accent {
  color: var(--accent);
}

.confirm-meta {
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.confirm-meta-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 10px;
}

.confirm-meta-label {
  color: var(--muted);
}

.confirm-check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(15, 107, 95, 0.22);
  background: rgba(15, 107, 95, 0.07);
  color: var(--ink);
  line-height: 1.45;
}

/* Inputs styled by shared .checkbox rules. */

.confirm-check a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}

.confirm-check a:hover {
  border-bottom-color: var(--accent);
}

.confirm-pay {
  border: none;
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  font-size: 16px;
}

.confirm-pay:disabled {
  background: rgba(120, 130, 140, 0.18);
  color: rgba(120, 130, 140, 0.95);
  cursor: not-allowed;
}

.theme-dark .confirm-overlay {
  background: rgba(0, 0, 0, 0.68);
}

.theme-dark .confirm-close:hover {
  background: rgba(45, 180, 159, 0.12);
}

.theme-dark .confirm-check {
  border-color: rgba(45, 180, 159, 0.25);
  background: rgba(45, 180, 159, 0.14);
}

.theme-dark .confirm-pay:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(232, 237, 242, 0.35);
}

@media (max-width: 520px) {
  .confirm-meta-row {
    grid-template-columns: 1fr;
  }

  .confirm-summary {
    font-size: 22px;
  }
}

.terms-card {
  width: min(520px, 100%);
  background: var(--surface);
  border-radius: 18px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.terms-card h2 {
  margin: 0;
  font-size: 20px;
}

.terms-card p {
  margin: 0;
  color: var(--muted);
}

.terms-card a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}

.terms-card a:hover {
  border-bottom-color: var(--accent);
}

.terms-accept {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--accent-2);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.notice-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(15, 107, 95, 0.12);
  border: 1px solid rgba(15, 107, 95, 0.35);
  color: var(--text-primary);
  margin: 8px auto 24px;
}

.notice-bar-text {
  font-weight: 600;
}

.notice-bar-action {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--accent-2);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

.notice-bar-action:hover {
  filter: brightness(1.05);
}

.auth-layout {
  display: grid;
  place-items: center;
  padding: 32px;
  min-height: calc(100vh - 120px);
}

.auth-card {
  width: min(440px, 100%);
  background: var(--surface);
  border-radius: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.auth-card h2 {
  margin: 0;
  font-size: 20px;
}

.auth-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.auth-link {
  font-size: 13px;
  color: var(--accent-2);
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.filters {
  background: var(--surface);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--line);
  height: fit-content;
}

.section-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tab {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 600;
  color: var(--muted);
}

.tab.active {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.filters h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

label {
  font-size: 13px;
  color: var(--muted);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.checkbox input {
  width: 16px;
  height: 16px;
}

select,
input[type="date"],
input[type="datetime-local"],
input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

select:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: rgba(15, 107, 95, 0.6);
  box-shadow: 0 0 0 3px rgba(15, 107, 95, 0.18);
}

textarea {
  min-height: 84px;
  resize: vertical;
}

.date-range {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.date-range input[type="date"] {
  flex: 1 1 140px;
  min-width: 0;
}

.date-range input[type="datetime-local"] {
  flex: 1 1 180px;
  min-width: 0;
}

.quick-range {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button {
  padding: 10px 14px;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  color: var(--accent-2);
  border: 1px dashed var(--line);
}

.danger {
  background: #d1464a;
  color: #fff;
  border: none;
}

.primary {
  background: var(--accent);
  color: #fff;
  border: none;
}

.legend {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 8px;
  line-height: 1.5;
}

.save-status {
  font-size: 12px;
  color: var(--muted);
  min-height: 18px;
}

.legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sources {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.source-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.source-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.source-header-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.source-header h3 {
  margin: 0;
  font-size: 18px;
}

.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.help-tip-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  background: #fff;
  cursor: help;
}

.help-tip-text {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  min-width: 260px;
  max-width: 360px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  z-index: 30;
}

.help-tip:hover .help-tip-text {
  opacity: 1;
  visibility: visible;
}

.onboarding-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: min(440px, calc(100vw - 24px));
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(15, 107, 95, 0.12), rgba(11, 59, 90, 0.08));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
  padding: 14px;
  z-index: 90;
  animation: fadeUp 0.25s ease both;
}

.onboarding-toast-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.onboarding-toast-text {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.45;
  margin-bottom: 10px;
}

.onboarding-toast-close {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.onboarding-toast.closing {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.feeds {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.profile-field {
  display: grid;
  gap: 6px;
}

.profile-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

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

.plan-card {
  position: relative;
  border-radius: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: linear-gradient(140deg, rgba(4, 64, 60, 0.08), transparent 60%);
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}

.plan-card h4 {
  margin: 0;
  font-size: 18px;
}

.plan-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.plan-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: -4px;
}

.profile-actions .danger {
  background: #d9463e;
  color: #fff;
  border: none;
}

.profile-actions .danger:hover {
  filter: brightness(1.05);
}

.plan-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.plan-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 107, 95, 0.12);
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.4px;
}

.plan-badge.pro {
  background: rgba(193, 141, 56, 0.16);
  color: #b86e00;
}

.plan-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 13px;
  display: grid;
  gap: 6px;
}

.plan-cta {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}

.plan-cta:disabled {
  background: rgba(0, 0, 0, 0.08);
  color: var(--muted);
  cursor: default;
}

.plan-card.active {
  border-color: rgba(15, 107, 95, 0.5);
  box-shadow: 0 18px 38px rgba(15, 107, 95, 0.16);
}

.sites-list {
  display: grid;
  gap: 12px;
}

.site-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.site-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.site-toggle {
  width: 52px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #e7e2db;
  position: relative;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.site-toggle .site-knob {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.25s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.site-toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: rgba(15, 107, 95, 0.6);
}

.site-toggle[aria-pressed="true"] .site-knob {
  transform: translateX(24px);
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

.feed-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.feed-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: center;
}

.feed-row label {
  font-size: 12px;
  color: var(--muted);
}

.feed-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.toolbar {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
  align-items: center;
}

.toolbar-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.id-search-input {
  width: min(360px, 100%);
  border-radius: 999px;
  padding: 10px 14px;
}

.search-progress {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.search-progress::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--spinner-track);
  border-top-color: var(--accent);
  animation: spin 0.85s linear infinite;
  flex-shrink: 0;
}

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

@media (prefers-reduced-motion: reduce) {
  .search-progress::before {
    animation: none;
  }
}

.counter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

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

.card {
  background: var(--surface);
  border-radius: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: fadeUp 0.35s ease both;
}

.card.responded {
  border-color: rgba(15, 107, 95, 0.5);
  background: rgba(15, 107, 95, 0.12);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.card.viewed {
  background: rgba(130, 140, 150, 0.12);
  border-color: rgba(130, 140, 150, 0.35);
}

.card.responded.viewed {
  background: rgba(15, 107, 95, 0.12);
  border-color: rgba(15, 107, 95, 0.5);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

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

.tag {
  background: rgba(15, 107, 95, 0.1);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.source-badge {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow);
}

.source-flru {
  background: linear-gradient(135deg, #0f6b5f 0%, #0b3b5a 100%);
}

.source-kwork {
  background: linear-gradient(135deg, #f29e0f 0%, #d46a00 100%);
}

.source-freelance {
  background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
}

.source-unknown {
  background: linear-gradient(135deg, #9ca3af 0%, #4b5563 100%);
}

.time {
  font-size: 12px;
  color: var(--muted);
}

.card h3 {
  margin: 10px 0 6px;
  font-size: 18px;
  word-break: break-word;
}

.card a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
  word-break: break-word;
}

.context {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.card a:hover {
  text-decoration: underline;
}

.meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

.badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge.new {
  background: rgba(15, 107, 95, 0.14);
  color: var(--accent);
  border: 1px solid rgba(15, 107, 95, 0.35);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .feed-row {
    grid-template-columns: 1fr;
  }
}

.theme-toggle {
  width: 76px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f4efe7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.theme-track {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
}

.theme-icon {
  width: 16px;
  height: 16px;
  opacity: 0.85;
  background-size: 16px 16px;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.08));
}

.theme-icon.sun {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f6a623' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'/><path d='M12 2v3M12 19v3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M2 12h3M19 12h3M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1'/></svg>");
}

.theme-icon.moon {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237f8b97' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M21 14.5A8.5 8.5 0 1 1 9.5 3a7 7 0 1 0 11.5 11.5Z'/></svg>");
}

.theme-knob {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: transparent;
  left: 4px;
  top: 4px;
  transition: transform 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: none;
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.theme-dark {
  --bg: #101418;
  --surface: #181d22;
  --ink: #e8edf2;
  --muted: #9aa5b1;
  --accent: #2db49f;
  --accent-2: #7cc4ff;
  --line: #2a3138;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  --glass-bg: rgba(18, 23, 28, 0.72);
  --glass-border: rgba(47, 57, 66, 0.9);
  --spinner-track: rgba(154, 165, 177, 0.28);
}

.theme-dark .bg {
  background:
    radial-gradient(800px 400px at 20% -10%, rgba(45, 180, 159, 0.2), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(124, 196, 255, 0.16), transparent 60%),
    linear-gradient(180deg, #0f1317 0%, #0c1014 100%);
}

.theme-dark .theme-toggle {
  background: #0f1317;
  border-color: #222a31;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.theme-dark .theme-track {
  color: #cfd6dd;
}

.theme-dark .theme-knob {
  transform: translateX(34px);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: none;
}

.theme-dark .source-card {
  background: rgba(21, 26, 31, 0.9);
  border-color: #2a3138;
}

.theme-dark .feed-card {
  background: rgba(17, 22, 27, 0.85);
  border-color: #2a3138;
}

.theme-dark .feed-row label {
  color: #97a3af;
}

.theme-dark input[type="text"],
.theme-dark textarea,
.theme-dark select,
.theme-dark input[type="date"],
.theme-dark input[type="datetime-local"],
.theme-dark input[type="password"] {
  background: #12171c;
  border-color: #2a3138;
  color: #e8edf2;
}

.theme-dark select:focus,
.theme-dark input[type="date"]:focus,
.theme-dark input[type="datetime-local"]:focus,
.theme-dark input[type="text"]:focus,
.theme-dark input[type="password"]:focus,
.theme-dark textarea:focus {
  border-color: rgba(45, 180, 159, 0.7);
  box-shadow: 0 0 0 3px rgba(45, 180, 159, 0.22);
}

.theme-dark input::placeholder,
.theme-dark textarea::placeholder {
  color: #6f7b87;
}

.theme-dark .chip {
  background: #12171c;
  border-color: #2a3138;
  color: #c4cdd6;
}

.theme-dark .chip.primary {
  background: var(--accent);
  color: #fff;
}

.theme-dark .site-row {
  background: rgba(17, 22, 27, 0.85);
  border-color: #2a3138;
}

.theme-dark .site-toggle {
  background: #12171c;
  border-color: #2a3138;
}

.theme-dark .site-toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: rgba(45, 180, 159, 0.6);
}

.theme-dark .site-toggle .site-knob {
  background: #f6f1ea;
}

.theme-dark .help-tip-icon {
  background: #151a1f;
  border-color: #3a444d;
  color: #9fd2ff;
}

.theme-dark .help-tip-text {
  background: #151a1f;
  border-color: #343d46;
  color: #dbe3eb;
}

.theme-dark .onboarding-toast {
  background: linear-gradient(135deg, rgba(45, 180, 159, 0.2), rgba(124, 196, 255, 0.14));
  border-color: #36404a;
}

.theme-dark .card.responded {
  border-color: rgba(15, 107, 95, 0.6);
  background: rgba(15, 107, 95, 0.2);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
}

.theme-dark .card.viewed {
  background: rgba(18, 23, 28, 0.9);
  border-color: rgba(120, 130, 140, 0.25);
  color: rgba(232, 237, 242, 0.75);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.theme-dark .card {
  background: linear-gradient(180deg, rgba(24, 30, 36, 0.98), rgba(18, 23, 28, 0.96));
  border-color: #2f3942;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

.theme-dark .card.viewed .tag {
  background: rgba(120, 130, 140, 0.18);
  color: #a8b2bc;
}

.theme-dark .card.viewed .meta,
.theme-dark .card.viewed .context,
.theme-dark .card.viewed .time {
  color: rgba(170, 180, 190, 0.78);
}

.theme-dark .card.new {
  border-color: rgba(45, 180, 159, 0.55);
  background: linear-gradient(180deg, rgba(26, 34, 40, 0.98), rgba(20, 26, 32, 0.96));
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.5);
}

.theme-dark .card.responded.viewed {
  border-color: rgba(15, 107, 95, 0.6);
  background: rgba(15, 107, 95, 0.2);
  color: rgba(232, 237, 242, 0.9);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
}

.theme-dark .badge.new {
  background: rgba(45, 180, 159, 0.2);
  color: #7ee7d3;
  border-color: rgba(45, 180, 159, 0.5);
}

.theme-dark .page-footer {
  background: #2a241d;
  border-top: 1px solid rgba(210, 170, 120, 0.18);
  color: #cdb79a;
}

.theme-dark .footer-title {
  color: #e2caa8;
}

.theme-dark .footer-sep {
  color: #9b8568;
}

.theme-dark .footer-link {
  color: #cdb79a;
}

.theme-dark .footer-link:hover {
  color: #f0d9b8;
  border-bottom-color: #f0d9b8;
}

.theme-dark .terms-card {
  background: #1c222a;
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(232, 237, 242, 0.9);
}

.theme-dark .terms-card p {
  color: rgba(232, 237, 242, 0.7);
}
