@font-face {
  font-family: Galmuri;
  src: url("/assets/Galmuri11-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: light;
  --sans: Inter, Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --pixel: Galmuri, var(--sans);
  --mono: "IBM Plex Mono", Consolas, "Liberation Mono", monospace;
  --ink: #343047;
  --muted: #686273;
  --line: #dad4dd;
  --paper: #faf8f2;
  --violet: #6552a8;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button,input,textarea,select { font: inherit; }
button { cursor: pointer; border: 0; background: transparent; color: inherit; }
button:disabled { cursor: not-allowed; }
button,input,textarea,summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #8871bf; outline-offset: 3px; }
::selection { background: #e2d2fa; color: #352745; }
button,input,textarea { border-radius: 8px; }
h1,h2,h3,p,figure { margin: 0; }
[hidden] { display: none !important; }
.initial-loading { padding: 3rem; color: var(--muted); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font: 700 25px/1 var(--pixel); letter-spacing: -.075em; }
.brand-mark { display: block; width: 38px; height: auto; flex-shrink: 0; image-rendering: pixelated; }
.btn { min-height: 40px; padding: 9px 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 650; line-height: 1.45; background: #fffefa; border: 1px solid #c8becf; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover:enabled { background: #f6f1fc; border-color: #a798b9; }
.btn.primary { background: var(--violet); color: white; border-color: #54428f; box-shadow: 0 2px 0 #4c3c7c; }
.btn.primary:hover:enabled { background: #56428f; border-color: #493879; }
.btn:active:enabled { box-shadow: inset 0 1px 3px #38274e26; }
.btn:disabled { background: #f3f1ef; color: #716b77; border-color: #d9d4d8; box-shadow: none; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger:enabled { color:#fff; background:#963b48; border-color:#7f313d; }
.btn.danger:hover:enabled { background:#80323e; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 5px; flex-shrink: 0; border-radius: 7px; }
.icon-btn:hover:enabled { background: #eee7f3; }
.symbol { display: inline-flex; align-items: center; justify-content: center; line-height: 1; width: 18px; height: 18px; font-size: 17px; position: relative; flex-shrink: 0; font-family: "Segoe UI Symbol", system-ui, sans-serif; font-weight: 500; }
.symbol::before,.symbol::after { position: absolute; box-sizing: border-box; }
.i-folder::before { content:""; left: 1px; top: 5px; width: 16px; height: 11px; border: 1.5px solid currentColor; border-radius: 2px; }
.i-folder::after { content:""; top: 3px; left: 2px; width: 7px; height: 4px; border: 1.5px solid currentColor; border-bottom: none; border-radius: 2px 2px 0 0; }
.i-chat::before { content:""; left: 2px; top: 3px; width: 14px; height: 11px; border: 1.5px solid currentColor; border-radius: 4px; }
.i-chat::after { content:""; bottom: 2px; left: 5px; height: 4px; border-left: 1.5px solid currentColor; transform: skew(-24deg); }
.i-feed::before { content:""; width: 12px; height: 1.5px; box-shadow: 0 -5px currentColor, 0 5px currentColor; background: currentColor; border-radius: 2px; left: 6px; }
.i-feed::after { content:""; width: 2px; height: 2px; left: 1px; box-shadow: 0 -5px currentColor, 0 5px currentColor; background: currentColor; border-radius: 1px; }
.i-plus::before,.i-plus::after { content:""; width: 12px; height: 1.5px; border-radius: 2px; background: currentColor; }
.i-plus::after { transform: rotate(90deg); }
.i-x::before,.i-x::after { content:""; width: 13px; height: 1.5px; background: currentColor; transform: rotate(45deg); }
.i-x::after { transform: rotate(-45deg); }
.i-down::before { content:""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
.i-file::before { content:""; width: 12px; height: 15px; border: 1.5px solid currentColor; border-radius: 2px; }
.i-file::after { content:""; width: 5px; height: 1px; background: currentColor; box-shadow: 0 3px currentColor; }
.i-terminal::before { content: "›_"; font-family: var(--mono); font-size: 15px; font-weight: bold; white-space:nowrap; }
.i-eye::before { content:""; width: 14px; height: 11px; border: 1.5px solid currentColor; border-radius: 70% 15%; transform: rotate(45deg); }
.i-eye::after { content:""; width: 4px; height: 4px; border: 1px solid currentColor; border-radius: 50%; }
.i-link::before,.i-link::after { content:""; width: 7px; height: 11px; border: 1.5px solid currentColor; transform: rotate(40deg); border-radius: 5px; }
.i-link::before { left: 4px; top: 7px; } .i-link::after { left: 9px; top: 1px; }
.i-menu::before { content:""; height: 1.5px; width: 15px; box-shadow: 0 -5px currentColor, 0 5px currentColor; background: currentColor; }
.i-send::before { content:""; width: 8px; height: 8px; border: solid currentColor; border-width: 1.6px 1.6px 0 0; transform: translateY(-2px) rotate(-45deg); }
.i-send::after { content:""; width: 1.6px; height: 12px; background: currentColor; }
.i-power::before { content:""; width:12px; height:12px; top:5px; border:1.5px solid; border-top-color:transparent; border-radius:50%; }
.i-power::after { content:""; width:1.5px; height:9px; background:currentColor; top:1px; }

/* Account screen */
.auth {
  min-height:100vh; min-height:100dvh; display:flex; flex-direction:column;
  background-color:var(--paper); background-image:radial-gradient(#dfd9cf .8px, transparent 1px); background-size:16px 16px;
}
.auth-mast { border-bottom:1px solid #dbd5ca; background:#fffcf6; }
.mast-inner,.status-inner { width:min(100% - 96px,1200px); margin:0 auto; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.mast-inner { min-height:76px; }
.guide-link,.server-link { display:inline-flex; align-items:center; gap:7px; padding:8px 10px; color:#564e61; font-size:13px; font-weight:600; }
.guide-link:hover,.server-link:hover { background:#eee9e9; }
.i-help::before { content:"?"; width:16px; height:16px; border-radius:50%; border:1.5px solid currentColor; text-align:center; font:700 12px/14px var(--sans); }
.auth-main {
  flex:1; display:grid; align-items:center; grid-template-columns:minmax(0,1.28fr) minmax(340px,.88fr);
  gap:clamp(46px,6.5vw,100px); width:min(100% - 112px,1120px); margin:0 auto; padding:clamp(32px,6vh,72px) 0;
}
.auth-art { min-width:0; }
.art-caption { margin-bottom:24px; }
.art-caption h2 { color:#393143; font:700 clamp(29px,3.25vw,46px)/1.48 var(--pixel); letter-spacing:-.065em; }
.art-caption em { position:relative; isolation:isolate; font-style:normal; white-space:nowrap; }
.art-caption em::before { content:""; position:absolute; z-index:-1; left:0; right:-2px; bottom:4%; height:.24em; background:#dfcfed; }
.pixel-spark { position:relative; top:-.45em; display:inline-block; width:.48em; height:.48em; margin-left:.17em; background:#ebaf74; clip-path:polygon(40% 0,60% 0,60% 25%,75% 25%,75% 40%,100% 40%,100% 60%,75% 60%,75% 75%,60% 75%,60% 100%,40% 100%,40% 75%,25% 75%,25% 60%,0 60%,0 40%,25% 40%,25% 25%,40% 25%); }
.art-caption p { margin-top:10px; color:#645968; font-size:15px; line-height:1.8; }
.room-preview { overflow:hidden; background:#d3c1e2; border:2px solid #5d4e64; border-radius:12px; box-shadow:5px 6px 0 #dbd1de; }
.room-bar { display:flex; align-items:center; gap:8px; height:33px; padding:0 13px; background:#e2d5f0; color:#4a3e55; border-bottom:2px solid #685571; font:700 12px var(--pixel); }
.room-bar .i-folder { transform:scale(.87); }
.room-bar .i-folder::before,.room-bar .i-folder::after { background:#ffdd9f; }
.window-dots,.status-palette { display:inline-flex; align-items:center; gap:5px; margin-left:auto; }
.window-dots i { width:8px; height:8px; border:1px solid #73647c; border-radius:2px; background:#fff4d4; }
.window-dots i:nth-child(2) { background:#eeb4b0; }
.window-dots i:nth-child(3) { background:#b2a0ce; }
.room-picture { display:block; width:100%; height:auto; aspect-ratio:1.78; object-fit:cover; object-position:center 55%; }
.auth-card { align-self:center; min-width:0; padding:clamp(25px,2.65vw,41px); border:1.5px solid #b9acbc; border-radius:18px; background:#fffdfa; box-shadow:4px 5px 0 #e2dbe1; }
.auth-card h1 { color:#352d40; font:700 clamp(24px,2.1vw,30px)/1.45 var(--pixel); letter-spacing:-.07em; }
.auth-card .intro { color:var(--muted); margin:7px 0 24px; font-size:14px; line-height:1.65; }
.tabs { display:grid; grid-template-columns:1fr 1fr; padding:4px; gap:3px; border:1px solid #e0d9e2; border-radius:10px; background:#f0ecf2; }
.tabs button { min-height:34px; padding:6px 5px; border:1px solid transparent; border-radius:7px; color:#685e71; font-weight:650; font-size:13px; }
.tabs button[aria-pressed="true"] { background:#fffefa; color:#584386; border-color:#cfc4d7; box-shadow:0 1px 2px #45315219; }
.tabs button[aria-pressed="false"]:hover { background:#e8e1ed; }
.form-stack { display:grid; gap:16px; margin-top:21px; }
.field { display:grid; gap:7px; min-width:0; font-size:13px; font-weight:650; }
input,textarea { color:var(--ink); background:#fff; border:1px solid #cfc7d0; width:100%; padding:11px 13px; line-height:1.5; font-size:14px; font-weight:450; }
input::placeholder,textarea::placeholder { color:#77717d; }
input:focus,textarea:focus { outline:2px solid #e2d7f1; border-color:#9279af; }
.help,.error { font-size:13px; line-height:1.55; }
.help { color:var(--muted); font-weight:450; }
.error { color:#8b353d; padding:10px 12px; background:#fcecea; border-radius:7px; }
.password-field { position:relative; }
.password-field input { padding-right:45px; }
.reveal-password { position:absolute; right:4px; top:50%; transform:translateY(-50%); color:#7c7283; }
.reveal-password[aria-pressed="true"] { color:var(--violet); background:#eee8f5; }
.reveal-password[aria-pressed="true"]::after { content:""; position:absolute; width:17px; height:1.5px; background:currentColor; transform:rotate(-45deg); }
.auth-card .primary { width:100%; min-height:45px; margin-top:3px; }
.i-forward::before { content:""; width:12px; height:1.5px; background:currentColor; }
.i-forward::after { content:""; right:3px; width:7px; height:7px; border:solid currentColor; border-width:1.5px 1.5px 0 0; transform:rotate(45deg); }
.auth-divider { display:flex; gap:12px; align-items:center; margin:18px 0 13px; color:#746d78; font-size:11px; }
.auth-divider::before,.auth-divider::after { content:""; flex:1; height:1px; background:#e6dfe4; }
.github-login { width:100%; min-height:41px; }
.github-login:enabled { color:white; background:#443b50; border-color:#3c3245; }
.github-login:hover:enabled { color:white; background:#352c40; border-color:#302938; }
.github-login:enabled .symbol { filter:brightness(0) invert(1); }
.i-github { background:center/16px no-repeat url("/assets/github.svg"); }
.github-login:disabled .symbol { opacity:.68; }
.github-setup { margin-top:9px; text-align:center; font-size:12px; }
.github-steps { margin:0; padding-left:1.45em; color:var(--muted); font-size:14px; line-height:1.65; }
.github-steps li + li { margin-top:5px; }
.device-code { text-align:center; font-size:21px; letter-spacing:.12em; }
.auth-status { background:#faf7ef; border-top:1px solid #e0d9d1; }
.status-inner { min-height:43px; }
.server-address { display:flex; align-items:center; gap:8px; min-width:0; color:#736977; font-size:11px; }
.server-address .symbol { width:15px; }
.server-host { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:12px var(--mono); }
.server-link { flex-shrink:0; font-size:12px; }
.status-palette { gap:3px; }
.status-palette i { width:8px; height:8px; background:#edbea3; }
.status-palette i:nth-child(2) { background:#c9badb; }
.status-palette i:nth-child(3) { background:#aabfa3; }
.welcome-guide { display:grid; gap:17px; padding-left:21px; margin:23px 0 8px; }
.welcome-guide li { padding-left:3px; font-size:14px; }
.welcome-guide li::marker { font-family:var(--pixel); color:var(--violet); }
.welcome-guide p { margin-top:5px; color:var(--muted); font-size:13px; line-height:1.65; }

/* Project shell */
.workspace {
  --sidebar-paper: #efebf8;
  --desk-paper: #fcfaf5;
  --desk-line: #dfd8df;
  --desk-violet: #59488e;
  display:grid; grid-template-columns:274px minmax(0,1fr);
  height:100vh; height:100dvh; overflow:hidden;
}
.sidebar {
  --brand-bg:var(--sidebar-paper);
  display:flex; flex-direction:column; min-height:0; color:#393348;
  background:var(--sidebar-paper); border-right:1px solid #cfc7d8;
}
.side-head { min-height:82px; padding:19px 24px; display:flex; justify-content:space-between; align-items:center; }
.side-head .brand { font-size:25px; }
.sidebar .icon-btn { color:#574a70; width:32px; height:32px; }
.sidebar .icon-btn:hover,.side-actions button:hover { background:#e1d9ef; }
.side-menu { overflow:auto; padding:9px 14px 22px; flex:1; min-height:54px; scrollbar-width:thin; scrollbar-color:#c4b8d9 transparent; }
.side-heading { display:flex; align-items:center; justify-content:space-between; color:#61566e; padding:0 3px 12px 9px; font-size:13px; font-weight:700; }
.project-count { margin-left:2px; padding:1px 6px; background:#e3daee; color:#57496d; border-radius:5px; font:600 11px/1.5 var(--mono); }
.side-heading .icon-btn { width:28px; height:28px; border:1px solid #cfc5dc; border-radius:8px; background:#faf7ff; }
.project-group + .project-group { margin-top:5px; }
.project-row { display:flex; border:1px solid transparent; border-radius:9px; color:#3e364e; }
.project-link { flex:1; min-width:0; min-height:44px; padding:8px 9px; display:flex; gap:10px; align-items:center; text-align:left; font-size:14px; font-weight:700; }
.project-new-chat { align-self:center; }
.project-toggle { display:grid; place-items:center; flex:0 0 44px; padding:0; }
.project-link:hover,.project-toggle:hover,.tree-link:hover { background:#e7dff2; }
.project-link > .i-folder { color:#655570; }
.project-link > .i-folder::before,.project-link > .i-folder::after { background:#f3cca8; }
.project-toggle .i-down { color:#796c86; transform:rotate(-90deg); }
.project-toggle[aria-expanded="true"] .i-down { transform:rotate(0); }
.label-clip { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.project-children { display:grid; gap:3px; padding:2px 0 3px 10px; margin:1px 0 9px 18px; border-left:1px dashed #beb1d0; }
.tree-link { width:100%; min-width:0; min-height:34px; display:flex; align-items:flex-start; gap:5px; padding:7px 5px; border:1px solid transparent; border-radius:9px; text-align:left; color:#5c5368; font-size:14px; }
.project-row.active,.tree-link.active { background:#fffcff; border-color:#cfc3dd; color:#49376e; box-shadow:0 2px 0 #ded5e7; }
.tree-link.active { font-weight:680; }
.tree-link.active > .symbol { color:#77639b; }
.tree-link > .symbol { margin-top:1px; }
.tree-text { display:grid; gap:3px; min-width:0; }
.tree-text small { color:#6b5e77; font-size:12px; font-weight:450; line-height:1.4; }
.tree-link > .tree-text { flex:1; }
.tree-chat-heading { display:grid; min-width:0; grid-template-columns:minmax(0,1fr) fit-content(clamp(45%,calc(100% - 60px),60%)); align-items:start; gap:4px; }
.tree-chat-title { min-width:0; line-height:1.4; font-weight:600; }
.tree-link.active .tree-chat-title { font-weight:inherit; }
.tree-chat-heading .tree-chat-owner {
  min-width:0; max-width:100%; justify-self:end; overflow-wrap:anywhere;
  padding:1px 4px; border-radius:4px; font-weight:600;
  background:hsl(var(--chat-owner-hue) 55% 92%); color:hsl(var(--chat-owner-hue) 58% 24%);
}
.tree-chat-status { justify-self:start; border-radius:4px; padding:1px 5px; background:#e6dbf1; color:#534073; font-size:11px; font-weight:650; line-height:1.4; white-space:nowrap; }
.tree-chat-status[data-status="error"] { background:#fcecea; color:#8b353d; }
.chat-action-menu { position:fixed; inset:0 auto auto 0; margin:0; min-width:132px; padding:4px; border:1px solid #cfc3dd;
  border-radius:8px; background:#fffdf9; color:var(--ink); box-shadow:0 5px 16px #38274e25; }
.chat-action-menu button { display:block; width:100%; min-height:36px; padding:6px 10px; text-align:left; border-radius:5px; font-size:14px; }
.chat-action-menu button:hover,.chat-action-menu button:focus-visible { background:#eee7f4; }
.chat-action-menu button:focus-visible { outline-offset:-2px; }
.chat-action-menu .danger { color:#8b353d; }
.side-status { margin:10px 8px; color:#635471; font-size:12px; line-height:1.55; }
.side-actions { display:grid; margin:0 15px; padding:12px 0; border-top:1px dashed #ccc1d8; }
.side-actions button { display:flex; align-items:center; gap:9px; min-height:35px; padding:7px 9px; color:#584e66; text-align:left; font-size:13px; font-weight:570; }
.side-user { display:flex; align-items:center; gap:10px; padding:17px 20px; border-top:1px solid #d6ccdf; background:#e8e1f1; }
.avatar { display:inline-grid; place-items:center; flex-shrink:0; width:35px; height:35px; color:#6b4848; background:#ffd8cc; border:1px solid #ae8990; border-radius:12px; font-size:15px; font-weight:750; }
.side-user .name { font-weight:650; font-size:14px; }
.side-user .icon-btn { margin-left:auto; }
.surface { display:flex; flex-direction:column; min-width:0; min-height:0; background:var(--desk-paper); }
.topbar { min-height:62px; padding:11px clamp(18px,3vw,48px); display:flex; align-items:center; justify-content:space-between; gap:12px; border-bottom:1px solid var(--desk-line); background:#fffcf8; }
.crumbs,.toolbar,.actions { display:flex; align-items:center; gap:10px; min-width:0; }
.crumbs { font-size:13px; color:var(--muted); }
.root-crumb { flex-shrink:0; }
.crumbs strong { color:#504657; font-weight:650; }
.slash { color:#a79da9; }
.topbar .btn { min-height:33px; font-size:13px; padding:5px 11px; }
.toolbar { flex-shrink:0; }
.connected { display:inline-flex; align-items:center; gap:7px; }
.connected::before { content:""; width:7px; height:7px; background:#408459; border-radius:50%; }
.view { width:100%; flex:1; display:flex; flex-direction:column; min-height:0; }
.view-head { display:flex; align-items:center; justify-content:space-between; gap:16px; width:100%; padding:clamp(22px,3.6vh,40px) clamp(20px,4vw,64px); border-bottom:1px solid var(--desk-line); background:#fffdf9; }
.view-title { display:flex; align-items:center; min-width:0; gap:15px; }
.view-icon { display:grid; place-items:center; flex-shrink:0; width:46px; height:46px; background:#f5ddcb; color:#715463; border:1px solid #cab2af; border-radius:13px; box-shadow:0 2px 0 #e6d6d1; }
.view-icon:has(.i-chat) { color:#61507b; background:#e9e1f5; border-color:#c5b8d3; box-shadow:0 2px 0 #ddd3e5; }
.view-icon .symbol { transform:scale(1.14); }
.view-head h1 { font-size:clamp(22px,2vw,31px); font-weight:750; letter-spacing:-.055em; line-height:1.3; }
.view-head .meta { display:flex; align-items:center; gap:7px; margin-top:6px; color:var(--muted); font-size:13px; flex-wrap:wrap; }
.pill { display:inline-flex; align-items:center; gap:5px; padding:1px 7px; border:1px solid #d9cee6; border-radius:5px; background:#f4eff9; color:#5e4e76; font-size:12px; line-height:1.5; font-weight:600; }
.pane { flex:1; overflow:auto; min-height:0; scrollbar-width:thin; scrollbar-color:#cfc3d6 transparent; }
.timeline { max-width:1000px; margin:0 auto; padding:10px clamp(18px,4vw,64px) 28px; }
.empty { display:flex; align-items:center; justify-content:center; padding:32px 20px; }
.pane.empty { padding:20px; justify-content:flex-start; flex-direction:column; background-color:var(--desk-paper); background-image:radial-gradient(#e4dce0 .9px,transparent 1px); background-size:19px 19px; }
.pane.empty > div { width:100%; margin:auto; }
.empty-inner { max-width:435px; text-align:center; }
.empty-art {
  position:relative; display:inline-flex; width:130px; height:83px; margin:0 0 18px;
  background:linear-gradient(#c5afd5 0 0) 9px 37px/8px 2px,linear-gradient(#c5afd5 0 0) 12px 34px/2px 8px,
    linear-gradient(#dba58b 0 0) 114px 54px/8px 2px,linear-gradient(#dba58b 0 0) 117px 51px/2px 8px;
  background-repeat:no-repeat;
}
.empty-art::before,.empty-art::after { content:""; position:absolute; transform:rotate(-5deg); }
.empty-art::before {
  left:22px; top:12px; width:81px; height:54px; background:#9c88b7;
  clip-path:polygon(0 4px,4px 4px,4px 0,29px 0,36px 7px,76px 7px,76px 11px,81px 11px,81px 100%,0 100%);
}
.empty-art::after {
  left:23px; top:31px; width:80px; height:42px; box-sizing:border-box;
  border:2px solid #766783; border-radius:4px 5px 9px 8px;
  background:linear-gradient(#584a68 0 0) 24px 15px/3px 5px,linear-gradient(#584a68 0 0) 50px 15px/3px 5px,
    linear-gradient(#795b75 0 0) 35px 21px/2px 2px,linear-gradient(#795b75 0 0) 37px 23px/4px 2px,linear-gradient(#795b75 0 0) 41px 21px/2px 2px,
    linear-gradient(#e1abb7 0 0) 17px 21px/7px 3px,linear-gradient(#e1abb7 0 0) 53px 21px/7px 3px,#e1d2f0;
  background-repeat:no-repeat; box-shadow:0 3px 0 #d7cbd8;
}
.empty-art > .symbol { z-index:1; position:absolute; left:86px; top:7px; width:31px; height:28px; background:#ffdfbb; border:1px solid #ab8c86; border-radius:7px; color:#725861; transform:rotate(9deg); }
.empty-art > .symbol::before,.empty-art > .symbol::after { translate:5px 3px; }
.empty-art > .i-feed::before,.empty-art > .i-feed::after { translate:5px 0; }
.empty h2 { font-size:clamp(23px,2vw,29px); letter-spacing:-.055em; line-height:1.4; }
.empty p { margin:10px 0 0; font-size:15px; line-height:1.75; color:var(--muted); }
.empty .actions { justify-content:center; flex-wrap:wrap; margin-top:23px; }
.event { padding:18px 0; border-bottom:1px solid var(--desk-line); }
.event:last-child { border-bottom:0; }
.event:focus { outline:2px solid #8575ab; outline-offset:2px; }
.event-heading { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:13px; color:var(--muted); }
.event-mark { display:grid; place-items:center; flex:none; width:29px; height:29px; border-radius:8px; color:#635476; background:#eae2f4; border:1px solid #d3c6e2; }
.event[data-kind="user"] .event-mark { color:#805358; background:#f9dfd3; border-color:#e7c7c0; }
.event[data-kind="change"] .event-mark { color:#4e6758; background:#e4eee0; border-color:#ccdbcb; }
.event-heading strong { color:var(--ink); font-size:14px; }
.event-heading time { margin-left:auto; font:12px var(--mono); }
.event-body { font-size:15px; line-height:1.75; white-space:pre-wrap; margin:7px 0 0 37px; overflow-wrap:anywhere; }
.event[data-kind="user"] .event-body { width:fit-content; padding:8px 13px; border-radius:3px 12px 12px; background:#f4eae4; }
.chat-timeline .event { border-bottom:0; }
.chat-timeline .event-heading time { margin-left:0; }
.chat-timeline .event[data-kind="user"] { display:flex; flex-direction:column; align-items:flex-end; }
.chat-timeline .event[data-kind="user"] .event-heading { max-width:100%; justify-content:flex-end; }
.chat-timeline .event[data-kind="user"] .event-body {
  max-width:min(85%,68ch); margin-left:0; padding:10px 15px;
  border-radius:14px 3px 14px 14px; background:#f4e6df; text-align:start;
}
.command-runs { margin:0 0 8px 37px; color:var(--muted); font-size:13px; }
.command-runs > summary { width:fit-content; padding:6px 8px; border-radius:6px; cursor:pointer; }
.command-runs > summary:hover { background:#f4f0f6; }
.command-runs ul { margin:3px 0 6px 10px; padding:0 0 0 12px; border-left:2px solid var(--desk-line); list-style:none; }
.command-runs li { display:flex; flex-wrap:wrap; gap:2px 10px; align-items:baseline; padding:4px 0; }
.command-runs time { font:12px var(--mono); }
.file-chat-link { display:flex; align-items:center; gap:10px; max-width:calc(100% - 37px); padding:8px 11px; margin:8px 0 0 37px; border:1px solid #d7cddd; border-radius:9px; color:var(--desk-violet); text-align:left; background:#fffdfa; }
.file-chat-link span { min-width:0; }
.file-chat-link code,.file-chat-link small { display:block; overflow-wrap:anywhere; }
.file-chat-link small { color:var(--muted); margin-top:3px; font-size:12px; }
.file-chat-link:hover { background:#f3eef8; }
.change-card { border:1px solid #dcd3dc; border-radius:9px; overflow:hidden; margin:9px 0 0 37px; background:#fffdfb; }
.change-card summary { padding:9px 12px; cursor:pointer; font:13px/1.6 var(--mono); overflow-wrap:anywhere; }
.change-card summary:hover { background:#f4f0f6; }
.change-card pre { margin:0; border-top:1px solid var(--desk-line); padding:8px 0; background:#f8f6f6; overflow:auto; font:13px/1.6 var(--mono); }
.code-line { display:block; padding:0 11px; min-height:1.6em; width:max-content; min-width:100%; }
.code-line.add { background:#e5f1e1; color:#325635; }
.code-line.remove { background:#f8e5e3; color:#883b42; }
.event .minor { margin:9px 0 0 37px; padding:4px 8px; border:1px solid #d3c7dd; color:var(--desk-violet); background:#fffdfa; font-size:12px; }
.chat-jump { padding:2px 5px; color:#635288; font-size:12px; text-decoration:underline; text-underline-offset:3px; }
.older { display:block; margin:0 auto 10px; }
.activity-notice { position:relative; flex:0 0 0; z-index:1; }
.activity-jump { position:absolute; left:50%; bottom:12px; transform:translateX(-50%); white-space:nowrap; min-height:38px; padding:7px 16px; border-radius:999px; font-size:14px; }
.composer-area { padding:14px clamp(18px,4vw,64px) 19px; background:#fffcf8; border-top:1px solid var(--desk-line); }
.composer { max-width:880px; margin:0 auto; padding:10px 12px; background:#fffefd; border:1px solid #cbbfd3; border-radius:14px; box-shadow:0 3px 0 #ece5e9; }
.composer:focus-within { border-color:#8d79b0; }
.composer textarea { border:0; background:transparent; min-height:46px; resize:vertical; padding:3px 4px; max-height:190px; font-size:15px; }
.composer textarea:focus { outline:0; box-shadow:none; }
.composer-options { position:relative; margin:3px 0 8px; }
.composer-settings { display:flex; align-items:center; flex-wrap:wrap; gap:6px 8px; }
.composer-setting,.skill-picker summary { min-height:30px; border:1px solid #d9cfe0; border-radius:7px; background:#f8f4fa; color:#594a6a; font-size:12px; }
.composer-setting { display:flex; align-items:center; gap:4px; max-width:100%; padding-left:8px; }
.composer-setting > span { color:var(--muted); white-space:nowrap; }
.composer-setting select { min-width:0; max-width:16em; padding:4px 3px; color:inherit; background:transparent; border:0; border-radius:4px; cursor:pointer; font-weight:600; text-overflow:ellipsis; }
.skill-picker { margin-left:auto; }
.skill-picker summary { padding:5px 9px; cursor:pointer; }
.skill-picker[open] summary { border-color:#a492b7; }
.skill-panel { position:absolute; right:0; bottom:calc(100% + 6px); z-index:3; width:min(100%,330px); max-height:45dvh; display:flex; flex-direction:column; gap:8px; padding:12px; border:1px solid #cbbfd3; border-radius:10px; background:#fffdfa; box-shadow:0 5px 18px #49365a26; }
.skill-panel > strong { font-size:13px; }
.skill-panel > input { padding:6px 9px; }
.skill-panel .help,.option-notice { font-size:12px; color:var(--muted); }
.skill-list { overflow:auto; overscroll-behavior:contain; }
.skill-choice { display:flex; align-items:flex-start; gap:8px; padding:7px 3px; border-radius:5px; cursor:pointer; }
.skill-choice:hover,.skill-choice:focus-within { background:#f6f0f8; }
.skill-choice input { flex:none; width:16px; height:16px; margin:2px 0 0; padding:0; accent-color:var(--violet); }
.skill-choice strong,.skill-choice small { display:block; font-size:13px; overflow-wrap:anywhere; }
.skill-choice small { color:var(--muted); font-size:12px; line-height:1.5; }
.option-notice { margin-top:6px; }
.reset-options { padding:3px 5px; margin-left:4px; color:var(--desk-violet); text-decoration:underline; text-underline-offset:2px; }
.composer-foot { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.composer-foot .help { font-size:12px; }
.composer kbd { display:inline-block; padding:0 4px; border:1px solid #ddd6dc; border-bottom-width:2px; border-radius:4px; background:#f7f4f5; font:11px/1.5 var(--mono); }
.composer-foot .btn { min-height:34px; padding:6px 12px; }
.notice { max-width:880px; margin:0 auto; display:flex; align-items:center; justify-content:center; gap:8px; font-size:14px; line-height:1.6; color:var(--muted); }
.notice .btn { margin-left:3px; min-height:34px; padding:5px 10px; white-space:nowrap; }
.mobile-only,.scrim { display:none; }
@media(max-width:700px) {
  .view-title { gap:9px; }
  .view-icon { width:34px; height:34px; border-radius:9px; }
  .view-icon .symbol { transform:none; }
  .pane.empty { padding:10px; }
  .pane.empty .empty { padding:20px 7px; }
  .file-chat-link { max-width:100%; }
}
@media(max-width:380px) {
  .view-icon { display:none; }
  .notice { flex-wrap:wrap; }
}

/* Dialogs and smaller screens */
dialog { width:min(94vw,435px); max-height:min(90dvh,750px); padding:0; border:1.5px solid #b5a6bc; border-radius:15px; color:var(--ink); background:#fffdfa; box-shadow:4px 5px 0 #53485e35,0 20px 70px #33253d2e; }
dialog::backdrop { background:#31283e63; }
.dialog-body { padding:24px; }
.dialog-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.dialog-head h2 { font-size:22px; letter-spacing:-.045em; }
.dialog-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:20px; }
.dialog-note { color:var(--muted); font-size:14px; line-height:1.7; margin-top:14px; }
.code-box,.folder-location { color:#524666; background:#f5eff7; border:1px solid #dfd4e4; border-radius:8px; }
.code-box { white-space:pre-wrap; overflow-wrap:anywhere; word-break:break-all; padding:11px 12px; font:13px/1.65 var(--mono); }
.folder-settings { display:grid; gap:14px; padding-top:20px; }
.folder-project { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.folder-location { padding:12px 14px; font:14px/1.6 var(--mono); overflow-wrap:anywhere; }
.folder-settings .dialog-note { margin:0; }
.folder-settings .actions,.folder-suggestions .actions { flex-wrap:wrap; }
.folder-suggestions {
  display:grid; gap:9px; padding:12px clamp(20px,4vw,64px); max-height:40%; overflow:auto;
  border-bottom:1px solid var(--desk-line); background:#faf6fc; font-size:14px;
}
.folder-suggestions .btn,.location-settings .btn { min-height:32px; padding:5px 12px; }
.folder-choices { margin:0; padding:6px 12px; min-width:0; border:1px solid #dfd4e4; border-radius:8px; }
.folder-choices legend { font-weight:650; }
.folder-choices label,.search-locations li { display:flex; gap:9px; align-items:baseline; padding:4px 0; }
.folder-choices label { cursor:pointer; }
.folder-choices input { flex:none; width:1em; height:1em; margin:0; padding:0; accent-color:var(--violet); }
.folder-choices span,.search-locations span { min-width:0; overflow-wrap:anywhere; font:14px/1.6 var(--mono); }
.location-settings { margin-top:20px; padding-top:16px; border-top:1px solid var(--line); }
.location-settings h3 { font-size:16px; margin:0 0 5px; }
.search-locations { padding:0; margin:8px 0; list-style:none; }
.search-locations li { justify-content:space-between; }
.search-locations button { flex-shrink:0; }
.provider-options { display:flex; gap:8px; }
.provider-option { flex:1; padding:9px 10px; border:1px solid #b5a2cd; color:#57426d; background:#f0eaf6; border-radius:7px; display:flex; justify-content:space-between; align-items:center; }
.provider-option.off { color:#716d76; background:#f4f2f1; border-color:#ddd8d9; }
.provider-option small { font-size:12px; font-weight:450; }
#notifications { position:fixed; inset:auto 16px 16px auto; z-index:20; pointer-events:none; }
.toast { border-radius:9px; padding:12px 17px; color:white; background:#493d59; box-shadow:0 4px 20px #33253d24; font-size:14px; max-width:min(500px,calc(100vw - 32px)); }
@media(max-width:1000px) {
  .auth-main { width:calc(100% - 64px); gap:32px; grid-template-columns:minmax(0,1fr) minmax(320px,.9fr); }
  .art-caption h2 { max-width:9em; }
  .room-picture { aspect-ratio:1.48; }
}
@media(max-width:900px) { .workspace { grid-template-columns:235px minmax(0,1fr); } }
@media(max-width:760px) {
  .mast-inner,.status-inner { width:calc(100% - 40px); }
  .mast-inner { min-height:61px; }
  .mast-inner .brand { font-size:22px; }
  .mast-inner .brand-mark { width:31px; }
  .auth-main { width:min(calc(100% - 40px),465px); grid-template-columns:1fr; gap:18px; padding:24px 0 32px; align-content:center; }
  .auth-art { display:grid; grid-template-columns:minmax(0,1fr) minmax(95px,30%); align-items:center; gap:12px; }
  .art-caption { margin:0; }
  .art-caption h2 { max-width:none; font-size:clamp(18px,4.9vw,25px); line-height:1.5; }
  .art-caption p { font-size:12px; margin-top:5px; line-height:1.65; }
  .art-caption p br { display:none; }
  .room-preview { border-radius:8px; box-shadow:2px 3px 0 #dbd1de; }
  .room-bar { display:none; }
  .room-picture { aspect-ratio:1.25; }
  .auth-card { padding:24px; box-shadow:3px 4px 0 #e2dbe1; }
  .auth-card .intro { margin-bottom:19px; }
  .status-inner { min-height:38px; }
}
@media(max-width:700px) {
  .workspace { grid-template-columns:1fr; } .mobile-only { display:inline-flex; }
  .sidebar { position:fixed; left:0; top:0; bottom:0; z-index:8; width:min(290px,85vw); visibility:hidden; transform:translateX(-104%); transition:transform .17s,visibility 0s linear .17s; }
  .workspace.show-menu .sidebar { visibility:visible; transform:none; transition-delay:0s; }
  .workspace.show-menu .scrim { position:fixed; display:block; inset:0; background:#33293f5e; z-index:7; border-radius:0; }
  .topbar { min-height:55px; padding:8px 12px; gap:5px; }
  .toolbar,.crumbs { gap:5px; } .crumbs .root-crumb,.crumbs .slash { display:none; }
  .topbar .btn { padding:5px 7px; min-height:32px; }
  .topbar .btn .symbol { display:none; }
  .view-head { padding:19px 16px 15px; gap:8px; }
  .timeline { padding:8px 16px 20px; } .composer-area { padding:10px 12px max(12px,env(safe-area-inset-bottom)); }
  .event-heading time { font-size:11px; } .composer-foot .help { font-size:11px; }
  .event-body,.change-card,.command-runs,.event .minor,.file-chat-link { margin-left:0; }
}
@media(prefers-reduced-motion:reduce) { * { transition:none!important; scroll-behavior:auto!important; } }
.git-panel { min-width: 0; overflow-wrap: anywhere; }
dialog:has(.git-panel) { width: min(94vw, 760px); }
.git-panel h3, .git-panel p { margin: 0; }
.git-panel textarea, .git-diff, .git-branch { font-family: ui-monospace, Consolas, monospace; }
.git-panel textarea { width: 100%; resize: vertical; white-space: pre; }
.git-diff { max-height: 35vh; overflow: auto; padding: .75rem; background: #f4f1eb; font-size: .82rem; white-space: pre; }
.git-panel summary { cursor: pointer; }
.git-pr { display: grid; gap: .65rem; padding-top: .8rem; border-top: 1px solid #ddd6cb; }
