:root {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #eff0f7;
  background: #10121b;
  color-scheme: dark;
  --surface: #141722;
  --panel: #161926;
  --raised: #1b1f2e;
  --line: #292d40;
  --muted: #a2a8bf;
  --accent: #af9cfa;
  --accent-bg: #282341;
  --primary: #aa94f9;
  --primary-text: #181127;
  --green: #73d9ad;
  --amber: #f2c276;
  --red: #ff9da9;
  --radius: .7rem;
  --nav-width: 16.25rem;
  --inspector-width: 19rem;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 300px; min-height: 100dvh; margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
button, select, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent); }
h1, h2, h3, h4, p { margin: 0; }
svg.icon { width: 1.05rem; height: 1.05rem; display: inline-block; vertical-align: -.15em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.button, .icon-button {
  min-height: 2.35rem; border: 1px solid transparent; border-radius: .55rem; display: inline-flex;
  justify-content: center; align-items: center; gap: .5rem; color: inherit; background: transparent;
  font-size: .875rem; font-weight: 650;
}
.button { padding: .5rem .8rem; }
.icon-button { min-width: 2.15rem; min-height: 2.15rem; padding: .35rem; color: var(--muted); }
.icon-button:hover:not(:disabled), .subtle:hover:not(:disabled) { background: var(--raised); color: #f0efff; }
.primary { background: var(--primary); color: var(--primary-text); }
.primary:hover:not(:disabled) { background: #c0adff; }
.secondary { color: #edebfa; background: var(--raised); border-color: var(--line); }
.secondary:hover:not(:disabled) { background: #25293d; }
.subtle { color: var(--muted); }
.button svg.icon, .icon-button svg.icon { vertical-align: middle; }
input, textarea, select {
  width: 100%; min-width: 0; background: #11131d; border: 1px solid #35394e; border-radius: .52rem;
  color: #f4f3fb; padding: .65rem .72rem; font-size: 1rem;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #9299b4; }
input[type="file"] { padding: .48rem; }
input[type="file"]::file-selector-button {
  background: var(--accent-bg); color: #e8e0fa; font: inherit; font-size: .875rem; font-weight: 650;
  border: 0; border-radius: .33rem; padding: .48rem .66rem; margin-right: .65rem; cursor: pointer;
}
label { display: block; font-size: .875rem; font-weight: 620; }
label small { color: var(--muted); font-size: inherit; font-weight: 400; }
select { appearance: none; background-image: url("/chevron.svg"); background-repeat: no-repeat; background-position: right .65rem center; background-size: 1rem; padding-right: 2rem; }
.help { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.form-error { color: var(--red); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; line-height: 1.5; }

.auth {
  min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem;
  background: radial-gradient(ellipse at 50% 25%, #272040 0%, transparent 50%), radial-gradient(#282639 1px, transparent 1px) 50% 50% / 19px 19px, #10121b;
}
.login-card {
  width: min(100%, 27rem); padding: clamp(1.3rem, 5vw, 2.5rem); background: #161925;
  border: 1px solid #33364a; border-radius: 1rem; box-shadow: 0 24px 90px #090a1090;
}
.brand { display: flex; align-items: center; gap: .7rem; font-size: 1.15rem; font-weight: 750; letter-spacing: -.02em; }
.brand-icon, .dialog-icon, .session-glyph, .agent-avatar, .empty-icon {
  display: inline-flex; align-items: center; justify-content: center; background: var(--accent-bg); color: #c2b1ff;
  border: 1px solid #413568; border-radius: .65rem; flex: none;
}
.brand-icon { width: 2.12rem; height: 2.12rem; background: linear-gradient(145deg, #8465e7, #5340a2); color: white; }
.brand-icon .icon { width: 1.35rem; height: 1.35rem; }
.login-card h1 { font-size: clamp(1.4rem, 4vw, 1.72rem); letter-spacing: -.035em; margin: 1.7rem 0 .45rem; }
.login-card > p { line-height: 1.5; }
.login-card form { display: grid; gap: .45rem; margin-top: 1.6rem; }
.login-card input { margin-bottom: .55rem; }
.login-card .primary { margin-top: .5rem; min-height: 2.6rem; }
.notice { margin-top: 1rem; border: 1px solid #624d32; background: #30271f; border-radius: .5rem; color: var(--amber); font-size: .9rem; line-height: 1.55; padding: .8rem; }

.workspace { display: grid; grid-template-columns: var(--nav-width) minmax(0, 1fr) var(--inspector-width); height: 100dvh; overflow: hidden; }
.sidebar, .inspector { background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.sidebar { border-right: 1px solid var(--line); }
.sidebar-top, .topbar, .inspector-title { min-height: 4.2rem; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.sidebar-top { justify-content: space-between; padding: 0 1.1rem; }
.nav-scroll { flex: 1; overflow: auto; padding: .9rem .75rem; min-height: 0; }
.nav-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 .18rem 0 .5rem; margin-bottom: .3rem; }
.nav-heading h2, .inspector-title h2 { color: #c3c7d8; font-size: .875rem; font-weight: 680; }
.nav-heading .icon-button { min-width: 1.8rem; min-height: 1.8rem; }
#session-nav { margin-top: 1.6rem; }
.nav-item {
  display: flex; gap: .55rem; align-items: center; width: 100%; min-height: 2.4rem;
  color: #c0c4d7; background: transparent; border: 1px solid transparent; border-radius: .5rem;
  text-align: left; font-size: .9rem; font-weight: 525; padding: .45rem .57rem;
}
.nav-item:hover { background: var(--raised); color: #eeebfa; }
.nav-item[aria-current="true"] { background: var(--accent-bg); border-color: #433963; color: #e8e0ff; }
.nav-item[aria-current="true"] .icon { color: #baabfa; }
.nav-item .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-list { padding: .2rem .55rem; font-size: .85rem; color: var(--muted); line-height: 1.5; }
.sidebar-bottom { padding: .65rem .75rem .8rem; }
.team-button { margin-bottom: .55rem; }
.profile { border-top: 1px solid var(--line); padding: .8rem .15rem 0; display: flex; gap: .6rem; align-items: center; min-width: 0; }
.avatar { width: 2.05rem; height: 2.05rem; display: grid; place-items: center; background: #26233b; color: #d6c9ff; border-radius: 50%; flex: none; font-weight: 700; }
.profile-text { flex: 1; min-width: 0; }
.profile-text strong, .profile-text small { display: block; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.profile-text strong { font-size: .88rem; }
.profile-text small { color: var(--muted); font-size: .79rem; margin-top: .12rem; }
.profile > .icon-button { margin-left: auto; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #10121b; }
.topbar { gap: .7rem; padding: 0 1.4rem; min-width: 0; }
.breadcrumbs { display: flex; flex: 1; min-width: 0; gap: .65rem; align-items: center; color: var(--muted); font-size: .9rem; }
.breadcrumbs strong { color: #eeedf8; font-weight: 620; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumbs .icon { width: .8rem; height: .8rem; color: #8288a5; }
.menu-toggle, .inspector-toggle, .mobile-close { display: none; }
.chat-heading { display: flex; align-items: center; gap: .7rem; padding: .75rem 1.4rem; background: #12151f; border-bottom: 1px solid var(--line); }
.session-glyph { width: 2.18rem; height: 2.18rem; border-radius: .54rem; }
.chat-heading h1 { font-size: 1.03rem; overflow-wrap: anywhere; }
.chat-heading p { margin-top: .2rem; font-size: .8rem; color: var(--muted); }
.chat-scroll { flex: 1; min-height: 0; overflow: auto; scrollbar-color: #3a3c50 transparent; }
.chat-content { max-width: 55rem; min-height: 100%; margin: auto; padding: 1.5rem clamp(.95rem, 4vw, 2.1rem); }
.chat-content.is-empty { display: grid; place-items: center; }
.empty-state { display: grid; justify-items: center; text-align: center; max-width: 32rem; padding: 2.3rem 0; }
.empty-icon { width: 3.9rem; height: 3.9rem; border-radius: 1rem; position: relative; box-shadow: 0 0 55px #a17ef324; background: linear-gradient(145deg, #352956, #221d38); }
.empty-icon .icon { width: 1.9rem; height: 1.9rem; stroke-width: 1.5; }
.empty-state h2 { margin-top: 1.15rem; font-size: clamp(1.35rem, 4vw, 1.85rem); letter-spacing: -.04em; }
.empty-state p { color: var(--muted); line-height: 1.6; margin: .6rem 0 1.3rem; }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; }
.suggestions .button { font-weight: 550; font-size: .86rem; }
.quota-warning { display: flex; gap: .6rem; align-items: flex-start; padding: .65rem 1.4rem; color: #ffdaa1; background: #31261d; border-bottom: 1px solid #5d4530; font-size: .9rem; line-height: 1.5; }
.quota-warning .icon { margin-top: .15rem; }
.composer-area { width: min(100%, 55rem); margin: 0 auto; padding: .5rem clamp(.95rem, 4vw, 2.1rem) .85rem; }
.composer { background: #191c2a; border: 1px solid #373951; border-radius: .8rem; }
.composer:focus-within { border-color: #8070be; }
.composer textarea { display: block; width: 100%; min-height: 4.35rem; max-height: 13rem; border: 0; background: transparent; resize: vertical; padding: .8rem .85rem .3rem; outline: none; line-height: 1.45; }
.composer-toolbar { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .4rem .55rem .55rem; }
.composer-buttons { display: flex; gap: .4rem; align-items: center; }
.model-select { display: flex; align-items: center; gap: .35rem; min-width: 0; color: var(--accent); padding-left: .3rem; }
.model-select select { width: auto; max-width: min(14rem, 46vw); padding: .43rem 1.7rem .43rem .25rem; background-color: transparent; border: 1px solid transparent; color: #ddd7f3; font-size: .86rem; text-overflow: ellipsis; }
.model-select select:hover { background-color: var(--accent-bg); }
.model-select select option { background: var(--raised); color: #f5efff; }
.composer-meta { display: flex; justify-content: space-between; gap: .75rem; padding: .48rem .12rem 0; font-size: .8rem; color: var(--muted); }
.dot-separator::before { content: "·"; padding: 0 .28rem; }

.inspector { border-left: 1px solid var(--line); overflow: hidden; }
.inspector-title { flex: none; padding: 0 1rem; justify-content: space-between; }
.inspector-section { padding: .9rem 1rem 1.1rem; min-height: 0; flex: 1; overflow: auto; scrollbar-color: #3a3c50 transparent; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-bottom: .55rem; }
.section-heading h3 { display: flex; align-items: center; gap: .52rem; font-size: .92rem; font-weight: 650; }
.section-heading h3 .icon { color: var(--accent); }
.section-heading .icon-button { min-height: 1.8rem; min-width: 1.8rem; }
.git-summary { background: #191c29; border: 1px solid var(--line); border-radius: .6rem; padding: .7rem .65rem; }
.branch-name { display: flex; gap: .45rem; font: 650 .86rem/1.5 "SFMono-Regular", Consolas, monospace; color: #e1d8ff; overflow-wrap: anywhere; }
.git-meta { color: var(--muted); font-size: .83rem; line-height: 1.4; margin-top: .3rem; }
.change-list { list-style: none; margin: .65rem 0 0; padding: 0; max-height: 13rem; overflow: auto; }
.change-list li { display: flex; gap: .45rem; align-items: baseline; padding: .36rem .05rem; border-bottom: 1px solid var(--line); font-size: .82rem; }
.change-list code { color: #d6d7e7; overflow-wrap: anywhere; }
.change-code { display: inline-block; min-width: 1.8rem; text-align: center; background: #20362f; border-radius: .22rem; padding: .13rem .2rem; color: #9ce2c5; font: .75rem "SFMono-Regular", Consolas, monospace; }
.change-code.modified { background: #3d3125; color: #f2c88a; }
.change-code.deleted { background: #432a35; color: #ffadba; }
.git-buttons { display: flex; flex-wrap: wrap; gap: .42rem; margin-top: .7rem; }
.git-buttons .button:first-child { flex: 1; }
.git-buttons .button { min-width: 0; }
.usage-group { margin-top: .95rem; }
.usage-group h4 { color: #e7e5f4; font-size: .9rem; margin-bottom: .53rem; font-weight: 650; }
.usage-row + .usage-row { margin-top: .65rem; }
.usage-label { display: flex; justify-content: space-between; align-items: baseline; gap: .3rem; color: #c9cbdc; font-size: .8rem; }
.usage-label strong { flex: none; font-size: .82rem; font-variant-numeric: tabular-nums; color: #d5c9ff; }
.usage-row.low .usage-label strong { color: var(--amber); }
progress { appearance: none; width: 100%; height: .32rem; display: block; border: none; border-radius: 2rem; overflow: hidden; background: #292c40; margin: .33rem 0 .2rem; }
progress::-webkit-progress-bar { background: #292c40; }
progress::-webkit-progress-value { background: #a690f1; border-radius: 2rem; }
progress::-moz-progress-bar { background: #a690f1; border-radius: 2rem; }
.usage-row.low progress::-webkit-progress-value { background: var(--amber); }
.usage-row.low progress::-moz-progress-bar { background: var(--amber); }
.reset-time { font-size: .75rem; color: var(--muted); }
.checked-time { margin-top: .9rem; color: var(--muted); font-size: .78rem; }

.activity + .activity { margin-top: 1.45rem; }
.activity-stack { display: grid; gap: 1.35rem; }
.message { display: flex; gap: .65rem; align-items: flex-start; min-width: 0; }
.message-body { flex: 1; min-width: 0; }
.message-head { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .55rem; row-gap: .2rem; margin-bottom: .42rem; }
.message-head strong { font-size: .91rem; }
.message-head small { color: var(--muted); font-size: .76rem; }
.user-avatar, .agent-avatar { width: 1.92rem; height: 1.92rem; display: grid; place-items: center; flex: none; border-radius: .52rem; }
.user-avatar { background: #263047; color: #c2d4f5; font-size: .79rem; font-weight: 700; }
.prompt-text { padding: .78rem .85rem; background: #1b1e2c; border: 1px solid #2b2e42; border-radius: .6rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.answer { line-height: 1.65; overflow-wrap: anywhere; min-width: 0; }
.answer > * + * { margin-top: .65rem; }
.answer h1, .answer h2, .answer h3, .answer h4 { font-size: 1.1rem; line-height: 1.4; }
.answer ul, .answer ol { padding-left: 1.5rem; }
.answer pre, .detail pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #0e1018; border: 1px solid var(--line); border-radius: .44rem; padding: .65rem .7rem; color: #d1cee2; font-size: .83rem; line-height: 1.5; }
.answer pre:has(> .hljs) { white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.answer :not(pre) > code { background: var(--raised); border-radius: .23rem; padding: .12em .24em; font-size: .9em; }
.answer blockquote { border-left: 2px solid var(--accent); padding-left: .75rem; color: var(--muted); margin-left: 0; }
.answer table { display: block; width: max-content; max-width: 100%; overflow: auto; border-collapse: collapse; }
.answer th, .answer td { border: 1px solid var(--line); padding: .35rem .5rem; }
.tool-stack { display: grid; gap: .34rem; margin: .45rem 0 .75rem; }
.detail { border: 1px solid var(--line); border-radius: .48rem; background: #151823; color: #d2d4e5; }
.detail summary { padding: .49rem .56rem; list-style: none; cursor: pointer; display: flex; gap: .4rem; align-items: center; font-size: .82rem; }
.detail summary::-webkit-details-marker { display: none; }
.detail summary .chevron { color: var(--muted); }
.detail[open] summary .chevron { transform: rotate(90deg); }
.detail summary .label { min-width: 0; overflow-wrap: anywhere; }
.detail summary .state { margin-left: auto; color: var(--muted); font-size: .77rem; flex: none; }
.detail > pre { max-height: 15rem; overflow-y: auto; margin: .18rem .55rem .55rem; }
.turn-meta { display: flex; gap: .58rem; flex-wrap: wrap; margin: .55rem 0; color: var(--muted); font-size: .79rem; }
.activity-error { margin-top: .55rem; color: var(--red); white-space: pre-wrap; line-height: 1.5; font-size: .87rem; }
.git-message { border: 1px solid var(--line); border-radius: .6rem; background: #161a26; padding: .7rem .8rem; }
.git-message .icon { color: var(--accent); }
.git-message p + p { margin-top: .3rem; }
.spinner {
  border: 2px solid #5a5077; border-top-color: #e1d7ff; width: .85rem; height: .85rem;
  display: inline-block; border-radius: 50%; vertical-align: -.1em; margin-right: .18rem; animation: rotate .9s linear infinite;
}
@keyframes rotate { to { transform: rotate(360deg); } }
.history-control { margin-bottom: 1.3rem; display: flex; justify-content: center; }

dialog {
  width: min(calc(100% - 1.5rem), 31.5rem); max-height: calc(100dvh - 2rem); overflow: auto; border: 1px solid #3a3c51;
  border-radius: .9rem; background: #191c29; padding: 1.2rem 1.3rem 1.35rem; color: #f4f2fa; box-shadow: 0 18px 85px #060711ae;
}
dialog::backdrop { background: #060710b8; backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .65rem; }
.dialog-icon { width: 2.3rem; height: 2.3rem; }
dialog h2 { font-size: 1.28rem; letter-spacing: -.025em; }
dialog form { display: grid; gap: .48rem; margin-top: .95rem; }
dialog form label:not(:first-child) { margin-top: .33rem; }
dialog .form-error { margin-top: .15rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .45rem; flex-wrap: wrap; margin-top: .5rem; }
.dialog-note { margin: .6rem 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }
#user-list { margin-top: .75rem; max-height: 12rem; overflow: auto; }
.user-row { display: flex; align-items: center; gap: .55rem; justify-content: space-between; border-bottom: 1px solid var(--line); padding: .47rem .15rem; font-size: .9rem; }
.user-row p { font-size: .81rem; color: var(--muted); }
.user-row span { font-size: .78rem; color: #c9bef2; flex: none; }
.toast {
  position: fixed; z-index: 6; bottom: 1rem; left: 50%; transform: translateX(-50%); width: max-content;
  max-width: calc(100% - 2rem); border: 1px solid #4d466b; border-radius: .57rem; background: #232137;
  color: #f1eafd; padding: .66rem .9rem; font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere;
  box-shadow: 0 6px 26px #090a12a0;
}
.toast.error { border-color: #683c4b; color: #ffc4ce; }
.scrim { display: none; }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: var(--nav-width) minmax(0, 1fr); }
  .inspector-toggle, .inspector .mobile-close { display: inline-flex; }
  .inspector { position: fixed; right: 0; top: 0; bottom: 0; width: min(var(--inspector-width), 90vw); z-index: 4; visibility: hidden; }
  .workspace.show-inspector .inspector { visibility: visible; }
  .scrim { display: block; position: fixed; z-index: 3; inset: 0; width: 100%; border: 0; background: #05060db0; }
}
@media (max-width: 700px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .menu-toggle, .sidebar .mobile-close { display: inline-flex; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(var(--nav-width), 90vw); z-index: 4; visibility: hidden; }
  .workspace.show-navigation .sidebar { visibility: visible; }
  .topbar { padding: 0 .56rem; gap: .38rem; min-height: 3.35rem; }
  .sidebar-top, .inspector-title { min-height: 3.35rem; }
  .chat-heading { padding: .62rem .85rem; }
  .quota-warning { padding: .63rem .85rem; }
  .composer-meta > span:last-child { display: none; }
  .composer-meta { padding-bottom: env(safe-area-inset-bottom); }
  .message { gap: .43rem; }
  .inspector-toggle { padding: .45rem .55rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; }
}

.composer-options { display: flex; flex: 1; align-items: center; gap: .35rem; min-width: 0; }
.composer-options .model-select { min-width: 0; }
.draft-files { display: flex; flex-wrap: wrap; gap: .36rem; padding: .16rem .85rem .3rem; max-height: 6.5rem; overflow: auto; }
.draft-chip {
  display: inline-flex; gap: .4rem; align-items: center; max-width: 100%; padding: .12rem .15rem .12rem .45rem;
  border: 1px solid #453a64; border-radius: .45rem; background: var(--accent-bg); color: #e0d5fd; font-size: .83rem;
}
.draft-chip > span { max-width: 13.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-chip .icon-button { min-width: 1.65rem; min-height: 1.65rem; border: 0; padding: .2rem; }
.draft-chip .icon { width: .9rem; height: .9rem; }
.message-files { display: grid; gap: .35rem; padding: 0; margin: .45rem 0 0; list-style: none; }
.message-files li {
  display: flex; gap: .48rem; align-items: flex-start; padding: .5rem .65rem; border: 1px solid var(--line);
  border-radius: .45rem; background: #181b29; font-size: .84rem;
}
.message-files .icon { color: var(--accent); }
.message-files strong, .message-files code { display: block; overflow-wrap: anywhere; }
.message-files code { color: var(--muted); margin-top: .12rem; font-size: .78rem; }

@media (max-width: 420px) {
  .model-select > [data-icon] { display: none; }
}

.form-fields { display: grid; gap: .48rem; margin-top: .33rem; }
.danger { background: #f49aa7; color: #27131b; }
.danger:hover:not(:disabled) { background: #ffb0ba; }
.danger-quiet:hover:not(:disabled) { color: var(--red); background: #3b2532; }

.nav-row { display: flex; align-items: center; gap: .18rem; }
.nav-row + .nav-row { margin-top: .16rem; }
.nav-row .nav-item { flex: 1; min-width: 0; }
.nav-delete { flex: 0 0 auto; }
.nav-row .nav-delete { width: 1.8rem; min-width: 1.8rem; margin-right: -.15rem; }
.nav-row .nav-delete .icon { width: .88rem; height: .88rem; }
.chat-heading-text { flex: 1; min-width: 0; }

.inspector-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: .48rem .58rem; gap: .22rem; border-bottom: 1px solid var(--line); }
.inspector-tabs button {
  display: flex; justify-content: center; align-items: center; gap: .38rem; min-height: 2.36rem;
  background: transparent; border: 1px solid transparent; border-radius: .46rem; color: var(--muted);
  font-size: .85rem; font-weight: 620; padding: .35rem .22rem;
}
.inspector-tabs button .icon { width: .95rem; height: .95rem; }
.inspector-tabs button:hover { background: var(--raised); color: #f0efff; }
.inspector-tabs button[aria-selected="true"] { background: var(--accent-bg); color: #ece4ff; border-color: #433963; }
.file-inspector { display: flex; flex-direction: column; padding: .75rem .62rem 0; overflow: hidden; }
.file-inspector .section-heading { flex: none; margin: 0 .37rem .48rem; }
#file-tree { min-height: 0; overflow: auto; flex: 1; padding: 0 0 1rem; scrollbar-color: #3a3c50 transparent; }
#file-tree > .help { padding: 0 .37rem; }
.tree-root, .tree-group { list-style: none; padding: 0; margin: 0; }
.tree-group { margin-left: .53rem; padding-left: .42rem; border-left: 1px solid #32364c; }
.tree-row {
  display: flex; align-items: center; gap: .4rem; width: 100%; min-width: 0; min-height: 1.83rem;
  padding: .22rem .28rem; border: 1px solid transparent; border-radius: .32rem; background: none;
  color: #dedfea; text-align: start; font-size: .86rem;
}
.tree-row:hover { background: var(--raised); }
.tree-row:focus-visible { outline-offset: -2px; }
.tree-row[aria-selected="true"] { background: var(--accent-bg); border-color: #433963; color: #f2edff; }
.tree-row[aria-disabled="true"] { color: var(--muted); cursor: default; }
.tree-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tree-disclosure { display: inline-flex; justify-content: center; width: .78rem; flex: none; color: var(--muted); }
.tree-disclosure .icon { width: .78rem; height: .78rem; }
.tree-folder { color: #baa7f7; }
.tree-code { color: #90b9f6; }
.tree-image { color: #8ed5b6; }
.tree-video, .tree-audio { color: #ecc07f; }
.tree-file, .tree-link { color: #a7aec6; }
.tree-feedback { color: var(--muted); font-size: .83rem; padding: .36rem .5rem .38rem 1.65rem; overflow-wrap: anywhere; }
.tree-more {
  background: none; border: 0; color: var(--accent); padding: .34rem .45rem; margin: .15rem .18rem .15rem 1rem;
  border-radius: .3rem; font-size: .83rem; text-align: start;
}
.tree-feedback .tree-more { margin: .2rem 0 0; display: block; }
.tree-more:hover { background: var(--accent-bg); }

.file-preview { display: flex; flex: 1; flex-direction: column; min-height: 0; min-width: 0; }
.file-preview-bar {
  display: flex; align-items: center; gap: .65rem; padding: .66rem 1rem;
  min-height: 3.45rem; border-bottom: 1px solid var(--line); background: #12151f;
}
.file-preview-bar > .button { flex: none; text-decoration: none; white-space: nowrap; }
.file-preview-name { flex: 1; min-width: 0; }
.file-preview-name strong, .file-preview-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview-name strong { font-size: .92rem; }
.file-preview-name small { color: var(--muted); margin-top: .2rem; font-size: .79rem; }
.file-preview-content { flex: 1; min-width: 0; min-height: 0; overflow: auto; }
.preview-message { display: grid; place-items: center; text-align: center; padding: 1.25rem; }
.preview-text pre { margin: 0; padding: 1rem 1.35rem; tab-size: 4; line-height: 1.65; font-size: .88rem; color: #ebebf5; }
.numbered-code { display: flex; min-width: 100%; width: max-content; min-height: 100%; }
.preview-text .code-line-numbers {
  position: sticky; left: 0; flex: none; min-width: 3.1rem; padding-inline: .63rem;
  background: var(--surface); border-right: 1px solid var(--line); color: #929ab3;
  font-variant-numeric: tabular-nums; text-align: right; user-select: none;
}
.hljs { color: #e8e9f3; }
.hljs :is(.hljs-comment, .hljs-quote) { color: #9aa2bb; font-style: italic; }
.hljs :is(.hljs-keyword, .hljs-selector-tag, .hljs-doctag, .hljs-operator) { color: #c8abff; }
.hljs :is(.hljs-string, .hljs-regexp, .hljs-addition) { color: #a4ddb5; }
.hljs :is(.hljs-number, .hljs-literal, .hljs-symbol, .hljs-bullet, .hljs-meta) { color: #f3c28b; }
.hljs :is(.hljs-title, .hljs-section, .hljs-function, .hljs-selector-id) { color: #a1c8ff; }
.hljs :is(.hljs-type, .hljs-built_in, .hljs-name, .hljs-tag) { color: #87dbda; }
.hljs :is(.hljs-attribute, .hljs-attr, .hljs-property, .hljs-variable, .hljs-selector-class) { color: #f1b1d2; }
.hljs :is(.hljs-link, .hljs-deletion) { color: #ffa5ad; }
.hljs .hljs-subst { color: #e8e9f3; }
.hljs .hljs-emphasis { font-style: italic; }
.hljs .hljs-strong { font-weight: 700; }
.preview-note { padding: .7rem 1.35rem; color: var(--muted); border-bottom: 1px solid var(--line); font-size: .86rem; }
.preview-media { display: grid; align-content: center; justify-items: center; padding: 1rem; }
.preview-media img, .preview-media video { display: block; max-width: 100%; max-height: calc(100dvh - 13rem); object-fit: contain; border-radius: .45rem; }
.preview-media video { background: #080910; }
.preview-media audio { width: min(100%, 30rem); }
@media (max-width: 700px) {
  .file-preview-bar { padding-inline: .47rem; gap: .38rem; }
  .file-preview-bar > .button { padding-inline: .45rem; }
  .file-preview-bar > .button svg.icon { display: none; }
  .preview-text pre { padding-inline: .8rem; }
}
