:root {
  --bg: #eef3f8;
  --panel: #ffffff;
  --panel-soft: #f7fafc;
  --line: #d9e2ec;
  --text: #102033;
  --muted: #607086;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --green: #0f9f6e;
  --green-bg: #e9f8f1;
  --red: #dc2626;
  --red-bg: #fff0f0;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at top left, #ffffff 0, #eef3f8 42%, #e6edf5 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

.topbar {
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  background: rgba(255,255,255,0.84);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  font-weight: 800;
  font-size: 20px;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.bolt { margin-right: 7px; }

.label {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--panel-soft);
}

.shell {
  width: min(860px, calc(100% - 28px));
  margin: 46px auto;
}

.card, .admin-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.card {
  padding: 30px;
}

.loading-card, .empty-card, .done-card {
  text-align: center;
  padding: 56px 30px;
}

h1, h2 { margin: 0; }

h1 {
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.05;
  margin-top: 6px;
}

h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.muted {
  color: var(--muted);
}

.error {
  color: var(--red);
}

.project-strip {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--accent);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 6px 11px;
  font-weight: 700;
  font-size: 13px;
}

.step {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.step.compact { border-bottom: 0; }

.badge {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #dbeafe;
  color: var(--accent-dark);
  font-weight: 900;
}

.step-title {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 7px;
}

.target-label {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  word-break: break-word;
}

.target-label:hover { text-decoration: underline; }

.copy-box {
  white-space: pre-wrap;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  color: var(--text);
  line-height: 1.55;
}

.primary-btn, .secondary-btn, .danger-btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.08s ease, background 0.08s ease;
}

.primary-btn {
  width: 100%;
  margin-top: 22px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
}

.primary-btn:hover { background: var(--accent-dark); }

.secondary-btn {
  background: #e8eef6;
  color: var(--text);
  border: 1px solid var(--line);
}

.danger-btn {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid #fecaca;
}

.primary-btn:active, .secondary-btn:active, .danger-btn:active { transform: translateY(1px); }

.proof-area {
  margin-top: 20px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 4px 18px 18px;
}

.hidden { display: none; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  padding: 12px 13px;
  font: inherit;
}

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

#proofUrl { margin: 8px 0 12px; }

.status-line {
  min-height: 24px;
  margin: 14px 4px 0;
  color: var(--green);
  font-weight: 700;
}

.status-line.error { color: var(--red); }

.code {
  display: inline-block;
  margin-top: 10px;
  padding: 18px 24px;
  border-radius: 18px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.admin-shell {
  width: min(1180px, calc(100% - 28px));
}

.admin-panel {
  padding: 22px;
  margin-bottom: 18px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-grid .admin-panel { margin-bottom: 0; }

.wide { margin-top: 18px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

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

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

#workerLinks {
  min-height: 190px;
  margin-top: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.stats-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
}

.stats-row strong { color: var(--text); }

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

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--panel-soft);
}

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
  background: #e8eef6;
  color: var(--muted);
}

.pill.OPEN { background: #eff6ff; color: #1d4ed8; }
.pill.RESERVED { background: #fff7ed; color: #c2410c; }
.pill.DONE { background: var(--green-bg); color: var(--green); }

code {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
}

@media (max-width: 780px) {
  .topbar { padding: 0 14px; }
  .admin-grid, .form-row { grid-template-columns: 1fr; }
  .card { padding: 22px; }
  .shell { margin: 26px auto; }
}

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

.small-btn {
  padding: 8px 12px;
  font-size: 13px;
}

.login-panel {
  max-width: 720px;
  margin: 60px auto 0;
}

.compact-panel {
  padding-top: 18px;
  padding-bottom: 18px;
}

.no-margin {
  margin-top: 0 !important;
}
