/* Mise UI tokens + shared chrome for Preference Polls */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
  --ink: #0a0a0a;
  --ink-2: #52525b;
  --ink-3: #9b9ba3;
  --line: #e8e8ea;
  --line-2: #f2f2f4;
  --canvas: #f6f6f7;
  --accent: #2563eb;
  --warn: #b42318;

  /* Back-compat aliases used by page styles */
  --bg: var(--canvas);
  --panel: #ffffff;
  --border: var(--line);
  --text: var(--ink);
  --muted: var(--ink-2);

  /* Row selection on poll media — accent-forward, lightly varied */
  --row0: #2563eb;
  --row1: #1d4ed8;
  --row2: #3b82f6;
  --row3: #0a0a0a;
  --row4: #52525b;
  --row5: #2563eb;
  --row6: #1d4ed8;
  --row7: #3b82f6;

  /* Classic featured poll keeps category identity on the chart */
  --coffee: #2563eb;
  --bread: #0a0a0a;
  --steak: #52525b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

::selection {
  background: var(--ink);
  color: #fff;
}

a { color: inherit; }

.topnav a,
.nav-link {
  color: var(--ink-3);
  font-size: 12px;
  text-decoration: none;
}
.topnav a:hover,
.nav-link:hover {
  color: var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--ink);
  position: relative;
  flex-shrink: 0;
}
.brand-mark::after {
  content: "";
  position: absolute;
  top: 1.5px;
  left: 1.5px;
  width: 1.5px;
  height: 1.5px;
  border-radius: 50%;
  background: #fff;
}

.eyebrow {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.btn-primary,
button.submit,
.generate,
.create {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary:hover,
button.submit:hover:not(:disabled),
.generate:hover:not(:disabled),
.create:hover {
  opacity: 0.85;
}
.btn-primary:disabled,
button.submit:disabled,
.generate:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-ghost,
button.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn-ghost:hover,
button.ghost:hover {
  border-color: var(--ink-3);
}
.btn-ghost:disabled,
button.ghost:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--line);
}

.chip {
  background: var(--line-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--ink-2);
}
.chip strong {
  color: var(--ink);
  margin-left: 5px;
  font-weight: 600;
}
.chip.done,
.chip.done-coffee,
.chip.done-bread,
.chip.done-steak {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, #fff);
  color: var(--ink);
}

.field,
.controls input,
.revise input {
  background: color-mix(in srgb, var(--line-2) 60%, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  padding: 8px 12px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
}
@media (min-width: 640px) {
  .field,
  .controls input,
  .revise input {
    font-size: 13px;
  }
}
.field:focus,
.controls input:focus,
.revise input:focus {
  border-color: var(--ink-3);
  background: #fff;
}
.field::placeholder,
.controls input::placeholder,
.revise input::placeholder {
  color: var(--ink-3);
}

.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  display: none;
  z-index: 20;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.35);
  animation: rise-center 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.toast.ok {
  display: block;
  color: var(--ink);
}
.toast.err {
  display: block;
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 30%, var(--line));
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rise-center {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.animate-rise {
  animation: rise 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.spin {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 10px;
  border: 1.5px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -3px;
}

.hidden { display: none !important; }
