/* CreativeHtmlGen — offline site studio */

:root {
  --bg: #07090c;
  --bg-soft: #0a0d12;
  --panel: #0f141b;
  --panel-2: #131a22;
  --panel-3: #18212b;
  --ink: #e9eff6;
  --ink-2: #c3cfdd;
  --muted: #8795a8;
  --faint: #5e6b7c;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.13);
  --accent: #4ce0b3;
  --accent-2: #63a8ff;
  --accent-ink: #04211a;
  --violet: #b18cff;
  --amber: #f3c969;
  --danger: #ff7180;
  --ok: #4ce0b3;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Segoe UI Variable Text", "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, ui-monospace, monospace;
}

[data-theme="light"] {
  --bg: #f2f5f9;
  --bg-soft: #e9eef5;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --panel-3: #eef3f9;
  --ink: #0d1724;
  --ink-2: #2a3a4c;
  --muted: #5d6d80;
  --faint: #8593a5;
  --line: rgba(13, 28, 45, 0.09);
  --line-strong: rgba(13, 28, 45, 0.16);
  --accent: #0aa77f;
  --accent-2: #2f7ddd;
  --accent-ink: #ffffff;
  --violet: #7a5bd6;
  --amber: #b37c12;
  --danger: #d9485b;
  --ok: #0aa77f;
  --shadow: 0 24px 60px rgba(28, 48, 72, 0.14);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 14.5px;
  line-height: 1.55;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(700px 420px at 12% -8%, rgba(76, 224, 179, 0.09), transparent 62%),
    radial-gradient(760px 480px at 96% -6%, rgba(99, 168, 255, 0.075), transparent 64%);
  z-index: 0;
}

[data-theme="light"] body::before {
  background:
    radial-gradient(700px 420px at 12% -8%, rgba(10, 167, 127, 0.10), transparent 62%),
    radial-gradient(760px 480px at 96% -6%, rgba(47, 125, 221, 0.09), transparent 64%);
}

