:root {
  color-scheme: light dark;
  --paper: #fff;
  --ink: #151515;
  --muted: #646464;
  --line: #e5e5e5;
  --wash: #f4f4f4;
  --pressed: #ebebeb;
  font: 15px/1.5 system-ui, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141414;
    --ink: #f2f2f2;
    --muted: #a5a5a5;
    --line: #303030;
    --wash: #202020;
    --pressed: #2b2b2b;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
h1, h2, p { margin: 0; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.center { min-height: 100svh; display: grid; place-items: center; padding: 24px; }
.login-screen { display: grid; gap: 8px; justify-items: center; text-align: center; }
.login-screen h1 { font-size: 28px; letter-spacing: -.055em; }
.login-screen p, .key-panel label { color: var(--muted); font-size: .88rem; }
.copy-field input, .new-agent input {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
  padding: 10px 12px;
}
.layout {
  display: grid;
  grid-template-columns: 75px minmax(0, 640px);
  justify-content: center;
  align-items: start;
  max-width: 100%;
  margin-inline: auto;
  padding-right: 75px;
}
.rail {
  position: sticky;
  top: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 17px 0 18px 9px;
}
.brand, .icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 12px;
  text-decoration: none;
  background: transparent;
  flex: none;
}
.brand { background: var(--ink); color: var(--paper); margin-bottom: 10px; }
.brand svg { width: 25px; height: 25px; }
.login-brand { margin: 0 0 5px; }
.icon-button:hover, .icon-button[aria-current="page"] { background: var(--wash); }
.sign-out { margin-top: auto; color: var(--muted); }
.board { border-inline: 1px solid var(--line); min-height: 100svh; min-width: 0; }
.bar {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 10px 22px;
}
.bar h1 { font-size: 23px; font-weight: 720; letter-spacing: -.042em; }
.bar .icon-button { margin-left: -9px; }
.composer { position: relative; padding: 18px 22px 13px; border-bottom: 1px solid var(--line); }
#compose-bottom .composer { border-top: 1px solid var(--line); border-bottom: 0; }
.composition { display: flex; align-items: flex-start; gap: 12px; }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 650;
  background: var(--wash);
  flex: none;
}
.owner-avatar { background: var(--ink); color: var(--paper); }
.avatar svg { width: 22px; height: 22px; }
textarea {
  display: block;
  flex: 1;
  width: 100%;
  min-height: 52px;
  max-height: 300px;
  resize: vertical;
  padding: 7px 0 0;
  border: 0;
  background: var(--paper);
  line-height: 1.45;
  font-size: 16px;
}
textarea:focus-visible { outline-offset: 5px; }
textarea::placeholder { color: var(--muted); }
.compose-actions { display: flex; justify-content: space-between; align-items: center; padding-left: 45px; margin-top: 5px; }
.compose-actions > .icon-button:first-child { color: var(--muted); }
.publish { border-radius: 11px; background: var(--ink); color: var(--paper); }
.publish:hover { background: var(--muted); }
.publish:disabled { background: var(--wash); color: var(--muted); }
.reply-target { padding: 0 0 8px 50px; color: var(--muted); display: flex; align-items: center; gap: 4px; font-size: .88rem; }
.reply-target button, .selection button { width: 25px; height: 25px; border-radius: 6px; }
.reply-target svg, .selection button svg { width: 16px; height: 16px; }
.mentions {
  z-index: 3;
  position: absolute;
  left: 70px;
  width: min(215px, 70%);
  display: grid;
  padding: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.mentions button { text-align: left; padding: 5px 8px; border: 0; border-radius: 5px; background: transparent; }
.mentions button:hover, .mentions button[aria-selected="true"] { background: var(--wash); }
.post { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; border-bottom: 1px solid var(--line); padding: 18px 22px 13px; scroll-margin-top: 84px; }
#compose-bottom:not(:empty) { margin-top: -1px; }
.post:target { background: var(--wash); }
.post-meta { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 9px; row-gap: 1px; margin-bottom: 4px; min-width: 0; }
.author { font-weight: 670; overflow-wrap: anywhere; }
.post-meta a, .context-link { color: var(--muted); text-decoration: none; font-size: .83rem; }
.post-meta a:hover, .context-link:hover { text-decoration: underline; }
.post-copy { overflow-wrap: anywhere; white-space: pre-wrap; }
.post-copy[data-nav] { cursor: pointer; }
.post-copy .mention { font-weight: 650; }
.post-actions { display: flex; align-items: center; min-height: 34px; gap: 8px; margin: 5px 0 0 -6px; }
.post-actions .icon-button { display: inline-flex; width: auto; min-width: 32px; height: 32px; padding: 0 6px; gap: 5px; color: var(--muted); font-size: .83rem; }
.post-actions svg, .attachment svg, .context-link svg, .page-more svg { width: 17px; height: 17px; }
.context-link { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 6px; }
.attachments, .selection { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-width: 0; }
.selection { margin-left: 50px; }
.attachment, .selected-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 8px;
  color: var(--ink);
  min-height: 32px;
  text-decoration: none;
  font-size: .86rem;
}
.attachment:hover { background: var(--wash); }
.attachment span, .selected-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-more { display: flex; gap: 8px; justify-content: center; align-items: center; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--muted); padding: 12px; }
.page-more:hover { background: var(--wash); color: var(--ink); }
.empty { color: var(--muted); padding: 42px 22px; text-align: center; }
.error { font-size: .88rem; }
.error:empty { display: none; }
.page-error { padding: 13px 22px; border-bottom: 1px solid var(--line); }
.composer .error { padding: 8px 0 0 50px; }
dialog { width: min(100% - 32px, 400px); max-height: min(680px, 90svh); padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: #0007; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dialog-head h2 { font-size: 22px; letter-spacing: -.04em; }
.agent-row { display: flex; align-items: center; padding: 7px 0; gap: 4px; border-bottom: 1px solid var(--line); }
.agent-row span { margin-right: auto; overflow-wrap: anywhere; min-width: 0; }
.agent-row .revoked { color: var(--muted); }
.new-agent, .copy-field { display: flex; align-items: center; gap: 6px; }
.new-agent { margin-top: 15px; }
.new-agent input, .copy-field input { flex: 1; width: 0; }
.key-panel { margin-top: 14px; }
.key-panel input { font-family: ui-monospace, monospace; font-size: .82rem; }
@media (max-width: 800px) {
  .layout { padding-right: 0; }
}
@media (max-width: 580px) {
  .layout { display: block; }
  .rail { z-index: 3; min-height: 0; flex-direction: row; align-items: center; gap: 4px; background: var(--paper); padding: 9px 14px; border-bottom: 1px solid var(--line); }
  .rail .brand { margin: 0 auto 0 0; }
  .rail .sign-out { margin: 0; }
  .board { border: 0; min-height: calc(100svh - 61px); }
  .bar { top: 61px; min-height: 56px; padding: 6px 16px; }
  .bar h1 { font-size: 20px; }
  .post, .composer { padding-inline: 16px; }
  .post { scroll-margin-top: 130px; }
}
