:root {
  color-scheme: light;
  --ink: #1c1915;
  --muted: #5e574c;
  --paper: #f3efe6;
  --panel: #fffaf3;
  --line: #e0d5c6;
  --pine: #172421;
  --ember: #8f3418;
  --ember-ink: #fff7f2;
  --good: #1d5c3d;
  --bad: #8d2b2b;
  --shadow: 0 1px 0 rgba(28, 25, 21, 0.04);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(143, 52, 24, 0.08), transparent 50%),
    var(--paper);
  color: var(--ink);
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  background: var(--pine);
  color: #f6f1e8;
}

.mark {
  margin: 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #d7c4a8;
}

h1, h2 { font-family: Palatino, "Iowan Old Style", "Palatino Linotype", serif; font-weight: 600; }

h1 { margin: 0.15rem 0 0; font-size: 2rem; }

h2 { margin: 0 0 0.35rem; font-size: 1.45rem; }

main { width: min(980px, calc(100% - 2rem)); margin: 1.25rem auto 3rem; }

.lede { margin: 0 0 1rem; color: var(--muted); max-width: 42rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1rem 1.1rem;
  margin: 0 0 1rem;
  box-shadow: var(--shadow);
}

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

label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.82rem; color: var(--muted); }

#invite-form > label,
#editor > label { margin-bottom: 0.15rem; }

.apps {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 0.85rem 0;
  padding: 0.35rem 0.85rem 0.45rem;
}

.apps legend {
  padding: 0 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.app-choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.45rem 0;
}

.app-choice label {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-size: 1rem;
  flex: 1;
}

.app-choice input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  min-height: 0;
  padding: 0;
  accent-color: var(--ember);
}

.app-choice select { width: 9.5rem; flex: none; }

.app-group {
  margin: 0.75rem 0 0.15rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-choice input:disabled,
.app-choice select:disabled,
.staff-extra select:disabled,
#editor-staff:disabled { opacity: 0.55; }

.staff-extra {
  margin: 0 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem 0.85rem;
}

.staff-extra summary { cursor: pointer; color: var(--ink); }

.staff-extra .hint { margin: 0.55rem 0; }

.staff-extra select,
#editor-staff { max-width: 16rem; }

input, select, button { font: inherit; }

input, select {
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbbba8;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  min-height: 2.6rem;
}

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

button {
  background: var(--ember);
  color: var(--ember-ink);
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}

button.ghost, #sign-out, #editor-cancel, button.danger {
  background: transparent;
  color: var(--ink);
  border: 1px solid #cbbba8;
}

.top #sign-out {
  color: #f6f1e8;
  border-color: #d7c4a8;
}

button.danger { color: var(--bad); }

button:disabled { opacity: 0.6; cursor: wait; }

#account { display: flex; align-items: center; gap: 0.75rem; }

#account[hidden] { display: none; }

.row { display: flex; gap: 0.5rem; align-items: center; }

.status { min-height: 1.2rem; margin: 0 0 0.8rem; color: var(--good); }

.status.error { color: var(--bad); }

.scroll { overflow-x: auto; }

table { width: 100%; min-width: 36rem; border-collapse: collapse; font-size: 0.95rem; }

th, td { text-align: left; padding: 0.55rem 0.65rem 0.55rem 0; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }

th { font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

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

.editor { border-top: 1px solid var(--line); padding-top: 0.8rem; margin-bottom: 1rem; }

.editor-title { margin: 0 0 0.7rem; }

code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.9em; }

@media (max-width: 800px) {
  .top { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  main { width: min(100% - 1.25rem, 980px); }
  .app-choice { flex-wrap: wrap; }
  .app-choice select { width: 100%; }
}