::selection { background: rgba(76, 224, 179, 0.28); color: var(--ink); }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon.spin { animation: spin 0.8s linear infinite; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- Shell ---------- */
.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 20, 27, 0.86), rgba(8, 11, 15, 0.94));
  backdrop-filter: blur(14px);
  overflow-y: auto;
}
[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 247, 251, 0.96));
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 6px 8px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #05251c;
  background: linear-gradient(145deg, var(--accent), #7ef0cf 55%, var(--accent-2));
  box-shadow: 0 8px 24px rgba(76, 224, 179, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.18; }
.brand-text strong { font-size: 15px; letter-spacing: -0.02em; font-weight: 700; }
.brand-text strong span { color: var(--accent); }
.brand-text small { font-size: 10.5px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 11px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 550;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease;
}
.nav-item .icon { width: 18px; height: 18px; opacity: 0.85; }
.nav-item:hover { background: var(--panel-2); color: var(--ink-2); }
.nav-item.is-active {
  color: var(--ink);
  background: linear-gradient(90deg, rgba(76, 224, 179, 0.13), rgba(76, 224, 179, 0.03));
  box-shadow: inset 0 0 0 1px rgba(76, 224, 179, 0.14);
}
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2.5px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.nav-item.is-active .icon { color: var(--accent); opacity: 1; }
.nav-badge {
  margin-left: auto;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 750;
  display: grid;
  place-items: center;
}

.side-spacer { flex: 1; }

.engine-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.engine-row { display: flex; align-items: center; gap: 10px; }
.engine-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.03);
}
.engine-dot.ok { background: var(--ok); box-shadow: 0 0 12px rgba(76, 224, 179, 0.65); }
.engine-dot.bad { background: var(--danger); box-shadow: 0 0 12px rgba(255, 113, 128, 0.6); }
.engine-row strong { display: block; font-size: 12.5px; font-weight: 650; }
.engine-row small { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.engine-meta {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--faint);
  font-size: 10.5px;
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 9px;
  padding: 7px 9px;
  font-size: 12px;
}
.theme-toggle span { flex: 1; text-align: left; }
.theme-toggle:hover { background: var(--panel-2); color: var(--ink-2); }
.theme-toggle .icon { width: 15px; height: 15px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---------- Main ---------- */
.main {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 34px 18px;
  background: linear-gradient(180deg, rgba(7, 9, 12, 0.92) 55%, rgba(7, 9, 12, 0.55) 100%);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
}
[data-theme="light"] .topbar {
  background: linear-gradient(180deg, rgba(242, 245, 249, 0.94) 55%, rgba(242, 245, 249, 0.6) 100%);
}
.eyebrow {
  margin: 0 0 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.topbar h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.032em;
}
.subtitle { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; padding-bottom: 2px; }

.content { padding: 8px 34px 60px; max-width: 1500px; }
.view { display: none; animation: viewIn 0.35s ease both; }
.view.is-active { display: block; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.14s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.btn .icon { width: 16px; height: 16px; }
.btn:hover { background: var(--panel-3); border-color: rgba(255, 255, 255, 0.2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6ef0cd 70%, var(--accent-2));
  color: #032019;
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(76, 224, 179, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #66f0c7, #8bf6dc 60%, #7fbcff);
  color: #021712;
  box-shadow: 0 10px 28px rgba(76, 224, 179, 0.28);
}
[data-theme="light"] .btn-primary { color: #fff; background: linear-gradient(135deg, #0aa77f, #12b892); }

.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: var(--panel-2); }
.btn-danger { color: var(--danger); border-color: rgba(255, 113, 128, 0.28); background: rgba(255, 113, 128, 0.07); }
.btn-danger:hover { background: rgba(255, 113, 128, 0.13); border-color: rgba(255, 113, 128, 0.45); color: var(--danger); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12px; border-radius: 9px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn.is-busy { color: transparent !important; pointer-events: none; position: relative; }
.btn.is-busy::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  color: var(--accent-ink);
  animation: spin 0.7s linear infinite;
}
.btn-ghost.is-busy::after, .btn-danger.is-busy::after { color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { background: var(--panel-3); color: var(--ink); border-color: var(--line-strong); }
.icon-btn.ghost { background: transparent; border-color: transparent; width: 30px; height: 30px; }
.icon-btn.ghost:hover { background: var(--panel-3); }
.icon-btn.tiny { width: 28px; height: 28px; border-color: transparent; background: transparent; }
.icon-btn.tiny .icon { width: 15px; height: 15px; }
.icon-btn.danger:hover { color: var(--danger); background: rgba(255, 113, 128, 0.1); }

/* ---------- Stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.stat {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -45px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.035;
}
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: none;
}
.stat-icon .icon { width: 19px; height: 19px; }
.tint-mint { background: rgba(76, 224, 179, 0.11); color: var(--accent); }
.tint-blue { background: rgba(99, 168, 255, 0.12); color: var(--accent-2); }
.tint-violet { background: rgba(177, 140, 255, 0.12); color: var(--violet); }
.tint-amber { background: rgba(243, 201, 105, 0.11); color: var(--amber); }
.stat strong { display: block; font-size: 23px; line-height: 1.1; letter-spacing: -0.03em; font-weight: 700; }
.stat span { display: block; color: var(--muted); font-size: 11.5px; margin-top: 3px; }

/* ---------- Section head ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 32px 0 15px;
}
.section-head.compact { margin-top: 0; }
.section-head h2 { margin: 0; font-size: 17px; letter-spacing: -0.02em; font-weight: 650; }
.section-sub { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }

.search {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 9px;
  color: var(--faint);
  min-width: 220px;
}
.search .icon { width: 15px; height: 15px; }
.search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 12.5px;
  color: var(--ink);
}
.search:focus-within { border-color: rgba(76, 224, 179, 0.4); box-shadow: 0 0 0 3px rgba(76, 224, 179, 0.08); }

/* ---------- Project cards ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(305px, 1fr));
  gap: 13px;
}
.project-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(420px 160px at 100% 0%, rgba(76, 224, 179, 0.05), transparent 70%),
    linear-gradient(165deg, var(--panel-2), var(--panel));
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  min-height: 212px;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.project-card:hover {
  border-color: rgba(76, 224, 179, 0.24);
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}
.pc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 210px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-3);
  color: var(--muted);
  font-size: 10.5px;
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip.live { color: var(--accent); border-color: rgba(76, 224, 179, 0.24); background: rgba(76, 224, 179, 0.07); }
.pc-name {
  margin: 14px 0 2px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pc-url {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-stats {
  display: flex;
  gap: 0;
  margin: 15px 0 13px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}
.pc-stats > div { flex: 1; min-width: 0; padding: 0 10px; border-left: 1px solid var(--line); }
.pc-stats > div:first-child { padding-left: 0; border-left: 0; }
.pc-stats strong { display: block; font-size: 13px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-stats span { display: block; font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 1px; }
.pc-foot { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-top: auto; }
.pc-time { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--faint); white-space: nowrap; }
.pc-time .icon { width: 13px; height: 13px; }
.pc-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; }
.pc-main, .pc-tools { display: flex; align-items: center; gap: 5px; }
.pc-tools { margin-left: auto; }
.pc-actions .btn { padding: 0 9px; height: 30px; font-size: 11.5px; }
.pc-actions .btn.icon-only { width: 30px; padding: 0; }

/* ---------- Panels & forms ---------- */
.panel {
  border: 1px solid var(--line);
  background: linear-gradient(165deg, var(--panel-2), var(--panel));
  border-radius: var(--radius);
  padding: 20px;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.panel-head h2 { margin: 0; font-size: 16.5px; font-weight: 650; letter-spacing: -0.02em; }
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; max-width: 46ch; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-3);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge .icon { width: 12px; height: 12px; }
.badge-lock { color: var(--accent); border-color: rgba(76, 224, 179, 0.2); background: rgba(76, 224, 179, 0.06); }

.form { display: flex; flex-direction: column; gap: 13px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-grid-3 { grid-template-columns: 2fr 1fr 0.7fr; }
.field-span-2 { grid-column: span 1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field select, .field textarea {
  height: 40px;
  width: 100%;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  padding: 0 11px;
  font-size: 13px;
  color: var(--ink);
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input::placeholder { color: var(--faint); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(76, 224, 179, 0.5);
  box-shadow: 0 0 0 3px rgba(76, 224, 179, 0.09);
}
.field input:disabled { color: var(--muted); background: var(--panel-3); cursor: not-allowed; }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 40px; }
.input-action {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--faint);
  display: grid;
  place-items: center;
}
.input-action:hover { color: var(--ink); background: var(--panel-3); }
.hint { font-size: 10.5px; color: var(--faint); line-height: 1.4; }
.field textarea {
  height: auto;
  min-height: 82px;
  padding: 9px 11px;
  line-height: 1.5;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}
.field textarea::placeholder { color: var(--faint); }

.backup-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.backup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}
.backup-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.backup-main strong { font-size: 12.5px; font-weight: 600; }
.backup-main span { font-size: 11px; color: var(--muted); }
.backup-main small {
  font-size: 10.5px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60ch;
}
.backup-actions { display: flex; gap: 6px; flex-shrink: 0; }
.empty-inline {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
}
.empty-inline .icon { color: var(--faint); flex-shrink: 0; }
.empty-inline div { display: flex; flex-direction: column; gap: 3px; }
.empty-inline span { font-size: 11px; }
.form-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 5px 0 0;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--faint);
}
.form-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.form-divider em { font-style: normal; text-transform: none; letter-spacing: 0; font-size: 10.5px; color: var(--faint); }
.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }

/* ---------- Domains ---------- */
.domain-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 22px; align-items: start; }
.domain-form-panel { position: sticky; top: 104px; }

