/* PageForge admin shell.
   One palette, defined once. Everything else refers to these.

   The colours are the logo's: the near-black navy of "Page", the amber-to-orange of "Forge",
   and the blue-into-violet of the icon's lower blade. The accent orange is a shade deeper than
   the logo's so white text on a button stays readable (about 4.5:1 against #e2560d). */

:root {
    --pf-bg: #f6f6fb;
    --pf-surface: #ffffff;
    --pf-border: #e5e6f0;
    --pf-ink: #101534;
    --pf-ink-soft: #5a6088;

    --pf-accent: #e2560d;
    --pf-accent-hover: #c2450a;
    --pf-accent-soft: #fff2e9;
    --pf-accent-ink: #ffffff;
    --pf-focus: rgba(255, 106, 26, .24);

    --pf-orange: #ff6a1a;
    --pf-amber: #fbb024;
    --pf-blue: #2f4df0;
    --pf-violet: #9a6cf5;
    --pf-indigo: #3b4fe0;
    --pf-indigo-soft: #eef0ff;

    /* The icon read left to right: blue blade, violet where it meets the P, then the amber-orange body. */
    --pf-brand-gradient: linear-gradient(90deg, var(--pf-blue) 0%, var(--pf-violet) 26%, var(--pf-orange) 68%, var(--pf-amber) 100%);

    --pf-sidebar: #0e1130;
    --pf-sidebar-ink: #c3c7e8;
    --pf-sidebar-active: rgba(255, 255, 255, .08);
    --pf-sidebar-line: #262b63;

    --pf-good: #17803d;
    --pf-warn: #a45c00;
    --pf-bad: #b42318;
    --pf-radius: 10px;
    --pf-shadow: 0 1px 2px rgba(27, 30, 69, .06), 0 1px 3px rgba(27, 30, 69, .1);
}

