.file-workspace {
  --fw-ink: var(--ink, #252c2a);
  --fw-line: var(--line, #dce1df);
  --fw-muted: var(--muted, #67716f);
  overflow: hidden;
  padding: 0;
}
.file-workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 18px 15px;
  border-bottom: 1px solid var(--fw-line);
  background: linear-gradient(110deg, #fbf6f0 0%, var(--surface, #fff) 62%);
}
.file-workspace-head h2, .file-workspace-template h2 { font-size: 18px; letter-spacing: -.35px; }
.file-workspace-head p, .file-workspace-template p {
  margin-top: 5px;
  color: var(--fw-muted);
  line-height: 1.5;
}
.file-workspace-head .eyebrow, .file-workspace-template .eyebrow { margin-bottom: 5px; }
.file-workspace-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.file-workspace-crumbs {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 12px 18px;
  color: var(--fw-muted);
  font-size: 12px;
}
.file-workspace-crumbs button {
  min-height: 28px;
  padding: 4px 7px;
  border: 0;
  background: transparent;
  color: var(--orange, #d65b27);
  font-size: 12px;
}
.file-workspace-crumbs [aria-current="page"] { color: var(--fw-ink); font-weight: 700; }
.file-workspace-folders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 8px;
  padding: 0 18px 15px;
}
.file-workspace-folder {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  padding: 5px 7px 5px 4px;
  border: 1px solid var(--fw-line);
  border-radius: 9px;
  background: var(--surface, #fff);
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}
.file-workspace-folder:hover { transform: translateY(-1px); border-color: #d9b49b; background: #fffaf6; }
.file-workspace-folder-open {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  padding: 7px;
  border: 0;
  background: transparent;
  text-align: left;
  white-space: normal;
}
.file-workspace-folder-mark {
  position: relative;
  width: 28px;
  height: 21px;
  flex: none;
  border: 1px solid #d7aa87;
  border-radius: 4px;
  background: #f8e9dc;
}
.file-workspace-folder-mark::before {
  position: absolute;
  top: -5px;
  left: 1px;
  width: 11px;
  height: 6px;
  border: 1px solid #d7aa87;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  background: #f8e9dc;
  content: "";
}
.file-workspace-folder-copy { display: grid; min-width: 0; gap: 2px; }
.file-workspace-folder-copy b { overflow-wrap: anywhere; font-size: 12px; }
.file-workspace-folder-copy small { color: var(--fw-muted); font-size: 11px; }
.file-workspace-folder-arrow { margin-left: auto; color: var(--fw-muted); font-size: 22px; line-height: 1; }
.file-workspace-folder .lifecycle-delete {
  min-height: 34px;
  padding: 5px 7px;
}
.file-workspace-folder .lifecycle-delete span { display: none; }
.file-workspace-documents { padding: 0 18px 16px; }
.file-workspace-section-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 1px 0 8px;
}
.file-workspace-section-title h3 { font-size: 13px; }
.file-workspace-section-title span { color: var(--fw-muted); font-size: 11px; }
.file-workspace-documents .empty { border: 1px dashed var(--fw-line); background: #fafbf9; }
.file-workspace-template {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}
.file-workspace-template-copy { max-width: 690px; }
.file-workspace-template-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; }
.file-workspace-template-footer > span { color: var(--fw-muted); font-size: 11px; }
.file-workspace-modal-note { color: var(--muted, #67716f); line-height: 1.55; }

.file-workspace-preview {
  width: min(1120px, calc(100vw - 28px));
  max-width: 1120px;
  height: min(90dvh, 900px);
  max-height: 90dvh;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line, #dce1df);
  border-radius: 13px;
  background: var(--surface, #fff);
  color: var(--ink, #252c2a);
  box-shadow: 0 24px 80px #20282442;
}
.file-workspace-preview::backdrop { background: #17201db0; backdrop-filter: blur(3px); }
.file-workspace-preview-shell { display: flex; width: 100%; height: 100%; min-height: 0; flex-direction: column; }
.file-workspace-preview-head {
  z-index: 1;
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 13px 17px;
  border-bottom: 1px solid var(--line, #dce1df);
  background: var(--surface, #fff);
}
.file-workspace-preview-heading { min-width: 0; }
.file-workspace-preview-heading .eyebrow { margin: 0 0 3px; }
.file-workspace-preview-heading h2 { overflow: hidden; max-width: min(66vw, 700px); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.file-workspace-preview-heading p { margin-top: 4px; color: var(--muted, #67716f); font-size: 11px; }
.file-workspace-preview-controls { display: flex; flex: none; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.file-workspace-preview-content {
  display: grid;
  min-height: 0;
  flex: 1;
  place-items: center;
  overflow: auto;
  padding: 18px;
  background: #eff1ef;
}
.file-workspace-preview-image { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.file-workspace-preview-pdf { display: block; width: 100%; height: 100%; min-height: 55dvh; border: 0; border-radius: 5px; background: #e5e7e5; }
.file-workspace-pdf-note { font-size: 12px; color: var(--muted, #67716f); padding-top: 8px; }
.file-workspace-pdf { align-self: start; width: 100%; min-width: 0; }
.file-workspace-pdf-toolbar { display: flex; position: sticky; top: 0; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px; background: var(--surface, #fff); border-radius: 8px; z-index: 1; }
.file-workspace-pdf canvas { display: block; width: 100%; height: auto; margin: 12px auto 0; max-width: 100%; box-shadow: 0 2px 10px #0002; }
.file-workspace-pdf canvas[hidden] { display: none; }
.file-workspace-pdf-message { padding: 8px; text-align: center; }
.file-workspace-preview-state {
  display: grid;
  max-width: 520px;
  justify-items: center;
  gap: 12px;
  padding: 30px 20px;
  color: var(--ink, #252c2a);
  text-align: center;
}
.file-workspace-preview-state p { color: var(--muted, #67716f); line-height: 1.6; }
.file-workspace-preview-state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 3px; }
.file-workspace-preview-error { color: var(--red, #a43e37); }
.file-workspace-file-glyph {
  display: grid;
  width: 58px;
  height: 68px;
  place-items: center;
  border: 1px solid #d8b69b;
  border-radius: 8px;
  background: #fbf1e9;
  color: #8c4c2e;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .05em;
}
.file-workspace-skeleton {
  width: min(68vw, 480px);
  height: min(46vh, 380px);
  border: 1px solid #dce1df;
  border-radius: 8px;
  background: linear-gradient(100deg, #e5e8e6 25%, #f5f6f5 40%, #e5e8e6 60%);
  background-size: 220% 100%;
  animation: file-workspace-skeleton 1.4s ease-in-out infinite;
}
@keyframes file-workspace-skeleton {
  from { background-position: 100% 0; }
  to { background-position: -120% 0; }
}
.dark .file-workspace-head { background: linear-gradient(110deg, #332e2a, var(--surface, #292e2f) 62%); }
.dark .file-workspace-folder { background: var(--surface, #292e2f); }
.dark .file-workspace-folder:hover { border-color: #9c6848; background: #35302d; }
.dark .file-workspace-folder-mark, .dark .file-workspace-folder-mark::before { border-color: #987051; background: #48382d; }
.dark .file-workspace-documents .empty { background: #303636; }
.dark .file-workspace-preview { border-color: var(--line, #42494a); background: var(--surface, #292e2f); color: var(--ink, #edf0ed); }
.dark .file-workspace-preview-head { border-color: var(--line, #42494a); background: var(--surface, #292e2f); }
.dark .file-workspace-preview-content { background: #202525; }
.dark .file-workspace-preview-state { color: var(--ink, #edf0ed); }
.dark .file-workspace-file-glyph { border-color: #79583f; background: #3e322b; color: #efc2a2; }

@media (max-width: 700px) {
  .file-workspace-head { display: grid; padding: 15px 13px 12px; }
  .file-workspace-actions { display: grid; grid-template-columns: 1fr 1fr; justify-content: stretch; }
  .file-workspace-actions button { width: 100%; white-space: normal; }
  .file-workspace-crumbs { padding: 10px 13px; }
  .file-workspace-folders { grid-template-columns: 1fr; padding: 0 13px 13px; }
  .file-workspace-documents { padding: 0 13px 13px; }
  .file-workspace-template { grid-template-columns: 1fr; }
  .file-workspace-template-footer { justify-content: space-between; }
  .file-workspace-preview {
    inset: auto 0 0;
    width: 100vw;
    height: min(94dvh, 860px);
    max-width: none;
    max-height: 94dvh;
    margin: auto 0 0;
    border-radius: 15px 15px 0 0;
  }
  .file-workspace-preview-head { align-items: flex-start; padding: 12px 12px 10px; }
  .file-workspace-preview-heading h2 { max-width: 48vw; }
  .file-workspace-preview-controls { gap: 5px; }
  .file-workspace-preview-controls > * { min-height: 42px; padding: 7px 9px; font-size: 12px; }
  .file-workspace-preview-content { padding: 10px; }
  .file-workspace-preview-pdf { min-height: 70dvh; }
}
@media (prefers-reduced-motion: reduce) {
  .file-workspace-folder, .file-workspace-folder:hover { transition: none; transform: none; }
  .file-workspace-skeleton { animation: none; background: #e5e8e6; }
}
