:root {
  color-scheme: light;
  --bg: #f5f6f1;
  --surface: #ffffff;
  --surface-2: #eef1e8;
  --line: #d7ddcf;
  --text: #20251f;
  --muted: #667064;
  --accent: #24564b;
  --accent-2: #a64231;
  --accent-soft: #e2eee9;
  --warning-soft: #f7e8df;
  --shadow: 0 12px 30px rgba(27, 35, 29, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: #fbfcf8;
}

.brand-block h1,
.workspace-header h1,
.panel h2,
.side-section h2 {
  margin: 0;
}

.brand-block h1 {
  font-size: 30px;
  line-height: 1.05;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.primary-action,
.secondary-action,
.icon-button {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 14px;
  font-weight: 800;
}

.primary-action {
  background: var(--accent);
  color: white;
}

.secondary-action {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #c8ddd4;
}

.icon-button {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line);
}

.side-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-heading,
.panel-heading,
.workspace-header,
.header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.side-section h2 {
  font-size: 16px;
}

.session-list,
.title-editor,
.item-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.session-list {
  max-height: 260px;
  overflow: auto;
}

.session-button,
.title-row,
.topic-card,
.vote-card,
.roll-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.session-button {
  display: block;
  width: 100%;
  padding: 12px;
  text-align: left;
}

.session-button strong,
.session-button span {
  display: block;
}

.session-button span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 8px;
  padding: 10px;
}

.title-row input,
.field-row input,
.date-field input,
.session-name,
.topic-card input,
.topic-card textarea,
.vote-card input,
.vote-card textarea,
.vote-card select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.title-row input,
.field-row input,
.date-field input,
.topic-card input,
.vote-card input,
.vote-card select {
  min-height: 40px;
  padding: 8px 10px;
}

.remove-button {
  width: 36px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--warning-soft);
  color: var(--accent-2);
  font-weight: 900;
}

.workspace {
  min-width: 0;
  padding: 30px clamp(18px, 4vw, 56px) 56px;
}

.workspace-header {
  margin-bottom: 22px;
  align-items: flex-end;
}

.session-name {
  max-width: 560px;
  border: 0;
  border-bottom: 2px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 4px 0 8px;
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  line-height: 1.04;
}

.date-field {
  display: grid;
  gap: 4px;
  min-width: 160px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.panel {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel h2 {
  font-size: 22px;
}

.stat-pill {
  min-width: 96px;
  border-radius: 8px;
  padding: 9px 12px;
  background: var(--surface-2);
  color: var(--accent);
  font-weight: 900;
  text-align: center;
}

.roll-call {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.roll-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(280px, 2fr);
  gap: 14px;
  padding: 12px;
}

.roll-title {
  display: flex;
  align-items: center;
  font-weight: 900;
}

.roll-controls {
  display: grid;
  gap: 10px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.segmented button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 800;
}

.segmented button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.field-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.field-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.topic-card,
.vote-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.card-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.vote-topline {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 10px;
}

textarea {
  min-height: 110px;
  padding: 10px;
  resize: vertical;
}

.ballot-list {
  display: grid;
  gap: 8px;
}

.ballot-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 180px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-2);
}

.voter-name {
  font-weight: 900;
}

.voter-title {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.aye-nay {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.aye-nay button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
}

.aye-nay button.active.aye {
  background: #dfeee2;
  color: #1d5a32;
  border-color: #9fc7aa;
}

.aye-nay button.active.nay {
  background: #f4dfd9;
  color: #973d2d;
  border-color: #d4a195;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(440px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #1f2a24;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace-header,
  .header-actions,
  .roll-row,
  .vote-topline,
  .ballot-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .workspace-header,
  .header-actions {
    flex-direction: column;
  }

  .session-name {
    max-width: 100%;
  }
}

@media (max-width: 560px) {
  .workspace,
  .sidebar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .panel {
    padding: 14px;
  }

  .segmented,
  .field-row {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }
}
