/* ===================================================================
   WyfoldShipping, Bulk Cargo Tracker

   The look, second pass.

   Will named four sites he likes on 1 September: uni-tankers.com ("I
   like this clean and straight forward"), scorpiotankers.com ("quiet
   without being too much"), feadship.nl ("will no doubt be impressive")
   and edmiston.com ("like the look of it"). He also sent his own
   dashboard picture on 28 July.

   The first pass kept the restraint of those sites and lost their
   presence, so it came out plain. What gives them presence is three
   things, and this pass does all three:

   1. Bold uppercase type with wide letter spacing. It is exactly what
      his own wordmark does, WYFOLD over SHIPPING, so the headings use
      Montserrat set the same way.
   2. Solid blocks of deep navy. The bar, the table headings and the
      port rail carry it, and the page stays light so a ledger read all
      day is easy on the eye.
   3. Real contrast between large and small type, and between the
      page and white cards that sit on it with a soft shadow.

   From his dashboard picture: vessel names in bold, Import and Export
   as outlined pills, and status as a coloured dot with its name.

   The card and form structure follows Leon's Daveng portal, recoloured
   for Wyfold. Every colour is a token below, so a darker theme like
   his dashboard picture is a change of values rather than a rewrite.

   Still meant to be done again properly once his designer delivers.
   =================================================================== */

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../lib/fonts/montserrat-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../lib/fonts/montserrat-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* --- Deep navy, the brand colour. The bar, table headings and rail. --- */
    --wf-navy:          #0f1b33;
    --wf-navy-mid:      #16284a;
    --wf-navy-soft:     #1f3358;
    --wf-navy-ink:      #14223f;

    /* --- The one accent, teal from his dashboard picture. --- */
    --wf-teal:          #14707b;
    --wf-teal-deep:     #0e565f;
    --wf-teal-bright:   #1f9aa8;
    --wf-teal-glow:     #4fc3d0;

    /* --- Ink, lines and ground. --- */
    --wf-text:          #1d2433;
    --wf-text-muted:    #637083;
    --wf-text-faint:    #97a1b0;
    --wf-line:          #e3e8f0;
    --wf-line-soft:     #eef2f7;
    --wf-surface:       #ffffff;
    --wf-canvas:        #f3f6fa;

    /* --- Soft tints for pills and notes. --- */
    --wf-tint-teal:     #e4f3f5;
    --wf-tint-amber:    #fdf1e3;
    --wf-tint-violet:   #efecfb;
    --wf-tint-green:    #e7f5ec;
    --wf-tint-red:      #fdecec;
    --wf-tint-slate:    #eef1f5;

    --wf-amber:         #c46a1c;
    --wf-violet:        #6b5bc4;
    --wf-green:         #2f8a55;
    --wf-slate:         #6b7686;
    --wf-danger:        #c9302c;

    /* --- Shape and depth. --- */
    --wf-radius:        10px;
    --wf-radius-sm:     6px;
    --wf-radius-pill:   999px;
    --wf-shadow:        0 1px 2px rgba(15, 27, 51, 0.05), 0 4px 16px rgba(15, 27, 51, 0.07);
    --wf-shadow-hover:  0 2px 4px rgba(15, 27, 51, 0.06), 0 12px 28px rgba(15, 27, 51, 0.13);
    --wf-shadow-lg:     0 18px 50px rgba(15, 27, 51, 0.22);

    /* --- Type. --- */
    --wf-font-head:     'Montserrat', 'Segoe UI', Helvetica, Arial, sans-serif;
    --wf-font-body:     'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;

    /* --- The names the rest of this file already uses, kept pointing at the new
           values so the dashboard, rail and import styles below carry on working. --- */
    --accent:           var(--wf-teal);
    --accent-dark:      var(--wf-teal-deep);
    --accent-bright:    var(--wf-teal-glow);
    --accent-soft:      var(--wf-tint-teal);
    --navy:             var(--wf-navy);
    --navy-soft:        var(--wf-navy-soft);
    --ink:              var(--wf-text);
    --ink-soft:         var(--wf-text-muted);
    --ink-faint:        var(--wf-text-faint);
    --line:             var(--wf-line);
    --page:             var(--wf-canvas);

    /* --- Bootstrap follows the theme. --- */
    --bs-body-bg:       var(--wf-canvas);
    --bs-body-color:    var(--wf-text);
    --bs-border-color:  var(--wf-line);
    --bs-primary:       var(--wf-teal);
    --bs-link-color:    var(--wf-teal);
}

/* --- Base --- */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 15px;
    }
}

body {
    margin-bottom: 64px;
    font-family: var(--wf-font-body);
    background-color: var(--wf-canvas);
    color: var(--wf-text);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--wf-teal);
}

a:hover {
    color: var(--wf-teal-deep);
}

/* --- The bar --- */
/* Deep navy with a faint lift towards the right, which is the solid colour block the
   reference sites lead with. */
.navbar-portal {
    background: linear-gradient(100deg, var(--wf-navy) 0%, var(--wf-navy-mid) 100%);
    padding-top: 0;
    padding-bottom: 0;
    min-height: 58px;
    box-shadow: 0 2px 14px rgba(15, 27, 51, 0.18);
}

.navbar-portal-brand {
    color: #ffffff !important;
    font-family: var(--wf-font-head);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 12px 20px 12px 0;
}

.navbar-portal-brand:hover {
    color: var(--wf-teal-glow) !important;
}

.navbar-portal-link {
    color: rgba(255, 255, 255, 0.78) !important;
    font-family: var(--wf-font-head);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 20px 14px !important;
    white-space: nowrap;
    position: relative;
}

.navbar-portal-link:hover,
.navbar-portal-link:focus {
    color: #ffffff !important;
}

/* A teal rule under the link you point at, rather than a filled box. */
.navbar-portal-link::before {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 12px;
    height: 2px;
    border-radius: 2px;
    background: var(--wf-teal-glow);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.navbar-portal-link:hover::before,
.navbar-portal-link:focus::before {
    transform: scaleX(1);
}

.navbar-portal .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar-portal .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-portal-dropdown {
    background-color: var(--wf-navy);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--wf-radius-sm);
    box-shadow: var(--wf-shadow-lg);
    min-width: 190px;
    padding: 6px 0;
    margin-top: 0 !important;
}

.navbar-portal-dropdown-item {
    color: rgba(255, 255, 255, 0.82) !important;
    font-size: 0.85rem;
    padding: 9px 18px;
}

.navbar-portal-dropdown-item:hover,
.navbar-portal-dropdown-item:focus {
    color: #ffffff !important;
    background-color: rgba(79, 195, 208, 0.12);
}

.navbar-portal-dropdown .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.12);
}

.navbar-brand {
    white-space: normal;
    display: flex;
    align-items: center;
}

/* --- Headings --- */
/* The page heading is set like his wordmark: bold, uppercase and widely spaced, and
   large enough to anchor the page. */
h4 {
    font-family: var(--wf-font-head);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--wf-navy);
    margin-bottom: 0.5rem;
}

h5 {
    font-family: var(--wf-font-head);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--wf-navy);
}

h6 {
    font-family: var(--wf-font-head);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--wf-navy);
}

/* Under the page heading, a short teal rule rather than a line across the page. Only the
   rule straight after a page heading gets this. A rule used anywhere else to divide one
   part of a page from the next stays a plain, faint line. */
main hr {
    border: 0;
    border-top: 1px solid var(--wf-line);
    opacity: 1;
    margin: 1.4rem 0;
}

main h4 + hr {
    border-top: 0;
    height: 2px;
    width: 44px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--wf-teal-bright), var(--wf-teal-glow));
    margin: 0 0 1.6rem 0;
}

/* A small spaced label above a heading, as the reference sites do. */
.wf-eyebrow {
    display: block;
    font-family: var(--wf-font-head);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--wf-teal);
    margin-bottom: 4px;
}

/* --- Focus --- */
.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--wf-teal-bright);
    box-shadow: 0 0 0 0.2rem rgba(31, 154, 168, 0.18);
    outline: none;
}

/* --- Buttons --- */
/* One primary button per page, teal with a soft glow that lifts when you point at it. */
.btn {
    border-radius: var(--wf-radius-sm);
    font-weight: 600;
    transition: all 0.18s ease;
}

.btn-sm {
    font-size: 0.8rem;
    padding: 7px 15px;
}

.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--wf-teal-bright), var(--wf-teal));
    border: none;
    box-shadow: 0 2px 8px rgba(20, 112, 123, 0.28);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--wf-teal), var(--wf-teal-deep));
    box-shadow: 0 4px 14px rgba(20, 112, 123, 0.36);
    transform: translateY(-1px);
}

.btn-secondary {
    color: var(--wf-text);
    background: var(--wf-surface);
    border: 1px solid var(--wf-line);
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
    color: var(--wf-teal-deep);
    background: var(--wf-tint-teal);
    border-color: rgba(20, 112, 123, 0.35);
}

.btn-danger {
    color: #ffffff;
    background: var(--wf-danger);
    border: 1px solid var(--wf-danger);
}

.btn-danger:hover,
.btn-danger:focus {
    color: #ffffff;
    background: #a52622;
    border-color: #a52622;
}

/* --- Form controls --- */
.form-control,
.form-select {
    border-color: var(--wf-line);
    border-radius: var(--wf-radius-sm);
    font-size: 0.875rem;
    color: var(--wf-text);
    background-color: var(--wf-surface);
}

.form-label,
.col-form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--wf-text);
}

.form-check-input:checked {
    background-color: var(--wf-teal);
    border-color: var(--wf-teal);
}

.form-text {
    color: var(--wf-text-muted);
    font-size: 0.78rem;
}

.text-danger {
    color: var(--wf-danger) !important;
    font-size: 0.8rem;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* --- Cards --- */
/* A white card that sits on the page with a soft shadow and no border. The heading is
   small, bold and spaced, with a short teal bar in front of it. */
.wf-card,
.card {
    background: var(--wf-surface);
    border: none;
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow);
}

.wf-card {
    padding: 24px;
    margin-bottom: 16px;
}

.wf-card-heading {
    font-family: var(--wf-font-head);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--wf-navy);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--wf-line);
    display: flex;
    align-items: center;
    gap: 8px;
}

.wf-card-heading::before {
    content: '';
    width: 3px;
    height: 14px;
    background: linear-gradient(180deg, var(--wf-teal-glow), var(--wf-teal));
    border-radius: var(--wf-radius-pill);
    flex-shrink: 0;
}

/* One field: label, box, message, then any help line. */
.wf-field {
    margin-bottom: 16px;
}

.wf-field > .form-label {
    margin-bottom: 5px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--wf-text-muted);
}

.wf-field .form-text {
    margin-top: 5px;
}

/* The bar under the cards with Save and Cancel on the left and Delete on the right. */
.wf-form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 16px;
    background: var(--wf-surface);
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow);
}

.wf-capture {
    padding-bottom: 32px;
}

/* A line of plain fact inside a card: a muted label on the left, the value on the right. */
.wf-rows {
    margin: 0;
}

.wf-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px solid var(--wf-line-soft);
    font-size: 0.875rem;
}

.wf-row:last-child {
    border-bottom: none;
}

.wf-row-label {
    color: var(--wf-text-muted);
    font-size: 0.8rem;
    flex: 0 0 auto;
}

.wf-row-value {
    font-weight: 600;
    color: var(--wf-text);
    text-align: right;
    overflow-wrap: anywhere;
}

.wf-row-value.is-empty {
    color: var(--wf-text-faint);
    font-weight: 400;
}

.wf-muted {
    color: var(--wf-text-muted);
    font-size: 0.82rem;
}

/* --- Pills and status --- */
/* Import and Export as outlined pills, the way his dashboard picture shows them. */
.wf-pill {
    display: inline-block;
    font-family: var(--wf-font-head);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
    padding: 3px 8px;
    border-radius: var(--wf-radius-sm);
    border: 1px solid currentColor;
    white-space: nowrap;
}

.wf-pill.is-import  { color: var(--wf-teal);   background: var(--wf-tint-teal); }
.wf-pill.is-export  { color: var(--wf-amber);  background: var(--wf-tint-amber); }
.wf-pill.is-coastal { color: var(--wf-violet); background: var(--wf-tint-violet); }
.wf-pill.is-other   { color: var(--wf-slate);  background: var(--wf-tint-slate); }

/* A completed voyage: muted on the ledger and in the vessel history, and named in the
   detail box. The row still opens like any other. */
.wf-pill.is-complete { color: var(--wf-slate); background: var(--wf-tint-slate); }
tr.is-complete td { color: var(--wf-text-muted); }
tr.is-complete td .wf-status,
tr.is-complete td .wf-pill { opacity: 0.6; }
.history-complete {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--wf-slate);
}

/* Status as a coloured dot and its name. */
.wf-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--wf-font-head);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--wf-text);
    white-space: nowrap;
}

.wf-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--wf-slate);
    flex-shrink: 0;
}

.wf-status.is-fixed::before  { background: var(--wf-green); box-shadow: 0 0 0 3px rgba(47, 138, 85, 0.16); }
.wf-status.is-subs::before   { background: var(--wf-amber); box-shadow: 0 0 0 3px rgba(196, 106, 28, 0.16); }
.wf-status.is-cargo::before  { background: var(--wf-violet); }
.wf-status.is-failed::before { background: var(--wf-danger); }
.wf-status.is-failed         { color: var(--wf-text-muted); }

/* --- Tables --- */
/* A table never scrolls sideways. It takes the width of the page and fits its columns
   to it, cutting a long value with dots instead of pushing the table wider. The whole
   of every value is one click away in the detail box. Sideways scroll bars inside a
   table were what made the ledger hard to use. */
.table-wrapper,
.table-responsive {
    background: var(--wf-surface);
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow);
}

.table {
    font-size: 0.85rem;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
    width: 100%;
}

.table.table-fit {
    table-layout: fixed;
}

/* The heading stays at the top of the window while you scroll the page, and the table
   has no scrolling box of its own. */
.table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: linear-gradient(90deg, var(--wf-navy) 0%, var(--wf-navy-mid) 100%);
    color: #ffffff;
    font-family: var(--wf-font-head);
    font-weight: 700;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: none;
    padding: 11px 12px;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table thead tr:first-child th:first-child { border-top-left-radius: var(--wf-radius); }
.table thead tr:first-child th:last-child  { border-top-right-radius: var(--wf-radius); }

.table thead th a {
    color: #ffffff;
    text-decoration: none;
}

