:root {
  --bg0: #050505;
  --bg1: #0c0c0c;
  --bg2: #141414;
  --bg3: #1a1a1a;
  --surface: rgba(18, 18, 18, 0.72);
  --surface-hover: rgba(26, 26, 26, 0.88);
  --ink: #f5f5f5;
  --ink-soft: #d4d4d4;
  --muted: #737373;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(220, 38, 38, 0.35);
  --accent: #ef4444;
  --accent-bright: #ff5555;
  --accent-deep: #b91c1c;
  --accent-glow: rgba(239, 68, 68, 0.45);
  --accent-ink: #fff;
  --warn: #f59e0b;
  --bad: #f87171;
  --ok: #4ade80;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
  --sans: "Plus Jakarta Sans", "IBM Plex Sans", system-ui, sans-serif;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.55);
  --shadow-red: 0 8px 32px rgba(220, 38, 38, 0.22);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── 3D arka plan ── */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(127, 29, 29, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 50%, rgba(153, 27, 27, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 0% 80%, rgba(127, 29, 29, 0.12) 0%, transparent 45%),
    linear-gradient(165deg, #0a0a0a 0%, #050505 40%, #0f0f0f 100%);
}

.bg::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 20%, transparent 75%);
}

.bg::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 0%, rgba(239, 68, 68, 0.08) 0%, transparent 45%);
}

/* ── Header ── */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.75rem;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 8, 0.75);
  backdrop-filter: blur(20px) saturate(1.2);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  position: sticky;
  top: 0;
  z-index: 100;
  isolation: isolate;
}

.brand {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

.brand h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 0%, #fca5a5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.mark {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ef4444 0%, #991b1b 100%);
  color: #fff;
  font-weight: 800;
  font-family: var(--mono);
  font-size: 0.78rem;
  border-radius: 14px;
  box-shadow:
    var(--shadow-red),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  transform: perspective(200px) rotateX(2deg);
}

.health {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-align: right;
  max-width: 32rem;
  line-height: 1.6;
  padding: 0.5rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}

.health .ok { color: var(--ok); }
.health .bad { color: var(--bad); }

.top-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
  min-width: 0;
}

.auth-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.5rem 0.35rem 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.auth-bar .auth-btn {
  white-space: nowrap;
}

.auth-user {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent-bright);
}

.auth-btn {
  padding: 0.28rem 0.65rem;
  font-size: 0.72rem;
}

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(127, 29, 29, 0.28) 0%, transparent 55%),
    var(--bg0);
}

/* Giriş sayfasında fixed bg katmanı inputları engellemesin */
.login-page .bg {
  display: none !important;
}

.login-page main {
  max-width: none;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

.login-wrap {
  width: min(100%, 22rem);
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.login-card {
  padding: 1.35rem 1.5rem;
  overflow: visible !important;
  pointer-events: auto;
}

.login-form {
  display: grid;
  gap: 0.85rem;
  pointer-events: auto;
}

.login-form input {
  position: relative;
  z-index: 3;
  pointer-events: auto !important;
  color: var(--ink) !important;
  -webkit-text-fill-color: var(--ink) !important;
  caret-color: var(--accent-bright);
  background: rgba(0, 0, 0, 0.45) !important;
}

.login-form input:-webkit-autofill,
.login-form input:-webkit-autofill:hover,
.login-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.45) inset;
  transition: background-color 9999s ease-out 0s;
}

.login-brand {
  margin-bottom: 1.25rem;
}

.login-brand p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.login-submit {
  width: 100%;
  margin-top: 0.25rem;
}

/* ── Panel tabs ── */
.panel-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem;
  max-width: 960px;
  margin: 1rem auto 0;
  background: rgba(12, 12, 12, 0.85);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 4.35rem;
  z-index: 90;
  isolation: isolate;
}

.panel-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.18s, background 0.18s, box-shadow 0.18s;
  flex: 1;
  text-align: center;
}

