:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  --bg: #111214;
  --rail: #161719;
  --panel: rgba(255, 255, 255, 0.065);
  --panel-strong: rgba(255, 255, 255, 0.11);
  --ink: #f5f5f7;
  --muted: #a8abb2;
  --subtle: #6f737c;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.24);
  --primary: #f5f5f7;
  --blue: #3da1ff;
  --green: #35c759;
  --orange: #ff9f0a;
  --red: #ff453a;
  --violet: #bf5af2;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.46);
  --glow: 0 0 160px rgba(47, 94, 255, 0.25);
}

* {
  box-sizing: border-box;
}

::selection {
  background: rgba(61, 161, 255, 0.36);
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease, opacity 160ms ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.primary-btn:disabled,
.send-btn:disabled {
  background: rgba(255, 255, 255, 0.12);
  color: var(--muted);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(61, 161, 255, 0.72);
  outline-offset: 3px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 42px;
  padding: 9px 12px;
}

textarea {
  padding: 12px 14px;
  resize: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow: 0 0 0 4px rgba(61, 161, 255, 0.14);
}

h1,
h2,
p {
  margin: 0;
}

a {
  color: var(--blue);
}

.hidden {
  display: none !important;
}

.hidden-input {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-overlay {
  position: fixed;
  inset: 18px;
  z-index: 80;
  display: grid;
  place-items: center;
  border: 1px solid rgba(61, 161, 255, 0.55);
  border-radius: 28px;
  background: rgba(8, 13, 24, 0.72);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.985);
  transition: opacity 160ms ease, transform 160ms ease;
  backdrop-filter: blur(26px) saturate(1.2);
}

.drop-overlay div {
  display: grid;
  justify-items: center;
  gap: 8px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  padding: 24px 30px;
}

.drop-overlay strong {
  font-size: 28px;
}

.drop-overlay span {
  color: var(--muted);
  font-size: 13px;
}

.app-shell.drop-active .drop-overlay {
  opacity: 1;
  transform: scale(1);
}

.command-palette {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 11vh 18px 18px;
  background: rgba(5, 7, 12, 0.58);
  backdrop-filter: blur(18px) saturate(1.18);
}

.palette-panel {
  width: min(640px, 100%);
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  background: rgba(28, 30, 36, 0.92);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55);
  padding: 12px;
}

.palette-panel::before {
  content: "";
  display: none;
  width: 42px;
  height: 4px;
  justify-self: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

#commandSearchInput {
  min-height: 54px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 17px;
}

.command-list {
  max-height: min(52vh, 460px);
  overflow: auto;
  display: grid;
  gap: 6px;
  scrollbar-width: thin;
}

.command-item {
  display: grid;
  gap: 4px;
  border-radius: 16px;
  background: transparent;
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.command-item:hover,
.command-item:focus-visible {
  background: rgba(255, 255, 255, 0.1);
}

.command-item strong {
  font-size: 14px;
}

.command-item span,
.palette-empty {
  color: var(--muted);
  font-size: 12px;
}

.palette-empty {
  padding: 16px 12px;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: grid;
  justify-items: end;
  gap: 8px;
  pointer-events: none;
}

.toast-note {
  width: fit-content;
  max-width: min(360px, calc(100vw - 28px));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(28, 30, 36, 0.92);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
  color: var(--ink);
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 750;
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(18px);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 28;
  background: rgba(4, 5, 7, 0.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  backdrop-filter: blur(8px);
}

.eyebrow,
.hint,
.field span,
#uploadSummary,
#editorMeta,
.file-meta,
.file-path,
.composer-meta,
.session-meta,
.recent-file span,
.upload-drop span,
.metric span,
.context-stats span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.error {
  min-height: 18px;
  color: var(--red);
  font-size: 13px;
}

.field {
  display: grid;
  gap: 7px;
}

.login-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(34, 48, 86, 0.26), transparent 48%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03), transparent 30%, rgba(61, 161, 255, 0.08), transparent 78%),
    #0b0c0f;
}

