:root {
  --ink: #1d2433;
  --muted: #5b6475;
  --line: #d9dde5;
  --paper: #ffffff;
  --page: #f4f6f9;
  --accent: #1f5fbf;
  --alert: #a3281f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 600;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  /* A name with no blanks, in a title or in a card, wraps instead of widening the page. */
  overflow-wrap: anywhere;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.alert {
  border-left: 4px solid var(--alert);
  background: var(--paper);
  padding: 0.75rem 1rem;
  color: var(--alert);
}

.note {
  color: var(--muted);
}

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

.button,
button.choice {
  display: block;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 0.5rem;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

button.choice {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
  text-align: left;
}

button.choice small {
  display: block;
  color: var(--muted);
}

button.link {
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li {
  margin-bottom: 0.5rem;
}

.signout {
  margin: 0;
}

.plain {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

/* The inbox: the filters, one card for each conversation, and the conversation itself. */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filters a {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}

.filters a.on {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.count {
  color: var(--muted);
}

.inbox {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.inbox li {
  margin-bottom: 0.5rem;
}

.conv {
  display: block;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}

.conv .line {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.conv .line strong {
  min-width: 0;
}

.conv time {
  color: var(--muted);
  white-space: nowrap;
}

.preview {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.by {
  font-weight: 600;
}

.state {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.1rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.85rem;
  background: var(--page);
  color: var(--muted);
}

.state-paused {
  background: #fbe9e7;
  color: var(--alert);
}

.state-human {
  background: #e4eefb;
  color: var(--accent);
}

.thread {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.msg {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--paper);
}

.msg.assistant {
  background: #e4eefb;
  border-color: #c5d8f3;
}

.msg .head {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* What a customer wrote is shown as written: its line breaks stay, and a long word wraps. */
.msg .body {
  margin: 0.25rem 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.kind {
  color: var(--muted);
  font-style: italic;
}

/* What a person does in a conversation: the notice, the buttons, the messages that did not go out
   and the box to write in. */
.notice {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--accent);
  background: var(--paper);
}

.notice.error {
  border-left-color: var(--alert);
  color: var(--alert);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.actions form {
  margin: 0;
}

button.act {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 0.5rem;
  background: var(--paper);
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}

.msg.team {
  background: #eaf6ec;
  border-color: #c4e3c9;
}

.waiting {
  list-style: none;
  margin: 0;
  padding: 0;
}

.waiting li {
  margin-bottom: 0.75rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--line);
}

.waiting li.problem {
  border-left-color: var(--alert);
}

.waiting .head {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.waiting .body {
  margin: 0.25rem 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.waiting .note {
  margin: 0.25rem 0 0;
}

.composer label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.composer textarea {
  display: block;
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  font: inherit;
  resize: vertical;
}

/* What a person wrote that could not be sent, so that they can copy it: as written. */
.draft {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* The calendar: a table by month, one row for each lodging and one column for each day. The state
   of a day is a letter and a color, never the color alone. The table moves sideways in its box. */
.months {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
}

.agenda-scroll {
  overflow-x: auto;
  margin: 0 0 0.75rem;
  border: 1px solid var(--line);
  background: var(--paper);
}

table.agenda {
  border-collapse: collapse;
  font-size: 0.8rem;
}

table.agenda th,
table.agenda td {
  min-width: 1.7rem;
  padding: 0.2rem 0.25rem;
  border: 1px solid var(--line);
  text-align: center;
}

table.agenda th[scope="row"] {
  position: sticky;
  left: 0;
  min-width: 6rem;
  background: var(--paper);
  text-align: left;
  white-space: nowrap;
}

table.agenda .wd {
  display: block;
  color: var(--muted);
  font-weight: 400;
}

table.agenda th.weekend {
  background: #f1f3f7;
}

table.agenda th.today {
  outline: 2px solid var(--accent);
}

.res,
.hold,
.block,
.ext,
.hours,
.clean,
.stale {
  font-weight: 600;
}

.res {
  background: #cde8d3;
}

.hold {
  background: #fbe8b0;
}

.block {
  background: #d8dbe0;
}

.ext {
  background: #d3e2f6;
}

.hours {
  background: #e6d6f0;
}

.clean {
  background: #f3e3d3;
}

.stale {
  background: #f1d4d1;
}

.off {
  color: var(--muted);
  font-weight: 400;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}

.swatch {
  display: inline-block;
  min-width: 1.4rem;
  padding: 0 0.3rem;
  border: 1px solid var(--line);
  text-align: center;
}

.stays {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stays li {
  margin-bottom: 0.75rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--line);
}

.stays .head,
.stays .body,
.stays .note {
  margin: 0;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.stays li.problem {
  border-left-color: var(--alert);
}

.stays .note.problem {
  color: var(--alert);
}

.stays details {
  margin-top: 0.5rem;
}

.stays h3 {
  margin: 0.75rem 0 0.25rem;
  font-size: 1rem;
}

.attempts {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stays summary {
  cursor: pointer;
  font-weight: 600;
}

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

.settle label {
  font-weight: 600;
}

.settle input[type="text"],
.settle input[type="date"],
.settle input[type="number"],
.settle select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  font: inherit;
}

.settle button.act {
  justify-self: start;
}

.settle fieldset {
  margin: 0.25rem 0;
  padding: 0;
  border: 0;
}

.settle legend {
  padding: 0;
  font-weight: 600;
}

.settle fieldset label {
  display: block;
  font-weight: normal;
}

/* The rates of a lodging: the forms fold away inside the card, and the days of the week are boxes
   side by side. */
.rates details {
  margin-top: 0.5rem;
}

.rates summary {
  cursor: pointer;
  font-weight: 600;
}

.settle fieldset.days {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.settle fieldset.days label {
  display: inline-block;
}
