/* T460 (doc 57): files page STRUCTURAL port from prototype files.html (measured truth).
   Loads last. This wave fixes what component-level CSS could not: toolbar chrome,
   search field proportions, pane nesting, and spacing. Scoped to #files-legacy-tab. */

/* Search field — prototype .file-search input: tall, glass, 15px type. */
#files-legacy-tab .files-tree-toolbar {
  display: flex;
  flex-direction: column;
  /* T315: the tree toolbar must stay exactly as tall as the preview
     column's open-tabs row + path row combined, so the two split-pane
     headers share one bottom edge — this prototype pass must not
     re-collapse it to content-based sizing. Center the search field
     within that reserved height rather than anchoring it to the top. */
  justify-content: center;
  min-height: calc(var(--files-path-row-height) + var(--files-path-row-height));
  flex: 0 0 calc(var(--files-path-row-height) + var(--files-path-row-height));
  padding: 0.55rem 0.9rem;
  border-bottom: 0;
  background: transparent;
  position: static;
}
#files-legacy-tab .files-search-field {
  position: relative;
  inset: auto;
  display: block;
  /* T315: the toolbar centers this field with flex (justify-content),
     and #files-search-results is absolutely positioned off the input's
     own center (files.css) — a bottom-only margin here would just skew
     the field off the toolbar's vertical center. */
  margin: 0;
  padding: 0;
}
#files-legacy-tab .files-tree-search {
  height: auto;
  width: 100%;
  padding: 0.75rem 6.4rem 0.75rem 2.6rem;
  border-radius: 0.875rem;
  border: 1px solid var(--ui-line);
  background: var(--ui-panel);
  color: var(--ui-text);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.35;
  transition: border-color 140ms ease;
}
#files-legacy-tab .files-tree-search:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--ui-accent) 45%, transparent);
}
#files-legacy-tab .files-tree-search::placeholder { color: var(--ui-muted); font-weight: 400; }

/* Controls become quiet 28px icon buttons inside the search row (prototype .ra-btn). */
#files-legacy-tab .files-tree-controls {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  margin: 0;
  flex-wrap: nowrap;
}
#files-legacy-tab .files-tree-control {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  display: grid;
  place-items: center;
  padding: 0;
  gap: 0;
  background: transparent;
  border: 0;
  color: var(--ui-muted);
  font-size: 0.85rem;
  line-height: 1;
  white-space: nowrap;
}
#files-legacy-tab .files-tree-control span:not([aria-hidden]) { display: none; }
#files-legacy-tab .files-tree-control:hover { background: var(--ui-hover); color: var(--ui-text); }
#files-legacy-tab .files-tree-control[aria-checked="true"] { color: var(--ui-accent); }
#files-legacy-tab .files-search-spinner { top: 50%; transform: translateY(-50%); }

/* Panes — single glass surfaces (prototype cards), not stacked chrome. */
#files-legacy-tab .files-tree-pane {
  border: 1px solid var(--ui-line);
  border-radius: 1.125rem;
  background: var(--ui-panel);
  overflow: hidden;
}
#files-legacy-tab .file-preview-pane {
  border: 1px solid var(--ui-line);
  border-radius: 1.125rem;
  background: var(--ui-panel);
  overflow: hidden;
}
#files-legacy-tab .file-preview-body { background: transparent; }
#files-legacy-tab #files-tree { padding: 0.25rem 0.35rem 0.5rem; }
#files-legacy-tab .files-alt-pane { padding: 0.85rem 0.85rem 1rem; }

/* Preview empty state — spacious, centered (prototype composition). */
#files-legacy-tab .file-preview-empty {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.55rem;
  padding: 4.5rem 2rem;
  color: var(--ui-muted);
  text-align: center;
  font-size: 0.9rem;
}

/* Tab strip sits clear of the field (prototype .page-tabs margin). */
#files-legacy-tab .files-view-tabs { margin: 0.35rem 0 0.15rem; }
