:root {
  color-scheme: dark;
  --bg: #202226;
  --surface: #26292e;
  --raised: #282b30;
  --hover: #30343b;
  --border: #3a3f47;
  --line: #30343b;
  --text: #dce0e6;
  --muted: #a0a7b2;
  --link: #79b8f0;
  --primary: #347bb8;
  --notice: #202e3d;
  --danger: #ff8e95;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fff;
  --surface: #f6f8fa;
  --raised: #fff;
  --hover: #eef1f5;
  --border: #d8dee5;
  --line: #e8ecf0;
  --text: #1f2328;
  --muted: #59636e;
  --link: #276caa;
  --notice: #eff6ff;
  --danger: #b4232f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
strong, b { font-weight: 600; }
h1, h2, p { margin: 0 0 16px; }
h1 { font-size: 21px; font-weight: 600; line-height: 1.4; }
h2 { font-size: 16px; font-weight: 600; }
button, input { font: inherit; }
button, .button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-weight: 500;
  cursor: pointer;
}
button:hover, .button:hover { filter: brightness(1.1); text-decoration: none; }
.secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.quiet { background: transparent; color: var(--text); justify-content: start; }
.danger, .error { color: var(--danger); }
input:not([type="radio"]):not([type="checkbox"]):not(.sr-only) {
  display: block;
  width: 100%;
  padding: 7px 10px;
  margin-top: 5px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  color: var(--text);
}
input[readonly] { color: var(--muted); }
input[type="radio"], input[type="checkbox"] { accent-color: var(--primary); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
label { display: block; margin-bottom: 16px; font-weight: 500; }
.choice { display: flex; align-items: center; gap: 9px; margin: 8px 0; font-weight: 400; }
fieldset { border: 0; margin: 0 0 16px; padding: 0; }
legend { font-weight: 500; margin-bottom: 4px; }
.bar { height: 56px; display: flex; align-items: center; gap: 28px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.bar a { color: var(--text); }
.brand { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 600; }
.brand:hover { text-decoration: none; }
.account-menu { margin-left: auto; position: relative; }
.account-menu summary { cursor: pointer; padding: 7px; }
.menu { position: absolute; right: 0; top: 40px; z-index: 10; min-width: 160px; padding: 6px; background: var(--raised); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 6px 20px #0002; }
.menu a, .menu button { display: block; width: 100%; padding: 7px 10px; text-align: left; border-radius: 4px; }
.menu a:hover, .menu button:hover { background: var(--hover); text-decoration: none; }
main { flex: 1; width: min(1200px, calc(100% - 48px)); margin: 28px auto 48px; }
footer { min-height: 34px; padding: 7px 24px; border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 12px; }
.heading, .toolbar, .actions { display: flex; align-items: center; gap: 12px; }
.heading { justify-content: space-between; margin-bottom: 18px; }
.heading h1, .toolbar h2 { margin: 0; }
.panel { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.padded { padding: 20px; }
.auth { width: min(390px, 100%); margin: 42px auto; padding: 24px; background: var(--surface); }
.auth button { width: 100%; }
.form-page { max-width: 600px; margin: 16px auto; padding: 24px; }
.project-row { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); font-size: 16px; }
.project-row:last-child, .file-row:last-child, .history-row:last-child, .token-row:last-child { border-bottom: 0; }
.project-row:hover, .file-row:hover { background: var(--hover); text-decoration: none; }
.badge { border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 11px; color: var(--muted); font-weight: 400; }
.project-heading h1 { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.icon { width: 19px; height: 19px; flex-shrink: 0; color: var(--muted); vertical-align: middle; }
.folder { color: var(--link); }
.toolbar { margin: 18px 0 12px; flex-wrap: wrap; }
.toolbar > .button:last-child, .toolbar > .actions { margin-left: auto; }
.ref { display: inline-block; border: 1px solid var(--border); background: var(--surface); border-radius: 5px; padding: 5px 10px; font: 12px/20px ui-monospace, monospace; }
.breadcrumbs { display: flex; gap: 9px; flex-wrap: wrap; overflow-wrap: anywhere; min-width: 0; }
.version-row { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 10px; }
.version-row > span { flex: 1; overflow-wrap: anywhere; }
.version-row time { color: var(--muted); font-size: 12px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); color: var(--text); }
.file-row > span:first-of-type { flex: 1; overflow-wrap: anywhere; }
.file-row .muted { font-size: 12px; }
.empty { padding: 22px; margin: 0; color: var(--muted); }
.empty-project { padding: 24px; }
.empty-project pre { margin-bottom: 0; }
.file-header { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 10px; }
.readme { margin-top: 24px; }
.readme > h2 { margin: 0; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-bottom: 0; border-radius: 6px 6px 0 0; }
.readme > .panel { border-radius: 0 0 6px 6px; }
.markdown { padding: 24px 30px; overflow-wrap: anywhere; }
.markdown h1, .markdown h2 { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.markdown h1 { font-size: 28px; }
.markdown h2 { font-size: 21px; margin-top: 24px; }
.markdown > :last-child { margin-bottom: 0; }
.markdown blockquote { border-left: 3px solid var(--border); padding-left: 16px; margin-left: 0; color: var(--muted); }
pre, code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12px; }
pre { padding: 14px; overflow: auto; background: var(--surface); border-radius: 5px; line-height: 1.65; }
.text-preview { margin-top: 0; }
.history-row, .token-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.muted { color: var(--muted); }
.history-row .muted, .token-row .muted { font-size: 12px; margin-top: 3px; }
.pagination { display: flex; justify-content: flex-end; margin-top: 14px; }
.settings { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; }
.settings nav h2 { padding: 8px 12px; margin-bottom: 5px; }
.settings nav a { display: block; padding: 9px 12px; border-radius: 5px; color: var(--text); }
.settings nav a[aria-current] { background: var(--hover); font-weight: 500; }
.settings-content { max-width: 850px; }
.token-form { margin-top: 22px; }
.token-form form { max-width: 480px; }
.notice { padding: 13px 16px; background: var(--notice); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 18px; }
.token { white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.skip { position: absolute; top: -100px; }
.skip:focus { top: 8px; left: 8px; z-index: 20; background: var(--bg); padding: 8px; }
@media (prefers-reduced-motion: no-preference) {
  a, button, input { transition: background-color .12s ease, border-color .12s ease; }
}
@media (max-width: 700px) {
  main { width: calc(100% - 28px); margin-top: 20px; }
  .bar { padding: 0 14px; gap: 18px; }
  .settings { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .settings nav { display: flex; flex-wrap: wrap; gap: 5px; }
  .settings nav h2 { width: 100%; margin-bottom: 0; }
  .version-row { flex-wrap: wrap; }
  .version-row > span { flex-basis: 100%; }
  .markdown { padding: 18px; }
  .token-row { align-items: start; }
}
.project-nav { display: flex; gap: 8px; border-bottom: 1px solid var(--border); margin: -5px 0 22px; }
.project-nav a { padding: 9px 16px; color: var(--text); border-bottom: 2px solid transparent; }
.project-nav a[aria-current] { border-bottom-color: var(--link); font-weight: 500; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.member-row:last-child { border-bottom: 0; }
.member-row > strong, .member-row > a { flex: 1; overflow-wrap: anywhere; }
.member-row:has(.role-picker) { position: relative; }
.panel:has(.role-picker) { overflow: visible; }
.role-picker { position: relative; }
.role-picker summary { cursor: pointer; padding: 5px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); text-transform: capitalize; }
.role-picker .menu { top: 36px; min-width: 190px; padding: 12px; }
.role-picker .choice { white-space: nowrap; }
.role-picker button { margin-top: 8px; }
.branch-picker { position: relative; max-width: 100%; }
.branch-picker summary { cursor: pointer; max-width: 240px; overflow-wrap: anywhere; }
.branch-picker .menu { left: 0; right: auto; min-width: 220px; max-width: min(320px, 85vw); max-height: 340px; overflow: auto; }
.branch-picker .menu a { overflow-wrap: anywhere; }
.branch-picker a[aria-current] { background: var(--hover); font-weight: 600; }
.hint { font-size: 12px; margin: 8px 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.key-signin { margin-top: 18px; }
.key-signin summary, .key-row summary { cursor: pointer; color: var(--link); }
.key-signin form, .key-row form { margin-top: 16px; }
.key-error { margin-top: 12px; }
.key-row { border-top: 1px solid var(--border); padding: 12px 0; }
.key-row > details { margin-top: 6px; }
.security-section { margin-bottom: 20px; }
.recovery-codes { user-select: all; line-height: 1.8; overflow-wrap: anywhere; white-space: pre-wrap; }
.media-preview { display: flex; justify-content: center; padding: 16px; }
.media-preview img, .media-preview video { max-width: 100%; max-height: 70vh; object-fit: contain; }
.media-preview audio { width: min(100%, 560px); }
.markdown img { max-width: 100%; height: auto; }
.button .icon, button .icon, .ref .icon { width: 16px; height: 16px; color: currentColor; }
.clone-picker { position: relative; }
.clone-picker > summary { list-style: none; }
.clone-picker > summary::-webkit-details-marker { display: none; }
.caret { font-size: 11px; margin-left: 2px; }
.clone-menu { width: min(460px, calc(100vw - 28px)); padding: 14px; }
.clone-menu label { margin-bottom: 8px; }
.clone-menu .hint { overflow-wrap: anywhere; }
.copy-row { display: flex; gap: 6px; }
.copy-row input { min-width: 0; font: 12px/1.5 ui-monospace, monospace; }
.clone-menu .copy-row input { margin-top: 0; }
.clone-menu .copy-row button { display: inline-flex; width: auto; min-width: 96px; flex-shrink: 0; padding: 5px 10px; }