.table tbody td {
    padding: 8px 12px;
    vertical-align: middle;
    border-top: 1px solid var(--wf-line-soft);
    border-bottom: none;
    color: var(--wf-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--wf-surface);
}

.table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--wf-radius); }
.table tbody tr:last-child td:last-child  { border-bottom-right-radius: var(--wf-radius); }

.table tbody td.cell-clip {
    max-width: 220px;
}

.table tbody td.cell-wrap {
    white-space: normal;
}

/* Figures line up down the column. */
.table td.cell-num,
.table th.cell-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* The vessel is what the eye looks for, so it is in bold. */
.table td.cell-vessel {
    font-weight: 700;
    color: var(--wf-navy);
}

/* The Configure lists are plain: the name is in the normal weight and colour, and Active
   or Inactive is not in bold either. */
.table td.cell-name { color: var(--wf-text); }
.config-table .wf-status { font-weight: 500; }

.table-striped > tbody > tr:nth-of-type(odd) > *,
.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: var(--wf-surface);
}

.table-hover > tbody > tr:hover > * {
    background-color: var(--wf-tint-teal) !important;
    color: var(--wf-text);
}

/* A row you can open. The whole row is the target, so it says so when you point at it. */
.table tbody tr.is-openable {
    cursor: pointer;
}

.table tbody tr.is-openable:hover > td {
    background-color: var(--wf-tint-teal) !important;
}

.table tbody tr.is-openable:hover > td:first-child {
    box-shadow: inset 3px 0 0 var(--wf-teal-bright);
}

.table tbody tr.is-openable:focus-visible > td {
    background-color: var(--wf-tint-teal) !important;
    outline: none;
}

/* --- Sorting --- */
.table.sortable thead th {
    cursor: pointer;
    user-select: none;
    padding-right: 24px;
}

.table.sortable thead th:hover {
    background: var(--wf-navy-soft);
}

.sortable th::after {
    content: '\2195';
    position: absolute;
    right: 9px;
    opacity: 0.4;
    font-size: 0.7rem;
}

.sortable th.sort-asc::after {
    content: '\2191';
    opacity: 1;
    color: var(--wf-teal-glow);
}

.sortable th.sort-desc::after {
    content: '\2193';
    opacity: 1;
    color: var(--wf-teal-glow);
}

.table.sortable thead th.no-sort {
    cursor: default;
    padding-right: 12px;
}

.sortable th.no-sort::after {
    content: '';
}

/* --- Row actions --- */
.table-action-link {
    color: var(--wf-teal);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.8rem;
    white-space: nowrap;
}

.table-action-link:hover {
    color: var(--wf-teal-deep);
    text-decoration: underline;
}

.table-action-delete {
    color: var(--wf-danger);
}

.table-action-delete:hover {
    color: #a52622;
}

.action-icon {
    width: 18px;
    height: 18px;
    margin: 0 4px;
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.action-icon:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* --- Layout helpers --- */
.border-top {
    border-top: 1px solid var(--wf-line);
}

.border-bottom {
    border-bottom: 1px solid var(--wf-line);
}

.box-shadow {
    box-shadow: var(--wf-shadow);
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 64px;
    font-size: 0.78rem;
    color: var(--wf-text-faint);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    color: #ffffff;
    background-color: var(--wf-teal);
}

.alert {
    font-size: 0.9rem;
    border-radius: var(--wf-radius-sm);
}

.login-container {
    max-width: 400px;
    margin: 0 auto;
}

/* --- Modals --- */
.modal-content {
    border: none;
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--wf-line);
    padding: 16px 22px;
}

.modal-title {
    font-family: var(--wf-font-head);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--wf-navy);
}

.modal-footer {
    border-top: 1px solid var(--wf-line);
    padding: 12px 22px;
}

/* --- Capturing a fixture --- */

/* Will's shorthand, shown back to him in grey so he can see it was understood. */
.shorthand-marker {
    color: #8a9099;
    font-style: italic;
}

.form-control.is-shorthand {
    color: #8a9099;
    font-style: italic;
}

/* The card that appears when a fixture might already be in the ledger. Amber, with an
   amber bar on the heading, so it reads as a question to answer rather than an error. */
.wf-card.wf-card-warn {
    background: #fffaf2;
    box-shadow: 0 0 0 1px #f1dcbb, var(--wf-shadow);
}

.wf-card.wf-card-warn .wf-card-heading {
    color: #8a4b10;
    border-bottom-color: #f1dcbb;
}

.wf-card.wf-card-warn .wf-card-heading::before {
    background: linear-gradient(180deg, #f0a24a, var(--wf-amber));
}

/* A table sitting inside a card: no second shadow, just a hairline edge. */
.table-wrapper.wf-table-inset {
    box-shadow: 0 0 0 1px var(--wf-line);
}

/* A plain warning under a date box. It never blocks a save. */
.date-warning {
    display: flex;
    gap: 8px;
    align-items: baseline;
    padding: 8px 10px;
    border-left: 3px solid var(--wf-amber);
    border-radius: var(--wf-radius-sm);
    background: var(--wf-tint-amber);
    color: #8a4b10;
    font-size: 0.8rem;
}

/* Comments carry the corrections that matter, so they wrap in full rather than
   being cut off. */
.comments-cell {
    min-width: 180px;
}

/* --- The four grade colours ---
   Used on the dashboard grade filter, the port rail chips and the ledger grade
   column, and nowhere else. They are set here once so they can be changed in one
   place. Each one has to hold its own against white and against the dark port
   rail panel. */
:root {
    --grade-cpp: #1f9aa8;
    --grade-dpp: #d97828;
    --grade-chems: #7b6ad0;
    --grade-veg: #3d9a63;
    --grade-other: #98a0aa;

    /* The same four, lifted for the dark port rail panel. */
    --grade-cpp-on-dark: #4ecdd9;
    --grade-dpp-on-dark: #f0a45c;
    --grade-chems-on-dark: #a99af0;
    --grade-veg-on-dark: #6fc98f;

    /* The two kinds of rate, so the eye can tell them apart without reading. Kept
       clear of the four grade colours. rnr stays grey like the other markers. */
    --rate-worldscale: #2b5fad;
    --rate-lumpsum: #a8386f;
    --rate-rnr: #8a9099;
}

.rate-worldscale { color: var(--rate-worldscale); font-weight: 600; }
.rate-lumpsum { color: var(--rate-lumpsum); font-weight: 600; }
.rate-rnr { color: var(--rate-rnr); font-style: italic; }

/* The two rate boxes on the fixture form carry the same colour on their left edge. */
.form-control.rate-box-worldscale { border-left: 3px solid var(--rate-worldscale); }
.form-control.rate-box-lumpsum { border-left: 3px solid var(--rate-lumpsum); }

.grade-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 6px;
    vertical-align: baseline;
    background-color: var(--grade-other);
}

.grade-dot.grade-cpp { background-color: var(--grade-cpp); }
.grade-dot.grade-dpp { background-color: var(--grade-dpp); }
.grade-dot.grade-chems { background-color: var(--grade-chems); }
.grade-dot.grade-veg { background-color: var(--grade-veg); }
.grade-dot.grade-other { background-color: var(--grade-other); }

/* --- Dashboard --- */

.dash-head {
    margin-bottom: 18px;
}

.dash-window {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0;
}

.dash-empty {
    background-color: #ffffff;
    border: 1px solid #e8eaed;
    border-radius: 6px;
    padding: 20px 22px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.region-tabs {
    display: flex;
    gap: 22px;
    border-bottom: 1px solid #e3e6ea;
    margin-bottom: 18px;
    overflow-x: auto;
}

.region-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 2px 10px 2px;
    color: var(--wf-text-muted);
    text-decoration: none;
    font-family: var(--wf-font-head);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.region-tab:hover {
    color: var(--wf-navy);
}

.region-tab.is-on {
    color: var(--wf-navy);
    font-weight: 700;
    border-bottom-color: var(--wf-teal-bright);
}

.region-tab-count {
    background-color: #eef1f4;
    color: #566270;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 0.74rem;
    font-weight: 600;
}

.region-tab.is-on .region-tab-count {
    background-color: #d9f1f4;
    color: #15707a;
}

/* The import review uses the same tabs, as buttons that switch the table below them. On a
   phone they sit in two rows of two, so every tab and its count is in view (Snag 21). */
button.region-tab {
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.review-tabs {
    margin-bottom: 12px;
}

/* Configure, Own Programme: on a phone the two headings wrap rather than being cut short. */
@media (max-width: 767.98px) {
    .own-pairs-table thead th {
        white-space: normal;
        text-overflow: clip;
        line-height: 1.3;
    }
}

/* Ignore past ETAs on the line up upload: easy to tap on a phone. */
@media (max-width: 767.98px) {
    .import-tick {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 38px;
    }

    .import-tick .form-check-input {
        margin-top: 0;
    }
}

@media (max-width: 767.98px) {
    .review-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 14px;
        overflow-x: visible;
    }

    .review-tabs .region-tab {
        min-height: 44px;
        justify-content: space-between;
        text-align: left;
        white-space: normal;
        line-height: 1.25;
        gap: 6px;
        letter-spacing: 0.04em;
    }

    .review-tabs .region-tab-count {
        white-space: nowrap;
        padding: 1px 6px;
    }
}

.dash-note {
    font-size: 0.82rem;
    color: #8a4b10;
    background-color: var(--wf-tint-amber);
    border: none;
    border-left: 3px solid var(--wf-amber);
    border-radius: var(--wf-radius-sm);
    padding: 10px 14px;
    margin-bottom: 16px;
}

.dash-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin-bottom: 20px;
}

.dash-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.dash-filter-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #98a0aa;
    margin-right: 2px;
}

.dash-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--wf-radius-pill);
    font-size: 0.78rem;
    color: var(--wf-text-muted);
    text-decoration: none;
    background-color: var(--wf-surface);
    box-shadow: 0 0 0 1px var(--wf-line);
    white-space: nowrap;
    transition: all 0.15s ease-in-out;
}

.dash-chip:hover {
    background-color: #e4e8ec;
    color: var(--wf-navy);
}

.dash-chip.is-on {
    background: linear-gradient(135deg, var(--wf-navy-mid), var(--wf-navy));
    box-shadow: none;
    color: #ffffff;
    font-weight: 600;
}

.stat-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 6px;
}

.stat-tile {
    flex: 1 1 180px;
    min-width: 170px;
    background-color: var(--wf-surface);
    border: none;
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

/* A thin teal line across the top of each figure, the one touch of colour on it. */
.stat-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--wf-teal-bright), var(--wf-teal-glow));
}

.stat-label {
    font-family: var(--wf-font-head);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--wf-text-muted);
}

.stat-figure {
    font-family: var(--wf-font-head);
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--wf-navy);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat-unit {
    font-size: 0.78rem;
    font-weight: 400;
    color: #98a0aa;
    margin-left: 6px;
}

.stat-under {
    font-size: 0.76rem;
    color: #8a9099;
}

/* --- The port rail ---
   This panel keeps the dark background from the prototype Will sent on 28 July,
   because that is the picture he already has in his head. Everything else on the
   page stays white. The rail scrolls sideways inside its own box, so the page
   itself never scrolls sideways even on a phone. */
.rail-panel {
    background: linear-gradient(160deg, var(--wf-navy-mid) 0%, var(--wf-navy) 60%);
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow-hover);
    padding: 20px 22px 22px 22px;
    margin-top: 8px;
    color: #e8ecf2;
}

.rail-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 6px;
}

.rail-title {
    margin: 0;
    color: #ffffff;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.rail-key {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.rail-key-item {
    font-size: 0.72rem;
    color: #aab4c2;
    white-space: nowrap;
}

.rail-key-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 5px;
}

.rail-key-dot.grade-cpp { background-color: var(--grade-cpp-on-dark); }
.rail-key-dot.grade-dpp { background-color: var(--grade-dpp-on-dark); }
.rail-key-dot.grade-chems { background-color: var(--grade-chems-on-dark); }
.rail-key-dot.grade-veg { background-color: var(--grade-veg-on-dark); }
.rail-key-dot.grade-other { background-color: var(--grade-other); }

.rail-scroller {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 0 2px 0;
}

.rail-track {
    display: flex;
    align-items: stretch;
    min-width: min-content;
}

/* No horizontal padding on the port itself, so each stop's dashed border meets its
   neighbour and the line runs unbroken across the whole panel, as it does in the
   prototype. The breathing room goes on the chips and the name instead. */
.rail-port {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 168px;
}

/* Exports sit above the line, imports and coastal below it. Both sides are the
   same height so every port name lines up on one dashed line across the panel. */
.rail-above,
.rail-below {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 108px;
    padding-left: 10px;
    padding-right: 10px;
}

.rail-above {
    justify-content: flex-end;
    padding-bottom: 8px;
}

.rail-below {
    justify-content: flex-start;
    padding-top: 8px;
}

/* The dashed line runs along the whole panel, through every port stop. */
.rail-stop {
    border-top: 1px dashed #56637a;
    padding-top: 8px;
    text-align: center;
}

.rail-port-name {
    display: block;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.rail-port-count {
    display: block;
    color: #8d99ab;
    font-size: 0.7rem;
    white-space: nowrap;
}

/* A port with nothing against it is still shown, because an empty berth is worth
   seeing, but it sits back so the busy ports carry the eye. */
.rail-port.is-quiet {
    min-width: 118px;
}

.rail-port.is-quiet .rail-port-name {
    color: #8d99ab;
    font-weight: 500;
}

.rail-port.is-quiet .rail-port-count {
    color: #616e81;
}

.rail-chip {
    display: block;
    border: 1px solid;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.72rem;
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.04);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.15s ease-in-out;
}

.rail-chip:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

.rail-chip-qty {
    margin-left: 6px;
    opacity: 0.8;
}

.rail-chip.grade-cpp { color: var(--grade-cpp-on-dark); border-color: var(--grade-cpp-on-dark); }
.rail-chip.grade-dpp { color: var(--grade-dpp-on-dark); border-color: var(--grade-dpp-on-dark); }
.rail-chip.grade-chems { color: var(--grade-chems-on-dark); border-color: var(--grade-chems-on-dark); }
.rail-chip.grade-veg { color: var(--grade-veg-on-dark); border-color: var(--grade-veg-on-dark); }
.rail-chip.grade-other { color: #b9c2ce; border-color: #6c7889; }

.rail-chip-more {
    color: #aab4c2;
    border-color: #56637a;
    border-style: dashed;
    font-style: italic;
}

.rail-nothing {
    color: #8d99ab;
    font-size: 0.85rem;
    margin: 14px 0 4px 0;
}

.rail-footnote {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #2c3546;
    font-size: 0.76rem;
    color: #8d99ab;
}

.rail-footnote div + div {
    margin-top: 4px;
}

.rail-footnote a {
    color: #4ecdd9;
}

/* --- Importing --- */

/* The three ways of bringing data in, each a card like the rest of the portal. */
.import-panel {
    background-color: var(--wf-surface);
    border: none;
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow);
    padding: 22px 22px 20px 22px;
}