.panel-tab:hover {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.04);
}

.panel-tab.active {
  color: var(--ink);
  background: rgba(239, 68, 68, 0.12);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.28);
}

.tab-panel[hidden] {
  display: none !important;
}

.tab-panel.active {
  display: grid;
  gap: 1rem;
  grid-column: 1 / -1;
}

.index-section .index-urls-field span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Layout ── */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
  display: grid;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

/* ── Panel cards ── */
.panel-card {
  background: linear-gradient(180deg, rgba(22, 22, 22, 0.92) 0%, rgba(14, 14, 14, 0.88) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.panel-card-compact {
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.card-head-row {
  justify-content: space-between;
}

.card-head-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: 12px;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.card-head-icon svg {
  display: block;
}

.card-head-text {
  min-width: 0;
  flex: 1;
}

.card-head-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.25;
}

.card-head-desc {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.card-body {
  padding: 1.25rem 1.35rem 1.35rem;
}

.card-body-compact {
  padding: 0.65rem 1rem 1rem;
}

.status-line {
  margin: 0 0 1rem;
  padding: 0.55rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.status-line.ok { color: var(--ok); border-color: rgba(74, 222, 128, 0.25); background: rgba(74, 222, 128, 0.06); }
.status-line.err { color: var(--bad); border-color: rgba(248, 113, 113, 0.25); background: rgba(248, 113, 113, 0.06); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.65rem;
  box-shadow: var(--shadow-md), var(--shadow-inset);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.35), transparent);
  pointer-events: none;
}

.sec-head h2,
.sec-head h3 {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  text-transform: none;
}

.sec-head h2::before,
.sec-head h3::before {
  content: "";
  width: 3px;
  height: 0.95em;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.hint {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.domain-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  flex: 1 1 100%;
  justify-content: flex-end;
  margin-top: 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.domain-form {
  align-items: end;
}

.domain-check-result {
  margin-top: 0.85rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.55;
  text-align: center;
}

.domain-check-result.ok {
  border: 1px solid rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.08);
  color: #bbf7d0;
}

.domain-check-result.err {
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.08);
  color: #fecaca;
}

.domain-check-result.warn {
  border: 1px solid rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
  color: #fde68a;
}

.domain-check-result .ok { color: var(--ok); }
.domain-check-result .bad { color: var(--bad); }

.fqdn-preview {
  flex: 1 1 100%;
  margin: 0.25rem 0 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent-bright);
  padding: 0.5rem 0.85rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
}

/* ── Process bar (minimal) ── */
.process-bar {
  padding: 0.75rem 1rem;
}

.process-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
  min-height: 1.25rem;
}

.process-target {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-bright);
  flex-shrink: 0;
}

