.file-studio-dialog { width: min(1220px, 100%); height: min(780px, calc(100dvh - 40px)); display: grid; grid-template-rows: 68px minmax(0, 1fr); }
.modal-head { min-height: 68px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 17px; }
.modal-head h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.modal-head > span { min-width: 0; flex: 1; color: var(--subtle); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { height: 38px; width: min(330px, 34vw); border: 1px solid var(--line); background: var(--surface); border-radius: 11px; color: var(--text); padding: 0 12px; outline: 0; }
.search:focus { border-color: rgba(123, 120, 255, .4); box-shadow: 0 0 0 3px rgba(123, 120, 255, .06); }
.files-layout { min-height: 0; display: grid; grid-template-columns: 190px minmax(0, 1fr) 350px; }
.file-nav { min-width: 0; border-right: 1px solid var(--line); padding: 12px 10px; overflow: auto; background: rgba(9, 12, 17, .54); }
.file-nav-tabs { display: grid; gap: 4px; }
.file-nav-tabs .nav-btn { min-height: 42px; padding-inline: 11px; font-size: 12px; }
.file-nav-summary { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.temp-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.temp-summary-grid > span { display: grid; justify-items: center; padding: 8px 3px; border-radius: 10px; background: rgba(255,255,255,.022); }
.temp-summary-grid strong { font-size: 12px; }
.temp-summary-grid small { color: var(--subtle); font-size: 8.5px; }
.temp-storage-line { margin-top: 9px; color: var(--subtle); font-size: 9.5px; line-height: 1.4; text-align: center; }
.file-center { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.file-center-toolbar { min-height: 50px; display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.file-center-toolbar select { min-height: 34px; max-width: 150px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); padding: 0 28px 0 9px; font-size: 10px; }
.file-bulk-actions { display: flex; gap: 6px; margin-left: auto; }
.file-bulk-actions button { min-height: 34px; padding: 0 10px; white-space: nowrap; font-size: 10px; }
.file-select-control { width: 34px; flex: 0 0 34px; display: grid; place-items: center; align-self: stretch; cursor: pointer; }
.file-select-control input { width: 16px; height: 16px; accent-color: var(--accent); }
.file-breadcrumbs { min-width: 0; display: flex; align-items: center; gap: 3px; overflow: auto; scrollbar-width: none; }
.temporary-crumb { flex: 0 0 auto; min-height: 30px; border-radius: 8px; padding: 0 8px; color: var(--muted); font-size: 10.5px; }
.temporary-crumb:hover { background: var(--surface-2); color: var(--text); }
.file-view-hint { margin-left: auto; color: var(--subtle); font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-content-scroll { min-height: 0; overflow: auto; padding: 14px; display: grid; align-content: start; gap: 16px; }
.file-list, .temporary-file-explorer { min-width: 0; display: grid; gap: 8px; align-content: start; }
.file-list { grid-template-columns: 1fr; padding: 0; overflow: visible; }
.file-conversation-group { display: grid; gap: 7px; }
.file-conversation-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 3px 5px; color: var(--muted); }
.file-conversation-heading span { font-size: 11px; font-weight: 720; }
.file-conversation-heading small { color: var(--subtle); font-size: 9px; }
.file-studio-row, .temporary-file-card { position: relative; min-width: 0; min-height: 68px; border: 1px solid var(--line); border-radius: 14px; background: rgba(15, 19, 27, .66); display: flex; align-items: center; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.file-studio-row:hover, .temporary-file-card:hover, .temporary-file-card.active { background: var(--surface-2); border-color: var(--line-2); }
.file-studio-item, .temporary-file-open { min-width: 0; flex: 1; min-height: 66px; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; align-items: center; padding: 9px 7px 9px 11px; text-align: left; }
.file-studio-item.active { background: rgba(123, 120, 255, .07); }
.temporary-file-icon, .file-thumb { width: 40px; height: 44px; border-radius: 10px; background: linear-gradient(145deg, #273142, #151b25); display: grid; place-items: center; color: var(--accent-2); font-size: 9px; font-weight: 800; }
.file-studio-item-copy, .temporary-file-copy { min-width: 0; }
.file-studio-item-name, .temporary-file-name { display: block; color: var(--text); font-size: 11.5px; font-weight: 680; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-studio-item-path, .temporary-file-meta { display: block; margin-top: 4px; color: var(--subtle); font-size: 9.8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.temporary-file-actions { padding-right: 6px; }
.file-actions-menu-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; color: var(--subtle); }
.file-actions-menu-btn:hover { background: var(--surface-3); color: var(--text); }
.file-actions-popover { position: fixed; z-index: var(--z-popover); min-width: 180px; max-height: min(320px, calc(100dvh - 16px)); overflow: auto; padding: 6px; border: 1px solid var(--line-2); border-radius: 12px; background: #11161f; box-shadow: var(--shadow-soft); display: grid; }
.file-actions-popover a, .file-actions-popover button { min-height: 36px; display: flex; align-items: center; padding: 0 9px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 11px; }
.file-actions-popover a:hover, .file-actions-popover button:hover { background: var(--surface-3); color: var(--text); }
.file-actions-popover .danger { color: #ff9ba8; }
.file-preview { min-width: 0; border-left: 1px solid var(--line); padding: 14px; display: none; flex-direction: column; gap: 11px; overflow: auto; background: rgba(8, 11, 16, .58); }
.file-studio-modal.has-file-selected .file-preview { display: flex; }
.file-preview-head { display: grid; gap: 2px; }
.file-preview-head strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-preview-head span { color: var(--subtle); font-size: 9.5px; }
.preview-stage { min-height: 260px; flex: 1; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, #121720, #0b0e14); display: grid; place-items: center; overflow: hidden; }
.preview-actions { display: flex; gap: 7px; }
.preview-actions button { min-height: 40px; flex: 1; }
.file-studio-empty-state { min-height: 100%; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); padding: 28px; }
.file-studio-empty-state h3 { margin: 11px 0 3px; color: var(--text); font-size: 14px; }
.file-studio-empty-state p { margin: 0; max-width: 240px; color: var(--subtle); font-size: 10.5px; line-height: 1.5; }
.empty-file-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: rgba(123, 120, 255, .08); color: #b7b4ff; font-size: 22px; }
.workspace-empty, .file-studio-inline-state { min-height: 138px; padding: 26px; border: 1px dashed var(--line); border-radius: 15px; display: grid; place-items: center; align-content: center; gap: 4px; text-align: center; color: var(--subtle); }
.workspace-empty strong { color: var(--muted); font-size: 12px; }
.workspace-empty span { max-width: 320px; font-size: 10.5px; }
.file-studio-inspector { display: grid; gap: 8px; }
.file-inspector-card { border: 1px solid var(--line); border-radius: 13px; padding: 11px; background: var(--surface); }
.file-inspector-kicker { color: var(--subtle); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.file-inspector-card h3 { margin: 4px 0; font-size: 13px; }
.file-inspector-meta { color: var(--subtle); font-size: 10px; }
.file-inspector-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.file-preview-loading { display: grid; justify-items: center; gap: 8px; padding: 30px; text-align: center; }
.file-preview-loading p { color: var(--subtle); font-size: 10px; }
.spinner { width: 28px; height: 28px; border: 2px solid var(--line-2); border-top-color: var(--accent-2); border-radius: 50%; animation: file-spin .8s linear infinite; }
@keyframes file-spin { to { transform: rotate(360deg); } }
.file-preview-image, .presentation-reference-image { max-width: 100%; max-height: 100%; object-fit: contain; }
.file-preview-readonly, .studio-code-preview { width: 100%; height: 100%; overflow: auto; padding: 14px; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; color: #dfe5ef; }
.studio-workbench, .presentation-workbench, .immersive-editor-document, .immersive-editor-presentation, .immersive-editor-text { width: 100%; height: 100%; min-height: 0; display: grid; }
.studio-panel, .presentation-inspector-panel, .visual-document-inspector { min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); overflow: hidden; }
.studio-panel-head, .presentation-edit-head { min-height: 42px; padding: 0 11px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.studio-editor-textarea, .file-editor-text { width: 100%; min-height: 300px; resize: none; border: 0; outline: 0; background: transparent; color: var(--text); padding: 14px; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.file-mobile-sheet { display: none; }
.file-mobile-actions { display: grid; gap: 8px; padding: 14px; }
.file-mobile-title { font-weight: 720; }
.file-mobile-meta { color: var(--subtle); font-size: 10px; }
.file-card { min-height: 72px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 12px; text-align: left; display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 11px; align-items: center; }
.file-card:hover, .file-card.selected { background: var(--surface-2); border-color: var(--line-2); }
.file-copy { min-width: 0; }
.file-copy strong, .file-copy span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-copy strong { font-size: 11.5px; }
.file-copy span { color: var(--subtle); font-size: 10.5px; margin-top: 4px; }

/* V6.4 file selection and preview polish */
.file-thumb.has-image, .temporary-file-icon.has-image { overflow: hidden; padding: 0; }
.file-thumb.has-image img, .temporary-file-icon.has-image img { width: 100%; height: 100%; object-fit: contain; background: #090d14; }
.file-studio-item[aria-selected="true"], .temporary-file-open[aria-selected="true"] { background: rgba(123,120,255,.075); }
.file-preview-error-detail { max-width: 520px; color: var(--subtle); font-size: 10px; overflow-wrap: anywhere; }
.document-visual-frame.pdf-preview-frame { width: 100%; height: 100%; min-height: 420px; border: 0; background: #fff; }
.file-studio-row.is-selected, .temporary-file-card.active { border-color: rgba(123,120,255,.38); background: rgba(123,120,255,.075); box-shadow: 0 0 0 1px rgba(123,120,255,.08) inset; }
.file-studio-row.is-selected .file-studio-item, .temporary-file-card.active .temporary-file-open { color: var(--text); }

/* V6.4 stable file preview geometry */
.file-preview-head { grid-template-columns: minmax(0,1fr); align-items: center; }
.file-preview-title { min-width: 0; display: grid; gap: 2px; }
.file-preview-title strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-preview-title span { color: var(--subtle); font-size: 9.5px; }
.file-preview-back { display: none; }
.file-studio-surface > .studio-workbench { width: 100%; height: 100%; min-height: 0; align-self: stretch; justify-self: stretch; }
.studio-workbench.single-preview { grid-template-rows: minmax(0,1fr); }
.studio-workbench.single-preview > .studio-panel { width: 100%; height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr); }
.studio-workbench.single-preview .file-preview-image { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; padding: 10px; object-fit: contain; }

/* V6.4 guided file assistant: compact by default, expanded only on demand */
.preview-stage.file-studio-surface {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  overflow: auto;
}
.preview-stage.file-studio-surface > .immersive-editor-stage,
.preview-stage.file-studio-surface > .studio-workbench {
  width: 100%;
  min-height: 0;
  flex: 1 0 min(420px, 54vh);
}
.preview-stage.file-studio-surface > .studio-workbench.single-preview {
  min-height: 260px;
  height: auto;
}
.studio-assistant-dock {
  flex: 0 0 auto;
  margin: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.studio-assistant-title { color: var(--text); font-size: 12px; font-weight: 720; }
.studio-assistant-copy { margin-top: 3px; color: var(--subtle); font-size: 10px; line-height: 1.45; }
.studio-assistant-workspace {
  display: none;
  flex: 0 0 auto;
  margin: 0 10px 10px;
  padding: 13px;
  border: 1px solid rgba(123,120,255,.25);
  border-radius: 15px;
  background: rgba(123,120,255,.045);
}
.studio-assistant-workspace.open { display: grid; gap: 12px; }
.studio-assistant-workspace-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.studio-assistant-grid { display: grid; grid-template-columns: minmax(210px,.72fr) minmax(260px,1fr); gap: 12px; }
.studio-assistant-config, .studio-assistant-compose, .studio-assistant-group { display: grid; gap: 8px; min-width: 0; }
.studio-target-list, .document-guidance-list { display: flex; flex-wrap: wrap; gap: 6px; }
.studio-target-chip, .studio-suggestion-chip {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
}
.studio-target-chip.active, .studio-target-chip:hover, .studio-suggestion-chip:hover {
  border-color: rgba(123,120,255,.38);
  background: rgba(123,120,255,.09);
  color: var(--text);
}
.studio-assistant-input {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5,8,13,.55);
  color: var(--text);
  padding: 11px;
  outline: 0;
  font: 12px/1.5 inherit;
}
.studio-assistant-input:focus { border-color: rgba(123,120,255,.42); box-shadow: 0 0 0 3px rgba(123,120,255,.06); }
.studio-assistant-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.studio-assistant-hint { color: var(--subtle); font-size: 9.5px; line-height: 1.4; }
