:root {
  --bg: #faf7f2;
  --surface: #fff;
  --surface-2: #f3eee6;
  --fg: #1f1a14;
  --muted: #6f675c;
  --line: #e7e0d5;
  /* A field's edge: 3:1 on its surface (WCAG 1.4.11), where --line is decoration. */
  --field: #8f8578;
  --accent: #bf5520;
  --accent-hover: #a8481a;
  --on-accent: #fff;
  --accent-soft: #fbeadf;
  --ok: #2c7a4b;
  --ok-soft: #e2f1e7;
  --bad: #b03f2b;
  --bad-soft: #f8e2dd;
  --busy: #86651a;
  --busy-soft: #f6eed6;
  --shadow: 0 1px 2px rgb(60 40 20 / 6%), 0 4px 16px rgb(60 40 20 / 6%);
  --radius: 12px;
  --sidebar: 280px;
  --read: 760px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151311;
    --surface: #1e1b18;
    --surface-2: #27231f;
    --fg: #efe9e1;
    --muted: #a39a8e;
    --line: #342e28;
    --field: #7a7066;
    --accent: #ec8a4f;
    --accent-hover: #f39c66;
    --on-accent: #241208;
    --accent-soft: #3b271b;
    --ok: #74c895;
    --ok-soft: #1c2d23;
    --bad: #f08d79;
    --bad-soft: #36201b;
    --busy: #e1c46f;
    --busy-soft: #2f2817;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}
[hidden] {
  /* biome-ignore lint/complexity/noImportantStyles: an element's own display (flex, grid) would otherwise show it */
  display: none !important;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font:
    15px / 1.6 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    system-ui,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}
main {
  height: 100%;
}
h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.01em;
}
a {
  color: var(--accent);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Controls */
button,
a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 500;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.05s;
}
button:hover,
a.button:hover {
  border-color: color-mix(in srgb, var(--line), var(--fg) 15%);
}
button:active {
  transform: translateY(1px);
}
button.primary,
a.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
button.primary:hover,
a.button.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
button.ghost {
  background: none;
  border-color: transparent;
  color: var(--muted);
}
button.ghost:hover {
  background: var(--surface-2);
  color: var(--fg);
}
button.icon-button {
  padding: 8px;
}
button.wide,
a.button.wide {
  width: 100%;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}
textarea,
input,
select {
  width: 100%;
  font: inherit;
  /* 16px or more: iOS Safari zooms the page into a smaller field. */
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid var(--field);
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type="checkbox"] {
  width: auto;
}
textarea {
  resize: vertical;
}
code,
pre {
  background: var(--surface-2);
  border-radius: 6px;
  font:
    13px / 1.5 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}
code {
  padding: 1px 5px;
}
pre {
  padding: 12px 14px;
  overflow-x: auto;
}
.status {
  color: var(--bad);
  font-size: 14px;
  margin: 0;
  min-height: 0;
}
.status:empty {
  display: none;
}
.hint,
.lede {
  color: var(--muted);
}
.hint {
  font-size: 14px;
  margin: 0;
}

/* Sign-in */
.signin-page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: radial-gradient(60rem 30rem at 50% -10%, var(--accent-soft), transparent 70%), var(--bg);
}
.signin {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 36px 32px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.signin h1 {
  margin: 0;
  font-size: 24px;
  text-align: center;
}
.signin .lede {
  margin: -6px 0 6px;
  text-align: center;
  font-size: 15px;
}
.signin .hint {
  text-align: center;
}
.signin-mark {
  align-self: center;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--on-accent);
}
.signin-mark .icon {
  width: 32px;
  height: 32px;
}
.signin-foot {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 13px;
}
form.password {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
form.password label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}
form.password button {
  margin-top: 4px;
  padding: 11px 14px;
}

