
:root {
  color-scheme: dark;
  --bg: #090b0a;
  --panel: #101310;
  --panel-2: #151915;
  --line: #32382f;
  --line-soft: #242923;
  --muted: #7f8879;
  --dim: #50574c;
  --ink: #e7eadf;
  --green: #b5f36c;
  --cyan: #75e6d1;
  --orange: #ffb44a;
  --red: #ff6b67;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 13px; }
button, textarea, input { font: inherit; }
button, a { color: inherit; }
button { cursor: pointer; }
a { text-decoration: none; }

.shell { min-height: 100dvh; display: grid; grid-template-rows: 48px 1fr auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 700; }
.brand span { margin-right: 8px; color: var(--green); }
.brand b { margin-left: 8px; color: var(--cyan); font-weight: 400; font-size: 11px; letter-spacing: .16em; }
.topbar nav { display: flex; align-items: center; gap: 14px; font-size: 11px; }
.topbar nav a { color: var(--muted); letter-spacing: .1em; }
.topbar nav a:hover { color: var(--cyan); }
.user-email { color: var(--dim); font-size: 10px; }
.topbar form { display: inline; }
.topbar nav button { border: 0; background: transparent; color: var(--muted); font-size: 11px; letter-spacing: .1em; padding: 0; }
.topbar nav button:hover { color: var(--red); }

main { width: min(1060px, 100%); margin: 0 auto; padding: 26px 18px 60px; }
.footer { display: flex; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--dim); font-size: 10px; background: var(--panel); }

.hero { padding: clamp(22px, 4vw, 54px) 0; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.hero p { margin: 0 0 18px; color: var(--green); letter-spacing: .16em; font-size: 11px; }
.hero h1 { margin: 0; font-size: clamp(34px, 5vw, 64px); line-height: .9; letter-spacing: -.06em; text-transform: uppercase; }
.hero .sub { margin-top: 18px; max-width: 62ch; color: var(--muted); line-height: 1.5; letter-spacing: 0; font-size: 13px; }

h2.section { margin: 30px 0 14px; color: var(--muted); font-size: 11px; letter-spacing: .16em; font-weight: 400; }
h2.section::before { content: "+ "; color: var(--green); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tile { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line-soft); background: var(--panel); }
.tile:hover { border-color: var(--green); background: #b5f36c08; }
.tile img { width: 100%; aspect-ratio: 1; display: block; border: 1px solid var(--line); }
.tile strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile span { color: var(--dim); font-size: 10px; }
.tile-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; scrollbar-color: var(--line) transparent; }
.tile-row .tile { flex: 0 0 168px; }
.row-hint { margin: -8px 0 12px; color: var(--dim); font-size: 10px; letter-spacing: .04em; }
.tile-more { align-content: center; justify-items: center; min-height: 150px; border-style: dashed; color: var(--muted); }
.tile-more .more-mark { font-size: 42px; color: var(--cyan); line-height: 1; }

.panel { border: 1px solid var(--line); background: var(--panel); padding: 18px; margin-bottom: 18px; }
.panel h3 { margin: 0 0 12px; font-size: 11px; color: var(--cyan); letter-spacing: .14em; font-weight: 400; }
.notice { padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--green); background: var(--panel); color: var(--muted); }
.notice.error { border-left-color: var(--red); }