.login-card {
  width: min(100%, 430px);
  display: grid;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  padding: 28px;
  backdrop-filter: blur(28px) saturate(1.3);
}

.login-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #f5f5f7;
  color: #111214;
  font-size: 28px;
  font-weight: 900;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form h1 {
  font-size: 32px;
}

.app-shell {
  height: 100dvh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 23%),
    linear-gradient(90deg, transparent 18%, rgba(20, 44, 126, 0.12) 44%, rgba(19, 43, 122, 0.2) 58%, transparent 82%),
    #111214;
}

.icon-rail {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  justify-items: center;
  gap: 22px;
  padding: 22px 10px;
  background: rgba(255, 255, 255, 0.018);
  border-right: 1px solid rgba(255, 255, 255, 0.035);
}

.rail-logo {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #f5f5f7;
  color: #111214;
  font-size: 20px;
  font-weight: 900;
}

.rail-action,
.rail-tool,
.nav-btn {
  width: 58px;
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 0;
  background: transparent;
  color: var(--ink);
}

.rail-action span,
.rail-tool span,
.nav-glyph {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: transparent;
  color: var(--ink);
  font-size: 25px;
}

.nav-btn.active .nav-glyph,
.rail-action:hover span,
.rail-tool:hover span,
.nav-btn:hover .nav-glyph {
  background: rgba(255, 255, 255, 0.13);
}

.nav-btn.active .nav-glyph {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 10px 30px rgba(0, 0, 0, 0.24);
}

.rail-action small,
.rail-tool small,
.nav-btn small {
  color: #d7d9df;
  font-size: 12px;
}

.rail-nav {
  display: grid;
  align-content: start;
  gap: 20px;
}

.rail-bottom {
  display: grid;
  justify-items: center;
  gap: 16px;
}

.avatar-dot {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background:
    conic-gradient(from 220deg, #7c3aed, #3da1ff, #35c759, #ff9f0a, #7c3aed);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.main-canvas {
  min-width: 0;
  min-height: 0;
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding: 22px 28px 26px;
}

.top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
}

.menu-pill {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 24px;
}

.menu-pill:hover {
  background: rgba(255, 255, 255, 0.08);
}

.top-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.status-line span {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  padding: 6px 9px;
}

.warning {
  width: min(100%, 780px);
  justify-self: center;
  border: 1px solid rgba(255, 159, 10, 0.36);
  border-radius: 16px;
  background: rgba(255, 159, 10, 0.12);
  color: #ffd89b;
  padding: 10px 12px;
  font-size: 13px;
}

.workspace {
  min-height: 0;
  height: 100%;
  display: grid;
}

#warningBox.hidden + .workspace {
  grid-row: 2 / 4;
}

.view {
  min-height: 0;
  height: 100%;
  display: none;
}

.view.active {
  display: flex;
}

.chat-view {
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

.chat-view:not(.has-messages) .log {
  display: none;
}

.chat-view.has-messages {
  justify-content: stretch;
}

.chat-view.has-messages .home-center,
.chat-view.has-messages .feature-ribbon,
.home-center.compact {
  display: none;
}

.home-center {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-top: -28px;
}

.orbit-label {
  color: var(--muted);
  font-size: 15px;
}

.home-center h1 {
  max-width: 980px;
  color: #f5f5f7;
  font-size: 46px;
  font-weight: 720;
  line-height: 1.1;
  text-align: center;
  letter-spacing: 0;
}

.command-box {
  width: min(100%, 1028px);
  display: grid;
  gap: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.115);
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(30px) saturate(1.24);
}

.chat-view.has-messages .command-box {
  flex: 0 0 auto;
  margin: 0 auto 6px;
}

.command-box textarea {
  min-height: 42px;
  max-height: 160px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.45;
}

.command-box textarea::placeholder {
  color: #91949d;
}

.command-row,
.command-left,
.command-right {
  display: flex;
  align-items: center;
}

.command-row {
  justify-content: space-between;
  gap: 12px;
}

.command-left,
.command-right {
  gap: 10px;
}

.command-left > *,
.command-right > * {
  flex: 0 0 auto;
}

