:root {
  --bg: #0f1115;
  --card: #171a21;
  --line: #2a2f3a;
  --text: #e6e8ee;
  --muted: #8b93a7;
  --accent: #4f8cff;
  --accent2: #3a6fd8;
  --danger: #ff5c5c;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, Segoe UI, Roboto, sans-serif; }
a { color: var(--accent); }
header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
header h1 { font-size: 20px; margin: 0; }
.hdr-right { display: flex; gap: 12px; align-items: center; }
main { max-width: 980px; margin: 0 auto; padding: 16px 20px 40px; display: grid; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.gate { max-width: 640px; margin: 40px auto; }
.hidden { display: none !important; }
label { font-weight: 600; }
textarea, input[type=text], input[type=password], select {
  width: 100%; background: #0c0e12; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: inherit;
}
textarea { resize: vertical; margin: 6px 0 10px; }
select { width: auto; min-width: 280px; }
.row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.row.wrap { flex-wrap: wrap; }
.row.gap { gap: 12px; }
.row.end { justify-content: flex-end; }
.row > input[type=text], .row > input[type=password] { flex: 1; }
#iconName { max-width: 220px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.brand { display: inline-flex; align-items: center; gap: 4px; }
.hex { width: 90px !important; flex: none !important; font-family: ui-monospace, Consolas, monospace; }
.swatch { display: inline-block; width: 20px; height: 20px; border-radius: 4px; border: 1px solid var(--line); margin-right: 8px; }
button { background: #232834; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px 14px; font: inherit; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent2); color: #fff; }
button.primary:hover:not(:disabled) { background: var(--accent2); }
button.big { padding: 10px 26px; font-size: 16px; }
button.ghost { background: transparent; }
.clock { font-family: ui-monospace, Consolas, monospace; color: var(--muted); min-width: 4ch; }
.status { color: var(--muted); }
.status.err { color: var(--danger); }
.nudges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.nudges button { padding: 4px 10px; font-size: 13px; }
.muted { color: var(--muted); font-size: 13px; }
.preview-main { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.checker {
  width: 256px; height: 256px; border: 1px solid var(--line); border-radius: 6px;
  background-color: #ccc;
  background-image: linear-gradient(45deg, #999 25%, transparent 25%), linear-gradient(-45deg, #999 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #999 75%), linear-gradient(-45deg, transparent 75%, #999 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.checker canvas { display: block; }
.strips { display: flex; flex-direction: column; gap: 12px; }
.strip { display: flex; align-items: flex-end; gap: 14px; padding: 12px 16px; border-radius: 6px; min-height: 64px; min-width: 260px; }
.strip.light { background: #f3f3f3; }
.strip.dark { background: #202020; }
.strip canvas { image-rendering: pixelated; display: block; }
.strip .lbl { font-size: 11px; color: #888; text-align: center; }
.sizes .chk { font-family: ui-monospace, Consolas, monospace; }
dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 10px; width: min(600px, 92vw); padding: 20px; }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h2 { margin-top: 0; }
footer { padding: 18px 20px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; font-size: 13px; }
footer a { color: var(--accent); text-decoration: none; }
/* Tip links: outlined pills, matching dirtsimple.app, in this app's theme. */
.tip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tip a { border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; }
.tip a:hover { border-color: var(--accent); background: var(--card); }
@media (max-width: 600px) {
  .preview-main { justify-content: center; }
  select { min-width: 0; width: 100%; }
}
