:root {
  color-scheme: dark;
  --bg: #080a0f;
  --panel: rgba(15, 19, 29, 0.84);
  --panel-solid: #101522;
  --line: rgba(152, 205, 255, 0.18);
  --text: #eef7ff;
  --muted: #96a8b9;
  --cyan: #42d9ff;
  --green: #6ef2b2;
  --amber: #ffd166;
  --red: #ff6b7a;
  --violet: #b8a1ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(66, 217, 255, 0.14), transparent 26rem),
    radial-gradient(circle at 82% 16%, rgba(110, 242, 178, 0.1), transparent 24rem),
    linear-gradient(135deg, #080a0f 0%, #101320 48%, #071015 100%);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1480px, calc(100vw - 24px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 12px 0;
}

.presence,
.console {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.presence {
  min-height: calc(100vh - 24px);
  border-radius: 8px;
  display: grid;
  place-items: center;
  align-content: start;
  gap: 14px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  position: sticky;
  top: 12px;
}

.presence::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(66, 217, 255, 0.12);
  pointer-events: none;
}

.status-row {
  position: absolute;
  top: 24px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 24px var(--green);
}

.orb {
  width: clamp(142px, 15vw, 188px);
  height: clamp(142px, 15vw, 188px);
  border: 0;
  border-radius: 999px;
  background: transparent;
  position: relative;
  display: grid;
  place-items: center;
  cursor: pointer;
  margin-top: 42px;
}

.orb-core {
  width: 46%;
  height: 46%;
  border-radius: 999px;
  background:
    radial-gradient(circle, #f5ffff 0%, #77eaff 22%, #136b7b 58%, #071217 100%);
  box-shadow:
    0 0 32px rgba(66, 217, 255, 0.76),
    0 0 92px rgba(66, 217, 255, 0.34);
  animation: core-idle 4.8s ease-in-out infinite;
}

.orb-ring {
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(66, 217, 255, 0.56);
  animation: breathe 3.6s ease-in-out infinite;
}

.ring-one {
  width: 72%;
  height: 72%;
}

.ring-two {
  width: 98%;
  height: 98%;
  border-color: rgba(110, 242, 178, 0.32);
  animation-delay: 0.8s;
}

@keyframes breathe {
  0%, 100% {
    transform: scale(0.96);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

@keyframes core-idle {
  0%, 100% {
    transform: scale(0.96);
    filter: brightness(0.95);
  }
  50% {
    transform: scale(1.03);
    filter: brightness(1.12);
  }
}

@keyframes core-speaking {
  0%, 100% {
    transform: scale(0.92);
    box-shadow:
      0 0 28px rgba(66, 217, 255, 0.7),
      0 0 76px rgba(66, 217, 255, 0.28);
  }
  35% {
    transform: scale(1.12);
    box-shadow:
      0 0 38px rgba(245, 255, 255, 0.86),
      0 0 116px rgba(66, 217, 255, 0.46);
  }
  62% {
    transform: scale(1.02);
  }
}

@keyframes ring-speaking {
  0% {
    transform: scale(0.82);
    opacity: 0.3;
  }
  70% {
    transform: scale(1.14);
    opacity: 1;
  }
  100% {
    transform: scale(1.24);
    opacity: 0;
  }
}

@keyframes ring-listening {
  0%, 100% {
    transform: scale(0.9);
    opacity: 0.45;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.95;
  }
}

@keyframes core-processing {
  0%, 100% {
    transform: scale(0.96) rotate(0deg);
    filter: hue-rotate(0deg) brightness(1);
  }
  50% {
    transform: scale(1.07) rotate(180deg);
    filter: hue-rotate(32deg) brightness(1.18);
  }
}

[data-mic="escuchando"] .orb-core {
  animation: core-idle 2.8s ease-in-out infinite;
}

[data-mic="escuchando"] .orb-ring {
  animation: ring-listening 2.4s ease-in-out infinite;
}

[data-mic="oyendo"] .orb-core,
[data-mic="activa"] .orb-core {
  animation: core-speaking 0.9s ease-in-out infinite;
}

[data-mic="oyendo"] .orb-ring,
[data-mic="activa"] .orb-ring {
  animation: ring-speaking 1.05s ease-out infinite;
}

[data-mic="procesando"] .orb-core {
  animation: core-processing 1.2s ease-in-out infinite;
}

[data-mic="procesando"] .orb-ring {
  animation: ring-speaking 1.4s linear infinite;
}

[data-mic="hablando"] .orb-core {
  animation: core-speaking 0.72s ease-in-out infinite;
}

[data-mic="hablando"] .ring-one {
  animation: ring-speaking 0.95s ease-out infinite;
}

[data-mic="hablando"] .ring-two {
  animation: ring-speaking 1.18s ease-out infinite;
  animation-delay: 0.18s;
}

.identity {
  text-align: center;
  max-width: 320px;
  z-index: 1;
}

.identity h1 {
  margin: 0;
  font-size: clamp(38px, 4.6vw, 58px);
  letter-spacing: 0;
  line-height: 1;
}

.identity p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.voice-status {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(66, 217, 255, 0.16);
  border-radius: 8px;
  background: rgba(66, 217, 255, 0.055);
  color: var(--text);
  text-align: left;
}

.voice-status span {
  font-size: 13px;
  font-weight: 700;
}

.voice-status small {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

[data-mic="oyendo"] .voice-status,
[data-mic="activa"] .voice-status {
  border-color: rgba(110, 242, 178, 0.42);
  background: rgba(110, 242, 178, 0.085);
}

[data-mic="procesando"] .voice-status {
  border-color: rgba(255, 209, 102, 0.42);
  background: rgba(255, 209, 102, 0.08);
}

[data-mic="manual"] .voice-status {
  opacity: 0.82;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 100%;
  z-index: 1;
}

.quick-actions button,
#sendButton,
#voiceButton,
#saveSettingsButton {
  min-height: 42px;
  border: 1px solid rgba(66, 217, 255, 0.24);
  background: rgba(66, 217, 255, 0.08);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  min-width: 0;
  overflow-wrap: anywhere;
}

.quick-actions button:hover,
#sendButton:hover,
#voiceButton:hover,
#saveSettingsButton:hover {
  background: rgba(66, 217, 255, 0.17);
}

.console {
  min-height: calc(100vh - 24px);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr);
  align-content: start;
}

.console > .panel-header,
.console > .command-box,
.console > .mode-grid,
.console > .workspace-panel {
  grid-column: 1 / -1;
}

.console > .task-panel,
.console > .media-panel,
.console > .settings-panel {
  grid-column: 1;
}

.console > .chat-panel {
  grid-column: 2;
  grid-row: span 2;
}

.console.chat-expanded {
  grid-template-columns: minmax(0, 1fr);
}

.console.chat-expanded > .chat-panel {
  grid-column: 1 / -1;
  grid-row: auto;
  min-height: min(760px, calc(100vh - 170px));
}

.console.chat-expanded > .task-panel,
.console.chat-expanded > .media-panel,
.console.chat-expanded > .settings-panel {
  display: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-header h2 {
  margin: 3px 0 0;
  font-size: 22px;
  letter-spacing: 0;
}

.panel-header.slim h2 {
  font-size: 18px;
}

.eyebrow {
  margin: 0;
  color: var(--cyan);
  text-transform: uppercase;
  font-size: 12px;
}

select,
input {
  border: 1px solid var(--line);
  background: rgba(6, 10, 16, 0.82);
  color: var(--text);
  border-radius: 6px;
}

select {
  min-height: 38px;
  padding: 0 10px;
}

.icon-button {
  width: 38px;
  min-height: 38px;
  border: 1px solid rgba(66, 217, 255, 0.24);
  background: rgba(66, 217, 255, 0.08);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
}

.chat-expand-button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 600;
}

.icon-button:hover,
.icon-button.active {
  background: rgba(66, 217, 255, 0.17);
  border-color: rgba(66, 217, 255, 0.6);
}

.config-menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 12, 19, 0.98);
  box-shadow: var(--shadow);
}