.round-btn,
.send-btn,
.secondary-btn,
.primary-btn,
.secondary-upload,
.text-btn {
  min-height: 40px;
  border-radius: 999px;
  padding: 9px 15px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.round-btn {
  width: 48px;
  min-height: 48px;
  padding: 0;
  font-size: 30px;
  font-weight: 300;
}

.send-btn,
.primary-btn {
  background: #f5f5f7;
  color: #111214;
}

.send-btn.danger {
  background: rgba(255, 69, 58, 0.18);
  color: #ffd1cd;
}

.secondary-btn:hover,
.round-btn:hover,
.secondary-upload:hover {
  background: rgba(255, 255, 255, 0.15);
}

.primary-btn:hover,
.send-btn:hover {
  background: #ffffff;
}

.send-btn.danger:hover {
  background: rgba(255, 69, 58, 0.25);
}

.round-btn:hover,
.send-btn:hover,
.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
}

.command-right span {
  color: var(--muted);
  font-size: 13px;
}

.feature-ribbon {
  width: min(100%, 1180px);
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 1px;
  margin-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.feature-cell {
  min-height: 118px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--ink);
}

.feature-cell:first-child {
  border-left: 0;
}

.feature-cell strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feature-cell small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.feature-icon {
  min-width: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  font-size: 27px;
  font-weight: 800;
}

.feature-icon.red {
  color: var(--red);
}

.feature-icon.yellow {
  color: var(--orange);
}

.feature-icon.green {
  color: var(--green);
}

.feature-icon.blue {
  color: var(--blue);
}

.feature-icon.violet {
  color: var(--violet);
}

.log {
  flex: 1;
  width: min(100%, 980px);
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 0;
  scrollbar-width: thin;
}

.tool-activity {
  width: min(100%, 980px);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -18px;
}

.tool-pill {
  border: 1px solid rgba(61, 161, 255, 0.24);
  border-radius: 999px;
  background: rgba(61, 161, 255, 0.1);
  color: #c9e4ff;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 750;
}

.message {
  position: relative;
  max-width: min(78%, 780px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.09);
  padding: 14px 16px;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.65;
}

.message-body {
  padding-right: 34px;
}

.message.empty-message {
  display: none;
}

.message-tools {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  justify-content: flex-end;
  margin: 0;
  opacity: 0;
  transition: opacity 150ms ease;
}

.message:hover .message-tools,
.message:focus-within .message-tools {
  opacity: 1;
}

.message-copy {
  width: 28px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  padding: 0;
  font-size: 10px;
  font-weight: 850;
}

.message.user .message-copy {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(17, 18, 20, 0.7);
}

.message.user {
  align-self: flex-end;
  background: #f5f5f7;
  color: #111214;
}

.message.assistant,
.message.system {
  align-self: flex-start;
}

.message.system {
  border-color: rgba(255, 159, 10, 0.35);
  background: rgba(255, 159, 10, 0.11);
  color: #ffdfaa;
}

.message h1,
.message h2,
.message h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.message p,
.message ul,
.message ol,
.message pre {
  margin: 0 0 9px;
}

.message p:last-child,
.message ul:last-child,
.message ol:last-child,
.message pre:last-child {
  margin-bottom: 0;
}

.message ul,
.message ol {
  padding-left: 20px;
}