.import-panel h6 {
    font-family: var(--wf-font-head);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--wf-navy);
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--wf-line);
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-panel h6::before {
    content: '';
    width: 3px;
    height: 14px;
    background: linear-gradient(180deg, var(--wf-teal-glow), var(--wf-teal));
    border-radius: var(--wf-radius-pill);
    flex-shrink: 0;
}

.import-panel-line {
    font-size: 0.82rem;
    color: var(--wf-text-muted);
    margin-bottom: 14px;
}

.review-head {
    background-color: var(--wf-surface);
    border: none;
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow);
    padding: 16px 20px 18px;
}

/* What was imported, as a title line, with the import's status on the right. */
.review-source {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--wf-line);
}

.review-source-text {
    min-width: 0;
}

.review-file {
    display: block;
    font-family: var(--wf-font-head);
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--wf-navy);
    overflow-wrap: anywhere;
}

.review-batch-status {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: var(--wf-radius-pill);
    background: var(--wf-tint-slate);
}

/* One figure per kind of line, in the colour that kind has in the table. A click on a
   figure opens its tab. */
.review-figures {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.review-figure {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 14px;
    border: 1px solid var(--wf-line);
    border-left: 3px solid var(--wf-slate);
    border-radius: var(--wf-radius-sm);
    background: var(--wf-surface);
    text-align: left;
    color: var(--wf-text);
}

button.review-figure {
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

button.review-figure:hover,
button.review-figure:focus-visible {
    box-shadow: var(--wf-shadow-hover);
    outline: none;
}

.review-figure-value {
    font-family: var(--wf-font-head);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--wf-navy);
    font-variant-numeric: tabular-nums;
}

.review-figure-update         { border-left-color: #1a5fa8; }
.review-figure-new            { border-left-color: var(--wf-green); }
.review-figure-duplicate      { border-left-color: #b8960f; }
.review-figure-could-not-read { border-left-color: var(--wf-danger); }

@media (max-width: 767.98px) {
    /* On a phone the card keeps the title, the status and Rows read. The four kinds of
       line are left to the tabs just below, which show the same counts and open on a
       tap, so the first line comes up on the first screen (Snag 31). */
    .review-figures {
        grid-template-columns: 1fr;
    }

    .review-figures > button.review-figure {
        display: none;
    }

    .review-figure {
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
        padding: 8px 14px;
    }

    .review-figure-value {
        font-size: 1.2rem;
    }

    .review-source {
        align-items: flex-start;
    }
}

/* On a tablet the five figures sit in one row, so the longer labels may wrap. */
@media (min-width: 768px) and (max-width: 991.98px) {
    .review-figure .review-label {
        letter-spacing: 0.06em;
    }
}

/* An import's own status on the Import page: committed, still a draft, or cancelled. */
.wf-status.is-committed::before { background: var(--wf-green); box-shadow: 0 0 0 3px rgba(47, 138, 85, 0.16); }
.wf-status.is-draft::before     { background: var(--wf-amber); box-shadow: 0 0 0 3px rgba(196, 106, 28, 0.16); }
.wf-status.is-cancelled::before { background: var(--wf-text-faint); }
.wf-status.is-cancelled         { color: var(--wf-text-muted); }

.review-label {
    display: block;
    font-family: var(--wf-font-head);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--wf-text-muted);
}

.review-notes {
    background-color: var(--wf-tint-teal);
    border: none;
    border-left: 3px solid var(--wf-teal-bright);
    border-radius: var(--wf-radius-sm);
    padding: 10px 14px;
    font-size: 0.82rem;
    color: var(--wf-text);
}

.review-notes div + div {
    margin-top: 4px;
}

/* The review table fits the page like every other table. It shows the columns needed to
   decide on a line; every field is in the line box that opens when a line is clicked. */
.review-table td {
    vertical-align: middle;
}

/* Text wraps rather than being cut short, so a vessel, a cargo or a port is always read
   in full. Dates and numbers stay on one line. Headings wrap too, so none is cut. */
.table.review-table tbody td {
    white-space: normal;
    overflow-wrap: break-word;
    text-overflow: clip;
}

/* A clear line between the lines of an import, which shows on the amber and cream rows
   as well as the white ones. On a phone each line is its own card instead. */
@media (min-width: 768px) {
    .table.review-table tbody tr + tr td {
        border-top: 1px solid rgba(15, 27, 51, 0.16);
    }
}

.table.review-table thead th {
    white-space: normal;
    text-overflow: clip;
    line-height: 1.3;
}

/* A page that uses the whole width of the window keeps a margin at each side. */
.wf-wide { padding-left: 24px; padding-right: 24px; max-width: 1680px; }

/* Snag 55: on the ledger opened from a link, the wide part under the heading and the tabs.
   Where the cards show, below 768, it keeps the width and the margins of the part above. */
@media (max-width: 767.98px) {
    .wf-wide.ins-wide { padding-left: 12px; padding-right: 12px; max-width: 540px; }
}
@media (max-width: 575.98px) {
    .wf-wide.ins-wide { max-width: none; }
}

/* The table is never narrower than its columns need. When the window is narrower than
   that, the table scrolls sideways inside its own white box and the page never does; the
   script on the page marks that box is-scrolling only when the table does not fit, so on a
   wide window the headings still follow the page down. On a phone the lines are cards. */
@media (min-width: 768px) {
    .review-wrap .review-table { min-width: var(--review-min, 0); }
    .review-wrap.is-scrolling { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .review-wrap.is-scrolling .review-table thead th { position: static; }
}

.table.review-table tbody td.review-date,
.table.review-table tbody td.cell-num {
    white-space: nowrap;
    padding-left: 8px;
    padding-right: 8px;
}

.review-tick-cell {
    text-align: center;
}

/* In the line box, a field the import would change is highlighted, with what the ledger
   holds now under it in small grey text. */
.wf-field.is-changing .form-control,
.wf-field.is-changing .form-select,
.wf-field.is-changing .wf-tags {
    border-color: var(--wf-amber);
    background-color: var(--wf-tint-amber);
}

/* Same voyage or New voyage, under What it is. A line whose dates suggest a new voyage is
   highlighted, with the suggestion in its notes. */
.review-voyage-choice {
    display: block;
    width: 100%;
    max-width: 150px;
    margin-top: 4px;
    font-size: 0.75rem;
    padding: 2px 26px 2px 8px;
    background-position: right 8px center;
    min-height: 0;
}

.review-row.review-new-voyage td {
    background-color: var(--wf-tint-amber);
}

/* The line box for a line matched to a fixture. Each field shows what the ledger holds and,
   where the import gives something different, the new value beside it in amber with an
   Accept tick. Each field takes a whole line of its card so the two values have room. On a
   phone the new value sits under the ledger's. */
.review-now {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--wf-text);
    padding: 6px 0;
    overflow-wrap: anywhere;
}

.review-now.is-empty {
    color: var(--wf-text-faint);
    font-weight: 400;
}

.review-accept {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--wf-amber);
    cursor: pointer;
}

.review-accept .form-check-input {
    margin-top: 0;
}

.review-compare-key {
    font-size: 0.8rem;
    color: var(--wf-text-muted);
    margin-bottom: 12px;
}

/* What Add this port will make a field: plain amber text, with nothing to edit. */
.review-adding {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--wf-text);
    background-color: var(--wf-tint-amber);
    border: 1px solid var(--wf-amber);
    border-radius: var(--wf-radius-sm);
    padding: 6px 10px;
    overflow-wrap: anywhere;
}

.review-field.is-adding .review-new > :not(.review-adding) {
    display: none;
}

#reviewLineModal.is-comparing .review-pair > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
}

/* One line per field, as in the ledger's detail box: the label, what the ledger holds, and
   the new value where there is one. */
#reviewLineModal.is-comparing .review-pair {
    --bs-gutter-y: 0;
}

#reviewLineModal.is-comparing .review-field {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 12px;
    align-items: center;
    margin-bottom: 0;
    padding: 6px 0;
    border-bottom: 1px solid var(--wf-line-soft);
}

#reviewLineModal.is-comparing .review-field > .form-label {
    margin-bottom: 0;
    font-size: 0.8rem;
    font-weight: 400;
}

#reviewLineModal.is-comparing .review-now {
    padding: 0;
}

#reviewLineModal.is-comparing .review-field:not(.is-changing) .review-now {
    grid-column: 2 / -1;
}

@media (max-width: 767.98px) {
    #reviewLineModal.is-comparing .review-field {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 4px;
    }

    #reviewLineModal.is-comparing .review-field:not(.is-changing) .review-now {
        grid-column: auto;
    }

    .review-accept {
        min-height: 38px;
    }
}

/* Notes is a sentence, so it is shown in full, wrapped over as many lines as it needs. */
.table tbody td.review-message-cell {
    white-space: normal;
    font-size: 0.78rem;
    color: var(--wf-text-muted);
    line-height: 1.35;
}

.review-rownum {
    display: block;
    font-size: 0.7rem;
    color: var(--wf-text-faint);
    margin-top: 2px;
}

/* A line changed in the line box says so, so it is clear what will be posted. */
.review-changed {
    display: inline-block;
    font-family: var(--wf-font-head);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wf-teal-deep);
    background: var(--wf-tint-teal);
    border-radius: 4px;
    padding: 1px 5px;
    margin-top: 3px;
}

.review-row.is-changed > td:first-child {
    box-shadow: inset 3px 0 0 var(--wf-teal-bright);
}

/* The top of the line box: what the import made of the line, and exactly what it read. */
.review-line-found {
    background: var(--wf-surface);
    border-radius: var(--wf-radius);
    box-shadow: 0 1px 2px rgba(15, 27, 51, 0.05);
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 0.875rem;
}

.review-raw-full {
    color: var(--wf-text-muted);
    font-style: italic;
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.row-status {
    font-family: var(--wf-font-head);
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.row-status-new {
    color: var(--wf-green);
}

.row-status-update {
    color: #1a5fa8;
}

.row-status-duplicate {
    color: #8a6d00;
}

.row-status-could-not-read {
    color: var(--wf-danger);
}

.review-row.review-duplicate td,
.review-row.review-could-not-read td {
    background-color: #fdfaf3;
}

/* --- The PDF preview box --- */
/* Every PDF in the portal opens here first. The box is tall so a landscape page is
   readable without scrolling the box itself. */
.pdf-preview-body {
    position: relative;
    background-color: #f2f3f5;
    min-height: 60vh;
}

.pdf-preview-frame {
    width: 100%;
    height: 72vh;
    border: 0;
    display: block;
}

.pdf-preview-waiting {
    margin: 0;
    padding: 28px 16px;
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.85rem;
}

/* On a phone there is not enough height for a readable page, so the box fills the
   screen and the PDF gets all of it. */
@media (max-width: 767.98px) {
    .pdf-preview-frame {
        height: 68vh;
    }
}

/* A row action that changes data is a posted button, not a link. It is made to look
   exactly like the text links beside it so the row still reads as one line of actions. */
.table-action-button {
    background: none;
    border: 0;
    padding: 0;
    color: var(--accent);
    font-size: 0.78rem;
    white-space: nowrap;
    cursor: pointer;
}

.table-action-button:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

.table-action-button.table-action-delete {
    color: #c9302c;
}

/* --- On a phone --- */
/* A wide table is unreadable on a phone even when it scrolls sideways: the ledger is
   13 columns, so one fixture takes three and a half screens. Below the tablet width each
   row becomes its own small card with the column name against each value. Empty values
   drop out, so a sparse fixture stays short. The markup is the same table either way. */
@media (max-width: 767.98px) {
    .table-wrapper.is-stacked {
        border: 0;
        border-radius: 0;
        overflow: visible;
    }

    /* The table lets go of its fixed column widths on a phone. Without this the widths
       set for a desktop still squeeze every card into a thin strip. */
    .table-stack,
    .table-stack tbody {
        display: block;
        width: 100%;
    }

    .table-stack.table-fit {
        table-layout: auto;
    }

    .table-stack colgroup {
        display: none;
    }

    .table-stack tbody tr {
        width: 100%;
    }

    .table-stack thead {
        display: none;
    }

    .table-stack tbody tr {
        display: block;
        background-color: #ffffff;
        border: 1px solid var(--line);
        border-radius: 6px;
        margin-bottom: 10px;
        padding: 4px 0;
    }

    /* The label sits in its own lane on the left and the value flows normally on the
       right, so a value made of more than one piece, such as the grade dot and the grade
       name, stays together instead of being pushed apart. */
    .table-stack tbody td {
        display: block;
        position: relative;
        border: 0;
        padding: 6px 12px 6px 116px;
        white-space: normal;
        text-align: right;
        min-height: 1.6em;
    }

    .table-stack tbody td::before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        top: 7px;
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--ink-soft);
        text-align: left;
    }

    /* Nothing to say, so the line is not there at all. */
    .table-stack tbody td:empty {
        display: none;
    }

    /* A card is as tall as it needs to be, so nothing is cut short on a phone. */
    .table-stack tbody td.cell-clip {
        max-width: none;
        overflow: visible;
        text-overflow: clip;
    }

    /* Two figures across rather than one, so the port rail is not a thousand pixels
       down the page. */
    .stat-tile {
        flex: 1 1 calc(50% - 7px);
        min-width: 0;
    }
}

/* The port rail is wider than the screen and scrolls sideways. A soft fade at each edge
   says so, instead of a chip that simply stops mid word. */
.rail-scroller {
    position: relative;
}

.rail-fade {
    position: relative;
}

.rail-fade::before,
.rail-fade::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 28px;
    pointer-events: none;
    z-index: 1;
}

.rail-fade::before {
    left: 0;
    background: linear-gradient(to right, var(--wf-navy), rgba(15, 27, 51, 0));
}

.rail-fade::after {
    right: 0;
    background: linear-gradient(to left, var(--wf-navy), rgba(15, 27, 51, 0));
}

/* ===================================================================
   Components added with the second pass on the look
   =================================================================== */

