html, body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
    overflow-x: clip;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ---------- Boot splash (wwwroot/index.html) ----------
   Shown while the WASM runtime downloads, before MudBlazor's CSS variables exist, so colours are
   hard-coded to the Trawlwise light theme (Primary #245476, Background #F8FAFC).
   Layout mirrors Shared/LoadingScreen.razor (64px logo, mb-6, large MudProgressCircular). */
.boot-splash {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #f8fafc;
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.boot-splash-logo {
    height: 64px;
    margin-bottom: 24px;
}

.boot-splash-spinner {
    width: 70px;
    height: 70px;
    animation: boot-splash-rotate 1.4s linear infinite;
}

    .boot-splash-spinner circle {
        stroke: #245476;
        stroke-linecap: round;
        stroke-dasharray: 80px, 200px;
        stroke-dashoffset: 0;
        animation: boot-splash-dash 1.4s ease-in-out infinite;
    }

/* Download progress reported by blazor.webassembly.js via --blazor-load-percentage-text. */
.boot-splash-progress {
    margin-top: 16px;
    min-height: 1.25rem;
    font-size: 0.875rem;
    color: #64748b;
}

    .boot-splash-progress:after {
        content: var(--blazor-load-percentage-text, "");
    }

@keyframes boot-splash-rotate {
    100% { transform: rotate(360deg); }
}

@keyframes boot-splash-dash {
    0% { stroke-dasharray: 1px, 200px; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 100px, 200px; stroke-dashoffset: -15px; }
    100% { stroke-dasharray: 100px, 200px; stroke-dashoffset: -125px; }
}

code {
    color: #c02d76;
}

/* ---------- In-app help (web mockup 19) ---------- */
/* The Help home: the search, "For you", a card per section, and support beside the last card. */
.help-hero { background: linear-gradient(180deg, color-mix(in srgb, var(--mud-palette-primary) 10%, var(--mud-palette-surface)), var(--mud-palette-background));
             border: 1px solid var(--mud-palette-lines-default); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.help-often { font-size: 0.75rem; color: var(--mud-palette-text-secondary); margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.help-often button { font: inherit; background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); border-radius: 99px;
                     padding: 2px 10px; color: var(--mud-palette-text-primary); cursor: pointer; }
.help-often button:hover { border-color: var(--mud-palette-primary); color: var(--mud-palette-primary); }
.help-pop { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.help-pc { background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); border-radius: 10px; padding: 10px 14px;
           font-size: 0.8125rem; display: flex; gap: 10px; align-items: flex-start; color: inherit; text-decoration: none; }
.help-pc:hover { border-color: var(--mud-palette-primary); }
.help-pc .mud-icon-root { color: var(--mud-palette-primary); flex: none; }
.help-pc b { display: block; font-weight: 600; }
.help-pc-d { color: var(--mud-palette-text-secondary); font-size: 0.75rem; }
.help-tgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.help-tc { background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); border-radius: 10px; padding: 12px 14px; font-size: 0.8125rem; }
.help-tc-nm { display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 6px; padding: 0; border: 0; background: none; font: inherit;
              font-size: 0.875rem; font-weight: 600; color: var(--mud-palette-text-primary); text-align: left; cursor: default; }
.help-tc-ic { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex: none;
              background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent); color: var(--mud-palette-primary); }
.help-tc-c { margin-left: auto; font-size: 0.6875rem; font-weight: 500; color: var(--mud-palette-text-secondary); }
.help-tc-n { display: none; margin-left: auto; font-size: 0.6875rem; font-weight: 500; color: var(--mud-palette-text-secondary); }
.help-tc-list a, .help-tc-all { display: block; padding: 3px 0; color: var(--mud-palette-primary); text-decoration: none; }
.help-tc-list a:hover { text-decoration: underline; }
.help-tc-all { border: 0; background: none; font: inherit; cursor: pointer; padding-left: 0; }
.help-new { font-size: 0.625rem; background: color-mix(in srgb, var(--mud-palette-info) 15%, transparent); color: color-mix(in srgb, var(--mud-palette-info) 50%, var(--mud-palette-text-primary));
            border-radius: 99px; padding: 0 6px; font-weight: 600; margin-left: 4px; vertical-align: middle; }
.help-support { grid-column: span var(--help-span, 3); background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default);
                border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 0.8125rem; }
.help-support-ic { color: var(--mud-palette-primary); font-size: 1.5rem !important; }
.help-support-t { flex: 1; min-width: 200px; }
.help-support-s { color: var(--mud-palette-text-secondary); font-size: 0.75rem; }
.help-support-b { display: flex; gap: 8px; flex-wrap: wrap; }

/* The search box, and its results dropping down under it. */
.help-search { position: relative; max-width: 620px; }
.help-search-box { display: flex; align-items: center; gap: 10px; background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-inputs);
                   border-radius: 10px; padding: 9px 12px; color: var(--mud-palette-text-secondary); }
.help-search-box .mud-icon-root { color: var(--mud-palette-primary); flex: none; }
.help-search-box.typing { border-color: var(--mud-palette-primary); box-shadow: 0 0 0 1px var(--mud-palette-primary) inset; }
.help-search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 0.9375rem; color: var(--mud-palette-text-primary); }
.help-search-box input::-webkit-search-cancel-button { display: none; }
.help-search-lg .help-search-box { padding: 11px 14px; }
.help-search-mid { margin: 0 auto 10px; text-align: left; }
.help-search-clear { border: 0; background: none; padding: 0; display: inline-flex; cursor: pointer; }
.help-search-clear .mud-icon-root { color: var(--mud-palette-text-secondary); }
.help-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 20; background: var(--mud-palette-surface);
                border: 1px solid var(--mud-palette-lines-default); border-radius: 10px; box-shadow: 0 6px 18px rgba(15, 36, 61, 0.10);
                font-size: 0.8125rem; max-height: 60vh; overflow-y: auto; }
.help-results-h { padding: 8px 14px; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--mud-palette-text-secondary);
                  font-weight: 600; border-bottom: 1px solid var(--mud-palette-lines-default); }
.help-hit { display: flex; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--mud-palette-lines-default); color: inherit; text-decoration: none; }
.help-hit:last-child { border-bottom: 0; }
.help-hit .mud-icon-root { color: var(--mud-palette-primary); flex: none; margin-top: 1px; }
.help-hit.on { background: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent); }
.help-hit b { font-weight: 600; }
.help-hit-sec { color: var(--mud-palette-text-secondary); font-size: 0.75rem; }
.help-hit-sn { font-size: 0.75rem; margin-top: 2px; }
.help-results mark { background: color-mix(in srgb, var(--mud-palette-warning) 30%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
.help-none { padding: 14px; }
.help-none-s { font-size: 0.75rem; color: var(--mud-palette-text-secondary); margin: 4px 0 10px; }

/* A guide: the article, and "On this page" and Related on the right. */
.help-facts { margin: 0 0 14px; }
.help-guide { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 20px; align-items: start; }
.help-rail { font-size: 0.8125rem; position: sticky; top: 76px; }
.help-box { background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.help-box-s { font-size: 0.75rem; color: var(--mud-palette-text-secondary); }
.help-box-s b { color: var(--mud-palette-text-primary); }
.help-box-s a { color: var(--mud-palette-primary); font-weight: 500; text-decoration: none; }
.help-rh { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--mud-palette-text-secondary); font-weight: 600; margin: 0 0 6px; }
.help-ot a { display: block; padding: 4px 10px; border-left: 2px solid var(--mud-palette-lines-default); color: var(--mud-palette-text-secondary); text-decoration: none; }
.help-ot a.on { border-left-color: var(--mud-palette-primary); color: var(--mud-palette-primary); font-weight: 600; }
.help-rel a { display: flex; gap: 6px; align-items: center; padding: 4px 0; color: var(--mud-palette-primary); text-decoration: none; }
.help-otm { display: none; background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); border-radius: 10px;
            padding: 8px 12px; font-size: 0.8125rem; margin-bottom: 10px; }
.help-otm summary { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; }
.help-otm summary::-webkit-details-marker { display: none; }
.help-otm summary::after { content: "▾"; margin-left: auto; color: var(--mud-palette-text-secondary); }
.help-otm summary .mud-icon-root { color: var(--mud-palette-primary); }
.help-otm .help-ot { margin-top: 8px; }
.help-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.help-pn a { background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); border-radius: 10px; padding: 9px 14px;
             font-size: 0.8125rem; text-decoration: none; color: inherit; }
.help-pn a:hover { border-color: var(--mud-palette-primary); }
.help-pn a.nx { text-align: right; }
.help-pn-k { display: block; font-size: 0.6875rem; color: var(--mud-palette-text-secondary); }
.help-pn b { color: var(--mud-palette-primary); font-weight: 600; }

