/* Existing layout and state rules; canonical components are unlayered. */
@layer myna-legacy {
:root {
  color-scheme: light;
  --bg-top: #ffffff;
  --bg-bottom: #f6f8fb;
  --panel: rgba(255, 255, 255, 0.74);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --orange: #cf3900;
  --orange-border: rgba(145, 42, 0, 0.42);
  --text: #171717;
  --muted: #616161;
  --chat-paper-ink: #171718;
  --line: rgba(23, 23, 23, 0.1);
  --button-border: rgba(57, 72, 86, 0.38);
  --button-border-strong: rgba(23, 23, 23, 0.72);
  --button-fill: #171717;
  --button-fill-strong: #2f3438;
  --button-fill-text: #ffffff;
  --shadow: 0 24px 80px rgba(17, 17, 17, 0.08);
  --danger: #9c2f2f;
  --company-red: rgba(23, 23, 23, 0.72);
  --company-red-soft: rgba(23, 23, 23, 0.16);
  --radius-xl: 34px;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  background: var(--bg-top);
  color: var(--text);
  font-family: "Instrument Sans", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

/* Deterministic first-run introduction. Visual cues are presentation-only;
   every fact is also present in the preserved chat transcript. */
.onboarding-language-screen {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 28px;
}

.onboarding-language-actions {
  width: min(430px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.onboarding-language-option {
  min-height: 64px;
  padding: 14px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
}

.onboarding-language-option:hover { background: #ffffff; }
.onboarding-language-error { position: absolute; top: calc(50% + 60px); }

.onboarding-tour-controls {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  box-shadow: none;
  transform: translate(-50%, -50%);
}

.onboarding-actions, .help-onboarding-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.help-onboarding-actions { margin: 0 0 20px; }
.onboarding-tour-controls .onboarding-actions { flex-wrap: nowrap; }
.onboarding-tour-controls .mini-control { min-height: 30px; padding: 5px 9px; }
.onboarding-tour-controls .onboarding-play-pause {
  width: 32px;
  min-width: 32px;
  padding: 6px;
}
.onboarding-tour-controls .onboarding-play-pause svg { width: 16px; height: 16px; }
.onboarding-composer-preview { pointer-events: none; }
.onboarding-composer-preview button:disabled,
.onboarding-composer-preview textarea:disabled { opacity: 1; }

.app-shell.onboarding-active {
  position: relative;
}

.onboarding-active:not(.onboarding-revealed-workspace) .workspace {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.onboarding-active:not(.onboarding-revealed-shared) .workspace-entry[data-path="Shared"] { display: none; }

.onboarding-cue-chats.onboarding-revealed-chats #chatListToggle,
.onboarding-cue-shared.onboarding-revealed-shared .workspace-entry[data-path="Shared"] .workspace-entry-main,
.onboarding-cue-knowledge.onboarding-revealed-knowledge .workspace-entry[data-path="Shared/Wiki"] .workspace-entry-main,
.onboarding-cue-documents.onboarding-revealed-documents .workspace-entry[data-name="MYNA-Tour.md"],
.onboarding-cue-attach.onboarding-revealed-attach #onboardingAttachDemo,
.onboarding-cue-voice.onboarding-revealed-voice #onboardingVoiceDemo,
.onboarding-cue-images.onboarding-revealed-images #onboardingImageDemo,
.onboarding-cue-inbox:not(.onboarding-cue-revealed) #scheduledToggle,
.onboarding-cue-admin-users:not(.onboarding-account-menu-shown):not(.onboarding-cue-revealed) .account-name,
.onboarding-cue-admin-users:not(.onboarding-account-menu-shown):not(.onboarding-cue-revealed) #accountToggle,
.onboarding-cue-admin-users.onboarding-account-menu-shown:not(.onboarding-cue-revealed) .account-menu:not([hidden]),
.onboarding-cue-help.onboarding-standard-user:not(.onboarding-account-menu-shown):not(.onboarding-cue-revealed) .account-name,
.onboarding-cue-help.onboarding-standard-user:not(.onboarding-account-menu-shown):not(.onboarding-cue-revealed) #accountToggle,
.onboarding-cue-help:not(.onboarding-account-menu-shown):not(.onboarding-cue-revealed) #helpToggle,
.onboarding-cue-help.onboarding-standard-user.onboarding-account-menu-shown:not(.onboarding-cue-revealed) .account-menu:not([hidden]) {
  transform-origin: center;
  animation: onboarding-spring-pop 820ms cubic-bezier(0.18, 0.9, 0.24, 1.25) both;
}

.onboarding-cue-admin-users.onboarding-account-menu-shown:not(.onboarding-cue-revealed) .account-menu:not([hidden]),
.onboarding-cue-help.onboarding-standard-user.onboarding-account-menu-shown:not(.onboarding-cue-revealed) .account-menu:not([hidden]) {
  transform-origin: top right;
}

.onboarding-cue-chats.onboarding-revealed-chats .chat-list-panel,
.onboarding-cue-workspace.onboarding-revealed-workspace .files-panel,
.onboarding-cue-documents.onboarding-revealed-documents .preview-panel,
.onboarding-cue-composer.onboarding-revealed-composer .onboarding-composer-preview,
.onboarding-cue-inbox.onboarding-cue-revealed .scheduled-modal,
.onboarding-cue-admin-users.onboarding-cue-revealed .admin-modal,
.onboarding-cue-admin-api.onboarding-cue-revealed .lan-api-modal,
.onboarding-cue-help.onboarding-cue-revealed .help-info-modal {
  transform-origin: center;
  animation: onboarding-spring-pop-surface 820ms cubic-bezier(0.18, 0.9, 0.24, 1.25) both;
}

.onboarding-cue-chat.onboarding-revealed-chat .onboarding-tour-controls {
  transform-origin: center;
  animation: onboarding-spring-pop-centered 820ms cubic-bezier(0.18, 0.9, 0.24, 1.25) both;
}

.onboarding-cue-layout .workspace {
  transition: grid-template-columns 720ms cubic-bezier(0.22, 1, 0.36, 1);
}

.onboarding-active .panel-drag-hit {
  display: none;
}

.onboarding-active .panel-drag-handle,
.onboarding-active .panel-resize-handle-mark {
  opacity: 0 !important;
}

.onboarding-cue-layout.onboarding-demo-phase-1 .panel-drag-handle,
.onboarding-cue-layout.onboarding-demo-phase-2 .panel-drag-handle {
  opacity: 1 !important;
}

.onboarding-cue-layout.onboarding-demo-phase-2 .panel-drag-handle svg {
  transform-origin: center;
  animation: onboarding-spring-pop 820ms cubic-bezier(0.18, 0.9, 0.24, 1.25) both;
}

.onboarding-cue-layout.onboarding-demo-phase-3 [data-panel-resize="columns"] .panel-resize-handle-mark {
  opacity: 1 !important;
  transform-origin: center;
  animation: onboarding-spring-pop 820ms cubic-bezier(0.18, 0.9, 0.24, 1.25) both;
}

.onboarding-cue-inbox .modal-backdrop,
.onboarding-cue-admin-users .admin-modal-backdrop,
.onboarding-cue-admin-api .modal-backdrop,
.onboarding-cue-help .modal-backdrop { padding-bottom: 88px; }

.onboarding-cue-inbox .modal-panel,
.onboarding-cue-admin-users .admin-modal,
.onboarding-cue-admin-api .modal-panel,
.onboarding-cue-help .modal-panel { max-height: min(690px, calc(100vh - 112px)); }

.onboarding-active .scheduled-modal button:not(#scheduledClose),
.onboarding-active .lan-api-modal button:not(#lanApiClose),
.onboarding-active .lan-api-modal input,
.onboarding-active .lan-api-modal .switch-control,
.onboarding-active .admin-modal button,
.onboarding-active .admin-modal input,
.onboarding-active .admin-modal .switch-control,
.onboarding-active .help-info-modal button:not(#onboardingPause):not(#onboardingSkip) { pointer-events: none; }

.onboarding-active button:not(#onboardingPause):not(#onboardingSkip):not(#scheduledClose):not(#adminClose):not(#lanApiClose):not(#helpClose),
.onboarding-active input,
.onboarding-active select,
.onboarding-active textarea,
.onboarding-active a,
.onboarding-active [contenteditable],
.onboarding-active [draggable="true"] {
  pointer-events: none;
}

.onboarding-active #onboardingPause,
.onboarding-active #onboardingSkip,
.onboarding-active #scheduledClose,
.onboarding-active #adminClose,
.onboarding-active #lanApiClose,
.onboarding-active #helpClose {
  pointer-events: auto;
}

.onboarding-active button:disabled,
.onboarding-active input:disabled,
.onboarding-active select:disabled,
.onboarding-active textarea:disabled {
  opacity: 1;
  color: inherit;
  cursor: default;
  -webkit-text-fill-color: currentColor;
}

.onboarding-active .chat-attach-button:disabled {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}

@keyframes onboarding-spring-pop {
  0% { opacity: 0; transform: scale(0.48); }
  43% { opacity: 1; transform: scale(1.16); }
  64% { opacity: 1; transform: scale(0.93); }
  82% { opacity: 1; transform: scale(1.055); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes onboarding-spring-pop-centered {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.48); }
  43% { opacity: 1; transform: translate(-50%, -50%) scale(1.16); }
  64% { opacity: 1; transform: translate(-50%, -50%) scale(0.93); }
  82% { opacity: 1; transform: translate(-50%, -50%) scale(1.055); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes onboarding-spring-pop-surface {
  0% { opacity: 0; transform: scale(0.86); }
  43% { opacity: 1; transform: scale(1.028); }
  64% { opacity: 1; transform: scale(0.985); }
  82% { opacity: 1; transform: scale(1.008); }
  100% { opacity: 1; transform: scale(1); }
}

@media (max-width: 760px) {
  .onboarding-language-actions { grid-template-columns: 1fr; }
  .onboarding-tour-controls { max-width: calc(100vw - 40px); }
  .onboarding-revealed-admin-users .topbar > .onboarding-tour-controls,
  .onboarding-revealed-help .topbar > .onboarding-tour-controls {
    position: static;
    flex: 0 0 100%;
    order: 3;
    justify-content: center;
    max-width: none;
    padding: 0;
    border: 0;
    background: transparent;
    transform: none;
  }
  .onboarding-revealed-admin-users .topbar > .onboarding-tour-controls .onboarding-actions,
  .onboarding-revealed-help .topbar > .onboarding-tour-controls .onboarding-actions {
    width: max-content;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-strong);
  }
  .onboarding-actions button { flex: 1; }
  .onboarding-actions .onboarding-play-pause { flex: 0 0 32px; }

  .app-shell.onboarding-active {
    height: 100dvh;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .onboarding-active .workspace-stage,
  .onboarding-active .workspace,
  .onboarding-active .workspace.has-preview {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .onboarding-active .workspace,
  .onboarding-active .workspace.has-preview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    grid-template-areas: "chat" !important;
    gap: 10px;
  }

  .onboarding-active.onboarding-revealed-workspace .workspace:not(.has-preview) {
    grid-template-rows: minmax(0, 1.2fr) minmax(132px, 0.8fr) !important;
    grid-template-areas: "chat" "workspace" !important;
  }

  .onboarding-active.onboarding-revealed-documents .workspace.has-preview {
    grid-template-rows: minmax(0, 1fr) 193px 160px !important;
    grid-template-areas: "chat" "workspace" "preview" !important;
  }

  .onboarding-active.onboarding-mobile-chat-focus .workspace,
  .onboarding-active.onboarding-mobile-chat-focus .workspace.has-preview {
    grid-template-rows: minmax(0, 1fr) !important;
    grid-template-areas: "chat" !important;
  }

  .onboarding-active.onboarding-mobile-chat-focus .files-panel,
  .onboarding-active.onboarding-mobile-chat-focus .preview-panel {
    display: none;
  }

  .onboarding-active .chat-panel {
    grid-area: chat !important;
  }

  .onboarding-active .files-panel {
    grid-area: workspace !important;
  }

  .onboarding-active .preview-panel {
    grid-area: preview !important;
  }

  .onboarding-active .panel,
  .onboarding-active .chat-panel,
  .onboarding-active .files-panel,
  .onboarding-active .preview-panel {
    min-height: 0;
    height: auto;
    align-self: stretch;
  }

  .onboarding-active .layout-card + .layout-card {
    margin-top: 0;
  }

  .onboarding-active .workspace-list {
    overflow-y: auto;
  }

  .onboarding-active .preview {
    padding: 8px;
    font-size: 0.76rem;
    line-height: 1.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .onboarding-active *,
  .onboarding-active *::before,
  .onboarding-active *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

#app {
  min-height: 100vh;
  min-height: 100dvh;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  line-height: 1.45;
}

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

button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--button-border-strong);
  border-radius: 999px;
  background: var(--button-fill);
  color: var(--button-fill-text);
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

button[aria-disabled="true"],
button:disabled {
  opacity: 0.55;
  cursor: default;
}

button:hover {
  background: var(--button-fill-strong);
}

button.primary-action,
#signin,
#change,
#createUser,
#createLanApiKey,
#saveFolder,
.button,
.chat-list-new,
.workspace-round-button#createFolder,
#newFolderToggle {
  border-color: var(--orange-border);
  background: var(--orange);
  color: #ffffff;
}

button.primary-action:hover,
#signin:hover,
#change:hover,
#createUser:hover,
#createLanApiKey:hover,
#saveFolder:hover,
.button:hover,
.chat-list-new:hover,
#newFolderToggle:hover {
  background: #b83200;
  color: #ffffff;
}

.myna-hover-label {
  position: fixed;
  z-index: 1000;
  max-width: min(260px, calc(100vw - 16px));
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(23, 23, 23, 0.92);
  box-shadow: 0 10px 30px rgba(17, 17, 17, 0.18);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translateY(2px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: normal;
}

.myna-hover-label.is-visible {
  opacity: 1;
  transform: translateY(0);
}

button.mini-control,
button.secondary {
  border-color: var(--line);
  background: var(--panel-strong);
  box-shadow: none;
  color: var(--text);
}

button.secondary:hover {
  border-color: var(--button-border);
  background: #ffffff;
}

button.danger {
  border-color: rgba(179, 48, 48, 0.24);
  background: rgba(179, 48, 48, 0.08);
  color: var(--danger);
}

button.danger:hover,
button.danger:focus-visible {
  border-color: rgba(179, 48, 48, 0.34);
  background: rgba(179, 48, 48, 0.13);
  color: var(--danger);
}

input,
textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  outline: none;
}

input[type="checkbox"] {
  width: auto;
}

input:focus,
textarea:focus {
  border-color: var(--button-border-strong);
}

textarea {
  resize: vertical;
}

.maintenance-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.maintenance-card {
  width: min(560px, 100%);
  padding: clamp(28px, 6vw, 52px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.maintenance-card h1 {
  margin: 38px 0 12px;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  line-height: 1.08;
}

.maintenance-card p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 18px;
  gap: 18px;
}

.topbar {
  position: relative;
  z-index: 90;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  font-size: 1.24rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
}

.account {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  position: relative;
}

.mini-control {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: none;
  color: var(--text);
}

.account-name {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
}

.account-button svg {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 20px;
}

.account-button.help-button svg {
  width: 21px;
  height: 21px;
}

.account-button.is-open,
.workspace-round-button.is-open,
.file-menu-button.is-open {
  border-color: var(--button-border-strong);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(23, 23, 23, 0.06), var(--shadow);
}

.account-button:hover,
.account-button.is-open {
  background: rgba(23, 23, 23, 0.055);
  border-color: transparent;
  box-shadow: none;
}

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

.account-menu-head {
  display: grid;
  gap: 2px;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--line);
}

.account-menu-head span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-switcher {
  display: grid;
  gap: 6px;
  padding: 4px 2px;
}

.language-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-color: var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
}

.language-button.is-active {
  border-color: var(--button-border-strong);
  background: var(--button-fill);
  color: var(--button-fill-text);
}

.account-menu-item {
  display: flex;
  align-items: center;
  min-height: 34px;
  justify-content: flex-start;
  border-color: var(--line);
  background: var(--panel-strong);
  color: var(--text);
}

.account-menu a.account-menu-item { text-decoration: none; }
.account-export-status { padding: 2px 4px; color: var(--muted); font-size: 0.78rem; line-height: 1.45; }

.account-menu-item:hover {
  border-color: var(--button-border);
  background: #ffffff;
  color: var(--text);
}

.account-password-form {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.modal-panel.password-modal {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.96);
}

.modal-panel.export-modal {
  width: min(440px, 100%);
  background: rgba(255, 255, 255, 0.98);
}

.export-modal-body {
  display: grid;
  gap: 12px;
  padding: 18px;
  overflow: auto;
}

.export-modal-body p { margin: 0; }

.export-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 40px;
  padding: 0 20px;
  border: 1px solid var(--orange-border);
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.export-receipt { font-weight: 700; }
.export-note, .export-backup { color: var(--muted); font-size: 0.85rem; }
.export-backup { padding-top: 14px; border-top: 1px solid var(--line); }
.export-backup summary { color: var(--text); cursor: pointer; font-weight: 700; }
.export-backup-content { display: grid; gap: 10px; padding-top: 10px; }
.export-backup .account-menu-item { width: fit-content; }

.workspace {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.workspace-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: block;
}

.workspace-stage > .workspace {
  width: 100%;
  height: 100%;
}

.workspace-stage.is-chat-history-open {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 4fr);
  gap: 18px;
}

.workspace.has-preview {
  align-items: stretch;
}

.workspace.no-preview {
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}

.panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.panel:last-child {
  border-right: 1px solid var(--line);
}

.panel-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title {
  min-width: 0;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: 1.52rem;
}

h2 {
  font-size: 1rem;
}

h3 {
  font-size: 0.9rem;
}

.eyebrow {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 12px;
}

.row {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.row > * {
  min-width: 0;
}

.row > button,
.row > .badge {
  flex: 0 0 auto;
}

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

.scroll {
  min-height: 0;
  overflow: auto;
  scrollbar-color: var(--line) transparent;
}

.files-body,
.inspector-body {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
}

.files-panel,
.preview-panel,
.admin-panel {
  align-self: start;
}

.files-panel {
  container-type: inline-size;
  padding: 12px;
  background: #f2f2f2;
}

.layout-card {
  align-self: stretch;
  box-shadow: none;
  transition:
    transform 190ms ease,
    opacity 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.layout-card.is-dragging {
  opacity: 0.58;
  border-color: var(--button-border);
  box-shadow: 0 24px 62px rgba(15, 23, 42, 0.2);
}

.panel-drag-hit {
  position: absolute;
  left: 50%;
  top: -10px;
  z-index: 4;
  width: 148px;
  height: 90px;
  transform: translateX(-50%);
}

.panel-drag-handle {
  position: absolute;
  left: 50%;
  top: 18px;
  z-index: 5;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  max-width: 30px;
  max-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  line-height: 0;
  opacity: 0;
  transform: translateX(-50%);
  cursor: grab;
  box-shadow: 0 8px 22px rgba(17, 17, 17, 0.08);
  transition: opacity 130ms ease, background 130ms ease;
}

.panel-drag-hit:hover + .panel-drag-handle,
.panel-drag-hit:focus-within + .panel-drag-handle,
.panel-drag-handle:hover,
.panel-drag-handle:focus-visible,
.layout-card.is-dragging .panel-drag-handle {
  opacity: 1;
}

.panel-drag-handle:active {
  cursor: grabbing;
}

.panel-drag-handle svg {
  width: 16px;
  height: 16px;
  display: block;
  flex: 0 0 auto;
}

.panel-resize-handle {
  position: absolute;
  z-index: 12;
  width: 72px;
  height: 72px;
  min-width: 72px;
  min-height: 72px;
  max-width: 72px;
  max-height: 72px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  transform: translate(-50%, -50%);
  touch-action: none;
}

.panel-resize-handle:hover {
  background: transparent;
}

.panel-resize-handle-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  box-shadow: 0 8px 22px rgba(17, 17, 17, 0.08);
  opacity: 0;
  transition: opacity 130ms ease, background 130ms ease;
}

.panel-resize-handle:hover .panel-resize-handle-mark,
.panel-resize-handle:focus-visible .panel-resize-handle-mark,
.panel-resize-handle.is-dragging .panel-resize-handle-mark {
  opacity: 1;
}

.panel-resize-handle:focus-visible {
  outline: none;
}

.panel-resize-handle:focus-visible .panel-resize-handle-mark {
  outline: 2px solid rgba(242, 140, 40, 0.44);
  outline-offset: 2px;
}

.panel-resize-handle-mark svg {
  width: 16px;
  height: 16px;
}

.panel-resize-vertical {
  cursor: col-resize;
}

.panel-resize-horizontal {
  cursor: row-resize;
}

.panel-drop-zone {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  border: 2px solid rgba(17, 17, 17, 0.18);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.34);
  opacity: 0;
  transition: opacity 120ms ease, border-color 120ms ease, background 120ms ease;
}

.panel-drop-zone.is-visible {
  opacity: 1;
}

.panel-drop-zone.is-hot {
  border-color: var(--button-border);
  background: rgba(255, 255, 255, 0.68);
}

.panel-drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  min-width: 180px;
  pointer-events: none;
  padding: 12px 14px;
  border: 1px solid var(--button-border);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 60px rgba(17, 17, 17, 0.18);
  transform: translate3d(-9999px, -9999px, 0);
}

.preview-panel {
  grid-template-rows: auto minmax(0, 1fr);
  justify-self: stretch;
  margin-top: 0;
  position: static;
}

.preview-panel.is-collapsed {
  grid-template-rows: auto;
}

.file-list,
.workspace-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.workspace-list {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.workspace-table {
  --workspace-modified-column: clamp(6.5rem, 18cqw, 7.375rem);
  --workspace-type-column: clamp(4rem, 11cqw, 4.875rem);
  --workspace-size-column: clamp(5.5rem, 11cqw, 5.75rem);
  position: relative;
  min-width: 0;
  display: grid;
  align-content: start;
}

.workspace-table::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: 0;
  right: var(--workspace-size-column);
  bottom: 0;
  width: 1px;
  background: rgba(23, 23, 23, 0.1);
  box-shadow:
    calc(0px - var(--workspace-type-column)) 0 0 rgba(23, 23, 23, 0.1),
    calc(0px - var(--workspace-type-column) - var(--workspace-modified-column)) 0 0 rgba(23, 23, 23, 0.1);
  pointer-events: none;
}

.workspace-list-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--workspace-modified-column) var(--workspace-type-column) var(--workspace-size-column);
  gap: 0;
  align-items: center;
  padding: 0;
  border-bottom: 0;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.workspace-list-head > * {
  min-width: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 6px;
  overflow: hidden;
}

.workspace-list-head > * + * {
  border-left: 0;
}

.workspace-sort-button {
  min-width: 0;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  padding: 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
}

.workspace-sort-button:hover,
.workspace-sort-button:focus-visible {
  color: var(--text);
  background: transparent;
  box-shadow: none;
}

.workspace-sort-button.is-active {
  color: var(--text);
}

.workspace-sort-button[data-workspace-sort="size"] {
  justify-content: flex-end;
}

.workspace-sort-arrow {
  width: 10px;
  min-width: 10px;
  display: inline-flex;
  justify-content: center;
  font-size: 0.72rem;
  line-height: 1;
}

.workspace-body-split {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  flex: 1 1 auto;
}

.workspace-browser-column {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
}

.workspace-browser-column.can-write {
  grid-template-rows: auto minmax(0, 1fr);
}

.workspace-file-area {
  position: relative;
  min-width: 0;
  min-height: max(320px, calc(100dvh - 270px));
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 4px;
  border-radius: 18px;
}

.file {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  text-align: left;
  position: relative;
}

.file:hover,
.file.active {
  border-color: var(--button-border-strong);
  background: #ffffff;
}

.workspace-entry {
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--workspace-modified-column) var(--workspace-type-column) var(--workspace-size-column);
  grid-template-areas: "main modified type size";
  align-items: center;
  gap: 0;
  padding: 0;
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.18);
  color: var(--text);
  text-align: left;
  position: relative;
}

.workspace-entry:last-child {
  border-bottom: 0;
}

.workspace-entry.active,
.workspace-entry:hover {
  background: rgba(255, 255, 255, 0.34);
}

.workspace-entry.pending-upload {
  background: rgba(245, 246, 248, 0.92);
  color: rgba(23, 23, 23, 0.62);
  filter: grayscale(0.2);
  opacity: 0.58;
  pointer-events: none;
}

.workspace-entry.pending-upload:hover {
  background: rgba(245, 246, 248, 0.92);
}

.workspace-entry.pending-upload .workspace-entry-icon {
  background: rgba(23, 23, 23, 0.045);
  color: rgba(23, 23, 23, 0.55);
}

.workspace-entry.pending-upload .workspace-entry-cell {
  color: rgba(23, 23, 23, 0.62);
}

.workspace-upload-progress {
  position: absolute;
  right: 12px;
  bottom: 7px;
  left: 12px;
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.12);
}

.workspace-upload-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #111111;
}

.workspace-upload-progress.indeterminate span {
  width: 38%;
  animation: workspace-upload-sweep 1.05s ease-in-out infinite;
}

@keyframes workspace-upload-sweep {
  0% {
    transform: translateX(-115%);
  }

  100% {
    transform: translateX(270%);
  }
}

.workspace-entry.company-folder {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.workspace-entry.company-folder:hover,
.workspace-entry.company-folder.active {
  box-shadow: none;
}

.workspace-entry-main {
  min-width: 0;
  width: 100%;
  height: 100%;
  grid-area: main;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 40px 6px 6px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  text-align: left;
}

.workspace-entry-main:hover {
  background: transparent;
}

.workspace-entry-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(23, 23, 23, 0.06);
  color: var(--muted);
}

.workspace-entry-icon svg {
  width: 17px;
  height: 17px;
  display: block;
}

.workspace-message {
  margin: 4px 0;
}

.workspace-reference-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: min(100%, 34rem);
  border: 1px solid rgba(66, 153, 225, 0.35);
  border-radius: 999px;
  background: rgba(66, 153, 225, 0.08);
  color: inherit;
  font: inherit;
  padding: 1px 7px;
  cursor: pointer;
  vertical-align: baseline;
}