/* --- The brand in the bar --- */
/* The shield from his logo, then WYFOLD spaced the way his wordmark is, with the name of
   the portal small underneath. */
.wf-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.wf-brand-mark {
    width: 30px;
    height: 30px;
    display: block;
    flex-shrink: 0;
}

.wf-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.wf-brand-name {
    font-family: var(--wf-font-head);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: #ffffff;
}

.wf-brand-product {
    font-family: var(--wf-font-head);
    font-size: 0.56rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--wf-teal-glow);
    margin-top: 3px;
}

.wf-brand:hover .wf-brand-name {
    color: var(--wf-teal-glow);
}

/* --- The two row toolbar --- */
/* Search and every filter on the first row, the dates with print, Excel and Add on the
   second. On a desktop each row is one line and never wraps. */
.wf-toolbar {
    background: var(--wf-surface);
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow);
    padding: 14px 16px;
    margin-bottom: 18px;
}

.wf-toolbar-row {
    display: grid;
    gap: 10px;
    align-items: end;
}

/* Search, then the five dropdowns (area, direction, grade, status, size), then the four
   typed boxes (vessel, port, load port, discharge port). */
.wf-toolbar-filters {
    grid-template-columns: minmax(150px, 1.5fr) repeat(5, minmax(76px, 0.75fr)) repeat(4, minmax(96px, 1fr));
}

.wf-toolbar-foot {
    grid-template-columns: 1fr auto;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--wf-line-soft);
}

.wf-toolbar-dates {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.wf-toolbar-dates .wf-toolbar-field {
    width: 150px;
}

.wf-toolbar-buttons,
.wf-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wf-toolbar-field {
    min-width: 0;
}

.wf-toolbar-field .form-control,
.wf-toolbar-field .form-select {
    width: 100%;
}

.filter-label {
    display: block;
    font-family: var(--wf-font-head);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--wf-text-muted);
    margin-bottom: 4px;
    white-space: nowrap;
}

/* Below a desktop width the filters fold into a tidy grid rather than one long line. */
@media (max-width: 1199.98px) {
    .wf-toolbar-filters {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .wf-toolbar-search {
        grid-column: span 4;
    }
}

@media (max-width: 767.98px) {
    .wf-toolbar-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wf-toolbar-search {
        grid-column: span 2;
    }

    .wf-toolbar-foot {
        grid-template-columns: 1fr;
    }

    .wf-toolbar-dates .wf-toolbar-field {
        width: calc(50% - 5px);
    }

    .wf-toolbar-actions {
        justify-content: flex-end;
    }
}

/* The ledger's toolbar is one row: the search, the dates and the voyage on the left, the
   count and the buttons on the right. The rest is in the Advanced search box. */
.wf-toolbar-foot.ledger-toolbar {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    /* The filters stay together on one line. The count and the buttons sit at the right
       of the same line when there is room, and on the line below, still at the right,
       when there is not. */
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: end;
    gap: 10px 16px;
}

.ledger-toolbar .wf-toolbar-dates { flex-wrap: nowrap; }
.ledger-toolbar .wf-toolbar-dates .wf-toolbar-field { width: 145px; }
.ledger-toolbar .wf-toolbar-actions { margin-left: auto; }

.wf-toolbar-dates .wf-toolbar-field.ledger-search {
    width: 240px;
}

@media (max-width: 1199.98px) {
    .ledger-toolbar .wf-toolbar-dates { flex-wrap: wrap; }
}

.ledger-advanced-on {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--wf-line-soft);
    font-size: 0.85rem;
    color: var(--wf-text);
}

.ledger-advanced-on a { margin-left: 4px; }

@media (max-width: 767.98px) {
    .wf-toolbar-dates .wf-toolbar-field.ledger-search {
        width: 100%;
    }

    .ledger-toolbar .wf-toolbar-dates .wf-toolbar-field { width: calc(50% - 5px); }
    .ledger-toolbar .wf-toolbar-dates .wf-toolbar-field.ledger-search { width: 100%; }
    .ledger-toolbar .wf-toolbar-buttons,
    .ledger-toolbar .wf-toolbar-actions { flex-wrap: wrap; }
    .ledger-toolbar,
    .ledger-toolbar .wf-toolbar-dates { min-width: 0; width: 100%; }
}

/* --- The fixture detail box --- */
.wf-detail-body {
    background: var(--wf-canvas);
    padding: 20px 22px;
}

.wf-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.wf-detail-vessel {
    font-family: var(--wf-font-head);
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--wf-navy);
    line-height: 1.15;
}

/* The vessel's size beside its name: a small outlined tag, such as MR. */
.wf-size {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    font-family: var(--wf-font-body, inherit);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    vertical-align: middle;
    color: var(--wf-teal-deep);
    border: 1px solid var(--wf-teal-deep);
    border-radius: var(--wf-radius-pill);
}

.wf-detail-route {
    margin-top: 4px;
    color: var(--wf-text-muted);
    font-size: 0.9rem;
}

.wf-detail-badges {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 18px;
}

/* The four figures that matter most, across the top in a navy band. */
.wf-detail-figures {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: linear-gradient(100deg, var(--wf-navy) 0%, var(--wf-navy-mid) 100%);
    border-radius: var(--wf-radius);
    margin-bottom: 16px;
    overflow: hidden;
}

.wf-detail-figure {
    padding: 14px 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.wf-detail-figure:last-child {
    border-right: none;
}

.wf-detail-figure-label {
    display: block;
    font-family: var(--wf-font-head);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--wf-teal-glow);
    margin-bottom: 5px;
}

.wf-detail-figure-value {
    font-family: var(--wf-font-head);
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
}

.wf-detail-figure-value small {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
}

/* A card inside the detail box sits a little flatter, so the box does not stack shadow
   on shadow. */
.wf-card.wf-card-flat {
    padding: 16px 18px;
    box-shadow: 0 1px 2px rgba(15, 27, 51, 0.05);
}

.wf-card.wf-card-flat .wf-card-heading {
    margin-bottom: 6px;
}

.wf-detail-notes {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--wf-line-soft);
    font-size: 0.875rem;
    white-space: pre-line;
}

.wf-detail-notes .wf-row-label {
    display: block;
    margin-bottom: 4px;
}

.wf-detail-foot {
    justify-content: space-between;
}

@media (max-width: 575.98px) {
    .wf-detail-figures {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wf-detail-figure:nth-child(2) {
        border-right: none;
    }

    .wf-detail-figure:nth-child(-n+2) {
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .wf-detail-badges {
        padding-top: 0;
    }
}

/* Will's shorthand written in help text, such as tbn or fxd. A quiet teal tag instead of
   the browser's bright pink, so the hint reads as a hint. */
code {
    font-family: var(--wf-font-head);
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--wf-teal-deep);
    background: var(--wf-tint-teal);
    padding: 1px 5px;
    border-radius: 4px;
}

/* A short form, such as a vessel or a charterer, sits in a narrower column so its card and
   its Save bar line up, instead of one small card stranded on a wide page. */
.wf-capture-narrow {
    max-width: 760px;
}

/* Active and inactive on a setup list, as a dot and a word like a fixture's status. */
.wf-status.is-active::before   { background: var(--wf-green); box-shadow: 0 0 0 3px rgba(47, 138, 85, 0.16); }
.wf-status.is-inactive::before { background: var(--wf-text-faint); }
.wf-status.is-inactive         { color: var(--wf-text-muted); }

/* A setup list toolbar is a single row: search and filters on the left, print, Excel and
   Add on the right. */
.wf-toolbar-single {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

.wf-toolbar-single .wf-toolbar-left {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.wf-toolbar-single .wf-toolbar-search {
    width: 260px;
}

.wf-toolbar-single .wf-toolbar-select {
    width: 190px;
}

@media (max-width: 767.98px) {
    .wf-toolbar-single .wf-toolbar-search,
    .wf-toolbar-single .wf-toolbar-select {
        width: 100%;
    }

    .wf-toolbar-single .wf-toolbar-left {
        width: 100%;
    }
}

/* The port rail is a wide picture, so it does scroll sideways. Its scroll bar is dark and
   slim to sit inside the navy panel, instead of the browser's bright white bar. */
.rail-scroller {
    scrollbar-width: thin;
    scrollbar-color: rgba(79, 195, 208, 0.45) rgba(255, 255, 255, 0.04);
}

.rail-scroller::-webkit-scrollbar {
    height: 8px;
}

.rail-scroller::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.rail-scroller::-webkit-scrollbar-thumb {
    background: rgba(79, 195, 208, 0.4);
    border-radius: 999px;
}

.rail-scroller::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 195, 208, 0.65);
}

@media (max-width: 767.98px) {
    .table-stack tbody td.review-message-cell {
        display: block;
        -webkit-line-clamp: unset;
        overflow: visible;
    }

    .table-stack tbody td.review-tick-cell {
        text-align: right;
    }
}

/* --- The port rail, dark or light ---
   The switch above the panel on the right. The dark look is the prototype Will sent;
   the light look is a white card like the rest of the portal. The choice is kept in a
   cookie, so the rail opens the same way next time. */
.rail-theme-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
}

.rail-theme-label {
    font-family: var(--wf-font-head);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--wf-text-muted);
}

.rail-theme-switch {
    display: inline-flex;
    padding: 3px;
    border-radius: var(--wf-radius-pill);
    background: var(--wf-surface);
    box-shadow: 0 0 0 1px var(--wf-line);
}

.rail-theme-option {
    border: 0;
    background: transparent;
    color: var(--wf-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: var(--wf-radius-pill);
    cursor: pointer;
    transition: all 0.15s ease;
}

.rail-theme-option:hover {
    color: var(--wf-navy);
}

.rail-theme-option.is-on {
    background: linear-gradient(135deg, var(--wf-navy-mid), var(--wf-navy));
    color: #ffffff;
}

.rail-theme-option:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(31, 154, 168, 0.3);
}

/* The light rail. Grade colours on white need deeper shades than on navy to stay easy
   to read at chip size, so the light chips carry their own. */
.rail-panel.is-light {
    --rail-cpp: #137884;
    --rail-dpp: #a3520f;
    --rail-chems: #5f4fb8;
    --rail-veg: #2d7a4c;

    background: var(--wf-surface);
    box-shadow: var(--wf-shadow);
    color: var(--wf-text);
}

.rail-panel.is-light .rail-title {
    color: var(--wf-navy);
}

.rail-panel.is-light .rail-key-item {
    color: var(--wf-text-muted);
}

.rail-panel.is-light .rail-key-dot.grade-cpp { background-color: var(--grade-cpp); }
.rail-panel.is-light .rail-key-dot.grade-dpp { background-color: var(--grade-dpp); }
.rail-panel.is-light .rail-key-dot.grade-chems { background-color: var(--grade-chems); }
.rail-panel.is-light .rail-key-dot.grade-veg { background-color: var(--grade-veg); }

.rail-panel.is-light .rail-stop {
    border-top-color: #b9c4d3;
}

.rail-panel.is-light .rail-port-name {
    color: var(--wf-navy);
}

.rail-panel.is-light .rail-port-count {
    color: var(--wf-text-muted);
}

.rail-panel.is-light .rail-port.is-quiet .rail-port-name {
    color: var(--wf-text-faint);
}

.rail-panel.is-light .rail-port.is-quiet .rail-port-count {
    color: #b3bcc8;
}

.rail-panel.is-light .rail-chip {
    background-color: #ffffff;
}

.rail-panel.is-light .rail-chip:hover {
    background-color: var(--wf-canvas);
}