/* The guide's text (Markdown rendered to HTML, so it needs explicit typography in the theme's colours). */
.help-content { color: var(--mud-palette-text-primary); line-height: 1.6; font-size: 0.875rem; }
.tw-card.help-content { padding: 18px 24px; }
.help-content h2 { font-size: 1.0625rem; font-weight: 600; margin: 22px 0 6px; padding-top: 4px; scroll-margin-top: 76px; }
.help-content h2:first-child { margin-top: 0; }
.help-content h3 { font-size: 0.9375rem; font-weight: 600; margin: 16px 0 4px; scroll-margin-top: 76px; }
.help-content p, .help-content ul, .help-content table { margin: 0 0 10px; max-width: 68ch; }
.help-content p.help-lede { font-size: 0.9375rem; color: var(--mud-palette-text-secondary); }
.help-content ul { padding-left: 1.25rem; }
.help-content li { margin-bottom: 4px; }
/* Steps: numbered circles. */
.help-content ol { list-style: none; padding: 0; margin: 0 0 12px; counter-reset: step; max-width: 64ch; }
.help-content ol > li { counter-increment: step; position: relative; padding: 2px 0 8px 36px; margin: 0; }
.help-content ol > li::before { content: counter(step); position: absolute; left: 0; top: 2px; width: 24px; height: 24px; border-radius: 99px;
                                 background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent); color: var(--mud-palette-primary);
                                 font-weight: 600; font-size: 0.75rem; display: flex; align-items: center; justify-content: center; }
.help-content a { color: var(--mud-palette-primary); text-decoration: none; }
.help-content a:hover { text-decoration: underline; }
/* On-screen words written as `code` read as buttons. */
.help-content code { font-family: inherit; font-weight: 600; background: var(--mud-palette-background-gray); border-radius: 4px; padding: 0 5px;
                     font-size: 0.8125rem; white-space: nowrap; color: var(--mud-palette-text-primary); }
.help-content table { border-collapse: collapse; width: 100%; font-size: 0.8125rem; }
.help-content th, .help-content td { border-bottom: 1px solid var(--mud-palette-lines-default); padding: 6px 8px; text-align: left; vertical-align: top; }
.help-content thead th { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--mud-palette-text-secondary); font-weight: 600; }
.help-content blockquote { margin: 4px 0 12px; padding: 9px 12px; border-radius: 10px; background: var(--mud-palette-background-gray);
                           color: var(--mud-palette-text-secondary); max-width: 68ch; }
.help-content blockquote p { margin: 0; }
.help-content hr { border: none; border-top: 1px solid var(--mud-palette-lines-default); margin: 18px 0; }
/* "> **Tip:**" and "> **Heads up:**". */
.help-call { display: flex; gap: 10px; border-radius: 10px; padding: 9px 12px; margin: 4px 0 12px; max-width: 68ch; font-size: 0.8125rem; }
.help-call .help-svg { flex: none; margin-top: 2px; }
.help-call p { margin: 0; }
.help-call.tip { background: color-mix(in srgb, var(--mud-palette-info) 14%, transparent); color: color-mix(in srgb, var(--mud-palette-info) 45%, var(--mud-palette-text-primary)); }
.help-call.warn { background: color-mix(in srgb, var(--mud-palette-warning) 14%, transparent); color: color-mix(in srgb, var(--mud-palette-warning) 45%, var(--mud-palette-text-primary)); }
.help-call a { color: inherit; text-decoration: underline; }

/* A page's ? and the side panel it opens (screen 5). */
.help-q { width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; padding: 0; flex: none; cursor: pointer;
          display: inline-flex; align-items: center; justify-content: center; color: var(--mud-palette-text-secondary); }
.help-q .mud-icon-root { width: 20px; height: 20px; }
.help-q:hover, .help-q:focus-visible { background: color-mix(in srgb, var(--mud-palette-primary) 10%, transparent); color: var(--mud-palette-primary); outline: none; }
.help-panel-scrim { position: fixed; inset: var(--mud-appbar-height, 64px) 0 0 0; background: color-mix(in srgb, var(--mud-palette-background) 60%, transparent); z-index: 1250; }
.help-panel { position: fixed; top: var(--mud-appbar-height, 64px); right: 0; bottom: 0; width: 380px; max-width: 100vw; background: var(--mud-palette-surface);
              border-left: 1px solid var(--mud-palette-lines-default); box-shadow: -8px 0 24px rgba(15, 36, 61, 0.14); z-index: 1260;
              display: flex; flex-direction: column; outline: 0; }
.help-panel-h { padding: 12px 16px; border-bottom: 1px solid var(--mud-palette-lines-default); display: flex; align-items: center; gap: 8px; font-weight: 600; }
.help-panel-ic { color: var(--mud-palette-primary); }
.help-panel-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.help-panel-open { display: inline-flex; align-items: center; gap: 2px; font-size: 0.8125rem; font-weight: 500; color: var(--mud-palette-primary); text-decoration: none; white-space: nowrap; }
.help-panel-x, .help-panel-back { border: 0; background: none; padding: 2px; display: inline-flex; cursor: pointer; color: var(--mud-palette-text-secondary); }
.help-panel-back { display: none; }
.help-panel-b { flex: 1; overflow-y: auto; padding: 12px 16px; position: relative; }
.help-panel-b .help-content { font-size: 0.8125rem; }
.help-panel-b .help-content h2 { font-size: 0.875rem; margin-top: 14px; }
.help-panel-f { padding: 10px 16px; border-top: 1px solid var(--mud-palette-lines-default); font-size: 0.75rem; color: var(--mud-palette-text-secondary); }
.help-panel-f button { border: 0; background: none; padding: 0; font: inherit; color: var(--mud-palette-primary); font-weight: 500; cursor: pointer; }
@media (max-width: 899.98px) {
    .help-panel { width: 100vw; border-left: 0; }
    .help-panel-back { display: inline-flex; }
    .help-panel-x { display: none; }
}

/* "Did this answer your question?" at the foot of a guide. */
.help-helpful { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.8125rem; color: var(--mud-palette-text-secondary);
                border-top: 1px solid var(--mud-palette-lines-default); padding-top: 12px; margin-top: 16px; }

/* A guide that's gone. */
.help-empty { max-width: 760px; text-align: center; padding: 26px 24px; font-size: 0.875rem; }
.help-empty-ic { font-size: 2.125rem !important; color: var(--mud-palette-text-disabled); }
.help-empty h3 { margin: 8px 0 4px; font-size: 1.0625rem; }
.help-empty p { color: var(--mud-palette-text-secondary); margin: 0 0 12px; }
.help-empty-links { font-size: 0.8125rem; color: var(--mud-palette-text-secondary); }
.help-empty-links a { color: var(--mud-palette-primary); text-decoration: none; font-weight: 500; }

/* Narrow screens (14): two columns, then one; "On this page" folds above the text; sections become rows that open. */
@media (max-width: 1099.98px) {
    .help-tgrid, .help-pop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .help-support { grid-column: 1 / -1; }
}
@media (max-width: 899.98px) {
    .help-guide { grid-template-columns: minmax(0, 1fr); }
    .help-rail { display: none; }
    .help-otm { display: block; }
    .tw-card.help-content { padding: 12px 14px; }
}
@media (max-width: 599.98px) {
    .help-tgrid, .help-pop { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .help-pop .help-pc:not(:first-child) { display: none; }
    .help-tc { padding: 10px 12px; }
    .help-tc-nm { margin: 0; cursor: pointer; }
    .help-tc-c { display: none; }
    .help-tc-n { display: inline; }
    .help-tc-list { display: none; margin-top: 8px; }
    .help-tc.open .help-tc-list { display: block; }
    .help-guide-actions { margin-left: 0; width: 100%; }
    .help-pn { grid-template-columns: minmax(0, 1fr); }
}

/* Print-friendly reports: strip the app chrome (top bar, side nav) and anything explicitly marked
   `.no-print` (filter controls, action buttons), leaving just the report content. Triggered by the
   Print button on the report pages, which calls window.print(). */
@media print {
    .mud-appbar,
    .mud-drawer,
    .mud-overlay,
    .no-print {
        display: none !important;
    }

    /* The drawer normally offsets the content; reclaim the full width once it's hidden. */
    .mud-main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    body {
        background: #fff !important;
    }

    /* Keep cards, tables and chart panels from being split awkwardly across pages. */
    .mud-card,
    .mud-paper,
    .mud-table-container,
    .mud-simple-table tr {
        break-inside: avoid;
    }
}

/* ---------- Account & Fleet Settings side-navigation layout ---------- */
.settings-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: stretch;
}

@media (min-width: 960px) {
    .settings-layout {
        flex-direction: row;
        align-items: flex-start;
    }
}