.message code {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 5px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.message pre {
  overflow: auto;
  border-radius: 14px;
  background: #050506;
  color: #f5f5f7;
  padding: 11px;
}

.files-view,
.editor-view {
  flex-direction: column;
  gap: 16px;
  width: min(100%, 1180px);
  justify-self: center;
  margin: 0 auto;
  padding: 18px 0 0;
}

.view-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-head h2 {
  margin: 5px 0;
  font-size: 40px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric,
.upload-card,
.library-panel,
.editor-tools,
.inspector,
.history-drawer {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(24px) saturate(1.22);
}

.metric {
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
}

.metric strong {
  font-size: 26px;
}

.file-layout,
.editor-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
}

.upload-card,
.library-panel,
.editor-tools {
  min-height: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.upload-card,
.editor-tools {
  align-content: start;
}

.editor-tools {
  overflow: auto;
  scrollbar-width: thin;
}

.tool-section {
  display: grid;
  align-content: start;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  padding: 9px;
}

.tool-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 13px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  padding: 5px 6px;
  user-select: none;
}

.tool-summary::-webkit-details-marker {
  display: none;
}

.tool-summary span {
  font-size: 13px;
  font-weight: 850;
}

.tool-summary small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.35;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-summary::after {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  color: var(--muted);
  content: "+";
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.tool-section[open] .tool-summary::after {
  content: "-";
}

.tool-summary:hover,
.tool-summary:focus-visible {
  background: rgba(255, 255, 255, 0.075);
}

.tool-body {
  display: grid;
  gap: 9px;
  padding: 9px 2px 2px;
}

.compact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.compact-row .primary-btn,
.compact-row .secondary-btn {
  min-width: 68px;
}

.upload-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.find-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.find-actions .secondary-btn,
.find-actions .primary-btn {
  min-width: 0;
  padding-right: 8px;
  padding-left: 8px;
}

.find-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.section-title small {
  min-width: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--muted);
  padding: 3px 7px;
  font-size: 11px;
  text-align: center;
}

.outline-list {
  max-height: 240px;
  overflow: auto;
  display: grid;
  gap: 5px;
  scrollbar-width: thin;
}

.outline-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  padding: 8px 9px;
  text-align: left;
}

.outline-item:hover,
.outline-item:focus-visible {
  background: rgba(255, 255, 255, 0.09);
}

.outline-title {
  overflow: hidden;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outline-line {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.outline-item.level-2 {
  padding-left: 18px;
}

.outline-item.level-3 {
  padding-left: 28px;
}

.library-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.upload-details {
  display: grid;
  gap: 0;
}

.upload-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  user-select: none;
}

.upload-summary-row::-webkit-details-marker {
  display: none;
}

.upload-summary-row span {
  font-size: 14px;
  font-weight: 850;
}

.upload-summary-row small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-summary-row::after {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  color: var(--muted);
  content: "+";
  font-size: 15px;
  font-weight: 850;
  line-height: 1;
}

.upload-details[open] .upload-summary-row::after {
  content: "-";
}

.upload-summary-row:hover,
.upload-summary-row:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.upload-body {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

.upload-drop {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
}

.upload-drop.dragging {
  border-color: rgba(61, 161, 255, 0.6);
  background: rgba(61, 161, 255, 0.1);
}

.upload-drop input,
.secondary-upload input {
  display: none;
}

.upload-drop strong {
  font-size: 18px;
}

.upload-line,
.meta-row,
.filter-bar {
  display: grid;
  gap: 10px;
}

.filter-bar {
  grid-template-columns: 1fr 150px 150px;
}

.file-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  scrollbar-width: thin;
}

.folder-group {
  display: grid;
  gap: 8px;
}

.folder-head,
.file-item,
.recent-file {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.folder-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  padding: 9px 11px;
  font-size: 12px;
  font-weight: 700;
}

.file-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.file-item.active {
  border-color: rgba(61, 161, 255, 0.45);
  background: rgba(61, 161, 255, 0.1);
}

.file-main {
  min-width: 0;
  width: 100%;
  display: block;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  padding: 4px;
  text-align: left;
}

.file-main:hover,
.file-main:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}

.file-path {
  margin-bottom: 3px;
  color: var(--blue);
  word-break: break-word;
}

.file-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.file-meta {
  margin-top: 4px;
}

.file-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.file-badge {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
}

.file-badge.text {
  color: var(--green);
}

.file-actions,
.editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.file-actions {
  flex-wrap: nowrap;
  gap: 5px;
}

.file-tool-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.075);
  color: var(--ink);
  padding: 0;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.file-tool-btn:hover,
.file-tool-btn:focus-visible {
  background: rgba(255, 255, 255, 0.14);
}

.file-tool-btn.danger {
  color: #ffb7b2;
}