.rail-panel.is-light .rail-chip.grade-cpp { color: var(--rail-cpp); border-color: var(--grade-cpp); background-color: #eef8f9; }
.rail-panel.is-light .rail-chip.grade-dpp { color: var(--rail-dpp); border-color: var(--grade-dpp); background-color: #fdf4ec; }
.rail-panel.is-light .rail-chip.grade-chems { color: var(--rail-chems); border-color: var(--grade-chems); background-color: #f3f1fc; }
.rail-panel.is-light .rail-chip.grade-veg { color: var(--rail-veg); border-color: var(--grade-veg); background-color: #eef7f1; }
.rail-panel.is-light .rail-chip.grade-other { color: var(--wf-text-muted); border-color: #b9c4d3; }

.rail-panel.is-light .rail-chip.grade-cpp:hover { background-color: #e4f3f5; }
.rail-panel.is-light .rail-chip.grade-dpp:hover { background-color: #fbe8d8; }
.rail-panel.is-light .rail-chip.grade-chems:hover { background-color: #e7e3f8; }
.rail-panel.is-light .rail-chip.grade-veg:hover { background-color: #e5f3ea; }

.rail-panel.is-light .rail-chip-more {
    color: var(--wf-text-muted);
    border-color: #b9c4d3;
    background-color: transparent;
}

.rail-panel.is-light .rail-nothing {
    color: var(--wf-text-muted);
}

.rail-panel.is-light .rail-footnote {
    border-top-color: var(--wf-line);
    color: var(--wf-text-muted);
}

.rail-panel.is-light .rail-footnote a {
    color: var(--wf-teal);
}

/* The fades at each end match the panel they sit on. */
.rail-panel.is-light .rail-fade::before {
    background: linear-gradient(to right, #ffffff, rgba(255, 255, 255, 0));
}

.rail-panel.is-light .rail-fade::after {
    background: linear-gradient(to left, #ffffff, rgba(255, 255, 255, 0));
}

.rail-panel.is-light .rail-scroller {
    scrollbar-color: rgba(20, 112, 123, 0.35) rgba(15, 27, 51, 0.05);
}

.rail-panel.is-light .rail-scroller::-webkit-scrollbar-track {
    background: rgba(15, 27, 51, 0.05);
}

.rail-panel.is-light .rail-scroller::-webkit-scrollbar-thumb {
    background: rgba(20, 112, 123, 0.35);
}

.rail-panel.is-light .rail-scroller::-webkit-scrollbar-thumb:hover {
    background: rgba(20, 112, 123, 0.55);
}

/* ===================================================================
   Several ports or areas in one box, on the fixture form. Each value
   is a small tag in the order it was added, with a cross to take it
   off, and the rest of the box is for typing the next one.
   =================================================================== */
.wf-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-height: calc(1.5em + 0.75rem + 2px);
    height: auto;
    padding: 4px 6px;
    cursor: text;
}

.wf-tags:focus-within {
    border-color: var(--wf-teal-bright);
    box-shadow: 0 0 0 0.2rem rgba(31, 154, 168, 0.18);
}

.wf-tag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 4px 1px 8px;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--wf-teal-deep);
    background: var(--wf-tint-teal);
    border-radius: var(--wf-radius-pill);
    white-space: nowrap;
}

.wf-tag-remove {
    border: 0;
    background: transparent;
    color: var(--wf-teal-deep);
    font-size: 1rem;
    line-height: 1;
    padding: 0 4px;
    border-radius: var(--wf-radius-pill);
    cursor: pointer;
}

.wf-tag-remove:hover,
.wf-tag-remove:focus-visible {
    background: rgba(20, 112, 123, 0.15);
    outline: none;
}

.wf-tags-input {
    flex: 1 1 6rem;
    min-width: 6rem;
    border: 0;
    outline: 0;
    padding: 2px;
    font: inherit;
    background: transparent;
    color: var(--wf-text);
}

/* ===================================================================
   Every value in capitals, as Will asked. A box marked wf-caps shows
   what is typed in capitals straight away. This only changes how it
   looks: the value is put into capitals on the server when it is saved.
   Comments are never marked, because they stay as typed.
   =================================================================== */
.wf-caps,
.wf-caps .wf-tags-input,
.wf-tags.wf-caps .wf-tag {
    text-transform: uppercase;
}

.wf-caps::placeholder,
.wf-caps .wf-tags-input::placeholder {
    text-transform: none;
}

/* ===================================================================
   The ledger, read two ways. The reading columns fit the page. Every
   column shows each field on its own and scrolls sideways inside the
   table when it is wider than the page. The pencil at the start of a
   row opens that fixture's Edit form.
   =================================================================== */
.ledger-table thead th { width: var(--w-read, auto); }

/* The reading view. Dates, numbers and the status have exact widths that always fit them,
   and never wrap. A long rate, such as 2.5M (290), may take a second line. The vessel, the charterer, the cargo and the ports share the
   rest of the width and wrap onto a second line rather than being cut short. */
.ledger-table:not(.is-full) thead th { white-space: normal; text-overflow: clip; line-height: 1.25; }
.table.ledger-table:not(.is-full) tbody td { white-space: normal; overflow-wrap: break-word; text-overflow: clip; }
.table.ledger-table:not(.is-full) tbody td[data-label="Size"],
.table.ledger-table:not(.is-full) tbody td[data-label="Qty (kt)"],
.table.ledger-table:not(.is-full) tbody td[data-label="Laycan"],
.table.ledger-table:not(.is-full) tbody td[data-label="ETA"],
.table.ledger-table:not(.is-full) tbody td[data-label="Status"] { white-space: nowrap; }

/* Below 1,400 pixels the fixed columns are a little narrower and the cells closer. */
@media (max-width: 1399.98px) {
    .ledger-table:not(.is-full) thead th { width: var(--w-narrow, var(--w-read, auto)); padding-left: 8px; padding-right: 8px; letter-spacing: 0.06em; }
    .table.ledger-table:not(.is-full) tbody td { padding-left: 8px; padding-right: 8px; }
}

/* Below 1,200 pixels, a window beside another or a small laptop, the text is a touch
   smaller and the fixed columns a little narrower again, so more of each name fits on
   one line. */
@media (max-width: 1199.98px) {
    .table.ledger-table:not(.is-full) tbody td { font-size: 0.8rem; }
    .ledger-table:not(.is-full) thead th { width: var(--w-compact, var(--w-narrow, var(--w-read, auto))); padding-left: 6px; padding-right: 6px; letter-spacing: 0.02em; }
    .table.ledger-table:not(.is-full) tbody td { padding-left: 6px; padding-right: 6px; }
}

/* Snag 18: on a tablet, from 768 pixels until the reading columns fit, the table keeps a
   width where names and ports read, and scrolls sideways inside its own box. Below 768 the
   ledger is cards. */
@media (min-width: 768px) and (max-width: 1099.98px) {
    .table-wrapper.ledger-wrap:not(.is-full) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .ledger-table:not(.is-full) { min-width: 1040px; }
    .ledger-table:not(.is-full) thead th { position: static; }
}

/* The pencil and the clock always sit side by side, whatever the width. */
.table.ledger-table tbody td.ledger-edit { white-space: nowrap; padding-left: 8px; padding-right: 0; }
.ledger-table:not(.is-full) .col-full { display: none; }
.ledger-table.is-full .col-read { display: none; }

/* Show every column makes the table wider than the page. The table and its white card
   grow to fit, so the page itself scrolls sideways, with its scroll bar at the foot of
   the window, rather than a scroll bar at the foot of a long table. */
.table-wrapper.ledger-wrap.is-full { overflow: visible; width: max-content; min-width: 100%; }
.ledger-table.is-full { width: max-content; min-width: 100%; }
.ledger-table.is-full thead th { width: var(--w-full, auto); }
.ledger-table.is-full thead th { position: static; }

.ledger-table td.ledger-edit {
    padding-left: 8px;
    padding-right: 0;
    text-align: center;
}

.ledger-pencil {
    display: inline-block;
    border: 1px solid var(--wf-line);
    background: var(--wf-surface);
    color: var(--wf-teal-deep);
    border-radius: var(--wf-radius-sm);
    padding: 3px 6px;
    line-height: 1;
    vertical-align: middle;
}

.ledger-pencil:hover,
.ledger-pencil:focus-visible { background: var(--wf-tint-teal); color: var(--wf-teal-deep); outline: none; }

/* The clock beside the pencil opens the vessel's history. The column is a fixed width
   that fits both buttons, so the clock is never cut off. */
.ledger-history { margin-left: 6px; }
.ledger-table td.ledger-edit { white-space: nowrap; }

.ledger-switch { margin: 0 8px 0 0; align-self: center; font-size: 0.8rem; white-space: nowrap; }

/* How many fixtures the filters found, in the toolbar where it is seen, in the normal text
   colour, before the print and Excel buttons. */
.ledger-count { margin: 0 6px 0 0; align-self: center; font-size: 0.85rem; font-weight: 600; color: var(--wf-text); white-space: nowrap; }

/* The line under the ledger that says what the flag on a row means. */
.ledger-flag-note { font-size: 0.85rem; color: var(--wf-text); }

/* On a phone the ledger is a stack of cards to read. A card opens the fixture's detail
   box, which has Edit on it, and the extra columns are left to that box. */
@media (max-width: 767.98px) {
    .ledger-wide-only { display: none !important; }
    .ledger-table.is-full td.col-full { display: none !important; }
    .ledger-table.is-full td.col-read:not(:empty) { display: block !important; }
    .table-wrapper.ledger-wrap.is-full { overflow-x: visible; width: auto; min-width: 0; }
    .ledger-table.is-full { width: 100%; }
}

/* ===================================================================
   Needs attention. A small red flag at the start of a ledger row that
   one of the exception rules has picked out, with the reason on hover,
   and the line on the Dashboard linking to the fixtures with a gap.
   =================================================================== */
.attention-flag {
    display: inline-block;
    color: #c0362c;
    margin-right: 5px;
    vertical-align: -1px;
}

.attention-line {
    margin: 12px 0 0;
    font-size: 0.875rem;
}

.attention-line a {
    color: #c0362c;
    font-weight: 700;
}

/* ===================================================================
   Layout, set under Configure, Layout: the menu dark or light, along
   the top or down the side. The body carries wf-menu-dark or
   wf-menu-light, and wf-layout-top or wf-layout-side.
   =================================================================== */

:root {
    --wf-side-w: 236px;
    --wf-rail-w: 66px;
}

/* --- Light Mode, the bar along the top --- */
/* White, with a shadow under it so the page can see where the menu ends, dark words, and
   the shield turned dark so it still reads, the way it sits on his printed logo. */
.navbar-portal.navbar-portal-light {
    background: #ffffff;
    box-shadow: 0 1px 0 var(--wf-line), 0 4px 18px rgba(15, 27, 51, 0.09);
}

.wf-menu-light .wf-brand-mark {
    filter: invert(1);
}

.wf-menu-light .wf-brand-name {
    color: var(--wf-navy);
}

.wf-menu-light .wf-brand-product {
    color: var(--wf-teal);
}

.wf-menu-light .wf-brand:hover .wf-brand-name {
    color: var(--wf-teal);
}

.navbar-portal-light .navbar-portal-link {
    color: var(--wf-text-muted) !important;
}

.navbar-portal-light .navbar-portal-link:hover,
.navbar-portal-light .navbar-portal-link:focus {
    color: var(--wf-navy) !important;
}

.navbar-portal-light .navbar-portal-link::before {
    background: var(--wf-teal);
}

.navbar-portal-light .navbar-toggler {
    border-color: var(--wf-line);
}

.navbar-portal-light .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2815, 27, 51, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-portal-light .navbar-portal-dropdown {
    background-color: #ffffff;
    border: 1px solid var(--wf-line);
}

.navbar-portal-light .navbar-portal-dropdown-item {
    color: var(--wf-text) !important;
}

.navbar-portal-light .navbar-portal-dropdown-item:hover,
.navbar-portal-light .navbar-portal-dropdown-item:focus {
    color: var(--wf-teal-deep) !important;
    background-color: var(--wf-tint-teal);
}

.navbar-portal-light .navbar-portal-dropdown .dropdown-divider {
    border-color: var(--wf-line);
}

/* --- Side Layout, the frame --- */
body.wf-layout-side {
    margin-bottom: 0;
}

.wf-layout-side .wf-shell {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

.wf-layout-side .wf-main {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: var(--wf-side-w);
    position: relative;
    min-height: 100vh;
    padding-top: 1.5rem;
    padding-bottom: 64px;
    transition: margin-left 0.2s ease;
}

/* --- The side menu, Dark Mode first --- */
.wf-sidebar {
    width: var(--wf-side-w);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    background: linear-gradient(170deg, var(--wf-navy) 0%, var(--wf-navy-mid) 100%);
    box-shadow: 2px 0 14px rgba(15, 27, 51, 0.18);
    /* Visible, so the Configure and name menus can open out of the foot. The list of
       items scrolls on its own. */
    overflow: visible;
    transition: width 0.2s ease;
}

.wf-side-brand-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 64px;
    padding: 12px 12px 12px 16px;
    flex-shrink: 0;
    position: relative;
}

.wf-side-brand-row::after {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--wf-teal-glow), transparent);
    opacity: 0.55;
}

.wf-side-brand {
    flex: 1;
    min-width: 0;
    padding: 0;
    text-decoration: none;
}

.wf-side-brand .wf-brand-text {
    overflow: hidden;
    white-space: nowrap;
}

.wf-rail-toggle {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: var(--wf-radius-sm);
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
    transition: background 0.15s ease, color 0.15s ease;
}

.wf-rail-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.wf-rail-toggle svg {
    width: 15px;
    height: 15px;
    transition: transform 0.2s ease;
}

.wf-side-nav {
    flex: 1 1 auto;
    padding: 14px 10px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.wf-side-item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 10px 10px;
    margin-bottom: 2px;
    border: none;
    border-radius: var(--wf-radius-sm);
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--wf-font-head);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.wf-side-item:hover,
.wf-side-item:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* On navy the page you are on turns white, as it does in the Daveng portal. */
.wf-side-item.active,
.wf-side-item.active:hover {
    background: #ffffff;
    color: var(--wf-navy);
    box-shadow: 0 2px 10px rgba(9, 16, 31, 0.28);
}

.wf-side-item.active .wf-side-icon {
    color: var(--wf-teal);
    opacity: 1;
}

.wf-side-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: 0.85;
}

.wf-side-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wf-side-caret {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.55;
    transition: transform 0.18s ease;
}

[aria-expanded="true"] > .wf-side-caret {
    transform: rotate(180deg);
}

/* A group such as Reports, and the entries under it, one step in. */
.wf-side-group.is-current {
    color: #ffffff;
}

.wf-menu-light .wf-side-group.is-current {
    color: var(--wf-navy);
}

.wf-side-sub {
    padding-left: 26px;
    font-size: 0.68rem;
}

.wf-shell.wf-rail .wf-side-sub,
.wf-pre-collapsed .wf-side-sub {
    padding-left: 0;
}

.wf-side-foot {
    flex-shrink: 0;
    padding: 8px 10px 12px;
}

.wf-side-configure {
    margin-bottom: 8px;
}

.wf-side-user {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 8px;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    background: transparent;
    text-align: left;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.wf-side-user:hover {
    background: rgba(255, 255, 255, 0.08);
}

.wf-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--wf-teal-bright), var(--wf-navy-soft));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--wf-font-head);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.wf-side-user-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.wf-side-user-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wf-side-user-role {
    display: block;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.65);
}

/* The menus that open upward out of the foot. */
.wf-side-menu {
    min-width: 220px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow-lg);
    padding: 8px;
}

.wf-side-menu-head {
    font-family: var(--wf-font-head);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--wf-text-muted);
    padding: 4px 10px 8px;
}

.wf-side-menu .dropdown-item {
    border-radius: var(--wf-radius-sm);
    font-size: 0.85rem;
    padding: 8px 10px;
    color: var(--wf-text);
}

.wf-side-menu .dropdown-item:hover,
.wf-side-menu .dropdown-item:focus,
.wf-side-menu .dropdown-item.active {
    background: var(--wf-tint-teal);
    color: var(--wf-teal-deep);
}

.wf-side-menu .dropdown-item.active {
    font-weight: 600;
}

/* --- The side menu in Light Mode --- */
/* White, with a shadow down its edge, dark words and the shield turned dark. */
.wf-menu-light .wf-sidebar {
    background: #ffffff;
    box-shadow: 1px 0 0 var(--wf-line), 4px 0 18px rgba(15, 27, 51, 0.08);
}

.wf-menu-light .wf-side-brand-row::after {
    background: linear-gradient(90deg, var(--wf-teal), transparent);
    opacity: 0.35;
}

.wf-menu-light .wf-rail-toggle {
    background: var(--wf-tint-slate);
    color: var(--wf-text-muted);
}

.wf-menu-light .wf-rail-toggle:hover {
    background: var(--wf-line);
    color: var(--wf-navy);
}

.wf-menu-light .wf-side-nav {
    scrollbar-color: rgba(15, 27, 51, 0.16) transparent;
}

.wf-menu-light .wf-side-item {
    color: var(--wf-text-muted);
}

.wf-menu-light .wf-side-item:hover,
.wf-menu-light .wf-side-item:focus-visible {
    background: var(--wf-tint-slate);
    color: var(--wf-navy);
}

.wf-menu-light .wf-side-item.active,
.wf-menu-light .wf-side-item.active:hover {
    background: var(--wf-tint-teal);
    color: var(--wf-teal-deep);
    box-shadow: inset 3px 0 0 var(--wf-teal);
}