.config-menu[hidden] {
  display: none;
}

.config-menu label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.config-menu input,
.config-menu select {
  width: 100%;
}

.menu-toggle {
  display: flex !important;
  align-items: center;
}

.menu-toggle input {
  width: 18px;
  height: 18px;
}

#menuSaveButton,
.secondary-menu-button {
  min-height: 40px;
  border: 1px solid rgba(110, 242, 178, 0.36);
  background: rgba(110, 242, 178, 0.12);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
}

.secondary-menu-button {
  border-color: rgba(66, 217, 255, 0.28);
  background: rgba(66, 217, 255, 0.08);
}

.command-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 96px;
  gap: 10px;
}

input {
  min-height: 46px;
  padding: 0 14px;
  outline: none;
}

input:focus {
  border-color: rgba(66, 217, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(66, 217, 255, 0.1);
}

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

.mode-grid article,
.task-panel,
.media-panel,
.chat-panel,
.settings-panel,
.workspace-panel,
.apps-panel,
.library-panel {
  border: 1px solid var(--line);
  background: rgba(7, 11, 18, 0.58);
  border-radius: 8px;
}

.mode-grid article {
  min-height: 74px;
  padding: 11px;
  display: grid;
  align-content: space-between;
}

.mode-grid span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.mode-grid strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.mode-grid article.agent-offline {
  border-color: rgba(255, 183, 77, 0.42);
  background: rgba(255, 183, 77, 0.07);
}

.mode-grid article.agent-offline strong {
  color: #ffd18a;
}

.task-panel,
.media-panel,
.chat-panel,
.settings-panel,
.workspace-panel,
.apps-panel,
.library-panel {
  padding: 16px;
  min-width: 0;
}

.settings-panel {
  display: none;
}

.media-panel[hidden] {
  display: none;
}

.media-panel iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 12px;
  border: 0;
  border-radius: 6px;
  background: #000;
}

