/* Base resets + typography + clickable hover system */

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

html, body {
  height: 100%;
  background: var(--bg-app);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

input, select, textarea {
  font: inherit;
  color: inherit;
}

ul, ol { list-style: none; }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }

p { color: var(--text-secondary); }

/* ── Universal clickable hover / focus ── */
.is-clickable,
button:not(:disabled),
a[href],
[role="button"],
[data-action],
.btn,
.icon-btn,
.nav-item,
.menu-item,
.template-card,
.queue-row,
.toggle,
.settings-nav-item,
.palette-node,
.role-chip,
.demo-map-card,
.tab,
.filter-chip,
.allowlist-tab {
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease, outline-color 0.12s ease, opacity 0.12s ease;
}

.is-clickable:hover,
button:not(:disabled):hover,
a[href]:hover,
[role="button"]:hover,
[data-action]:hover {
  outline: 1px solid var(--accent-outline);
  outline-offset: 1px;
}

.is-clickable:focus-visible,
button:not(:disabled):focus-visible,
a[href]:focus-visible,
[role="button"]:focus-visible,
[data-action]:focus-visible,
.btn:focus-visible,
.icon-btn:focus-visible,
.nav-item:focus-visible,
.menu-item:focus-visible,
.template-card:focus-visible,
.queue-row:focus-visible,
.toggle:focus-visible,
.settings-nav-item:focus-visible,
.palette-node:focus-visible,
.demo-map-card:focus-visible,
.tab:focus-visible,
.filter-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  outline: none !important;
}

/* Soften outline on filled accent buttons (they already show hover via bg) */
.btn--primary:hover,
.btn--primary:focus-visible {
  outline-color: rgba(255, 255, 255, 0.35);
}

/* Body offset for ProtoChrome */
body.has-proto-chrome {
  padding-top: 44px;
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-accent { color: var(--accent); }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.grow { flex: 1; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