.wf-menu-light .wf-side-user {
    border-top-color: var(--wf-line);
}

.wf-menu-light .wf-side-user:hover {
    background: var(--wf-tint-slate);
}

.wf-menu-light .wf-side-user-name {
    color: var(--wf-navy);
}

.wf-menu-light .wf-side-user-role {
    color: var(--wf-text-muted);
}

/* --- Folded to its icons --- */
.wf-shell.wf-rail .wf-sidebar,
.wf-pre-collapsed .wf-sidebar {
    width: var(--wf-rail-w);
}

.wf-layout-side .wf-shell.wf-rail .wf-main,
.wf-pre-collapsed .wf-layout-side .wf-main {
    margin-left: var(--wf-rail-w);
}

.wf-shell.wf-rail .wf-side-brand .wf-brand-text,
.wf-shell.wf-rail .wf-side-label,
.wf-shell.wf-rail .wf-side-caret,
.wf-shell.wf-rail .wf-side-user-text,
.wf-pre-collapsed .wf-side-brand .wf-brand-text,
.wf-pre-collapsed .wf-side-label,
.wf-pre-collapsed .wf-side-caret,
.wf-pre-collapsed .wf-side-user-text {
    display: none;
}

.wf-shell.wf-rail .wf-side-brand-row,
.wf-pre-collapsed .wf-side-brand-row {
    flex-direction: column;
    gap: 10px;
    padding: 14px 8px 12px;
}

.wf-shell.wf-rail .wf-side-brand-row::after,
.wf-pre-collapsed .wf-side-brand-row::after {
    left: 12px;
    right: 12px;
}

.wf-shell.wf-rail .wf-side-brand,
.wf-pre-collapsed .wf-side-brand {
    flex: none;
    justify-content: center;
}

.wf-shell.wf-rail .wf-rail-toggle svg,
.wf-pre-collapsed .wf-rail-toggle svg {
    transform: rotate(180deg);
}

.wf-shell.wf-rail .wf-side-nav,
.wf-shell.wf-rail .wf-side-foot,
.wf-pre-collapsed .wf-side-nav,
.wf-pre-collapsed .wf-side-foot {
    padding-left: 8px;
    padding-right: 8px;
}

.wf-shell.wf-rail .wf-side-item,
.wf-shell.wf-rail .wf-side-user,
.wf-pre-collapsed .wf-side-item,
.wf-pre-collapsed .wf-side-user {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    gap: 0;
}

/* Folded, each icon names itself on hover. Placed by site.js against the window. */
.wf-rail-tip {
    position: fixed;
    transform: translateY(-50%);
    background: var(--wf-navy);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 11px;
    border-radius: var(--wf-radius-sm);
    box-shadow: var(--wf-shadow-lg);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease;
    z-index: 1200;
}

.wf-rail-tip.show {
    opacity: 1;
}

/* --- The bar that opens the side menu on a phone or tablet --- */
.wf-appbar,
.wf-scrim {
    display: none;
}

@media (max-width: 991.98px) {
    .wf-appbar {
        display: flex;
        align-items: center;
        gap: 14px;
        min-height: 58px;
        padding: 0 16px;
        background: linear-gradient(100deg, var(--wf-navy) 0%, var(--wf-navy-mid) 100%);
        box-shadow: 0 2px 14px rgba(15, 27, 51, 0.18);
    }

    .wf-menu-light .wf-appbar {
        background: #ffffff;
        box-shadow: 0 1px 0 var(--wf-line), 0 4px 18px rgba(15, 27, 51, 0.09);
    }

    .wf-appbar .wf-brand {
        text-decoration: none;
        padding: 0;
    }

    .wf-hamburger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 34px;
        flex-shrink: 0;
        background: transparent;
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: var(--wf-radius-sm);
        color: #ffffff;
    }

    .wf-menu-light .wf-hamburger {
        border-color: var(--wf-line);
        color: var(--wf-navy);
    }

    .wf-hamburger svg {
        width: 18px;
        height: 18px;
    }

    .wf-scrim {
        position: fixed;
        inset: 0;
        background: rgba(15, 27, 51, 0.5);
        z-index: 1035;
    }

    .wf-drawer-open .wf-scrim {
        display: block;
    }

    /* The menu slides in over the page, always at full width. Folding is a desktop idea. */
    .wf-sidebar,
    .wf-shell.wf-rail .wf-sidebar,
    .wf-pre-collapsed .wf-sidebar {
        width: var(--wf-side-w);
        transform: translateX(-100%);
        transition: transform 0.22s ease-in-out;
        box-shadow: var(--wf-shadow-lg);
    }

    .wf-shell.wf-drawer-open .wf-sidebar {
        transform: translateX(0);
    }

    .wf-rail-toggle {
        display: none;
    }

    .wf-shell.wf-rail .wf-side-brand .wf-brand-text,
    .wf-pre-collapsed .wf-side-brand .wf-brand-text {
        display: flex;
    }

    .wf-shell.wf-rail .wf-side-label,
    .wf-shell.wf-rail .wf-side-caret,
    .wf-shell.wf-rail .wf-side-user-text,
    .wf-pre-collapsed .wf-side-label,
    .wf-pre-collapsed .wf-side-caret,
    .wf-pre-collapsed .wf-side-user-text {
        display: block;
    }

    .wf-shell.wf-rail .wf-side-brand-row,
    .wf-pre-collapsed .wf-side-brand-row {
        flex-direction: row;
        padding: 12px 12px 12px 16px;
    }

    .wf-shell.wf-rail .wf-side-brand,
    .wf-pre-collapsed .wf-side-brand {
        flex: 1;
        justify-content: flex-start;
    }

    .wf-shell.wf-rail .wf-side-item,
    .wf-shell.wf-rail .wf-side-user,
    .wf-pre-collapsed .wf-side-item,
    .wf-pre-collapsed .wf-side-user {
        justify-content: flex-start;
        gap: 11px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .wf-layout-side .wf-main,
    .wf-layout-side .wf-shell.wf-rail .wf-main,
    .wf-pre-collapsed .wf-layout-side .wf-main {
        margin-left: 0;
        padding-top: 0;
    }

    .wf-layout-side .wf-main > .container {
        margin-top: 1.25rem;
    }

    .wf-shell.wf-rail .wf-side-sub,
    .wf-pre-collapsed .wf-side-sub {
        padding-left: 26px;
    }
}

@media print {
    .wf-sidebar,
    .wf-appbar,
    .wf-scrim {
        display: none !important;
    }

    .wf-layout-side .wf-main {
        margin-left: 0 !important;
    }
}

/* --- The choices on the Layout page --- */
.wf-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 575.98px) {
    .wf-choice-grid {
        grid-template-columns: 1fr;
    }
}

.wf-choice-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wf-choice {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius);
    background: var(--wf-surface);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wf-choice:hover {
    border-color: var(--wf-teal-bright);
}

.wf-choice-input:checked + .wf-choice {
    border-color: var(--wf-teal);
    box-shadow: 0 0 0 3px rgba(20, 112, 123, 0.16);
}

.wf-choice-input:focus-visible + .wf-choice {
    outline: 2px solid var(--wf-teal);
    outline-offset: 2px;
}

.wf-choice-name {
    font-family: var(--wf-font-head);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--wf-navy);
    margin-top: 6px;
}

.wf-choice-input:checked + .wf-choice .wf-choice-name::after {
    content: ' \2713';
    color: var(--wf-teal);
}

.wf-choice-note {
    font-size: 0.8rem;
    color: var(--wf-text-muted);
}

/* The small picture: a page with the menu drawn on it, across the top or down the side,
   navy or white. */
.wf-choice-picture {
    position: relative;
    display: block;
    height: 92px;
    border-radius: var(--wf-radius-sm);
    background: var(--wf-canvas);
    border: 1px solid var(--wf-line);
    overflow: hidden;
}

.wf-choice-menu {
    position: absolute;
    background: linear-gradient(170deg, var(--wf-navy), var(--wf-navy-mid));
}

.wf-choice-picture.is-light .wf-choice-menu {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 27, 51, 0.16);
}

.wf-choice-picture.is-top .wf-choice-menu {
    left: 0;
    right: 0;
    top: 0;
    height: 18px;
}

.wf-choice-picture.is-side .wf-choice-menu {
    left: 0;
    top: 0;
    bottom: 0;
    width: 34px;
}

/* A white card on the page, standing for the content. */
.wf-choice-page {
    position: absolute;
    background: #ffffff;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(15, 27, 51, 0.1);
}

.wf-choice-picture.is-top .wf-choice-page {
    left: 14px;
    right: 14px;
    top: 30px;
    bottom: 10px;
}

.wf-choice-picture.is-side .wf-choice-page {
    left: 46px;
    right: 12px;
    top: 12px;
    bottom: 10px;
}

/* =====================================================================
   Sprint 3
   ===================================================================== */

/* A box that cannot be typed in looks it: a grey ground and softer text, so a locked box
   is never mistaken for an open one. On the fixture form the destination follows the
   first discharge port and is locked while it does. */
.form-control[readonly] {
    background-color: var(--wf-tint-slate);
    color: var(--wf-text-muted);
    cursor: default;
}

.form-control[readonly]:focus {
    background-color: var(--wf-tint-slate);
    border-color: var(--wf-line);
    box-shadow: none;
}

/* The change history on the fixture form wraps its text rather than cutting it short. */
.wf-history-table thead th,
.wf-history-table tbody td {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}

/* A list's filters sit behind one Filters button on a phone. A tap opens them and a tap
   closes them. On a tablet or a desktop the filters are always shown and the button is not. */
.filter-toggle {
    display: none;
}

@media (min-width: 768px) {
    .wf-toolbar .filter-panel.collapse:not(.show) {
        display: flex;
    }
}

@media (max-width: 767.98px) {
    .filter-toggle {
        display: block;
        width: 100%;
        min-height: 38px;
    }

    .wf-toolbar .filter-panel.collapse:not(.show) {
        display: none;
    }

    /* The print, Excel and Add buttons keep their own row, with Add easy to reach. */
    .wf-toolbar .wf-toolbar-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .wf-toolbar .wf-toolbar-actions .btn {
        min-height: 38px;
        min-width: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Text of 16 pixels in every box on a phone, so tapping a box does not zoom the page. */
    .form-control,
    .form-select,
    .form-control-sm,
    .form-select-sm,
    .wf-tags-input {
        font-size: 16px;
    }
}

/* Parcels on the ledger, such as (17+7), sit on their own short line under the total, so
   the Qty column stays narrow and the parcels are never cut off. */
.qty-parcels {
    display: block;
    font-size: 0.85em;
    color: var(--wf-text-muted);
    white-space: nowrap;
}

/* Will's logo in the bar, the side menu and the phone bar. It keeps its own shape and is
   never stretched: only its height is set. White on navy; in Light Mode the same logo
   shows black. Folded to a rail, the side menu shows his shield alone. */
.wf-brand-logo {
    display: block;
    height: 32px;
    width: auto;
    max-width: 100%;
}

.wf-side-brand .wf-brand-logo,
.wf-appbar .wf-brand-logo {
    height: 28px;
}

.wf-menu-light .wf-brand-logo {
    filter: invert(1);
}

.wf-side-brand .wf-rail-only {
    display: none;
    width: auto;
}

.wf-shell.wf-rail .wf-side-brand .wf-rail-only,
.wf-pre-collapsed .wf-side-brand .wf-rail-only {
    display: block;
}

@media (max-width: 991.98px) {
    .wf-shell.wf-rail .wf-side-brand .wf-rail-only,
    .wf-pre-collapsed .wf-side-brand .wf-rail-only {
        display: none;
    }
}

/* The sign in page: Will's logo with the shield above the name, centred, with room. */
.wf-login-logo {
    display: block;
    width: 200px;
    max-width: 100%;
    height: auto;
    margin: 4px auto 8px;
}

/* On a phone the Quick Add save buttons stay at the foot of the box, so they can be
   reached without scrolling, held upright or sideways, and are big enough for a thumb. */
@media (max-width: 767.98px) {
    .wf-quick-add .wf-form-actions {
        position: sticky;
        bottom: calc(-1 * var(--bs-modal-padding, 1rem));
        margin-bottom: calc(-1 * var(--bs-modal-padding, 1rem));
        padding: 10px 0 var(--bs-modal-padding, 1rem);
        background: var(--wf-surface);
        box-shadow: 0 -8px 12px -10px rgba(15, 27, 51, 0.35);
        z-index: 2;
    }

    .wf-quick-add .wf-form-actions .btn {
        min-height: 44px;
    }

    /* Task 3.13: the report buttons, big enough for a thumb. */
    form[data-pdf-preview-form] .wf-form-actions .btn {
        min-height: 38px;
    }
}


/* =====================================================================
   Task 5.2: the grade insights page. Built for a phone first: each block fits a phone
   screen and the fixtures behind any figure are one tap away. The bars are plain blocks
   drawn on the server, so the PDF shows the same picture.
   ===================================================================== */
.ins-grade-tabs {
    margin-bottom: 12px;
}

.ins-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-bottom: 10px;
}

.ins-periods {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.ins-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* Patch 5.1, Item 5: while a new choice is fetched, the page fades a little, so a tap is
   seen to have done something. */
#insPage {
    transition: opacity 0.15s ease-in-out;
}

#insPage.is-swapping {
    opacity: 0.55;
}

/* Patch 5.1, Item 4: the Period and Size rows one under the other, their chips lined up.
   On a tablet or a desktop they are always shown; on a phone they sit behind Filters. */
.ins-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ins-choices .dash-filter-label {
    min-width: 50px;
}

@media (min-width: 768px) {
    .ins-toolbar .filter-panel.collapse:not(.show) {
        display: flex;
    }
}

@media (max-width: 767.98px) {
    .ins-toolbar .filter-panel.collapse:not(.show) {
        display: none;
    }

    .ins-toolbar .filter-panel {
        width: 100%;
    }
}

.ins-dates {
    font-size: 0.86rem;
    color: var(--wf-text-muted);
    margin-bottom: 14px;
}

.ins-headline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.ins-tile {
    min-width: 0;
    cursor: pointer;
    transition: box-shadow 0.15s ease-in-out;
}

.ins-tile:hover,
.ins-tile:focus-visible {
    box-shadow: var(--wf-shadow-hover);
    outline: none;
}

.ins-top-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ins-top-name {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--wf-text);
}

