/* Helpy pages. One small sheet, light and dark, no external resources. */

:root {
  color-scheme: light dark;
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #646c78;
  --line: #e2dfd9;
  --accent: #2b5fc7;
  --accent-text: #ffffff;
  --ok-bg: #e4f3e8;
  --ok-text: #1c6b3a;
  --wait-bg: #eeedf0;
  --wait-text: #4d5562;
  --busy-bg: #e3edfb;
  --busy-text: #214f9e;
  --warn-bg: #fdf3d3;
  --warn-text: #6a4a00;
  --warn-line: #e6cc7a;
  --bad-bg: #fce8e6;
  --bad-text: #9a2118;
  --bad-line: #eeb1ab;
  --me: #2b5fc7;
  --others: #8046b5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1d2024;
    --text: #e4e6ea;
    --muted: #9aa2ae;
    --line: #30343a;
    --accent: #86aef5;
    --accent-text: #10141a;
    --ok-bg: #173323;
    --ok-text: #8fd6a6;
    --wait-bg: #2a2d33;
    --wait-text: #b4bbc6;
    --busy-bg: #1a2c4a;
    --busy-text: #a4c3f7;
    --warn-bg: #3a2f10;
    --warn-text: #efd58a;
    --warn-line: #6b5720;
    --bad-bg: #41201d;
    --bad-text: #f5aaa3;
    --bad-line: #7a3530;
    --me: #86aef5;
    --others: #c59af0;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.top,
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

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

.brand {
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
}

main {
  padding-top: 8px;
  padding-bottom: 64px;
}

h1 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 20px 0 16px;
  overflow-wrap: anywhere;
}

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

p {
  margin: 0 0 12px;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

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

.back {
  margin: 16px 0 0;
  font-size: 0.92rem;
}

/* Buttons and forms. */

button,
.button {
  display: inline-block;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.3;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

button[type="submit"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

button.plain {
  background: none;
  border-color: transparent;
  color: var(--muted);
  padding: 4px 6px;
}

button:hover,
.button:hover {
  filter: brightness(0.97);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.login {
  max-width: 380px;
  margin: 32px auto 0;
}

.login label {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.login input {
  display: block;
  width: 100%;
  font: inherit;
  padding: 9px 11px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.login button {
  margin-bottom: 18px;
}

.login.wide {
  margin: 0;
}

/* The header link to the account and the table of logged in devices. */

.top .me {
  margin-left: auto;
  margin-right: 10px;
  font-size: 0.92rem;
}

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

.devices li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.devices p {
  margin: 0;
  overflow-wrap: anywhere;
}

.devices .device {
  font-weight: 600;
}

.devices form {
  margin: 0;
  flex: none;
}

.devices .buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex: none;
}

/* The people page: the invite form and a link or password that is shown once. */

.top .me a {
  margin-left: 12px;
}

.invite label {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.invite .row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.invite input[type="text"] {
  flex: 1 1 220px;
  font: inherit;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.secret {
  padding: 4px 14px 10px;
  margin: 0 0 8px;
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--warn-text);
}

.secret h2 {
  margin-top: 12px;
}

.secret .muted {
  color: inherit;
}

.secret code {
  font: 0.95rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
  user-select: all;
}

/* Notices and state badges. */

.notice {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow-wrap: anywhere;
}

.notice.warn,
.notice.wait {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn-text);
}

.notice.ok {
  background: var(--ok-bg);
  border-color: transparent;
  color: var(--ok-text);
}

.notice.bad {
  background: var(--bad-bg);
  border-color: var(--bad-line);
  color: var(--bad-text);
}

.state {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 0.85rem;
  white-space: nowrap;
  background: var(--wait-bg);
  color: var(--wait-text);
}

.state.ok {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.state.busy {
  background: var(--busy-bg);
  color: var(--busy-text);
}

.state.bad {
  background: var(--bad-bg);
  color: var(--bad-text);
}

/* Server status above the list. */

.status {
  margin-bottom: 20px;
}

.statusline {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.95rem;
}

.statusline .key {
  color: var(--text);
  font-weight: 600;
  margin-right: 6px;
}

/* List of recordings. */

table.recordings {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.recordings th {
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 6px 10px 6px 0;
  border-bottom: 1px solid var(--line);
}

.recordings td {
  padding: 10px 10px 10px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.recordings .when {
  white-space: nowrap;
}

.recordings .source {
  overflow-wrap: anywhere;
}

.recordings .num {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pager {
  display: flex;
  gap: 18px;
  margin-top: 18px;
}

/* One recording. */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px 20px;
  margin: 0 0 18px;
}

.facts dt {
  font-size: 0.82rem;
  color: var(--muted);
}

.facts dd {
  margin: 2px 0 0;
}

audio {
  display: block;
  width: 100%;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
}

.actions form {
  margin: 0;
}

.revisions ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.revisions li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.revisions li.selected a {
  font-weight: 650;
  color: var(--text);
  text-decoration: none;
}

.revisions .muted {
  margin-left: 8px;
  font-size: 0.88rem;
}

.tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: var(--ok-bg);
  color: var(--ok-text);
}

/* Transcript. */

.meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.turns {
  margin-top: 20px;
}

.turn {
  margin: 0 0 16px;
  padding-left: 12px;
  border-left: 3px solid var(--line);
}

.turn.me {
  border-left-color: var(--me);
}

.turn.others {
  border-left-color: var(--others);
}

.who {
  margin: 0 0 2px;
  font-size: 0.85rem;
  color: var(--muted);
}

.who .label {
  font-weight: 650;
  color: var(--text);
}

.turn.me .label {
  color: var(--me);
}

.turn.others .label {
  color: var(--others);
}

.who .at {
  font-variant-numeric: tabular-nums;
}

.said {
  margin: 0;
  overflow-wrap: anywhere;
}

.gap {
  margin: 0 0 16px;
  padding: 6px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

/* Phones: the table becomes a list of blocks. */

@media (max-width: 620px) {
  .top,
  main {
    padding-left: 16px;
    padding-right: 16px;
  }

  h1 {
    font-size: 1.35rem;
  }

  .recordings thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .recordings tr {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  .recordings td {
    display: inline;
    padding: 0;
    border: 0;
    margin-right: 10px;
  }

  .recordings td.when {
    display: block;
    margin: 0 0 2px;
    font-weight: 600;
  }

  .recordings .num {
    color: var(--muted);
  }
}
