/* The look of the app: old-paper tones, book lettering for titles, black ink for every action. */
:root {
  --background: #f8f3ea;
  --surface: #fffdf8;
  --raised: #f0e8da;
  --border: #ddd2c0;
  --text: #2a2019;
  --muted: #64574a;
  --ink: #1c1712;
  --on-ink: #fffdf8;
  --danger: #a03b2a;
  --gold: #f4e4ae;
  --gold-edge: #a8862b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #14110f;
    --surface: #1e1a17;
    --raised: #29231f;
    --border: #3a322c;
    --text: #f3ede4;
    --muted: #b5a99a;
    --ink: #f3ede4;
    --on-ink: #14110f;
    --danger: #e58b7b;
    --gold: #3d352d;
    --gold-edge: #d9b36a;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

h1,
h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  margin: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 21px;
}

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

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 28px;
  padding-bottom: 8px;
}

.who {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  min-width: 0;
}

.who span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 48px;
}

#panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.devices {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
}

.notice {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--danger);
  border-radius: 12px;
  color: var(--danger);
  background: var(--surface);
}

form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label,
legend {
  font-weight: 600;
  font-size: 14px;
  margin-top: 8px;
  padding: 0;
}

.count {
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
}

.count.over {
  color: var(--danger);
  font-weight: 600;
}

input[type='text'],
input[type='datetime-local'],
textarea,
select {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--background);
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

legend {
  margin-bottom: 4px;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
}

.choice:has(input:checked) {
  background: var(--gold);
  border-color: var(--gold-edge);
}

.choice input {
  accent-color: var(--gold-edge);
}

#later {
  flex-basis: 100%;
}

.preview {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--raised);
  overflow-wrap: anywhere;
}

.quiet {
  margin: 4px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--gold);
  border: 1px solid var(--gold-edge);
  font-size: 14px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.confirm p {
  flex-basis: 100%;
  margin: 0;
  font-weight: 600;
}

button {
  font: inherit;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

.primary,
.secondary {
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 600;
}

.primary {
  background: var(--ink);
  color: var(--on-ink);
  border: 1px solid var(--ink);
}

.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.link {
  min-height: 48px;
  padding: 0 4px;
  background: none;
  border: 0;
  color: var(--text);
  text-decoration: underline;
  font-weight: 600;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.messages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.messages li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.messages .state {
  font-size: 14px;
  font-weight: 600;
}

.messages .figures,
.messages .text {
  font-size: 14px;
  color: var(--muted);
}

.messages .link {
  align-self: flex-start;
  color: var(--danger);
}

:focus-visible {
  outline: 3px solid var(--gold-edge);
  outline-offset: 2px;
}
