/* The one stylesheet of the web UI. Phone screens first, one column, system fonts,
   light and dark by the browser's preference. No inline styles: the content security
   policy forbids them. */

:root {
  --bg: #fdfdfc;
  --fg: #1d1f21;
  --muted: #5d6166;
  --line: #d6d8db;
  --accent: #1f5fbf;
  --accent-fg: #ffffff;
  --danger: #b3261e;
  --notice: #fff4d6;
  --field: #ffffff;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17191c;
    --fg: #e8e9eb;
    --muted: #a3a8ae;
    --line: #3a3e44;
    --accent: #7aa7f0;
    --accent-fg: #0d1520;
    --danger: #f2a49e;
    --notice: #3b3320;
    --field: #22252a;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1.0625rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.top, main, footer {
  max-width: 36rem;
  margin: 0 auto;
  padding: 0 1rem;
}

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

.brand { font-weight: 700; font-size: 1.25rem; color: var(--fg); text-decoration: none; }

.signout { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.account { color: var(--muted); overflow-wrap: anywhere; }

main { padding-top: 1rem; padding-bottom: 2rem; }

footer { color: var(--muted); font-size: 0.875rem; padding-bottom: 2rem; }

h1 { font-size: 1.5rem; line-height: 1.25; margin: 0.5rem 0 1rem; }

p, li, td, th { overflow-wrap: anywhere; }

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

label { display: block; font-weight: 600; margin: 1rem 0 0.25rem; }

input[type="text"], input[type="password"], input[type="email"], select, textarea {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  font: inherit;
  color: var(--fg);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 0.375rem;
}

input.code { font-family: ui-monospace, monospace; font-size: 1.375rem; letter-spacing: 0.1em; text-transform: uppercase; }

.hint { color: var(--muted); font-size: 0.9375rem; margin: 0.25rem 0 0; }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: 0.375rem;
  background: var(--accent);
  color: var(--accent-fg);
  cursor: pointer;
}

button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button.danger { background: var(--danger); border-color: var(--danger); color: var(--bg); }
button.link { background: none; border: none; color: var(--accent); padding: 0.5rem; font-weight: 400; text-decoration: underline; }

.actions, .choices { display: flex; flex-direction: column; gap: 0.75rem; margin: 1.5rem 0; }
.actions form { margin: 0; }
.actions button, .choices .button { width: 100%; }

.errors, .messages { list-style: none; padding: 0.75rem 1rem; margin: 0 0 1rem; border-radius: 0.375rem; }
.errors { border: 1px solid var(--danger); color: var(--danger); }
.messages { background: var(--notice); }
.demo-notice { background: var(--notice); padding: 0.75rem 1rem; margin: 0 0 1rem; border-radius: 0.375rem; }

.notice { background: var(--notice); padding: 0.75rem 1rem; border-radius: 0.375rem; }

.code-shown { font-family: ui-monospace, monospace; font-size: 1.5rem; font-weight: 700; letter-spacing: 0.1em; }

.devices { list-style: none; padding: 0; margin: 0; }
.devices li { border-bottom: 1px solid var(--line); padding: 0.75rem 0; }
.devices .name { font-weight: 600; }
.devices .facts { color: var(--muted); font-size: 0.9375rem; margin: 0.25rem 0 0.5rem; }

@media (min-width: 30rem) {
  .actions, .choices { flex-direction: row; flex-wrap: wrap; }
  .actions button, .choices .button { width: auto; }
}

/* Navigation below the top line (signed in). */
.sections { max-width: 36rem; margin: 0 auto; padding: 0.5rem 1rem; display: flex; gap: 1.25rem; border-bottom: 1px solid var(--line); }
.sections a { min-height: 2.75rem; display: inline-flex; align-items: center; }

h2 { font-size: 1.1875rem; margin: 1.5rem 0 0.5rem; }
h3 { font-size: 1.0625rem; margin: 0 0 0.25rem; }

/* Notes */
.notes { list-style: none; padding: 0; margin: 0; }
.notes li { border-bottom: 1px solid var(--line); }
.note-link { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; padding: 0.75rem 0; color: var(--fg); text-decoration: none; }
.note-link .when { font-weight: 600; }
.note-link .length, .note-link .state { color: var(--muted); }
.note-link .preview { flex-basis: 100%; overflow-wrap: anywhere; }
.attention { color: var(--danger); font-weight: 600; }
.paging { display: flex; justify-content: space-between; gap: 1rem; margin: 1.5rem 0; }
.paging a { min-height: 2.75rem; display: inline-flex; align-items: center; }

.facts dt { color: var(--muted); font-size: 0.9375rem; }
.facts dd { margin: 0 0 0.5rem; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; }
dl.facts dd { margin: 0; }
p.facts { color: var(--muted); font-size: 0.9375rem; margin: 0 0 0.5rem; }

.problem { border: 1px solid var(--danger); border-radius: 0.375rem; padding: 0.25rem 1rem; margin: 1rem 0; }
.detail { font-family: ui-monospace, monospace; font-size: 0.875rem; white-space: pre-wrap; overflow-wrap: anywhere; }
details summary { cursor: pointer; color: var(--muted); min-height: 2.75rem; display: flex; align-items: center; }

.transcript, .result { overflow-wrap: anywhere; }
blockquote.preview { margin: 0.5rem 0; padding-left: 0.75rem; border-left: 3px solid var(--line); color: var(--muted); overflow-wrap: anywhere; }

audio { width: 100%; }
.run { border-top: 1px solid var(--line); padding: 0.75rem 0; }
.steps { padding-left: 1.25rem; margin: 0.25rem 0 0.75rem; }
.steps li { margin-bottom: 0.5rem; }
.step-name { font-weight: 600; }
ul.result { list-style: none; padding: 0; margin: 0.25rem 0; }
.run-state-failed { color: var(--danger); }
ul.plain { list-style: none; padding: 0; margin: 0; }

/* Settings */
.part { border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; }
.part:last-of-type { border-bottom: none; }
textarea { min-height: 8rem; resize: vertical; line-height: 1.4; }
.setting { margin: 1rem 0 1.5rem; }
.setting .description { margin: 0.25rem 0; }
.setting .marker { color: var(--muted); font-weight: 400; }
.facts-list { padding-left: 1.25rem; }
