:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --cyan: #06b6d4;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: #ffffff;
  --canvas: #f8fafc;
  --danger: #dc2626;
  --success: #059669;
  --shadow: 0 20px 55px rgba(15, 23, 42, .08);
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
input, textarea, select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--ink);
  background: white;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .14);
}
textarea { min-height: 130px; resize: vertical; }
label { display: block; font-size: 13px; font-weight: 700; margin: 0 0 7px; }
.helptext, .hint { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
.errorlist { color: var(--danger); font-size: 13px; margin: 6px 0; padding-left: 18px; }
.shell { min-height: 100vh; }
.brand { display: inline-flex; align-items: center; border-radius: 50%; }
.brand:focus-visible { outline: 3px solid rgba(37, 99, 235, .24); outline-offset: 4px; }
.brand-icon {
  display: block; width: 38px; height: 38px; object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(37, 99, 235, .18));
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; border: 1px solid transparent; border-radius: 9px; padding: 9px 18px;
  font-weight: 750; cursor: pointer; transition: .16s ease; white-space: nowrap;
}
.btn-primary { background: var(--blue-600); color: white; }
.btn-primary:hover { background: var(--blue-700); transform: translateY(-1px); }
.btn-secondary { background: white; color: var(--ink); border-color: #cbd5e1; }
.btn-secondary:hover { border-color: var(--blue-400); background: var(--blue-50); }
.btn-danger { color: var(--danger); background: white; border-color: #fecaca; }
.btn-sm { min-height: 34px; padding: 6px 11px; font-size: 12px; }
.card { background: white; border: 1px solid var(--line); border-radius: 15px; }
.notice { padding: 13px 15px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.notice-success { color: #065f46; background: #ecfdf5; border: 1px solid #a7f3d0; }
.notice-error { color: #991b1b; background: #fef2f2; border: 1px solid #fecaca; }
.notice-info { color: #1e40af; background: var(--blue-50); border: 1px solid var(--blue-200); }
.field { margin-bottom: 20px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.page-title { margin: 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.045em; }
.page-subtitle { margin: 6px 0 0; color: var(--muted); }

/* Authentication and marketing */
.landing {
  min-height: 100vh; overflow: hidden; background:
    radial-gradient(circle at 80% 10%, rgba(6,182,212,.15), transparent 28%),
    radial-gradient(circle at 15% 80%, rgba(37,99,235,.16), transparent 35%), white;
}
.topbar { max-width: 1180px; margin: auto; padding: 24px; display:flex; align-items:center; justify-content:space-between; }
.hero { max-width: 1180px; margin: auto; padding: 90px 24px 120px; display:grid; grid-template-columns: 1.1fr .9fr; gap:70px; align-items:center; }
.hero h1 { font-size: clamp(44px, 6vw, 76px); letter-spacing: -.065em; line-height: .98; margin:0 0 25px; }
.hero h1 span { color: var(--blue-600); }
.hero p { color:#475569; font-size:20px; max-width:650px; }
.hero-visual { min-height: 420px; position:relative; display:grid; place-items:center; }
.visual-orbit { position:absolute; inset:0; border:1px dashed var(--blue-200); border-radius:50%; animation:spin 30s linear infinite; }
.visual-card { position:relative; width:85%; padding:28px; border-radius:24px; background:white; border:1px solid var(--blue-100); box-shadow:var(--shadow); transform:rotate(-2deg); }
.visual-line { height:10px; border-radius:99px; background:#e2e8f0; margin:13px 0; }
.visual-line.blue { width:65%; background:linear-gradient(90deg,var(--blue-500),var(--cyan)); }
@keyframes spin { to { transform:rotate(360deg); } }
.auth-layout {
  position:relative; isolation:isolate; min-height:100vh; display:grid; place-items:center; padding:24px;
  color:#f8fafc; background:#05070d; overflow:hidden;
}
.auth-layout::before {
  content:""; position:absolute; z-index:-2; inset:0;
  background-image:linear-gradient(rgba(59,130,246,.065) 1px,transparent 1px),linear-gradient(90deg,rgba(59,130,246,.065) 1px,transparent 1px);
  background-size:48px 48px; mask-image:radial-gradient(circle at center,#000,transparent 73%);
}
.auth-layout::after {
  content:""; position:absolute; z-index:-1; width:620px; height:620px; left:50%; top:50%;
  transform:translate(-50%,-50%); border-radius:50%; background:rgba(37,99,235,.15); filter:blur(110px);
}
.auth-card {
  width:min(450px,100%); padding:38px; border:1px solid rgba(148,163,184,.17); border-radius:20px;
  background:linear-gradient(145deg,rgba(14,21,36,.96),rgba(7,11,19,.98));
  box-shadow:0 35px 90px rgba(0,0,0,.5),0 0 55px rgba(37,99,235,.08);
}
.auth-card .brand-icon { width:36px; height:36px; }
.auth-eyebrow { display:block; margin-top:28px; color:#73a7ff; font-size:9px; font-weight:850; letter-spacing:.17em; }
.auth-card h1 { margin:11px 0 6px; color:#f8fafc; font-size:29px; letter-spacing:-.04em; }
.auth-card .page-subtitle { color:#8493a9; }
.auth-card form p { margin:16px 0; }
.auth-card label { color:#bac6d8; }
.auth-card input {
  color:#f1f5f9; border-color:rgba(148,163,184,.2); background:#080d16;
}
.auth-card input::placeholder { color:#546176; }
.auth-card input:focus { border-color:#3b82f6; box-shadow:0 0 0 3px rgba(37,99,235,.18); }
.auth-card .notice-error { color:#fecaca; border:1px solid rgba(248,113,113,.25); background:rgba(127,29,29,.22); }
.google-btn {
  width:100%; margin:24px 0 12px; color:#f8fafc; border-color:rgba(148,163,184,.22);
  background:rgba(255,255,255,.035);
}
.google-btn:hover { color:#fff; border-color:#3b82f6; background:rgba(37,99,235,.12); }
.auth-google-mark {
  display:grid; place-items:center; width:24px; height:24px; border-radius:50%;
  color:#0f172a; background:#fff; font-size:12px; font-weight:900;
}
.auth-setup-hint { color:#64748b!important; text-align:center; }
.divider { display:flex; align-items:center; gap:12px; color:#64748b; font-size:12px; margin:18px 0; }
.divider::before,.divider::after { content:""; height:1px; background:rgba(148,163,184,.14); flex:1; }

/* Onboarding — dark-first (matches dashboard theme-dark) */
.onboarding-shell {
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  display: flex;
  flex-direction: column;
}
.onboarding-header {
  padding: 22px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 18, 32, .92);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.steps { max-width: 800px; flex: 1; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.step-item {
  display: flex; align-items: center; color: #94a3b8; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.step-item:not(:last-child)::after {
  content: ""; width: 34px; height: 1px; background: #334155; margin: 0 12px;
}
.step-dot {
  width: 12px; height: 12px; border: 2px solid #475569; border-radius: 50%; margin-right: 6px;
}
.step-item.active, .step-item.done { color: #e2e8f0; }
.step-item.active .step-dot {
  border-color: var(--blue-600);
  box-shadow: inset 0 0 0 2px var(--canvas);
  background: var(--blue-600);
}
.step-item.done .step-dot {
  border-color: var(--blue-600);
  background: var(--blue-600);
}
.onboarding-main {
  width: min(900px, calc(100% - 36px));
  margin: 0 auto;
  padding: 54px 0 110px;
  flex: 1;
}
.onboarding-heading { text-align: center; margin-bottom: 32px; }
.onboarding-heading h1 {
  font-size: 24px; letter-spacing: -.035em; margin: 0 0 8px; color: var(--ink);
}
.onboarding-heading p { color: var(--muted); margin: 0; }
.form-card { padding: 28px; }
.onboarding-footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 14px max(24px, calc((100vw - 900px) / 2));
  border-top: 1px solid var(--line);
  background: rgba(11, 18, 32, .94);
  backdrop-filter: blur(10px);
  display: flex; justify-content: space-between; z-index: 10;
}
.url-stage {
  margin-top: 45px;
  padding: 40px 36px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.url-stage::before,
.url-stage::after { display: none; }
.url-panel {
  position: relative;
  z-index: 1;
  background: transparent;
  padding: 8px 4px;
  border-radius: 0;
  box-shadow: none;
  color: var(--ink);
}
.url-panel h1 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 28px;
  letter-spacing: -.03em;
}
.url-panel h1 .accent { color: var(--blue-400, #60a5fa); }
.url-panel .page-subtitle { color: var(--muted); margin: 0; }
.url-row { display: flex; gap: 12px; }
.url-row input {
  flex: 1;
  background: #0f172a;
  border-color: #334155;
  color: var(--ink);
}
.loading-stage { text-align: center; padding: 75px 25px; color: var(--ink); }
.loader {
  width: 72px; height: 72px; border-radius: 50%;
  border: 7px solid var(--blue-100);
  border-top-color: var(--blue-600);
  margin: 0 auto 28px;
  animation: spin 1s linear infinite;
}
.loading-stage h1 { font-size: 29px; margin: 0 0 10px; color: var(--ink); }
.loading-list { margin: 35px auto 0; max-width: 460px; text-align: left; }
.loading-item { display: flex; gap: 12px; padding: 12px 0; color: var(--muted); }
.loading-item.active { color: var(--blue-700); font-weight: 700; }
.tag-section { padding: 22px; margin-bottom: 18px; }
.tag-section h2 { font-size: 17px; margin: 0 0 5px; color: var(--ink); }
.tag-editor { display: grid; grid-template-columns: 1fr; gap: 10px; }
.competitors-panel { padding: 24px; }
.competitors-header {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 8px;
}
.competitors-title-row { display: flex; align-items: center; gap: 10px; }
.competitors-title-row h2 { margin: 0; color: var(--ink); }
.competitors-count {
  display: inline-flex; align-items: center; min-height: 22px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid rgba(45, 212, 191, .35); background: rgba(15, 118, 110, .22);
  color: #5eead4; font-size: 12px; font-weight: 800;
}
.competitors-ai-btn { white-space: nowrap; }
.competitors-add-row { display: flex; gap: 10px; margin: 14px 0 10px; }
.competitors-add-row input { flex: 1; margin: 0; }
.competitors-add-btn { min-width: 78px; }
.competitors-error { color: var(--danger) !important; margin: 0 0 10px; }
.competitors-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 6px;
}
.competitor-chip {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px 8px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: #152033; color: #cbd5e1;
}
.competitor-favicon {
  width: 18px; height: 18px; border-radius: 4px; object-fit: contain; flex-shrink: 0; background: #0f172a;
}
.competitor-label {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 650; color: #e2e8f0;
}
.competitor-remove {
  width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: #94a3b8;
  font-size: 18px; line-height: 1; cursor: pointer; flex-shrink: 0;
}
.competitor-remove:hover { color: #f1f5f9; background: rgba(148, 163, 184, .14); }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.choice-card {
  border: 1px solid var(--blue-100); background: var(--blue-50); border-radius: 12px;
  padding: 22px; text-align: center; min-height: 120px; display: grid; place-items: center; font-weight: 750;
  color: var(--ink);
}
.choice-card.primary { border-color: var(--blue-500); box-shadow: 0 0 0 2px rgba(59, 130, 246, .12); }
.choice-card.disabled { color: #94a3b8; filter: grayscale(.5); position: relative; }
.choice-card.disabled::after {
  content: "Coming soon"; display: block; font-size: 10px; color: var(--blue-700);
  background: #152033; padding: 3px 6px; border-radius: 99px;
}
.toggle-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 22px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.toggle-row:last-child { border-bottom: 0; }
.toggle-row input { width: 20px; height: 20px; accent-color: var(--blue-600); }
.style-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.style-chip input { width: auto; margin-right: 4px; }
.style-chip { padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.image-preferences { margin-top: 24px; padding-top: 8px; border-top: 1px solid var(--line); }
.image-preferences-block + .image-preferences-block {
  margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line);
}
.image-preferences-title { font-size: 16px; margin: 0 0 6px; font-weight: 800; color: var(--ink); }
.image-preferences-lead { margin: 0 0 14px; max-width: 640px; color: var(--muted); }
.image-style-grid { display: grid; gap: 10px; }
.image-style-grid--article { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.image-style-grid--featured { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
.image-style-grid.is-disabled { opacity: .55; pointer-events: none; }
.image-style-card {
  display: flex; flex-direction: column; gap: 8px; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  background: #152033; transition: border-color .15s, background .15s, box-shadow .15s;
}
.image-style-card.is-selected {
  border-color: #7c3aed; background: rgba(124, 58, 237, .18);
  box-shadow: 0 0 0 1px rgba(124, 58, 237, .35);
}
.image-style-card--featured { padding: 8px; }
.image-style-preview {
  display: block; width: 100%; aspect-ratio: 1; border-radius: 8px;
  border: 1px solid #334155; background: #0f172a; position: relative; overflow: hidden;
}
.image-style-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.image-style-preview--featured { aspect-ratio: 16 / 10; }
.featured-preview-title {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 14px 16px;
  text-align: center; font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(13px, 1.6vw, 18px); font-weight: 700; line-height: 1.25;
  letter-spacing: -.02em; color: #5eead4; pointer-events: none;
}
.image-style-label {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 12px; font-weight: 750; color: #e2e8f0;
}
.image-style-help {
  display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 99px;
  background: #334155; color: #94a3b8; font-size: 9px; font-weight: 800; cursor: help;
}
.title-featured-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.title-featured-header input[type="checkbox"] {
  width: 20px; height: 20px; accent-color: var(--blue-600); flex-shrink: 0; margin-top: 4px;
}
.title-featured-sub { margin: 10px 0 0; max-width: 640px; color: var(--muted); }
.badge-new {
  display: inline-flex; align-items: center; padding: 2px 7px; margin-left: 6px; border-radius: 99px;
  font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: #6ee7b7; background: rgba(6, 95, 70, .35); vertical-align: middle;
}
.settings-section-title { font-size: 15px; margin: 26px 0 12px; font-weight: 800; color: var(--ink); }
.settings-section-title:first-of-type { margin-top: 0; }
.settings-wrap .field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.referral-grid {
  max-width: 650px; margin: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.referral-option input { width: auto; margin-right: 8px; }
.referral-option {
  border: 1px solid var(--line); border-radius: 10px; padding: 15px; cursor: pointer; color: var(--ink);
}
.referral-option:hover { border-color: var(--blue-500); background: var(--blue-50); }
.strategy-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 600px; margin: 32px auto;
}
.strategy-card {
  padding: 18px; background: var(--blue-50); border: 1px solid var(--line);
  border-radius: 12px; text-align: left; color: var(--ink);
}

/* Dashboard */
.dashboard { min-height:100vh; display:grid; grid-template-columns:260px minmax(0,1fr); background:white; }
.sidebar { position:sticky; top:0; height:100vh; border-right:1px solid var(--line); padding:22px 14px; display:flex; flex-direction:column; background:white; }
.site-switcher { margin:22px 0 15px; }
.site-switcher select { font-size:13px; }
.nav { display:flex; flex-direction:column; gap:4px; }
.nav-label { font-size:10px; color:#94a3b8; text-transform:uppercase; letter-spacing:.12em; padding:18px 12px 7px; font-weight:800; }
.nav a { padding:10px 12px; border-radius:8px; font-size:14px; color:#334155; font-weight:600; display:flex; align-items:center; gap:6px; }
.nav a:hover,.nav a.active { color:var(--blue-700); background:var(--blue-50); }
.sidebar-user { margin-top:auto; border-top:1px solid var(--line); padding:15px 10px 0; font-size:12px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; }
.sidebar-user-menu {
  position:relative; margin-top:auto; border-top:1px solid var(--line); padding:12px 4px 0;
}
.account-menu-trigger {
  width:100%; display:flex; align-items:center; gap:10px; padding:8px; border:0; border-radius:12px;
  background:transparent; color:inherit; cursor:pointer; text-align:left;
}
.account-menu-trigger:hover { background:rgba(148,163,184,.12); }
.account-avatar {
  width:34px; height:34px; border-radius:999px; display:grid; place-items:center; flex:0 0 auto;
  background:#0f766e; color:#fff; font-weight:800; font-size:14px; text-transform:lowercase;
}
.account-avatar-img {
  display:block; object-fit:cover; background:#0f172a; text-transform:none;
}
.account-meta { min-width:0; flex:1; display:flex; flex-direction:column; gap:1px; }
.account-email {
  font-size:12px; font-weight:700; color:#e2e8f0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.account-plan { font-size:11px; color:#94a3b8; }
.account-chevron { color:#94a3b8; font-size:12px; line-height:1; transform:rotate(180deg); transition:transform .15s ease; }
.sidebar-user-menu.is-open .account-chevron { transform:rotate(0deg); }
.account-menu-panel {
  display:none; position:absolute; left:4px; right:4px; bottom:calc(100% + 8px); z-index:40;
  background:#fff; color:#0f172a; border-radius:14px; box-shadow:0 18px 40px rgba(2,6,23,.28);
  border:1px solid #e2e8f0; padding:8px; flex-direction:column; gap:2px;
}
.sidebar-user-menu.is-open .account-menu-panel { display:flex; }
.account-menu-panel[hidden] { display:none !important; }
.account-menu-item {
  display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px;
  color:#0f172a; font-size:14px; font-weight:600; text-decoration:none;
}
.account-menu-item:hover { background:#f1f5f9; color:#0f172a; }
.account-menu-icon { display:inline-flex; color:#475569; }
.account-menu-divider { height:1px; background:#e2e8f0; margin:6px 4px; }
.invite-form { display:flex; gap:10px; flex-wrap:wrap; }
.invite-form input[type="email"] { flex:1; min-width:220px; margin:0; }
.main { min-width:0; min-height:0; padding:28px 34px 70px; background:#fff; overflow:visible; }
.main-header { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:22px; }
.plan-pill { padding:9px 13px; border:1px solid var(--blue-200); background:var(--blue-50); border-radius:99px; color:var(--blue-700); font-size:12px; font-weight:800; }
.quota-bar { background:#e2e8f0; height:7px; border-radius:99px; overflow:hidden; margin-top:7px; }
.quota-fill { background:linear-gradient(90deg,var(--blue-600),var(--cyan)); height:100%; }
.planner-banner { padding:14px 16px; background:var(--blue-50); border:1px solid var(--blue-200); border-radius:10px; margin-bottom:22px; display:flex; align-items:center; justify-content:space-between; gap:14px; }
.planner-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:16px; align-items:stretch; }
.planner-day { min-height:0; display:block; }
.idea-card { height:100%; padding:16px; border:1px solid var(--blue-200); background:linear-gradient(145deg,#fff,var(--blue-50)); border-radius:11px; display:flex; flex-direction:column; }
.idea-card-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px; flex-wrap:wrap; }
.day-label { font-size:12px; font-weight:800; color:#475569; white-space:nowrap; }
.idea-tag { display:inline-flex; font-size:10px; color:var(--blue-700); background:var(--blue-100); padding:2px 6px; border-radius:99px; font-weight:800; }
.idea-card h3 { font-size:14px; margin:0 0 12px; flex:1; }
.idea-meta { display:flex; justify-content:space-between; gap:8px; color:var(--muted); font-size:11px; margin-bottom:12px; }
.idea-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:auto; }
.idea-card .btn { width:100%; }
.idea-actions .btn { width:auto; }
.status { display:inline-flex; border-radius:99px; padding:4px 8px; font-size:11px; font-weight:750; text-transform:capitalize; }
.status-published,.status-complete { color:#047857; background:#d1fae5; }
.status-failed { color:#b91c1c; background:#fee2e2; }
.status-queued,.status-generating,.status-researching,.status-writing,.status-imaging,.status-publishing { color:#1d4ed8; background:#dbeafe; }
.status-planned,.status-ready { color:#475569; background:#f1f5f9; }
.table-card { overflow:auto; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th,td { text-align:left; padding:14px; border-bottom:1px solid var(--line); vertical-align:top; }
th { color:#64748b; background:#f8fafc; font-size:11px; text-transform:uppercase; letter-spacing:.06em; }
.settings-wrap { max-width:820px; }
.settings-wrap .card { padding:25px; margin-top:20px; }
.article-review-header { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:22px; flex-wrap:wrap; }
.article-review-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.article-review-layout { max-width:920px; display:grid; gap:16px; }
.article-cost-card { padding:18px 20px; }
.article-cost-header { display:flex; justify-content:space-between; gap:16px; align-items:flex-end; margin-bottom:14px; flex-wrap:wrap; }
.article-cost-header label { display:block; font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); margin-bottom:4px; }
.article-cost-total { font-size:28px; letter-spacing:-.03em; }
.article-cost-table { width:100%; border-collapse:collapse; font-size:13px; }
.article-cost-table th,.article-cost-table td { text-align:left; padding:10px 8px; border-bottom:1px solid var(--line); vertical-align:top; }
.article-cost-table th { color:#64748b; font-size:11px; text-transform:uppercase; letter-spacing:.06em; }
.article-review-body { padding:28px 32px; }
.article-review-body h2 { font-size:22px; margin:28px 0 12px; }
.article-review-body h3 { font-size:18px; margin:24px 0 10px; }
.article-feature-image { width:100%; max-height:360px; object-fit:cover; border-radius:12px; margin-bottom:20px; border:1px solid var(--line); }
.article-meta-box { padding:14px 16px; border:1px solid var(--line); border-radius:10px; background:#f8fafc; margin-bottom:22px; }
.article-meta-box label { font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); margin-bottom:6px; }
.article-meta-box p { margin:0 0 6px; font-size:14px; line-height:1.55; }
.article-section { font-size:15px; line-height:1.65; color:#334155; margin-bottom:16px; }
.article-section a { color:var(--blue-700); text-decoration:underline; }
.history-search { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:18px; max-width:560px; }
.history-search input[type="search"] { flex:1; min-width:200px; margin:0; }
.history-table-wrap { padding:0; }
.history-table { font-size:13px; }
.history-table th { white-space:nowrap; }
.history-sort { color:inherit; font-weight:inherit; text-decoration:none; }
.history-sort:hover { color:var(--blue-700); text-decoration:underline; }
.history-thumb-cell { width:112px; }
.history-thumb-link { display:block; }
.history-thumb { width:96px; height:64px; object-fit:cover; border-radius:8px; border:1px solid var(--line); display:block; }
.history-thumb-placeholder { display:grid; place-items:center; padding:6px; font-size:9px; font-weight:700; line-height:1.25; text-align:center; color:#475569; background:linear-gradient(145deg,#fff,var(--blue-50)); overflow:hidden; }
.history-title-cell { min-width:220px; max-width:360px; }
.history-title-cell a { color:inherit; }
.history-title-cell a:hover strong { color:var(--blue-700); }
.history-actions { white-space:nowrap; }
.history-actions form { display:inline; }
.history-empty { text-align:center; padding:48px 16px !important; color:var(--muted); }
.metric-pill { display:inline-flex; min-width:28px; justify-content:center; padding:3px 8px; border-radius:99px; font-size:12px; font-weight:800; }
.metric-pill-easy { color:#047857; background:#d1fae5; }
.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; }
.integration-summary-card { padding:20px 22px; margin-top:20px; }
.gsc-wrap { max-width:820px; }
.gsc-card { padding:24px; margin-top:22px; }
.gsc-card-title { display:flex; align-items:center; gap:8px; font-size:15px; margin:0 0 16px; font-weight:800; }
.gsc-info {
  display:inline-grid; place-items:center; width:16px; height:16px; border-radius:99px;
  background:#e2e8f0; color:#64748b; font-size:10px; font-weight:800; cursor:help;
}
.gsc-connect-row {
  display:flex; align-items:center; justify-content:space-between; gap:18px;
  padding:16px 18px; border:1px solid var(--line); border-radius:12px; background:#f8fafc;
}
.gsc-connect-row strong { display:block; margin-bottom:4px; }
.gsc-actions { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
.gsc-property-form { margin-top:18px; }
.gsc-property-row { display:flex; gap:10px; align-items:center; }
.gsc-property-row select { margin:0; }
body.theme-dark .gsc-connect-row { background:#0f172a; border-color:var(--line); }
body.theme-dark .gsc-info { background:#334155; color:#cbd5e1; }
.gsc-insights-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:16px; flex-wrap:wrap; }
.gsc-summary-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-bottom:18px; }
.gsc-summary-pill {
  padding:12px 14px; border:1px solid var(--line); border-radius:12px; background:#f8fafc;
  display:flex; flex-direction:column; gap:2px;
}
.gsc-summary-pill strong { font-size:22px; letter-spacing:-.03em; }
.gsc-summary-pill span { color:var(--muted); font-size:12px; font-weight:650; }
.gsc-insights-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.gsc-insights-grid > * { min-width:0; }
.gsc-subtitle { margin:0 0 4px; font-size:14px; }
.gsc-list { list-style:none; margin:10px 0 0; padding:0; display:grid; gap:8px; min-width:0; }
.gsc-list li {
  display:flex; flex-direction:column; gap:2px; padding:10px 12px; border:1px solid var(--line);
  border-radius:10px; background:#fff; font-size:13px; min-width:0; overflow:hidden;
}
.gsc-list em { color:var(--muted); font-style:normal; font-size:11px; }
.gsc-page-link {
  display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  max-width:100%; min-width:0; color:inherit; text-decoration:none;
}
.gsc-page-link:hover { color:var(--blue-600); text-decoration:underline; }
.gsc-planner-insights { padding:18px 20px; margin-bottom:18px; }

/* Domain Rating gauge card */
.dr-card {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  max-width: 100%;
}
.dr-gauge {
  --dr-value: 0;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(closest-side, var(--surface) 70%, transparent 71% 100%),
    conic-gradient(var(--ink) calc(var(--dr-value) * 1%), var(--line) 0);
}
.dr-gauge-empty {
  background:
    radial-gradient(closest-side, var(--surface) 70%, transparent 71% 100%),
    conic-gradient(var(--line) 0 100%);
}
.dr-gauge-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1;
}
.dr-card-copy { min-width: 0; }
.dr-card-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 2px;
}
.dr-card-meta {
  font-size: 12px;
  color: var(--muted);
  font-weight: 550;
  line-height: 1.35;
}
.dr-card-meta a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.dr-card-meta a:hover { color: var(--ink); }
.dr-card-wrap { margin-bottom: 18px; }
body.theme-dark .dr-card { background: var(--surface); border-color: var(--line); }
body.theme-dark .dr-gauge {
  background:
    radial-gradient(closest-side, var(--surface) 70%, transparent 71% 100%),
    conic-gradient(#e2e8f0 calc(var(--dr-value) * 1%), #334155 0);
}
body.theme-dark .dr-gauge-empty {
  background:
    radial-gradient(closest-side, var(--surface) 70%, transparent 71% 100%),
    conic-gradient(#334155 0 100%);
}

/* Home dashboard */
.home-wrap { max-width: 1100px; }
.home-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.home-header-copy { min-width: 0; flex: 1; }
.home-header-slash { color: #94a3b8; font-weight: 500; margin: 0 6px; }
.home-header-host { color: var(--muted); font-weight: 650; font-size: 0.72em; }
.home-top-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}
.home-stat-card { padding: 20px 22px; }
.home-stat-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.home-stat-card-head h2 { margin: 0; font-size: 16px; }
.home-stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 15px;
}
.home-article-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.home-article-stats strong {
  display: block;
  font-size: 28px;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.home-article-stats span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}
.home-article-stats em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  margin-top: 2px;
}
.home-usage-line { margin: 0 0 12px; font-size: 14px; }
.home-quota { margin-bottom: 4px; height: 8px; }
.home-section { margin-bottom: 34px; }
.home-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.home-section-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.03em; }
.home-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}
.home-section-sub {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}
.home-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.home-action-card {
  padding: 18px 18px 16px;
  background: linear-gradient(160deg, #fff, var(--blue-50));
  border-color: var(--blue-100);
}
.home-action-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--blue-100);
  color: var(--blue-700);
  margin-bottom: 12px;
}
.home-action-card h3 { margin: 0 0 6px; font-size: 15px; }
.home-action-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.home-action-cta {
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 800;
}
.home-action-cta:hover { text-decoration: underline; }
.home-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.home-metric {
  padding: 16px 16px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
}
.home-metric span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}
.home-metric strong {
  font-size: 30px;
  letter-spacing: -0.04em;
  line-height: 1;
}
.home-metric-blue { background: var(--blue-50); border-color: var(--blue-100); }
.home-metric-cyan { background: #ecfeff; border-color: #a5f3fc; }
.home-metric-mint { background: #ecfdf5; border-color: #a7f3d0; }
.home-metric-slate { background: #f8fafc; }
.home-sources-card { padding: 18px 20px; margin-bottom: 14px; }
.home-sources-card h3 { margin: 0 0 12px; font-size: 15px; }
.home-source-bar {
  display: flex;
  height: 14px;
  border-radius: 99px;
  overflow: hidden;
  background: #e2e8f0;
  gap: 2px;
}
.home-source-seg { display: block; min-width: 4px; }
.home-source-seg.tone-blue { background: var(--blue-600); }
.home-source-seg.tone-cyan { background: var(--cyan); }
.home-source-seg.tone-ink { background: #334155; }
.home-source-legend {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  font-size: 13px;
  color: var(--muted);
}
.home-source-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  margin-right: 6px;
  vertical-align: middle;
}
.home-source-legend i.tone-blue { background: var(--blue-600); }
.home-source-legend i.tone-cyan { background: var(--cyan); }
.home-source-legend i.tone-ink { background: #334155; }
.home-source-legend strong { color: var(--ink); font-weight: 800; }
.home-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.home-list-card { padding: 18px 20px; }
.home-list-card h3 { margin: 0 0 14px; font-size: 15px; }
.home-eff-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.home-eff-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.home-eff-name {
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-eff-signal { font-size: 10px; color: var(--success); }
.home-eff-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.home-eff-bar {
  height: 7px;
  border-radius: 99px;
  background: #e2e8f0;
  overflow: hidden;
}
.home-eff-bar span {
  display: block;
  height: 100%;
  background: var(--blue-600);
  border-radius: 99px;
}
.home-eff-bar.tone-cyan span { background: var(--cyan); }
.home-eff-empty { color: var(--muted); font-size: 13px; }
body.theme-dark .home-action-card {
  background: linear-gradient(160deg, var(--surface), rgba(37, 99, 235, 0.12));
  border-color: var(--line);
}
body.theme-dark .home-metric-blue { background: rgba(37, 99, 235, 0.14); }
body.theme-dark .home-metric-cyan { background: rgba(6, 182, 212, 0.12); }
body.theme-dark .home-metric-mint { background: rgba(5, 150, 105, 0.12); }
body.theme-dark .home-metric-slate { background: #152033; }
body.theme-dark .home-badge { background: #152033; color: #cbd5e1; }
body.theme-dark .home-action-icon { background: #152033; border-color: var(--line); }

.insights-wrap { max-width:1100px; }
.insights-status-card { padding:20px 22px; margin-bottom:18px; }
.insights-status-grid {
  display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px;
}
.insights-status-grid label {
  display:block; font-size:11px; text-transform:uppercase; letter-spacing:.08em;
  color:var(--muted); margin-bottom:4px;
}
.insights-status-ok { color:#34d399; }
.insights-summary { margin-bottom:18px; grid-template-columns:repeat(4,minmax(0,1fr)); }
.insights-panels { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-bottom:16px; }
.insights-panel { padding:18px 20px; }
.insights-panel h2 { margin:0 0 4px; font-size:16px; }
.insights-table-wrap { margin-top:12px; border:1px solid var(--line); border-radius:12px; overflow:auto; }
.insights-table { width:100%; border-collapse:collapse; font-size:13px; }
.insights-table th, .insights-table td { padding:10px 12px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
.insights-table th { color:#94a3b8; background:#0f172a; font-size:11px; text-transform:uppercase; letter-spacing:.06em; }
.insights-table td a { color:var(--blue-700); word-break:break-all; }
.ai-spark {
  display:flex; align-items:flex-end; gap:2px; height:28px; min-width:72px;
}
.ai-spark span {
  flex:1; min-width:3px; max-width:8px; height:var(--h, 0%);
  border-radius:2px 2px 0 0; background:rgba(56,189,248,.75);
}
.portal-wrap { max-width:1180px; }
.portal-tabs {
  display:flex; flex-wrap:wrap; gap:8px; margin:0 0 20px; padding:6px;
  border:1px solid var(--line); border-radius:12px; background:rgba(15,23,42,.35);
}
.portal-tab {
  padding:8px 12px; border-radius:8px; font-size:13px; font-weight:700; color:#cbd5e1;
}
.portal-tab:hover { background:rgba(59,130,246,.12); color:#fff; }
.portal-tab.is-active { background:rgba(59,130,246,.22); color:#fff; }
.portal-card { padding:20px 22px; }
.portal-card-head {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin-bottom:14px; flex-wrap:wrap;
}
.portal-card-head h2 { margin:0; font-size:17px; }
.portal-table-wrap { border:1px solid var(--line); border-radius:12px; overflow:auto; }
.portal-table { width:100%; border-collapse:collapse; font-size:13px; }
.portal-table th, .portal-table td {
  padding:11px 12px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top;
}
.portal-table th {
  color:#94a3b8; background:#0f172a; font-size:11px; text-transform:uppercase; letter-spacing:.06em;
}
.portal-table td a { color:var(--blue-700); }
.portal-admin-form { max-width:560px; }
.portal-admin-row { display:flex; gap:10px; align-items:center; }
.portal-admin-row input { margin:0; }
@media (max-width: 700px) {
  .portal-admin-row { flex-direction:column; align-items:stretch; }
}
@media (max-width: 900px) {
  .insights-status-grid, .insights-panels, .insights-summary { grid-template-columns:1fr; }
}
.idea-source {
  display:inline-flex; margin:0 0 8px; padding:2px 8px; border-radius:99px; font-size:10px;
  font-weight:800; letter-spacing:.04em; text-transform:uppercase;
}
.idea-source-refresh { color:#9a3412; background:#ffedd5; }
.idea-source-opportunity { color:#1d4ed8; background:#dbeafe; }
.idea-source-measured { color:#0f766e; background:#ccfbf1; }
.idea-related { margin:0 0 10px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body.theme-dark .gsc-summary-pill, body.theme-dark .gsc-list li { background:#0f172a; }
body.theme-dark .idea-source-refresh { color:#fdba74; background:rgba(154,52,18,.28); }
body.theme-dark .idea-source-opportunity { color:#bfdbfe; background:rgba(37,99,235,.28); }
body.theme-dark .idea-source-measured { color:#99f6e4; background:rgba(15,118,110,.28); }
@media (max-width: 900px) {
  .gsc-insights-grid, .gsc-summary-grid { grid-template-columns:1fr; }
}

/* Dashboard dark theme */
body.theme-dark {
  color-scheme: dark;
  --blue-50: #13233f;
  --blue-100: #1a2f52;
  --blue-200: #243b63;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #3b82f6;
  --blue-700: #93c5fd;
  --cyan: #22d3ee;
  --ink: #e8eef8;
  --muted: #94a3b8;
  --line: #243247;
  --surface: #111827;
  --canvas: #0b1220;
  --danger: #f87171;
  --success: #34d399;
  --shadow: 0 24px 60px rgba(0, 0, 0, .45);
  background: var(--canvas);
  color: var(--ink);
}
body.theme-dark input,
body.theme-dark textarea,
body.theme-dark select {
  color: var(--ink);
  border-color: #334155;
  background: #0f172a;
}
body.theme-dark input:focus,
body.theme-dark textarea:focus,
body.theme-dark select:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .22);
}
body.theme-dark .btn-secondary {
  color: var(--ink);
  border-color: #334155;
  background: #152033;
}
body.theme-dark .btn-secondary:hover {
  border-color: var(--blue-500);
  background: var(--blue-50);
}
body.theme-dark .btn-danger {
  color: #fecaca;
  border-color: rgba(248, 113, 113, .35);
  background: rgba(127, 29, 29, .25);
}
body.theme-dark .card {
  background: var(--surface);
  border-color: var(--line);
}
body.theme-dark .notice-success {
  color: #a7f3d0;
  background: rgba(6, 95, 70, .28);
  border-color: rgba(52, 211, 153, .28);
}
body.theme-dark .notice-error {
  color: #fecaca;
  background: rgba(127, 29, 29, .28);
  border-color: rgba(248, 113, 113, .28);
}
body.theme-dark .notice-info {
  color: #bfdbfe;
  background: rgba(37, 99, 235, .18);
  border-color: rgba(59, 130, 246, .28);
}
body.theme-dark .dashboard {
  background:
    radial-gradient(circle at 88% 0%, rgba(37, 99, 235, .16), transparent 32%),
    radial-gradient(circle at 8% 100%, rgba(6, 182, 212, .08), transparent 28%),
    var(--canvas);
}
body.theme-dark .sidebar {
  background: rgba(11, 18, 32, .92);
  border-right-color: var(--line);
  backdrop-filter: blur(12px);
}
body.theme-dark .nav a { color: #cbd5e1; }
body.theme-dark .nav a:hover,
body.theme-dark .nav a.active {
  color: #dbeafe;
  background: rgba(59, 130, 246, .16);
}
body.theme-dark .sidebar-user a { color: #93c5fd; }
body.theme-dark .account-email { color:#e2e8f0; }
body.theme-dark .account-plan { color:#94a3b8; }
body.theme-dark .account-menu-trigger:hover { background:rgba(148,163,184,.12); }
body.theme-dark .main { background: transparent; }
body.theme-dark .plan-pill {
  color: #bfdbfe;
  border-color: rgba(59, 130, 246, .35);
  background: rgba(37, 99, 235, .16);
}
body.theme-dark .quota-bar { background: #1e293b; }
body.theme-dark .planner-banner {
  color: #dbeafe;
  border-color: rgba(59, 130, 246, .28);
  background: rgba(37, 99, 235, .14);
}
body.theme-dark .idea-card {
  border-color: rgba(59, 130, 246, .28);
  background: linear-gradient(145deg, #121a2b, #15233a);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
}
body.theme-dark .day-label { color: #94a3b8; }
body.theme-dark .idea-tag {
  color: #bfdbfe;
  background: rgba(59, 130, 246, .22);
}
body.theme-dark .status-published,
body.theme-dark .status-complete {
  color: #6ee7b7;
  background: rgba(6, 95, 70, .35);
}
body.theme-dark .status-failed {
  color: #fecaca;
  background: rgba(127, 29, 29, .35);
}
body.theme-dark .status-queued,
body.theme-dark .status-generating,
body.theme-dark .status-researching,
body.theme-dark .status-writing,
body.theme-dark .status-imaging,
body.theme-dark .status-publishing {
  color: #bfdbfe;
  background: rgba(37, 99, 235, .28);
}
body.theme-dark .status-planned,
body.theme-dark .status-ready {
  color: #cbd5e1;
  background: #1e293b;
}
body.theme-dark th {
  color: #94a3b8;
  background: #0f172a;
}
body.theme-dark .article-meta-box {
  background: #0f172a;
  border-color: var(--line);
}
body.theme-dark .article-section { color: #cbd5e1; }
body.theme-dark .article-section a { color: #93c5fd; }
body.theme-dark .history-thumb-placeholder {
  color: #94a3b8;
  background: linear-gradient(145deg, #121a2b, #15233a);
}
body.theme-dark .history-title-cell a:hover strong,
body.theme-dark .history-sort:hover { color: #93c5fd; }
body.theme-dark .metric-pill-easy {
  color: #6ee7b7;
  background: rgba(6, 95, 70, .35);
}
body.theme-dark .toggle-row,
body.theme-dark .image-preferences,
body.theme-dark .image-preferences-block + .image-preferences-block {
  border-color: #1e293b;
}
body.theme-dark .image-preferences-title,
body.theme-dark .settings-section-title { color: #f1f5f9; }
body.theme-dark .image-style-card {
  background: #0f172a;
  border-color: #334155;
}
body.theme-dark .image-style-card.is-selected {
  border-color: #a78bfa;
  background: rgba(139, 92, 246, .18);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, .35);
}
body.theme-dark .image-style-preview { border-color: #334155; }
body.theme-dark .image-style-label { color: #e2e8f0; }
body.theme-dark .featured-preview-title { color: #115e59; text-shadow: 0 1px 0 rgba(255,255,255,.65); }
body.theme-dark .image-style-help {
  color: #cbd5e1;
  background: #334155;
}
body.theme-dark .badge-new {
  color: #6ee7b7;
  background: rgba(6, 95, 70, .35);
}
body.theme-dark .site-switcher .hint { color: #93c5fd !important; }

@media (max-width: 900px) {
  .hero { grid-template-columns:1fr; padding-top:55px; }
  .hero-visual { min-height:300px; }
  .steps .step-item span { display:none; }
  .step-item:not(:last-child)::after { width:15px; margin:0 5px; }
  .dashboard { grid-template-columns:82px minmax(0,1fr); }
  .nav a span,.site-switcher,.nav-label,.sidebar-user,.account-meta,.account-chevron { display:none; }
  .sidebar-user-menu { border-top:0; padding:8px 0 0; }
  .account-menu-trigger { justify-content:center; padding:6px; }
  .account-menu-panel { left:48px; right:auto; bottom:8px; width:240px; }
  .nav a { text-align:center; font-size:18px; }
  .main { padding:22px 18px 60px; }
  .choice-grid,.style-options { grid-template-columns:1fr 1fr; }
  .image-style-grid--article { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .image-style-grid--featured { grid-template-columns:1fr 1fr; }
}
@media (max-width: 620px) {
  .field-grid,.strategy-cards,.referral-grid { grid-template-columns:1fr; }
  .url-stage { padding:30px 16px; }
  .url-panel { padding:22px; }
  .url-row { flex-direction:column; }
  .onboarding-header .brand { display:none; }
  .choice-grid,.style-options { grid-template-columns:1fr; }
  .image-style-grid--article,.image-style-grid--featured { grid-template-columns:1fr; }
  .settings-wrap .field-grid { grid-template-columns:1fr; }
  .competitors-header { flex-direction:column; align-items:stretch; }
  .competitors-grid { grid-template-columns:1fr; }
  .competitors-add-row { flex-direction:column; }
  .dashboard { display:block; }
  .sidebar { position:static; width:100%; height:auto; flex-direction:row; align-items:center; overflow-x:auto; border-right:0; border-bottom:1px solid var(--line); padding:10px; }
  .sidebar .brand { margin-right:12px; }
  .nav { flex-direction:row; }
  .nav a { white-space:nowrap; }
  .main-header { flex-direction:column; }
  .home-header { flex-direction: column; }
  .home-top-grid,
  .home-metric-grid,
  .home-split-grid,
  .home-article-stats { grid-template-columns: 1fr; }
  .planner-banner { flex-direction:column; align-items:flex-start; }
  .planner-banner .btn { width:100%; }
}

/* Backlink Exchange */
.page-head-row{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap}
.exchange-dr-pill{padding:8px 12px;border:1px solid var(--blue-200);border-radius:999px;background:var(--blue-50);color:var(--blue-700);font-size:12px;font-weight:700;white-space:nowrap}
.exchange-card-title{margin:0 0 10px;font-size:15px}
.exchange-settings-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.exchange-toggle{display:inline-flex;align-items:center;gap:10px;font-weight:700}
.exchange-inline{display:flex;align-items:center;gap:8px}
.exchange-inline input[type=number]{width:80px}
.exchange-metrics{display:grid;grid-template-columns:1.1fr .9fr;gap:16px;margin-top:18px}
.exchange-metric-value{margin:4px 0 6px;font-size:40px;line-height:1;letter-spacing:-.04em;font-weight:800}
.exchange-metric-sm{font-size:32px}
.exchange-value{color:#059669}
.exchange-perf-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:8px}
.exchange-target-form{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.exchange-target-form input{flex:1;min-width:180px}
.exchange-target-list{list-style:none;padding:0;margin:16px 0 0;display:grid;gap:10px}
.exchange-target-list li{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:12px 14px;border:1px solid var(--line);border-radius:12px}
.exchange-target-list a{display:block;color:var(--muted);font-size:12px;word-break:break-all}
.exchange-empty{margin-top:18px;padding:28px;border:1px dashed var(--line);border-radius:14px;text-align:center;color:var(--muted)}
.exchange-locked p{max-width:460px;margin:0 auto 16px}
@media(max-width:820px){
  .exchange-settings-grid,.exchange-metrics,.exchange-perf-grid{grid-template-columns:1fr}
}

.portal-plan-actions{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.portal-plan-actions form{margin:0}
