:root {
  color-scheme: light;
  --bg: #f5f7f9;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #657386;
  --line: #d9e0e7;
  --accent: #167c80;
  --accent-dark: #0d5558;
  --danger: #a23b3b;
  --shadow: 0 18px 50px rgba(24, 36, 48, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  background: var(--bg);
  color: var(--ink);
}

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

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

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.sidebar {
  min-height: 100vh;
  padding: 28px;
  display: grid;
  align-content: start;
  gap: 22px;
  border-right: 1px solid var(--line);
  background: #eef3f5;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.1;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.2rem;
}

h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.panel,
.room-view {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

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

.workspace {
  min-width: 0;
  padding: 24px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
}

.room-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.room-tab {
  flex: 0 0 260px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.room-tab.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(22, 124, 128, 0.18);
}

.room-view {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.room-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.room-header p {
  color: var(--muted);
}

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

.conversation {
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr auto;
}

.messages {
  overflow: auto;
  padding: 20px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.message {
  max-width: 760px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.message-meta,
.delivery-row,
.audit-row,
.member-row,
.provider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.message-meta {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.message-body {
  margin-bottom: 10px;
  line-height: 1.45;
}

.delivery-list {
  display: grid;
  gap: 6px;
}

.delivery-row,
.audit-row,
.member-row,
.provider-row {
  min-height: 32px;
  padding: 7px 9px;
  border-radius: 6px;
  background: #eef3f5;
  font-size: 0.82rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e4f4f2;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.message-form {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 110px;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #f9fbfc;
}

.details {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 20px;
  border-left: 1px solid var(--line);
  background: #f9fbfc;
}

.provider-list,
.member-list,
.call-list,
.audit-list,
.check-list {
  display: grid;
  gap: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
}

.check-row input {
  width: auto;
}

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

.call-links {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.call-links a {
  color: var(--accent-dark);
  overflow-wrap: anywhere;
}

.audit-row {
  display: grid;
  align-items: start;
  gap: 4px;
}

.hash {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  body {
    display: block;
  }

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

  .columns,
  .message-form {
    grid-template-columns: 1fr;
  }

  .details {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .room-header {
    display: grid;
  }
}
