/* Layout: two columns — left = input + "người thấy / mèo thấy" preview, right = ranked list. Single dark theme so swatches read against a neutral night surround. */
:root {
  --bg: #17151f;
  --panel: #221f2e;
  --line: #34304a;
  --ink: #f1eff7;
  --muted: #a6a1bd;
  --accent: #f2b33d;
  --good: #2e9e7a;
  --ok: #7fc6ad;
  --weak: #e6b75a;
  --bad: #e0605a;
  --display: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 20px 48px; display: grid; gap: 22px; }
header h1 { font-family: var(--display); font-weight: 800; font-size: clamp(24px, 3.4vw, 34px); line-height: 1.15; margin: 0 0 6px; text-wrap: balance; }
header h1 .eye { color: var(--accent); }
header p { margin: 0; color: var(--muted); max-width: 68ch; }

.grid { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 22px; align-items: start; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 14px; }
.card h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; font-weight: 700; }

.inputrow { display: flex; gap: 10px; align-items: stretch; }
.inputrow input[type=color] { width: 56px; height: 52px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: none; cursor: pointer; flex: none; }
.inputrow input[type=color]::-webkit-color-swatch-wrapper { padding: 4px; }
.inputrow input[type=color]::-webkit-color-swatch { border: none; border-radius: 6px; }
.hexfield { flex: 1; display: flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; }
.hexfield span { color: var(--muted); font-size: 20px; font-weight: 600; }
.hexfield input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--ink); font: 600 22px/1 var(--body); letter-spacing: .06em; padding: 12px 6px; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.hexfield input:focus { outline: none; }
.hexfield:focus-within { border-color: var(--accent); }
.err { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: -6px; }

.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.presets button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); cursor: pointer; padding: 0; }
.presets button[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.presets button:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ease { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 4px 11px; }
.pill.A { background: var(--good); color: #fff; }
.pill.B { background: var(--ok); color: #17151f; }
.pill.C { background: var(--weak); color: #17151f; }
.pill.D { background: var(--bad); color: #fff; }
.ease small { color: var(--muted); font-size: 13px; }

.views { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.view { border-radius: 10px; min-height: 150px; padding: 10px; display: grid; grid-template-rows: auto 1fr; border: 1px solid rgba(255,255,255,.12); }
.view .lbl { font-size: 12px; font-weight: 700; }
.dots { display: flex; flex-wrap: wrap; gap: 8px; align-content: center; justify-content: center; }
.dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }

.list { display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: 26px 44px 1fr 150px auto; gap: 12px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.row .n { font-weight: 800; color: var(--accent); font-size: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.pair { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.12); }
.pair i { width: 22px; height: 22px; border-radius: 50%; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.who b { display: block; font-size: 15px; }
.who small { color: var(--muted); font-size: 13px; display: block; }
.score { display: grid; gap: 4px; }
.score .bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.score .bar span { display: block; height: 100%; border-radius: 99px; }
.score .num { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; }
.copy { background: transparent; border: 1px solid var(--line); color: var(--ink); border-radius: 8px; padding: 6px 10px; font: 600 13px var(--body); cursor: pointer; font-variant-numeric: tabular-nums; white-space: nowrap; }
.copy:hover { border-color: var(--accent); }
@media (max-width: 560px) {
  .row { grid-template-columns: 22px 44px 1fr; }
  .row .score, .row .copy { grid-column: 2 / -1; }
}

.avoid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 5px; font-size: 13px; }
.chip i { width: 18px; height: 18px; border-radius: 50%; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.chip em { font-style: normal; color: var(--bad); font-weight: 700; font-variant-numeric: tabular-nums; }

.check { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; }
.checkres { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.checkres .big { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }

.note { color: var(--muted); font-size: 13px; max-width: 80ch; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #17151f; font-weight: 700; padding: 8px 16px; border-radius: 999px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