.workspace-reference-chip:hover,
.workspace-reference-chip:focus {
  border-color: rgba(66, 153, 225, 0.75);
  background: rgba(66, 153, 225, 0.16);
}

.workspace-reference-chip svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.workspace-reference-chip span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-source-citation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 22px;
  margin: 0 2px;
  padding: 0 6px;
  border: 1px solid rgba(23, 23, 23, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font: inherit;
  font-size: 0.82em;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  vertical-align: baseline;
}

.inline-source-citation:hover,
.inline-source-citation:focus {
  border-color: rgba(23, 23, 23, 0.32);
  background: #f7f8fa;
}

.chat-source-panel {
  margin-top: 10px;
  min-width: 0;
}

.chat-source-toggle {
  width: max-content;
  max-width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  list-style: none;
  box-shadow: var(--shadow-soft);
}

.chat-source-toggle::-webkit-details-marker {
  display: none;
}

.chat-source-toggle:hover,
.chat-source-toggle:focus {
  border-color: var(--muted);
  background: var(--panel-strong);
}

.chat-source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  min-width: 0;
}

.chat-source-chip {
  flex: 0 1 auto;
  max-width: min(100%, 260px);
}

.chat-source-excerpt {
  min-width: min(100%, 280px);
  max-width: 100%;
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid rgba(23, 23, 23, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.4;
}

.chat-source-excerpt span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.workspace-entry.company-folder .workspace-entry-icon {
  background: rgba(23, 23, 23, 0.06);
  color: var(--text);
}

.workspace-entry-copy {
  min-width: 0;
  display: grid;
}

.workspace-entry-name {
  min-width: 0;
  overflow: visible;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.workspace-entry-cell {
  min-width: 0;
  min-height: 48px;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 5px 6px;
  border-left: 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.15;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.workspace-entry-modified {
  grid-area: modified;
}

.workspace-entry-type {
  grid-area: type;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.workspace-entry-type-label {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.workspace-entry-size {
  grid-area: size;
  justify-content: flex-end;
  text-align: right;
}

@container (max-width: 420px) {
  .workspace-entry-main {
    gap: 0;
    padding: 5px;
  }

  .workspace-entry-icon {
    display: none;
  }

  .workspace-entry-name {
    font-size: 0.74rem;
  }

  .workspace-entry-cell {
    padding: 4px;
    font-size: 0.64rem;
  }
}

.table-actions,
.actions,
.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.table-actions button {
  min-height: 34px;
  padding: 0 11px;
  font-size: 0.84rem;
}

.file-menu {
  position: relative;
  grid-area: main;
  justify-self: end;
  align-self: center;
  margin-right: 12px;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  z-index: 2;
}

.workspace-entry:hover .file-menu,
.workspace-entry:focus-within .file-menu,
.file-menu:has(.file-menu-button.is-open) {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.file-menu-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: 0;
  letter-spacing: 0;
}

.file-menu-button .more-horizontal-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 18px;
}

.file-menu-button:hover,
.file-menu-button.is-open {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.file-menu-popover {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  right: 0;
  width: max-content;
  min-width: 212px;
  max-width: min(300px, calc(100vw - 20px));
  max-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.floating-file-menu {
  position: fixed;
  z-index: 160;
  right: auto;
}

.file-menu-popover button {
  width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 12px;
  font-size: 0.86rem;
  text-align: left;
}

.file-menu-popover button svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.file-menu-index-status {
  margin-top: 4px;
  padding: 7px 10px 2px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
}

.file-menu-index-status.indexed {
  color: #187344;
}

.file-menu-index-status.failed {
  color: var(--danger);
}

.file-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.drop {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed var(--button-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.54);
  cursor: pointer;
}

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

.drop-action {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.workspace-head {
  align-items: center;
  justify-content: space-between;
}

.filespace-views {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 0;
}

.filespace-views button {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.filespace-views button[aria-pressed="true"] {
  color: var(--text);
  background: var(--panel-strong);
}

.company-knowledge-view .workspace-list-head,
.company-knowledge-view .workspace-entry {
  grid-template-columns: minmax(0, 1fr);
}

.company-knowledge-view .workspace-entry {
  grid-template-areas: "main";
}

.company-knowledge-view .workspace-list-head > :not(:first-child),
.company-knowledge-view .workspace-entry-cell,
.company-knowledge-view .workspace-table::after {
  display: none;
}

.workspace-location {
  min-width: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.workspace-up-button {
  width: auto;
  height: 34px;
  min-width: max-content;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  box-shadow: none;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.workspace-path-label {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-round-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  box-shadow: none;
  color: var(--text);
  font-size: 1.1rem;
}

.workspace-round-button svg {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 18px;
}

#uploadButton {
  border-color: rgba(255, 255, 255, 0.08);
  background: #050505;
  color: #ffffff;
}

#uploadButton:hover {
  background: #202020;
  color: #ffffff;
}

.workspace-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.46);
}

.workspace-drop-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 8;
  place-items: center;
  padding: 20px;
  border: 1px dashed var(--button-border);
  border-radius: 24px;
  background: rgba(57, 72, 86, 0.13);
  color: var(--text);
  pointer-events: none;
}

.workspace-drop-overlay.is-active {
  display: grid;
  border-color: var(--button-border-strong);
}

.workspace-drop-copy {
  display: grid;
  gap: 4px;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}

.workspace-drop-copy strong {
  color: var(--text);
}

.workspace-folder-drop-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 3;
  place-items: center;
  border: 1px dashed var(--button-border-strong);
  border-radius: inherit;
  background: rgba(57, 72, 86, 0.13);
  color: var(--text);
  pointer-events: none;
}

.workspace-entry.is-folder-drop-active .workspace-folder-drop-overlay {
  display: grid;
}

.workspace-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
}

.chat-panel {
  min-width: 0;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: rgba(255, 255, 255, 0.9);
}

.chat-panel-head {
  align-items: flex-start;
  justify-content: flex-start;
}

.chat-list-control {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

.chat-list-trigger {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
  border-color: var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: none;
}

.chat-history-trigger {
  width: 34px;
  min-width: 34px;
  padding: 0;
}

.chat-history-trigger.is-open {
  width: 34px;
  min-width: 34px;
  padding: 0;
}

.chat-list-trigger:hover,
.chat-list-trigger.is-open,
.voice-button:hover,
.voice-cancel-button:hover,
.workspace-up-button:hover {
  border-color: var(--button-border);
  background: #ffffff;
  color: var(--text);
}

.chat-list-trigger:focus-visible,
.voice-button:focus-visible,
.voice-cancel-button:focus-visible,
.workspace-up-button:focus-visible {
  outline: 2px solid rgba(242, 140, 40, 0.44);
  outline-offset: 2px;
}

.chat-list-trigger:active,
.voice-button:active,
.voice-cancel-button:active,
.workspace-up-button:active {
  background: rgba(255, 255, 255, 0.84);
}

.chat-list-trigger-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: inline-flex;
}

.chat-list-trigger-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.chat-list-trigger-label {
  min-width: 0;
  overflow: hidden;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scheduled-header-trigger {
  position: relative;
}

/* The primary bubble navigation uses the same compact geometry as all three
   desktop clients. Action buttons elsewhere remain circular. */
#chatListToggle,
#scheduledToggle {
  width: 30px;
  height: 29px;
  min-width: 30px;
  min-height: 29px;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

#chatListToggle:hover,
#chatListToggle.is-open,
#scheduledToggle:hover,
#scheduledToggle.is-open {
  background: transparent;
}

.notification-count {
  position: absolute;
  right: -3px;
  top: -3px;
  box-sizing: border-box;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 1px solid #ffffff;
  border-radius: 999px;
  background: #f28c28;
  color: #111111;
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
}

.chat-body {
  grid-row: 3;
  min-height: 0;
  height: 100%;
  display: block;
}

.chat-list-panel {
  z-index: 2;
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.94);
  max-height: none;
  overflow: hidden;
}

.chat-list-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 0;
  border-bottom: 0;
}

.chat-list-new {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.chat-list-new .iconoir-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.chat-list-rows {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chat-list-rows::-webkit-scrollbar {
  display: none;
}

.chat-list-row {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: start;
  gap: 7px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  box-shadow: none;
  text-align: left;
}

.chat-list-row:hover {
  background: rgba(23, 23, 23, 0.025);
}

.chat-list-row:disabled,
.chat-list-row.is-disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.chat-list-row:disabled:hover,
.chat-list-row.is-disabled:hover {
  background: transparent;
}

.chat-list-row:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: -2px;
}

.chat-list-row.is-selected {
  border-color: var(--line);
  background: var(--selection-surface);
}

.chat-list-row-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.chat-list-row-title,
.chat-list-row-preview,
.chat-list-row-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-list-row-title {
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.18;
}

.chat-list-row-preview,
.chat-list-row-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.15;
}

.chat-list-state {
  padding: 14px 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.chat-list-state.error {
  color: var(--danger);
}

.selected-chat-notice {
  margin-top: -8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  font-size: 0.84rem;
}

.chat-layout,
.chat-shell {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  background: transparent;
}

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

.chat-shell > .active-incidents {
  grid-row: 1;
  grid-column: 1;
}

.active-incidents:empty {
  display: none;
}

.active-incidents {
  display: grid;
  gap: 8px;
  max-height: min(35vh, 240px);
  overflow-y: auto;
  padding: 2px 12px 10px;
}

.chat-bubble.incident {
  max-width: min(760px, 100%);
  border-color: rgba(237, 107, 55, 0.7);
  background: rgba(255, 247, 242, 0.88);
}

.chat-bubble.incident .chat-content {
  line-height: 1.45;
}

.incident-review {
  display: block;
  min-height: 30px;
  margin-top: 10px;
  padding: 0 12px;
  border: 1px solid rgba(237, 107, 55, 0.55);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 650;
}

.incident-review:hover,
.incident-review:focus-visible {
  background: rgba(237, 107, 55, 0.1);
}

.delivery-unconfirmed {
  display: block;
  margin-top: 7px;
  color: #8b5b3b;
  font-size: 0.75rem;
}

.chat-shell > .chat-log-stage {
  grid-row: 2;
  grid-column: 1;
}

.chat-shell > .chat-form {
  grid-row: 3;
  grid-column: 1;
}

.chat-log-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.chat-log-stage > .chat-log {
  height: 100%;
}

.round-icon-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: none;
  line-height: 0;
}

.round-icon-button > span,
.round-icon-button > svg,
.round-icon-button .chat-list-trigger-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  line-height: 0;
}