.process-current {
  flex: 1 1 auto;
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.process-current.err { color: #fca5a5; }

.process-badge {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.process-badge.ok {
  color: #bbf7d0;
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.35);
}

.process-badge.run {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  animation: dotPulse 1.2s ease infinite;
}

.process-badge.err {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

#otoProcessFaviconBtn,
#otoProcessAppHtmlBtn,
#otoProcessGoogleHtmlBtn {
  flex-shrink: 0;
}

.oto-app-html-section .card-body {
  padding-top: 0.25rem;
}

.clickat-result .clickat-row {
  margin: 0.35rem 0;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.clickat-result .clickat-row.ok { color: #bbf7d0; }
.clickat-result .clickat-row.err { color: #fecaca; }

.process-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.process-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
}

.process-dot.ok { background: var(--ok); }
.process-dot.skip { background: rgba(255, 255, 255, 0.22); }
.process-dot.error { background: var(--bad); }
.process-dot.run {
  background: var(--accent-bright);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: dotPulse 1.2s ease infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.85); }
}

/* ── Son alınan domainler ── */
.recent-section {
  margin-top: 0;
}

.recent-toggle {
  min-width: auto;
  padding: 0.35rem 0.55rem;
}

.recent-count {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
}

.recent-chevron {
  font-size: 0.85rem;
  color: var(--muted);
  transition: transform 0.2s;
}

.recent-toggle.open .recent-chevron {
  transform: rotate(180deg);
}

.recent-domains {
  display: grid;
  gap: 0.35rem;
  max-height: 12rem;
  overflow-y: auto;
}

.recent-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.38rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.recent-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

.recent-item.active {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}

.recent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.recent-dot.done { background: var(--ok); box-shadow: 0 0 6px rgba(74, 222, 128, 0.5); }
.recent-dot.run { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.5); animation: dotPulse 1.2s ease infinite; }
.recent-dot.error { background: var(--bad); }

.recent-name {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-meta {
  font-size: 0.62rem;
  color: var(--muted);
  white-space: nowrap;
}

.recent-loading,
.recent-empty {
  margin: 0;
  padding: 0.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  text-align: center;
}

.job.history { padding: 0.85rem 1rem; }

/* ── Theme section ── */
.theme-section {
  margin-top: 0;
}

.field-optional {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0;
}

.theme-row { align-items: end; }
.theme-form { display: grid; gap: 0.85rem; }

.theme-html-field { display: grid; gap: 0.4rem; }

.theme-html-field textarea,
.index-urls-field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font: 400 0.82rem/1.5 var(--mono);
  resize: vertical;
  outline: none;
  border-radius: var(--radius-md);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.theme-html-field textarea {
  min-height: 10rem;
}

.theme-html-field textarea:focus,
.index-urls-field textarea:focus {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.3),
    0 0 0 3px rgba(239, 68, 68, 0.12);
}

.theme-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.theme-approve-row {
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.approve-target {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1;
}

.approve-target-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Domain picker ── */
.domain-pick-block {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.domain-pick-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.domain-pick-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
}

.domain-pick-hint code {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink-soft);
}

.domain-pick-wrap {
  position: relative;
}

.domain-pick-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.68rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font: 500 0.88rem/1.2 var(--mono);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  text-align: left;
}

.domain-pick-btn:hover {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.06);
}

.domain-pick-btn.selected {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
}

.domain-pick-btn-sm {
  width: auto;
  min-width: 12rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
}

.domain-pick-btn-block {
  width: 100%;
}

.domain-pick-icon {
  display: flex;
  color: var(--accent-bright);
  flex-shrink: 0;
}

.domain-pick-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-pick-value.muted {
  color: var(--muted);
}

.domain-pick-chevron {
  color: var(--muted);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.domain-pick-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 120;
  max-height: 14rem;
  overflow-y: auto;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(14, 14, 14, 0.98);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
}

.domain-pick-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.domain-pick-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

.domain-pick-item-name {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent-bright);
}

.domain-pick-item-meta {
  font-size: 0.68rem;
  color: var(--muted);
}

.domain-pick-empty {
  margin: 0;
  padding: 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

.index-block {
  margin-top: 1.35rem;
  padding: 1.35rem 1rem 1.1rem;
  border-top: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.04);
  border-radius: var(--radius-md);
  text-align: center;
}

.index-block-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink);
}

.index-urls-field {
  margin-top: 0;
  text-align: left;
}

.index-urls-field textarea {
  min-height: 5rem;
  font-size: 0.85rem;
  border-color: rgba(239, 68, 68, 0.25);
}

.index-actions {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.clok-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  text-align: center;
}
.clok-actions .btn { min-width: 14rem; }

.index-result {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(74, 222, 128, 0.25);
  background: rgba(74, 222, 128, 0.05);
  border-radius: var(--radius-md);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
}

.watch-section .sec-head h3 {
  font-size: 0.78rem;
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.tab-soon {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.45rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 999px;
  vertical-align: middle;
}

.watch-soon-panel {
  text-align: center;
  padding: 2rem 1.25rem 2.25rem;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}

.watch-soon-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.85), rgba(220, 38, 38, 0.95));
  border-radius: 999px;
}