#closeMediaButton {
  min-height: 36px;
  border: 1px solid rgba(66, 217, 255, 0.24);
  background: rgba(66, 217, 255, 0.08);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  padding: 0 12px;
}

#closeMediaButton:hover {
  background: rgba(66, 217, 255, 0.17);
}

.progress-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 14px 0;
}

.progress-track span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  box-shadow: 0 0 24px rgba(66, 217, 255, 0.58);
  transition: width 240ms ease;
}

#currentStep {
  color: var(--muted);
  margin: 0 0 12px;
}

#stepList {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

#stepList li {
  color: var(--muted);
}

#stepList li.done {
  color: var(--green);
}

#stepList li.running {
  color: var(--amber);
}

[data-view="detailed"] .task-panel {
  background: rgba(10, 18, 28, 0.78);
}

[data-view="detailed"] .chat-log {
  max-height: 320px;
}

[data-view="technical"] .task-panel,
[data-view="technical"] .mode-grid article {
  background: rgba(5, 9, 14, 0.86);
  border-color: rgba(110, 242, 178, 0.28);
}

[data-view="technical"] .task-panel,
[data-view="technical"] .mode-grid strong,
[data-view="technical"] #currentStep,
[data-view="technical"] #stepList {
  font-family: Consolas, "Cascadia Mono", monospace;
}

[data-view="technical"] #stepList li::marker {
  color: var(--green);
}

[data-view="visual"] .task-panel {
  background:
    radial-gradient(circle at 12% 20%, rgba(66, 217, 255, 0.16), transparent 15rem),
    rgba(7, 11, 18, 0.58);
}

[data-view="visual"] .progress-track {
  height: 14px;
}

[data-view="visual"] .task-panel .panel-header.slim h2 {
  font-size: 22px;
}

[data-view="visual"] #stepList {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  padding-left: 0;
  list-style: none;
}

[data-view="visual"] #stepList li {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.chat-log {
  display: grid;
  gap: 10px;
  max-height: min(460px, calc(100vh - 470px));
  min-height: 180px;
  overflow: auto;
}

.console.chat-expanded .chat-log {
  max-height: min(720px, calc(100vh - 285px));
  min-height: min(620px, calc(100vh - 330px));
  align-content: start;
}

.chat-log p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.chat-log p.thinking-line {
  color: var(--text);
  border: 1px solid rgba(66, 217, 255, 0.16);
  background: rgba(66, 217, 255, 0.06);
}

.chat-log .document-preview {
  display: grid;
  gap: 8px;
  background: rgba(66, 217, 255, 0.07);
  border: 1px solid rgba(66, 217, 255, 0.16);
}

.document-preview-content {
  display: grid;
  gap: 10px;
  color: var(--text);
  font: 14px/1.58 "Segoe UI", system-ui, sans-serif;
  overflow-wrap: anywhere;
}

.document-preview-content h1,
.document-preview-content h2,
.document-preview-content h3,
.document-preview-content p,
.document-preview-content ul,
.document-preview-content ol {
  margin: 0;
}

.chat-log .document-preview-content p {
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  color: var(--text);
}

.chat-log .document-preview-content p + p {
  border-top: 0;
}

.document-preview-content h1 {
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.15;
  color: var(--text);
}

.document-preview-content h2 {
  margin-top: 8px;
  font-size: 19px;
  line-height: 1.25;
  color: #ffffff;
}

.document-preview-content h3 {
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.3;
  color: var(--cyan);
}

.document-preview-content ul,
.document-preview-content ol {
  display: grid;
  gap: 5px;
  padding-left: 22px;
}

.document-preview-content table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.document-preview-content th,
.document-preview-content td {
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  vertical-align: top;
}

.document-preview-content th {
  color: var(--cyan);
  background: rgba(66, 217, 255, 0.09);
}

.generated-file-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.generated-file-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 7px;
  background: rgba(66, 217, 255, 0.16);
  color: var(--cyan);
  font-weight: 800;
  margin: 0;
}

.generated-file-content {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.generated-file-content span {
  margin: 0;
  font-size: 11px;
}

.generated-file-content strong,
.generated-file-content small,
.generated-file-content code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generated-file-content strong {
  color: var(--text);
  font-size: 14px;
}

.generated-file-content small {
  color: var(--muted);
  font-size: 12px;
}

.generated-file-content code {
  color: rgba(229, 238, 246, 0.76);
  font: 11px/1.35 Consolas, "Cascadia Mono", monospace;
}

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

.generated-file-actions a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.generated-file-actions a:first-child {
  background: rgba(66, 217, 255, 0.14);
  color: var(--cyan);
}

.chat-log span {
  color: var(--cyan);
  font-weight: 700;
  margin-right: 6px;
}

.chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  margin-top: 12px;
}

