:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #20231f;
  --muted: #687064;
  --line: #dfe4dc;
  --accent: #2f6f61;
  --accent-dark: #204f46;
  --soft: #edf4f1;
  --warn: #8a4f12;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  background: #25332f;
  color: white;
}

h1 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

.sidebar p {
  margin: 0;
  color: #d8e5df;
  line-height: 1.5;
}

.quick {
  display: grid;
  gap: 10px;
}

.quick button {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  color: white;
  cursor: pointer;
  text-align: left;
  padding: 10px 12px;
}

.quick button:hover {
  background: rgba(255, 255, 255, 0.15);
}

.chat {
  display: grid;
  grid-template-rows: 1fr auto;
  min-width: 0;
  min-height: 100vh;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  overflow: auto;
}

.message {
  max-width: 780px;
  border-radius: 8px;
  padding: 14px 16px;
  line-height: 1.5;
  border: 1px solid var(--line);
  background: var(--panel);
}

.message.user {
  align-self: flex-end;
  border-color: transparent;
  background: var(--accent);
  color: white;
}

.message.assistant {
  align-self: flex-start;
}

.message.error {
  border-color: #e7c99c;
  color: var(--warn);
}

.details {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.detail-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 8px;
  font-size: 14px;
}

.detail-row span:first-child {
  color: var(--muted);
}

.room-cards {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.room-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
}

.room-card-title {
  font-weight: 800;
  margin-bottom: 3px;
}

.room-card-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.occupants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.occupant {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  padding: 4px 9px;
  font-size: 13px;
}

.occupant.matched {
  border-color: rgba(47, 111, 97, 0.28);
  background: var(--soft);
  color: var(--accent-dark);
  font-weight: 800;
}

.confirm-box {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
}

.confirm-line {
  font-size: 14px;
  color: var(--ink);
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.confirm-actions button {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 700;
}

.confirm-actions button:disabled {
  cursor: default;
  opacity: 0.6;
}

.confirm-button {
  border: 0;
  background: var(--accent);
  color: white;
}

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

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 10px;
  padding: 18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
}

.composer input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: white;
  color: var(--ink);
  outline: none;
}

.composer input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--soft);
}

.composer button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

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

.composer button:disabled {
  cursor: wait;
  opacity: 0.7;
}

@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    padding: 18px;
  }

  .quick {
    grid-template-columns: 1fr;
  }

  .chat {
    min-height: calc(100vh - 232px);
  }

  .messages {
    padding: 16px;
  }

  .composer {
    grid-template-columns: 1fr;
  }
}