.file-tool-btn.danger:hover,
.file-tool-btn.danger:focus-visible {
  background: rgba(255, 69, 58, 0.18);
}

.editor-stats {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.editor-mode-switch {
  display: flex;
  align-items: center;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px;
}

.mode-btn {
  min-height: 32px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 800;
}

.mode-btn.active {
  background: #f5f5f7;
  color: #111214;
}

.editor-layout {
  grid-template-columns: 280px minmax(0, 1fr);
}

.editor-workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.editor-pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.format-bar {
  min-width: 0;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.048);
  padding: 5px;
  scrollbar-width: none;
}

.format-btn {
  min-width: 34px;
  min-height: 30px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
}

.format-btn:hover,
.format-btn:focus-visible {
  background: rgba(255, 255, 255, 0.15);
}

.format-btn:disabled {
  opacity: 0.35;
}

.editor {
  height: 100%;
  min-height: 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
}

.editor-preview,
.editor-diff {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.05);
}

.editor-diff {
  display: none;
}

.editor-workspace.mode-diff .editor-preview {
  display: none;
}

.editor-workspace.mode-preview {
  grid-template-columns: minmax(0, 1fr);
}

.editor-workspace.mode-preview .editor-pane {
  display: none;
}

.editor-workspace.mode-diff .editor-diff {
  display: grid;
}

.editor-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 11px 13px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.editor-preview-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.preview-body {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  color: #f1f2f4;
  font-size: 14px;
  line-height: 1.75;
  scrollbar-width: thin;
}

.preview-body.empty {
  display: grid;
  place-items: center;
  color: var(--subtle);
  text-align: center;
}

.preview-body h1,
.preview-body h2,
.preview-body h3 {
  margin: 0 0 12px;
  line-height: 1.22;
}

.preview-body h1 {
  font-size: 30px;
}

.preview-body h2 {
  font-size: 24px;
}

.preview-body h3 {
  font-size: 18px;
}

.preview-body p,
.preview-body ul,
.preview-body ol,
.preview-body blockquote,
.preview-body pre {
  margin: 0 0 12px;
}

.preview-body ul,
.preview-body ol {
  padding-left: 22px;
}

.preview-body blockquote {
  border-left: 3px solid rgba(61, 161, 255, 0.62);
  color: #d7e7ff;
  padding: 5px 0 5px 12px;
}

.preview-body code {
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 5px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.preview-body pre {
  overflow: auto;
  border-radius: 14px;
  background: rgba(5, 5, 7, 0.82);
  padding: 12px;
}

.preview-body a {
  color: #8fcbff;
}

.diff-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  scrollbar-width: thin;
}

.diff-body.empty {
  place-items: center;
  align-content: center;
  color: var(--subtle);
  font-family: inherit;
  text-align: center;
}

.diff-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 6px 8px;
}

.diff-row span:first-child {
  color: var(--muted);
  font-weight: 900;
}