.ins-top-share {
    color: var(--wf-text-muted);
    font-variant-numeric: tabular-nums;
}

/* Task 5.14: beside the first figure, how it compares with the period before. */
.ins-trend {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    border-radius: var(--wf-radius-pill);
    font-family: var(--wf-font-head);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    vertical-align: 0.35em;
    color: var(--wf-text-muted);
    background: var(--wf-tint-slate);
}

.ins-trend.is-up {
    color: var(--wf-green);
    background: var(--wf-tint-green);
}

.ins-trend.is-down {
    color: var(--wf-danger);
    background: var(--wf-tint-red);
}

/* Leon, 27 November 2026 (in place of the columns of Snag 49): the blocks sit in even rows.
   Each block takes its share of a row, a narrow one (a figure or a ring) a quarter and a
   wide one (a comparison or bars) a third, in page order. A block that does not fit starts
   the next row, and the blocks on a row grow to fill it, so a row is never left part empty
   and its blocks are the same height. */
.ins-blocks {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 18px;
    margin-bottom: 24px;
}

.ins-block.is-narrow {
    flex: 1 1 calc(25% - 18px);
}

.ins-block.is-wide {
    flex: 1 1 calc(33.333% - 18px);
}

.ins-block {
    display: block;
    min-width: 0;
    background: var(--wf-surface);
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow);
    padding: 16px 18px 12px;
    min-width: 0;
}

.ins-block-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: var(--wf-font-head);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--wf-navy);
    margin-bottom: 8px;
}

.ins-block-unit {
    font-family: var(--wf-font-body);
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--wf-text-faint);
}

.ins-nothing {
    font-size: 0.86rem;
    color: var(--wf-text-muted);
    margin: 6px 0 8px;
}

.ins-key {
    font-size: 0.72rem;
    color: var(--wf-text-muted);
    margin-bottom: 8px;
}

.ins-key-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin: 0 4px 0 0;
    vertical-align: -1px;
}

.ins-key-swatch.is-before {
    margin-left: 10px;
}

.ins-key-expected {
    margin-left: 10px;
}

.ins-row {
    padding: 7px 6px 8px;
    margin: 0 -6px 2px;
    border-radius: var(--wf-radius-sm);
    cursor: pointer;
}

.ins-row + .ins-row {
    border-top: 1px solid var(--wf-line-soft);
}

.ins-row:hover,
.ins-row:focus-visible {
    background: var(--wf-tint-teal);
    outline: none;
}

.ins-row-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.8rem;
    line-height: 1.3;
    margin-bottom: 3px;
}

.ins-row-label {
    color: var(--wf-text);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.ins-row-figure {
    white-space: nowrap;
    color: var(--wf-navy);
    font-variant-numeric: tabular-nums;
}

.ins-row-share {
    color: var(--wf-text-muted);
    margin-left: 6px;
}

.ins-track {
    position: relative;
    height: 10px;
    background: var(--wf-line-soft);
    border-radius: 3px;
    overflow: hidden;
}

/* Task 5.14: a block with two or more parts opens with one bar cut into each part's
   share, in its own colour, and each row's dot and bar take the same colour. Others and
   anything not set are grey. The colours are set on the page from InsightBlock.Palette. */
.ins-share {
    display: flex;
    height: 22px;
    margin: 2px 0 12px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--wf-line-soft);
}

.ins-share-part {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    font-family: var(--wf-font-head);
    font-size: 0.66rem;
    font-weight: 700;
    color: #ffffff;
    border-right: 2px solid var(--wf-surface);
}

.ins-share-part:last-child {
    border-right: 0;
}

.ins-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 2px;
    margin-right: 7px;
    vertical-align: 0;
}

/* Snags 33 and 34: the previous period is its own line, a button that lists that
   period's fixtures, with its grey bar and its figure on the right, so the figure reads
   with its own row and never with the next. */
.ins-before {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 8px;
    width: 100%;
    margin-top: 4px;
    padding: 0;
    background: none;
    border: 0;
    text-align: left;
    cursor: pointer;
}

.ins-before:hover .ins-before-figure,
.ins-before:focus-visible .ins-before-figure {
    color: var(--wf-teal-deep);
    text-decoration: underline;
}

.ins-track.is-thin {
    height: 6px;
    background: var(--wf-line-soft);
}

.ins-fill {
    display: block;
    height: 100%;
    border-radius: 3px;
}

.ins-fill.is-now,
.ins-key-swatch.is-now {
    background: var(--wf-teal);
}

.ins-fill.is-before,
.ins-key-swatch.is-before {
    background: #b9c3cf;
}

.ins-before-figure {
    font-size: 0.72rem;
    line-height: 1.2;
    color: var(--wf-text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.ins-expected {
    display: inline-block;
    margin-top: 6px;
    padding: 1px 9px;
    font-size: 0.72rem;
    color: var(--wf-teal-deep);
    background: var(--wf-tint-teal);
    border: 0;
    border-radius: var(--wf-radius-pill);
    cursor: pointer;
}

/* Patch 5.1, Item 1: a block of one row is a large figure, with the change under it and
   the previous figure small under that. */
.ins-one {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 6px 8px;
    margin: 0 -6px;
    border-radius: var(--wf-radius-sm);
    cursor: pointer;
}

.ins-one:hover,
.ins-one:focus-visible {
    background: var(--wf-tint-teal);
    outline: none;
}

.ins-one-label {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--wf-text-muted);
    overflow-wrap: anywhere;
}

.ins-one-figure {
    font-family: var(--wf-font-head);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--wf-navy);
    font-variant-numeric: tabular-nums;
}

.ins-one-figure .stat-unit {
    margin-left: 6px;
}

.ins-one-under {
    font-size: 0.8rem;
    color: var(--wf-text-muted);
}

.ins-one-before {
    display: inline-block;
    margin-top: 2px;
    padding: 0;
    font-size: 0.74rem;
    color: var(--wf-text-faint);
    background: none;
    border: 0;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}

.ins-one-before:hover,
.ins-one-before:focus-visible {
    color: var(--wf-teal-deep);
    text-decoration: underline;
}

/* Leon, 27 November 2026: in an even row a one figure block is often taller than its
   figure, so the figure sits in the middle of the space under the heading. */
.ins-block.is-figure {
    display: flex;
    flex-direction: column;
}

.ins-block.is-figure .ins-one {
    margin-top: auto;
}

.ins-block.is-figure .ins-one-before,
.ins-block.is-figure .ins-expected {
    align-self: flex-start;
}

.ins-block.is-figure > :last-child {
    margin-bottom: auto;
}

/* Patch 5.1, Item 1: two or three rows are a ring shaped pie, with its key beside it on a
   computer and under it on a phone. The slices take the colours of the bars. */
.ins-pie {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    margin-top: 4px;
}

.ins-ring {
    flex: 0 0 auto;
    width: 128px;
    height: 128px;
}

.ins-ring text {
    font-family: var(--wf-font-head);
}

.ins-pie-key {
    flex: 1 1 160px;
    min-width: 0;
}

.ins-pie-key .ins-key {
    margin-bottom: 4px;
}

.ins-pie-key .ins-key-swatch.is-before {
    margin-left: 0;
}

.ins-pie-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 8px;
    padding: 4px 0 5px;
}

.ins-pie-row + .ins-pie-row {
    border-top: 1px solid var(--wf-line-soft);
}

.ins-pie-item {
    display: flex;
    flex: 1 1 auto;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 3px 6px;
    margin-left: -6px;
    font-size: 0.8rem;
    line-height: 1.3;
    border-radius: var(--wf-radius-sm);
    cursor: pointer;
}

.ins-pie-item:hover,
.ins-pie-item:focus-visible {
    background: var(--wf-tint-teal);
    outline: none;
}

.ins-pie-before {
    padding: 0;
    font-size: 0.72rem;
    color: var(--wf-text-faint);
    background: none;
    border: 0;
    white-space: nowrap;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}

.ins-pie-before:hover,
.ins-pie-before:focus-visible {
    color: var(--wf-teal-deep);
    text-decoration: underline;
}

.ins-pie-row .ins-expected {
    margin-top: 0;
}

/* Leon, 27 November 2026: the comparison chart. Each row is one line: the name, a rail
   with a grey dot for the previous period and a dot in the row's colour for this period,
   joined by a line in that colour, then the figure and share. The previous figure follows
   in grey and lists its own fixtures. */
.ins-key-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin: 0 4px 0 0;
    vertical-align: -1px;
}

.ins-key-dot.is-before {
    margin-left: 10px;
    background: #b9c3cf;
}

.ins-cmp-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 8px;
}

.ins-cmp-row + .ins-cmp-row {
    border-top: 1px solid var(--wf-line-soft);
}

.ins-cmp-item {
    display: grid;
    grid-template-columns: minmax(0, 34%) minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    padding: 7px 6px;
    margin-left: -6px;
    font-size: 0.8rem;
    border-radius: var(--wf-radius-sm);
    cursor: pointer;
}

.ins-cmp-item:hover,
.ins-cmp-item:focus-visible {
    background: var(--wf-tint-teal);
    outline: none;
}

.ins-cmp-label {
    color: var(--wf-text);
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.ins-cmp-track {
    position: relative;
    height: 14px;
    margin: 0 6px;
    background: linear-gradient(var(--wf-line-soft), var(--wf-line-soft)) center / 100% 2px no-repeat;
}

.ins-cmp-line {
    position: absolute;
    top: 6px;
    height: 2px;
    opacity: 0.45;
}

.ins-cmp-dot {
    position: absolute;
    top: 2px;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--wf-surface);
}

.ins-cmp-dot.is-before {
    background: #b9c3cf;
}

.ins-cmp-figure {
    color: var(--wf-navy);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.ins-cmp-before {
    min-width: 42px;
    padding: 0;
    font-size: 0.72rem;
    text-align: right;
    color: var(--wf-text-faint);
    background: none;
    border: 0;
    white-space: nowrap;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}

.ins-cmp-before:hover,
.ins-cmp-before:focus-visible {
    color: var(--wf-teal-deep);
    text-decoration: underline;
}

.ins-cmp-expected {
    margin: 0 0 6px;
}

/* Leon, 27 November 2026: on a tablet or a computer each bar is one line, the name, the
   bar and the figure, the same height as a comparison row, so blocks side by side end
   together. On a phone the name and figure stay over the bar. */
@media (min-width: 768px) {
    .ins-block.is-bars .ins-row {
        display: grid;
        grid-template-columns: minmax(0, 34%) minmax(0, 1fr) auto;
        grid-template-areas: "label track figure";
        align-items: center;
        column-gap: 10px;
        padding: 7px 6px;
    }

    .ins-block.is-bars .ins-row-head { display: contents; }
    .ins-block.is-bars .ins-row-label { grid-area: label; }
    .ins-block.is-bars .ins-row-figure { grid-area: figure; }
    .ins-block.is-bars .ins-row > .ins-track { grid-area: track; }
}

/* Patch 5.1, Item 3: the small note under the charterer figures. */
.ins-block-note {
    font-size: 0.72rem;
    color: var(--wf-text-faint);
    margin: 6px 0 0;
}

.ins-tile-note {
    display: block;
    margin-top: 4px;
    font-size: 0.7rem;
    color: var(--wf-text-faint);
}

.ins-list-sub {
    font-size: 0.82rem;
    color: var(--wf-text-muted);
    margin-bottom: 10px;
}

/* Every value shows in full, never cut short with dots. Long text wraps between words,
   never inside one. Dates, sizes, quantities, rates and the status stay on one line, as on
   the ledger (Snag 37). Where the window is too narrow for every column, the table scrolls
   inside its own box, never the page. */
.ins-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table.ins-table thead th,
.table.ins-table tbody td {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: normal;
    word-break: normal;
    padding-left: 8px;
    padding-right: 8px;
}

.table.ins-table thead th,
.table.ins-table tbody td.ins-c-date,
.table.ins-table tbody td.ins-c-size,
.table.ins-table tbody td.ins-c-qty,
.table.ins-table tbody td.ins-c-status {
    white-space: nowrap;
}

/* Snag 52: vessel, charterer and rate stay on one line; a table too wide for its box
   scrolls inside the box. On a phone the rows are cards and wrap as before. */
@media (min-width: 768px) {
    .table.ins-table tbody td.ins-c-vessel,
    .table.ins-table tbody td.ins-c-charterer,
    .table.ins-table tbody td.ins-c-rate {
        white-space: nowrap;
    }
}

/* On a smaller computer three narrow blocks share a row, and two wide ones. */
@media (max-width: 1199.98px) {
    .ins-block.is-narrow {
        flex-basis: calc(33.333% - 18px);
    }

    .ins-block.is-wide {
        flex-basis: calc(50% - 18px);
    }
}

/* On a tablet two blocks share a row, and a block left on its own takes the whole row. */
@media (max-width: 991.98px) {
    .ins-block.is-narrow,
    .ins-block.is-wide {
        flex-basis: calc(50% - 18px);
    }
}

@media (max-width: 767.98px) {
    .ins-blocks {
        gap: 12px;
    }

    .ins-block.is-narrow,
    .ins-block.is-wide {
        flex-basis: 100%;
    }

    /* Snag 35: the four grade tabs on one line, scrolling sideways in their strip only if
       more grades are ever added. */
    .ins-grade-tabs {
        gap: 18px;
        overflow-x: auto;
    }

    .ins-grade-tabs .region-tab {
        min-height: 40px;
        letter-spacing: 0.05em;
    }

    /* Snag 36: Arrived and Expected side by side, Top charterers under them. */
    .ins-headline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .ins-headline .ins-tile {
        padding: 14px 14px;
    }

    .ins-headline .ins-tile:nth-child(3) {
        grid-column: 1 / -1;
    }

    .ins-headline .stat-figure {
        font-size: 1.45rem;
    }

    .ins-before {
        min-height: 30px;
    }

    .ins-periods .dash-chip {
        min-height: 38px;
        padding: 4px 14px;
    }

    .ins-actions {
        width: 100%;
    }

    .ins-actions .btn {
        flex: 1 1 0;
        min-height: 38px;
    }

    .ins-row {
        padding: 8px 6px;
    }

    /* Leon, 27 November 2026: on a phone each comparison row has its name and figure on
       one line and the dots full width under them, easy to tap. */
    .ins-cmp-item {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "label figure" "track track";
        row-gap: 6px;
        min-height: 38px;
    }

    .ins-cmp-label { grid-area: label; }
    .ins-cmp-figure { grid-area: figure; }
    .ins-cmp-track { grid-area: track; }

    .ins-cmp-before {
        min-height: 30px;
        align-self: flex-end;
    }

    /* Patch 5.1, Item 1: on a phone the pie's key sits under the ring, full width, and
       each of its rows is easy to tap. */
    .ins-pie {
        flex-direction: column;
        align-items: stretch;
    }

    .ins-ring {
        align-self: center;
    }

    .ins-pie-key {
        flex: 0 0 auto;
    }

    .ins-pie-item {
        align-items: center;
        min-height: 38px;
    }

    .ins-pie-before,
    .ins-one-before {
        min-height: 30px;
    }

    .ins-expected {
        min-height: 30px;
        padding: 4px 12px;
    }

    /* Snag 38: on a phone each fixture is a short card of four lines: the vessel and its
       status; the size, charterer, quantity and cargo; the load port to the discharge port;
       and the laycan, ETA and rate, labelled where a value could be mistaken. */
    .ins-table-wrap {
        overflow-x: visible;
    }

    .table.ins-table.table-stack tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        column-gap: 10px;
        row-gap: 2px;
        padding: 8px 12px;
    }

    .table.ins-table.table-stack tbody tr::before,
    .table.ins-table.table-stack tbody tr::after {
        content: "";
        flex-basis: 100%;
        height: 0;
    }

    .table.ins-table.table-stack tbody tr::before { order: 7; }
    .table.ins-table.table-stack tbody tr::after { order: 10; }

    .table.ins-table.table-stack tbody td {
        display: block;
        padding: 0;
        min-height: 0;
        text-align: left;
        font-size: 0.86rem;
        white-space: normal;
    }

    .table.ins-table.table-stack tbody td::before {
        display: none;
    }

    /* Snag 41: the vessel and its status own the first line, so the vessel is never
       squeezed; the charterer, quantity and cargo start the second line. */
    .table.ins-table.table-stack tbody tr {
        position: relative;
    }

    .table.ins-table.table-stack tbody td.ins-c-vessel {
        order: 1;
        flex: 0 0 100%;
        min-width: 0;
        padding-right: 76px;
        font-weight: 700;
        color: var(--wf-navy);
    }

    /* Snag 41 retest: flex items paint in their order, so the pinned status is lifted
       above the vessel cell, which would otherwise paint over it. */
    .table.ins-table.table-stack tbody td.ins-c-status {
        position: absolute;
        top: 8px;
        right: 12px;
        z-index: 2;
        background: transparent;
    }
    .table.ins-table.table-stack tbody td.ins-c-size { order: 3; font-weight: 600; color: var(--wf-text-muted); }
    .table.ins-table.table-stack tbody td.ins-c-charterer { order: 4; }
    .table.ins-table.table-stack tbody td.ins-c-qty { order: 5; }
    .table.ins-table.table-stack tbody td.ins-c-cargo { order: 6; }
    .table.ins-table.table-stack tbody td.ins-c-load { order: 8; }
    .table.ins-table.table-stack tbody td.ins-c-discharge { order: 9; }
    .table.ins-table.table-stack tbody td.ins-c-laycan { order: 11; }
    .table.ins-table.table-stack tbody td.ins-c-eta { order: 12; }
    .table.ins-table.table-stack tbody td.ins-c-rate { order: 13; }

    .table.ins-table.table-stack tbody td.ins-c-qty::after {
        content: " kt";
    }

    /* Snag 40: "to" belongs to the discharge port, so it shows only when there is one, and
       a value that is empty takes its label away with it. */
    .table.ins-table.table-stack tbody td.ins-c-discharge::before {
        display: inline;
        position: static;
        content: "to ";
        font-size: 0.86rem;
        color: var(--wf-text-faint);
    }

    .table.ins-table.table-stack tbody td:empty {
        display: none;
    }

    .table.ins-table.table-stack tbody td.ins-c-laycan::before,
    .table.ins-table.table-stack tbody td.ins-c-eta::before,
    .table.ins-table.table-stack tbody td.ins-c-rate::before {
        display: inline;
        position: static;
        content: attr(data-label) " ";
        font-size: 0.68rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--wf-text-faint);
    }

    /* The row that says the list is empty stays a plain line. */
    .table.ins-table.table-stack tbody td[colspan] {
        flex: 1 1 100%;
        text-align: center;
    }
}