.domain-list { display: flex; flex-direction: column; gap: 10px; }
.domain-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  padding: 14px;
}
.dc-head { display: flex; align-items: center; gap: 11px; }
.dc-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--accent-2);
  background: rgba(99, 168, 255, 0.1);
  flex: none;
}
.dc-icon .icon { width: 18px; height: 18px; }
.dc-head h3 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
.dc-head p { margin: 1px 0 0; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.dc-head .badge { margin-left: auto; }
.dc-meta { display: flex; flex-direction: column; gap: 5px; margin: 12px 0; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dc-meta div { display: flex; gap: 10px; font-size: 11.5px; }
.dc-meta dt { color: var(--faint); width: 58px; flex: none; }
.dc-meta dd { margin: 0; font-family: var(--mono); font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dc-state { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--accent); }
.dc-state .icon { width: 12px; height: 12px; }
.dc-state.off { color: var(--faint); }
.dc-actions { display: flex; gap: 4px; }

/* ---------- Activity ---------- */
.activity-list { display: flex; flex-direction: column; gap: 8px; }
.activity-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.activity-row:hover { border-color: var(--line-strong); background: var(--panel-2); }
.act-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--panel-3);
  color: var(--muted);
}
.act-icon .icon { width: 16px; height: 16px; }
.act-icon.scrape { color: var(--accent); background: rgba(76, 224, 179, 0.09); }
.act-icon.upload { color: var(--accent-2); background: rgba(99, 168, 255, 0.1); }
.act-icon.minify { color: var(--amber); background: rgba(243, 201, 105, 0.09); }
.act-main { min-width: 0; }
.act-main strong { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-main span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-time { font-size: 11px; color: var(--faint); white-space: nowrap; }

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.settings-list { margin: 0; display: flex; flex-direction: column; }
.settings-list > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.settings-list > div:last-child { border-bottom: 0; }
.settings-list dt { color: var(--muted); font-size: 12px; flex: none; }
.settings-list dd { margin: 0; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); text-align: right; word-break: break-all; max-width: 60%; }
.note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.note-list li { display: flex; gap: 11px; }
.note-list .icon { width: 16px; height: 16px; color: var(--accent); margin-top: 3px; }
.note-list strong { display: block; font-size: 12.5px; font-weight: 650; }
.note-list p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.callout {
  margin-top: 18px;
  border: 1px solid rgba(243, 201, 105, 0.22);
  background: rgba(243, 201, 105, 0.055);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.55;
}
.callout strong { color: var(--amber); }

