:root {
  --bg: #f3f4f7;
  --panel: #ffffff;
  --ink: #141820;
  --ink-2: #3a404b;
  --muted: #6b7280;
  --line: #e3e6ec;
  --line-strong: #d5d9e1;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #e8efff;
  --focus: #3b82f6;
  --danger: #c0352b;
  --ok: #1d7a46;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14.5px/1.55 system-ui, -apple-system, "Segoe UI", Inter, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1 { font-size: 22px; letter-spacing: -0.01em; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 0 0 14px; }
.lead { color: var(--muted); margin: 0 0 22px; max-width: 760px; }
code, pre { font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* bar */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 20px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; color: var(--ink); text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.nav a { padding: 7px 11px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 13.5px; }
.nav a:hover { background: #eef1f5; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.who { display: flex; gap: 6px; align-items: center; }
.who form { margin: 0; }

.page { max-width: 1000px; margin: 0 auto; padding: 28px 20px 64px; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: 0 10px 30px rgba(15, 23, 42, .08); }
.auth .brand { margin-bottom: 18px; }

/* cards and forms */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 8px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.card > p.help:first-of-type { margin-top: -6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .k { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 650; margin-top: 4px; }
.stat .s { font-size: 12.5px; color: var(--muted); }
.good { color: var(--ok); }
.bad { color: var(--danger); }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 550; color: var(--ink-2); margin-bottom: 6px; }
label.field > small, .help { display: block; font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.help { margin: 0 0 14px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
input, select, textarea { width: 100%; font: inherit; color: inherit; border: 1px solid var(--line-strong); background: #fff; border-radius: 8px; padding: 8px 11px; min-height: 38px; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
textarea.tall { min-height: 260px; }
textarea.code { font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(59, 130, 246, .18); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; min-height: 0; accent-color: var(--accent); margin: 0; }
input[type=color] { padding: 3px; height: 38px; cursor: pointer; }
input[type=file] { padding: 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; margin: 0 16px 14px 0; font-size: 13.5px; cursor: pointer; }

button, .button { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 550; font-size: 13.5px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: #f4f6f9; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent-hover); }
button.ghost, .button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover, .button.ghost:hover { background: #eef1f5; }
button.danger { color: var(--danger); }
button.danger:hover { background: #fdf1f0; border-color: #f2c4bf; }
button.small { padding: 4px 9px; font-size: 12.5px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 16px; }
.sticky-actions { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%); display: flex; gap: 8px; }

.flash { background: #e9f7ef; color: var(--ok); border: 1px solid #bfe6cf; padding: 10px 14px; border-radius: 10px; margin: 0 0 18px; }
.flash.error { background: #fdf1f0; color: var(--danger); border-color: #f2c4bf; }

/* repeating items */
.item { border: 1px solid var(--line); border-radius: 10px; padding: 14px 14px 2px; margin-bottom: 12px; background: #fbfcfd; }
.item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.item-head .num { width: 26px; height: 26px; border-radius: 7px; background: #eef1f5; color: var(--muted); font-size: 12px; font-weight: 650; display: grid; place-items: center; flex: none; }
.item-head .grow { flex: 1; }
.item-head .key { font-size: 12px; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 4px 0; margin-bottom: 12px; }

/* look */
.media { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.slot { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 12px; background: #fff; }
.slot b { display: block; font-size: 13px; }
.slot small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.slot .thumb { height: 96px; display: grid; place-items: center; background: repeating-conic-gradient(#f1f3f6 0 25%, #fff 0 50%) 0 0 / 14px 14px; border-radius: 8px; margin-bottom: 8px; }
.slot .thumb img { max-height: 90px; max-width: 100%; }
.slot .none { color: var(--muted); font-size: 12px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 14px; }

pre.snippet { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 10px; overflow-x: auto; margin: 0 0 14px; }
table.list { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
table.list th, table.list td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
table.list th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

@media (max-width: 720px) {
  .who { width: 100%; justify-content: flex-end; }
}
.spaced { margin-top: 16px; }
.default-submit { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
