:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #17201b;
  --muted: #64706a;
  --line: #d9e0dc;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --accent: #b45309;
  --danger: #b42318;
  --soft: #e9f4f1;
  --shadow: 0 16px 40px rgba(23, 32, 27, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 36%),
    linear-gradient(315deg, rgba(180, 83, 9, 0.12), transparent 32%),
    var(--bg);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar,
.stats-grid,
.workspace,
.board-header,
.split-section,
.person-card,
.room-card,
.suggestion-card {
  display: grid;
  gap: 16px;
}

.topbar {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  line-height: 1.04;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.toolbar,
.board-actions,
.form-actions,
.card-actions,
.room-members {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 8px 20px rgba(23, 32, 27, 0.06);
}

.file-button input {
  display: none;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.stat,
.entry-panel,
.board {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.stat {
  padding: 18px;
}

.stat-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
}

.stat-label,
.board-header p,
.meta,
.empty,
.room-status {
  color: var(--muted);
}

.workspace {
  grid-template-columns: 340px minmax(0, 1fr);
  align-items: start;
}

.entry-panel,
.board {
  padding: 20px;
}

.form {
  display: grid;
  gap: 14px;
}

label,
legend {
  color: #34443c;
  font-size: 0.9rem;
  font-weight: 750;
}

input[type="text"],
textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fbfcfb;
}

textarea {
  resize: vertical;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.segmented input:checked + span {
  border-color: var(--brand);
  color: var(--brand-strong);
  background: var(--soft);
}

.checkbox-line {
  display: flex;
  gap: 9px;
  align-items: center;
}

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

.primary {
  color: #fff;
  background: var(--brand);
}

.primary:hover {
  background: var(--brand-strong);
}

.secondary,
.small-button {
  border-color: var(--line);
  color: var(--ink);
  background: #fff;
}

.danger {
  color: #fff;
  background: var(--danger);
}

.board-header {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.people-list,
.rooms,
.suggestions {
  display: grid;
  gap: 10px;
}

.people-list {
  margin-bottom: 24px;
}

.last-added {
  margin: 0 0 12px;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--brand-strong);
  background: var(--soft);
  font-weight: 800;
}

.me-panel {
  display: grid;
  gap: 4px;
  margin: 0 0 12px;
  border: 1px solid rgba(180, 83, 9, 0.32);
  border-radius: 8px;
  padding: 12px;
  color: #7c2d12;
  background: #fff7ed;
}

.me-panel span {
  color: #8a5a2b;
  font-size: 0.9rem;
}

.person-card,
.room-card,
.suggestion-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.person-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.person-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 4px;
}

.person-name,
.room-title {
  margin: 0;
  font-weight: 850;
}

.meta {
  margin: 4px 0 0;
  font-size: 0.88rem;
}

.note {
  margin: 8px 0 0;
  color: #34443c;
  font-size: 0.9rem;
}

.badge-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.badge {
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--brand-strong);
  background: var(--soft);
  font-size: 0.76rem;
  font-weight: 850;
}

.badge.accent {
  color: #7c2d12;
  background: #ffedd5;
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.split-section {
  grid-template-columns: minmax(260px, 0.85fr) minmax(300px, 1.15fr);
  align-items: start;
}

.suggestion-card {
  gap: 10px;
}

.suggestion-card ul,
.room-card ul {
  margin: 0;
  padding-left: 18px;
}

.room-card.complete {
  border-color: rgba(15, 118, 110, 0.45);
}

.room-card.open {
  border-color: rgba(180, 83, 9, 0.42);
}

.room-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.room-visual {
  display: grid;
  grid-template-columns: repeat(3, 22px);
  gap: 5px;
  margin-top: 10px;
}

.request-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.request-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.bed {
  height: 18px;
  border-radius: 4px;
  border: 1px solid #bdd6d1;
  background: #dff1ed;
}

.bed.empty {
  border-style: dashed;
  background: #f6f8f7;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100% - 40px));
  transform: translateY(24px);
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  background: #17201b;
  opacity: 0;
  pointer-events: none;
  transition: 160ms ease;
}

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

dialog {
  width: min(420px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(23, 32, 27, 0.34);
}

@media (max-width: 920px) {
  .workspace,
  .split-section,
  .board-header {
    grid-template-columns: 1fr;
  }

  .board-actions {
    justify-content: stretch;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1280px);
    padding-top: 14px;
  }

  .topbar,
  .person-card {
    grid-template-columns: 1fr;
  }

  .toolbar {
    justify-content: flex-start;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .entry-panel,
  .board,
  .stat {
    padding: 14px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .entry-panel,
  .toolbar,
  .board-actions,
  .card-actions,
  .people-list,
  .suggestions {
    display: none;
  }

  .app-shell,
  .workspace,
  .split-section {
    width: 100%;
    display: block;
  }

  .board,
  .stat,
  .room-card {
    box-shadow: none;
  }
}