.settings-sidenav {
    width: 100%;
    background-color: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

@media (min-width: 960px) {
    .settings-sidenav {
        width: 260px;
        flex-shrink: 0;
    }
}

.settings-sidenav-section {
    padding: 0.375rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mud-palette-text-secondary);
}

.settings-sidenav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.settings-sidenav-btn:hover {
    background-color: var(--mud-palette-action-default-hover);
    color: var(--mud-palette-text-primary);
}

.settings-sidenav-btn.active {
    background-color: var(--mud-palette-secondary);
    color: var(--mud-palette-primary);
    font-weight: 600;
}

.settings-sidenav-btn-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
    white-space: nowrap;
}

.settings-sidenav-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    background-color: var(--mud-palette-background);
    color: var(--mud-palette-text-secondary);
    border: 1px solid var(--mud-palette-lines-default);
    line-height: 1.3;
    white-space: nowrap;
}

.settings-sidenav-btn.active .settings-sidenav-badge {
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-primary);
}

.settings-sidenav-badge-success {
    background-color: rgba(16, 185, 129, 0.14);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.3);
}

.settings-sidenav-divider {
    height: 1px;
    background-color: var(--mud-palette-lines-default);
    margin: 0.375rem 0.25rem;
}

.settings-content-card {
    flex: 1 1 0%;
    min-width: 0;
    width: 100%;
    background-color: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    min-height: 460px;
}

@media (min-width: 960px) {
    .settings-content-card {
        padding: 1.5rem;
    }
}

.settings-tab-pane {
    display: block;
    width: 100%;
}

.settings-tab-pane.d-none {
    display: none !important;
}


/* Dashboard stat tiles that open the detail behind their number */
.stat-tile-clickable {
    cursor: pointer;
    transition: box-shadow 0.15s ease-in-out;
}

.stat-tile-clickable:hover {
    box-shadow: var(--mud-elevation-4);
}

.stat-tile-clickable:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* Keep the leading label column visible while scrolling wide report/schedule tables horizontally. */
.sticky-first-col th:first-child,
.sticky-first-col td:first-child {
    position: sticky;
    left: 0;
    background-color: var(--mud-palette-surface);
    z-index: 1;
}

/* Menu: a small heading inside an open section (e.g. "Reports" under Trips and Money, "All boats" under Boats). */
.nav-subheader {
    display: block;
    padding: 10px 16px 2px 48px;
    color: var(--mud-palette-text-secondary);
    font-size: 0.7rem;
}

/* Menu: a boat's own pages, under the boat (several boats) or straight under the section (one boat). */

/* Menu details from mockup 02: amber counts, a boat's at-sea dot, and a guide line beside the open boat's pages. */
.nav-badge {
    margin-left: auto;
    min-width: 20px;
    padding: 0 7px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--mud-palette-warning) 18%, transparent);
    color: var(--mud-palette-warning);
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}
.mud-nav-link .mud-nav-link-text { display: flex; align-items: center; gap: 8px; width: 100%; }
.nav-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--mud-palette-lines-default); flex: none; }
.nav-dot-at-sea { background: var(--mud-palette-tertiary); }
.nav-boat-page { margin-left: 56px; border-left: 2px solid var(--mud-palette-lines-default); border-radius: 0 8px 8px 0; }
.nav-boat-page .mud-nav-link-text { padding-left: 4px; font-size: 0.8125rem; }

/* A boat's share plan at a glance (05, screen 6). */
.share-plan-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }

/* Go to (Ctrl+K), mockup 07: the top bar's box and the panel it opens. */
.goto-box {
    display: flex; align-items: center; gap: 8px; flex: 0 1 300px; margin-left: 20px; padding: 7px 10px;
    border: 0; border-radius: 8px; background: rgba(255, 255, 255, 0.10); color: #B8C7D9; font: inherit; font-size: 0.8125rem;
    cursor: pointer; text-align: left;
}
.goto-box:hover, .goto-box:focus-visible { background: rgba(255, 255, 255, 0.16); outline: none; }
.goto-box.on { box-shadow: 0 0 0 2px var(--mud-palette-tertiary); }
.goto-box-kbd { margin-left: auto; font-family: inherit; font-size: 0.6875rem; background: rgba(255, 255, 255, 0.14); border-radius: 4px; padding: 1px 6px; color: #DCE6F2; }
.goto-scrim { position: fixed; inset: 0; background: rgba(15, 36, 61, 0.35); z-index: 1400; }
.goto-panel {
    position: fixed; top: 72px; left: 50%; transform: translateX(-50%); width: min(600px, calc(100vw - 24px));
    max-height: calc(100vh - 120px); display: flex; flex-direction: column; overflow: hidden; z-index: 1401;
    background: var(--mud-palette-surface); color: var(--mud-palette-text-primary); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}
.goto-q { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--mud-palette-lines-default); }
.goto-q .mud-icon-root { color: var(--mud-palette-text-secondary); }
.goto-q input { flex: 1; border: 0; outline: none; background: transparent; color: inherit; font: inherit; font-size: 1rem; }
.goto-q kbd, .goto-ft kbd { font-family: inherit; font-size: 0.6875rem; background: var(--mud-palette-background-gray); border-radius: 4px; padding: 0 5px; color: var(--mud-palette-text-secondary); }
.goto-results { overflow-y: auto; padding-bottom: 4px; }
.goto-grp { padding: 8px 16px 2px; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--mud-palette-text-secondary); }
.goto-it { display: flex; align-items: center; gap: 10px; padding: 7px 16px; font-size: 0.875rem; cursor: pointer; }
.goto-it .mud-icon-root { color: var(--mud-palette-text-secondary); }
.goto-it.sel { background: color-mix(in srgb, var(--mud-palette-primary) 10%, transparent); color: var(--mud-palette-primary); }
.goto-it.sel .mud-icon-root { color: var(--mud-palette-primary); }
.goto-it mark { background: none; color: inherit; font-weight: 700; }
.goto-sub { font-size: 0.75rem; color: var(--mud-palette-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goto-chip { margin: 0 0 0 auto !important; }
.goto-empty { padding: 22px 16px; text-align: center; font-size: 0.875rem; color: var(--mud-palette-text-secondary); }
.goto-empty b { color: var(--mud-palette-text-primary); }
.goto-empty-try { font-size: 0.8125rem; }
.goto-ft { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--mud-palette-lines-default); font-size: 0.75rem; color: var(--mud-palette-text-secondary); }
.goto-ft kbd { margin-right: 4px; }
/* Tablet: the box shrinks to its icon; on touch, no keyboard hints. */
@media (max-width: 959.98px) {
    .goto-box { flex: none; margin-left: 8px; padding: 8px; }
    .goto-box-text, .goto-box-kbd { display: none; }
    .goto-panel { width: calc(100vw - 24px); }
}
@media (hover: none) {
    .goto-ft, .goto-q kbd, .goto-box-kbd { display: none; }
}

/* ── The mockups' page parts (docs/design/web, shared stylesheet): cards, tiles, tabs, tables, hint, dialogs ── */
.tw-card-table { padding: 4px 10px; }
.tw-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.tw-tile { background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); border-radius: 10px; padding: 11px 14px; }
.tw-tile-k { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--mud-palette-text-secondary); }
.tw-tile-v { font-size: 1.4375rem; font-weight: 600; margin-top: 3px; line-height: 1.25; }
.tw-tile-v small { font-size: 0.8125rem; font-weight: 400; color: var(--mud-palette-text-secondary); margin-left: 4px; }
.tw-tile-s { font-size: 0.75rem; color: var(--mud-palette-text-secondary); margin-top: 2px; }
/* A page title with its chip, and the page's buttons as one group at the right (they wrap together, not one by one). */
/* Tabs; when the row is too narrow, the open tab's buttons drop below the tabs instead of being cut off. */
.tw-tabs { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--mud-palette-lines-default); margin: 0 0 12px; }
.tw-tab { display: flex; align-items: center; gap: 5px; padding: 8px 8px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent;
          background: none; color: var(--mud-palette-text-secondary); font: inherit; font-size: 0.8125rem; cursor: pointer; white-space: nowrap; }
.tw-tab:hover { color: var(--mud-palette-text-primary); }
.tw-tab .mud-icon-root { width: 16px; height: 16px; }
.tw-tab.on { color: var(--mud-palette-primary); border-bottom-color: var(--mud-palette-primary); font-weight: 600; }
.tw-tab-count { font-size: 0.6875rem; background: var(--mud-palette-background-gray); color: var(--mud-palette-text-secondary); border-radius: 99px; padding: 0 6px; font-weight: 500; }
.tw-tabs-actions { margin-left: auto; display: flex; gap: 8px; padding-bottom: 6px; flex: none; }
.tw-tabs-actions .mud-button-root { white-space: nowrap; }
.tw-table .mud-table-cell, .tw-table td, .tw-table th { padding: 8px !important; font-size: 0.8125rem; white-space: nowrap; }
.tw-table thead .mud-table-cell, .tw-table thead th { font-size: 0.6875rem !important; text-transform: uppercase !important; letter-spacing: 0.4px !important; font-weight: 600;
          color: var(--mud-palette-text-secondary); padding: 6px 8px !important; }