.console.chat-expanded .chat-composer {
  grid-template-columns: minmax(0, 1fr) 112px;
}

.console.chat-expanded #chatInput {
  min-height: 54px;
  font-size: 16px;
}

.chat-composer input {
  min-width: 0;
}

.chat-composer button {
  min-height: 46px;
  border: 1px solid rgba(66, 217, 255, 0.24);
  background: rgba(66, 217, 255, 0.08);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
}

.chat-composer button:hover {
  background: rgba(66, 217, 255, 0.17);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 12px;
  margin-top: 14px;
}

.settings-grid label,
.workspace-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.settings-grid input,
.workspace-grid input,
.workspace-grid select {
  width: 100%;
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  align-items: end;
}

.workspace-grid > * {
  min-width: 0;
}

.workspace-grid > :nth-child(1) {
  grid-column: 1 / 4;
}

.workspace-grid > :nth-child(2) {
  grid-column: 4 / 9;
}

.workspace-grid > :nth-child(3) {
  grid-column: 9 / 13;
}

.workspace-grid > :nth-child(4) {
  grid-column: 1 / 9;
}

.workspace-grid > :nth-child(5) {
  grid-column: 9 / 11;
}

.workspace-grid > :nth-child(6) {
  grid-column: 11 / 13;
}

.workspace-grid button,
#refreshWorkspacesButton,
#deleteWorkspaceButton {
  min-height: 42px;
  border: 1px solid rgba(66, 217, 255, 0.24);
  background: rgba(66, 217, 255, 0.08);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  padding: 0 12px;
  overflow-wrap: anywhere;
}

.workspace-grid button:hover,
#refreshWorkspacesButton:hover,
#deleteWorkspaceButton:hover {
  background: rgba(66, 217, 255, 0.17);
}

.workspace-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
}

#deleteWorkspaceButton.danger-soft {
  border-color: rgba(255, 116, 116, 0.45);
  background: rgba(255, 116, 116, 0.08);
}

#deleteWorkspaceButton.danger-soft:hover {
  background: rgba(255, 116, 116, 0.16);
}

.workspace-question {
  grid-column: 1 / 11;
}

.workspace-grid > :nth-child(8) {
  grid-column: 11 / 13;
}

#workspaceStatus {
  color: var(--muted);
  margin: 12px 0 0;
}

.workspace-answer {
  display: none;
  margin-top: 12px;
  padding: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  line-height: 1.5;
}

.workspace-answer.visible {
  display: block;
}

.toggle-row {
  grid-column: 1 / -1;
  display: flex !important;
  align-items: center;
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

#voiceButton.listening {
  border-color: rgba(110, 242, 178, 0.72);
  background: rgba(110, 242, 178, 0.14);
  color: var(--green);
}

#voiceButton.awake {
  border-color: rgba(255, 209, 102, 0.72);
  background: rgba(255, 209, 102, 0.14);
  color: var(--amber);
}

#voiceButton.unsupported {
  border-color: rgba(255, 183, 77, 0.42);
  color: #ffd18a;
}

[data-interface="minimized"] .console {
  display: none;
}

[data-interface="minimized"] {
  grid-template-columns: minmax(260px, 390px);
  justify-content: center;
}

[data-interface="results_only"] .task-panel,
[data-interface="results_only"] .chat-panel {
  display: none;
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  }

  .console {
    grid-template-columns: 1fr;
  }

  .console > .task-panel,
  .console > .media-panel,
  .console > .settings-panel,
  .console > .chat-panel {
    grid-column: 1;
  }

  .console > .chat-panel {
    grid-row: auto;
  }

  .console.chat-expanded {
    grid-template-columns: 1fr;
  }

  .console.chat-expanded > .chat-panel {
    grid-column: 1;
    grid-row: auto;
    min-height: auto;
  }

  .console.chat-expanded .chat-log {
    max-height: 520px;
    min-height: 360px;
  }

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

  .workspace-grid > :nth-child(1),
  .workspace-grid > :nth-child(2),
  .workspace-grid > :nth-child(4),
  .workspace-question {
    grid-column: 1 / 5;
  }

  .workspace-grid > :nth-child(3),
  .workspace-grid > :nth-child(5),
  .workspace-grid > :nth-child(6),
  .workspace-grid > :nth-child(8) {
    grid-column: 5 / 7;
  }
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    align-items: start;
    width: min(100vw - 16px, 680px);
    padding: 8px 0;
  }

  .presence {
    position: relative;
    top: auto;
  }

  .presence,
  .console {
    min-height: auto;
  }

  .presence {
    padding-top: 24px;
  }

  .mode-grid,
  .quick-actions,
  .settings-grid,
  .workspace-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-grid > :nth-child(1),
  .workspace-grid > :nth-child(2),
  .workspace-grid > :nth-child(3),
  .workspace-grid > :nth-child(4),
  .workspace-grid > :nth-child(5),
  .workspace-grid > :nth-child(6),
  .workspace-grid > :nth-child(8),
  .workspace-question {
    grid-column: 1 / -1;
  }

  .command-box {
    grid-template-columns: 1fr;
  }

  .console.chat-expanded .chat-composer {
    grid-template-columns: 1fr;
  }
}

