:root {
  --bg: #e8eef2;
  --bg-deep: #1a3a4a;
  --surface: #f7fafb;
  --ink: #142028;
  --muted: #5a6b75;
  --accent: #c45c26;
  --accent-hover: #a34a1c;
  --line: #c8d4dc;
  --ok: #2d6a4f;
  --warn: #b8860b;
  --radius: 6px;
  --font: 'IBM Plex Sans', system-ui, sans-serif;
  --display: 'Literata', Georgia, serif;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(165deg, #dfe9ef 0%, var(--bg) 40%, #d4e0e8 100%);
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  margin: 0 0 0.5rem;
}

a {
  color: var(--accent);
}

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

button {
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  padding: 0.55rem 1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
}

button:hover {
  background: var(--accent-hover);
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

button.ghost:hover {
  background: var(--surface);
}

button.small {
  padding: 0.35rem 0.65rem;
  font-size: 0.875rem;
}

.layout {
  max-width: 920px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 1.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}

.brand {
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--bg-deep);
  letter-spacing: -0.02em;
}

.brand span {
  display: block;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.nav button {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 0.4rem 0.75rem;
}

.nav button.active {
  color: var(--bg-deep);
  border-color: var(--line);
  background: var(--surface);
}

.nav button:hover {
  color: var(--ink);
  background: var(--surface);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.panel h2 {
  font-size: 1.15rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.stat {
  padding: 0.75rem 0;
  border-top: 2px solid var(--accent);
}

.stat strong {
  display: block;
  font-size: 1.5rem;
  font-family: var(--display);
}

.form-grid {
  display: grid;
  gap: 0.75rem;
  max-width: 480px;
}

label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

input,
select,
textarea {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.list-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.list-item:last-child {
  border-bottom: none;
}

.vote-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
}

.vote-bar .tally {
  font-size: 0.85rem;
  color: var(--muted);
  margin-left: auto;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  background: #dce8ee;
  color: var(--bg-deep);
}

.badge.closed {
  background: #eee;
  color: var(--muted);
}

.badge.admin {
  background: #fde8dc;
  color: var(--accent-hover);
}

.error {
  color: #9b2226;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.login-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: linear-gradient(145deg, var(--bg-deep) 0%, #2a5568 55%, #4a7a8c 100%);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  padding: 2rem 1.75rem;
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.login-card .brand {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.share-grid {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

@media (max-width: 600px) {
  .brand-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .vote-bar .tally {
    margin-left: 0;
    width: 100%;
  }
}