.round-icon-button svg {
  width: 18px;
  height: 18px;
  display: block;
}

.chat-jump-latest {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 4;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 7px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 0s linear 140ms;
}

.chat-jump-latest.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

.chat-jump-latest:hover {
  border-color: var(--button-border);
  background: #ffffff;
}

.messages,
.chat-log {
  position: relative;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  height: auto;
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 30px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 34px 38px;
  max-height: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.messages::-webkit-scrollbar,
.chat-log::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.message,
.chat-bubble {
  min-width: 0;
  max-width: min(760px, 88%);
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: transparent;
  overflow-wrap: anywhere;
}

.message.user,
.chat-bubble.user {
  justify-self: end;
  border-color: transparent;
  border-radius: 18px 18px 8px 18px;
  background: rgba(23, 23, 23, 0.06);
  color: var(--text);
}

.message.assistant,
.chat-bubble.assistant {
  justify-self: start;
}

.chat-bubble.pending {
  color: var(--muted);
}

.chat-bubble.pending .chat-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pending-activity-spinner {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  display: inline-block;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: pending-activity-spin 0.8s linear infinite;
}

@keyframes pending-activity-spin {
  to {
    transform: rotate(360deg);
  }
}

.chat-role {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-bubble.user .chat-role {
  display: none;
}

.chat-content {
  min-width: 0;
  max-width: 100%;
  word-break: break-word;
}

.chat-content p,
.chat-content ul,
.chat-content ol,
.chat-content pre,
.chat-content h1,
.chat-content h2,
.chat-content h3,
.chat-content h4,
.chat-content h5,
.chat-content h6 {
  margin: 0 0 0.6rem;
}

.chat-content > :last-child {
  margin-bottom: 0;
}

.chat-content h1,
.chat-content h2,
.chat-content h3,
.chat-content h4,
.chat-content h5,
.chat-content h6 {
  font-size: 0.98rem;
  line-height: 1.3;
}

.chat-content ul,
.chat-content ol {
  padding-left: 1.2rem;
}

.chat-content li + li {
  margin-top: 0.25rem;
}

.chat-content code {
  padding: 0.12rem 0.28rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  word-break: break-word;
}

.chat-content pre {
  color: var(--chat-paper-ink);
  overflow-x: auto;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  white-space: pre;
}

.chat-content pre code {
  padding: 0;
  border: 0;
  background: transparent;
  white-space: inherit;
}

.chat-content a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-table-wrap {
  max-width: 100%;
  margin: 0 0 0.6rem;
  overflow-x: auto;
}

.chat-table {
  color: var(--chat-paper-ink);
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.chat-table th,
.chat-table td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.chat-table th {
  background: #f8f9fa;
  color: inherit;
  font-weight: 700;
}

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

.field span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.composer,
.chat-form {
  --chat-form-padding-y: 8px;
  --chat-form-padding-x: 8px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 2px;
  min-height: 104px;
  margin: 0;
  padding: var(--chat-form-padding-y) var(--chat-form-padding-x);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel-strong);
  box-shadow: none;
}

.chat-form.is-expanded {
  border-radius: 24px;
}

.chat-form .field {
  align-self: stretch;
  min-height: 100%;
}

.chat-form .field > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.chat-prompt-wrap {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 100%;
  align-content: stretch;
}

.chat-textarea-wrap {
  position: relative;
  display: grid;
  min-height: 100%;
}

.voice-transcribing-dots {
  position: absolute;
  top: 17px;
  left: 14px;
  display: flex;
  gap: 4px;
  pointer-events: none;
}

.voice-transcribing-dots.has-draft {
  left: auto;
  right: 14px;
}

.voice-transcribing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c83b05;
  animation: voice-transcribing-pulse 1s ease-in-out infinite;
}

.voice-transcribing-dots i:nth-child(2) { animation-delay: 0.15s; }
.voice-transcribing-dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes voice-transcribing-pulse {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.chat-dropzone {
  display: none;
  position: absolute;
  inset: var(--chat-form-padding-y) var(--chat-form-padding-x);
  z-index: 6;
  place-items: center;
  min-height: 42px;
  padding: 12px;
  border: 1px dashed var(--button-border-strong);
  border-radius: 16px;
  background: rgba(245, 246, 248, 0.96);
  color: var(--text);
  text-align: center;
  pointer-events: none;
}

.chat-form.is-drop-active .chat-dropzone {
  display: grid;
}

.chat-form.is-drop-active .field,
.chat-form.is-drop-active .actions {
  visibility: hidden;
}

.chat-form.is-drop-active textarea {
  color: transparent;
}

.chat-form.is-drop-active textarea::placeholder {
  color: transparent;
}

.chat-form.is-drop-active .chat-attachments-draft {
  visibility: hidden;
}

.chat-form .actions {
  width: 100%;
  align-self: end;
  justify-content: flex-end;
  gap: 8px;
  padding: 0;
}

.chat-form .button.voice-transcribing {
  width: 34px;
  min-width: 34px;
  padding: 0;
  border-radius: 50%;
}

.voice-transcribing-spinner {
  display: block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.36);
  border-top-color: #fff;
  border-radius: 50%;
  animation: voice-transcribing-spin 0.75s linear infinite;
}

@keyframes voice-transcribing-spin { to { transform: rotate(360deg); } }

.chat-form .chat-attach-button {
  order: 1;
  margin-right: auto;
}

.chat-form .voice-cancel-button,
.chat-form .voice-waveform,
.chat-form .voice-button,
.chat-form .voice-cancel-button {
  order: 2;
}

.chat-form.is-recording .chat-attach-button {
  display: none;
}

.chat-form.is-recording .voice-cancel-button {
  order: 1;
}

.chat-form.is-recording .voice-waveform {
  order: 2;
}

.chat-form.is-recording .voice-button { order: 3; }
.chat-form.is-recording #send { display: none; }

.chat-form .voice-accept-button {
  width: 34px;
  min-width: 34px;
  padding: 0;
  border-radius: 999px;
}

.chat-form .voice-accept-button svg {
  width: 19px;
  height: 19px;
}

.chat-form.is-transcribing .voice-button,
.chat-form.is-transcribing .voice-cancel-button,
.chat-form.is-transcribing .chat-attach-button {
  display: none;
}

.chat-form.is-transcribing .voice-accept-button {
  opacity: 1;
  cursor: progress;
}

.chat-form.is-transcribing textarea {
  cursor: progress;
}

.voice-transcribing-spinner {
  display: block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.36);
  border-top-color: #fff;
  border-radius: 50%;
  animation: voice-transcribing-spin 0.75s linear infinite;
}

@keyframes voice-transcribing-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .voice-transcribing-dots i,
  .voice-transcribing-spinner { animation: none; }
}

.chat-form .button,
.chat-form .chat-stop-button {
  order: 3;
}

.composer textarea,
.chat-form textarea {
  min-height: 52px;
  max-height: 220px;
  width: 100%;
  overflow-y: auto;
  resize: none;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  line-height: 22px;
}

.voice-button,
.voice-cancel-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  box-shadow: none;
  color: var(--text);
  cursor: pointer;
}

.chat-attach-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: #050505;
  box-shadow: none;
  color: #ffffff;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
}

.chat-attach-button svg {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
}

.chat-attachments-draft {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.chat-user-attachments,
.chat-runtime-outputs {
  margin-top: 8px;
}

.chat-attachment-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
}

.chat-attachment-chip span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attachment-remove {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  cursor: pointer;
}

.chat-attachment-remove svg {
  width: 12px;
  height: 12px;
}

.chat-attachment-message {
  color: var(--muted);
  font-size: 0.82rem;
}

.voice-button svg,
.voice-cancel-button svg {
  width: 18px;
  height: 18px;
}

.voice-cancel-button[hidden] { display: none; }
.voice-button[hidden] { display: none; }

.voice-button.is-recording {
  background: var(--panel-strong);
  color: var(--text);
}

.voice-cancel-button[hidden] { display: none; }

.voice-waveform {
  width: 76px;
  height: 34px;
  flex: 0 0 76px;
  overflow: hidden;
}

.voice-waveform[hidden] {
  display: none;
}

.voice-waveform canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.button {
  box-sizing: border-box;
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid var(--orange-border);
  border-radius: 999px;
  background: var(--orange);
  box-shadow: none;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
}

.chat-stop-button {
  margin-left: auto;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: #050505;
  box-shadow: none;
  color: #ffffff;
}

.chat-form.is-busy .button,
.chat-form.is-busy .chat-attach-button,
.chat-form.is-busy .voice-button,
.chat-form.is-busy .voice-cancel-button {
  display: none;
}

.chat-stop-icon {
  width: 12px;
  height: 12px;
  display: block;
  border-radius: 2px;
  background: currentColor;
}