.watch-soon-title {
  margin: 1rem 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.watch-soon-text {
  margin: 0 auto;
  max-width: 36rem;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.92rem;
}

.watch-soon-list {
  display: inline-block;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
  color: var(--muted);
  font-size: 0.88rem;
}

.watch-soon-list li {
  padding: 0.35rem 0 0.35rem 1.35rem;
  position: relative;
}

.watch-soon-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.watch-section--paused {
  opacity: 0.95;
}

.watch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.watch-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.watch-empty {
  font-size: 0.85rem;
  margin: 0;
}

.watch-item {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
}

.watch-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.watch-item-domain {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text);
}

.watch-badge {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.watch-badge.ok {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 35%, var(--line));
}

.watch-badge.wait {
  color: var(--accent-bright);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.watch-item-url {
  margin: 0.25rem 0 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent-bright);
  word-break: break-all;
}

.rank-form-row {
  margin-bottom: 0.5rem;
}

.watch-item-meta {
  margin: 0.35rem 0 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.watch-item-meta.ok { color: var(--ok); }
.watch-item-meta.err { color: var(--bad); }

.watch-item-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.65rem;
}

.watch-google-link {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent-bright);
  text-decoration: none;
}

.watch-google-link:hover { text-decoration: underline; }

.watch-remove-btn {
  padding: 0.25rem 0.65rem;
  font-size: 0.72rem;
}

.theme-meta {
  margin: 0.65rem 0 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.theme-meta.ok { color: var(--ok); }
.theme-meta.err { color: var(--bad); }

.cloak-app-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.favicon-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.file-field input[type="file"] {
  display: block;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.78rem;
  cursor: pointer;
}

.file-field input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  background: var(--surface);
  color: var(--accent-bright);
  font-family: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

.file-field-name {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.theme-preview {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.theme-preview h3 {
  font-size: 0.78rem;
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.theme-preview-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent-bright);
}

.oto-preview-head-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.oto-preview-toggle .recent-chevron {
  transition: transform 0.2s;
}

.oto-preview-toggle.open .recent-chevron {
  transform: rotate(180deg);
}

.theme-preview-section .card-head-row {
  align-items: flex-start;
}

.theme-iframe {
  width: 100%;
  height: min(70vh, 640px);
  margin-top: 0.75rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.theme-approve-row { margin-top: 1rem; }

.theme-code {
  margin: 0.75rem 0 0;
  padding: 1rem 1.1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-family: var(--mono);
  font-size: 0.76rem;
  color: #fca5a5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.theme-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.theme-item {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  transition: border-color 0.2s;
}

.theme-item:hover {
  border-color: rgba(239, 68, 68, 0.25);
}

.theme-item-urls {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0.35rem 0;
}

.theme-item a {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent-bright);
  text-decoration: none;
}

.theme-item a:hover { text-decoration: underline; }

.theme-open-btn {
  margin-top: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
}

.ok-badge {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--ok);
  margin-left: 0.35rem;
  padding: 0.15rem 0.45rem;
  background: rgba(74, 222, 128, 0.1);
  border-radius: var(--radius-pill);
}

.theme-empty { color: var(--muted); font-size: 0.85rem; }
.muted { color: var(--muted); font-size: 0.75rem; }

/* ── Form fields ── */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: end;
}

.field {
  display: grid;
  gap: 0.4rem;
  min-width: 5.5rem;
  position: relative;
}

.field.grow { flex: 1; min-width: 12rem; }