html[data-theme="aura"] {
  color-scheme: dark;
  --bg: #050608;
  --panel: rgba(15, 19, 29, 0.84);
  --panel-solid: #101522;
  --line: rgba(152, 205, 255, 0.18);
  --text: #eef7ff;
  --muted: #96a8b9;
  --cyan: #42d9ff;
  --green: #6ef2b2;
}

html[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #0b0d14;
  --panel: rgba(22, 24, 34, 0.88);
  --panel-solid: #171925;
  --line: rgba(188, 180, 255, 0.18);
  --text: #f3f0ff;
  --muted: #aaa7bb;
  --cyan: #9ca7ff;
  --green: #d4a7ff;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --line: rgba(29, 53, 87, 0.16);
  --text: #151925;
  --muted: #667084;
  --cyan: #0866c9;
  --green: #0b8f64;
}

html[data-theme="forest"] {
  color-scheme: dark;
  --bg: #07100c;
  --panel: rgba(13, 28, 22, 0.88);
  --panel-solid: #0e2119;
  --line: rgba(143, 224, 180, 0.18);
  --text: #ecfff5;
  --muted: #98b5a7;
  --cyan: #79dfb1;
  --green: #45f08f;
}

html[data-theme] body {
  background:
    radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--cyan) 16%, transparent), transparent 25rem),
    radial-gradient(circle at 82% 16%, color-mix(in srgb, var(--green) 12%, transparent), transparent 24rem),
    var(--bg);
}

html[data-theme] .presence,
html[data-theme] .console,
html[data-theme] .presence-footer {
  background: var(--bg);
}

html[data-theme] .console,
html[data-theme] .presence {
  color: var(--text);
}

html[data-theme="light"] .presence,
html[data-theme="light"] .console,
html[data-theme="light"] .presence-footer {
  background: #f7f9fd;
}

html[data-theme="light"] .chat-log p,
html[data-theme="light"] .mode-grid article,
html[data-theme="light"] .task-panel,
html[data-theme="light"] .settings-panel,
html[data-theme="light"] .workspace-panel,
html[data-theme="light"] .apps-panel,
html[data-theme="light"] .library-panel,
html[data-theme="light"] .memory-panel {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(29, 53, 87, 0.12);
}

/* Conversational workspace layout */
body {
  background: #050608;
}

.shell {
  width: 100vw;
  min-height: 100vh;
  height: 100vh;
  margin: 0;
  grid-template-columns: 258px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.presence,
.console {
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.presence {
  min-height: 100vh;
  height: 100vh;
  top: 0;
  border-radius: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: #08090c;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: stretch;
  align-content: stretch;
  padding: 0;
  gap: 0;
  overflow: visible;
}

.presence::before {
  display: none;
}

.presence-scroll {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 8px 10px;
  scrollbar-gutter: stable;
}

.presence-scroll::-webkit-scrollbar {
  width: 10px;
}

.presence-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

.presence-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  border: 2px solid #08090c;
}

.presence-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.34);
}

.status-row {
  position: static;
  order: 1;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.orb {
  order: 2;
  justify-self: center;
  width: 104px;
  height: 104px;
  margin-top: 2px;
}

.identity {
  order: 0;
  text-align: left;
  max-width: none;
}

.identity h1 {
  font-size: 21px;
  line-height: 1.1;
}

.identity p {
  min-height: 0;
  margin-top: 6px;
  font-size: 13px;
}

.voice-status {
  margin-top: 8px;
  padding: 8px 10px;
}

.voice-status span {
  font-size: 12px;
}

.voice-status small {
  font-size: 12px;
}

.quick-actions {
  order: 3;
  grid-template-columns: 1fr;
  gap: 3px;
  margin-top: 0;
}

.quick-actions button {
  min-height: 32px;
  justify-content: start;
  text-align: left;
  padding: 0 10px;
  font-size: 14px;
  background: transparent;
  border-color: transparent;
}

.quick-actions button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: transparent;
}