.message-line {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.preview {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  width: 100%;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  font-family: "Segoe UI Mono", Consolas, monospace;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.preview > pre,
.document-preview > pre {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.preview-docx,
.preview-xlsx,
.preview-pptx,
.preview-pdf {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family: inherit;
  white-space: normal;
}

.preview-filename {
  max-width: min(34vw, 420px);
  margin-top: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-head-actions {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.preview-page-status {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-markdown {
  font-family: inherit;
  line-height: 1.55;
  white-space: normal;
}

.preview-markdown h1,
.preview-markdown h2,
.preview-markdown h3 {
  margin: 0 0 10px;
  line-height: 1.2;
}

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

.preview-markdown code,
.preview-markdown pre {
  font-family: "Segoe UI Mono", Consolas, monospace;
}

.preview-table-wrap {
  max-width: 100%;
  overflow: auto;
}

.preview-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.preview-table th,
.preview-table td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.preview-table th {
  background: rgba(255, 255, 255, 0.06);
  font-weight: 700;
}

.preview-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.image-preview {
  display: grid;
  place-items: center;
  min-height: 260px;
}

.preview-image { padding: 0; white-space: normal; overflow: hidden; }
.preview-image .image-preview { position: relative; width: 100%; min-width: 0; height: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); place-items: stretch; }
.image-preview-viewport { width: 100%; min-width: 0; min-height: 0; height: 100%; overflow: auto; outline-offset: -2px; }
.image-preview-canvas { min-width: 100%; min-height: 100%; width: max-content; display: grid; place-items: center; }
.preview-image .image-preview img { display: block; max-width: none; max-height: none; height: auto; border-radius: 0; }
.app-shell .workspace.has-preview .preview-panel.is-expanded {
  position: fixed; inset: 0; z-index: 140; width: auto; max-width: none; height: auto; max-height: none;
  padding: 16px; border-radius: 0; background: var(--bg-top); display: flex; flex-direction: column;
}
.app-shell .preview-panel.is-expanded .panel-head { flex: 0 0 auto; }
.app-shell .preview-panel.is-expanded .preview { flex: 1 1 auto; min-height: 0; height: auto; }
.preview-expand-trigger { flex: 0 0 auto; border-color: var(--line); color: var(--text); background: transparent; }
@media (hover: none) {
  .preview-panel .document-preview-zoom .document-preview-control { opacity: 1; pointer-events: auto; transform: none; }
}

.preview-html, .preview-video { padding: 0; white-space: normal; }
.html-preview-frame { display: block; width: 100%; height: 100%; min-height: 320px; border: 0; background: #fff; }
.video-preview { height: 100%; min-height: 260px; display: grid; place-items: center; background: #171718; }
.video-preview video { display: block; width: 100%; max-height: 100%; object-fit: contain; }

.image-preview img {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 6px;
}

.document-viewer {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.document-preview-zoom {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 24px 0 0 24px;
}

.document-preview-zoom .document-preview-control {
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.document-preview-zoom:hover .document-preview-control,
.document-preview-zoom:has(.document-preview-control:focus-visible) .document-preview-control {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.document-preview-control:hover {
  border-color: var(--button-border);
  background: #ffffff;
}

.document-preview-control:disabled {
  opacity: 0.45;
  cursor: default;
}

.document-loading {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 0.84rem;
}

.document-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(23, 23, 23, 0.16);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: document-preview-spin 720ms linear infinite;
}

@keyframes document-preview-spin {
  to { transform: rotate(360deg); }
}

.document-preview-error {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(178, 64, 55, 0.2);
  border-radius: 10px;
  background: rgba(178, 64, 55, 0.06);
  color: #8e312a;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 0.82rem;
}

.pdf-preview-viewport {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  touch-action: pan-x pan-y pinch-zoom;
}

.pdf-preview {
  min-height: 100%;
  min-width: 100%;
  width: max-content;
  display: grid;
  gap: 16px;
  align-content: start;
  justify-items: center;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.pdf-page {
  width: 100%;
  max-width: none;
  overflow: hidden;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.pdf-page-placeholder {
  width: 100%;
  min-height: 260px;
  display: grid;
  place-items: center;
}

.pdf-page canvas,
.pdf-page img {
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
}

@media (max-width: 760px) {
  .document-preview-zoom {
    display: none;
  }

  .preview-filename {
    max-width: 58vw;
  }
}

.tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}

.tab {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.tab.active {
  background: var(--panel-strong);
  color: var(--text);
}

.admin {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
}

.modal-backdrop,
.admin-modal-backdrop {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 23, 23, 0.28);
}

.modal-panel,
.admin-modal {
  width: min(980px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  grid-template-rows: auto minmax(0, 1fr);
  background: rgba(255, 255, 255, 0.96);
}

#connectionsBackdrop .admin {
  grid-template-rows: none;
  grid-auto-rows: max-content;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-panel.scheduled-modal {
  width: min(1120px, 100%);
  height: min(720px, calc(100dvh - 48px));
}

.scheduled-modal .panel-head > div { min-width: 0; overflow-wrap: anywhere; }
.scheduled-modal #scheduledClose { flex: 0 0 auto; }

.modal-panel.help-info-modal {
  width: min(860px, 100%);
}

.modal-panel.source-detail-modal {
  width: min(760px, 100%);
}

.modal-panel.meeting-protocol-modal {
  width: min(760px, 100%);
  height: min(720px, calc(100dvh - 48px));
  max-height: min(720px, calc(100vh - 48px));
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 12px;
  background: rgba(255, 255, 255, 0.98);
}

.meeting-protocol-backdrop.is-opening {
  animation: meeting-protocol-backdrop-in 220ms ease-out both;
}

.meeting-protocol-backdrop.is-opening .meeting-protocol-modal {
  animation: meeting-protocol-modal-in 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.meeting-protocol-backdrop.is-closing {
  pointer-events: none;
  animation: meeting-protocol-backdrop-out 220ms ease-in both;
}

.meeting-protocol-backdrop.is-closing .meeting-protocol-modal {
  animation: meeting-protocol-modal-out 220ms ease-in both;
}

@keyframes meeting-protocol-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes meeting-protocol-backdrop-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes meeting-protocol-modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes meeting-protocol-modal-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(6px) scale(0.99); }
}

@media (prefers-reduced-motion: reduce) {
  .meeting-protocol-backdrop.is-opening,
  .meeting-protocol-backdrop.is-closing,
  .meeting-protocol-backdrop.is-opening .meeting-protocol-modal,
  .meeting-protocol-backdrop.is-closing .meeting-protocol-modal {
    animation-duration: 0.01ms;
  }
}

.modal-panel.meeting-protocol-modal.has-error { grid-template-rows: auto auto auto auto minmax(0, 1fr); }

.meeting-protocol-head,
.meeting-status,
.meeting-head-actions,
.meeting-section-head {
  min-width: 0;
  display: flex;
  align-items: center;
}

.meeting-protocol-head,
.meeting-section-head {
  justify-content: space-between;
  gap: 12px;
}

.meeting-protocol-head { min-height: 36px; }
.meeting-status { gap: 14px; padding-left: 8px; }
.meeting-duration {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.meeting-record-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(156, 47, 47, 0.1);
}

.meeting-protocol-modal.is-idle .meeting-record-dot,
.meeting-protocol-capsule.is-idle .meeting-record-dot {
  background: var(--muted);
  box-shadow: 0 0 0 6px rgba(70, 70, 70, 0.07);
}

.meeting-protocol-modal.is-idle .meeting-duration { color: var(--muted); }

.meeting-protocol-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.84rem;
}

#meetingProtocolTitle {
  min-width: 0;
  width: 100%;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 700;
}

#meetingProtocolTitle:hover,
#meetingProtocolTitle:focus {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.meeting-head-actions { gap: 8px; }
.meeting-head-actions .mini-control,
.meeting-head-actions .meeting-discard-button,
.meeting-head-actions .meeting-record-control,
.meeting-head-actions .meeting-save-button {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  flex: 0 0 36px;
}
.meeting-head-actions svg { width: 19px; height: 19px; }
.meeting-minus-mark { width: 14px; height: 2px; border-radius: 2px; background: currentColor; }
.meeting-record-control { background: var(--orange); color: #fff; }
.meeting-save-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}
.meeting-save-button:hover { background: rgba(23, 23, 23, 0.06); }

.meeting-discard-button {
  border: 0;
  background: #262626;
  color: #fff;
}

.meeting-discard-button:hover { background: #111; }

.meeting-protocol-intro { display: grid; justify-items: start; gap: 8px; padding: 0 2px; }

.meeting-discard-overlay {
  position: fixed;
  inset: 0;
  z-index: 121;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 23, 23, 0.28);
}

.meeting-discard-dialog {
  width: min(340px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(23, 23, 23, 0.18);
  text-align: center;
}

.meeting-consent-dialog { width: min(450px, 100%); }
.meeting-consent-dialog .meeting-discard-options { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
.meeting-consent-dialog .meeting-discard-options button { white-space: normal; overflow-wrap: anywhere; }

.meeting-discard-dialog h3 { margin: 0 0 20px; font-size: 1.06rem; }
.meeting-discard-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
}

.meeting-discard-options button { min-width: 0; min-height: 36px; padding: 5px 8px; }
.meeting-discard-confirm-button { background: var(--danger); color: #fff; border-color: var(--danger); }
.meeting-discard-confirm-button:hover { background: #842424; }
.meeting-consent-confirm-button { background: var(--orange); color: #fff; border-color: var(--orange); }
.meeting-consent-confirm-button:hover { background: #b83200; }

.meeting-mode-switch {
  width: max-content;
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.05);
}

.meeting-mode-switch button {
  min-height: 32px;
  padding: 5px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.meeting-mode-switch button[aria-pressed="true"] {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(23, 23, 23, 0.1);
}

.meeting-protocol-body {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

.meeting-protocol-tabs {
  min-height: 34px;
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.045);
}

.meeting-protocol-tabs button {
  min-width: 0;
  min-height: 28px;
  flex: 1 1 50%;
  padding: 3px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.meeting-protocol-tabs button[aria-selected="true"] {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 5px rgba(23, 23, 23, 0.1);
}

.meeting-protocol-pane,
.meeting-transcript-pane {
  min-width: 0;
  min-height: 0;
}

.meeting-protocol-pane[hidden],
.meeting-transcript-pane[hidden] { display: none; }

.meeting-protocol-pane {
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
}

.meeting-items { min-height: 0; flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.meeting-delete-item { margin-top: 6px; padding: 4px 7px; min-height: 28px; border: 0; background: transparent; color: var(--danger); box-shadow: none; }
.meeting-delete-item:hover { background: rgba(156, 47, 47, 0.08); }

.meeting-priority-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.meeting-priority-grid > section {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(23, 23, 23, 0.025);
}

.meeting-priority-grid h3,
.meeting-speakers-section h3,
.meeting-transcript h3 { margin: 0 0 8px; font-size: 0.9rem; }

.meeting-priority-grid .meeting-section-head h3 { margin: 0; }

.meeting-protocol-item {
  position: relative;
  min-width: 0;
  min-height: 48px;
  margin-top: 8px;
  padding: 8px 38px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.83);
}

.meeting-protocol-item.is-expanded,
.meeting-protocol-item.is-editing { background: #fff; }
.meeting-item-summary {
  display: block;
  width: 100%;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  text-align: left;
  line-height: 1.4;
}
.meeting-item-summary:hover { background: transparent; }
.meeting-decision-text,
.meeting-action-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.meeting-protocol-item.is-expanded .meeting-decision-text,
.meeting-protocol-item.is-expanded .meeting-action-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.meeting-edit-button {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 5px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
  color: var(--orange);
}

.meeting-edit-button:hover,
.meeting-edit-button:focus-visible { background: rgba(207, 57, 0, 0.09); }
.meeting-edit-button svg { width: 17px; height: 17px; }

.meeting-add-button {
  flex-shrink: 0;
}

.meeting-priority-grid textarea,
.meeting-priority-grid input,
.meeting-speaker input {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.meeting-priority-grid textarea {
  min-height: 70px;
  padding: 7px;
  resize: none;
}

.meeting-protocol-item.is-editing textarea,
.meeting-protocol-item.is-editing input {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.meeting-priority-grid textarea:hover,
.meeting-priority-grid textarea:focus,
.meeting-priority-grid input:hover,
.meeting-priority-grid input:focus,
.meeting-speaker input:hover,
.meeting-speaker input:focus {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.meeting-action-row {
  display: grid;
  gap: 6px;
}

.meeting-action-meta { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.meeting-action-meta:empty { display: none; }
.meeting-action-owner,
.meeting-action-due {
  max-width: 100%;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.06);
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}
.meeting-action-owner { color: var(--text); font-weight: 600; }
.meeting-action-text { display: block; min-width: 0; }
.meeting-action-edit { display: grid; gap: 5px; }
.meeting-action-edit input { padding: 7px; }

.meeting-speakers-section { padding: 0 2px; }
.meeting-section-head h3 { margin-bottom: 0; }

.meeting-speaker-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) 36px;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  max-height: 100px;
  overflow-y: auto;
}

.meeting-speaker {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(23, 23, 23, 0.035);
}

.meeting-speaker:nth-child(odd) { grid-column: 1; }
.meeting-speaker:nth-child(even) { grid-column: 2; }

.meeting-add-speaker {
  grid-column: 3;
  justify-self: end;
  align-self: center;
}

.meeting-speaker > span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--orange);
  color: #ffffff;
  font-weight: 700;
}

.meeting-speaker input { min-width: 0; padding: 4px; font-weight: 700; }

.meeting-transcript {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  padding: 0 2px 2px;
}

.meeting-transcript-scroll { min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.meeting-transcript p > span { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }

.meeting-transcript p {
  display: grid;
  grid-template-columns: max-content 22px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  margin: 7px 0;
  color: var(--muted);
}

.meeting-transcript time {
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(23, 23, 23, 0.045);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.meeting-transcript b {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(207, 57, 0, 0.1);
  color: var(--orange);
}

.meeting-protocol-capsule {
  position: fixed;
  z-index: 121;
  top: 88px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  color: var(--text);
  transform: translateX(-50%);
}

.meeting-protocol-capsule span:not(.meeting-record-dot) { color: var(--muted); }

.source-detail-body {
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 2px 4px 4px;
  overflow: auto;
}

.source-detail-state,
.source-detail-path {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.source-detail-body h3 {
  margin: 4px 0 0;
  font-size: 0.9rem;
  line-height: 1.25;
}

.source-detail-body pre {
  max-height: min(52vh, 420px);
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.48;
  overflow: auto;
  white-space: pre-wrap;
}

.help-info-body {
  min-height: 0;
  display: grid;
  gap: 18px;
  padding: 2px 4px 4px;
  overflow: auto;
}

.help-info-intro {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.help-icon-guide {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
}

.help-icon-guide-head h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

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

.help-icon-guide-item {
  min-width: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.help-icon-guide-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--text);
}

.help-icon-guide-mark.is-pill-sample {
  width: auto;
  min-width: max-content;
  padding: 0 10px;
}

.help-icon-guide-mark.is-text-sample {
  width: auto;
  min-width: 54px;
  padding: 0 6px;
}

.help-icon-guide-mark.is-black-sample {
  border-color: rgba(255, 255, 255, 0.08);
  background: #050505;
  color: #ffffff;
}

.help-icon-guide-mark.is-orange-sample {
  border-color: var(--orange-border);
  background: var(--orange);
  color: #ffffff;
}

.help-icon-guide-mark svg {
  width: 20px;
  height: 20px;
}

.help-icon-guide-item strong,
.help-icon-guide-item small {
  min-width: 0;
  display: block;
}

.help-icon-guide-item strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.help-icon-guide-item small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.help-button-sample.text-sample {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 48px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--orange);
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.help-button-sample.plus-sample {
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
}

.help-info-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  border-top: 1px solid var(--line);
}

.help-inline-icon {
  width: 1.1em;
  height: 1.1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -0.16em;
  color: var(--text);
}

.help-inline-icon svg {
  width: 1.1em;
  height: 1.1em;
}

.help-info-section {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.help-info-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.25;
}

.help-info-section p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.scheduled-layout {
  min-height: 0;
  max-height: none;
  display: grid;
  grid-template-columns: minmax(190px, 0.28fr) minmax(0, 1fr);
  gap: 12px;
}

.scheduled-sidebar,
.scheduled-main {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.scheduled-sidebar {
  display: grid;
  align-content: start;
  gap: 8px;
  padding-right: 4px;
}

.scheduled-task-row {
  position: relative;
  min-width: 0;
}

.scheduled-modal .scheduled-sidebar-row {
  width: 100%;
  min-width: 0;
  display: grid;
  justify-content: stretch;
  gap: 2px;
  white-space: normal;
  padding: 10px 38px 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-align: left;
}

.scheduled-sidebar-row:hover,
.scheduled-sidebar-row.is-selected,
.scheduled-task-row.is-selected .scheduled-sidebar-row {
  border-color: var(--button-border);
  background: #ffffff;
}

.scheduled-sidebar-title,
.scheduled-sidebar-meta {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.scheduled-sidebar-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.scheduled-sidebar-timing {
  flex: 1 1 100%;
  white-space: normal;
}

.scheduled-sidebar-title {
  font-weight: 800;
}

.scheduled-sidebar-meta,
.scheduled-output-meta,
.scheduled-empty-sidebar,
.scheduled-empty-main {
  color: var(--muted);
  font-size: 0.8rem;
}

.scheduled-task-menu-button {
  position: absolute;
  right: 6px;
  top: 50%;
  opacity: 1;
  transform: translateY(-50%);
  pointer-events: auto;
  transition: opacity 120ms ease, border-color 120ms ease, background 120ms ease;
}

.scheduled-task-row:hover .scheduled-task-menu-button,
.scheduled-task-row:focus-within .scheduled-task-menu-button,
.scheduled-task-menu-button.is-open {
  opacity: 1;
  pointer-events: auto;
}

.scheduled-task-menu {
  right: 4px;
  top: calc(100% + 4px);
}

.floating-file-menu[data-scheduled-task-id] {
  min-width: 160px;
  max-width: 180px;
}

.scheduled-task-menu button {
  gap: 8px;
}

.scheduled-task-menu svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.scheduled-main {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 10px;
}

.scheduled-output-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
}

.scheduled-output-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-strong);
}

.scheduled-output-card:hover,
.scheduled-output-card:focus-within {
  border-color: var(--button-border-strong);
  background: #ffffff;
  box-shadow: none;
}

.scheduled-output-card.status-failed {
  border-color: rgba(179, 48, 48, 0.34);
}

.scheduled-output-card.is-unread {
  border-color: var(--company-red);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--company-red-soft), inset 0 0 10px rgba(23, 23, 23, 0.1);
}

.scheduled-output-card.is-unread:hover,
.scheduled-output-card.is-unread:focus-within {
  border-color: var(--company-red);
  box-shadow: inset 0 0 0 1px rgba(23, 23, 23, 0.24), inset 0 0 12px rgba(23, 23, 23, 0.14);
}

.scheduled-output-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: stretch;
  gap: 4px;
}

.scheduled-modal .scheduled-output-summary {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
  padding: 12px 0 12px 12px;
  white-space: normal;
  border-radius: calc(var(--radius-sm) - 1px);
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.scheduled-output-summary:hover,
.scheduled-output-summary:active,
.scheduled-output-summary:focus {
  background: transparent;
  color: var(--text);
}

.scheduled-output-summary:focus-visible {
  outline: 2px solid rgba(23, 23, 23, 0.18);
  outline-offset: -3px;
  border-radius: calc(var(--radius-sm) - 1px);
}

.scheduled-modal .scheduled-output-head > .scheduled-output-delete {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  appearance: none;
  -webkit-appearance: none;
}

.scheduled-output-delete:hover {
  background: transparent;
  color: var(--company-red);
}

.scheduled-output-delete:focus-visible {
  outline: 2px solid var(--company-red);
  outline-offset: 2px;
}

.scheduled-output-delete svg {
  width: 18px;
  height: 18px;
  display: block;
}

.scheduled-output-copy {
  min-width: 0;
  display: block;
}

.scheduled-output-copy > .scheduled-output-meta {
  display: block;
  margin-top: 3px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.scheduled-output-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.scheduled-output-body {
  min-width: 0;
  margin: 0 12px 12px;
  padding: 12px 0 0;
  border-top: 1px solid rgba(23, 23, 23, 0.12);
  user-select: text;
  -webkit-user-select: text;
}

.scheduled-output-chevron {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.scheduled-output-chevron svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke-width: 1.8;
}

.scheduled-load-more {
  justify-self: center;
}

.scheduled-error {
  margin: 0;
}

.scheduled-empty-sidebar,
.scheduled-empty-main {
  padding: 10px 12px;
}

.admin-create-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) max-content max-content;
  align-items: center;
  gap: 10px;
}

.lan-api-section {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.lan-api-section h3 {
  margin: 0;
  font-size: 1rem;
}

.lan-api-admin {
  grid-template-rows: 1fr;
}

.lan-api-create-form {
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) max-content;
}

.switch-row,
.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.switch-row {
  min-width: 0;
  color: var(--text);
  font-weight: 700;
}

.switch-control {
  position: relative;
  min-width: 0;
}

.switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  width: 50px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid rgba(111, 33, 0, 0.42);
  border-radius: 999px;
  background: linear-gradient(180deg, #ff6a22 0%, #ff4b00 52%, #cf3900 100%);
  box-shadow: inset 0 2px 4px rgba(87, 22, 0, 0.38), inset 0 -1px 0 rgba(255, 255, 255, 0.2), 0 1px 1px rgba(17, 17, 17, 0.08);
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.switch-thumb {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff7b2e 0%, #ff5208 58%, #df3d00 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 3px 6px rgba(87, 22, 0, 0.32);
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.switch-input:checked ~ .switch-track {
  border-color: rgba(111, 33, 0, 0.42);
  background: linear-gradient(180deg, #ff6a22 0%, #ff4b00 52%, #cf3900 100%);
}

.switch-input:checked ~ .switch-track .switch-thumb {
  transform: translateX(22px);
}

.switch-input:focus-visible ~ .switch-track {
  outline: 2px solid var(--button-border-strong);
  outline-offset: 2px;
}

.switch-state {
  min-width: 28px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.switch-state.is-active {
  color: var(--text);
}

.language-switch-row,
.customer-admin-switch-row,
.file-menu-switch-row {
  justify-content: space-between;
}

.file-menu-switch-row {
  width: 100%;
  min-height: 34px;
  justify-content: center;
  padding: 0 2px 2px;
  cursor: pointer;
}

.file-menu-switch-control {
  width: 100%;
  justify-content: space-between;
  gap: 8px;
}

.file-menu-switch-row .switch-state {
  min-width: max-content;
}

.file-menu-switch-row .switch-state-left {
  text-align: right;
}

.file-menu-switch-row .switch-state-right {
  text-align: left;
}

.admin-temp-password {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.86);
}

.admin-temp-password code {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.92rem;
}

.user-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.user-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
}

.user-card-main,
.user-badges,
.user-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-card-main {
  justify-content: space-between;
}

.user-badges,
.user-actions {
  flex-wrap: wrap;
}

.badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.error {
  min-height: 20px;
  color: var(--danger);
  font-size: 0.9rem;
}

.login-card .error:empty {
  display: none;
}

.login-card .error:not(:empty) {
  min-height: 0;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(237, 107, 55, 0.35);
  border-radius: 14px;
  background: rgba(255, 247, 242, 0.88);
  color: var(--text);
  line-height: 1.45;
}

:root[data-appearance="dark"] .login-card .error:not(:empty) {
  background: #382a24;
  color: #ffe2d4;
  border-color: #9b664b;
}

.empty {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
}

@media (max-width: 1120px) {
  .workspace-stage.is-chat-history-open {
    display: block;
    overflow-x: clip;
    overflow-y: visible;
  }

  .workspace-stage.is-chat-history-open > .chat-history-card {
    position: absolute;
    inset: 0 auto auto 0;
    z-index: 8;
    width: 82%;
    height: 360px;
    padding: 14px;
  }

  .workspace-stage.is-chat-history-open.is-opening > .chat-history-card {
    animation: chat-history-drawer-in 180ms ease-out both;
  }

  .workspace-stage.is-chat-history-open .chat-panel {
    transform: translateX(82%);
    filter: grayscale(1);
  }

  .workspace-stage.is-chat-history-open.is-opening .chat-panel {
    animation: chat-panel-shift-right 180ms ease-out both;
  }

  .workspace-stage.is-chat-history-open .chat-panel .chat-body,
  .workspace-stage.is-chat-history-open .chat-panel > .message-line,
  .workspace-stage.is-chat-history-open .chat-panel .chat-panel-head {
    opacity: 0.28;
    pointer-events: none;
    user-select: none;
  }

  .workspace,
  .workspace.has-preview {
    display: block;
  }

  .layout-card + .layout-card {
    margin-top: 18px;
  }

  .panel-drag-hit,
  .panel-drag-handle,
  .panel-resize-handle {
    display: none;
  }

  .inspector {
    grid-column: 1 / -1;
  }

  .messages,
  .chat-log {
    max-height: none;
  }

  .scheduled-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(44px, min(190px, 28dvh)) minmax(0, 1fr);
  }

  .scheduled-sidebar {
    max-height: 190px;
    padding-right: 0;
  }
}

@keyframes chat-history-drawer-in {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes chat-panel-shift-right {
  from { transform: translateX(0); }
  to { transform: translateX(82%); }
}

@media (min-width: 1121px) {
  html,
  body,
  #app {
    height: 100%;
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    overflow: hidden;
  }

  .workspace,
  .workspace.has-preview,
  .workspace.no-preview {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }
}

@media (max-width: 760px) {
  .app-shell {
    min-height: 100dvh;
    padding: 10px;
    gap: 10px;
  }

  .topbar {
    align-items: center;
    padding: 14px;
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
  }

  .account {
    flex-wrap: wrap;
    margin-left: auto;
  }

  .chat-panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .chat-list-control {
    width: auto;
    flex-basis: auto;
    justify-content: flex-start;
  }

  .chat-form {
    --chat-form-padding-y: 8px;
    --chat-form-padding-x: 8px;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 2px;
    min-height: 104px;
    margin: 0;
    padding: var(--chat-form-padding-y) var(--chat-form-padding-x);
    border-radius: 24px;
  }

  .chat-form.is-expanded {
    border-radius: 24px;
  }

  .chat-form .field {
    gap: 0;
  }

  .chat-form .field > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .chat-form textarea {
    min-height: 58px;
    max-height: 144px;
    padding: 8px 10px 4px;
    line-height: 22px;
  }

  .chat-form .actions {
    width: 100%;
    justify-content: flex-end;
    gap: 7px;
    padding: 0 2px 2px;
  }

  .chat-form .chat-attach-button {
    order: 1;
    margin-right: auto;
  }

  .chat-form .voice-button,
  .chat-form .voice-cancel-button {
    order: 2;
  }

  .chat-form.is-recording .voice-cancel-button { order: 1; }
  .chat-form.is-recording .voice-button { order: 3; }

  .chat-form .voice-waveform {
    order: 2;
    width: 75px;
    height: 34px;
    flex-basis: 75px;
  }

  .chat-form .button,
  .chat-form .chat-stop-button {
    order: 3;
  }

  .chat-form .chat-attach-button,
  .chat-form .voice-button,
  .chat-form .voice-cancel-button,
  .chat-form .chat-stop-button {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
  }

  .chat-form .button {
    height: 34px;
    min-height: 34px;
    padding: 0 14px;
  }

  .chat-list-trigger {
    width: 34px;
    max-width: 34px;
  }

  .chat-history-trigger {
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    padding: 0;
  }

  .chat-form .voice-accept-button {
    width: 34px;
    min-width: 34px;
    padding: 0;
  }

  .chat-history-trigger.is-open {
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    padding: 0;
  }

  .help-info-sections {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .help-icon-guide-grid {
    grid-template-columns: 1fr;
  }

  .workspace-stage.is-chat-history-open > .chat-list-panel {
    width: 82%;
    height: min(760px, max(260px, calc(100dvh - 92px)));
    max-height: none;
  }

  .workspace,
  .workspace.has-preview {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: 360px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius-lg);
  }

  .chat-panel {
    min-height: 0;
    height: min(760px, max(260px, calc(100dvh - 92px)));
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0;
    padding: 14px;
  }

  .chat-log {
    justify-items: stretch;
    gap: 24px;
    padding: 54px 8px 18px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0 14px, #000 48px, #000 100%);
    mask-image: linear-gradient(to bottom, transparent 0 14px, #000 48px, #000 100%);
  }

  .chat-bubble.user {
    justify-self: end;
    width: auto;
    max-width: 86%;
    padding: 11px 13px;
  }


  .active-incidents .chat-bubble.assistant.incident {
    width: auto;
    max-width: 100%;
    padding: 11px 13px;
    border: 1px solid rgba(237, 107, 55, 0.7);
    border-radius: 18px;
    background: rgba(255, 247, 242, 0.88);
  }

  .panel:last-child {
    border-bottom: 0;
  }

  .row,
  .split-row,
  .workspace-inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .workspace-list {
    overflow-x: hidden;
    overflow-y: visible;
  }

  .workspace-table {
    position: relative;
    min-width: 0;
    display: grid;
    align-content: start;
  }

  .workspace-table::after {
    content: "";
    position: absolute;
    z-index: 3;
    top: 0;
    right: var(--workspace-size-column);
    bottom: 0;
    width: 1px;
    background: rgba(23, 23, 23, 0.1);
    box-shadow:
      calc(0px - var(--workspace-type-column)) 0 0 rgba(23, 23, 23, 0.1),
      calc(0px - var(--workspace-type-column) - var(--workspace-modified-column)) 0 0 rgba(23, 23, 23, 0.1);
    pointer-events: none;
  }

  .workspace-list-head {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--workspace-modified-column) var(--workspace-type-column) var(--workspace-size-column);
    font-size: 0.62rem;
    letter-spacing: 0;
  }

  .workspace-list-head > * {
    min-width: 0;
    min-height: 34px;
    padding: 7px 4px;
    overflow: hidden;
  }

  .workspace-list-head > * + * {
    border-left: 0;
  }

  .workspace-sort-button {
    min-height: 34px;
    gap: 2px;
    padding: 7px 4px;
  }

  .workspace-sort-arrow {
    width: 7px;
    min-width: 7px;
  }

  .workspace-entry {
    min-width: 0;
    min-height: 48px;
    grid-template-columns: minmax(0, 1fr) var(--workspace-modified-column) var(--workspace-type-column) var(--workspace-size-column);
    grid-template-areas: "main modified type size";
    gap: 0;
    padding: 0;
  }

  .workspace-entry-main {
    min-width: 0;
    gap: 5px;
    padding: 6px 38px 6px 4px;
  }

  .workspace-entry-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
  }

  .workspace-entry-icon svg {
    width: 14px;
    height: 14px;
  }

  .workspace-entry-name {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.15;
  }

  .workspace-entry-cell {
    min-width: 0;
    min-height: 48px;
    display: flex;
    gap: 0;
    padding: 5px 4px;
    font-size: 0.66rem;
    border-left: 0;
  }

  .workspace-entry-cell::before {
    content: none;
  }

  .workspace-entry-size {
    justify-content: flex-end;
    text-align: right;
  }

  .file-menu {
    margin-right: 2px;
  }

  .file-menu-button {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
  }

  .files-panel {
    padding-right: 12px;
    padding-left: 12px;
  }

  .workspace-body-split {
    grid-template-columns: 1fr;
  }

  .admin-create-form {
    grid-template-columns: 1fr;
  }

  .modal-backdrop,
  .admin-modal-backdrop {
    align-items: stretch;
    padding: 10px;
  }

  .modal-panel,
  .admin-modal {
    width: 100%;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    min-height: 0;
  }

  .modal-panel.meeting-protocol-modal {
    width: 100%;
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
    gap: 10px;
  }

  .meeting-protocol-intro { gap: 8px; }
  .meeting-protocol-body { gap: 6px; }
  .meeting-priority-grid { grid-template-columns: 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 8px; overflow: hidden; }
  .meeting-priority-grid > section { padding: 8px; }
  #meetingProtocolTitle { font-size: 1rem; }
  .meeting-protocol-capsule { top: 78px; }

  .scheduled-backdrop {
    padding: 0;
  }

  .modal-panel.scheduled-modal {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .scheduled-layout {
    min-height: 0;
    max-height: none;
    height: 100%;
    grid-template-rows: minmax(44px, min(190px, 28dvh)) minmax(0, 1fr);
    gap: 10px;
  }

  .scheduled-sidebar {
    max-height: min(190px, 28dvh);
  }

  .scheduled-task-menu-button {
    opacity: 1;
    pointer-events: auto;
  }

  .scheduled-main {
    min-height: 0;
  }

  .scheduled-output-list {
    min-height: 0;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .user-card-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-actions {
    justify-content: stretch;
  }

  .table-actions button {
    width: 100%;
  }

  button {
    width: auto;
  }

  .message {
    max-width: 100%;
  }

  .chat-content .workspace-reference-chip {
    max-width: 100%;
  }

  .chat-content .workspace-reference-chip svg {
    flex: 0 0 auto;
  }

  .chat-content .workspace-reference-chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
/* Account-level desktop distribution remains unavailable until release qualification. */
#desktopAppsBackdrop { align-items: center; }
.desktop-apps-modal { display: block; width: min(680px, calc(100vw - 32px)); overflow-y: auto; }
.desktop-apps-modal .panel-head { margin-bottom: 18px; }
.desktop-apps-intro { margin: 0 0 22px; color: var(--muted, #666); }
.desktop-apps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.desktop-app-card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 12px; border: 1px solid #ddd; border-radius: 20px; background: #fafafa; color: #282828; text-align: center; text-decoration: none; }
.desktop-app-card.is-unavailable:disabled { opacity: 1; cursor: default; }
.desktop-app-card.is-available { border-color: var(--text); background: var(--panel-strong); cursor: pointer; }
.desktop-app-card.is-available:hover { transform: translateY(-1px); }
.desktop-app-card.is-available:focus-visible { outline: 2px solid rgba(242, 140, 40, 0.44); outline-offset: 2px; }
.desktop-app-card svg { width: 48px; height: 52px; }
.desktop-app-card strong { font-size: 17px; font-weight: 600; }
.desktop-app-card span { font-size: 12px; color: #666; }
.desktop-apps-note { margin: 22px 0 0; color: #666; font-size: 13px; line-height: 1.5; }
@media (max-width: 500px) {
  .desktop-apps-grid { grid-template-columns: 1fr; gap: 10px; }
  .desktop-app-card { padding: 14px 18px; flex-direction: row; gap: 16px; }
  .desktop-app-card svg { width: 32px; height: 36px; }
  .desktop-app-card span { margin-left: auto; }
}

/* Shared Iconoir regular artwork; no CSS-drawn replacement glyphs. */
.iconoir-icon { display: block; width: 18px; height: 18px; stroke-width: 1.5 !important; }
.chat-stop-icon { width: 18px; height: 18px; background: none; border-radius: 0; }
.chat-stop-icon .iconoir-icon { display: block; width: 18px; height: 18px; }

.export-receipt .iconoir-icon { display: inline-block; vertical-align: middle; margin-right: 5px; }
/* Connections: own accounts first; administration is a separate view. */
#connectionsBackdrop .connections-modal {
  width: min(640px, 100%);
  max-height: min(720px, calc(100dvh - 48px));
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  padding: 24px;
  border-radius: 24px;
  overflow: hidden;
}
#connectionsBackdrop .connections-modal.has-access-views { grid-template-rows: auto auto minmax(0, 1fr); }
.connections-modal .panel-head { margin-bottom: 20px; }
.connections-modal .panel-head h2 { margin: 0; font-size: 1.25rem; }
.connection-views { display: flex; gap: 24px; border-bottom: 1px solid var(--line); }
.connection-views button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; padding: 10px 0; color: var(--muted); font-weight: 600; }
.connection-views button[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--text); }
.connections-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: 4px; }
.connections-intro { margin: 20px 0 12px; color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
.connections-status { margin: 12px 0; font-size: 0.9rem; }
.connections-status[hidden] { display: none; }
.connection-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.connection-row:last-child { border-bottom: 0; }
.connection-info { min-width: 0; }
.connection-info h3 { margin: 0 0 6px; font-size: 1rem; font-weight: 600; }
.connection-info p { margin: 4px 0 0; font-size: 0.875rem; line-height: 1.5; overflow-wrap: anywhere; color: var(--muted); }
.connection-info .is-connected { color: #247047; }
.connection-info .is-connected::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin: 0 7px 2px 0; }
.connection-row-actions { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.connection-action { min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: transparent; font-size: 0.875rem; font-weight: 600; }
.connection-action.is-primary { background: var(--button-fill); color: var(--button-fill-text); border-color: var(--button-fill); }
.connection-action:disabled { opacity: 0.55; cursor: wait; }
.connection-manage { text-align: right; }
.connection-manage summary { cursor: pointer; padding: 9px 0; font-size: 0.875rem; color: var(--muted); }
.connection-secondary-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding-top: 8px; }
.connection-access { border-bottom: 1px solid var(--line); }
.connection-access summary { display: list-item; cursor: pointer; padding: 18px 0; }
.connection-access-title { display: inline-flex; flex-direction: column; gap: 5px; margin-left: 8px; vertical-align: middle; font-weight: 600; }
.connection-count { color: var(--muted); font-size: 0.875rem; font-weight: 400; }
.connection-user-list { padding: 0 0 12px 24px; }
.connection-user { min-height: 44px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 6px 0; font-size: 0.9rem; font-weight: 400; cursor: pointer; }
.connection-user span { overflow-wrap: anywhere; min-width: 0; }
.connection-user input { width: 18px; height: 18px; margin: 0 4px; flex-shrink: 0; accent-color: var(--text); }
.connections-modal :is(button,summary,input):focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
@media (hover: hover) { .connection-action:not(:disabled):hover { background: #f0f1f2; } .connection-action.is-primary:not(:disabled):hover { background: var(--button-fill-strong); } }
@media (max-width: 500px) {
  #connectionsBackdrop .connections-modal { padding: 18px; max-height: calc(100dvh - 20px); border-radius: 18px; }
  .connection-row { flex-direction: column; gap: 10px; padding: 18px 0; }
  .connection-row-actions { align-items: flex-start; width: 100%; }
  .connection-manage { text-align: left; width: 100%; }
  .connection-secondary-actions { align-items: flex-start; }
  .connection-views { gap: 20px; }
}

/* Account surfaces share spacing, form labels and a quiet menu hierarchy. */
.account-menu { gap: 0; padding: 10px; max-height: calc(100dvh - 100px); overflow-y: auto; box-shadow: 0 12px 40px rgba(17,17,17,0.12); }
.account-menu-head { padding: 8px 10px 12px; border-bottom: 0; }
.account-menu-head strong { overflow-wrap: anywhere; }
.account-menu .language-switcher { padding: 8px 10px 12px; }
.account-menu .language-switch-row { width: 100%; justify-content: space-between; font-weight: 400; }
.account-menu-group { padding: 5px 0; border-top: 1px solid var(--line); }
.account-menu .account-menu-item { width: 100%; min-height: 40px; border: 0; border-radius: 8px; padding: 9px 10px; background: transparent; font-size: 0.9rem; font-weight: 500; }
.account-menu .account-menu-item:hover { background: #f0f1f2; }
.account-menu :is(button,input):focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
:is(#adminBackdrop,#lanApiBackdrop,#passwordBackdrop,#exportBackdrop,#desktopAppsBackdrop,#helpBackdrop) > section {
  gap: 0; padding: 24px; border-radius: 24px; max-height: calc(100dvh - 48px); overflow: hidden;
}
:is(#adminBackdrop,#lanApiBackdrop,#passwordBackdrop,#exportBackdrop,#desktopAppsBackdrop,#helpBackdrop) .panel-head { margin: 0 0 20px; }
:is(#adminBackdrop,#lanApiBackdrop,#passwordBackdrop,#exportBackdrop,#desktopAppsBackdrop,#helpBackdrop) .panel-head h2 { margin: 0; font-size: 1.25rem; }
:is(#adminBackdrop,#lanApiBackdrop,#passwordBackdrop,#exportBackdrop,#desktopAppsBackdrop,#helpBackdrop) :is(button,input,summary,a):focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
#adminBackdrop .admin-modal { width: min(760px, 100%); }
#lanApiBackdrop .admin-modal { width: min(720px, 100%); }
#helpBackdrop .modal-panel { width: min(720px, 100%); }
#desktopAppsBackdrop .modal-panel { width: min(640px, 100%); grid-template-rows: auto auto minmax(0, 1fr) auto; overflow-y: auto; }
#adminBackdrop .admin, #lanApiBackdrop .admin { display: block; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: 4px; }
#adminBackdrop .user-list { overflow: visible; }
#adminBackdrop .admin-create-form, #lanApiBackdrop .lan-api-create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.settings-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; font-size: 0.875rem; font-weight: 500; }
.settings-field input { width: 100%; min-width: 0; min-height: 40px; border-radius: 10px; }
#adminBackdrop .customer-admin-switch-row { min-height: 40px; font-size: 0.875rem; font-weight: 400; justify-content: space-between; }
#adminBackdrop .user-card, #lanApiBackdrop .user-card { padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
#adminBackdrop .user-card:last-child, #lanApiBackdrop .user-card:last-child { border-bottom: 0; }
#adminBackdrop .user-actions, #lanApiBackdrop .user-actions { gap: 8px; }
#adminBackdrop .user-actions button, #lanApiBackdrop .user-actions button { min-height: 36px; padding: 6px 12px; font-size: 0.8rem; }
#adminBackdrop .badge { border: 0; background: #f0f1f2; font-weight: 500; }
#adminBackdrop .user-card-main { flex-wrap: wrap; gap: 8px; }
#lanApiBackdrop .lan-api-section { padding-top: 0; border-top: 0; gap: 18px; }
#lanApiBackdrop .panel-head.compact { flex-wrap: wrap; gap: 12px; margin: 0; }
#lanApiBackdrop .admin-temp-password code { overflow-wrap: anywhere; }
#passwordBackdrop .account-password-form { padding: 0; gap: 18px; min-height: 0; overflow-y: auto; }
#passwordBackdrop .account-password-form > button { background: var(--button-fill); color: var(--button-fill-text); min-height: 40px; margin-top: 4px; }
#exportBackdrop .export-modal-body { padding: 0; gap: 16px; line-height: 1.55; }
#exportBackdrop .export-download { background: var(--button-fill); color: var(--button-fill-text); border-color: var(--button-fill); border-radius: 10px; }
#exportBackdrop .export-receipt { font-size: 0.875rem; font-weight: 500; }
#desktopAppsBackdrop .desktop-apps-intro { margin: 0 0 20px; font-size: 0.9rem; line-height: 1.5; }
#desktopAppsBackdrop .desktop-app-card { padding: 20px 12px; border-radius: 12px; box-shadow: none; }
#desktopAppsBackdrop .desktop-apps-note { margin-top: 18px; }
#helpBackdrop .help-info-body { min-height: 0; overscroll-behavior: contain; }
:is(#adminBackdrop,#lanApiBackdrop,#passwordBackdrop) .error:empty { display: none; }
@media (max-width: 500px) {
  :is(#adminBackdrop,#lanApiBackdrop,#passwordBackdrop,#exportBackdrop,#desktopAppsBackdrop,#helpBackdrop) > section { padding: 18px; border-radius: 18px; max-height: calc(100dvh - 20px); }
  #adminBackdrop .admin-create-form, #lanApiBackdrop .lan-api-create-form { grid-template-columns: 1fr; }
  #desktopAppsBackdrop .desktop-apps-grid { grid-template-columns: 1fr; }
  #desktopAppsBackdrop .desktop-app-card { flex-direction: row; justify-content: flex-start; }
}

.settings-user-actions summary { cursor: pointer; padding: 6px 0; color: var(--muted); font-size: 0.875rem; }
.settings-user-actions .user-actions { padding-top: 8px; }

.settings-add-user { margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.settings-add-user > summary { width: fit-content; cursor: pointer; padding: 10px 0 16px; font-size: 0.9rem; font-weight: 600; }
#adminBackdrop .settings-add-user .admin-create-form { border-bottom: 0; margin: 0; padding: 4px 0 20px; }

/* Short account tasks size to content, including the tablet breakpoint. */
:is(#adminBackdrop,#lanApiBackdrop,#passwordBackdrop,#exportBackdrop,#desktopAppsBackdrop,#helpBackdrop) { align-items: center; }
:is(#adminBackdrop,#lanApiBackdrop,#passwordBackdrop,#exportBackdrop,#desktopAppsBackdrop,#helpBackdrop) > section { align-self: center; height: auto; max-height: min(720px, calc(100dvh - 48px)); }
#passwordBackdrop .account-password-form, #exportBackdrop .export-modal-body { align-content: start; grid-auto-rows: max-content; }
#passwordBackdrop .account-password-form > button { height: 40px; border-radius: 10px; }
#adminBackdrop #createUser, #lanApiBackdrop #createLanApiKey { background: var(--button-fill); color: var(--button-fill-text); border-radius: 10px; min-height: 40px; font-size: 0.875rem; }
.settings-intro { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
#helpBackdrop .help-info-body { align-content: start; }
#helpBackdrop .help-icon-guide { display: block; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
#helpBackdrop .help-icon-guide > summary { cursor: pointer; font-size: 0.95rem; font-weight: 600; }
#helpBackdrop .help-icon-guide-grid { margin-top: 16px; }
@media (max-width: 500px) {
  :is(#adminBackdrop,#lanApiBackdrop,#passwordBackdrop,#exportBackdrop,#desktopAppsBackdrop,#helpBackdrop) > section { max-height: calc(100dvh - 20px); }
}

/* Public question uses the existing composer; progress stays in the reply bubble. */


.navigation-preferences { padding-block: 6px; }
.navigation-setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.navigation-switch { width: 30px; height: 18px; flex: 0 0 auto; padding: 3px; border-radius: 12px; background: #777; }
.navigation-switch::after { content: ""; display: block; width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.navigation-setting[aria-checked="true"] .navigation-switch { background: #cf3900; }
.navigation-setting[aria-checked="true"] .navigation-switch::after { transform: translateX(12px); }
.navigation-preferences-error { margin: 4px 10px; font-size: 13px; }

/* Shared document surface: content stays square; compact views use a sheet. */
.preview-panel { border-radius: 0; }
.preview-panel .preview { border-radius: 0; border: 0; }
.preview-save-action { border: 0; background: transparent; color: inherit; padding: 8px 10px; min-height: 36px; font: inherit; font-size: 13px; white-space: nowrap; border-radius: 6px; cursor: pointer; }
.preview-save-action:hover { background: var(--panel-strong); }
.preview-save-action:focus-visible { outline: 2px solid #cf3900; outline-offset: 2px; }
.preview-action-message { margin: 0; font-size: 13px; }
.preview-action-message:empty { display: none; }
.preview-panel .panel-head { min-width: 0; gap: 10px; }
.preview-panel .panel-title { min-width: 0; flex: 1 1 auto; }
.preview-filename { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1000px) {
  .workspace.has-preview .preview-panel {
    position: fixed; inset: 72px 0 0; z-index: 60; margin: 0;
    border-radius: 18px 18px 0 0; padding: 14px 12px 0;
    display: flex; flex-direction: column; background: var(--bg-top);
    animation: preview-sheet-enter 180ms ease-out;
  }
  .workspace.has-preview .preview-panel .preview { flex: 1 1 auto; min-height: 0; height: auto; padding: 12px; }
  .workspace.has-preview { grid-template-rows: minmax(0, 1fr) !important; grid-template-areas: "chat" !important; grid-template-columns: minmax(0, 1fr) !important; }
  .workspace.has-preview .chat-panel { grid-area: chat !important; }
  .preview-head-actions { flex-shrink: 0; }
}
@keyframes preview-sheet-enter { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .workspace.has-preview .preview-panel { animation: none; } }

/* Approved Open slate: real app controls, locally served approved assets. */
@font-face { font-family: "Instrument Sans"; src: url("/assets/instrument-sans.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
:root { --bg-top: #e7e8ea; --bg-bottom: #e7e8ea; --surface: #fff; --text: #171718; --muted: #62636a; --line: #17171818; --panel: #ffffff70; --panel-strong: #ffffffb8; }
:root[data-appearance="dark"] { color-scheme: dark; --bg-top: #191a1d; --bg-bottom: #191a1d; --surface: #27282b; --text: #efeff1; --muted: #a2a2aa; --line: #ffffff20; --panel: #ffffff08; --panel-strong: #27282b; --button-fill: #efeff1; --button-fill-text: #171718; --button-fill-strong: #ffffff18; }
.app-shell:not(.onboarding-active) { height: 100dvh; min-height: 0; padding: 12px 28px 20px; gap: 0; overflow: hidden; }
.topbar { min-height: 56px; padding: 0 8px; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
.brand img { display: block; width: 41px; height: 41px; object-fit: contain; }
:root[data-appearance="dark"] .brand img { filter: invert(1); }
.header-navigation { display: flex; align-items: center; gap: 8px; margin-left: auto; padding-right: 8px; }
.header-navigation:empty { padding: 0; }
.app-shell:not(.onboarding-active) .account-name,
.app-shell:not(.onboarding-active) .account > .help-button { display: none; }
.account-button { width: 36px; height: 36px; min-width: 36px; border: 1px solid var(--line); background: var(--panel); color: var(--text); box-shadow: none; }
.account-button svg { width: 20px; height: 20px; }
.account-button:hover { background: var(--line); }
.app-shell:not(.onboarding-active) .workspace { display: grid; gap: 28px; }
.app-shell:not(.onboarding-active) .chat-panel { height: 100%; display: flex; flex-direction: column; border: 0; border-radius: 0; padding: 0; box-shadow: none; background: transparent; }
.app-shell:not(.onboarding-active) .chat-panel-head { display: none; }
.chat-panel > .message-line:empty { display: none; }
.app-shell:not(.onboarding-active) .chat-body { flex: 1 1 auto; min-height: 0; width: 100%; max-width: 800px; margin: 0 auto; }
.app-shell:not(.onboarding-active) .has-preview .chat-body { max-width: 600px; }
.app-shell:not(.onboarding-active) .chat-shell { border-radius: 0; gap: 8px; }
.chat-log { padding: 12px 8px 18px; gap: 16px; }
.chat-bubble { max-width: min(700px, 92%); padding: 16px 19px; line-height: 1.5; }
.chat-bubble.assistant { background: #fff; color: #171718; border: 0; border-radius: 20px 20px 20px 6px; }
.chat-bubble.user { background: #181819; color: #fff; border: 0; border-radius: 20px 20px 6px 20px; }
.chat-bubble .chat-role { display: none; }
.chat-bubble.user a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.chat-bubble.user code { color: inherit; background: #ffffff18; }
:root[data-appearance="dark"] .chat-bubble.assistant { background: #27282b; color: #efeff1; }
:root[data-appearance="dark"] .chat-bubble.user { background: #f4f4f5; color: #151516; }
:root[data-appearance="dark"] .chat-bubble.user code { background: #1717180c; }
.chat-bubble.pending { background: transparent; color: var(--muted); }
.chat-form, .chat-form.is-expanded { min-height: 88px; padding: 12px 12px 8px; border-radius: 23px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(14px); box-shadow: none; }
.chat-form .field { min-height: 0; }
.chat-form textarea { min-height: 24px; line-height: 24px; padding: 0 6px; color: var(--text); background: transparent; border: 0; border-radius: 0; scrollbar-width: none; }
.chat-form textarea::-webkit-scrollbar { display: none; }
.chat-form textarea::placeholder { color: var(--muted); opacity: 1; }
.chat-form .actions { gap: 6px; padding: 4px 0 0; align-items: center; }
.chat-form #send, .chat-form .chat-attach-button, .chat-form .voice-button, .chat-form .chat-stop-button { width: 36px; height: 36px; min-width: 36px; min-height: 36px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; box-shadow: none; }
.chat-form #send { border: 0; background: #cf3900; color: #fff; }
.chat-form #send svg { width: 22px; height: 22px; }
.chat-form .chat-attach-button { background: transparent; color: var(--text); border: 0; }
.chat-form .chat-attach-button svg { width: 32px; height: 32px; }
.chat-form .voice-button { background: transparent; color: var(--text); border: 0; }
:root[data-appearance="dark"] .chat-form :is(.voice-waveform, .voice-button) { color: #fff; }
.chat-form .voice-button svg { width: 20px; height: 20px; }
.chat-form .chat-stop-button[hidden] { display: none; }
.chat-form.is-busy #send { display: none; }
.chat-jump-latest { bottom: 14px; background: var(--surface); border-color: var(--line); color: var(--text); }
.account-menu { min-width: 280px; max-height: min(620px, calc(100dvh - 90px)); overflow-y: auto; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 28px #00000018; }
.account-menu-item { border: 0; border-radius: 8px; padding: 10px 12px; color: var(--text); background: transparent; text-align: left; font-weight: 400; }
.account-menu-item:hover { background: var(--line); }
.appearance-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; font-size: 13px; }
.appearance-options { display: flex; gap: 2px; background: var(--line); border-radius: 7px; padding: 2px; }
.appearance-option { border: 0; background: transparent; color: var(--text); padding: 5px 8px; font: inherit; border-radius: 5px; }
.appearance-option[aria-checked="true"] { background: var(--surface); }
.appearance-option:focus-visible { outline: 2px solid #cf3900; outline-offset: 2px; }
.navigation-preferences { border-block: 1px solid var(--line); margin-block: 5px; }
.modal-panel { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 28px #00000020; }
:root[data-appearance="dark"] input, :root[data-appearance="dark"] select { background: var(--surface); color: var(--text); border-color: var(--line); }
.preview-panel { background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
.preview-panel .preview { --text: #171718; --muted: #616161; --line: #17171818; background: #fff; color: #171718; border-radius: 0; box-shadow: 0 8px 28px #00000012; }
.preview-panel .panel-head { min-height: 44px; padding: 0 4px; }
.preview-back-action { flex: 0 0 auto; }
.files-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.files-panel .filespace-header { background: transparent; }
:root[data-appearance="dark"] .workspace-entry, :root[data-appearance="dark"] .workspace-list-head { background: var(--surface); color: var(--text); }
.chat-list-panel { background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
::selection { background: #cf390033; }
textarea { caret-color: #cf3900; }
@media (max-width: 1000px) {
  .app-shell:not(.onboarding-active) { padding: 8px 12px 12px; }
  .topbar { min-height: 56px; }
  .brand img { width: 34px; height: 34px; }
  .app-shell:not(.onboarding-active) .workspace { grid-template-areas: "chat" !important; grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: minmax(0, 1fr) !important; }
  .workspace.has-files .files-panel { position: fixed; inset: 64px 0 0; z-index: 60; margin: 0; padding: 12px; border-radius: 16px 16px 0 0; }
  .workspace.has-preview .preview-panel { inset: 64px 0 0; background: var(--bg-top); }
  .workspace-stage.is-chat-history-open { display: block; }
  .chat-list-panel { position: fixed; inset: 64px 0 0; z-index: 65; width: min(340px, 100%); max-width: 100%; border-radius: 0; }
  .account-menu { right: 0; max-width: calc(100vw - 24px); }
  .chat-log { padding: 8px 2px 14px; }
  .chat-bubble { padding: 14px 16px; max-width: 94%; }
}

/*! Instrument Sans — Copyright 2022 The Instrument Sans Project Authors (https://github.com/Instrument/instrument-sans)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
 */

/* Corrections from real light/dark and keyboard E2E. */
.chat-bubble.assistant code { color: inherit; background: #17171806; }
:root[data-appearance="dark"] .chat-bubble.assistant code { color: inherit; background: #ffffff12; }
.preview-close-trigger, .preview-close-trigger .chat-list-trigger-icon { color: var(--text); }
.preview-close-trigger { background: transparent; border: 1px solid var(--line); }
.preview-close-trigger:hover { background: var(--line); }

/* Open slate: a compact account menu; preferences have their own surface. */
.account-menu { width: 270px; min-width: 0; gap: 2px; border-radius: 20px; scrollbar-width: none; }
.account-menu-head { padding: 12px; margin-bottom: 8px; border: 0; }
.account-menu-item { min-height: 42px; padding: 11px 12px; border-radius: 10px; font-size: 14px; box-shadow: none; }
.preferences-modal { align-self: center; overflow-y: auto; display: block; width: min(560px, 100%); min-height: 0; padding: 24px; border-radius: 28px; background: var(--bg-top); }
.preferences-modal .panel-head { padding: 0 0 20px; margin: 0; border: 0; }
.preferences-modal h2 { margin: 0; font-size: 24px; font-weight: 500; }
.preferences-modal .appearance-setting, .preferences-modal .language-switcher, .preferences-modal .navigation-setting { padding: 18px 0; min-height: 60px; font-size: 16px; border-top: 1px solid var(--line); border-radius: 0; }
.preferences-modal .language-switch-row { margin: 0; font-weight: 400; }
.preferences-modal .navigation-preferences { border: 0; margin: 0; padding: 0; }
.preferences-modal .navigation-setting { width: 100%; }
.preferences-modal .round-icon-button { background: transparent; border: 0; color: var(--text); box-shadow: none; }
.preferences-modal .round-icon-button svg { width: 20px; height: 20px; }
@media (max-width: 600px) { .preferences-modal { padding: 20px; } }

/* Shared Open Slate menus and dialogs. Document paper keeps its own colors. */
:root { --dialog-surface: #e7e8ea; --dialog-field: #ffffff60; --dialog-hover: #17171808; --selection-surface: #f7f8fa; }
:root[data-appearance="dark"] { --dialog-surface: #252629; --dialog-field: #ffffff08; --dialog-hover: #ffffff0d; --selection-surface: #ffffff12; }
.modal-backdrop, .admin-modal-backdrop { padding: 24px; align-items: center; background: #0003; backdrop-filter: blur(10px); }
.modal-backdrop > .modal-panel, .admin-modal-backdrop > .admin-modal {
  align-self: center; min-height: 0; max-height: calc(100dvh - 48px); overflow: hidden;
  padding: 24px; border-radius: 28px; background: var(--dialog-surface); color: var(--text);
  border: 1px solid var(--line); box-shadow: 0 18px 60px #0002;
  grid-template-rows: auto minmax(0, 1fr); gap: 18px;
}
.modal-backdrop > .password-modal { width: min(480px, 100%); }
.admin-modal-backdrop > .admin-modal { width: min(840px, 100%); }
.modal-backdrop > .preferences-modal { width: min(560px, 100%); overflow-y: auto; }
.modal-backdrop .panel-head, .admin-modal-backdrop .panel-head { padding: 0; margin: 0; border: 0; min-height: 36px; gap: 16px; }
.modal-backdrop .panel-head h2, .admin-modal-backdrop .panel-head h2 { font-size: 24px; font-weight: 500; line-height: 1.25; margin: 0; }
.modal-backdrop .eyebrow, .admin-modal-backdrop .eyebrow { display: none; }
.slate-dialog-close { flex: 0 0 36px; width: 36px; height: 36px; min-height: 36px; padding: 0; border: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--text); box-shadow: none; }
.slate-dialog-close svg, .account-menu-item > svg { width: 20px; height: 20px; flex: 0 0 20px; }
.slate-dialog-close:hover { background: var(--dialog-hover); }
.account-menu-item { display: flex; align-items: center; gap: 12px; }
.account-menu { background: var(--dialog-surface); }
:is(.modal-panel,.admin-modal) :is(button,input,select,textarea) { font-family: inherit; font-weight: 400; }
:is(.modal-panel,.admin-modal) :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea) { min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--dialog-field); color: var(--text); box-shadow: none; }
:is(.modal-panel,.admin-modal) input::placeholder { color: var(--muted); opacity: 1; }
:is(.modal-panel,.admin-modal) button:not(.slate-dialog-close):not(.appearance-option):not(.navigation-setting):not(.scheduled-output-summary):not(.scheduled-output-delete):not(.scheduled-sidebar-row):not(.switch-button) { background: var(--dialog-field); color: var(--text); border-color: var(--line); box-shadow: none; }
:is(.modal-panel,.admin-modal) button:hover { background-color: var(--dialog-hover); }
:is(.modal-panel,.admin-modal) :is(.switch-row,.switch-state) { font-weight: 400; }
:is(.modal-panel,.admin-modal) :is(.admin,.user-list,.account-password-form) { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.admin-modal .admin { grid-template-rows: none; grid-auto-rows: max-content; }
.account-password-form { padding: 0; gap: 12px; }
.account-password-form .error:empty, .admin > [role="status"]:empty, #lanModelApiMessage:empty { display: none; }
:is(.modal-panel,.admin-modal) :is(.source-detail-state,.source-detail-path,.source-detail-body pre,.admin-temp-password,.help-icon-guide,.help-icon-guide-mark,.user-card) { background: var(--dialog-field); color: var(--text); border-color: var(--line); box-shadow: none; }
:is(.modal-panel,.admin-modal) :is(.source-detail-body,.help-info-body,.user-list,.admin,.account-password-form) { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.scheduled-sidebar-row { background: var(--dialog-field); }
.scheduled-sidebar-row:hover, .scheduled-sidebar-row.is-selected, .scheduled-task-row.is-selected .scheduled-sidebar-row { background: var(--dialog-hover); }
.scheduled-output-card:hover, .scheduled-output-card:focus-within, .scheduled-output-card.status-failed, .scheduled-output-card.is-unread { background: var(--dialog-field); }
.file-menu-popover { border-radius: 16px; background: var(--dialog-surface); color: var(--text); border-color: var(--line); box-shadow: 0 10px 30px #0002; }
.file-menu-popover button { min-height: 40px; background: transparent; color: var(--text); border: 0; border-radius: 8px; font-weight: 400; box-shadow: none; }
.file-menu-popover button:hover { background: var(--dialog-hover); }
.file-menu-popover button svg { width: 20px; height: 20px; flex-basis: 20px; }
:root[data-appearance="dark"] .file-menu-index-status.indexed { color: #8bcba6; }
.account-menu :focus-visible, :is(.modal-panel,.admin-modal,.file-menu-popover) :focus-visible { outline: 2px solid #cf3900; outline-offset: 2px; }
@media (max-width: 600px) {
  .modal-backdrop, .admin-modal-backdrop { padding: 12px; }
  .modal-backdrop > .modal-panel, .admin-modal-backdrop > .admin-modal { padding: 20px; max-height: calc(100dvh - 24px); border-radius: 24px; }
  .modal-backdrop > .scheduled-modal { height: calc(100dvh - 24px); }
  .admin-create-form, .lan-api-create-form { grid-template-columns: minmax(0, 1fr); }
  .user-actions { gap: 8px; }
  .scheduled-layout { max-height: none; }
}
@media (prefers-reduced-transparency: reduce) { .modal-backdrop, .admin-modal-backdrop { backdrop-filter: none; background: #0009; } }
/* Flat, consistent switches and action controls in all account windows. */
:is(.modal-panel,.admin-modal,.file-menu-popover) .switch-track { width: 38px; height: 22px; padding: 2px; border: 1px solid var(--line); background: #8886; box-shadow: none; }
:is(.modal-panel,.admin-modal,.file-menu-popover) .switch-thumb { width: 16px; height: 16px; background: #fff; box-shadow: 0 1px 3px #0002; }
:is(.modal-panel,.admin-modal,.file-menu-popover) .switch-input:checked ~ .switch-track { background: #cf3900; border-color: #cf3900; }
:is(.modal-panel,.admin-modal,.file-menu-popover) .switch-input:checked ~ .switch-track .switch-thumb { transform: translateX(14px); }
:is(.modal-panel,.admin-modal) .admin-create-form, .lan-api-create-form { gap: 10px; }
:is(.modal-panel,.admin-modal) .account-password-form > button, .user-actions button, #createUserForm > button, #createLanApiKey { min-height: 40px; padding: 8px 14px; border-radius: 12px; }
.admin-modal :is(.admin,.user-list) { align-content: start; }
:is(.modal-panel,.admin-modal) .admin > p { margin: 0; }
.slate-choice { position: relative; display: inline-block; min-width: 150px; max-width: 100%; }
.slate-choice > select { display: none; }
:is(.modal-panel,.admin-modal) .slate-choice-trigger { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 12px; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--dialog-field); color: var(--text); text-align: left; }
.slate-choice-trigger svg { width: 16px; height: 16px; flex: 0 0 16px; }
.slate-choice-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--dialog-surface); box-shadow: 0 8px 24px #0002; }
.slate-choice-list[hidden] { display: none; }
:is(.modal-panel,.admin-modal) .slate-choice-list button { display: flex; width: 100%; min-height: 38px; border: 0; border-radius: 8px; padding: 8px 10px; background: transparent; text-align: left; justify-content: space-between; gap: 8px; }
.slate-choice-list svg { width: 16px; height: 16px; }
@media (max-width: 600px) {
  .lan-api-section > .panel-head.compact { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .lan-api-section .switch-row { display: flex; justify-content: space-between; width: 100%; }
  .lan-api-section .switch-control { flex: 0 0 auto; }
}
.slate-action-dialog { width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; padding: 24px; border-radius: 24px; border: 1px solid var(--line); color: var(--text); background: var(--dialog-surface); box-shadow: 0 18px 60px #0002; }
.slate-action-dialog::backdrop { background: #0003; backdrop-filter: blur(10px); }
.slate-action-dialog form { display: grid; gap: 20px; }
.slate-action-dialog h2 { margin: 0; font-size: 22px; font-weight: 500; }
.slate-action-dialog p { margin: 0; overflow-wrap: anywhere; }
.slate-action-dialog input { width: 100%; padding: 12px; border: 1px solid var(--line); background: var(--dialog-field); color: var(--text); border-radius: 12px; font: inherit; }
.slate-action-buttons { display: flex; justify-content: flex-end; gap: 10px; }
.slate-action-buttons button { min-height: 40px; padding: 8px 16px; font: inherit; border: 1px solid var(--line); background: var(--dialog-field); color: var(--text); border-radius: 12px; box-shadow: none; }
.slate-action-buttons button[type="submit"] { background: var(--text); color: var(--dialog-surface); }
/* Optional drawers share the slate surface, without the retired card-shift layout. */
.files-panel, .chat-list-panel { background: var(--dialog-surface); color: var(--text); }
.workspace-stage.is-chat-history-open .chat-panel { transform: none; animation: none; filter: none; }
.workspace-stage.is-chat-history-open .chat-panel .chat-body { opacity: 1; }
.files-panel :is(.tab,.workspace-path-label,.workspace-entry-main,.workspace-entry-name), .chat-list-panel button { font-weight: 400; }
.files-panel :is(.workspace-round-button,.workspace-up-button), .chat-list-panel :is(.chat-history-close,.chat-list-new) { background: transparent; color: var(--text); border: 0; box-shadow: none; }
.files-panel :is(.workspace-round-button,.workspace-up-button) svg { width: 20px; height: 20px; }
.files-panel .workspace-entry { background: transparent; }
.files-panel .workspace-table::after { display: none; }
@media (max-width: 1000px) {
  .workspace-stage.is-chat-history-open > .chat-list-panel { position: fixed; inset: 64px auto 0 0; margin: 0; width: min(340px, 100%); height: auto; border-radius: 16px 16px 0 0; }
  .files-panel .workspace-list-head { display: none; }
  .files-panel .workspace-entry { display: grid; grid-template-columns: minmax(0,1fr) 64px; grid-template-areas: "main size"; min-height: 64px; border-bottom: 1px solid var(--line); }
  .files-panel .workspace-entry-main { min-height: 64px; padding: 12px 40px 12px 4px; gap: 12px; }
  .files-panel .workspace-entry-icon { display: inline-flex; width: 24px; height: 24px; background: transparent; }
  .files-panel .workspace-entry-icon svg { width: 20px; height: 20px; }
  .files-panel .workspace-entry-name { font-size: 16px; line-height: 1.4; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .files-panel .workspace-entry-cell { border: 0; }
  .files-panel :is(.workspace-entry-modified,.workspace-entry-type) { display: none; }
  .files-panel .workspace-entry-size { font-size: 12px; color: var(--muted); }
  .files-panel .file-menu-button { background: transparent; box-shadow: none; border: 0; }
}

/* Main-only account surfaces share the approved slate palette. */
.account-button { border-radius: 50%; }
#accountToggle { border-color: transparent; border-radius: 8px; background: transparent; }
#accountToggle:hover, #accountToggle.is-open { background: var(--line); }
#headerChatListToggle, #headerFilesToggle { border-color: transparent; background: transparent; }
.desktop-app-card, .desktop-app-card.is-available { background: var(--dialog-field); border-color: var(--line); color: var(--text); }
.desktop-app-card span, .desktop-apps-note { color: var(--muted); }
.chat-form .voice-cancel-button { width: 36px; height: 36px; border-radius: 50%; color: var(--text); }
.chat-form .voice-cancel-button svg { width: 20px; height: 20px; }
:root[data-appearance="dark"] .chat-form .voice-cancel-button { color: #fff; }

/* Open Slate reference geometry: the document floats inside the slate. */
.app-shell:not(.onboarding-active) .chat-body { max-width:650px; }
.app-shell:not(.onboarding-active) .has-preview .chat-body { max-width:560px; }
.chat-form .chat-attach-button svg { width:20px; height:20px; }
.preview-panel { display:flex; flex-direction:column; min-height:0; gap:0; }
.preview-panel .panel-head { border:0; flex:0 0 44px; min-height:44px; padding:0 12px; }
.preview-head-actions { display:flex; gap:4px; }
.preview-head-actions button,.preview-back-action { width:34px; height:34px; min-width:34px; padding:7px; border:0; border-radius:50%; background:transparent; color:var(--text); box-shadow:none; }
.preview-head-actions svg,.slate-page-controls svg { width:20px; height:20px; }
.preview-panel .preview { flex:1; min-height:0; height:auto; padding:8px 12px; background:transparent; box-shadow:none; overflow:auto; }
.preview-panel .preview-markdown,.preview-panel .preview-text { flex:0 1 auto; width:calc(100% - 24px); max-width:530px; max-height:calc(100% - 60px); margin:auto; padding:32px; background:#fff; color:#181819; box-shadow:0 10px 35px #00000016; }
.preview-panel .preview-markdown { min-height:min(60vh,650px); }
.preview-panel .document-viewer,.preview-panel .image-preview { height:100%; min-height:0; }
.preview-panel .document-preview-zoom { display:inline-flex; }
.preview-panel .document-preview-zoom .document-preview-control { opacity:1; pointer-events:auto; transform:none; }
.slate-page-controls .document-preview-zoom { position:static; padding:0; gap:2px; margin-left:8px; }
.slate-page-controls .document-preview-control { width:34px; height:34px; padding:7px; }
.slate-page-controls .preview-zoom-reset { width:48px; padding:0 2px; font-size:11px; font-variant-numeric:tabular-nums; }
.preview-unavailable { max-width:420px; margin:auto; padding:24px; color:var(--text); line-height:1.5; }
.preview-panel .pdf-preview-viewport { height:100%; padding:0; overflow:auto; }
.preview-panel .pdf-preview { min-height:100%; min-width:100%; width:max-content; height:max-content; display:flex; align-items:flex-start; justify-content:flex-start; padding:0; gap:0; background:transparent; }
.preview-panel .pdf-page { margin:auto; border:0; border-radius:0; box-shadow:0 10px 35px #00000016; flex-shrink:0; }
.preview-panel .pdf-page[hidden] { display:none; }
.slate-page-controls { flex:0 0 44px; display:flex; justify-content:center; align-items:center; gap:4px; }
.slate-page-controls button { width:40px; height:40px; padding:10px; border:0; background:none; color:var(--text); }
.slate-page-controls button:disabled { opacity:.25; }
.slate-page-controls span { font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums; }
.preview-action-message:empty { display:none; }
@media(max-width:1000px) {
 .workspace.has-preview .preview-panel { inset:12px 0 0; border-radius:24px 24px 0 0; padding:8px 0 0; z-index:80; }
 .workspace.has-preview .preview-panel .preview { padding:8px 12px; }
 .workspace.has-preview .preview-panel .preview-markdown,.workspace.has-preview .preview-panel .preview-text { flex:0 1 auto; padding:24px; }
}

.app-shell:not(.onboarding-active) .workspace-stage { width:100%; max-width:1320px; margin-inline:auto; }
.topbar { justify-content:flex-start; }
.topbar .account { margin-left:0; }
.preview-panel.layout-card { border:0; }
.preview-panel .panel-head { align-self:center; width:var(--slate-page-width,100%); max-width:100%; padding:0; }
.preview-filename { font-size:13px; font-weight:400; }
.preview-panel .preview-head-actions .round-icon-button { background:transparent; box-shadow:none; border:0; }
@media(max-width:1000px) { .preview-panel .panel-head { width:100%; padding:0 14px; } }

.slate-setting-row { display:flex; align-items:center; gap:16px; padding:18px 0; border-top:1px solid var(--line); }
.slate-setting-row>span { min-width:82px; }
.slate-choice { position:relative; flex:1; }
.slate-choice summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; background:var(--panel); border:1px solid var(--line); border-radius:12px; cursor:pointer; list-style:none; }
.slate-choice summary .iconoir-icon { width:16px; height:16px; flex:0 0 16px; }
.slate-choice summary::-webkit-details-marker { display:none; }
.slate-choice-list { position:absolute; inset:calc(100% + 6px) 0 auto; z-index:5; border:1px solid var(--line); border-radius:14px; background:var(--surface); box-shadow:0 12px 36px #0002; padding:6px; }
.slate-choice-list button { display:flex; width:100%; justify-content:space-between; align-items:center; padding:10px 12px; border:0; border-radius:8px; background:none; color:var(--text); font:inherit; }
.slate-choice-list button:hover { background:var(--line); }
.slate-choice-list svg { width:18px; height:18px; }
.preferences-modal { width:520px; max-width:calc(100vw - 32px); padding:26px; border-radius:24px; background:var(--bg-top); }
.preferences-modal .panel-head { border:0; padding:0 0 24px; }
.preferences-modal .panel-head h2 { font-size:20px; font-weight:500; }
.preferences-modal .navigation-setting { border-radius:0; border-bottom:1px solid var(--line); padding:18px 0; }
.files-panel { padding:24px; border:1px solid var(--panel-strong); border-radius:24px; background:var(--bg-top); }
.slate-files-title { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
.slate-files-title h2 { margin:0; font-size:20px; font-weight:500; }
.slate-files-title button { width:36px; height:36px; border:0; background:none; color:var(--text); }
.slate-files-title svg { width:20px; height:20px; }
.workspace-head { border:0; padding:0; }
.files-panel .workspace-round-button { background:none; border:0; color:var(--text); box-shadow:none; }
.slate-file-search { width:100%; padding:12px 16px; border:1px solid var(--line); border-radius:14px; background:var(--panel); margin:12px 0; color:var(--text); font:inherit; }
.workspace-list-head,.workspace-entry>.workspace-entry-cell { display:none; }
.workspace-table { display:block; }
.workspace-entry { display:flex; align-items:center; padding:14px 0; border:0; border-bottom:1px solid var(--line); background:transparent!important; }
.workspace-entry[hidden] { display:none; }
.workspace-entry-main { flex:1; padding:8px; min-width:0; }
.workspace-entry-copy { display:flex; flex-direction:column; gap:4px; }
.slate-file-meta { color:var(--muted); font-size:12px; }
.workspace-entry .file-menu { position:static; margin-left:auto; }
@media(max-width:1000px) { .workspace.has-files .files-panel { inset:12px 0 0; border-radius:24px 24px 0 0; padding:24px; } }
.slate-setting-row>span { flex:0 0 100px; }
.files-panel #newFolderToggle,.files-panel #uploadButton { background:transparent; color:var(--text); border:0; box-shadow:none; width:36px; height:36px; }
.files-panel .workspace-entry-icon { width:32px; height:32px; background:none; border:0; }
.files-panel .workspace-entry-icon svg { width:24px; height:24px; }
.files-panel .workspace-entry-name { font-size:15px; font-weight:400; }
.files-panel .workspace-path-label { font-size:14px; color:var(--muted); }
@media(max-width:1000px) {
 .workspace.has-preview .preview-panel,
 .workspace.has-files .files-panel { z-index:120; }
 .app-shell:has(.workspace.has-preview) .topbar,
 .app-shell:has(.workspace.has-files) .topbar { visibility:hidden; }
}
@media(min-width:1001px) {
 .preview-panel:has(.preview-markdown),.preview-panel:has(.preview-text) { justify-content:center; }
 .preview-panel:has(.preview-markdown) .panel-head,.preview-panel:has(.preview-text) .panel-head { width:min(530px,calc(100% - 24px)); }
 .preview-panel .preview-markdown,.preview-panel .preview-text { margin:0 auto; }
}
/* Shared Open Slate surfaces: keep documents legible in either app theme. */
.preview-panel .preview-csv { margin:8px 12px 16px; padding:0; background:#fff; color:#181819; box-shadow:0 10px 35px #00000016; }
.preview-panel .preview-csv table { color:#181819; background:#fff; }
.preview-panel .preview-csv th { background:#f1f1f2; color:#606067; }
.preview-panel .preview-csv td { background:#fff; color:#181819; border-color:#ededee; }
.preview-panel .video-preview { background:transparent; min-height:0; }
.preview-panel .video-preview video { height:auto; max-height:100%; border-radius:0; }
:root[data-appearance="dark"] #adminBackdrop .badge { background:#ffffff12; color:#d7d7dc; }
.connections-modal .connection-views { display:flex; gap:4px; margin-top:12px; padding:4px; border:0; border-radius:14px; background:var(--dialog-field); }
.connections-modal .connection-views button { flex:1; padding:10px 12px; border:0; border-radius:10px; background:transparent; }
.connections-modal .connection-views button[aria-pressed="true"] { background:var(--surface); }
:is(.modal-panel,.admin-modal) .button,:is(.modal-panel,.admin-modal) button[type="submit"] { border-radius:22px; }
.slate-choice-list button { background:transparent!important; }
.slate-choice-list button:hover { background:var(--dialog-hover)!important; }
.preferences-modal .navigation-setting { background:transparent!important; }
.slate-choice { min-width:0; }
.preview-panel .preview-head-actions { flex-shrink:0; }
.preview-panel .panel-title { overflow:hidden; }
@media(max-width:1000px) {
 .workspace.has-preview .preview-panel .preview-csv { padding:0; }
 .workspace-stage.is-chat-history-open > .chat-list-panel { inset:12px 0 0; width:100%; max-width:none; border-radius:24px 24px 0 0; z-index:120; padding:20px; }
 .app-shell:has(.chat-list-panel) .topbar { visibility:hidden; }
}
.preview-panel .preview-csv { width:calc(100% - 24px); align-self:center; }
.modal-backdrop .account-password-form button[type="submit"],.admin-modal-backdrop .lan-model-api-form button[type="submit"],.export-primary-action { border-radius:22px; }
.connections-modal .connection-views button[aria-pressed="false"] { background:transparent!important; }
.connections-modal .connection-views button[aria-pressed="true"] { background:var(--surface)!important; }

@media(min-width:1001px) {
 .preview-panel:has(.pdf-preview) { justify-content:center; }
 .preview-panel:has(.pdf-preview) .preview { flex:0 1 auto; height:var(--slate-page-height,calc(100% - 88px)); }
}

.modal-backdrop .panel-head h2,.admin-modal-backdrop .panel-head h2 { font-size:20px; }
@media(min-width:1001px) {
 .preview-panel:has(.image-preview) { justify-content:center; }
 .preview-panel:has(.image-preview) .preview { flex:0 1 auto; height:var(--slate-page-height,calc(100% - 60px)); }
}

/* Spreadsheet exports keep their natural cell scale on a quiet white surface. */
.preview-panel .pdf-page.spreadsheet-page { padding:24px; box-sizing:border-box; background:#fff; }
.preview-panel .spreadsheet-page canvas { max-width:100%; margin:0; }

/* Menu counts participate in the row instead of the header badge positioning. */
.account-menu-item > .scheduled-count { position: static; margin-inline-start: auto; flex: 0 0 auto; background: var(--orange); color: #fff; }

/* Open Slate reading scale and short fades at scroll edges with more content. */
.app-shell:not(.onboarding-active) .chat-body { font-size: 15px; }
.chat-form textarea { font-size: inherit; }
.chat-log {
  --fade-top: 0px;
  --fade-bottom: 0px;
  mask-image: linear-gradient(to bottom, transparent, #000 var(--fade-top), #000 calc(100% - var(--fade-bottom)), transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--fade-top), #000 calc(100% - var(--fade-bottom)), transparent);
}
.chat-log.is-scrolled { --fade-top: 8px; }
.chat-log.has-more-below { --fade-bottom: 8px; }

/* Transient delivery notices use the conversation surface and Iconoir geometry. */
.scheduled-chat-notices { display:flex; flex-direction:column; align-items:flex-start; gap:14px; max-width:100%; }
.scheduled-chat-notice {
 display:flex; align-items:center; justify-content:flex-start; gap:12px; max-width:100%;
 min-height:68px; padding:12px 16px; border:0; border-radius:26px 26px 26px 6px;
 background:var(--panel); color:var(--text); box-shadow:none;
}
.scheduled-notice-action {
 flex:0 1 auto; min-width:0; min-height:44px; padding:10px 16px; border:0; border-radius:999px;
 background:#191919; color:#fff; box-shadow:none; text-align:left; overflow-wrap:anywhere;
 font:inherit; font-size:16px; font-weight:400; line-height:24px; white-space:normal;
}
:root[data-appearance="dark"] .scheduled-notice-action { background:#fff; color:#191919; }
.scheduled-notice-timer { display:flex; flex:0 0 24px; }
.scheduled-notice-countdown { width:24px; height:24px; flex:0 0 24px; stroke:currentColor; stroke-width:1.5; }
.scheduled-notice-track { opacity:.28; }
.scheduled-notice-progress { transform:rotate(-90deg); transform-origin:center; stroke-dasharray:56.549; stroke-linecap:round; animation:scheduled-notice-countdown 10s linear forwards; }
@keyframes scheduled-notice-countdown { from { stroke-dashoffset:0; } to { stroke-dashoffset:56.549; } }
@media (prefers-reduced-motion:reduce) { .scheduled-notice-progress { animation:none; stroke-dashoffset:0; } }

/* Reserve a real row for update status, keeping composer and dialogs unobscured. */
#app:has(> .ui-update-notice) { display:flex; flex-direction:column; height:100dvh; min-height:0; }
#app:has(> .ui-update-notice) > .app-shell { flex:1 1 auto; height:auto; min-height:0; }
.ui-update-notice { flex:0 0 auto; display:flex; align-items:center; justify-content:center; gap:16px; padding:10px 20px; background:var(--panel); color:var(--text); border-bottom:1px solid var(--line); font-size:14px; line-height:1.4; }
.ui-update-notice > span { min-width:0; overflow-wrap:anywhere; }
.ui-update-notice > button { flex:0 0 auto; min-height:36px; padding:6px 12px; border:1px solid var(--line); border-radius:18px; background:transparent; color:inherit; box-shadow:none; font-size:14px; font-weight:500; }
@media(max-width:600px) { .ui-update-notice { align-items:flex-start; gap:10px; padding:10px 12px; } }
/* Meeting capture stays in the conversation; these controls share one row. */
.meeting-inline-row { display:flex; align-items:center; gap:6px; flex-wrap:nowrap; }
.meeting-inline-row .workspace-reference-chip { min-width:0; flex:1; justify-content:flex-start; }
.meeting-inline-row .round-icon-button { flex:0 0 36px; width:36px; height:36px; padding:8px; background:transparent; color:inherit; border:0; }
.meeting-inline-row .round-icon-button svg { width:20px; height:20px; }
.meeting-conversation-status { font-size:0.9rem; }

.chat-bubble.meeting-chat-bubble { padding:16px 19px; }
@media(max-width:600px) { .chat-bubble.meeting-chat-bubble { padding:14px 16px; } }


}

/* The composer uses the text caret instead of a rectangular field focus ring. */
.chat-form textarea:focus { outline: none !important; box-shadow: none !important; }
/* Audio source selection is separate from recording/discard actions. */
.meeting-audio-mode {
  display: inline-flex; align-items: center; flex-shrink: 0; gap: 0;
  margin-inline-end: 18px; padding: 2px;
  border: 1px solid var(--myna-line, var(--line)); border-radius: 999px;
  background: var(--myna-canvas, var(--panel));
}
.meeting-audio-mode .meeting-audio-option {
  width: 40px; height: 40px; padding: 10px; border: 1px solid transparent;
  border-radius: 999px; background: transparent; color: var(--myna-muted, var(--muted));
}
.meeting-audio-mode .meeting-audio-option[aria-checked="true"] {
  background: var(--myna-surface, var(--panel)); color: var(--myna-ink, var(--text));
  border-color: var(--myna-control-line, var(--line));
}
