[hidden] { display: none !important; }

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #fff7ed;
  --surface-muted: #f9fafb;
  --text: #1f2937;
  --text-strong: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --primary: #f97316;
  --primary-strong: #ea580c;
  --primary-soft: #ffedd5;
  --primary-ink: #9a3412;
  --success: #15803d;
  --success-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 12px 32px rgba(17, 24, 39, 0.06);
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06);
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 8% -10%, #ffedd5 0%, rgba(255, 237, 213, 0) 60%),
    radial-gradient(700px 360px at 100% 0%, #fef3c7 0%, rgba(254, 243, 199, 0) 55%),
    var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; color: var(--text-strong); font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 28px; }
h2 { font-size: 18px; }
p { margin: 0; }

a { color: var(--primary-strong); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--danger); min-height: 20px; font-size: 13px; }

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ── Brand ─────────────────────────────────────────────────────────────── */

.brand { display: flex; align-items: center; gap: 10px; user-select: none; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--primary), var(--primary-strong));
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.03em;
  box-shadow: 0 6px 14px rgba(249, 115, 22, 0.28);
}
.brand-word { font-weight: 800; font-size: 18px; color: var(--text-strong); letter-spacing: -0.02em; }
.brand-sub { color: var(--muted); font-size: 13px; font-weight: 600; padding-left: 2px; }
.brand-lg .brand-mark { width: 44px; height: 44px; border-radius: 13px; font-size: 17px; }
.brand-lg .brand-word { font-size: 22px; }
.brand-lg .brand-sub { font-size: 15px; }

/* ── Auth ──────────────────────────────────────────────────────────────── */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
}