/* Task 5.5: the tracker under the blocks on a grade page. */
.ins-tracker {
    margin-bottom: 24px;
}

.ins-tracker-title {
    font-family: var(--wf-font-head);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--wf-navy);
    margin-bottom: 12px;
}

.ins-tracker-section {
    margin-bottom: 18px;
}

.ins-tracker-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--wf-font-head);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--wf-text-muted);
    margin-bottom: 8px;
}

/* Task 5.6 and 5.14: Will's note on a grade page, as he wrote it, line breaks kept. A
   card of its own under the dates, with its INSIGHTS heading and its Add insights or Edit insights button,
   so a note is plainly part of the page. With no note an Admin sees a dashed invitation. */
.ins-note {
    background: var(--wf-surface);
    border-left: 4px solid var(--wf-teal);
    border-radius: var(--wf-radius-sm);
    box-shadow: var(--wf-shadow);
    padding: 14px 18px 12px;
    margin-bottom: 20px;
}

.ins-note.is-empty {
    background: #f7fbfc;
    border: 1.5px dashed #a9d3d8;
    border-left: 4px solid var(--wf-teal-bright);
    box-shadow: none;
}

.ins-note-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.ins-note-label {
    font-family: var(--wf-font-head);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--wf-teal-deep);
}

.ins-note-text {
    white-space: pre-line;
    overflow-wrap: anywhere;
    font-size: 1.08rem;
    line-height: 1.5;
    color: var(--wf-navy);
    margin-bottom: 6px;
}

.ins-note-invite {
    font-size: 0.86rem;
    color: var(--wf-text-muted);
    margin: 0;
    max-width: 760px;
}

.ins-note-date {
    font-size: 0.74rem;
    color: var(--wf-text-faint);
    margin-bottom: 0;
}

@media (max-width: 767.98px) {
    .ins-note-box {
        font-size: 16px;
    }

    .ins-note-button {
        min-height: 38px;
    }
}

/* Task 5.3: the change on the previous period under a block's heading, and the line under
   the bars that opens its own list, such as the MIXED cargoes left out of diesel. */
.ins-block-change {
    font-size: 0.78rem;
    color: var(--wf-text-muted);
    margin: -4px 0 8px;
}

.ins-foot {
    display: block;
    width: 100%;
    text-align: left;
    margin-top: 6px;
    padding: 6px 0 2px;
    font-size: 0.74rem;
    color: var(--wf-teal-deep);
    background: none;
    border: 0;
    border-top: 1px solid var(--wf-line-soft);
    cursor: pointer;
}

@media (max-width: 767.98px) {
    .ins-foot {
        min-height: 38px;
    }
}

/* Task 5.4: the Imports and Exports tabs on CHEMS, and the two figures of the Exports tab. */
.ins-dir-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

/* Snag 49: on Exports the two headline boxes share the full width. */
.ins-headline.is-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 767.98px) {
    .ins-dir-tabs .dash-chip {
        min-height: 38px;
        padding: 4px 18px;
    }
}

/* Task 5.9: the Share box. */
.share-all {
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--wf-line-soft);
}

.share-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.share-link {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--wf-line-soft);
}

.share-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.share-buttons {
    display: flex;
    gap: 6px;
}

@media (max-width: 767.98px) {
    #shareModal .form-check {
        min-height: 38px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    #shareModal .form-check-input {
        width: 1.25em;
        height: 1.25em;
        margin-top: 0;
    }

    .share-buttons .btn {
        min-height: 38px;
    }
}

/* Task 5.10: the page shown for an expired or unknown link. */
.ins-expired {
    max-width: 520px;
    margin: 48px auto;
    padding: 24px 28px;
    background: var(--wf-surface);
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow);
    font-size: 1rem;
    text-align: center;
}

.ins-expired p {
    margin: 0;
}

/* Task 5.11: the read only ledger opened from a link. Every column shows in full; where
   the window is too narrow for them all, the table scrolls inside its own box. */
.table.link-ledger {
    font-size: 0.78rem;
}

.table.link-ledger thead th,
.table.link-ledger tbody td {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: normal;
    word-break: normal;
    padding-left: 6px;
    padding-right: 6px;
}

/* Headings wrap between words, so a long heading such as Destination Area does not set
   the column's width; dates and quantities stay on one line. */
.table.link-ledger thead th {
    letter-spacing: 0.04em;
    vertical-align: bottom;
}

.table.link-ledger tbody td.ins-c-date,
.table.link-ledger tbody td.cell-num {
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .link-ledger-wrap {
        overflow-x: visible;
    }

    .table.link-ledger.table-stack tbody td {
        text-align: right;
        padding: 6px 12px 6px 130px;
    }

    .table.link-ledger.table-stack tbody td:empty {
        display: none;
    }

    .table.link-ledger.table-stack tbody td.cell-vessel {
        padding-left: 12px;
        text-align: left;
    }

    .table.link-ledger.table-stack tbody td.cell-vessel::before {
        display: none;
    }
}

/* Task 5.11: the link ledger's reading columns fit the page; Show every column adds the
   rest. Snag 45: on a phone the cards show the same reading fields, as the signed in
   ledger's cards do, and the other six only after Show every column. */
.table.link-ledger:not(.is-full) .col-full,
.table.link-ledger.table-stack:not(.is-full) tbody td.col-full {
    display: none;
}

.link-ledger-columns {
    font-size: 0.8rem;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .link-ledger-columns {
        display: inline-flex;
        align-items: center;
        min-height: 38px;
    }
}

/* Snag 44: on a phone a recipient card is the name as its heading with the active dot at
   the top right, then the email and the mobile under it without labels. Last opened keeps
   its small label, since a date alone could be mistaken. */
@media (max-width: 767.98px) {
    .table.recipients-table.table-stack tbody tr {
        position: relative;
        padding: 8px 0 6px;
    }

    .table.recipients-table.table-stack tbody td.rec-name,
    .table.recipients-table.table-stack tbody td.rec-line {
        padding: 2px 12px;
        text-align: left;
        min-height: 0;
    }

    .table.recipients-table.table-stack tbody td.rec-name {
        padding-right: 100px;
        font-weight: 700;
        color: var(--wf-navy);
    }

    .table.recipients-table.table-stack tbody td.rec-name::before,
    .table.recipients-table.table-stack tbody td.rec-line::before,
    .table.recipients-table.table-stack tbody td.rec-active::before {
        display: none;
    }

    .table.recipients-table.table-stack tbody td.rec-active {
        position: absolute;
        top: 8px;
        right: 12px;
        z-index: 2;
        padding: 0;
        min-height: 0;
        background: transparent;
    }

    .table.recipients-table.table-stack tbody td:empty {
        display: none;
    }
}

/* Snag 56: on a phone the activity list in its card keeps no outline round the whole
   list, so each row and each day line reads as before. */
@media (max-width: 767.98px) {
    .table-wrapper.wf-table-inset.act-wrap { box-shadow: none; }
}

/* Snag 47: on a phone each activity row is one short line, the time small on the left,
   then the grade, the activity and the detail, with a line for the day when it changes. */
.act-day-row {
    display: none;
}

@media (max-width: 767.98px) {
    .table.recipient-activity.table-stack tbody tr.act-day-row {
        display: block;
        border: 0;
        background: transparent;
        margin: 10px 0 4px;
        padding: 0;
    }

    .table.recipient-activity.table-stack tbody tr.act-day-row td {
        padding: 0;
        text-align: left;
        background: transparent;
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--wf-text-muted);
    }

    .table.recipient-activity.table-stack tbody tr.act-row {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        column-gap: 8px;
        padding: 6px 12px;
        margin-bottom: 4px;
    }

    .table.recipient-activity.table-stack tbody tr.act-row td {
        display: inline;
        padding: 0;
        min-height: 0;
        text-align: left;
        background: transparent;
    }

    .table.recipient-activity.table-stack tbody tr.act-row td::before {
        display: none;
    }

    .table.recipient-activity.table-stack tbody tr.act-row td:empty {
        display: none;
    }

    .table.recipient-activity.table-stack tbody tr.act-row .act-date {
        display: none;
    }

    .table.recipient-activity.table-stack tbody tr.act-row td.act-when {
        font-size: 0.75rem;
        color: var(--wf-text-muted);
        font-variant-numeric: tabular-nums;
    }

    .table.recipient-activity.table-stack tbody tr.act-row td.act-activity {
        font-weight: 600;
    }
}

/* Snag 48: on a phone a correction reads as one line, Cargo: CPP to ULSD, with a small
   second line for the source, the number of times and the last date. */
.corr-unit {
    display: none;
}

@media (max-width: 767.98px) {
    .table.corrections-table.table-stack tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        column-gap: 6px;
        padding: 8px 12px;
    }

    .table.corrections-table.table-stack tbody tr::after {
        content: "";
        order: 4;
        flex-basis: 100%;
        height: 0;
    }

    .table.corrections-table.table-stack tbody td {
        display: inline;
        padding: 0;
        min-height: 0;
        text-align: left;
        background: transparent;
    }

    .table.corrections-table.table-stack tbody td::before {
        display: none;
    }

    .table.corrections-table.table-stack tbody td.corr-field { order: 1; font-weight: 700; color: var(--wf-navy); }
    .table.corrections-table.table-stack tbody td.corr-field::after { content: ":"; }
    .table.corrections-table.table-stack tbody td.corr-before { order: 2; font-weight: 600; }
    .table.corrections-table.table-stack tbody td.corr-after { order: 3; font-weight: 600; }

    .table.corrections-table.table-stack tbody td.corr-after::before {
        display: inline;
        position: static;
        content: "to ";
        font-weight: 400;
        color: var(--wf-text-faint);
    }

    .table.corrections-table.table-stack tbody td.corr-source,
    .table.corrections-table.table-stack tbody td.corr-times,
    .table.corrections-table.table-stack tbody td.corr-last {
        order: 5;
        font-size: 0.75rem;
        color: var(--wf-text-muted);
    }

    .table.corrections-table.table-stack tbody td.corr-source::after,
    .table.corrections-table.table-stack tbody td.corr-times::after {
        content: ",";
    }

    .table.corrections-table.table-stack tbody td.corr-last::before {
        display: inline;
        position: static;
        content: "last ";
        font-size: 0.75rem;
        color: var(--wf-text-muted);
    }

    .corr-unit {
        display: inline;
    }
}