form.stack { display: grid; gap: 10px; max-width: 520px; }
form.stack label { display: grid; gap: 5px; color: var(--dim); font-size: 10px; letter-spacing: .12em; }
form.stack input, form.stack textarea, form.stack select {
  padding: 9px 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
form.stack input:focus, form.stack textarea:focus, form.stack select:focus { outline: 0; border-color: var(--green); }
form.stack textarea { min-height: 84px; resize: vertical; }
form.stack button, .btn {
  justify-self: start; padding: 9px 18px; border: 1px solid var(--green);
  background: transparent; color: var(--green); letter-spacing: .12em; font-size: 11px;
}
form.stack button:hover, .btn:hover { background: var(--green); color: var(--bg); }
button.danger { border-color: var(--red); color: var(--red); }
button.danger:hover { background: var(--red); color: var(--bg); }

.landing-head { display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: start; margin-bottom: 22px; }
.landing-head img { width: 180px; aspect-ratio: 1; border: 1px solid var(--line); }
.landing-head h1 { margin: 0 0 10px; font-size: clamp(26px, 4vw, 44px); line-height: .95; letter-spacing: -.05em; text-transform: uppercase; }
.landing-head .meta { color: var(--dim); font-size: 10px; letter-spacing: .1em; margin-bottom: 12px; }
.landing-head .body { color: var(--muted); line-height: 1.55; max-width: 68ch; white-space: pre-line; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tags span { padding: 3px 8px; border: 1px solid var(--line); color: var(--cyan); font-size: 10px; }

.member-list, .request-list { display: grid; gap: 0; }
.member-row, .request-row { display: flex; align-items: baseline; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line-soft); }
.member-row .role { color: var(--dim); font-size: 10px; letter-spacing: .1em; }
.member-row .role.admin { color: var(--orange); }
.request-row { flex-wrap: wrap; }
.request-row .who { color: var(--ink); }
.request-row .msg { flex: 1 1 100%; color: var(--muted); line-height: 1.5; }
.request-row form { display: inline; }
.request-row button { padding: 4px 10px; font-size: 10px; letter-spacing: .1em; border: 1px solid var(--green); background: transparent; color: var(--green); }
.request-row button:hover { background: var(--green); color: var(--bg); }
.request-row button.danger { border-color: var(--red); color: var(--red); }
.request-row button.danger:hover { background: var(--red); color: var(--bg); }

.doc-list { display: grid; padding: 0; }
.doc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); text-decoration: none; }
.doc-row:hover { background: #b5f36c08; }
.doc-row:last-child { border-bottom: 0; }
.doc-row .title { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-row .meta { grid-column: 2; grid-row: 1; color: var(--dim); font-size: 10px; align-self: center; white-space: nowrap; }
.doc-row.kind-note .title::before { content: "% "; color: var(--green); }
.doc-row.kind-task .title::before { content: "@ "; color: var(--orange); }
.doc-row.kind-collection .title::before { content: "# "; color: var(--cyan); }
.doc-row.kind-booklet .title::before { content: "./ "; color: var(--green); }
.doc-row.kind-game .title::before { content: "$ "; color: var(--orange); }
.doc-content { margin: 0; padding: 16px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); white-space: pre-wrap; word-break: break-word; line-height: 1.55; max-height: 60dvh; overflow: auto; }
.diff { margin: 0; padding: 0; border: 1px solid var(--line); background: var(--panel); max-height: 60dvh; overflow: auto; font-size: 12px; line-height: 1.5; }
.diff div { padding: 1px 12px; white-space: pre-wrap; word-break: break-word; }
.diff .add { background: #b5f36c14; color: var(--green); }
.diff .add::before { content: "+ "; }
.diff .del { background: #ff6b6714; color: var(--red); }
.diff .del::before { content: "- "; }
.diff .same { color: var(--muted); }
.diff .same::before { content: "  "; }
.bundle-frame { width: 100%; height: 62dvh; border: 1px solid var(--line); background: #fff; }
.bundle-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.bundle-nav button { padding: 5px 11px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 11px; }
.bundle-nav button:hover, .bundle-nav button.active { border-color: var(--green); color: var(--green); }
.version-row { display: flex; align-items: baseline; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; flex-wrap: wrap; }
.version-row b { color: var(--cyan); font-weight: 400; }
.version-row form { margin-left: auto; }
.version-row .version-view { margin-left: auto; color: var(--cyan); font-size: 10px; text-decoration: none; }
.version-row .version-view + form { margin-left: 8px; }
.version-row button { padding: 3px 9px; font-size: 10px; border: 1px solid var(--orange); background: transparent; color: var(--orange); }
.version-row button:hover { background: var(--orange); color: var(--bg); }
.proposal-row { display: grid; gap: 4px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); text-decoration: none; }
.proposal-row:hover { background: #75e6d108; }
.proposal-row .title { color: var(--ink); }
.proposal-row .title::before { content: "? "; color: var(--cyan); }
.proposal-row .meta { color: var(--dim); font-size: 10px; }
.breadcrumb { margin: 0 0 18px; color: var(--dim); font-size: 11px; }
.breadcrumb a { color: var(--cyan); }
details.account-fold { margin-top: 34px; border: 1px solid var(--line); background: var(--panel); }
details.account-fold > summary { list-style: none; cursor: pointer; padding: 13px 16px; color: var(--muted); font-size: 11px; letter-spacing: .16em; }
details.account-fold > summary::-webkit-details-marker { display: none; }
details.account-fold > summary::before { content: "+ "; color: var(--green); }
details.account-fold[open] > summary::before { content: "- "; }
details.account-fold .fold-body { padding: 14px 16px 4px; border-top: 1px solid var(--line-soft); }
details.account-fold .fold-body .panel { border-color: var(--line-soft); }
.panel.welcome p { color: var(--muted); line-height: 1.65; margin: 0; max-width: 72ch; }
dialog.cli-dialog { width: min(720px, 92vw); max-height: 86dvh; padding: 0; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
dialog.cli-dialog::backdrop { background: rgba(5, 7, 5, .72); }
.dialog-bar { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid var(--line); color: var(--dim); font-size: 10px; letter-spacing: .12em; }
.dialog-bar button { border: 0; background: transparent; color: var(--cyan); font-size: 11px; }
.dialog-bar button:hover { color: var(--green); }
.dialog-body { padding: 16px; display: grid; gap: 12px; }

.chat-box { display: grid; grid-template-rows: auto auto 1fr auto; height: min(60dvh, 520px); padding: 0; }
.chat-more { padding: 7px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; color: var(--cyan); font-size: 10px; letter-spacing: .1em; }
.chat-more:hover { background: #75e6d108; }
.chat-more[hidden] { display: none; }
.chat-presence { padding: 8px 14px; border-bottom: 1px solid var(--line-soft); color: var(--dim); font-size: 10px; letter-spacing: .1em; }
.chat-presence b { color: var(--green); font-weight: 400; }
.chat-log { min-height: 0; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; scrollbar-color: var(--line) transparent; }
.chat-msg { line-height: 1.5; }
.chat-msg .head { color: var(--dim); font-size: 10px; letter-spacing: .08em; }
.chat-msg .head b { color: var(--cyan); font-weight: 400; }
.chat-msg.mine .head b { color: var(--green); }
.chat-msg .body { color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.chat-msg.system { color: var(--red); font-size: 11px; }
.chat-form { display: flex; gap: 0; border-top: 1px solid var(--line-soft); align-items: stretch; }
.chat-form textarea { flex: 1; padding: 10px 14px; border: 0; background: var(--bg); color: var(--ink); resize: none; line-height: 1.45; font: inherit; }
.chat-form textarea:focus { outline: 0; }
.chat-form button { padding: 0 18px; border: 0; border-left: 1px solid var(--line-soft); background: transparent; color: var(--green); letter-spacing: .12em; font-size: 11px; }
.chat-form button:hover { background: var(--green); color: var(--bg); }
.chat-form textarea:disabled, .chat-form button:disabled { opacity: .4; }
.token-row { display: flex; align-items: baseline; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; }
.token-row code { color: var(--cyan); }
.token-row form { margin-left: auto; }
.token-row button { padding: 3px 9px; font-size: 10px; border: 1px solid var(--red); background: transparent; color: var(--red); }
.token-row button:hover { background: var(--red); color: var(--bg); }
.searchbar { display: flex; gap: 8px; margin-bottom: 20px; }
.searchbar input { flex: 1; padding: 10px 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.searchbar input:focus { outline: 0; border-color: var(--cyan); }
.searchbar button { padding: 0 18px; border: 1px solid var(--cyan); background: transparent; color: var(--cyan); letter-spacing: .12em; font-size: 11px; }
.searchbar button:hover { background: var(--cyan); color: var(--bg); }

@media (max-width: 640px) {
  .landing-head { grid-template-columns: 1fr; }
  .landing-head img { width: 140px; }
  main { padding: 16px 12px 40px; }
  .chat-box { height: calc(100dvh - 210px); }
  .topbar nav { gap: 10px; }
  .user-email { display: none; }
}