.field span {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

input,
select {
  width: 100%;
  padding: 0.68rem 0.95rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font: 500 0.88rem/1.2 var(--mono);
  outline: none;
  border-radius: 10px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input::placeholder { color: #525252; }

input:focus,
select:focus {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(0, 0, 0, 0.5);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.25),
    0 0 0 3px rgba(239, 68, 68, 0.12);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23737373' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.25rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-soft);
  padding: 0.62rem 1.2rem;
  font: 600 0.84rem/1.2 var(--sans);
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.15s;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.38rem 0.55rem;
  font-size: 0.78rem;
  border-radius: 8px;
}

.btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn.primary {
  background: linear-gradient(180deg, #ef4444 0%, #c62828 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
  border-color: rgba(255, 255, 255, 0.16);
}

.btn.ghost {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.btn.ghost:hover:not(:disabled) {
  color: var(--ink);
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.06);
}

.btn.warn {
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.08);
}

.btn.warn:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
}

.btn.outline {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.06);
}

.btn.outline:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.7);
  color: #fff;
  box-shadow: var(--shadow-red);
}

.btn.ok {
  border-color: rgba(74, 222, 128, 0.4);
  color: var(--ok);
  background: rgba(74, 222, 128, 0.08);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Flash messages ── */
.flash {
  margin-top: 0.85rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
}

.flash.err {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.08);
  color: #fecaca;
}

.flash-inline {
  margin-top: 0.5rem;
  margin-bottom: 0.35rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
}

.oto-favicon-flash {
  margin: 0 1.25rem 0.75rem;
}

/* ── Section head ── */
.sec-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  gap: 0.75rem;
}

.sec-head h2 { margin-bottom: 0; }

/* ── Jobs ── */
.jobs { display: grid; gap: 0.85rem; }

.job {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  padding: 1.1rem 1.15rem;
  display: grid;
  gap: 0.85rem;
  border-radius: var(--radius-md);
  transition: border-color 0.2s;
}

.job:hover {
  border-color: rgba(239, 68, 68, 0.2);
}

.job-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: start;
}

.job-title {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.95rem;
}

.job-title small {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
}

.badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.25);
}

.badge.pending_approval { color: #fbbf24; border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.08); }
.badge.done { color: var(--ok); border-color: rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.08); }
.badge.error { color: var(--bad); border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }
.badge.running,
.badge.approved,
.badge[class*="running_"] {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
}

@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .top { padding: 0.85rem 1rem; flex-wrap: wrap; }
  .top-actions { width: 100%; flex-direction: row; justify-content: flex-end; align-items: center; }
  .health { display: none; }
  .auth-bar { margin-left: auto; }
  .panel-tabs {
    margin: 0.75rem 1rem 0;
    padding: 0.35rem;
    top: 3.5rem;
  }
  .panel-tab {
    font-size: 0.76rem;
    padding: 0.48rem 0.5rem;
  }
  .card-head { padding: 0.95rem 1rem; }
  .card-body { padding: 1rem; }
  main { padding: 1.25rem 1rem 2rem; }
  .card { padding: 1.15rem 1.2rem; border-radius: var(--radius-md); }
}

.step {
  border: 1px solid var(--line);
  padding: 0.55rem 0.65rem;
  font-size: 0.7rem;
  font-family: var(--mono);
  color: var(--muted);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
}

.step strong {
  display: block;
  color: var(--ink);
  font-size: 0.76rem;
  margin-bottom: 0.2rem;
  font-weight: 600;
}

.step.ok { border-color: rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.05); }
.step.error { border-color: rgba(248, 113, 113, 0.35); color: #fecaca; background: rgba(248, 113, 113, 0.05); }
.step.running { border-color: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.05); }
.step.skipped { opacity: 0.6; }

.actions { display: flex; gap: 0.55rem; flex-wrap: wrap; }

.logs {
  max-height: 7rem;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: 0.65rem;
}

.logs div { margin-bottom: 0.25rem; }
.empty { color: var(--muted); font-size: 0.88rem; padding: 1rem 0; }

/* scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(239, 68, 68, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(239, 68, 68, 0.5); }