/* The app: a sidebar and one pane */
.app {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  height: 100%;
}
.topbar,
.scrim {
  display: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 16px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--on-accent);
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 18px 14px 14px;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
}
.sidebar .brand {
  padding: 2px 6px 12px;
}
.nav-item {
  justify-content: flex-start;
  background: none;
  border-color: transparent;
}
.nav-item:hover,
.nav-item.on {
  background: var(--surface);
  border-color: var(--line);
}
.nav-label {
  margin: 14px 8px 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-empty {
  margin: 0 8px;
  font-size: 14px;
  color: var(--muted);
}
.convos {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.convo {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-width: 0;
  text-align: left;
  font-weight: 400;
  background: none;
  border-color: transparent;
}
.convo:hover {
  background: var(--surface);
  border-color: transparent;
}
.convo.on {
  background: var(--surface);
  border-color: var(--line);
}
.convo-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.convo small {
  color: var(--muted);
  font-size: 12px;
}
.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 6px 0;
  border-top: 1px solid var(--line);
}
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 650;
}
.who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}
.who small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The pane */
.pane {
  min-height: 0;
  min-width: 0;
}
.chat {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.thread {
  flex: 1;
  overflow-y: auto;
  padding: 32px 24px 16px;
}
.messages,
.welcome,
.composer,
.pane-inner {
  width: 100%;
  max-width: var(--read);
  margin: 0 auto;
}
.messages {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.msg.user {
  display: flex;
  justify-content: flex-end;
}
.bubble {
  max-width: 80%;
  padding: 10px 16px;
  border-radius: 18px 18px 4px 18px;
  background: var(--accent-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.assistant {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.avatar.bot {
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
}
.msg-body {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.answer > :first-child {
  margin-top: 4px;
}
.answer h3 {
  font-size: 16px;
  margin: 20px 0 6px;
}
.answer ul {
  padding-left: 22px;
}
.answer li {
  margin: 3px 0;
}
.answer.refused,
.answer.error {
  color: var(--muted);
}
.typing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 5px;
  color: var(--muted);
}
.dots {
  display: inline-flex;
  gap: 4px;
}
.dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.2s infinite ease-in-out;
}
.dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.dots i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .dots i {
    animation: none;
    opacity: 0.6;
  }
}
.note {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--busy-soft);
  color: var(--fg);
}
.note .icon {
  color: var(--busy);
  margin-top: 2px;
}
.note p {
  margin: 2px 0;
}
.note small {
  color: var(--muted);
}
.cites {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}
.cites summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
}
.cites summary::-webkit-details-marker {
  display: none;
}
.cites .icon {
  width: 14px;
  height: 14px;
}
.cites ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.cites code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* Tables and quotes in answers */
.table {
  overflow-x: auto;
  margin: 12px 0;
}
table {
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  font-size: 14px;
}
th,
td {
  padding: 8px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
tr:last-child td {
  border-bottom: none;
}
th {
  background: var(--surface-2);
  font-weight: 600;
}
blockquote {
  margin: 0;
  padding-left: 12px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

/* The composer */
.composer {
  padding: 8px 24px 18px;
  max-width: calc(var(--read) + 48px);
}
.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  background: var(--surface);
  border: 1px solid var(--field);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.composer-box:focus-within {
  border-color: var(--accent);
}
.composer-box textarea {
  border: none;
  padding: 7px 0;
  resize: none;
  max-height: 200px;
  background: none;
  box-shadow: none;
  line-height: 1.5;
}
.send {
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
}
.composer .status {
  margin-top: 8px;
}
.composer-hint {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* The welcome */
.welcome {
  padding: 4vh 0 16px;
}
.welcome-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--on-accent);
}
.welcome-mark .icon {
  width: 28px;
  height: 28px;
}
.welcome h1 {
  margin: 20px 0 8px;
  font-size: 28px;
}
.welcome .lede {
  margin: 0 0 24px;
  font-size: 16px;
}
.suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.suggestion {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  padding: 14px 16px;
  text-align: left;
  font-weight: 500;
  border-radius: var(--radius);
}
.suggestion small {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.suggestion:hover,
.kind-card:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--surface), var(--accent-soft) 40%);
}
.can-do h2 {
  margin: 32px 0 12px;
  font-size: 15px;
  color: var(--muted);
  font-weight: 600;
}
.kinds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.kind-card {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  padding: 14px;
  text-align: left;
  border-radius: var(--radius);
}
.kind-card .icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
  margin-bottom: 4px;
}
.kind-card small {
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
}
.kind-card[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}
.fine {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 28px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.fine .icon {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

/* Requests */
.requests-pane {
  overflow-y: auto;
  padding: 32px 24px;
}
.pane-inner h1 {
  margin: 0 0 6px;
  font-size: 26px;
}
.pane-inner > .lede {
  margin: 0 0 20px;
}
.pane-inner h2 {
  margin: 32px 0 12px;
  font-size: 18px;
}
.panel {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.request-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.extra {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.extra:empty {
  display: none;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}
.field small {
  font-weight: 400;
  color: var(--muted);
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.form-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.form-foot .status {
  flex: 1;
}
.requests {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.request {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.request-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.request-head .icon {
  color: var(--accent);
}
.request-head small {
  margin-left: auto;
  color: var(--muted);
}
.request-what {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}
.request-reason {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.files a.button {
  font-size: 14px;
  padding: 6px 12px;
}
.files small {
  color: var(--muted);
  font-weight: 400;
}
.pill {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--busy-soft);
  color: var(--busy);
}
.pill.done {
  background: var(--ok-soft);
  color: var(--ok);
}
.pill.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.empty,
.muted {
  color: var(--muted);
}

/* Staff */
.staff {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px 48px;
}
.staff-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.staff-head .brand {
  flex: 1;
}
.staff-head .tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.staff-head .tabs button {
  padding: 4px 10px;
  color: var(--muted);
  font-size: 14px;
}
.staff-head .tabs button:hover {
  color: var(--fg);
}
.staff section {
  scroll-margin-top: 80px;
}
.staff h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 32px 0 12px;
  font-size: 18px;
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.count.hot {
  background: var(--accent);
  color: var(--on-accent);
}
.queued {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.queued h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
}
.queued h3 small {
  color: var(--muted);
  font-weight: 400;
}
.queued .reason {
  margin: 0;
  font-size: 14px;
  color: var(--busy);
}
.queued blockquote > :first-child {
  margin-top: 0;
}
.queued blockquote > :last-child {
  margin-bottom: 0;
}
.queued details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
}
.actions {
  display: flex;
  gap: 8px;
}
.staff .table table {
  width: 100%;
}

/* Phone width: the sidebar is a drawer behind a top bar */
@media (max-width: 760px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 8px;
    padding-top: max(8px, env(safe-area-inset-top));
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .topbar .brand {
    font-size: 15px;
  }
  .topbar .brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 8px;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 3;
    width: min(85vw, 320px);
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow);
  }
  .drawer-open .sidebar {
    transform: none;
  }
  .scrim {
    position: fixed;
    inset: 0;
    z-index: 2;
    background: rgb(0 0 0 / 35%);
  }
  .drawer-open .scrim {
    display: block;
  }
  .thread {
    padding: 20px 16px 8px;
  }
  .composer {
    padding: 6px 12px max(12px, env(safe-area-inset-bottom));
  }
  .composer-hint {
    display: none;
  }
  .welcome {
    padding-top: 8px;
  }
  .welcome h1 {
    font-size: 23px;
  }
  .welcome .lede {
    font-size: 15px;
  }
  .suggestions {
    grid-template-columns: minmax(0, 1fr);
  }
  .kinds {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .msg.assistant {
    gap: 10px;
  }
  .avatar.bot {
    width: 28px;
    height: 28px;
  }
  .bubble {
    max-width: 88%;
  }
  .requests-pane {
    padding: 20px 16px;
  }
  .panel {
    padding: 16px;
  }
  .signin {
    padding: 28px 20px 22px;
  }
  .staff {
    padding: 0 16px 32px;
  }
  button.icon-button {
    min-width: 44px;
    min-height: 44px;
  }
  .staff-head .tabs,
  .staff-head .staff-who {
    display: none;
  }
}