.diff-row code {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.diff-row.add {
  border-color: rgba(53, 199, 89, 0.28);
  background: rgba(53, 199, 89, 0.1);
}

.diff-row.remove {
  border-color: rgba(255, 69, 58, 0.28);
  background: rgba(255, 69, 58, 0.1);
}

.diff-row.same {
  opacity: 0.72;
}

.inspector,
.history-drawer {
  position: fixed;
  top: 22px;
  bottom: 22px;
  z-index: 30;
  width: min(360px, calc(100vw - 112px));
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  overflow: auto;
  pointer-events: none;
  transform: translateX(calc(100% + 28px));
  transition: transform 180ms ease;
}

.inspector::before,
.history-drawer::before {
  content: "";
  width: 42px;
  height: 4px;
  display: none;
  justify-self: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.inspector {
  right: 22px;
}

.history-drawer {
  left: 104px;
  transform: translateX(calc(-100% - 132px));
}

.app-shell.inspector-open .inspector {
  pointer-events: auto;
  transform: translateX(0);
}

.app-shell.history-open .history-drawer {
  pointer-events: auto;
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.context-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.context-stats div {
  display: grid;
  gap: 5px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  padding: 10px;
}

.recent-files,
.session-list {
  display: grid;
  gap: 9px;
}

.recent-file,
.session-item {
  display: grid;
  gap: 4px;
  padding: 11px;
  color: var(--ink);
  text-align: left;
}

.session-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.session-item.active {
  border-color: rgba(61, 161, 255, 0.42);
  background: rgba(61, 161, 255, 0.1);
}

.session-main {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.session-title,
.recent-file strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-delete {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .feature-ribbon {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .file-layout,
  .editor-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%),
      linear-gradient(145deg, rgba(61, 161, 255, 0.12), transparent 34%),
      linear-gradient(35deg, rgba(53, 199, 89, 0.08), transparent 38%),
      #101113;
  }

  .icon-rail {
    position: fixed;
    right: 14px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    left: 14px;
    z-index: 60;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    gap: 2px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 24px;
    background: rgba(21, 23, 28, 0.86);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.42);
    padding: 5px;
    backdrop-filter: blur(28px) saturate(1.2);
  }

  #newChatBtn.rail-action {
    position: absolute;
    top: 7px;
    left: 50%;
    z-index: 2;
    width: 46px;
    min-width: 46px;
    min-height: 46px;
    border-radius: 18px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(238, 239, 243, 0.94));
    color: #111214;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.4);
    transform: translateX(-50%);
  }

  #newChatBtn.rail-action span {
    width: 46px;
    height: 46px;
    border-radius: 18px;
    background: transparent;
    color: #111214;
    font-size: 24px;
  }

  #newChatBtn.rail-action small {
    display: none;
  }

  .rail-logo,
  .rail-bottom,
  #refreshFilesBtn {
    display: none;
  }

  .rail-nav {
    display: contents;
  }

  .rail-action,
  .rail-tool,
  .nav-btn {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    align-content: center;
    gap: 2px;
    border-radius: 18px;
  }

  .rail-action span,
  .rail-tool span,
  .nav-glyph {
    width: 27px;
    height: 25px;
    border-radius: 11px;
    font-size: 18px;
  }

  .rail-action small,
  .rail-tool small,
  .nav-btn small {
    font-size: 10px;
    line-height: 1.1;
  }

  .nav-btn.active,
  .rail-action:active,
  .rail-tool:active {
    background: transparent;
  }

  .nav-btn.active .nav-glyph,
  .rail-tool:active span {
    background: rgba(255, 255, 255, 0.13);
  }

  #newChatBtn.rail-action:active {
    transform: translateX(-50%) scale(0.96);
  }

  .nav-btn.active small {
    color: #f5f5f7;
  }

  .main-canvas {
    min-width: 0;
    padding: 12px 14px calc(90px + env(safe-area-inset-bottom));
  }

  .top-strip {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 40px;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(17, 18, 20, 0.64);
    padding: 2px 5px;
    backdrop-filter: blur(20px) saturate(1.15);
  }

  .menu-pill {
    width: 36px;
    height: 36px;
    font-size: 21px;
  }

  .top-title {
    position: absolute;
    right: 54px;
    left: 54px;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .status-line {
    display: none;
  }

  .home-center {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    gap: 10px;
    margin-top: -22px;
  }

  .home-center h1 {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    font-size: 24px;
    line-height: 1.12;
    text-wrap: balance;
  }

  .orbit-label {
    font-size: 13px;
  }

  .command-box {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    border-radius: 22px;
    padding: 9px;
  }

  .command-box textarea {
    grid-column: 2;
    grid-row: 1;
    min-height: 34px;
    max-height: 96px;
    padding: 5px 2px;
    font-size: 16px;
    line-height: 1.45;
  }

  .command-row {
    display: contents;
  }

  .command-left,
  .command-right {
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .command-left {
    grid-column: 1;
    grid-row: 1;
  }

  .command-right {
    grid-column: 3;
    grid-row: 1;
    justify-content: end;
  }

  .command-right #streamStatus {
    display: none;
  }

  .round-btn {
    width: 36px;
    min-height: 36px;
    font-size: 22px;
  }

  .send-btn {
    min-height: 36px;
    padding: 7px 13px;
    font-size: 13px;
  }

  .chat-view {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    gap: 18px;
  }

  .chat-view.has-messages .command-box {
    margin-bottom: 0;
  }

  .log,
  .tool-activity {
    width: 100%;
  }

  .workspace,
  .view,
  .command-box,
  .feature-ribbon {
    min-width: 0;
    max-width: 100%;
  }

  .message {
    max-width: 92%;
    border-radius: 20px;
    padding: 12px 13px;
  }

  .feature-ribbon {
    display: flex;
    gap: 8px;
    margin-top: 2px;
    border-top: 0;
    overflow-x: auto;
    padding: 2px 0 4px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .feature-cell {
    flex: 0 0 92px;
    min-height: 62px;
    gap: 3px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.045);
    scroll-snap-align: start;
  }

  .feature-cell:last-child {
    flex-basis: 112px;
  }

  .feature-cell strong {
    font-size: 15px;
  }

  .feature-icon {
    min-width: 22px;
    min-height: 22px;
    font-size: 17px;
  }

  .feature-cell small {
    font-size: 10px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .files-view .metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .files-view .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .files-view #fileSearchInput {
    grid-column: 1 / -1;
  }

  .files-view #fileSearchInput,
  .files-view #categoryFilter,
  .files-view #sortSelect {
    min-height: 38px;
    border-radius: 14px;
    padding: 7px 10px;
    font-size: 13px;
  }

  .view-head {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .view-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .view-head h2 {
    font-size: 28px;
    line-height: 1.08;
  }

  .files-view,
  .editor-view {
    overflow: auto;
    gap: 12px;
    padding-top: 6px;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }

  .editor-view .view-head .eyebrow,
  .editor-view .view-head h2 {
    display: none;
  }

  .editor-view .view-head > div:first-child {
    min-width: 0;
  }

  #activeFileName {
    overflow: hidden;
    color: var(--ink);
    font-size: 17px;
    font-weight: 850;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .file-layout,
  .editor-layout {
    flex: 0 0 auto;
  }

  .files-view .library-panel {
    order: -1;
  }

  .files-view .upload-card {
    order: 1;
  }

  .library-panel {
    min-height: 360px;
  }

  .files-view .upload-drop {
    min-height: 106px;
    border-radius: 18px;
  }

  .files-view .upload-summary-row {
    min-height: 38px;
    border-radius: 14px;
    padding: 8px 9px;
  }

  .files-view .upload-summary-row span {
    font-size: 12px;
  }

  .files-view .upload-summary-row small {
    max-width: 52%;
    font-size: 10px;
  }

  .files-view .upload-summary-row::after {
    width: 18px;
    height: 18px;
    font-size: 13px;
  }

  .files-view .upload-body {
    gap: 7px;
    padding-top: 7px;
  }

  .files-view .upload-drop strong {
    font-size: 16px;
  }

  .files-view .upload-drop span {
    font-size: 12px;
  }

  .files-view .metric {
    min-height: 54px;
    border-radius: 14px;
    gap: 3px;
    padding: 8px 9px;
  }

  .files-view .metric span {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .files-view .metric strong {
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .upload-card,
  .library-panel,
  .editor-tools {
    border-radius: 22px;
    padding: 12px;
  }

  .editor-tools {
    gap: 7px;
  }

  .tool-section {
    border-radius: 15px;
    padding: 7px;
  }

  .tool-summary {
    min-height: 32px;
    border-radius: 11px;
    padding: 4px 5px;
  }

  .tool-summary span {
    font-size: 12px;
  }

  .tool-summary small {
    max-width: 52%;
    font-size: 10px;
  }

  .tool-summary::after {
    width: 18px;
    height: 18px;
    font-size: 13px;
  }

  .tool-body {
    gap: 7px;
    padding-top: 7px;
  }

  .compact-row {
    gap: 6px;
  }

  .compact-row .primary-btn,
  .compact-row .secondary-btn {
    min-width: 58px;
  }

  .upload-actions {
    gap: 6px;
  }

  .editor {
    min-height: 52dvh;
    border-radius: 18px;
    font-size: 12px;
    line-height: 1.58;
  }

  .editor-pane {
    gap: 6px;
  }

  .format-bar {
    gap: 4px;
    border-radius: 14px;
    padding: 4px;
  }

  .format-btn {
    min-width: 31px;
    min-height: 28px;
    border-radius: 9px;
    padding: 3px 7px;
    font-size: 10px;
  }

  .editor-mode-switch {
    display: flex;
    padding: 2px;
  }

  .editor-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .editor-view.has-file .editor-workspace {
    order: -1;
  }

  .editor-workspace.mode-edit .editor-preview,
  .editor-workspace.mode-edit .editor-diff,
  .editor-workspace.mode-preview .editor-pane,
  .editor-workspace.mode-preview .editor-diff,
  .editor-workspace.mode-diff .editor-pane,
  .editor-workspace.mode-diff .editor-preview {
    display: none;
  }

  .editor-preview,
  .editor-diff {
    min-height: 52dvh;
    border-radius: 18px;
  }

  .preview-body {
    padding: 15px;
  }

  .file-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .file-actions {
    justify-content: flex-start;
    gap: 6px;
  }

  .file-tool-btn {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    border-radius: 11px;
    font-size: 10px;
  }

  .editor-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .editor-actions #editorMeta {
    grid-column: 1 / 2;
    min-width: 0;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .editor-actions .editor-stats {
    grid-column: 2 / 3;
    justify-self: end;
    font-size: 11px;
    line-height: 1.25;
  }

  .editor-actions .editor-mode-switch {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .editor-actions .mode-btn {
    flex: 1;
    min-height: 29px;
    padding: 5px 8px;
    font-size: 11px;
  }

  .editor-actions .secondary-btn,
  .editor-actions .primary-btn,
  .view-actions .secondary-btn,
  .view-actions .primary-btn {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 12px;
  }

  .inspector,
  .history-drawer {
    top: auto;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 70;
    width: auto;
    max-height: min(66dvh, 540px);
    border-radius: 26px 26px 24px 24px;
    gap: 12px;
    padding: 10px 14px 14px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.58);
    transform: translateY(calc(100% + 120px));
  }

  .inspector::before,
  .history-drawer::before {
    display: block;
    margin-bottom: 2px;
  }

  .history-drawer {
    transform: translateY(calc(100% + 120px));
  }

  .app-shell.inspector-open .drawer-backdrop,
  .app-shell.history-open .drawer-backdrop {
    z-index: 65;
    opacity: 1;
    pointer-events: auto;
  }

  .app-shell.inspector-open .inspector,
  .app-shell.history-open .history-drawer {
    transform: translateY(0);
  }

  .drop-overlay {
    inset: 10px;
    border-radius: 22px;
  }

  .drop-overlay strong {
    font-size: 23px;
  }

  .command-palette {
    align-items: end;
    padding: 24px 10px calc(10px + env(safe-area-inset-bottom));
    background: rgba(4, 5, 7, 0.56);
    backdrop-filter: blur(18px) saturate(1.1);
  }

  .palette-panel {
    width: 100%;
    max-height: min(68dvh, 560px);
    border-radius: 26px 26px 24px 24px;
    gap: 8px;
    padding: 10px 12px 12px;
  }

  .palette-panel::before {
    display: block;
    margin-bottom: 2px;
  }

  #commandSearchInput {
    min-height: 44px;
    border-radius: 16px;
    font-size: 15px;
  }

  .command-list {
    max-height: min(46dvh, 420px);
    gap: 5px;
  }

  .command-item {
    border-radius: 14px;
    padding: 10px 11px;
  }

  .command-item strong {
    font-size: 13px;
  }

  .command-item span,
  .palette-empty {
    font-size: 11px;
  }

  .toast-stack {
    right: 12px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: 12px;
    justify-items: center;
  }

  .message-tools {
    opacity: 1;
  }
}