.auth-brand {
  position: relative;
  overflow: hidden;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  background:
    radial-gradient(700px 400px at 15% 10%, rgba(255, 255, 255, 0.24), transparent 55%),
    linear-gradient(145deg, #fb923c 0%, #f97316 42%, #ea580c 100%);
}
.auth-brand::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -160px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 60px solid rgba(255, 255, 255, 0.1);
}
.auth-brand .brand-word, .auth-brand .brand-sub { color: #fff; }
.auth-brand .brand-sub { opacity: 0.8; }
.auth-brand h1 {
  margin: 46px 0 18px;
  color: #fff;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.auth-lead { max-width: 480px; color: rgba(255, 255, 255, 0.9); font-size: 16px; }
.auth-points {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.95);
}
.auth-points li { display: flex; align-items: center; gap: 10px; }
.point-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-card { width: 100%; max-width: 420px; padding: 34px; }
.login-card h2 { font-size: 24px; margin-bottom: 4px; }
.login-card form { margin-top: 22px; }
.btn-block { width: 100%; margin-top: 6px; }

/* ── Navbar ────────────────────────────────────────────────────────────── */

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 32px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.nav-left { display: flex; align-items: center; gap: 36px; min-width: 0; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.tab:hover { color: var(--text-strong); background: var(--surface-muted); }
.tab.active { color: var(--primary-ink); background: var(--primary-soft); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  margin-right: 4px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
}
.who { font-size: 13px; font-weight: 600; color: var(--text); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Page and cards ────────────────────────────────────────────────────── */

.page { max-width: 1220px; margin: 0 auto; padding: 36px 32px 72px; }
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.page-head h1 { font-size: 30px; }
.page-head .muted { margin-top: 6px; max-width: 640px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.tab-panel { animation: rise 180ms ease both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.layout-main {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.8fr);
  gap: 20px;
  align-items: start;
}
.stack { display: grid; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.card:last-child { margin-bottom: 0; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.card-head h2 { font-size: 17px; }
.card-head .muted { margin-top: 3px; }

.note {
  background: var(--surface-soft);
  border-color: #fed7aa;
  box-shadow: none;
}
.note strong { color: var(--primary-ink); display: block; margin-bottom: 4px; }
.note p { color: #7c2d12; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

/* ── Forms ─────────────────────────────────────────────────────────────── */

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-transform: uppercase;
}
input, select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-strong);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
input::placeholder { color: #9ca3af; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.16);
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
.span-2 { grid-column: 1 / -1; }
.field-action { display: flex; align-items: flex-end; padding-bottom: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

.dev-field {
  padding: 14px;
  border: 1px dashed #fdba74;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.dev-field input { border-color: #fdba74; }
.hint { display: block; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }

/* ── Buttons ───────────────────────────────────────────────────────────── */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 80ms ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(249, 115, 22, 0.22); }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-ink); background: var(--surface-soft); }
.btn-danger { background: var(--danger-soft); border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: #fecaca; }
.btn-soft { background: var(--primary-soft); border-color: #fed7aa; color: var(--primary-ink); }
.btn-soft:hover { background: #fed7aa; }
.btn-sm { padding: 7px 11px; font-size: 13px; border-radius: 9px; }

.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-muted); color: var(--text); }

/* ── Lists ─────────────────────────────────────────────────────────────── */

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}
.row-item:first-child { border-top: 0; padding-top: 0; }
.row-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.row-title { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--text-strong); flex-wrap: wrap; }
.row-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.empty {
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  background: var(--surface-muted);
}
.empty.compact { padding: 16px; font-size: 13px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--muted);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--success); background: var(--success-soft); border-color: #bbf7d0; }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: #fde68a; }
.badge.bad { color: var(--danger); background: var(--danger-soft); border-color: #fecaca; }
.badge.dev { color: var(--primary-ink); background: var(--primary-soft); border-color: #fed7aa; }

.summary { display: grid; gap: 10px; margin: 0; }
.summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  border: 1px solid var(--line);
}
.summary-item dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.summary-item dd { margin: 0; color: var(--text-strong); font-weight: 750; }

/* ── Logs ──────────────────────────────────────────────────────────────── */

.logs pre {
  margin: 0;
  max-height: 460px;
  overflow: auto;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid #1f2937;
  background: #111827;
  color: #e5e7eb;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Dialogs ───────────────────────────────────────────────────────────── */

dialog {
  width: calc(100% - 32px);
  max-width: 560px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(17, 24, 39, 0.25);
}
dialog::backdrop { background: rgba(17, 24, 39, 0.45); backdrop-filter: blur(2px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.cleanup-code {
  white-space: pre-wrap;
  max-height: 280px;
  overflow: auto;
  padding: 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #0f172a;
  color: #cbd5e1;
  font: 12px/1.55 "Cascadia Mono", Consolas, monospace;
  user-select: text;
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.code-box {
  margin: 18px 0 10px;
  padding: 22px;
  border: 1px dashed #fdba74;
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--primary-ink);
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-align: center;
  user-select: all;
}

/* ── Toast ─────────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: 420px;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 18px 40px rgba(17, 24, 39, 0.16);
  font-size: 14px;
  animation: toast-in 160ms ease both;
}
.toast.bad { border-color: #fecaca; color: var(--danger); background: #fff5f5; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 1040px) {
  .layout-main { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 40px 32px; }
  .auth-brand h1 { margin-top: 28px; font-size: 34px; }
  .auth-panel { padding: 28px 20px 48px; }
  .nav-left { gap: 18px; }
  .who { max-width: 130px; }
}

@media (max-width: 760px) {
  .navbar { flex-direction: column; align-items: stretch; padding: 14px 18px; gap: 12px; }
  .nav-left { flex-direction: column; align-items: flex-start; gap: 12px; }
  .nav-links { width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .tab { white-space: nowrap; }
  .nav-right { justify-content: flex-end; }
  .page { padding: 24px 18px 56px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .grid-2, .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .row-item { flex-direction: column; align-items: flex-start; }
  .row-actions { width: 100%; justify-content: flex-start; }
  .auth-points { display: none; }
}

.url-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.url-list > div { display: flex; flex-direction: column; gap: 4px; }
.url-list span { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.url-list code {
  display: block;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  word-break: break-all;
}

.github-form {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}
.github-form .btn { justify-self: start; }
.github-form label { margin-bottom: 6px; }
