/* ============================================================================
 * Publish stage: the document in the order it goes out.
 *
 * Split out of app.css on 19-08-2026 (was lines 1096-1173). Rules are the
 * originals, sliced not retyped.
 * ========================================================================== */

/* ------------------------- Publish: the document in the order it goes out */
/* An ordered list, because the running order IS the information. The numbers
   come from the <ol> rather than being written into the labels, so inserting a
   boiler renumbers everything for free. */
.pub-order { list-style: none; margin: 0; padding: 0; counter-reset: pub-step; }

.pub-order__item {
    counter-increment: pub-step;
    display: grid;
    grid-template-columns: 1.9rem 1fr;
    gap: 0.5rem;
    align-items: start;
    margin-bottom: 0.4rem;
}

.pub-order__item::before {
    content: counter(pub-step);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--slate, #55648A);
    background: var(--off-white, #F7F7F8);
    border: 1px solid var(--light-silver, #E3E4E9);
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.35rem;
}

/* An <a> acting as a button that cannot be used. An anchor has no `disabled`
   attribute, so the inert state is the missing href plus this. Matches the
   look of a disabled <button> so the two read as one row of controls. */
.btn--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* The two pages a boiler always contributes, shown as a statement of what
   will print rather than as controls.

   `grid-column: 2` because the item is a two-column grid — the step number,
   then the row. As a second child this lands in column ONE by default and gets
   squeezed into the 1.9rem number gutter, one word per line. */
.pub-order__pages {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 1.25rem;
    margin-top: 0.45rem;
    font-size: 0.72rem;
    color: var(--slate, #55648A);
}

.pub-order__page { display: flex; align-items: center; gap: 0.35rem; }

.pub-order__page-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05rem;
    height: 1.35rem;
    border: 1px solid var(--soft-cyan, #C3E7F0);
    border-radius: 2px;
    background: var(--pale-cyan, #EAF7FA);
    color: var(--cyan-ink, #0A7A97);
    font-size: 0.64rem;
    font-weight: 700;
}

/* A row that carries no switch of its own — the ticks are in the table below. */
.pub-order__plain {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--light-silver, #E3E4E9);
    border-radius: 6px;
}

.pub-order__head { display: flex; align-items: center; gap: 0.45rem; }

/* "3/5" beside a row's title. What replaced a sentence when the running order
   lost its per-row descriptions: a count changes, a description does not. */
.pub-order__count {
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--slate, #55648A);
}

.note-line--tight { margin-top: 0.4rem; margin-bottom: 0; }


/* ------------------------------- one row of the running order (21-08-2026) */
/*
 * The row is a tick and a title, and they are separate controls: the tick
 * decides whether the section prints, the title opens it in the panel beside
 * the list. They were one <label> before, which is precisely why the title
 * could not be clickable — inside a label every click reaches the checkbox.
 */
.pub-row {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    border: 1px solid var(--light-silver, #E3E4E9);
    border-radius: var(--radius-btn, 8px);
    background: var(--white, #FFF);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
/* Included in the document. */
.pub-row--on { background: var(--pale-cyan, #EAF7FA); border-color: var(--soft-cyan, #C3E7F0); }

/*
 * A row with nothing behind it: a boiler prints two pages whatever anyone
 * thinks, and the estimate and its terms always print. Flatter and greyer than
 * the rest, with no pointer and no hover — the colour is the message that
 * clicking will not do anything, made before the reader clicks.
 */
.pub-row--fixed {
    background: var(--off-white, #F7F7F8);
    border-color: var(--light-silver, #E3E4E9);
    border-style: dashed;
}
.pub-row--fixed .pub-opt__label { color: var(--slate, #55648A); }

/* Open in the panel. A left bar rather than a fill: the fill already means
   "included", and one row must be able to be both. */
.pub-row--open {
    border-color: var(--cyan-ink, #0A7A97);
    box-shadow: inset 3px 0 0 var(--cyan-ink, #0A7A97);
}

.pub-row__tick {
    display: flex; align-items: center; justify-content: center;
    padding: 0.7rem 0.1rem 0.7rem 0.7rem;
    cursor: pointer;
}
/* Keeps the column width when a row has no tick, so every title starts on the
   same vertical line whether or not it can be switched off. */
.pub-row__tick--none { width: 1.55rem; }
/* The reset that matters. Without it the global `input { width: 100% }`
   stretches the box across the row and pushes the title to the far edge. */
.pub-row__tick input { width: auto; flex: none; margin: 0; }

.pub-row__body {
    flex: 1;
    display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
    padding: 0.7rem 0.8rem;
    background: none;
    border: 0;
    font: inherit;
    text-align: left;
    color: inherit;
}
.pub-row__body--open { cursor: pointer; }
.pub-row__body--open:hover .pub-opt__label { color: var(--cyan-ink, #0A7A97); }
.pub-row__body--open:hover .pub-row__chev { color: var(--cyan-ink, #0A7A97); transform: translateX(2px); }

/* Pushed to the far end: it points AT the panel, so it belongs at the edge
   nearest to it. */
.pub-row__chev {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--light-silver, #E3E4E9);
    transition: color 0.15s ease, transform 0.15s ease;
}
.pub-row--open .pub-row__chev { color: var(--cyan-ink, #0A7A97); }

/* ------------------------------------------- the running order + its panel */
/*
 * Two columns, and the only row on the stage. The detail gets the wide side:
 * the list is a column of one-line rows, while the panel is where the reading
 * and the typing actually happen.
 *
 * The right column follows the reader down a long panel rather than scrolling
 * off the top of it — a data-sheet table is taller than seven rows.
 */
/*
 * The right column: the running order, then Print underneath it.
 *
 * The list says what is in the envelope and the button sends it, which is the
 * order those two are used in — so Print sits directly below the last thing in
 * the list rather than above it in a card of its own.
 *
 * The COLUMN is sticky, not the list inside it, so the Print button travels
 * with the running order when a long panel is scrolled beside it. Sticking the
 * list alone would have left Print pinned to the bottom of a scrolled page.
 */
.pub-side {
    position: sticky;
    top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.pub-side > .section-block { margin-bottom: 0; }

/* Stacked, the list has to come FIRST: it is what you choose from, and a
   detail panel above the thing that drives it reads back to front. */
@media (max-width: 1100px) {
    .pub-doc-row--detail > .pub-side { order: -1; position: static; }
}

/* The narrow column makes every word count: the step number, the title, the
   chip and the count all share 19rem. Tighter padding and a smaller chip buy
   the title its line back. */
.pub-manifest .pub-order__item { grid-template-columns: 1.5rem 1fr; gap: 0.35rem; }
.pub-manifest .pub-order__item::before { width: 1.25rem; height: 1.25rem; font-size: 0.66rem; }
.pub-manifest .pub-row__body { padding: 0.55rem 0.5rem; gap: 0.3rem; }
.pub-manifest .pub-row__tick { padding: 0.55rem 0.1rem 0.55rem 0.5rem; }
.pub-manifest .pub-opt__label { font-size: 0.76rem; }
.pub-manifest .badge--region { font-size: 0.6rem; padding: 0.1rem 0.3rem; }
.pub-manifest .pub-order__pages { font-size: 0.68rem; gap: 0.2rem 0.6rem; }

/* ------------------------------------ Cover design picker, in the dialog */
/*
 * Tiles side by side rather than a dropdown: the choice is visual, and a closed
 * select hides the alternatives behind a click. Falls to one column when there
 * is not room, where they would be unreadably tight.
 *
 * It was a card on the Publish stage until 21-08-2026 and is now raised by
 * Print — the decision is taken on the way to the printer, so it is asked
 * there. The rules are unchanged; only where they apply moved.
 */
.pub-covers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.6rem;
    margin-top: 0.6rem;
}
.pub-cover { align-items: flex-start; }

/* --------------------------------------------- Cover design + Print, in a row */
/*
 * The cover choice and the button that prints it, side by side (20-08-2026).
 * The picker takes the room it needs for its tiles; the Print card is a fixed
 * narrow column, because two equal halves would give a card holding two buttons
 * as much of the window as one holding the whole choice.
 *
 * align-items:start so the short card does not stretch to the picker's height
 * and float its buttons in the middle of an empty panel.
 */
.pub-doc-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 19rem);
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
}
/* The gap owns the spacing here; the cards' own bottom margin would double it. */
.pub-doc-row > .section-block { margin-bottom: 0; }

/*
 * Stacked full width below this, so neither is squeezed into a column too
 * narrow for its contents.
 *
 * The breakpoint is on the WINDOW but the constraint is on the content area,
 * and the sidebar takes about 250px of the difference. Set at 900px the row
 * stayed two-up in a 1000px window with 700px of content, which left the cover
 * picker too narrow to put its two tiles side by side — the pair looked
 * squeezed while the media query still thought there was room.
 */
@media (max-width: 1100px) {
    .pub-doc-row { grid-template-columns: 1fr; }
}

/*
 * Full-width buttons in a column. Side by side they would wrap unpredictably in
 * a 19rem card — and the count on the ZIP button ("Download attachments (7)")
 * makes its width depend on the proposal, which is exactly the wrong thing to
 * hang a layout on.
 *
 * Same effect as the .btn--block utility, applied by the container rather than
 * by each button: the ZIP link composes its own class attribute at render time,
 * and a layout that depends on that string staying right is a layout that
 * breaks the next time somebody edits it.
 */
.pub-print__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
/*
 * Which cover the dialog will open on. A statement, not a control — the picker
 * is in the dialog — so it is set as quietly as the card's other prose and sits
 * under the buttons it describes.
 */
.pub-print__cover {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.7rem;
    font-size: 0.72rem;
    color: var(--slate, #55648A);
}
.pub-print__cover i { color: var(--light-silver, #E3E4E9); }

/* The cap is for the stacked layout: full width of a card that is now the width
   of the page turns Print into a 660px bar, which reads as a banner rather than
   as a button. Inside the 19rem card it never applies. */
.pub-print__actions .btn {
    width: 100%;
    max-width: 22rem;
    justify-content: center;
}

/*
 * WHY PRINT IS REFUSED, on the card that holds the button.
 *
 * A button that cannot be pressed and nothing beside it saying why is the worst
 * state this card can be in. The full authorisation card is in the Commercial
 * panel, next to the discount that caused it; this line says the fact and opens
 * that card, so the detail is one click away rather than duplicated.
 *
 * A button, not a banner: it does something, and it has to look as though it
 * does or nobody will press it.
 */
.pub-print__blocked {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    width: 100%;
    margin-top: 0.7rem;
    padding: 0.5rem 0.6rem;
    /* The same red the refused authorisation card is edged with, and the same
       wash the below-dose cells use — this is that state, said briefly. */
    border: 1px solid var(--logout-red, #e05c5c);
    border-radius: var(--radius-btn, 8px);
    background: var(--warn-cell, #fbe3e3);
    font: inherit;
    font-size: 0.72rem;
    line-height: 1.45;
    text-align: left;
    color: #8f2f2f;
    cursor: pointer;
}

.pub-print__blocked:hover { background: #f8d6d6; }
.pub-print__blocked i { margin-top: 0.12rem; flex: none; }

/* Reads as the link it is, and stays on the last line of the reason rather than
   claiming a column of its own in a 19rem card. */
.pub-print__blocked-go {
    margin-left: auto;
    flex: none;
    font-weight: 700;
    text-decoration: underline;
}

/* ------------------------------------------ the action bar above the tabs */
/*
 * Tabs on the left, everything you can DO on the right. Added 20-08-2026 when
 * the Publish stage was split into "Cover & Document" and "Data Sheets &
 * Certificates": the buttons belong to the whole stage, not to either tab, so
 * they sit on the tab row rather than inside one of the panels.
 */
.pubbar {
    display: flex; align-items: center; gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}
.pubbar .tabs { flex-wrap: wrap; }
/* With the sub-tabs gone the bar holds only Finish and the status icon, and
   `margin-left: auto` on the actions has nothing to push away from — so the row
   is given its own right alignment rather than leaving them adrift on the left. */
.pubbar--actions-only { justify-content: flex-end; }
/* margin-left:auto rather than justify-content, so that when the row wraps on
   a narrow window the buttons drop to their own line instead of stretching. */
.pubbar__actions {
    margin-left: auto;
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}

/* ------------------------------------------------- the print-status panel */
.pubinfo { position: relative; display: inline-flex; }
.pubinfo__btn {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.4rem 0.55rem; border-radius: 6px; cursor: pointer;
    background: var(--white, #FFF);
    border: 1px solid var(--light-silver, #E3E4E9);
    color: var(--slate, #55648A);
    font-size: 0.9rem; line-height: 1;
}
.pubinfo__btn:hover { border-color: var(--primary-blue, #0F9FC4); color: var(--cyan-ink, #0A7A97); }
/* Amber: printing works, but there is something worth doing first. */
.pubinfo__btn.is-warn { color: #8a5a00; background: #fff4dc; border-color: #f2d492; }
/* Red: printing is refused. The page carries no other sign of it, so this
   colour is doing real work rather than decorating. */
.pubinfo__btn.is-blocked { color: #96261f; background: #fdecea; border-color: #f3b7b2; }
/* The count is what makes somebody click, so it reads as a badge rather than
   as another character in the icon. It inherits the button's tone. */
.pubinfo__count {
    min-width: 1.05rem; padding: 0.05rem 0.28rem;
    border-radius: 999px;
    font-size: 0.68rem; font-weight: 700; font-variant-numeric: tabular-nums;
    text-align: center;
    background: currentColor;
    /* The digit is knocked out of the pill: the span's colour paints the pill,
       so the text needs the page's ground colour to stay legible. */
    -webkit-text-fill-color: var(--white, #FFF);
}

.pubinfo__panel {
    display: none;
    position: absolute; top: calc(100% + 0.4rem); right: 0;
    z-index: 30;
    width: min(26rem, 80vw);
    padding: 0.75rem;
    background: var(--white, #FFF);
    border: 1px solid var(--light-silver, #E3E4E9);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 30, 69, 0.14);
    text-align: left;
}
.pubinfo.is-open .pubinfo__panel { display: block; }
.pubinfo__title {
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.6px; color: var(--slate, #55648A);
    margin-bottom: 0.5rem;
}
.pubinfo__note {
    display: grid; grid-template-columns: 1rem 1fr; gap: 0.45rem;
    align-items: start;
    font-size: 0.78rem; line-height: 1.45;
    padding: 0.35rem 0; border-top: 1px solid var(--light-silver, #E3E4E9);
}
.pubinfo__note:first-of-type { border-top: none; }
.pubinfo__note--blocked { color: #96261f; }
.pubinfo__note--warn { color: #8a5a00; }
.pubinfo__note--fact { color: var(--slate, #55648A); }
.pubinfo__note i { margin-top: 0.15rem; }

/* --------------------------------------------- the introduction picker (F4) */
/*
 * One tile per introduction in the library, in the panel behind the
 * Introduction row. Stacked rather than side by side: each carries its cover
 * title and opening line, and those are sentences — two columns of prose in a
 * 26rem panel is unreadable.
 */
.pub-intros {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.6rem;
}
.pub-intro { align-items: flex-start; }
/* The opening line can be long; it wraps rather than stretching the tile. */
.pub-intro .pub-opt__help { white-space: normal; }

/*
 * The words are settled — a statement of fact, not a warning.
 *
 * The cyan note-line means "here is something to know"; this is the opposite of
 * a thing to act on, and it appears exactly where a picker or an editor used to
 * be. Neutral grey so the empty space beside it reads as closed rather than
 * broken.
 */
.note-line--settled {
    background: var(--off-white, #F7F7F8);
    border-color: var(--light-silver, #E3E4E9);
    color: var(--slate, #55648A);
}

/* --------------------------------- the covering letter, in the same panel */
/*
 * WHAT WILL PRINT, not what was written. The placeholders are already resolved
 * here, so this is set as the document sets it — a prose measure and a
 * comfortable line height — rather than as a form field. A seller reading a
 * preview in the screen's own 0.78rem UI type would be checking a paragraph
 * that looks nothing like the one going out.
 */
.pub-letter {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    line-height: 1.62;
    color: var(--text-dark, #0F1E45);
}

/* The preview is marked off as a quotation of the document rather than more of
   the screen, which is the only thing distinguishing it from the panel's own
   prose above it. */
.pub-letter--preview {
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--light-silver, #E3E4E9);
    border-left: 3px solid var(--cyan-ink, #0A7A97);
    border-radius: var(--radius-btn, 8px);
    background: var(--off-white, #F7F7F8);
}

.pub-letter__para { margin: 0 0 0.6rem; }
.pub-letter__para:last-child { margin-bottom: 0; }
.pub-letter__head {
    margin: 0 0 0.4rem;
    font-size: 0.84rem; font-weight: 700;
}
.pub-letter__list { margin: 0 0 0.6rem; padding-left: 1.1rem; }
/* Sub-bullets indented and lighter, as they print. */
.pub-letter__li--sub { margin-left: 0.9rem; list-style-type: circle; color: var(--slate, #55648A); }

/*
 * Read-only: the company's introduction, shown so it can be CHECKED, not
 * changed. Marked apart from the letter preview above by its neutral rule — the
 * cyan edge means "this proposal's own words", and these are not.
 *
 * Capped and scrolled rather than run out to full length: the seeded
 * introduction is several pages of prose, and a panel that grew to hold it
 * would push the running order beside it off the screen. The cap is generous
 * enough that most of them never scroll at all.
 */
.pub-letter--locked {
    border-left-color: var(--light-silver, #E3E4E9);
    max-height: 24rem;
    overflow-y: auto;
}

.pub-letter__editor {
    width: 100%;
    min-height: 16rem;
    font-family: inherit;
    font-size: 0.8rem;
    line-height: 1.6;
    resize: vertical;
}