/* ---------- Empty ---------- */
.empty {
  text-align: center;
  padding: 46px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.012);
  margin-top: 14px;
}
.empty.small { padding: 26px 18px; margin-top: 0; }
.empty-art { width: 110px; height: 80px; margin: 0 auto 16px; color: var(--accent); opacity: 0.55; }
.empty-art svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.empty h3 { margin: 0 0 6px; font-size: 16px; letter-spacing: -0.02em; }
.empty p { margin: 0 auto 16px; max-width: 46ch; color: var(--muted); font-size: 12.5px; }
.empty.small p { margin-bottom: 0; }

/* ---------- Job dock ---------- */
.job-dock {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  width: min(560px, calc(100vw - 24px));
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(13, 18, 24, 0.94);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: dockIn 0.28s cubic-bezier(0.2, 0.9, 0.25, 1);
}
[data-theme="light"] .job-dock { background: rgba(255, 255, 255, 0.96); }
@keyframes dockIn { from { opacity: 0; transform: translateY(14px) scale(0.99); } }
.job-dock.collapsed .console, .job-dock.collapsed .dock-foot, .job-dock.collapsed .dock-meta, .job-dock.collapsed .progress-track { display: none; }
.job-dock.collapsed { width: 380px; }

.dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.dock-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dock-title strong { display: block; font-size: 12.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-title span { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: relative; flex: none; }
.dock-pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: ping 1.6s ease-out infinite;
}
.dock-pulse.done { background: var(--accent); }
.dock-pulse.error { background: var(--danger); }
.dock-pulse.error::after { border-color: var(--danger); animation: none; }
.dock-pulse.idle { background: var(--faint); }
.dock-pulse.idle::after { display: none; }
@keyframes ping { 0% { transform: scale(0.7); opacity: 0.8; } 80%, 100% { transform: scale(1.9); opacity: 0; } }
.dock-tools { display: flex; align-items: center; gap: 5px; }

.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--panel-3);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.pill.running, .pill.queued { color: var(--accent); border-color: rgba(76, 224, 179, 0.25); background: rgba(76, 224, 179, 0.08); }
.pill.done { color: var(--accent); border-color: rgba(76, 224, 179, 0.25); background: rgba(76, 224, 179, 0.08); }
.pill.error, .pill.cancelled { color: var(--danger); border-color: rgba(255, 113, 128, 0.25); background: rgba(255, 113, 128, 0.08); }