.tw-table tfoot .mud-table-cell, .tw-table tr.tw-total td { font-weight: 600; border-top: 2px solid var(--mud-palette-lines-default); border-bottom: 0; }
.tw-row-more { width: 32px; text-align: right; }
/* Choice chips (06, mobile 12): a few fixed choices, the picked one filled. */
.tw-choice { display: flex; gap: 6px; flex-wrap: wrap; }
.tw-choice button { font: inherit; font-size: 0.8125rem; border: 1px solid var(--mud-palette-lines-default); background: var(--mud-palette-surface);
                    color: var(--mud-palette-text-primary); border-radius: 99px; padding: 4px 12px; cursor: pointer; }
.tw-choice button.on { background: var(--mud-palette-primary); border-color: var(--mud-palette-primary); color: var(--mud-palette-primary-text); }
/* Money's to-dos on a list, with what's left (web mockup 17): amber, and filled while on. */
.tw-choice button.todo { border-color: #F5C77E; background: #FFFBF3; color: #8A4B00; }
.tw-choice button.todo.on { background: #8A4B00; border-color: #8A4B00; color: #fff; }
.tw-todos { align-items: center; margin-top: -2px; }
.tw-todos-label { font-size: 0.8125rem; color: var(--mud-palette-text-secondary); }
/* The bulk line takes the filters' place while rows are ticked (17, screen 2). */
.tw-bulk { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; background: #EEF4FA; border: 1px solid #C9DAEA; border-radius: 10px; padding: 8px 12px; font-size: 0.8125rem; }
.tw-bulk .tw-bulk-pick { flex: 0 0 190px; margin: 0 !important; background: var(--mud-palette-surface); border-radius: 8px; }
/* MudBlazor puts the pick's class inside its own wrapper: size the wrapper (22: the pickers sit on one line). */
.tw-bulk > .mud-select { flex: 0 0 170px; max-width: 170px; }
/* A heading that sorts: looks like the heading, with its arrow. */
.tw-table button.tw-sort { font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.tw-table button.tw-sort.on { color: var(--mud-palette-primary); }
.tw-table button.tw-sort:hover { color: var(--mud-palette-text-primary); }
/* The one number a form is about, big (mobile 13). */
.tw-big-field input { font-size: 1.5rem !important; font-weight: 600; }
/* Two cards side by side, and a card's heading and label / value rows (08, screen 4). */
.tw-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
/* Reports → All reports (web mockup 18, screen 2): a card per report with its headline answer. */
.tw-report-group { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; color: var(--mud-palette-text-secondary); margin: 10px 0 8px; }
.tw-report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1099.98px) { .tw-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599.98px) { .tw-report-grid { grid-template-columns: minmax(0, 1fr); } }
.tw-report-card { display: flex; flex-direction: column; gap: 4px; background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default);
                  border-radius: 10px; padding: 12px 14px; color: inherit; text-decoration: none; min-height: 132px; }
.tw-report-card:hover { border-color: var(--mud-palette-primary); }
.tw-report-name { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 600; }
.tw-report-name .mud-icon-root { color: var(--mud-palette-primary); }
.tw-report-answer { font-size: 1.25rem; font-weight: 600; margin-top: 4px; }
.tw-report-answer small { font-size: 0.8125rem; font-weight: 400; color: var(--mud-palette-text-secondary); }
.tw-report-detail { font-size: 0.75rem; color: var(--mud-palette-text-secondary); }
.tw-report-go { margin-top: auto; padding-top: 8px; font-size: 0.75rem; font-weight: 500; color: var(--mud-palette-primary); }
/* A report's page (18): its share bars, an empty year, and the best buyer's row. */
.tw-share { display: inline-block; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--mud-palette-primary) 45%, transparent); vertical-align: middle; min-width: 2px; }
.tw-report-empty { color: var(--mud-palette-text-secondary); font-size: 0.875rem; }
/* Maintenance due (web mockup 20): two fields side by side in a dialog; the engines above the list; the group rows. */
.tw-form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 599.98px) { .tw-form-row { grid-template-columns: minmax(0, 1fr); } }
.tw-engines { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.tw-engine { background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); border-radius: 10px; padding: 10px 12px; font-size: 0.8125rem; }
.tw-engine .k { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--mud-palette-text-secondary); }
.tw-engine .v { font-size: 1.125rem; font-weight: 600; }
.tw-engine .s { font-size: 0.75rem; color: var(--mud-palette-text-secondary); }
.tw-engine.old { border-color: #F5C77E; background: color-mix(in srgb, #FFF3E0 50%, var(--mud-palette-surface)); }
.tw-engine.old .s { color: #8A4B00; }
.tw-table tr.tw-group td { background: var(--mud-palette-background-gray, #F5F7FA); font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.5px;
                           color: var(--mud-palette-text-secondary); font-weight: 600; padding: 5px 8px !important; }
.tw-old-reading { display: block; font-size: 0.75rem; color: #8A4B00; }
.tw-summary-line { font-size: 0.75rem; font-weight: 600; padding: 6px 10px; background: var(--mud-palette-background-gray, #EEF2F6); border-radius: 8px; }
@media (max-width: 899.98px) {
    /* A group's heading is a label between the cards, not a card. */
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) tr.tw-group { background: none; border: 0; box-shadow: none; padding: 8px 2px 2px; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) tr.tw-group td { background: none; padding: 0 !important; }
}
/* Year-end's checklist (18, screen 5): amber until it's done; a line per check. */
.tw-card-warn { border-color: #F5C77E; background: color-mix(in srgb, #FFF3E0 50%, var(--mud-palette-surface)); }
.tw-check { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; padding: 4px 0; }
.tw-check-dot { width: 8px; height: 8px; border-radius: 99px; background: #E8A13A; flex: none; margin: 0 4px; }
.tw-table tr.tw-best td { background: color-mix(in srgb, #E8F5E9 70%, var(--mud-palette-surface)); }
.tw-table td .tw-sub { display: block; color: var(--mud-palette-text-secondary); font-size: 0.75rem; font-weight: 400; }
@media (max-width: 959.98px) { .tw-pair { grid-template-columns: 1fr; } }
.tw-kv { display: flex; gap: 12px; font-size: 0.8125rem; padding: 5px 0; border-top: 1px solid var(--mud-palette-lines-default); }
.tw-kv:first-of-type { border-top: 0; }
.tw-kv > span:last-child { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tw-kv.b { font-weight: 600; }
.tw-sub { display: flex; align-items: center; gap: 8px; margin: 10px 2px 2px; font-size: 0.875rem; font-weight: 600; }
.tw-hint { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; background: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent);
           border-radius: 8px; padding: 2px 4px 2px 10px; margin-bottom: 12px; }
.tw-hint-x { margin-left: auto; }
.tw-square { border-radius: 8px !important; }
.tw-btn-xs { padding: 1px 8px !important; min-height: 0; font-size: 0.75rem !important; }
.tw-dialog .mud-dialog-title { border-bottom: 1px solid var(--mud-palette-lines-default); padding: 14px 18px; }
.tw-dialog .mud-dialog-content { padding-top: 14px; }
.tw-dialog .mud-dialog-actions { border-top: 1px solid var(--mud-palette-lines-default); padding: 12px 18px; }

/* The trip page (03): the close-out panel's four steps. */
.trip-closeout { border-color: var(--mud-palette-primary); }
.trip-closeout-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.9375rem; margin-bottom: 8px; }
/* Up to five steps (engine hours, sale, costs, settle, pay: web mockup 12); a Bookkeeper has four. */
.trip-closeout-steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
@media (max-width: 959.98px) { .trip-closeout-steps { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); } }
.trip-closeout-step { border: 1px solid var(--mud-palette-lines-default); border-radius: 10px; padding: 10px 12px; font-size: 0.8125rem; background: var(--mud-palette-surface); }
.trip-closeout-step.done { background: color-mix(in srgb, var(--mud-palette-success) 7%, var(--mud-palette-surface)); border-color: color-mix(in srgb, var(--mud-palette-success) 30%, transparent); }
.trip-closeout-step.next { border-color: var(--mud-palette-primary); box-shadow: 0 0 0 1px var(--mud-palette-primary) inset; }
.trip-closeout-title { display: flex; align-items: center; gap: 6px; font-weight: 600; margin-bottom: 4px; }
.trip-closeout-detail { color: var(--mud-palette-text-secondary); font-size: 0.75rem; margin-bottom: 8px; min-height: 32px; }

/* ── Today (09): the greeting, status chips, the alerts card, the boats and due rows, Get set up ── */
.tw-greet { font-size: 1.375rem; font-weight: 600; margin-bottom: 12px; }
.tw-greet .tw-title-actions { font-size: 0.875rem; font-weight: 400; }
.tw-lnk { font-weight: 500; }
.tw-alerts { --tw-bad-ic: var(--mud-palette-error); background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.tw-alerts-h { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; min-height: 44px; font-weight: 600; font-size: 0.9375rem; border-bottom: 1px solid var(--mud-palette-lines-default); }
.tw-alerts-r { margin-left: auto; font-weight: 400; font-size: 0.75rem; color: var(--mud-palette-text-secondary); display: flex; gap: 6px; align-items: center; }
.tw-al { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 14px; min-height: 40px; border-top: 1px solid var(--mud-palette-lines-default); font-size: 0.8125rem; }
.tw-alerts-h + .tw-al { border-top: 0; }
.tw-al-ic { flex: none; }
.tw-al-ic.bad { color: var(--mud-palette-error); }
.tw-al-ic.warn { color: color-mix(in srgb, var(--mud-palette-warning) 60%, var(--mud-palette-text-primary)); }
.tw-al-t b { font-weight: 600; }
.tw-al-w { color: var(--mud-palette-text-secondary); font-size: 0.75rem; }
.tw-al-r { margin-left: auto; display: flex; gap: 2px; align-items: center; flex: none; }
.tw-al-sub { padding-left: 44px; background: color-mix(in srgb, var(--mud-palette-background-gray) 50%, transparent); }
.tw-more { display: block; width: 100%; text-align: left; font: inherit; font-size: 0.8125rem; color: var(--mud-palette-primary); background: none; border: 0; border-top: 1px solid var(--mud-palette-lines-default); padding: 8px 14px; cursor: pointer; }
.tw-more:hover { text-decoration: underline; }
.tw-more-card { padding: 8px 0 0; margin-top: 2px; }
.tw-today-tiles { grid-template-columns: repeat(4, 1fr); }
.tw-today-tiles.three { grid-template-columns: repeat(3, 1fr); }
.tw-today-tiles.five { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 959.98px) { .tw-today-tiles, .tw-today-tiles.three, .tw-today-tiles.five { grid-template-columns: repeat(2, 1fr); } }
.tw-tile-link { color: inherit; text-decoration: none; display: block; }
.tw-tile-link:hover .tw-tile { border-color: var(--mud-palette-primary); }
.tw-boatrow, .tw-duerow { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--mud-palette-lines-default); font-size: 0.8125rem; min-height: 38px; }
.tw-card-h + .tw-boatrow, .tw-card-h + .tw-duerow, .tw-card-h + .mud-typography + .tw-duerow { border-top: 0; }
.tw-boatrow-n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tw-boatrow .tw-chip { flex: none; }
.tw-boatrow-r { margin-left: auto; display: flex; gap: 6px; align-items: center; font-size: 0.75rem; white-space: nowrap; flex: none; }
.tw-dot { width: 8px; height: 8px; border-radius: 99px; flex: none; background: var(--mud-palette-lines-inputs); }
.tw-dot.sea { background: var(--mud-palette-tertiary); }
.tw-duerow-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-duerow .mud-button-root, .tw-al .mud-button-root, .tw-step .mud-button-root { white-space: nowrap; flex: none; }
.tw-duerow .tw-chip { flex: none; }
.tw-step { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--mud-palette-lines-default); font-size: 0.8125rem; min-height: 38px; }
.tw-card-h + .tw-step { border-top: 0; }
.tw-step-ic { color: var(--mud-palette-text-secondary); flex: none; }
.tw-step.done { color: var(--mud-palette-text-secondary); background: color-mix(in srgb, var(--mud-palette-success) 7%, var(--mud-palette-surface));
    border: 1px solid color-mix(in srgb, var(--mud-palette-success) 25%, transparent); border-radius: 6px; padding: 4px 8px; margin: 3px 0; min-height: 30px; }
.tw-step.done + .tw-step { border-top: 0; }
.tw-step.done .tw-step-t { text-decoration: line-through; }
.tw-step.done .tw-step-ic { color: var(--mud-palette-success); }

/* ── Crew (10): the page title, initials, the list's toolbar, rows that open, wide tables that scroll in their card ── */
.tw-av { width: 30px; height: 30px; border-radius: 99px; flex: none; display: inline-flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent); color: var(--mud-palette-primary); font-size: 0.75rem; font-weight: 600; }
.tw-av.lg { width: 44px; height: 44px; font-size: 1rem; }
.tw-who { display: flex; align-items: center; gap: 10px; }
.tw-who b { font-weight: 600; }
.tw-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tw-search { max-width: 300px; flex: 1 1 220px; margin: 0 !important; }
/* A list's search is the pills' size, as the mockups draw it (17), so its hint fits: "Search name, supplier or category". */
.tw-search .mud-input, .tw-search input { font-size: 0.8125rem !important; }
.tw-scroll { overflow-x: auto; }
.tw-row-link { cursor: pointer; }
.tw-row-link:hover td { background: color-mix(in srgb, var(--mud-palette-primary) 4%, transparent); }
.tw-table { width: 100%; border-collapse: collapse; }
.tw-table th { text-align: left; color: var(--mud-palette-text-secondary); border-bottom: 1px solid var(--mud-palette-lines-default); }
.tw-table td { border-bottom: 1px solid var(--mud-palette-lines-default); vertical-align: middle; }
.tw-table tr:last-child td { border-bottom: 0; }
.tw-table td.num, .tw-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tw-facts { font-size: 0.8125rem; color: var(--mud-palette-text-secondary); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.tw-facts b { color: var(--mud-palette-text-primary); font-weight: 500; }
.tw-facts .mud-icon-root { width: 14px; height: 14px; }
.tw-access { display: flex; align-items: center; gap: 10px; font-size: 0.8125rem; }
.tw-access-t { flex: 1; min-width: 0; }
.tw-access-s { color: var(--mud-palette-text-secondary); font-size: 0.75rem; }
/* A row's name keeps its width; the muted detail beside it gives way (ellipsis). */
.tw-keep { flex: none; max-width: 60%; }
.tw-shrink { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-table td.tw-wrap { white-space: normal !important; min-width: 120px; }
/* A file to attach (mockup 10): a dashed, muted drop area. */
.tw-drop { border: 1px dashed var(--mud-palette-lines-inputs) !important; color: var(--mud-palette-text-secondary) !important;
    justify-content: flex-start !important; text-transform: none !important; font-weight: 400 !important; padding: 10px 12px !important; }

/* ── Crew schedule (11): two weeks by boat, plans as bars across their days ── */
.tw-range { font-weight: 600; margin-left: 6px; }
.tw-board { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 0.75rem; }
.tw-board th { font-weight: 500; color: var(--mud-palette-text-secondary); padding: 4px 0; text-align: center; font-size: 0.6875rem; border-bottom: 1px solid var(--mud-palette-lines-default); }
.tw-board th.today { color: var(--mud-palette-primary); font-weight: 700; }
.tw-board td { height: 34px; border-bottom: 1px solid var(--mud-palette-lines-default); padding: 2px 1px; vertical-align: middle; }
.tw-board .tw-board-nm { width: 170px; text-align: left; padding: 4px 8px; position: sticky; left: 0; background: var(--mud-palette-surface); z-index: 1; }
.tw-board-day { border-left: 1px solid color-mix(in srgb, var(--mud-palette-lines-default) 50%, transparent); }
.tw-board-day.today { background: color-mix(in srgb, var(--mud-palette-primary) 5%, transparent); }
.tw-board-day.wk { border-left: 2px solid var(--mud-palette-lines-default); }
.tw-board-grp td, .tw-board-grp .tw-board-nm { background: color-mix(in srgb, var(--mud-palette-background-gray) 60%, var(--mud-palette-surface)); font-size: 0.75rem; }
.tw-board-grp .tw-board-nm { line-height: 1.3; }
.tw-board-grp .tw-board-nm .mud-text-secondary { font-size: 0.6875rem; }
.tw-board-grp .tw-dot { display: inline-block; margin-right: 6px; vertical-align: middle; }
.tw-board-name { color: var(--mud-palette-text-primary); text-decoration: none; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-board-name:hover { text-decoration: underline; }
.tw-board-sub { display: block; color: var(--mud-palette-text-secondary); font-size: 0.6875rem; }
.tw-av.sm { width: 24px; height: 24px; font-size: 0.625rem; }
.tw-bar { border-radius: 6px; padding: 3px 7px; font-size: 0.6875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px;
    cursor: pointer; text-decoration: none; min-height: 22px; }
.tw-bar .mud-icon-root { width: 13px; height: 13px; flex: none; }
.tw-bar.trip { background: #0F243D; color: #fff; }
.tw-bar.sea { background: color-mix(in srgb, var(--mud-palette-tertiary) 18%, var(--mud-palette-surface)); color: color-mix(in srgb, var(--mud-palette-tertiary) 55%, var(--mud-palette-text-primary));
    border: 1px solid color-mix(in srgb, var(--mud-palette-tertiary) 35%, transparent); }
.tw-bar.plan { background: color-mix(in srgb, var(--mud-palette-primary) 10%, var(--mud-palette-surface)); color: var(--mud-palette-primary); border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 22%, transparent); }
.tw-bar.plan.warn { border-color: color-mix(in srgb, var(--mud-palette-warning) 60%, transparent); box-shadow: inset 3px 0 0 var(--mud-palette-warning); }
.tw-bar.off { background: repeating-linear-gradient(45deg, var(--mud-palette-background-gray), var(--mud-palette-background-gray) 4px, var(--mud-palette-lines-default) 4px, var(--mud-palette-lines-default) 8px);
    color: var(--mud-palette-text-secondary); border: 1px solid var(--mud-palette-lines-default); }
.tw-bar-w { color: color-mix(in srgb, var(--mud-palette-warning) 60%, var(--mud-palette-text-primary)); font-weight: 700; }
.tw-bar-menu, .tw-day-menu { display: block !important; width: 100%; }
.tw-bar-menu > div, .tw-day-menu > div { width: 100%; }
.tw-day { height: 26px; width: 100%; border-radius: 4px; cursor: pointer; }
.tw-day:hover { background: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent); }
.tw-pop { padding: 8px 14px 6px; font-size: 0.8125rem; max-width: 280px; border-bottom: 1px solid var(--mud-palette-lines-default); margin-bottom: 4px; }
.tw-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.75rem; color: var(--mud-palette-text-secondary); margin: 8px 2px 0; }
.tw-legend span { display: flex; align-items: center; gap: 6px; }
.tw-sw { width: 18px; height: 10px; border-radius: 3px; display: inline-block; }
.tw-sw.trip { background: #0F243D; }
.tw-sw.sea { background: color-mix(in srgb, var(--mud-palette-tertiary) 18%, var(--mud-palette-surface)); border: 1px solid color-mix(in srgb, var(--mud-palette-tertiary) 35%, transparent); }
.tw-sw.plan { background: color-mix(in srgb, var(--mud-palette-primary) 10%, var(--mud-palette-surface)); border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 22%, transparent); }
.tw-sw.off { background: repeating-linear-gradient(45deg, var(--mud-palette-background-gray), var(--mud-palette-background-gray) 3px, var(--mud-palette-lines-default) 3px, var(--mud-palette-lines-default) 6px); }
.tw-warnline, .tw-errline { display: flex; gap: 8px; align-items: flex-start; font-size: 0.8125rem; border-radius: 8px; padding: 8px 10px; }
.tw-warnline { background: color-mix(in srgb, var(--mud-palette-warning) 10%, var(--mud-palette-surface)); border: 1px solid color-mix(in srgb, var(--mud-palette-warning) 35%, transparent); }
.tw-errline { background: color-mix(in srgb, var(--mud-palette-error) 8%, var(--mud-palette-surface)); border: 1px solid color-mix(in srgb, var(--mud-palette-error) 30%, transparent); }
.tw-warnline .mud-icon-root, .tw-errline .mud-icon-root { flex: none; margin-top: 1px; }

/* ── Trips list (05, 06): filter drop-downs sit with the chips ── */
/* Text columns wrap so the list fits its card at desktop widths; numbers and chips stay on one line. */
.tw-trips-table td, .tw-trips-table th { white-space: normal !important; }
.tw-trips-table td.num, .tw-trips-table th.num, .tw-trips-table td:first-child, .tw-trips-table .trip-status { white-space: nowrap !important; }
/* Money › Settlements (13) the same way, so its ten columns fit beside the menu at 1,100 px. */
.tw-settlements-table td, .tw-settlements-table th { white-space: normal !important; }
.tw-settlements-table td.num, .tw-settlements-table th.num, .tw-settlements-table td:first-child, .tw-settlements-table td:nth-child(3), .tw-settlements-table th:nth-child(3), .tw-settlements-table .settlement-status,
.tw-settlements-table .settlement-next { white-space: nowrap !important; }
.tw-neg { color: var(--mud-palette-error); }
.tw-table th.tw-sort { cursor: pointer; user-select: none; }
.tw-table th.tw-sort:hover { color: var(--mud-palette-text-primary); }
/* The account menu's icon matches the app bar's icon buttons (24 px); a button's start icon is 20 px by default. */
.tw-account-button .mud-button-icon-start > svg { font-size: 1.5rem; }
/* Crew paid and owing (web mockup 12): the dialog's amount and its list of people owed. */
.tw-amount { font-size: 1.75rem; font-weight: 600; border: 1px solid var(--mud-palette-lines-inputs); border-radius: 10px; padding: 6px 12px; }
.tw-amount small { font-size: 0.875rem; font-weight: 400; color: var(--mud-palette-text-secondary); }
.tw-paylist { display: flex; flex-direction: column; gap: 6px; }
.tw-pl { display: flex; align-items: center; gap: 10px; font-size: 0.8125rem; }
.tw-pl b { font-weight: 500; width: 130px; flex: none; }
.tw-pl .paid-row-reference { flex: 1; margin: 0 !important; }
.tw-pl .tw-num { width: 80px; text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.tw-paybar { height: 8px; border-radius: 99px; background: #FFF3E0; overflow: hidden; margin: 4px 0 8px; }
.tw-paybar span { display: block; height: 100%; background: #2E7D32; }
.tw-tile.hl { border-color: #F5C77E; background: color-mix(in srgb, #FFF3E0 60%, var(--mud-palette-surface)); }
.tw-paidbox { display: flex; gap: 10px; align-items: flex-start; background: #F3FAF4; border: 1px solid #CDE7D1; border-radius: 10px; padding: 10px 12px; margin-top: 12px; font-size: 0.8125rem; color: #1F2933; }
.tw-paidbox .mud-icon-root { color: #2E7D32; }
.tw-paidbox.owe { background: #FFFBF3; border-color: #F5C77E; }
.tw-paidbox.owe .mud-icon-root { color: #8A4B00; }

/* ── Lists as cards below 900 px (web mockup 14, decided 2026-11-18) ──
   A list's cells say what they are on a card: tw-c-t the title (bold; several are joined with "·"), tw-c-r a small word after it (a role), tw-c-n the number
   that matters (right of line 1; data-suffix adds a word after it), tw-c-m the ⋮ menu, tw-c-s a fact on line 2
   (data-pre adds a word before it; joined with "·"), tw-c-k the status chip (right of line 2), tw-c-a the next-step
   button (line 3), tw-c-l a note on a line of its own. Cells without a role are left off the card. The :is(table, .mud-table-root) adds a class's
   weight so these beat MudTable's own cell rules and .tw-table's. Wide enough, the table is a table as before. */
@media (max-width: 899.98px) {
    /* MudTable and MudSimpleTable paint their own white box: as cards, the cards are the only boxes. */
    .mud-table.tw-cards, .tw-cards .mud-table-container { background: none !important; box-shadow: none !important; border: 0 !important; }
    /* A MudPaper holding a card list directly is no box of its own either (the older lists, 14 screen 4). */
    .mud-paper:has(> .tw-cards) { background: none !important; box-shadow: none !important; border-color: transparent !important; }
    /* Account settings: the section's card goes when the open section is a card list (the team, the tax rates). */
    .settings-content-card:has(.settings-tab-pane:not(.d-none) .tw-cards) { background: none !important; box-shadow: none !important; border-color: transparent !important; padding-left: 0 !important; padding-right: 0 !important; }
    .tw-cards.tw-card-table, .tw-card-table:has(> .tw-cards), .tw-card-table:has(.tw-cards), .tw-card-table:has(.tw-empty) { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; overflow: visible !important; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) { display: flex; flex-direction: column; width: 100%; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) > tbody:is(tbody, .mud-table-body) { display: flex; flex-direction: column; width: 100%; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) > tbody > tr.tw-total { order: -1; } /* the summary line goes above the cards */
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) > thead:is(thead, .mud-table-head), table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) > tfoot > tr:not(.tw-total) { display: none; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) > tfoot:is(tfoot, .mud-table-foot) { display: block; order: -1; } /* the summary line goes above the cards */
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) tr { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default);
                        border-radius: 10px; padding: 9px 12px; margin-bottom: 8px; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) tr::before { content: ""; order: 3; flex-basis: 100%; height: 0; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) tr::after { content: ""; order: 6; flex-basis: 100%; height: 0; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) > * > tr > td { display: none; border: 0 !important; padding: 0 !important; white-space: normal !important; min-width: 0 !important; width: auto !important; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-t { display: inline; order: 0; font-weight: 600; font-size: 0.875rem; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-t ~ td.tw-c-t::before { content: "\00a0· "; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-r { display: inline; order: 0; margin-left: 6px; font-size: 0.75rem; color: var(--mud-palette-text-secondary); }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-n { display: inline; order: 1; margin-left: auto; padding-left: 8px !important; font-weight: 600; font-size: 0.875rem; text-align: right; white-space: nowrap !important; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-n[data-suffix]::after { content: attr(data-suffix); font-weight: 400; color: var(--mud-palette-text-secondary); }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-m { display: inline-flex; order: 2; margin-left: 4px; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-m:empty { display: none; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-t + td.tw-c-m, table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) tr:not(:has(td.tw-c-n)) td.tw-c-m { margin-left: auto; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-s { display: inline; order: 4; font-size: 0.75rem; color: var(--mud-palette-text-secondary); }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-s[data-pre]::before { content: attr(data-pre); }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-s ~ td.tw-c-s::before { content: "\00a0· " attr(data-pre); }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-s[data-suffix]::after { content: attr(data-suffix); }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-k { display: inline-flex; align-items: center; gap: 6px; order: 5; margin-left: auto; padding-left: 8px !important; white-space: nowrap !important; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-a { display: flex; order: 7; flex-basis: 100%; justify-content: flex-end; margin-top: 4px; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-a:empty { display: none; }
    /* tw-c-l: a note on a line of its own under the facts (what a Skipper sees). */
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-l { display: block; order: 7; flex-basis: 100%; margin-top: 2px; font-size: 0.75rem; color: var(--mud-palette-text-secondary); }
    /* An empty list says so in a summary line, as "Sets / hauls · none yet" does (.tw-empty). MudTable puts it in a th, in a
       row that would otherwise be drawn as a card. */
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) tr:has(> th.mud-table-empty-row .tw-empty), table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) tr:has(> td .tw-empty) { background: none; border: 0; padding: 0; margin: 0; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td:has(> .tw-empty) { display: block; flex: 1 1 100%; }
    /* A page's own empty state (an icon, a line and a button) stays in its card, centred. */
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) th.mud-table-empty-row:not(:has(.tw-empty)) { text-align: center; }
    /* The older lists (14, screen 4): a cell's caption under its text is left off the card, and a paragraph runs inline. */
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td .mud-typography-caption { display: none; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td p.mud-typography, table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-t > div { display: inline; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-t .d-flex { display: inline-flex !important; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-t .mud-typography { font-weight: 600; font-size: inherit; }
    /* Two chips on a card (severity and status) sit side by side. */
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-k ~ td.tw-c-k { margin-left: 6px; padding-left: 0 !important; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) th.mud-table-empty-row { display: block; flex: 1 1 100%; border: 0 !important; padding: 0 !important; background: none; text-align: left; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) th.mud-table-empty-row .my-3 { margin: 0 !important; }
    .tw-empty { font-size: 0.75rem !important; font-weight: 600; color: var(--mud-palette-text-primary) !important; background: var(--mud-palette-background-gray, #EEF2F6);
                border-radius: 8px; padding: 6px 10px !important; margin: 0 !important; }
    /* A card with no facts for line 2 keeps its chip on line 1 (15: a crew card's certificate). */
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) tr:not(:has(td.tw-c-s, td.tw-c-n)) td.tw-c-k { order: 1; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) tr:not(:has(td.tw-c-s, td.tw-c-n)) td.tw-c-k ~ td.tw-c-m { margin-left: 4px; }
    /* A linked title is as bold as a plain one. */
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-t .mud-link { font-weight: 600; }
    /* A next-step button kept in the chip's cell (tw-c-a-in) still goes to line 3: the cell lets go of its contents. */
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-k:has(.tw-c-a-in) { display: contents; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-k:has(.tw-c-a-in) > * { order: 5; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-k:has(.tw-c-a-in) > :first-child { margin-left: auto; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) td.tw-c-k .tw-c-a-in { order: 7; margin-left: auto !important; margin-top: 4px; }
    /* The total row: one summary line above or below the cards. */
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) tr.tw-total { background: var(--mud-palette-background-gray, #EEF2F6); border: 0; padding: 6px 10px; font-size: 0.75rem; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) tr.tw-total td.tw-c-t { font-size: 0.75rem; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) tr.tw-total td.tw-c-s { order: 0; color: var(--mud-palette-text-primary); font-weight: 600; }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) tr.tw-total td.tw-c-s:first-of-type::before, table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) tr.tw-total td.tw-c-t ~ td.tw-c-s::before { content: "\00a0· " attr(data-pre); }
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) tr.tw-total::before, table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) tr.tw-total::after { display: none; }
}

/* ── Onboarding on the web (web mockup 16): the steps down the left, the step on the right; below 900 px a progress
   line above the step instead ── */
.ob-page { width: 100%; min-height: 100vh; align-self: stretch; display: flex; flex-direction: column; }
/* The sign-in layout has no app bar, so no room is kept for one: the page's own bar sits at the top. */
.mud-main-content:has(> .ob-page) { padding-top: 0 !important; align-items: stretch !important; }
.ob-bar { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 18px; background: var(--mud-palette-appbar-background); color: var(--mud-palette-appbar-text); }
.ob-wrap { display: grid; grid-template-columns: 280px minmax(0, 680px); gap: 22px; padding: 26px 30px 40px; align-items: start; justify-content: center; }
.ob-steps { background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); border-radius: 12px; padding: 18px; }
.ob-over { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--mud-palette-primary); font-weight: 600; }
.ob-account { font-size: 1.0625rem; font-weight: 600; margin: 4px 0 14px; }
.ob-step { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; font-size: 0.8125rem; }
.ob-step b { display: block; font-weight: 600; }
.ob-step span:not(.ob-n) { color: var(--mud-palette-text-secondary); font-size: 0.75rem; }
.ob-n { width: 24px; height: 24px; border-radius: 99px; border: 1.5px solid var(--mud-palette-lines-inputs); display: flex; align-items: center; justify-content: center;
        font-size: 0.75rem; font-weight: 600; color: var(--mud-palette-text-secondary); flex: none; }
.ob-n .mud-icon-root { width: 14px; height: 14px; }
.ob-step.on .ob-n { background: var(--mud-palette-primary); border-color: var(--mud-palette-primary); color: #fff; }
.ob-step.done .ob-n { background: var(--mud-palette-success); border-color: var(--mud-palette-success); color: #fff; }
.ob-next { border-top: 1px solid var(--mud-palette-lines-default); padding-top: 12px; font-size: 0.75rem; color: var(--mud-palette-text-secondary); line-height: 1.5; }
.ob-main { padding: 22px 26px !important; }
.ob-narrow-head { display: none; }
.ob-progress { display: flex; gap: 6px; margin: 6px 0 14px; }
.ob-progress span { height: 4px; flex: 1; border-radius: 99px; background: var(--mud-palette-lines-default); }
.ob-progress span.on { background: var(--mud-palette-primary); }
.ob-title { font-size: 1.375rem; font-weight: 600; margin: 0 0 4px; }
.ob-sub { font-size: 0.8125rem; color: var(--mud-palette-text-secondary); margin: 0 0 18px; }
.ob-label { font-size: 0.75rem; color: var(--mud-palette-text-secondary); margin-bottom: 4px; }
.ob-types { flex-wrap: wrap; }
/* Every field the same: no floating label (the label is above), no extra margin, one height and one text size. */
.ob-field.mud-input-control { margin: 0 !important; }
.ob-field .mud-input { font-size: 0.875rem; }
.ob-field .mud-input-slot { height: 22px; }
.ob-length { display: flex; gap: 6px; align-items: stretch; }
.ob-length .ob-field:first-child { flex: 1; min-width: 0; }
.ob-unit { flex: 0 0 76px; max-width: 76px; }
.ob-optional { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--mud-palette-text-secondary); margin: 16px 0 6px;
               border-top: 1px solid var(--mud-palette-lines-default); padding-top: 14px; }
.ob-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ob-foot { display: flex; gap: 8px; align-items: center; justify-content: flex-end; border-top: 1px solid var(--mud-palette-lines-default); margin-top: 18px; padding-top: 14px; }
.ob-crew-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--mud-palette-lines-default); font-size: 0.8125rem; }
.ob-crew-row:first-child { border-top: 0; }
/* Fixed columns, so each row's role and boat line up whatever the name's length (MudBlazor's inputs grow by default). */
.ob-grow { flex: 1 1 0 !important; min-width: 0; }
.ob-col { flex: 0 0 150px !important; width: 150px !important; max-width: 150px; }
.ob-act { flex: 0 0 56px; text-align: right; display: flex; justify-content: flex-end; }
.ob-crew-add { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 10px; border: 1px dashed var(--mud-palette-lines-inputs); border-radius: 10px;
               background: color-mix(in srgb, var(--mud-palette-primary) 4%, var(--mud-palette-surface)); }
.ob-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
/* What you fish (web mockup 35, screen 1): the shared list by group, three columns of ticks. */
.ob-grp { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; color: var(--mud-palette-text-secondary); margin: 14px 0 6px; }
.ob-ticks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ob-tick { border: 1px solid var(--mud-palette-lines-default); border-radius: 8px; padding: 0 6px; font-size: 0.8125rem; }
.ob-tick.on { border-color: var(--mud-palette-primary); background: color-mix(in srgb, var(--mud-palette-primary) 6%, var(--mud-palette-surface)); }
.ob-species-scroll { max-height: 420px; overflow-y: auto; }
.ob-sum-card { border: 1px solid var(--mud-palette-lines-default); border-radius: 10px; padding: 12px 14px; font-size: 0.8125rem; display: flex; flex-direction: column; gap: 2px; }
.ob-sum-card b { font-size: 0.9375rem; }
.ob-sum-k { display: flex; align-items: center; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--mud-palette-text-secondary); }
@media (max-width: 899.98px) {
    .ob-wrap { grid-template-columns: minmax(0, 1fr); padding: 18px 16px 30px; }
    .ob-steps { display: none; }
    .ob-narrow-head { display: block; }
    .ob-grid3, .ob-sum { grid-template-columns: minmax(0, 1fr); }
    .ob-crew-row, .ob-crew-add { flex-wrap: wrap; }
    .ob-ticks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* "No receipt for this expense?" (04, screen 4): the reasons as one list, not wrapped into columns. */
#no-receipt-reason.mud-radio-group { flex-direction: column; align-items: flex-start; flex-wrap: nowrap; }

/* ── Money overview (web mockup 04): a to-do per line, its button at the right ── */
.money-todo-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--mud-palette-lines-default); font-size: 0.8125rem; }
.money-todo-row:first-of-type { border-top: 0; }
.money-todo-text { flex: 1; min-width: 0; }
.money-todo-go { flex: none; }
@media (max-width: 699.98px) { .money-todo-row { flex-wrap: wrap; } .money-todo-go { margin-left: auto; } }

/* ── Showing and hiding by width (14, 15): tw-only-lt900 / tw-only-lt700 appear only below that width (keeping their own
   display), tw-hide-lt900 / tw-hide-lt700 go away below it. */
@media (min-width: 900px) { .tw-only-lt900 { display: none !important; } }
@media (min-width: 700px) { .tw-only-lt700 { display: none !important; } }
@media (max-width: 899.98px) { .tw-hide-lt900 { display: none !important; } }
@media (max-width: 699.98px) { .tw-hide-lt700 { display: none !important; } }

/* ── The trip page below 900 px (web mockup 15, decided 2026-11-18) ── */
.tw-tabs-list { display: contents; }
.trip-closeout-prog, .trip-closeout-short { display: none; }
/* A summary line on its own, as a card list's total row looks below 900 px. */
.tw-summary-line { font-size: 0.75rem; font-weight: 600; background: var(--mud-palette-background-gray, #EEF2F6); border-radius: 8px; padding: 6px 10px; }
@media (max-width: 899.98px) {
    /* The tabs on one line; the open tab's buttons on their own line under them. */
    .tw-tabs { border-bottom: 0; row-gap: 0; }
    .tw-tabs-list { display: flex; flex: 1 0 100%; flex-wrap: nowrap; gap: 4px; overflow-x: auto; scrollbar-width: none;
                    box-shadow: inset 0 -1px 0 var(--mud-palette-lines-default); }
    .tw-tabs-list .tw-tab { margin-bottom: 0; flex: none; }
    .tw-tabs-actions { flex-basis: 100%; justify-content: flex-end; margin-left: 0; padding: 8px 0 0; }
    .tw-tabs-actions:empty { display: none; }

    /* Close out: a progress bar, the done steps as one line of ticks, each open step a row with its buttons. */
    #trip-closeout .trip-closeout-head { margin-bottom: 0; }
    #trip-closeout .trip-closeout-prog { display: block; height: 5px; border-radius: 99px; background: var(--mud-palette-background-gray, #EEF2F6); overflow: hidden; margin: 8px 0 6px; }
    #trip-closeout .trip-closeout-prog span { display: block; height: 100%; background: var(--mud-palette-success); }
    #trip-closeout .trip-closeout-steps { display: flex; flex-wrap: wrap; gap: 0 14px; }
    #trip-closeout .trip-closeout-step { border: 0; border-radius: 0; background: none; box-shadow: none; padding: 0; }
    #trip-closeout .trip-closeout-step.done { order: 0; font-size: 0.75rem; color: var(--mud-palette-success-darken, #1B5E20); }
    #trip-closeout .trip-closeout-step.done .trip-closeout-title { font-weight: 400; margin: 0; gap: 4px; }
    #trip-closeout .trip-closeout-step.done .trip-closeout-title .mud-icon-root { width: 14px; height: 14px; }
    #trip-closeout .trip-closeout-step.done .trip-closeout-name, #trip-closeout .trip-closeout-step.done .trip-closeout-detail,
    #trip-closeout .trip-closeout-step.done > .d-flex { display: none !important; }
    #trip-closeout .trip-closeout-step.done .trip-closeout-short { display: inline; }
    #trip-closeout .trip-closeout-step:not(.done) { order: 1; flex: 1 0 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px;
                                                    align-items: center; border-top: 1px solid var(--mud-palette-lines-default); padding: 8px 0 2px; margin-top: 6px; }
    #trip-closeout .trip-closeout-step:not(.done) .trip-closeout-title { grid-column: 1; margin: 0; }
    #trip-closeout .trip-closeout-step:not(.done) .trip-closeout-detail { grid-column: 1; min-height: 0; margin: 0; padding-left: 26px; }
    #trip-closeout .trip-closeout-step:not(.done) > .d-flex { grid-column: 2; grid-row: 1 / span 2; justify-content: flex-end; }

    /* Settlement: the split folded away, the paid bar inside the money card. */
    #settlement-totals:not(.show-split) .settle-split { display: none; }
    .settle-paidline { display: flex; align-items: center; gap: 10px; font-size: 0.75rem; margin-top: 8px; }
    .settle-paidline .tw-paybar { flex: 1; margin: 0; }
    /* No Mark paid button on a crew card: the card opens it, and Mark all paid is on the tab line. */
    table:is(.tw-cards, .tw-cards *):is(table, .mud-table-root) .settlement-mark-paid { display: none; }

    /* Costs: biggest first as cards. */
    #trip-expenses table:is(.tw-cards, .tw-cards *) > tbody > tr { order: var(--card-order, 0); }

    /* Crew & gear's headings as the summary lines: "Crew · 4". */
    #trip-panel-crew .tw-sub { font-size: 0.75rem; font-weight: 600; background: var(--mud-palette-background-gray, #EEF2F6); border-radius: 8px; padding: 6px 10px; margin: 0 0 6px; }
    #trip-panel-crew .tw-sub .tw-tab-count { background: none; padding: 0; font-size: 0.75rem; font-weight: 600; color: inherit; }
    #trip-panel-crew .tw-sub .tw-tab-count::before { content: "· "; }
}
@media (max-width: 699.98px) {
    #trip-closeout .trip-closeout-value { display: none; }
    .tw-tabs-list .tw-tab .mud-icon-root { display: none; }
    .tw-tabs-list .tw-tab { padding: 8px 6px; }
    /* The header: the name and the ⋮ on one line, the chips under it. */
    .trip-header > .mud-typography { flex: 1 1 0; min-width: 0; order: 0; }
    .trip-header > .tw-title-actions { order: 1; }
    .trip-header::after { content: ""; order: 2; flex-basis: 100%; height: 0; }
    .trip-header > .mud-chip-container > .mud-chip, .trip-header > .tw-chip { order: 3; } /* MudChip sits in a display: contents box */
    /* The figures: one small card, three over two, no captions. */
    .trip-tiles { grid-template-columns: none !important; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: minmax(0, 1fr);
                  gap: 8px 12px; background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); border-radius: 10px; padding: 8px 12px; }
    .trip-tiles .tw-tile { border: 0; background: none; padding: 0; }
    .trip-tiles .tw-tile-k { font-size: 0.625rem; }
    .trip-tiles .tw-tile-v { font-size: 1.0625rem; margin-top: 1px; }
    .trip-tiles .tw-tile-v small { font-size: 0.75rem; }
    .trip-tiles .tw-tile-s { display: none; }
}
