:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e0d6;
  --card: #fffcf7;
  --accent: #1d4ed8;
  --accent-ink: #fff;
  --danger: #b91c1c;
  --ok: #047857;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", system-ui, sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, #dbeafe 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card,
.panel,
.site-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(28, 25, 23, 0.06);
}

.login-card {
  width: min(420px, 100%);
  padding: 32px 28px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 { margin: 0 0 8px; font-size: 28px; }
h2 { margin: 0 0 14px; font-size: 16px; }
.sub { margin: 0 0 22px; color: var(--muted); line-height: 1.6; }

label {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  color: #44403c;
}

input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: inherit;
}

input:focus {
  outline: 2px solid #93c5fd;
  border-color: var(--accent);
}

button {
  font: inherit;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}

button:hover { filter: brightness(1.05); }
button:disabled { opacity: 0.6; cursor: not-allowed; }
button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
button.warn { background: #9a3412; }
button.danger { background: #be123c; }
button.tiny {
  padding: 6px 10px;
  font-size: 12px;
  background: #0f172a;
}

.error {
  margin: 0 0 12px;
  color: var(--danger);
  font-size: 13px;
}

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.create { padding: 20px; margin-bottom: 20px; }
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.list { display: grid; gap: 14px; }
.site-card { padding: 18px 18px 14px; }
.site-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.site-head h3 { margin: 0; font-size: 18px; }
.slug { color: var(--muted); font-size: 13px; }

.keys {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}
.key-row {
  display: grid;
  grid-template-columns: 88px 1fr auto auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.key-row code {
  display: block;
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  white-space: nowrap;
}

.embed {
  margin-top: 12px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  overflow: auto;
  white-space: pre-wrap;
}

.actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .row,
  .key-row { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; }
}