.progress-track { height: 3px; background: var(--line); overflow: hidden; position: relative; }
.progress-track > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.35s ease;
}
.progress-track.is-indeterminate > span {
  width: 32%;
  position: absolute;
  animation: indeterminate 1.5s ease-in-out infinite;
}
@keyframes indeterminate {
  0% { left: -32%; }
  100% { left: 100%; }
}
.dock-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 14px;
  font-size: 10.5px;
  color: var(--faint);
  font-family: var(--mono);
  border-bottom: 1px solid var(--line);
}
.console {
  margin: 0;
  padding: 9px 12px;
  list-style: none;
  height: 190px;
  overflow-y: auto;
  background: #060809;
  color: #aab6c6;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.55;
  scroll-behavior: smooth;
}
.console li { display: flex; gap: 8px; padding: 1px 0; word-break: break-word; }
.console .lt { color: #4d5b6b; flex: none; font-size: 9.5px; padding-top: 1px; }
.console .lm { white-space: pre-wrap; min-width: 0; }
.console .lv-error .lm { color: #ff8b98; }
.console .lv-warn .lm { color: #f3c969; }
.console .lv-ok .lm { color: #5ce3b7; }
.console .lv-cmd .lm { color: #8fb7ff; }
.console .lv-out .lm { color: #aab6c6; }
.console .empty-log { color: #4d5b6b; font-style: italic; }
.dock-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.dock-foot-right { display: flex; gap: 6px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 5, 9, 0.72);
  backdrop-filter: blur(7px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: linear-gradient(170deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
  animation: modalIn 0.24s cubic-bezier(0.2, 0.9, 0.25, 1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.99); } }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 18px; letter-spacing: -0.025em; font-weight: 650; }
.modal-head p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.modal-body { padding: 18px 22px 22px; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}
.modal.wide { width: min(720px, 100%); }
.modal.narrow { width: min(460px, 100%); }

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  border-radius: 9px;
  margin-bottom: 14px;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
}
.seg button.is-active { background: var(--panel-3); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
}
.switch-row strong { display: block; font-size: 12.5px; font-weight: 600; }
.switch-row small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--panel-3);
  border: 1px solid var(--line-strong);
  transition: background 0.18s ease, border-color 0.18s ease;
  pointer-events: none;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.18s ease, background 0.18s ease;
}
.switch input:checked + .track { background: rgba(76, 224, 179, 0.9); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(18px); background: #04211a; }

.readonly-field {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px dashed var(--line-strong);
  background: var(--panel-3);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}
.readonly-field .icon { width: 14px; height: 14px; color: var(--accent); }
.readonly-field em { margin-left: auto; font-style: normal; font-family: var(--font); font-size: 10.5px; color: var(--faint); }

.advanced { border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); }
.advanced summary {
  cursor: pointer;
  padding: 10px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::after { content: "+"; font-size: 15px; color: var(--faint); }
.advanced[open] summary::after { content: "–"; }
.advanced .advanced-body { padding: 2px 12px 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.advanced .field > span { font-size: 9.5px; }

/* ---------- Inline SFTP setup (new project) ---------- */
.setup-block {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
}
.setup-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.setup-head > .icon { width: 16px; height: 16px; color: var(--accent); margin-top: 2px; }
.setup-head strong { display: block; font-size: 12.5px; font-weight: 600; }
.setup-head small { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.setup-block .field-grid { gap: 10px; }

.info-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(99, 168, 255, 0.06);
  border: 1px solid rgba(99, 168, 255, 0.16);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  margin-top: 12px;
}
.info-line .icon { width: 14px; height: 14px; color: var(--accent-2); margin-top: 1px; }
.info-line.warn { background: rgba(243, 201, 105, 0.055); border-color: rgba(243, 201, 105, 0.2); }
.info-line.warn .icon { color: var(--amber); }

.summary-strip {
  display: flex;
  gap: 16px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  margin-bottom: 14px;
}
.summary-strip div { min-width: 0; }
.summary-strip strong { display: block; font-size: 11.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-strip span { display: block; font-size: 10px; color: var(--faint); }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 36px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgba(16, 22, 29, 0.96);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  animation: toastIn 0.24s cubic-bezier(0.2, 0.9, 0.25, 1);
  font-size: 12px;
}
[data-theme="light"] .toast { background: rgba(255, 255, 255, 0.98); }
@keyframes toastIn { from { opacity: 0; transform: translateX(12px); } }
.toast .icon { width: 16px; height: 16px; margin-top: 1px; color: var(--accent); flex: none; }
.toast.error .icon { color: var(--danger); }
.toast.warn .icon { color: var(--amber); }
.toast div { min-width: 0; }
.toast strong { display: block; font-size: 12px; font-weight: 600; }
.toast p { margin: 1px 0 0; color: var(--muted); font-size: 11px; word-break: break-word; }
.toast.leaving { animation: toastOut 0.2s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(12px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .domain-layout { grid-template-columns: 1fr; }
  .domain-form-panel { position: static; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  body { overflow: auto; }
  .shell { grid-template-columns: 1fr; height: auto; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  .brand { padding: 0; }
  .brand-text small { display: none; }
  .nav { flex-direction: row; gap: 2px; overflow-x: auto; }
  .nav-item { width: auto; padding: 8px 10px; }
  .nav-item span { display: none; }
  .nav-item .icon { width: 19px; height: 19px; }
  .nav-item.is-active::before { display: none; }
  .nav-badge { position: absolute; top: 2px; right: 2px; min-width: 15px; height: 15px; font-size: 9px; padding: 0 4px; }
  .side-spacer, .engine-card, .theme-toggle span { display: none; }
  .theme-toggle { padding: 8px; }
  .main { height: auto; overflow: visible; }
  .topbar { padding: 18px 18px 12px; align-items: center; }
  .content { padding: 6px 18px 80px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 12px; }
  .topbar h1 { font-size: 23px; }
  .topbar-actions { width: 100%; justify-content: flex-end; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; gap: 10px; }
  .stat-icon { width: 34px; height: 34px; }
  .stat strong { font-size: 19px; }
  .section-head { flex-wrap: wrap; align-items: flex-start; margin-top: 24px; }
  .search { width: 100%; }
  .project-grid { grid-template-columns: 1fr; }
  .field-grid, .field-grid-3, .advanced .advanced-body { grid-template-columns: 1fr; }
  .form-divider { margin-top: 2px; }
  .activity-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .activity-row .act-time, .activity-row > .btn { display: none; }
  .job-dock { right: 8px; bottom: 8px; width: calc(100vw - 16px); }
  .job-dock.collapsed { width: calc(100vw - 16px); }
  .console { height: 160px; }
  .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .toasts { top: 10px; right: 10px; width: calc(100vw - 20px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* Missed files dialog */
.btn-warn {
  background: rgba(243, 201, 105, 0.12);
  border: 1px solid rgba(243, 201, 105, 0.4);
  color: var(--amber);
  gap: 5px;
  font-weight: 600;
}
.btn-warn:hover { background: rgba(243, 201, 105, 0.2); }
.btn-warn .icon { width: 13px; height: 13px; }
.issue-tools { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.issue-tools input[type="search"] {
  flex: 1;
  min-width: 0;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  padding: 0 10px;
  font-size: 12.5px;
  outline: 0;
}
.issue-all { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.issue-list {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 340px;
  overflow: auto;
  background: var(--panel-2);
}
.issue-list > .hint, .issue-list > .empty-inline { margin: 12px; }
.issue-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 0.7fr);
  gap: 10px;
  align-items: center;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  cursor: pointer;
}
.issue-row:last-child { border-bottom: 0; }
.issue-row:hover { background: var(--panel-3); }
.issue-row > span:first-child:not(.issue-path) { grid-column: 1; }
.advanced-body .issue-row { grid-template-columns: minmax(0, 1fr) auto; cursor: default; }
.issue-path {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.issue-reason { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.issue-hint { margin-right: auto; font-size: 11px; color: var(--amber); }

/* Exclusion rules dialog */
.excl-h { margin: 14px 0 8px; font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.excl-h:first-child { margin-top: 0; }
.excl-preview { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.excl-preview .info-line > div { min-width: 0; }
.excl-samples { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 5px; font-size: 11px; color: var(--muted); }
.excl-samples code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.pc-tools .btn.has-rules { color: var(--accent-2); border-color: rgba(76, 224, 179, 0.4); }
.pc-actions .pc-tools { gap: 4px; }
.pc-tools .btn.icon-only { width: 28px; }

.field-grid + .field { margin-top: 12px; }
