:root { color-scheme: light; font: 16px system-ui, sans-serif; color: #142e40; background: #f1f6f8; --control-border: #587280; --focus-ring: #075479; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.masthead { color: white; background: #083653; }
.masthead-inner, main { max-width: 1060px; margin: auto; padding: 24px; }
.masthead-inner { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.brand { display: block; width: 174px; height: auto; margin-bottom: 10px; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1 { font: 36px Georgia, serif; }
h2 { font: 29px Georgia, serif; }
h3 { font-size: 19px; }
p { margin: 8px 0 0; line-height: 1.5; }
.voyage { color: #c2e5ee; text-align: right; }
.role-heading { font: 700 16px/1.25 system-ui, sans-serif; margin-bottom: 8px; }
.activity { display: flex; align-items: center; gap: 10px; margin: 12px 0; padding: 10px 13px; border-radius: 9px; background: #e6f1f6; color: #083653; font-weight: 650; }
.activity-indicator { width: 16px; height: 16px; flex: none; border: 2px solid #99b8c8; border-top-color: #083653; border-radius: 50%; animation: activity-spin .8s linear infinite; }
@keyframes activity-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .activity-indicator { animation: none; } }
.session-expired button { margin-top: 14px; }
.roles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
button { border: 1px solid #083653; border-radius: 8px; background: #083653; color: white; font: inherit; font-weight: 650; min-height: 44px; padding: 8px 14px; cursor: pointer; }
button:disabled, button[aria-disabled='true'] { opacity: .55; cursor: default; }
button:hover:not(:disabled):not([aria-disabled='true']) { filter: brightness(1.17); }
.roles button, .secondary { background: white; color: #083653; border-color: var(--control-border); }
.roles button[aria-pressed='true'] { color: white; background: #083653; border-color: #083653; }
section { padding: 22px; border-radius: 14px; border: 1px solid #d1e0e6; background: white; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head p, .muted { color: #476477; }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 13px; margin-top: 20px; }
.publishing-form { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); align-items: start; }
.inline-form label { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 6px; font-size: 14px; font-weight: 700; }
.inline-form input { width: 100%; min-width: 0; max-width: 100%; border: 1px solid var(--control-border); border-radius: 8px; min-height: 44px; padding: 7px 10px; font: inherit; background: #fff; color: #142e40; }
input:focus-visible, button:focus-visible, h2[tabindex]:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.form-field { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 6px; }
.field-title { font-size: 14px; font-weight: 700; }
.read-only { display: flex; min-height: 44px; align-items: center; font-weight: 650; }
.file-picker { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; border: 1px solid var(--control-border); border-radius: 8px; min-height: 44px; padding: 5px 9px; background: white; }
.file-picker:focus-within { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.file-picker .file-input { position: absolute; inset: 0; opacity: 0; height: 100%; cursor: pointer; }
.file-picker .file-input:disabled { cursor: default; }
.file-picker-button { padding: 5px 8px; border-radius: 5px; background: #e6f1f6; color: #083653; font-size: 14px; font-weight: 700; }
.file-picker-name { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.field-error { margin: 0; color: #862f2a; font-size: 14px; font-weight: 650; }
.form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.list-heading { margin-top: 26px; border-top: 1px solid #d1e0e6; padding-top: 17px; }
.results { margin-top: 12px; display: grid; gap: 8px; }
.item { padding: 12px; border: 1px solid #d1e0e6; border-radius: 9px; background: #f9fbfc; overflow-wrap: anywhere; }
.item p { margin-top: 3px; }
.audit { color: #476477; font-size: 14px; }
.result, #message { margin: 12px 0; border-radius: 9px; padding: 11px 13px; background: #e6f1f6; color: #083653; }
.result.good, #message.good { background: #e2f4e9; color: #164f3c; }
.result.bad, #message.bad { background: #fbe9e8; color: #862f2a; }
.flag-card { min-width: 0; margin: 0; padding: 12px 16px 16px; }
.flag-card legend { max-width: 100%; padding-inline: 5px; font-weight: 700; overflow-wrap: anywhere; }
.flags { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 9px; }
.flag-option { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 7px 9px; border: 1px solid var(--control-border); border-radius: 8px; background: white; align-self: start; cursor: pointer; }
.flag-option input { accent-color: #083653; flex: none; width: 19px; height: 19px; margin: 0; }
.flag-help { margin: 5px 0 0; font-size: 14px; color: #476477; }
.flag-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; margin-top: 14px; }
.flag-state { margin: 0; padding: 4px 9px; border-radius: 7px; font-size: 14px; font-weight: 650; }
.flag-state.saved { color: #164f3c; background: #e2f4e9; }
.flag-state.dirty { color: #684600; background: #fff0c8; }
.camera { margin-top: 16px; }
.camera video { display: block; width: min(480px, 100%); margin-bottom: 8px; border-radius: 10px; background: #122032; }
.camera video.camera-starting { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.preview-dialog { width: min(900px, calc(100% - 24px)); height: min(760px, 92vh); height: min(760px, 92dvh); max-width: none; max-height: none; min-width: 0; border: 1px solid var(--control-border); border-radius: 14px; padding: 16px; color: #142e40; overflow: hidden; }
.preview-dialog[open] { display: flex; flex-direction: column; gap: 10px; }
.preview-dialog::backdrop, .leave-dialog::backdrop { background: #0a2535a8; }
.leave-dialog { width: min(470px, calc(100% - 24px)); max-width: none; max-height: calc(100% - 24px); border: 1px solid var(--control-border); border-radius: 14px; padding: 18px; color: #142e40; }
.leave-dialog h2 { font-size: 25px; }
.leave-dialog p { overflow-wrap: anywhere; }
.leave-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.discard-button { border-color: #862f2a; color: #862f2a; }
.preview-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
.preview-header h2 { font-size: 24px; min-width: 0; }
#preview-meta { margin: 0; color: #476477; overflow-wrap: anywhere; }
.preview-body { min-height: 0; flex: 1; overflow: auto; border: 1px solid #d1e0e6; border-radius: 9px; }
.preview-body iframe { display: block; width: 100%; height: 100%; border: 0; }
.draft-viewer { background: #edf3f8; min-height: 100%; }
.draft-viewer [data-status] { margin: 0; padding: 12px; }
.preview-controls { position: sticky; top: 0; display: flex; justify-content: center; align-items: center; gap: 4px; padding: 5px; background: white; border-bottom: 1px solid #d1e0e6; }
.preview-controls button { min-width: 44px; padding: 4px; }
.preview-controls [data-position] { min-width: 46px; text-align: center; }
.draft-page { padding: 10px; }
.draft-page canvas { display: block; height: auto; margin-inline: auto; background: white; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 540px) {
    main { padding: 14px 16px 16px; }
    .masthead-inner { padding: 12px 16px; align-items: start; flex-direction: column; gap: 3px; }
    .masthead h1 { font-size: 30px; }
    .brand { width: 138px; margin-bottom: 5px; }
    .section-head { align-items: start; flex-direction: column; gap: 8px; }
    .roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
    .roles button { padding: 6px; font-size: 14px; }
    .roles button:last-child { grid-column: 1 / -1; }
    section { padding: 15px; }
    .voyage { margin-top: 2px; text-align: left; }
    .inline-form, .publishing-form, .flags { grid-template-columns: minmax(0, 1fr); }
    .inline-form button { justify-self: start; }
    .preview-dialog { padding: 12px; }
}
