.files-main {
  gap: 18px;
}

.files-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
  padding: 26px;
  border: 1px solid rgba(45, 124, 255, 0.2);
  border-radius: 28px;
  background:
    radial-gradient(circle at 90% 0%, rgba(43, 212, 255, 0.18), transparent 30%),
    radial-gradient(circle at 0% 10%, rgba(109, 76, 255, 0.12), transparent 34%),
    linear-gradient(135deg, #ffffff, #f6f9ff);
  box-shadow: var(--shadow);
}

.files-eyebrow {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef7ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 950;
}

.files-eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--blue);
}

.files-hero h2 {
  max-width: 760px;
  margin-bottom: 8px;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1;
  letter-spacing: -0.06em;
}

.files-hero p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.55;
}

.files-upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
  margin-top: 20px;
}

.files-upload-form input {
  grid-column: 1 / -1;
}

.files-upload-form input,
.files-upload-form select,
.files-search-form input {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--ink);
  outline: 0;
}

.files-upload-form button,
.files-search-form button,
.files-source-card button,
.workspace-file-actions button,
.file-action-grid button,
.file-lineage-panel .section-title button,
.files-usage-panel button {
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
  font-weight: 950;
}

.files-source-card {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--soft-shadow);
}

.files-source-card > span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: #eef7ff;
  font-size: 26px;
}

.files-source-card b {
  display: block;
  font-size: 20px;
}

.files-source-card p {
  margin: 5px 0 0;
  font-size: 13px;
}

.files-source-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.files-source-card dl div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}

.files-source-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.files-source-card dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.files-insight-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.files-insight-strip article {
  min-width: 0;
  min-height: 126px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
  box-shadow: var(--soft-shadow);
}

.files-insight-strip span,
.files-insight-strip strong,
.files-insight-strip b,
.files-insight-strip p {
  display: block;
}

.files-insight-strip span {
  margin-bottom: 8px;
  font-size: 22px;
}

.files-insight-strip strong {
  color: var(--blue);
  font-size: 28px;
  letter-spacing: -0.05em;
}

.files-insight-strip p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.files-workbench {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.08fr);
  gap: 18px;
  align-items: start;
}

.files-library-column,
.files-detail-column {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.files-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px;
  margin-bottom: 12px;
}

.files-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.files-filter-tabs button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.files-filter-tabs button.active {
  border-color: transparent;
  background: var(--ink);
  color: white;
}

.workspace-file-list {
  display: grid;
  gap: 10px;
}

.workspace-file-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.workspace-file-card.active {
  border-color: rgba(45, 124, 255, 0.52);
  box-shadow: 0 12px 28px rgba(45, 124, 255, 0.12);
}

.workspace-file-card.needs-review {
  background: linear-gradient(180deg, #fffaf0, #ffffff);
}

.workspace-file-main {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.workspace-file-main > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: #eef7ff;
  font-size: 22px;
}

.workspace-file-main small,
.workspace-file-main b,
.workspace-file-main p {
  display: block;
}

.workspace-file-main small {
  color: var(--blue);
  font-size: 11px;
  font-weight: 950;
}

.workspace-file-main b {
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.25;
}

.workspace-file-main p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.workspace-file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workspace-file-meta span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 11px;
  font-weight: 900;
}

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

.workspace-file-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-size: 12px;
}

.workspace-file-actions button:first-child {
  border-color: transparent;
  background: var(--ink);
  color: white;
}

.file-preview,
.file-action-panel,
.file-lineage-panel {
  display: grid;
  gap: 15px;
}

.file-preview-head {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: start;
}

.file-preview-head > span,
.file-preview.empty-preview > span {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #eafff5;
  font-size: 28px;
}

.file-preview-head small {
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
}

.file-preview-head h2 {
  margin: 4px 0 6px;
  overflow-wrap: anywhere;
  font-size: clamp(23px, 2.1vw, 32px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.file-preview-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.file-understanding-grid article {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
}

.file-understanding-grid b,
.file-understanding-grid span {
  display: block;
}

.file-understanding-grid span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.file-action-grid button {
  display: grid;
  gap: 7px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  text-align: left;
}

.file-action-grid span {
  font-size: 24px;
}

.file-action-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.file-lineage article {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.file-lineage span,
.file-lineage b,
.file-lineage p {
  display: block;
}

.file-lineage span {
  margin-bottom: 8px;
  font-size: 22px;
}

.file-lineage p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.files-selected-rail,
.files-safety-panel {
  background:
    radial-gradient(circle at 92% 0%, rgba(45, 124, 255, 0.12), transparent 30%),
    white;
}

.files-usage-panel {
  display: grid;
  gap: 10px;
}

.files-usage-panel button {
  min-height: 42px;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  text-align: left;
  padding: 0 12px;
}

.files-usage-panel button:first-of-type {
  background: var(--ink);
  color: white;
  border-color: transparent;
}

@media (max-width: 1240px) {
  .files-workbench {
    grid-template-columns: 1fr;
  }

  .files-insight-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .files-hero {
    grid-template-columns: 1fr;
  }

  .files-upload-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .files-hero,
  .files-toolbar,
  .files-library,
  .file-preview,
  .file-action-panel,
  .file-lineage-panel {
    border-radius: 20px;
    padding: 16px;
  }

  .files-hero h2 {
    font-size: 34px;
  }

  .files-upload-form,
  .files-search-form,
  .files-insight-strip,
  .file-understanding-grid,
  .file-action-grid,
  .file-lineage {
    grid-template-columns: 1fr;
  }

  .workspace-file-actions {
    grid-template-columns: 1fr;
  }
}