body.pf {
    margin: 0;
    background: var(--pf-bg);
    color: var(--pf-ink);
    font: 15px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* Layout ------------------------------------------------------------------ */

.pf-shell {
    display: grid;
    grid-template-columns: 232px 1fr;
    min-height: 100vh;
}

/* The icon's own gradient: the blade's blue at the top fading into the logo's navy. */
.pf-side {
    background: linear-gradient(180deg, #1b2166 0%, var(--pf-sidebar) 38%, #090b22 100%);
    color: var(--pf-sidebar-ink);
    display: flex;
    flex-direction: column;
    padding: 18px 12px;
}

.pf-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 20px;
    text-decoration: none;
}

.pf-brand img {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: block;
}

.pf-brand-word {
    color: #fff;
    font-weight: 700;
    font-size: 19px;
    letter-spacing: -.3px;
}

.pf-brand-word span {
    background: linear-gradient(90deg, var(--pf-amber), var(--pf-orange));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.pf-nav { display: flex; flex-direction: column; gap: 2px; }

.pf-nav a {
    color: var(--pf-sidebar-ink);
    text-decoration: none;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 14px;
}

.pf-nav a:hover { background: var(--pf-sidebar-active); color: #fff; }

/* The page being looked at is marked in the logo's orange, on the edge rather than as a fill. */
.pf-nav a.active {
    background: var(--pf-sidebar-active);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--pf-orange);
}

.pf-nav-label {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: .6px;
    color: #7d82ad;
    padding: 16px 10px 6px;
}

/* The switcher sits in the sidebar rather than the header because the workspace
   decides what every page below it shows, not just the one being looked at. */
.pf-switch { padding: 14px 10px 0; }

.pf-switch select {
    width: 100%;
    padding: 7px 9px;
    font: inherit;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid var(--pf-sidebar-line);
    background: #1d2150;
    color: #fff;
}

.pf-switch select:focus { outline: none; border-color: var(--pf-orange); }

.pf-side-foot { margin-top: auto; padding: 12px 10px 0; font-size: 13px; border-top: 1px solid var(--pf-sidebar-line); }
.pf-side-foot .pf-who { color: #fff; font-weight: 600; }
.pf-side-foot .pf-where { color: #9094bf; font-size: 12px; }

.pf-menu-button {
    display: grid; place-items: center; flex: 0 0 auto;
    width: 44px; height: 44px; padding: 0;
    border: 0; border-radius: 8px; background: none; color: #fff; cursor: pointer;
}
.pf-menu-button:hover { background: var(--pf-sidebar-active); }
.pf-menu-button:focus-visible { outline: 2px solid var(--pf-orange); outline-offset: -2px; }

/* A phone's bar and what closes the menu: nothing on a screen wide enough for the sidebar. */
.pf-bar, .pf-menu-scrim, .pf-menu-close { display: none; }

.pf-main { display: flex; flex-direction: column; min-width: 0; }

/* A thin band of the brand gradient along the top of every page. */
.pf-top {
    background: var(--pf-brand-gradient) top / 100% 3px no-repeat, var(--pf-surface);
    border-bottom: 1px solid var(--pf-border);
    padding: 17px 28px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.pf-top h1 { font-size: 18px; font-weight: 650; margin: 0; letter-spacing: -.2px; color: var(--pf-ink); }
.pf-content { padding: 24px 28px 48px; }
/* No cap on the width: on a wide screen a 1180px column left a third of it empty beside the reports (the owner,
   2026-10-26). Every screen now uses the width it is given; the editor and the composer always did. */

/* Links in the content in the icon's indigo; buttons keep their own colours. */
.pf-content a:not(.pf-btn) { color: var(--pf-indigo); }
.pf-content a:not(.pf-btn):hover { color: #3730a3; }

/* Cards and tables -------------------------------------------------------- */

.pf-card {
    background: var(--pf-surface);
    border: 1px solid var(--pf-border);
    border-radius: var(--pf-radius);
    box-shadow: var(--pf-shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.pf-card h2 { font-size: 15px; font-weight: 650; margin: 0 0 14px; }

/* Global rather than scoped to a card: secondary text reads the same wherever it is,
   and half the places that need it are between cards rather than inside one. */
.pf-hint { color: var(--pf-ink-soft); font-size: 13px; }

.pf-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pf-table th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--pf-ink-soft);
    padding: 0 12px 8px;
    border-bottom: 1px solid var(--pf-border);
}
.pf-table td { padding: 11px 12px; border-bottom: 1px solid var(--pf-border); vertical-align: middle; }
.pf-table tr:last-child td { border-bottom: 0; }
.pf-table code { font-size: 12px; color: var(--pf-ink-soft); }

/* A sortable table's first column names the row — a page with its tracker and LP id, a box — and needs the room to
   say it on a line or two, not four; the numbers beside it are short. */
.pf-table[data-pf-sort] td:first-child { min-width: 240px; }

/* A heading sits right above its box, and a narrow box only shows the first letter of it. */
.pf-filter-row th:not(:first-child) .pf-input::placeholder { color: transparent; }

/* The tables with a column for everything. Tighter, because a number broken over two lines ("20.9" above "%") reads
   as two numbers, and the row's name stays in view when the screen is still too narrow for all of them. */
@media (min-width: 821px) {
    .pf-table.pf-dense { font-size: 13px; }
    .pf-table.pf-dense th { padding-left: 7px; padding-right: 7px; font-size: 11px; letter-spacing: .2px; }
    .pf-table.pf-dense td { padding: 9px 7px; }
    .pf-table.pf-dense td:not(:first-child) { white-space: nowrap; }
    .pf-table.pf-dense[data-pf-sort] td:first-child { min-width: 210px; }
    .pf-table.pf-dense .pf-filter-row .pf-input { min-width: 0; box-sizing: border-box; padding-left: 5px; padding-right: 5px; }
    .pf-table.pf-dense th:first-child, .pf-table.pf-dense td:first-child { position: sticky; left: 0; z-index: 1; background: var(--pf-surface); box-shadow: 1px 0 0 var(--pf-border); }
}

/* Controls ---------------------------------------------------------------- */

.pf-field { margin-bottom: 14px; }
.pf-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }

.pf-input, .pf-select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--pf-border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
    color: var(--pf-ink);
}

.pf-input:focus, .pf-select:focus {
    outline: none;
    border-color: var(--pf-orange);
    box-shadow: 0 0 0 3px var(--pf-focus);
}

.pf-btn {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: var(--pf-accent);
    color: var(--pf-accent-ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(217, 72, 15, .25);
}

.pf-btn:hover { background: var(--pf-accent-hover); }
.pf-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--pf-focus); }
.pf-btn.pf-ghost { background: #fff; color: var(--pf-ink); border-color: var(--pf-border); box-shadow: none; }
.pf-btn.pf-ghost:hover { background: var(--pf-accent-soft); border-color: #f8c9ab; }
.pf-btn.pf-danger { background: var(--pf-bad); box-shadow: none; }
.pf-btn.pf-danger:hover { background: #912018; }
.pf-btn.pf-sm { padding: 6px 11px; font-size: 13px; }

.pf-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.pf-row > * { flex: 1 1 180px; }
.pf-row > .pf-shrink { flex: 0 0 auto; }

/* Status ------------------------------------------------------------------ */

.pf-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #eeeff6;
    color: var(--pf-ink-soft);
}

.pf-badge.good { background: #e7f6ec; color: var(--pf-good); }
.pf-badge.warn { background: #fdf3e2; color: var(--pf-warn); }
.pf-badge.bad { background: #fdecea; color: var(--pf-bad); }
.pf-badge.busy { background: var(--pf-indigo-soft); color: var(--pf-indigo); }

/* A page as a tracker knows it: the tracker, and the landing page's id there (the owner, 2026-10-26). */
.pf-badge.tracker { background: #e6f0ff; color: #1d4ed8; }
.pf-badge.lp { background: var(--pf-accent-soft); color: var(--pf-accent); font-weight: 700; }
.pf-tracker-place { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; margin: 2px 8px 2px 0; }
.pf-tracker-place .pf-lp-name { font-size: 12px; color: var(--pf-ink-soft); }

.pf-note {
    border-radius: var(--pf-radius);
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 14px;
    border: 1px solid var(--pf-border);
    background: #fff;
}

.pf-note.info { border-color: #d6d3fa; background: #f5f4ff; }
.pf-note.warn { border-color: #f3d9a6; background: #fdf8ec; color: var(--pf-warn); }
.pf-note.bad { border-color: #f4c7c2; background: #fdf2f1; color: var(--pf-bad); }
.pf-error { color: var(--pf-bad); font-size: 13px; }

.pf-progress { height: 6px; background: #e9eaf2; border-radius: 999px; overflow: hidden; }
.pf-progress > div { height: 100%; background: linear-gradient(90deg, var(--pf-orange), var(--pf-amber)); width: 0; transition: width .4s ease; }

/* Label/value pairs. A grid rather than a table because these are facts about one
   thing, not rows of comparable things. */
.pf-facts { display: grid; grid-template-columns: 190px 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.pf-facts dt { color: var(--pf-ink-soft); font-size: 13px; }
.pf-facts dd { margin: 0; }

.pf-countdown { font-size: 17px; font-weight: 650; color: var(--pf-accent); }
.pf-countdown.over { font-size: 14px; font-weight: 400; color: var(--pf-ink-soft); }

.pf-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* A form kept closed until asked for, opened from a button-looking summary. */
.pf-inline-form > summary { list-style: none; }
.pf-inline-form > summary::-webkit-details-marker { display: none; }
.pf-inline-form[open] > summary { background: var(--pf-accent-soft); border-color: #f8c9ab; }

/* Editor ------------------------------------------------------------------ */

/* The page being edited needs the width; the usual reading column would squeeze it. */

.pf-editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.pf-editor-stage { position: sticky; top: 12px; }
.pf-editor-frame {
    width: 100%;
    height: calc(100vh - 150px);
    border: 1px solid var(--pf-border);
    border-radius: var(--pf-radius);
    background: #fff;
    display: block;
}
.pf-editor-panel .pf-input { box-sizing: border-box; }
.pf-editor-panel textarea { resize: vertical; }
.pf-code { font: 12px/1.45 ui-monospace, Consolas, monospace; }
.pf-section-list { display: flex; flex-direction: column; gap: 2px; max-height: 40vh; overflow: auto; }
.pf-section-list button {
    text-align: left;
    background: none;
    border: 0;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    color: var(--pf-ink);
}
.pf-section-list button:hover { background: var(--pf-accent-soft); }
.pf-section-list button[draggable="true"] { cursor: grab; }
.pf-section-list button.pf-dragging { opacity: .45; background: var(--pf-indigo-soft); }

/* Composer: the lineup and the library beside the preview. */
.pf-lineup { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow: auto; }
.pf-lineup-item {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: start;
    padding: 8px; border: 1px solid var(--pf-border); border-radius: 8px; background: #fff; cursor: grab;
}
.pf-lineup-item.pf-dragging { opacity: .45; background: var(--pf-indigo-soft); }
.pf-reorder-handle { display: none; }
.pf-phone-only { display: none; }
.pf-lineup-item img, .pf-library-head img { width: 56px; height: 42px; object-fit: cover; border-radius: 4px; border: 1px solid var(--pf-border); }
.pf-lineup-text { min-width: 0; }
.pf-lineup-title {
    display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; font: inherit;
    font-weight: 600; color: var(--pf-ink); cursor: pointer; overflow-wrap: anywhere;
}
.pf-lineup-title:hover { color: var(--pf-accent); }
.pf-lineup-problem { color: var(--pf-bad); font-size: 12px; margin-top: 2px; }
.pf-lineup-actions { display: flex; gap: 2px; }
.pf-lineup-actions .pf-btn { padding: 2px 7px; }
.pf-library { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow: auto; }
.pf-library-item { border: 1px solid var(--pf-border); border-radius: 8px; padding: 8px; }
.pf-library-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: start; }
.pf-library-variant {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center;
    margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--pf-border);
}

/* The editor's top bar ------------------------------------------------------
   How the draft stands, what can be taken back, and publishing — in that order, with the
   status pushed away from the controls so a message never shifts them about. */

.pf-editor-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pf-editor-status { color: var(--pf-ink-soft); font-size: 13px; min-width: 90px; text-align: right; }

/* Undo and redo read as one control, because they are one. */
.pf-btn-group { display: inline-flex; }
.pf-btn-group .pf-btn { border-radius: 0; margin-left: -1px; }
.pf-btn-group .pf-btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.pf-btn-group .pf-btn:last-child { border-radius: 0 8px 8px 0; }
.pf-btn-group .pf-btn:disabled { color: var(--pf-ink-soft); opacity: .55; cursor: default; background: #fff; }

.pf-switch {
    display: inline-flex; gap: 7px; align-items: center; white-space: nowrap;
    font-size: 13px; color: var(--pf-ink-soft);
    padding: 5px 10px; border: 1px solid var(--pf-border); border-radius: 999px; background: #fff;
    cursor: pointer;
}
.pf-switch:hover { border-color: #f8c9ab; background: var(--pf-accent-soft); }
.pf-switch input { margin: 0; }

/* Choosing a box ------------------------------------------------------------
   A window of its own: choosing a box is looking at boxes, and the strip down the side of the
   panel showed them three centimetres wide (the owner, 2026-09-23). */

/* Both classes, because the plain .pf-dialog width is declared further down and would otherwise win. */
.pf-dialog.pf-dialog-wide { width: min(1180px, calc(100% - 40px)); }
.pf-picker { display: flex; flex-direction: column; max-height: min(86vh, 900px); }

.pf-picker-head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
    padding: 22px 22px 14px;
    background: var(--pf-brand-gradient) top / 100% 3px no-repeat;
}
.pf-picker-head h2 { font-size: 17px; margin: 0 0 4px; }
.pf-picker-head p { margin: 0; }

.pf-picker-filters {
    display: grid; gap: 10px; padding: 0 22px 14px;
    grid-template-columns: minmax(190px, 1.6fr) repeat(auto-fit, minmax(130px, 1fr));
    border-bottom: 1px solid var(--pf-border);
}
.pf-picker-filters .pf-field { margin-bottom: 0; }
.pf-picker-filters .pf-input, .pf-picker-filters .pf-select { padding: 7px 9px; font-size: 13px; }

.pf-picker-grid {
    display: grid; gap: 12px; padding: 16px 22px; overflow: auto;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    align-content: start;
}

.pf-picker-foot { padding: 12px 22px 18px; border-top: 1px solid var(--pf-border); }

.pf-box-card {
    display: flex; flex-direction: column; gap: 8px;
    text-align: left; background: #fff; color: var(--pf-ink);
    border: 1px solid var(--pf-border); border-radius: 10px; padding: 9px;
    font: inherit; font-size: 13px; cursor: pointer;
}
.pf-box-card:hover { background: var(--pf-accent-soft); border-color: #f8c9ab; }
.pf-box-card:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--pf-focus); }

/* Capped rather than scaled: a box screenshot can be very tall, and one card growing to fit
   one leaves the row around it full of white. */
.pf-box-card-thumb {
    width: 100%; height: 150px; object-fit: cover; object-position: top;
    border: 1px solid var(--pf-border); border-radius: 7px; background: #fff; display: block;
}
.pf-box-card-blank {
    display: flex; align-items: center; justify-content: center;
    color: var(--pf-ink-soft); font-size: 12px; background: #fafaff;
}
.pf-box-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* Narrowing a grid as you type ----------------------------------------------
   A row of boxes under the headings, one per column. Lighter than the headings above it, so the
   table still reads as a table and not as a form. */

.pf-filter-row th { padding: 6px 12px 10px; background: var(--pf-surface); border-bottom: 1px solid var(--pf-border); }
.pf-filter-row .pf-input { width: 100%; font-weight: 400; padding: 5px 8px; font-size: 12px; }

/* A category, opened ---------------------------------------------------------
   The slug is the way in: pressed, it shows the boxes filed under it and where each would send
   a visitor. A plain button that reads as the code it replaced, so nothing on the row moves. */

.pf-slug {
    border: 1px dashed transparent; border-radius: 6px; padding: 1px 4px;
    background: none; font: inherit; cursor: pointer; color: inherit;
}
.pf-slug:hover { border-color: #f8c9ab; background: var(--pf-accent-soft); }
.pf-slug:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--pf-focus); }

.pf-offer-row {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    padding: 8px 0; border-bottom: 1px dashed var(--pf-border);
}
.pf-offer-row .pf-input { flex: 1 1 260px; min-width: 0; }

/* The ones worth adding: a language its pages are in that nothing covers. */
.pf-offer-missing { background: #fff8f4; border-radius: 8px; padding: 8px; }

/* One screen, several places ------------------------------------------------
   A screen that is ten cards deep is a screen you scroll rather than read. The tabs are in the
   page, so moving between them costs nothing and never loses what was typed in another one. */

.pf-tabs {
    display: flex; gap: 4px; flex-wrap: wrap;
    border-bottom: 1px solid var(--pf-border); margin-bottom: 18px;
}

/* A tab is a button where the page switches in place, and a link where each one is its own address with its
   own paging — the logs. Both read the same. */
.pf-tabs button, .pf-tabs .pf-tab-link {
    border: 1px solid transparent; border-bottom: none;
    border-radius: 8px 8px 0 0; padding: 9px 14px; margin-bottom: -1px;
    background: none; color: var(--pf-ink-soft); font: inherit; font-weight: 600; cursor: pointer;
    text-decoration: none; display: inline-block;
}
.pf-tabs button:hover, .pf-tabs .pf-tab-link:hover { color: var(--pf-ink); background: var(--pf-accent-soft); }
.pf-tabs button:focus-visible, .pf-tabs .pf-tab-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--pf-focus); }

.pf-tabs button[aria-selected="true"], .pf-tabs .pf-tab-link[aria-selected="true"] {
    color: var(--pf-ink); background: var(--pf-surface);
    border-color: var(--pf-border); border-bottom: 1px solid var(--pf-surface);
}

.pf-tab[hidden] { display: none; }

/* Folded away until it is wanted ------------------------------------------
   A list where every row is open at once is a list nobody can find anything on. What each row
   is stays readable while it is shut; opening one is a click on its own line. */

.pf-fold { border-top: 1px solid var(--pf-border); }
.pf-fold > summary {
    cursor: pointer; padding: 13px 2px; list-style-position: outside;
}
.pf-fold > summary:hover { background: var(--pf-accent-soft); }
.pf-fold > summary::marker { color: var(--pf-ink-soft); }
.pf-fold[open] > summary { border-bottom: 1px dashed var(--pf-border); margin-bottom: 12px; }

/* Inline-flex rather than flex: a flex summary loses its own marker in several browsers. */
.pf-fold-head { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pf-fold > :last-child { margin-bottom: 14px; }

/* The workspace's own files ------------------------------------------------ */

.pf-file-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.pf-file {
    display: flex; flex-direction: column; gap: 7px;
    border: 1px solid var(--pf-border); border-radius: 10px; padding: 10px; font-size: 13px;
}

/* Checked, so a favicon on a dark background is still visible and a logo's transparency reads as transparency. */
.pf-file-preview {
    width: 100%; height: 110px; object-fit: contain; border-radius: 7px;
    background: repeating-conic-gradient(#f2f2f6 0% 25%, #fff 0% 50%) 50% / 16px 16px;
    border: 1px solid var(--pf-border);
}
.pf-file-name { display: flex; gap: 5px; }
.pf-file-name .pf-input { min-width: 0; }

/* Choosing which snippets go on a page ------------------------------------- */

.pf-snippet-pick {
    display: flex; gap: 9px; align-items: flex-start;
    padding: 7px 8px; border: 1px solid var(--pf-border); border-radius: 8px;
    margin-bottom: 6px; cursor: pointer; font-size: 13px;
}
.pf-snippet-pick:hover { background: var(--pf-accent-soft); border-color: #f8c9ab; }
.pf-snippet-pick input { margin: 2px 0 0; }
.pf-snippet-pick span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pf-snippet-pick strong { overflow-wrap: anywhere; }
.pf-box-card-text strong { overflow-wrap: anywhere; }

@media (max-width: 1100px) {
    .pf-editor { grid-template-columns: 1fr; }
    .pf-editor-stage { position: relative; }
}

/* Capped rather than scaled: a box screenshot can be very tall, and a row that grows to
   fit one makes the list unreadable. */
.pf-thumb {
    width: 76px;
    max-height: 96px;
    object-fit: cover;
    object-position: top;
    border: 1px solid var(--pf-border);
    border-radius: 6px;
    background: #fff;
    display: block;
}

/* Fields size to their box with padding and border included; content-box let a 100%-wide field
   stick out past the edge of its card. */
.pf-input, .pf-select { box-sizing: border-box; }

/* The icon is transparent now, so it sits on the sidebar as it is: no plate, no edge. */
.pf-brand img { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45)); }

/* Asking before something cannot be undone ---------------------------------
   In the page, in the app's own colours. The browser's own confirm box looked like the page
   had broken (the owner, 2026-09-16), and it cannot say which button is the dangerous one. */

.pf-dialog {
    border: 0;
    padding: 0;
    width: min(460px, calc(100% - 32px));
    border-radius: 14px;
    background: var(--pf-surface);
    color: var(--pf-ink);
    box-shadow: 0 30px 70px rgba(8, 9, 30, .38);
}

/* Publishing: Basic and Advanced side by side, each with its own button (the owner, 2026-10-05). The dialog is widened
   for the two of them; both classes, so this wins over the plain width above. */
.pf-dialog.pf-dialog-publish { width: min(680px, calc(100% - 32px)); }
.pf-publish-modes {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-top: 16px;
}
.pf-publish-mode {
    display: flex; flex-direction: column; gap: 8px;
    border: 1px solid var(--pf-border); border-radius: 12px; padding: 14px 16px; background: var(--pf-surface);
}
.pf-publish-mode h3 { margin: 0; font-size: 16px; }
.pf-publish-mode ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.45; flex: 1; }
.pf-publish-mode .pf-btn { align-self: flex-start; }
.pf-publish-advanced { border-color: var(--pf-accent); background: var(--pf-accent-soft); }
.pf-favicon-now { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; min-height: 32px; }
.pf-favicon-now img { width: 32px; height: 32px; object-fit: contain; border: 1px solid var(--pf-border); border-radius: 6px; padding: 2px; background: #fff; }
.pf-favicon-now .pf-hint { word-break: break-all; }
.pf-publish-startover { display: flex; align-items: flex-start; gap: 6px; margin: 0 0 10px; }
.pf-publish-startover input { margin-top: 3px; }

.pf-dialog::backdrop { background: rgba(10, 12, 35, .55); }

/* The brand band as a background, as on the top of every page: a gradient border-image paints
   nothing when only one side has a width. */
.pf-dialog-body { padding: 25px 22px 18px; background: var(--pf-brand-gradient) top / 100% 3px no-repeat; }
.pf-dialog h2 { font-size: 16px; margin: 0 0 8px; }
.pf-dialog p { margin: 0; font-size: 14px; color: var(--pf-ink-soft); overflow-wrap: anywhere; }
.pf-dialog .pf-actions { justify-content: flex-end; padding: 14px 22px 18px; }

/* What a click carried --------------------------------------------------------
   The parameters are most of an offer link's length and all of its meaning, so they are
   set apart from the address rather than run together with it: name quiet, value plain,
   each pair readable on its own. */

/* Lists of clicks and conversions: a row reads down from its top, and the parameters are what the row is for. Their
   first column is a time, not a name, so the room a name needs would push the parameters off the side of the screen. */
.pf-table.pf-list td { vertical-align: top; }
.pf-table.pf-list[data-pf-sort] td:first-child { min-width: 100px; }
.pf-table.pf-list .pf-filter-row .pf-input { min-width: 0; box-sizing: border-box; }
.pf-list-wide { min-width: 460px; }

.pf-params { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

.pf-param {
    display: inline-flex; align-items: baseline; gap: 4px;
    padding: 1px 6px; border: 1px solid var(--pf-border); border-radius: 6px;
    font-size: 11px; background: var(--pf-bg); max-width: 100%;
}

.pf-param-name { color: var(--pf-ink-soft); }
.pf-param-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }

/* A category, read from a report ---------------------------------------------
   Read-only, and separate from the window that edits categories: a report is not a place
   to change what it is reporting on. */

.pf-plain { list-style: none; padding: 0; }

.pf-cat-boxes { display: grid; gap: 10px; }

.pf-cat-box {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 10px; border: 1px solid var(--pf-border); border-radius: 8px;
    font-size: 13px;
}

/* The pace of the traffic ----------------------------------------------------
   One chart per measure, because views and clicks differ by an order of magnitude and a
   second scale in one frame would make their crossings mean something they do not. The
   axis sits outside the drawing, so the times keep their own type size however wide the
   plot is drawn. Used on the overview, on a page version and on a box. */

.pf-pace { margin-bottom: 18px; }
.pf-pace-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 4px; }
.pf-pace-plot { display: block; width: 100%; height: 110px; overflow: visible; }
.pf-pace-plot g:hover path { opacity: .72; }
.pf-pace-axis { position: relative; height: 16px; margin-top: 2px; }

.pf-pace-axis span {
    position: absolute; transform: translateX(-50%);
    font-size: 11px; color: var(--pf-ink-soft); white-space: nowrap;
}
.pf-pace-axis span:first-child { transform: none; }

/* A thumbnail looked at properly -------------------------------------------
   The picture is the window: it takes the width it was taken at, and the frame
   is only as wide as the picture rather than a 460-pixel card with a stamp in it. */

.pf-dialog.pf-zoom { width: auto; max-width: min(96vw, 900px); }
.pf-zoom-body { padding: 0; background: var(--pf-brand-gradient) top / 100% 3px no-repeat; }

.pf-zoom-image {
    display: block;
    max-width: min(96vw, 900px);
    max-height: 84vh;
    margin: 3px auto 0;
    background: #fff;
    cursor: zoom-out;
}

.pf-zoom-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 10px 14px 12px; font-size: 13px; color: var(--pf-ink-soft);
}
.pf-zoom-caption { overflow-wrap: anywhere; }

/* Something to press on, and a hint that pressing does anything. */
.pf-thumb { cursor: zoom-in; }
.pf-thumb:hover { border-color: var(--pf-accent); }

/* Opens with the page rather than on top of it: a short rise, and nothing at all for
   anyone who asked their system for less movement. */
.pf-dialog[open] { animation: pf-dialog-in .14s ease-out; }

@keyframes pf-dialog-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Something is happening: a turning circle, and over the editor's preview a veil that says what. */
.pf-spinner {
    display: inline-block;
    width: 34px;
    height: 34px;
    border: 4px solid var(--pf-border);
    border-top-color: var(--pf-accent);
    border-radius: 50%;
    animation: pf-spin .8s linear infinite;
    vertical-align: middle;
}
.pf-spinner-sm { width: 14px; height: 14px; border-width: 2px; }

/* Typing into a drop-down to filter it (2026-10-08). The select stays, out of sight, as the field's source of truth. */
.pf-combo { position: relative; display: block; min-width: 0; }
.pf-combo[hidden] { display: none; }
.pf-combo-native {
    position: absolute !important; left: 0; bottom: 0; width: 1px !important; height: 1px !important;
    opacity: 0; pointer-events: none; padding: 0 !important; border: 0 !important;
}
.pf-combo-input {
    width: 100%; cursor: text; padding-right: 30px !important; text-overflow: ellipsis;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%235a6088' stroke-width='1.6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
}
.pf-combo-list {
    position: fixed; z-index: 10000; overflow: auto; padding: 4px; margin: 0;
    background: var(--pf-surface); color: var(--pf-ink); border: 1px solid var(--pf-border); border-radius: 10px;
    box-shadow: 0 12px 32px rgba(16, 21, 52, .16);
}
.pf-combo-list[hidden] { display: none; }
.pf-combo-item { padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.pf-combo-item[aria-selected="true"] { font-weight: 600; }
.pf-combo-item.pf-active { background: var(--pf-accent-soft); }
.pf-combo-item.pf-combo-disabled { color: var(--pf-ink-soft); cursor: default; }
.pf-combo-group { padding: 8px 10px 3px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--pf-ink-soft); }
.pf-combo-empty { padding: 8px 10px; color: var(--pf-ink-soft); font-size: 13px; }

/* A box made from nothing (2026-10-08). */
.pf-box-maker { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .pf-box-maker { grid-template-columns: 1fr; } }
.pf-box-body { min-height: 140px; height: auto; line-height: 1.55; overflow-wrap: anywhere; }
.pf-box-body:focus { outline: none; box-shadow: 0 0 0 3px var(--pf-focus); }
.pf-box-preview-card { position: sticky; top: 16px; }
.pf-box-preview { border: 1px solid var(--pf-border); border-radius: 12px; padding: 16px; background: #fff; color: #1d2433; }
.pf-box-preview h3 { margin: 8px 0 4px; font-size: 18px; line-height: 1.3; }
.pf-box-preview-badge { display: inline-block; background: #fff3cd; color: #7a5200; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.pf-box-preview-badge[hidden] { display: none; }
.pf-box-preview-picture { display: block; width: 100%; max-height: 220px; object-fit: contain; border-radius: 8px; margin: 8px 0; background: #f6f7f9; }
.pf-box-preview-rating { color: #e8a317; font-size: 14px; }
.pf-box-preview-body { font-size: 14px; line-height: 1.55; margin: 8px 0 12px; }
.pf-box-preview-button { display: inline-block; background: #e8590c; color: #fff; border-radius: 8px; padding: 9px 16px; font-weight: 700; }
.pf-box-preview-button[hidden] { display: none; }

/* The page's details in the editor (2026-10-07). */
.pf-meta-group { margin: 0 0 8px; }
.pf-meta-group > summary { cursor: pointer; font-weight: 600; margin: 0 0 8px; }
.pf-meta-field { margin-bottom: 10px; }
.pf-meta-field label { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.pf-meta-field label code { font-size: 11px; }
.pf-meta-count { margin-left: auto; }

/* The library's own pages, edited in place (2026-10-07). */
.pf-page-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.pf-page-tools { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pf-page-tools[hidden] { display: none; }
.pf-page-canvas, .pf-page-source {
    display: block; width: 100%; height: 70vh; min-height: 420px;
    border: 1px solid var(--pf-border); border-radius: 8px; background: #fff;
}
.pf-page-canvas[hidden], .pf-page-source[hidden] { display: none; }
.pf-page-source { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; line-height: 1.5; padding: 12px; resize: vertical; }
.pf-btn:disabled .pf-spinner-sm { border-color: rgba(255, 255, 255, .45); border-top-color: currentColor; }

.pf-busy {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: var(--pf-radius);
    background: color-mix(in srgb, var(--pf-surface) 72%, transparent);
    color: var(--pf-ink);
    font-weight: 600;
}
.pf-busy[hidden] { display: none; }

@keyframes pf-spin { to { transform: rotate(360deg); } }

/* A row changed in the background (data-pf-stay) while the screen's answer comes back. */
.pf-waiting {
    opacity: .45;
    pointer-events: none;
    animation: pf-waiting 1.2s ease-in-out infinite alternate;
}

@keyframes pf-waiting { to { opacity: .2; } }

@media (prefers-reduced-motion: reduce) {
    .pf-dialog[open] { animation: none; }
    .pf-spinner { animation-duration: 2.4s; }
    .pf-waiting { animation: none; }
}

/* Sign-in ----------------------------------------------------------------- */

/* The icon's colours as light: indigo from the top left, the orange glow from the bottom right. */
.pf-auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(900px 560px at 88% 112%, rgba(242, 101, 34, .42) 0%, rgba(242, 101, 34, 0) 62%),
        radial-gradient(1000px 640px at 8% -12%, rgba(67, 56, 202, .85) 0%, rgba(67, 56, 202, 0) 58%),
        #121433;
    padding: 24px;
}

.pf-auth-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 14px;
    padding: 30px 28px;
    box-shadow: 0 24px 56px rgba(8, 9, 30, .45);
}

.pf-auth-logo { display: block; width: 210px; max-width: 100%; height: auto; margin: 0 auto 22px; }
.pf-auth-card h1 { font-size: 20px; margin: 0 0 4px; letter-spacing: -.3px; }
.pf-auth-card .pf-sub { color: var(--pf-ink-soft); font-size: 13px; margin-bottom: 22px; }

@media (max-width: 820px) {
    /* Two rows or a short page would stretch the bar to share the height with the content. */
    .pf-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }

    /* A grid item is min-width:auto by default, so it grows to fit its contents and the overflow:auto below it
       never comes into play — which is how a row of twelve links pushed the whole page 150px wider than the
       phone it was on (the owner, 2026-09-24). Allowed to shrink, everything else can then behave. */
    .pf-shell > * { min-width: 0; }

    .pf-bar {
        display: flex; align-items: center; gap: 4px;
        position: sticky; top: 0; z-index: 40;
        padding: 4px 10px 4px 6px; background: var(--pf-sidebar);
    }
    .pf-bar .pf-brand { padding: 0; }
    .pf-bar .pf-brand img { width: 28px; height: 28px; }
    .pf-bar .pf-brand-word { font-size: 17px; }

    /* The whole sidebar with its groups, the workspace and Sign out, over the page instead of above it. Hidden as
       well as moved away, or the keyboard would walk through links nobody can see. */
    .pf-side {
        position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
        width: min(300px, 84vw); box-sizing: border-box; padding: 14px 12px 18px;
        overflow-y: auto; overscroll-behavior: contain;
        box-shadow: 0 0 40px rgba(8, 9, 30, .5);
        transform: translateX(-100%); visibility: hidden;
        transition: transform .2s ease, visibility 0s linear .2s;
    }
    .pf-menu-open .pf-side { transform: none; visibility: visible; transition: transform .2s ease; }

    .pf-menu-close { display: grid; position: absolute; top: 8px; right: 8px; }

    .pf-menu-scrim {
        display: block; position: fixed; inset: 0; z-index: 45;
        background: rgba(8, 9, 30, .55); opacity: 0; pointer-events: none; transition: opacity .2s ease;
    }
    .pf-menu-open .pf-menu-scrim { opacity: 1; pointer-events: auto; }

    /* The page stays where it was underneath. */
    body.pf-menu-open { overflow: hidden; }

    /* A finger, not a pointer. */
    .pf-nav { margin-bottom: 16px; }
    .pf-nav a { padding: 11px 12px; font-size: 15px; }

    .pf-content { padding: 18px 14px 40px; }
    .pf-top { padding: 15px 14px 12px; }

    /* A table is the one thing that cannot be made narrow, so it is the one thing allowed to scroll. */
    .pf-table { min-width: 560px; }
    .pf-card { overflow-x: auto; }

    /* The row's name stays in view while the numbers scroll under it: otherwise a phone shows a column of numbers
       with nothing to say whose they are. */
    .pf-table[data-pf-sort] th:first-child,
    .pf-table[data-pf-sort] td:first-child {
        position: sticky; left: 0; z-index: 1; background: var(--pf-surface);
        min-width: 160px; max-width: 200px; box-shadow: 1px 0 0 var(--pf-border);
    }
    /* A number broken over two lines ("2.9" above "%") reads as two numbers. */
    .pf-table[data-pf-sort] td:not(:first-child) { white-space: nowrap; }

    /* A list is words, not numbers: kept on one line a click's row came to 2,175px. And its first column is a time,
       which says nothing about the row and would take half the screen standing still. */
    .pf-table.pf-list[data-pf-sort] td.pf-wrap { white-space: normal; min-width: 170px; }
    .pf-table.pf-list[data-pf-sort] td.pf-list-wide, .pf-table.pf-list th.pf-list-wide { min-width: 300px; }
    .pf-table.pf-list[data-pf-sort] th:first-child, .pf-table.pf-list[data-pf-sort] td:first-child {
        position: static; min-width: 90px; box-shadow: none;
    }

    .pf-phone-only { display: block; }
    .pf-desktop-only { display: none; }

    /* Moving boxes. Dragged by a handle only, so a finger anywhere else still scrolls the screen. */
    .pf-reorder-handle {
        display: flex; align-items: center; justify-content: center; align-self: stretch;
        width: 28px; font-size: 22px; line-height: 1; color: var(--pf-ink-soft);
        cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
    }

    /* The live lineup: a box is one line of a list, what it can do opens from it. */
    .pf-slots-card { padding-left: 10px; padding-right: 10px; }
    .pf-slots { list-style: none; margin: 0; padding: 0; }
    .pf-slots.pf-busy { opacity: .6; pointer-events: none; }
    .pf-slot {
        display: grid; grid-template-columns: 28px 20px 46px minmax(0, 1fr) 44px; gap: 5px 6px; align-items: center;
        padding: 7px 0; border-bottom: 1px solid var(--pf-border); background: var(--pf-surface);
    }
    .pf-slot:last-child { border-bottom: 0; }
    .pf-slot > .pf-reorder-handle { grid-column: 1; grid-row: 1 / span 2; }
    .pf-slot-no { grid-column: 2; grid-row: 1 / span 2; }
    .pf-slot-pic { grid-column: 3; grid-row: 1; }
    .pf-slot-body { display: contents; }
    .pf-slot-open { grid-column: 4; grid-row: 1; }
    .pf-slot-tools { grid-column: 3 / 5; grid-row: 2; }
    .pf-slot-move { grid-column: 5; grid-row: 1 / span 2; }
    .pf-slot.off .pf-slot-no, .pf-slot.off .pf-slot-pic, .pf-slot.off .pf-slot-open { opacity: .5; }
    .pf-slot.pf-dragging { background: var(--pf-accent-soft); box-shadow: 0 2px 10px rgba(27, 30, 69, .22); position: relative; z-index: 2; }
    .pf-slot-no { font-weight: 700; font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
    .pf-slot-pic { display: block; width: 46px; height: 46px; object-fit: cover; border-radius: 6px; border: 1px solid var(--pf-border); background: var(--pf-bg); box-sizing: border-box; }
    .pf-slot-tools { display: flex; gap: 5px; }
    .pf-slot-tools form { margin: 0; }
    .pf-slot-tools .pf-btn { display: inline-flex; align-items: center; height: 30px; box-sizing: border-box; padding: 0 9px; font-size: 12.5px; line-height: 1; }
    .pf-slot-open { display: block; width: 100%; min-width: 0; padding: 0; border: 0; background: none; font: inherit; color: var(--pf-ink); text-align: left; cursor: pointer; }
    .pf-slot-title {
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
        font-size: 13.5px; font-weight: 600; line-height: 1.25;
    }
    .pf-slot-facts { display: block; font-size: 12px; color: var(--pf-ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
    .pf-slot-move { display: flex; flex-direction: column; gap: 3px; margin: 0; }
    .pf-slot-move .pf-btn { width: 44px; height: 32px; padding: 0; font-size: 16px; }
    .pf-slot:first-child [data-pf-step="-1"], .pf-slot:last-child [data-pf-step="1"] { opacity: .3; pointer-events: none; }

    /* What a box can do: rises from the bottom, in reach of a thumb. */
    .pf-dialog.pf-sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 14px 14px 0 0; max-height: 86vh; overflow: auto; }
    .pf-sheet .pf-dialog-body { padding: 20px 14px 18px; }
    .pf-sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
    .pf-sheet-head h2 { margin: 0; }
    .pf-sheet-box { padding: 10px 0; border-top: 1px solid var(--pf-border); }
    .pf-sheet-numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0; font-size: 13px; }
    .pf-sheet-numbers strong { display: block; font-size: 15px; }
    .pf-sheet .pf-actions { gap: 6px; justify-content: flex-start; padding: 0; margin: 8px 0 0; flex-wrap: wrap; }
    .pf-sheet .pf-row { margin: 8px 0 0; gap: 6px; align-items: center; flex-wrap: nowrap; }
    .pf-sheet form { margin: 0; }

    /* The composer's boxes: the same handle and arrows, and no list that scrolls inside a screen that scrolls. */
    #pf-composer .pf-editor-frame { height: 44vh; }
    #pf-composer .pf-lineup { max-height: none; overflow: visible; }
    .pf-editor-panel .pf-card { padding-left: 10px; padding-right: 10px; }
    .pf-lineup-item { grid-template-columns: 28px 46px minmax(0, 1fr) auto; gap: 6px; align-items: center; cursor: default; padding: 6px 4px; }
    .pf-lineup-item img { width: 46px; height: 46px; grid-column: 2; }
    .pf-lineup-text { grid-column: 3; }
    .pf-lineup-title { font-size: 13.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .pf-lineup-actions { grid-column: 4; display: grid; grid-auto-flow: column; grid-template-rows: 32px 32px; grid-auto-columns: auto; gap: 3px; }
    .pf-lineup-actions .pf-btn { padding: 0; width: 40px; }
    .pf-lineup-actions .pf-btn:nth-child(3) { grid-row: 1 / span 2; width: 30px; }
    .pf-lineup-item:first-child .pf-lineup-actions .pf-btn:nth-child(1),
    .pf-lineup-item:last-child .pf-lineup-actions .pf-btn:nth-child(2) { opacity: .3; pointer-events: none; }

    /* Room to read: a dialog on a phone is the screen, and the filter bar stacks rather than squeezing. */
    .pf-dialog, .pf-dialog.pf-dialog-wide { width: calc(100% - 20px); }
    .pf-picker-filters { grid-template-columns: 1fr; }
    .pf-picker-grid { grid-template-columns: 1fr 1fr; }
}

/* Narrower still: one box across, and the actions stop trying to share a line. */
@media (max-width: 520px) {
    .pf-picker-grid, .pf-file-grid { grid-template-columns: 1fr; }
    .pf-row > * { flex: 1 1 100%; }
    .pf-top { flex-wrap: wrap; gap: 8px; }
    .pf-top h1 { font-size: 18px; }
}

/* The lineup's box picker (layout-picker.js): every box with its picture, a click adds it. */
.pf-box-picker .pf-dialog-body { max-height: calc(100vh - 80px); display: flex; flex-direction: column; }
.pf-pick-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px;
    overflow-y: auto; min-height: 200px; padding: 2px;
}
.pf-pick-card {
    display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer;
    border: 1px solid var(--pf-border); border-radius: 10px; padding: 8px; background: var(--pf-surface); color: var(--pf-ink);
    font: inherit;
}
.pf-pick-card:hover, .pf-pick-card:focus-visible { border-color: var(--pf-accent); box-shadow: 0 0 0 2px var(--pf-accent-soft); }
.pf-pick-card[hidden] { display: none; }
.pf-pick-card img, .pf-pick-nopic {
    width: 100%; height: 130px; object-fit: cover; object-position: top; border-radius: 6px; background: #f1f3f5; display: block;
}
.pf-pick-nopic { display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--pf-ink-soft); }
.pf-pick-title { font-size: 13px; font-weight: 600; line-height: 1.3; display: block; }
.pf-pick-meta { font-size: 12px; color: var(--pf-ink-soft); display: block; overflow-wrap: anywhere; }
.pf-box-under { min-height: 56px; }
.pf-box-preview-under { margin-top: 6px; font-size: 13px; color: var(--pf-ink-soft); }
.pf-box-preview-under:empty { display: none; }

/* Something is being done (working.js): a bar along the top, a word in the corner, the pressed button turning. */
.pf-working-bar {
    position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 10000; overflow: hidden;
    pointer-events: none; opacity: 0; transition: opacity .15s;
}
.pf-working-bar::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%;
    background: var(--pf-brand-gradient); animation: pf-working-slide 1.1s ease-in-out infinite;
}
@keyframes pf-working-slide { to { left: 100%; } }
.pf-working-pill {
    position: fixed; right: 18px; bottom: 18px; z-index: 10000; display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 999px; background: #1f2340; color: #fff; font-size: 13px; font-weight: 600;
    box-shadow: 0 10px 30px rgba(8, 9, 30, .3); pointer-events: none; opacity: 0; transform: translateY(8px);
    transition: opacity .15s, transform .15s;
}
.pf-working-spin {
    width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
    animation: pf-spin .8s linear infinite;
}
html.pf-working .pf-working-bar, html.pf-working .pf-working-pill { opacity: 1; transform: none; }
html.pf-working body { cursor: progress; }
.pf-btn-working { pointer-events: none; opacity: .8; }
.pf-btn-working::after {
    content: ""; display: inline-block; width: 11px; height: 11px; margin-left: 8px; vertical-align: -1px; border-radius: 50%;
    border: 2px solid currentColor; border-top-color: transparent; animation: pf-spin .8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
    .pf-working-bar::before { animation-duration: 3s; }
    .pf-working-spin, .pf-btn-working::after { animation-duration: 2.4s; }
    .pf-side, .pf-menu-open .pf-side, .pf-menu-scrim { transition: none; }
}

/* The overview. */
.pf-dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pf-dash-head h1 { font-size: 22px; font-weight: 700; margin: 0 0 2px; letter-spacing: -.01em; }

.pf-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 20px; }
.pf-tile { background: var(--pf-surface); border: 1px solid var(--pf-border); border-radius: var(--pf-radius); box-shadow: var(--pf-shadow); padding: 16px 18px; min-width: 0; }
.pf-tile-label { font-size: 12px; font-weight: 600; color: var(--pf-ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.pf-tile-value { display: block; font-size: 24px; white-space: nowrap; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; margin-top: 6px; color: var(--pf-ink); text-decoration: none; font-variant-numeric: tabular-nums; }
a.pf-tile-value:hover { color: var(--pf-accent); }
.pf-tile-note { font-size: 12.5px; color: var(--pf-ink-soft); margin-top: 4px; }
.pf-change { font-weight: 650; margin-right: 4px; }
.pf-change.up { color: var(--pf-good); }
.pf-change.down { color: var(--pf-bad); }

.pf-dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.pf-dash-grid.even { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
@media (max-width: 980px) { .pf-dash-grid { grid-template-columns: minmax(0, 1fr); } }

.pf-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pf-card-head h2 { margin: 0; }

.pf-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--pf-ink-soft); }
.pf-key { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--pf-blue); vertical-align: middle; margin-right: 6px; }
.pf-key.before { border-top: 2px dashed #7a80a3; }

.pf-trend { position: relative; }
.pf-trend + .pf-trend { margin-top: 14px; }
.pf-trend-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.pf-trend-head .pf-hint { font-weight: 400; font-size: 12.5px; }
.pf-trend svg { display: block; width: 100%; height: auto; touch-action: none; }
.pf-trend-grid { stroke: var(--pf-border); stroke-width: 1; }
.pf-trend-grid.base { stroke: #cfd2e2; }
.pf-trend-label { font-size: 10px; fill: var(--pf-ink-soft); font-variant-numeric: tabular-nums; }
.pf-trend-now { fill: none; stroke: var(--pf-blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pf-trend-before { fill: none; stroke: #7a80a3; stroke-width: 1.5; stroke-dasharray: 4 4; stroke-linejoin: round; }
.pf-trend-area { fill: var(--pf-blue); fill-opacity: .08; }
.pf-trend-cross { stroke: var(--pf-ink-soft); stroke-width: 1; }
.pf-trend-cross[hidden], .pf-trend-dot[hidden] { display: none; }
.pf-trend-dot { fill: var(--pf-blue); stroke: var(--pf-surface); stroke-width: 2; }
.pf-trend-tip { position: absolute; top: 28px; left: 0; z-index: 2; pointer-events: none; background: var(--pf-surface); border: 1px solid var(--pf-border); border-radius: 8px; box-shadow: 0 4px 14px rgba(27, 30, 69, .12); padding: 7px 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pf-trend-tip .pf-hint { font-size: 12px; font-weight: 400; }

.pf-split { display: flex; gap: 2px; height: 12px; margin: 2px 0 12px; }
.pf-split span { min-width: 3px; flex-basis: 0; }
.pf-split span:first-child { border-radius: 4px 0 0 4px; }
.pf-split span:last-child { border-radius: 0 4px 4px 0; }
.pf-split .clean, .pf-split-legend i.clean { background: var(--pf-good); }
.pf-split .soft, .pf-split-legend i.soft { background: var(--pf-amber); }
.pf-split .bot, .pf-split-legend i.bot { background: var(--pf-bad); }
.pf-split-legend { display: grid; gap: 6px; font-size: 13px; }
.pf-split-legend div { display: flex; align-items: center; gap: 8px; }
.pf-split-legend i { width: 10px; height: 10px; border-radius: 3px; }
.pf-split-legend strong { margin-left: auto; font-variant-numeric: tabular-nums; }

.pf-rank { display: grid; gap: 9px; margin-top: 8px; }
.pf-rank-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; font-size: 13px; }
.pf-rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-rank-count { color: var(--pf-ink-soft); font-variant-numeric: tabular-nums; }
.pf-rank-track { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--pf-bg); overflow: hidden; }
.pf-rank-track span { display: block; height: 100%; border-radius: 4px; background: var(--pf-indigo); }

.pf-gaps { display: grid; gap: 12px; }
.pf-gap { display: flex; gap: 12px; align-items: flex-start; }
.pf-gap > .pf-badge { min-width: 34px; justify-content: center; }
.pf-gap a { text-decoration: none; }
.pf-gap a:hover strong { text-decoration: underline; }

.pf-mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 12px; }
.pf-mini-stats strong { display: block; font-size: 20px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.pf-mini-stats span { font-size: 12.5px; color: var(--pf-ink-soft); }

.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-chip { padding: 7px 12px; border: 1px solid var(--pf-border); border-radius: 999px; font-size: 13px; color: var(--pf-ink-soft); text-decoration: none; }
.pf-chip strong { color: var(--pf-ink); }
.pf-chip[href]:hover { border-color: var(--pf-accent); color: var(--pf-ink); }

/* Parts of the overview while they load. */
.pf-part-loading { display: flex; align-items: center; gap: 10px; min-height: 96px; color: var(--pf-ink-soft); font-size: 13px; }
.pf-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--pf-border); border-top-color: var(--pf-accent); animation: pf-spin .8s linear infinite; }
@keyframes pf-spin { to { transform: rotate(360deg); } }
.pf-shimmer { height: 26px; width: 70%; margin-top: 8px; border-radius: 6px; background: linear-gradient(90deg, var(--pf-bg) 25%, var(--pf-border) 50%, var(--pf-bg) 75%); background-size: 200% 100%; animation: pf-shimmer 1.3s linear infinite; }
.pf-shimmer.short { height: 12px; width: 50%; }
@keyframes pf-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .pf-spin, .pf-shimmer { animation: none; } }
.pf-part-failed { display: flex; align-items: center; gap: 10px; color: var(--pf-ink-soft); font-size: 13px; }
.pf-bot-share { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.pf-bot-share strong { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
