.pf-page {
  --pf-text: #f5edf9;
  --pf-muted: #cbb8db;
  --pf-accent: #c28bf0;
  --pf-border: #73508d;
  max-width: 1580px;
  margin: auto;
  color: var(--pf-text);
  font: 15px/1.6 'Segoe UI', system-ui, sans-serif;
  overflow-wrap: anywhere;
}
.pf-page * { box-sizing: border-box; }
.pf-page [hidden] { display: none !important; }
.pf-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 30px;
  padding: 30px 32px;
  align-items: center;
  border: 1px solid #9c71b8;
  border-radius: 21px;
  background: radial-gradient(ellipse at right top, #9c57ca38, transparent 65%), linear-gradient(125deg, #331e45, #23172f);
  margin-bottom: 24px;
}
.pf-eyebrow { color: #d9b3f5; font-size: 11px; font-weight: 750; letter-spacing: 1.6px; }
.pf-hero h1 { color: #fff; font-size: clamp(26px, 3vw, 36px); line-height: 1.25; margin: 12px 0; letter-spacing: -.5px; }
.pf-hero p { color: #dfcfe9; max-width: 85ch; margin: 0; }
.pf-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pf-hero-tags span { border: 1px solid #826095; border-radius: 20px; padding: 4px 11px; background: #21152d; font-size: 12px; }
.pf-hero-art { text-align: center; border: 1px solid #9e76b7; background: #b77ee01b; border-radius: 18px; padding: 28px 10px; transform: rotate(-3deg); }
.pf-hero-art b { display: block; font: 35px/1.4 ui-monospace, monospace; color: #e9caff; }
.pf-hero-art small { font-size: 9px; letter-spacing: 2px; color: #edd28a; }
.pf-workspace {
  position: relative;
  display: flex;
  flex-direction: column;
  height: clamp(730px, 86vh, 1100px);
  min-height: 600px;
  overflow: hidden;
  border: 1px solid #9368ae;
  border-radius: 17px;
  background: #170f22;
  box-shadow: 0 15px 40px #0003;
}
.pf-toolbar, .pf-viewbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 14px; background: #2e1d3d; border-bottom: 1px solid #69477d; }
.pf-toolbar { justify-content: space-between; }
.pf-actions, .pf-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pf-page button, .pf-file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  max-width: 100%;
  padding: 8px 13px;
  border: 1px solid #966eaf;
  border-radius: 8px;
  color: #f9f0ff;
  background: #3a254b;
  font: 600 12px/1.4 'Segoe UI', system-ui, sans-serif;
  cursor: pointer;
  text-align: center;
}
.pf-page button:hover:not(:disabled), .pf-file:hover { background: #57336d; border-color: #d9b2f0; }
.pf-page button.pf-primary, .pf-file.pf-primary { color: #24132f; background: linear-gradient(115deg, #cd99f5, #ab75d5); border-color: #e1baff; font-weight: 750; }
.pf-page button:disabled { opacity: .4; cursor: not-allowed; }
.pf-page :is(button, input, textarea, select, summary, a):focus-visible, .pf-file:focus-within { outline: 3px solid #efca74; outline-offset: 3px; }
.pf-file { position: relative; overflow: hidden; margin: 0; }
.pf-file input { position: absolute; width: 100%; height: 100%; opacity: 0; inset: 0; cursor: pointer; }
.pf-tabs { flex: 1; }
.pf-tabs button { min-width: 87px; border-color: transparent; background: transparent; }
.pf-tabs button[aria-selected=true] { background: #714398; border-color: #bf90e0; box-shadow: inset 0 -2px #e5c4fb; }
.pf-body { display: grid; grid-template-columns: 208px minmax(0, 1fr) 310px; flex: 1; min-height: 0; }
.pf-nav, .pf-inspector { padding: 16px; min-width: 0; overflow-y: auto; background: #25192f; scrollbar-color: #8958a7 #24182f; }
.pf-nav { border-right: 1px solid #624473; }
.pf-inspector { border-left: 1px solid #624473; }
.pf-panel-heading { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pf-panel-heading h2 { color: #e9d9f4; font-size: 13px; margin: 0; }
.pf-panel-close { display: none !important; }
.pf-source { border: 1px solid #654679; border-radius: 11px; padding: 12px; margin-top: 12px; background: #2d1e39; }
.pf-source-selected { border-color: #d5a4f6 !important; background: #4c2d62 !important; }
.pf-source button:first-child { background: transparent; border: 0; justify-content: flex-start; padding: 0; text-align: left; font-size: 12px; }
.pf-source small { display: block; font-size: 10px; color: #d6c1e5; margin: 8px 0; }
.pf-page button.pf-small { min-height: 29px; padding: 4px 8px; font-size: 10px; }
.pf-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pf-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; padding: 15px; }
.pf-metrics div { padding: 12px; border: 1px solid #64417c; border-radius: 9px; background: #2c1b3b; }
.pf-metrics b { display: block; color: #e0b1fc; font-size: 23px; line-height: 1.2; }
.pf-metrics small { display: block; font-size: 10px; margin-top: 8px; }
.pf-review-controls { padding: 0 15px 12px; border-bottom: 1px solid #553568; }
.pf-search-row { display: flex; gap: 10px; margin: 0 0 10px; }
.pf-search-row input { flex: 1; width: 0; }
.pf-search-row select { width: 145px; }
.pf-page :is(input:not([type=file]):not([type=checkbox]), select, textarea) { color: #f9f2ff; background: #1b1028; border: 1px solid #9972b0; border-radius: 8px; padding: 10px 11px; min-height: 39px; font: 13px/1.5 'Segoe UI', system-ui, sans-serif; max-width: 100%; }
.pf-page input::placeholder, .pf-page textarea::placeholder { color: #ab94bd; }
.pf-page input[type=checkbox] { width: 17px; height: 17px; flex: 0 0 17px; accent-color: #bd88e7; margin: 2px 0; }
.pf-content { flex: 1; min-height: 0; overflow: auto; padding: 15px; scrollbar-color: #9163af #21152e; }
.pf-count { color: #cbb4df; font-size: 11px; margin: 10px 0 0; }
.pf-record { position: relative; border: 1px solid #77528f; border-radius: 12px; margin-bottom: 12px; background: linear-gradient(115deg, #2f1c40, #251a30); }
.pf-record.pf-selected { border-color: #e0b0fc; box-shadow: inset 4px 0 #d6a0f9; background: #4c2c63; }
.pf-record[data-severity=review] { border-right: 3px solid #b99a62; }
.pf-record[data-severity=staged] { border-right: 3px solid #92cfa5; }
.pf-record .pf-record-select { display: block; width: 100%; padding: 16px; text-align: left; background: none; border: 0; font-weight: 400; }
.pf-record .pf-record-select:hover { background: #9b5fc51a; }
.pf-record strong { color: white; font-size: 14px; display: inline; }
.pf-record p { font-size: 12px; line-height: 1.65; color: #e1cceb; margin: 10px 0 0; white-space: pre-wrap; }
.pf-record small { display: block; color: #bfa6d2; font-size: 10px; margin-top: 8px; }
.pf-badge { display: inline-block; margin: 0 0 0 10px; padding: 3px 8px; border-radius: 20px; border: 1px solid #9b8250; color: #ffe1a5; background: #493826; font-size: 9px; vertical-align: middle; }
.pf-row-actions { display: flex; gap: 7px; padding: 0 12px 12px; }
.pf-row-actions button { min-height: 29px; padding: 3px 12px; }
.pf-inspector h3 { font-size: 15px; color: #edddfa; margin: 3px 0 14px; }
.pf-field { display: flex; flex-direction: column; gap: 7px; margin: 0 0 16px; color: #f1e2fa; font-size: 12px; font-weight: 600; }
.pf-field :is(input, textarea, select) { width: 100%; font-weight: 400; }
.pf-field textarea { resize: vertical; min-height: 90px; }
.pf-field.pf-checkbox { flex-direction: row-reverse; align-items: flex-start; justify-content: flex-end; gap: 10px; }
.pf-field.pf-checkbox span { flex: 1; }
.pf-settings { border-top: 1px solid #805798; padding-top: 14px; margin-top: 20px; }
.pf-settings summary { color: #e0b5fc; font-size: 12px; font-weight: 700; cursor: pointer; margin-bottom: 15px; }
.pf-scope { padding: 15px 18px; margin: 16px 0 0; border: 1px solid #69467f; border-radius: 10px; background: #24192e; font-size: 12px; color: #d6c0e4; line-height: 1.8; }
.pf-inspector .pf-scope { border: 0; padding: 10px 0 0; background: none; font-size: 11px; }
.pf-muted { color: #c6acd9; font-size: 11px; line-height: 1.8; }
.pf-inspector blockquote { margin: 12px 0; padding: 12px; border-left: 3px solid #c68deb; background: #1b1127; font-size: 11px; }
.pf-metadata { font: 10px/1.7 ui-monospace, monospace; white-space: pre-wrap; padding: 10px; background: #1b1025; border-radius: 8px; }
.pf-preview { display: grid; gap: 18px; }
.pf-paper { padding: 28px; background: #fffdfd; color: #302038; border-radius: 8px; min-width: 0; }
.pf-paper h2, .pf-paper h3, .pf-paper h4 { color: #704392; margin: 0 0 16px; }
.pf-paper p, .pf-paper li { font: 14px/1.8 Georgia, serif; color: #302038; }
.pf-paper small { display: block; color: #806b89; }
.pf-paper pre { white-space: pre-wrap; font: 12px/1.7 ui-monospace, monospace; }
.pf-paper dt { font-weight: 700; color: #72468c; }
.pf-paper dd { margin: 0 0 15px; }
.pf-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.pf-document-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pf-document-table td { border: 1px solid #baabc4; padding: 10px; white-space: pre-wrap; }
.pf-document-table .pf-table-heading { background: #e9dff3; font-weight: 700; }
.pf-centered { text-align: center; padding: 45px 0; }
.pf-prewrap { white-space: pre-wrap; }
.pf-figure-placeholder { padding: 40px 20px; text-align: center; background: #eee5f5; color: #684383; border: 1px dashed #a989bc; margin: 15px 0; }
.pf-export-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pf-export-card { padding: 18px; border: 1px solid #7a558f; border-radius: 12px; background: #2c1b3a; }
.pf-export-card h3 { margin: 0 0 10px; color: #e7c0ff; font-size: 15px; }
.pf-export-card p { color: #cbb1dc; font-size: 12px; line-height: 1.7; margin: 0 0 16px; }
.pf-footer { display: flex; justify-content: space-between; gap: 20px; padding: 12px 15px; background: #2b1e37; border-top: 1px solid #7a538f; font-size: 11px; }
.pf-footer small { color: #c0a4d3; font-size: 10px; }
.pf-footer [data-tone=error] { color: #ffb4be; }
.pf-footer [data-tone=success] { color: #a9dfc2; }
.pf-notice { border-bottom: 1px solid #b3677a; padding: 12px 16px; color: #ffdae0; background: #51283b; font-size: 13px; }
.pf-empty { max-width: 650px; text-align: center; margin: auto; padding: 55px 30px; color: #c9b0dd; }
.pf-empty span { display: block; font-size: 45px; color: #d5a1f7; }
.pf-empty h2 { color: #ecd8fb; font-size: 24px; }
.pf-empty p { line-height: 1.9; }
.pf-workspace dialog { max-width: 480px; padding: 25px; border-radius: 14px; border: 1px solid #b27ed1; background: #2d1c3c; color: #f7ebff; }
.pf-workspace dialog::backdrop { background: #100918b0; }
.pf-workspace dialog button { margin: 10px 8px 0 0; }
.pf-workspace:fullscreen, .pf-workspace.pf-focus { width: 100vw; height: 100dvh; min-height: 0; max-height: none; border-radius: 0; }
.pf-workspace.pf-focus { position: fixed; inset: 0; z-index: 10000; }
[data-pf=files-toggle], [data-pf=details-toggle] { display: none !important; }
@media (max-width: 1250px) {
  .pf-body { grid-template-columns: 170px minmax(0, 1fr) 280px; }
  .pf-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-compare { grid-template-columns: 1fr; }
}
@media (max-width: 1149px) {
  .pf-body { grid-template-columns: 185px minmax(0, 1fr); }
  .pf-inspector { position: absolute; display: none; right: 0; top: 0; bottom: 0; width: min(360px, 95%); z-index: 5; box-shadow: -15px 0 35px #0008; padding-top: 20px; }
  .pf-details-open .pf-inspector { display: block; }
  .pf-inspector .pf-panel-close, [data-pf=details-toggle] { display: inline-flex !important; }
}
@media (max-width: 700px) {
  .pf-hero { grid-template-columns: 1fr; padding: 23px 20px; gap: 0; }
  .pf-hero-art { display: none; }
  .pf-body { grid-template-columns: minmax(0, 1fr); }
  .pf-nav { position: absolute; display: none; left: 0; top: 0; bottom: 0; width: min(300px, 95%); z-index: 5; box-shadow: 15px 0 35px #0008; }
  .pf-files-open .pf-nav { display: block; }
  .pf-nav .pf-panel-close, [data-pf=files-toggle] { display: inline-flex !important; }
  .pf-toolbar, .pf-viewbar { padding: 10px; gap: 8px; }
  .pf-toolbar .pf-actions { gap: 6px; flex: 1 0 100%; }
  .pf-toolbar .pf-actions:last-child { flex: 1 0 100%; }
  .pf-toolbar .pf-actions:last-child button:last-child { margin-left: auto; }
  .pf-page button, .pf-file { padding: 8px 10px; font-size: 11px; min-height: 37px; }
  .pf-tabs { order: -1; flex: 1 0 100%; }
  .pf-tabs button { flex: 1; min-width: 0; }
  .pf-workspace { min-height: 680px; height: 88vh; }
  .pf-workspace:fullscreen, .pf-workspace.pf-focus { min-height: 0; height: 100dvh; }
  .pf-content, .pf-metrics { padding: 11px; }
  .pf-metrics { gap: 7px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pf-metrics div { padding: 9px; }
  .pf-metrics b { font-size: 20px; }
  .pf-metrics small { font-size: 8px; margin-top: 5px; }
  .pf-footer { gap: 8px; padding: 9px 11px; }
  .pf-footer small { display: none; }
  .pf-export-grid { grid-template-columns: 1fr; }
  .pf-record .pf-record-select { padding: 13px; }
  .pf-badge { margin: 8px 0 0; display: table; }
  .pf-paper { padding: 20px; }
  .pf-inspector { width: min(360px, 96%); }
}
@media (prefers-reduced-motion: reduce) {
  .pf-page *, .pf-page *::before, .pf-page *::after { scroll-behavior: auto !important; transition: none !important; }
}