.sidebar-section {
  order: 4;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.sidebar-recents {
  order: 5;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 4px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-heading button,
.more-projects > button,
.sidebar-list button {
  min-height: 34px;
  border: 0;
  color: var(--text);
  cursor: pointer;
}

.sidebar-heading button {
  width: 30px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-list {
  display: grid;
  gap: 3px;
}

.sidebar-list button,
.more-projects > button {
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 13px;
  background: transparent;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presence-footer {
  position: relative;
  padding: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #08090c;
}

.sidebar-config-button {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0 10px;
  text-align: left;
}

.sidebar-config-button:hover,
.sidebar-config-button:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  outline: 0;
}

.sidebar-config-popover {
  position: absolute;
  z-index: 30;
  left: 8px;
  right: 8px;
  bottom: 48px;
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(35, 35, 38, 0.98);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
}

.sidebar-config-popover[hidden] {
  display: none;
}

.sidebar-config-popover button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0 10px;
  cursor: pointer;
}

.sidebar-config-popover button:hover {
  background: rgba(255, 255, 255, 0.09);
}

.sidebar-list button:hover,
.more-projects > button:hover,
.sidebar-heading button:hover {
  background: rgba(255, 255, 255, 0.09);
}

.sidebar-list button:disabled {
  cursor: default;
  color: var(--muted);
  opacity: 0.75;
}

.more-projects {
  position: relative;
}

.more-popover {
  position: absolute;
  z-index: 20;
  left: calc(100% + 8px);
  bottom: 0;
  width: min(260px, calc(100vw - 290px));
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(35, 35, 38, 0.98);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
}

.more-popover[hidden] {
  display: none;
}

.console {
  min-height: 100vh;
  height: 100vh;
  border-radius: 0;
  padding: 22px clamp(18px, 3vw, 44px);
  background: #050608;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 14px;
  overflow: hidden;
}

.console > .panel-header {
  grid-column: 1 / -1;
}

.console > .command-box {
  grid-column: 1 / -1;
  width: min(860px, 100%);
  justify-self: center;
}

.console > .mode-grid {
  grid-column: 1;
  grid-row: 3;
  align-self: start;
}

.console > .task-panel {
  grid-column: 1;
  grid-row: 5;
  min-height: 0;
}

.console > .chat-panel {
  grid-column: 1;
  grid-row: 4;
  min-height: 0;
  height: 100%;
}

.console > .workspace-panel {
  grid-column: 1 / -1;
}

.panel-header h2 {
  font-size: 24px;
}

.eyebrow {
  color: #7aa2ff;
}

.command-box {
  grid-template-columns: minmax(0, 1fr) 78px 92px;
  gap: 8px;
  min-height: 58px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: #202124;
}

.command-box input {
  min-height: 42px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.command-box input:focus {
  box-shadow: none;
}

#voiceButton,
#sendButton {
  min-height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

#sendButton {
  background: rgba(66, 217, 255, 0.14);
}

.mode-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.mode-grid article {
  min-height: 54px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
}

.task-panel,
.media-panel,
.chat-panel,
.workspace-panel,
.apps-panel,
.library-panel {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.09);
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.chat-log {
  max-height: none;
  min-height: 0;
  align-content: start;
}

.chat-log p {
  background: transparent;
  padding: 10px 4px;
  border-radius: 0;
  color: #c5d0da;
}

.chat-log p + p {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-log .document-preview {
  padding: 14px;
  border-radius: 8px;
  background: rgba(66, 217, 255, 0.06);
}

.chat-composer {
  min-height: 54px;
  margin-top: 12px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: #202124;
}

.chat-composer input {
  min-height: 42px;
  border: 0;
  background: transparent;
}

.chat-composer input:focus {
  box-shadow: none;
}

.chat-composer button {
  min-height: 42px;
  border-radius: 999px;
  background: rgba(66, 217, 255, 0.14);
}

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

.workspace-grid > :nth-child(1) {
  grid-column: 1 / 3;
}

.workspace-grid > :nth-child(2) {
  grid-column: 3 / 6;
}

.workspace-grid > :nth-child(3) {
  grid-column: 6 / 7;
}

.workspace-grid > :nth-child(4) {
  grid-column: 1 / 6;
}

.workspace-grid > :nth-child(5) {
  grid-column: 6 / 7;
}

.workspace-grid > :nth-child(6) {
  grid-column: 7 / 9;
}

.workspace-question {
  grid-column: 1 / 7;
}

.workspace-grid > :nth-child(8) {
  grid-column: 7 / 9;
}

.console.chat-expanded {
  grid-template-columns: minmax(0, 1fr);
}

.console.chat-expanded > .command-box,
.console.chat-expanded > .chat-panel {
  width: min(980px, 100%);
  justify-self: center;
}

.console.chat-expanded > .chat-panel {
  min-height: calc(100vh - 160px);
}

.console.chat-expanded .chat-log {
  min-height: calc(100vh - 290px);
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .console {
    grid-template-columns: 1fr;
  }

  .console > .mode-grid,
  .console > .task-panel,
  .console > .chat-panel {
    grid-column: 1;
    grid-row: auto;
  }

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

@media (max-width: 780px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions select {
    min-width: 0;
    flex: 1;
  }

  .header-actions .icon-button {
    flex: 0 0 auto;
  }

  .presence {
    min-height: auto;
    position: relative;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .orb {
    width: 104px;
    height: 104px;
  }

  .command-box,
  .chat-composer {
    border-radius: 18px;
    grid-template-columns: 1fr;
  }
}

/* Main chat-first refinement */
.console {
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: auto;
}

.console > .panel-header {
  order: 1;
  width: min(920px, 100%);
  justify-self: center;
}

.console > .command-box {
  order: 2;
  width: min(920px, 100%);
}

.console > .mode-grid {
  order: 3;
  grid-column: 1;
  grid-row: auto;
  width: min(920px, 100%);
  justify-self: center;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.console > .chat-panel {
  order: 4;
  grid-column: 1;
  grid-row: auto;
  width: min(920px, 100%);
  justify-self: center;
  min-height: 0;
  height: 100%;
}

.console > .task-panel,
.console > .media-panel,
.console > .settings-panel,
.console > .workspace-panel,
.console > .apps-panel,
.console > .library-panel,
.console > .memory-panel {
  grid-column: 1;
  grid-row: auto;
  width: min(920px, 100%);
  justify-self: center;
}

.console > .task-panel {
  order: 5;
}

.console > .media-panel {
  order: 6;
}

.console > .workspace-panel {
  order: 7;
}

.console > .apps-panel {
  order: 8;
}

.console > .library-panel {
  order: 9;
}

.console > .memory-panel {
  order: 10;
}

.mode-grid article {
  min-height: 48px;
  padding: 8px 10px;
}

.mode-grid span {
  font-size: 11px;
}

.mode-grid strong {
  font-size: 13px;
}

.chat-log {
  min-height: 0;
}

.shell[data-active-panel="home"] .settings-panel,
.shell[data-active-panel="home"] .workspace-panel,
.shell[data-active-panel="home"] .apps-panel,
.shell[data-active-panel="home"] .library-panel,
.shell[data-active-panel="home"] .memory-panel,
.shell[data-active-panel="home"] .panel-header,
.shell[data-active-panel="home"] .command-box,
.shell[data-active-panel="home"] .mode-grid,
.shell[data-active-panel="home"] .task-panel,
.shell[data-active-panel="home"] .media-panel {
  display: none;
}

.shell[data-active-panel="home"] .console {
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
}

.shell[data-active-panel="home"] .chat-panel {
  align-self: stretch;
  width: min(940px, 100%);
  border: 0;
  background: transparent;
  grid-template-rows: minmax(0, 1fr) auto;
}

.shell[data-active-panel="home"] .chat-panel > .panel-header {
  display: none;
}

.shell[data-active-panel="home"] .chat-log {
  display: grid;
  place-content: center;
  gap: 14px;
  text-align: center;
}

.shell[data-active-panel="home"] .chat-log.has-document-preview {
  place-content: start stretch;
  align-content: start;
  text-align: left;
}

.shell[data-active-panel="home"] .chat-log p {
  font-size: 18px;
  color: var(--text);
}

.shell[data-active-panel="home"] .document-preview-content p,
.shell[data-active-panel="home"] .document-preview-content li,
.shell[data-active-panel="home"] .document-preview-content td,
.shell[data-active-panel="home"] .document-preview-content th {
  font-size: 14px;
}

.shell[data-active-panel="home"] .document-preview {
  width: min(920px, 100%);
  justify-self: center;
}

.shell[data-active-panel="home"] .chat-composer {
  margin: 0 auto 34px;
  width: min(780px, 100%);
}

.shell[data-active-panel="status"] .settings-panel,
.shell[data-active-panel="status"] .workspace-panel,
.shell[data-active-panel="status"] .apps-panel,
.shell[data-active-panel="status"] .library-panel,
.shell[data-active-panel="status"] .memory-panel {
  display: none;
}

.shell[data-active-panel="settings"] .workspace-panel,
.shell[data-active-panel="settings"] .apps-panel,
.shell[data-active-panel="settings"] .library-panel,
.shell[data-active-panel="settings"] .memory-panel,
.shell[data-active-panel="workspace"] .settings-panel,
.shell[data-active-panel="workspace"] .apps-panel,
.shell[data-active-panel="workspace"] .library-panel,
.shell[data-active-panel="workspace"] .memory-panel,
.shell[data-active-panel="apps"] .settings-panel,
.shell[data-active-panel="apps"] .workspace-panel,
.shell[data-active-panel="apps"] .library-panel,
.shell[data-active-panel="apps"] .memory-panel,
.shell[data-active-panel="library"] .settings-panel,
.shell[data-active-panel="library"] .workspace-panel,
.shell[data-active-panel="library"] .apps-panel,
.shell[data-active-panel="library"] .memory-panel,
.shell[data-active-panel="memory"] .settings-panel,
.shell[data-active-panel="memory"] .workspace-panel,
.shell[data-active-panel="memory"] .apps-panel,
.shell[data-active-panel="memory"] .library-panel {
  display: none;
}

@media (max-width: 1180px) {
  .console > .mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.panel-search {
  width: min(280px, 100%);
  min-height: 40px;
  background: rgba(255, 255, 255, 0.045);
}

.apps-feature {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 14px 0;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid rgba(66, 217, 255, 0.14);
  background:
    radial-gradient(circle at 12% 20%, rgba(66, 217, 255, 0.2), transparent 16rem),
    rgba(255, 255, 255, 0.045);
}

.windows-quick-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(0, 213, 255, 0.18);
  border-radius: 8px;
  background: rgba(0, 213, 255, 0.045);
}

.windows-quick-panel > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 118px;
}

.windows-quick-panel h3 {
  margin: 0;
  font-size: 15px;
}

.windows-quick-panel small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

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

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

.windows-allow-row input {
  min-height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.windows-allow-row button {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(110, 242, 178, 0.38);
  background: rgba(110, 242, 178, 0.1);
  color: var(--text);
  font-weight: 800;
  padding: 7px 12px;
}

.windows-command-grid button {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(0, 213, 255, 0.34);
  background: rgba(0, 213, 255, 0.08);
  color: var(--text);
  font-weight: 700;
  padding: 7px 10px;
}

.windows-command-grid button:hover {
  background: rgba(0, 213, 255, 0.16);
}

.windows-command-grid button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.windows-apps-catalog {
  margin: 10px 0 14px;
}

.windows-apps-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.windows-apps-grid .app-card {
  min-height: 62px;
  grid-template-columns: 34px minmax(0, 1fr);
  padding: 9px;
}

.windows-app-card-wrap {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 6px;
}

.windows-app-card-wrap .app-card {
  width: 100%;
}

.windows-revoke-button {
  min-width: 76px;
  border-radius: 8px;
  border: 1px solid rgba(255, 116, 116, 0.36);
  background: rgba(255, 116, 116, 0.08);
  color: var(--text);
  font-weight: 800;
  padding: 0 8px;
}

.windows-revoke-button:hover {
  background: rgba(255, 116, 116, 0.16);
}

.windows-revoke-button[data-confirm="true"] {
  border-color: rgba(255, 183, 77, 0.48);
  background: rgba(255, 183, 77, 0.13);
}

.windows-apps-grid .app-icon {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.apps-feature h3 {
  margin: 10px 0 4px;
  font-size: 21px;
}

.apps-feature p,
.empty-state {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.apps-feature button,
.library-actions button {
  min-height: 40px;
  border: 1px solid rgba(66, 217, 255, 0.24);
  background: rgba(66, 217, 255, 0.1);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  padding: 0 18px;
}

.catalog-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.catalog-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  padding: 0 14px;
}

.catalog-tabs button.active,
.catalog-tabs button:hover {
  background: rgba(66, 217, 255, 0.18);
}

.apps-catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.app-card {
  min-width: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.app-card:hover {
  background: rgba(255, 255, 255, 0.07);
}

.app-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(66, 217, 255, 0.85), rgba(110, 242, 178, 0.45));
  color: #041015;
  font-weight: 800;
}

.app-card span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.app-card strong,
.library-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-card small,
.library-row small {
  color: var(--muted);
  line-height: 1.35;
}

.app-card em,
.library-row em {
  align-self: start;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.library-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  min-width: 0;
}

.library-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.library-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.075);
}

.library-row:hover {
  background: rgba(66, 217, 255, 0.08);
}

.memory-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.memory-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
}

.memory-row:hover {
  background: rgba(110, 242, 178, 0.075);
}

.memory-row-content {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 14px;
}

.memory-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-row small {
  grid-column: 1;
  color: var(--muted);
  line-height: 1.35;
}

.memory-row em {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(110, 242, 178, 0.1);
  color: var(--green);
  font-size: 12px;
  font-style: normal;
}

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

.memory-action-button {
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(0, 213, 255, 0.45);
  background: rgba(0, 213, 255, 0.08);
  color: var(--text);
  font-weight: 700;
  padding: 7px 11px;
}

.memory-action-button:hover {
  background: rgba(0, 213, 255, 0.16);
}

.memory-delete-button,
.danger-soft {
  border-color: rgba(255, 116, 116, 0.45);
  background: rgba(255, 116, 116, 0.08);
}

.memory-delete-button:hover,
.danger-soft:hover {
  background: rgba(255, 116, 116, 0.16);
}

@media (max-width: 860px) {
  .apps-feature,
  .panel-header.slim,
  .library-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .apps-catalog,
  .library-row,
  .memory-row,
  .memory-row-content {
    grid-template-columns: 1fr;
  }

  .app-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .windows-quick-panel,
  .windows-command-grid,
  .windows-allow-row,
  .windows-apps-grid {
    grid-template-columns: 1fr;
  }

  .app-card em {
    grid-column: 2;
    justify-self: start;
  }

  .memory-row small,
  .memory-row em {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  .memory-row-actions {
    width: 100%;
  }

  .memory-action-button {
    flex: 1;
  }
}
