:root {
    color-scheme: light;
    --ink: #062e53;
    --ink-soft: #345671;
    --muted: #71879a;
    --paper: #f4f8fb;
    --white: #fff;
    --line: #d6e4ec;
    --navy: #0878b3;
    --navy-deep: #062e53;
    --teal: #008fa8;
    --teal-soft: #e1f7f8;
    --amber: #c68743;
    --danger: #a4403b;
    --shadow: 0 16px 48px rgb(6 46 83 / 8%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--paper);
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    background: var(--paper);
    font-size: 15px;
    line-height: 1.55;
}

a {
    color: var(--teal);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--navy-deep);
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #00a8be;
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.site-header {
    position: relative;
    z-index: 2;
    min-height: 76px;
    padding: 0 clamp(20px, 5vw, 76px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: rgb(255 255 255 / 93%);
    border-bottom: 1px solid #e1eaf0;
}

.brand {
    display: inline-flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
    text-decoration: none;
}

.brand-logo {
    width: 235px;
    max-width: 100%;
    height: auto;
    display: block;
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(12px, 2.1vw, 30px);
}

.top-nav a,
.nav-logout {
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.top-nav a:hover,
.nav-logout:hover {
    color: var(--teal);
}

.top-nav a.active {
    padding: 8px 12px;
    color: var(--navy);
    background: #e4f3f7;
    border: 1px solid #b7d1df;
    border-radius: 4px;
}

.top-nav .nav-login {
    padding: 9px 16px;
    color: white;
    background: var(--navy);
    border-radius: 5px;
}

.top-nav .nav-account {
    min-height: 36px;
    padding: 7px 12px;
    display: inline-flex;
    align-items: center;
    color: var(--navy);
    background: #e4f5f8;
    border: 1px solid #bde1e7;
    border-radius: 4px;
    font-weight: 700;
    white-space: nowrap;
}

.top-nav .active-trip-nav {
    min-height: 36px;
    max-width: min(320px, 42vw);
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    color: white;
    background: var(--navy);
    border-radius: 4px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-logout {
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.session-status {
    min-height: 36px;
    padding: 5px clamp(20px, 5vw, 76px);
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    background: #fbfdfd;
    border-bottom: 1px solid var(--line);
    font-size: 11px;
}

.session-progress {
    width: min(320px, 42vw);
    height: 6px;
    appearance: none;
    border: 0;
    background: transparent;
}

.session-progress::-webkit-progress-bar {
    background: #dceaf1;
    border-radius: 99px;
}

.session-progress::-webkit-progress-value {
    background: var(--teal);
    border-radius: 99px;
    transition: width .25s linear;
}

.session-progress::-moz-progress-bar {
    background: var(--teal);
    border-radius: 99px;
}

.session-progress[data-ending="true"]::-webkit-progress-value,
.session-progress[data-ending="true"]::-moz-progress-bar {
    background: var(--amber);
}

.session-countdown {
    min-width: 38px;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

#main-content {
    flex: 1;
}

.page-width {
    width: min(1180px, calc(100% - 48px));
    margin-inline: auto;
}

.narrow-page {
    width: min(820px, calc(100% - 48px));
}

.landing {
    min-height: 520px;
    padding-block: clamp(58px, 8vw, 112px) 70px;
    display: grid;
    grid-template-columns: 1.08fr .92fr;
    align-items: center;
    gap: clamp(38px, 7vw, 110px);
}

.landing-copy {
    max-width: 640px;
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--teal);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0;
    text-transform: uppercase;
}

.eyebrow-dot {
    width: 7px;
    height: 7px;
    margin-right: 8px;
    display: inline-block;
    border-radius: 50%;
    background: var(--amber);
    vertical-align: 1px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
.landing h1,
.auth-aside h1,
.page-intro h1,
.emergency-heading h1,
.legal-page h1 {
    margin-bottom: 20px;
    color: var(--navy-deep);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 60px;
    font-weight: 400;
    line-height: 1.09;
}

.landing h1 span {
    color: var(--teal);
}

.lead {
    max-width: 520px;
    margin-bottom: 30px;
    color: var(--ink-soft);
    font-size: 18px;
    line-height: 1.65;
}

.lead-small {
    max-width: 700px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 15px;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 11px;
}

.button {
    min-height: 45px;
    padding: 10px 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.button:disabled {
    opacity: .62;
    cursor: wait;
}

.button-primary {
    color: white;
    background: var(--navy);
}

.button-primary:hover {
    color: white;
    background: var(--navy-deep);
}

.button-outline {
    color: var(--navy);
    background: transparent;
    border-color: #b7d1df;
}

.button-outline:hover {
    color: var(--navy-deep);
    background: #e4f3f7;
    border-color: #64b9c8;
}

.button-quiet {
    color: var(--ink-soft);
    background: transparent;
}

.button-quiet:hover {
    color: var(--teal);
    background: #e8f5f8;
}

.button-full {
    width: 100%;
    margin-top: 9px;
}

.button-small {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 12px;
}

.microcopy {
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.landing-art {
    position: relative;
    min-height: 362px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background-color: #e8f4f9;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 31px, rgb(18 57 77 / 4%) 32px), repeating-linear-gradient(90deg, transparent, transparent 31px, rgb(18 57 77 / 4%) 32px);
    border-radius: 4px;
}

.art-grid {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 49.8%, rgb(255 255 255 / 38%) 50%, transparent 50.3%);
}

.paper {
    position: absolute;
    width: 48%;
    min-height: 220px;
    padding: 22px;
    background: white;
    box-shadow: 0 18px 32px rgb(16 46 60 / 13%);
}

.paper-back {
    transform: translate(-18px, 12px) rotate(-7deg);
    background: #fcfdfb;
}

.paper-front {
    transform: translate(18px, -3px) rotate(4deg);
    border-top: 5px solid var(--teal);
}

.paper-label {
    display: block;
    color: var(--teal);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0;
}

.paper-title {
    margin-top: 30px;
    display: block;
    color: var(--navy);
    font-family: Georgia, serif;
    font-size: 25px;
    line-height: 1.15;
}

.paper-lines {
    width: 72%;
    height: 72px;
    margin-top: 30px;
    display: block;
    background: repeating-linear-gradient(transparent 0 13px, #d9e7ef 13px 14px);
}

.paper-stamp {
    position: absolute;
    right: 19px;
    bottom: 15px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: var(--teal);
    border: 1px solid #78c6cf;
    border-radius: 50%;
    font-family: Georgia, serif;
}

.art-lock {
    position: absolute;
    right: 9%;
    bottom: 24%;
    width: 44px;
    height: 40px;
    display: grid;
    place-items: end center;
}

.art-lock::before {
    position: absolute;
    top: 0;
    width: 21px;
    height: 21px;
    content: "";
    border: 3px solid var(--navy);
    border-bottom: 0;
    border-radius: 15px 15px 0 0;
}

.art-lock span {
    width: 40px;
    height: 27px;
    display: block;
    background: var(--amber);
    border-radius: 4px;
}

.art-caption {
    position: absolute;
    bottom: 14px;
    left: 16px;
    margin: 0;
    color: #345671;
    font-size: 10px;
}

.landing-strip {
    margin-bottom: 72px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.landing-strip>div {
    min-height: 93px;
    padding: 20px 22px;
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.landing-strip>div+div {
    border-left: 1px solid var(--line);
}

.strip-index {
    color: var(--teal);
    font-family: Georgia, serif;
    font-size: 16px;
}

.landing-strip strong,
.landing-strip small {
    display: block;
}

.landing-strip strong {
    color: var(--navy);
    font-size: 13px;
}

.landing-strip small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.home-security {
    margin-bottom: 74px;
    padding-block: 62px 20px;
    border-top: 1px solid var(--line);
}

.home-security-heading {
    max-width: 780px;
    margin-bottom: 34px;
}

.home-security-heading h2 {
    max-width: 700px;
    margin-bottom: 12px;
    color: var(--navy-deep);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 34px;
    font-weight: 400;
    line-height: 1.18;
}

.home-security-heading>p:last-child {
    max-width: 680px;
    margin-bottom: 0;
    color: var(--ink-soft);
    font-size: 14px;
}

.home-security-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.home-security-grid article {
    padding-top: 15px;
    border-top: 2px solid var(--navy);
}

.home-security-grid article>span {
    color: var(--teal);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
}

.home-security-grid h3 {
    margin: 10px 0 8px;
    color: var(--navy-deep);
    font-size: 16px;
}

.home-security-grid p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 13px;
}

.home-security-limit {
    margin: 30px 0 0;
    padding: 14px 17px;
    color: #654b29;
    background: #fff8ec;
    border-left: 3px solid var(--amber);
    font-size: 13px;
}

.auth-layout {
    min-height: 690px;
    padding-block: 70px;
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    align-items: center;
    gap: clamp(45px, 9vw, 140px);
}

.auth-aside {
    max-width: 430px;
}

.auth-aside h1 {
    font-size: 54px;
}

.auth-aside>p:not(.eyebrow) {
    max-width: 380px;
    color: var(--ink-soft);
}

.aside-note {
    max-width: 430px;
    margin-top: 34px;
    padding: 15px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #345671;
    background: #e5f4f8;
    border-left: 3px solid var(--teal);
    font-size: 12px;
}

.note-symbol {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    display: grid;
    place-items: center;
    color: white;
    background: var(--teal);
    border-radius: 50%;
    font-family: Georgia, serif;
    font-style: italic;
    font-weight: 700;
}

.form-panel,
.workspace-panel {
    padding: clamp(23px, 4vw, 42px);
    background: var(--white);
    border: 1px solid #dce8ef;
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.auth-layout .form-panel {
    width: min(100%, 510px);
    justify-self: end;
}

.panel-heading {
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.step-label {
    color: var(--navy);
    font-size: 12px;
    font-weight: 750;
}

.step-count,
.secure-label {
    color: var(--muted);
    font-size: 10px;
}

.secure-label span {
    width: 6px;
    height: 6px;
    margin-right: 5px;
    display: inline-block;
    border-radius: 50%;
    background: var(--teal);
}

.form-panel form>label,
.form-field label,
.inline-form>label,
.modal-panel>label {
    margin: 16px 0 7px;
    display: block;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
}

.form-panel input,
.form-field input,
.selector-row select,
.inline-form input,
.inline-form textarea,
.modal-panel input {
    width: 100%;
    min-height: 45px;
    padding: 10px 12px;
    color: var(--ink);
    background: white;
    border: 1px solid #bfd2df;
    border-radius: 3px;
    font-size: 14px;
}

.form-panel input::placeholder,
.form-field input::placeholder,
.inline-form input::placeholder,
.inline-form textarea::placeholder {
    color: #8ba0ae;
}

.input-with-action {
    position: relative;
}

.input-with-action input {
    padding-right: 90px;
}

.field-action {
    position: absolute;
    top: 50%;
    right: 10px;
    padding: 5px;
    transform: translateY(-50%);
    color: var(--teal);
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

.label-row {
    margin-top: 19px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.label-row label {
    margin: 0 0 7px;
    font-size: 12px;
    font-weight: 700;
}

.text-action {
    margin-bottom: 7px;
    padding: 0;
    color: var(--teal);
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

.optional {
    color: var(--muted);
    font-size: 10px;
    font-weight: 400;
}

.field-help,
.form-footnote {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.form-panel .button-full {
    margin-top: 24px;
}

.form-footnote {
    margin-top: 13px;
    text-align: center;
}

.auth-switch {
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.auth-switch a {
    font-weight: 700;
}

.form-error {
    margin: 14px 0 0;
    padding: 10px 12px;
    color: var(--danger);
    background: #fcf0ef;
    border-left: 3px solid var(--danger);
    font-size: 12px;
}

.app-page {
    padding-block: 58px 90px;
}

.page-intro {
    margin-bottom: 30px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.page-intro h1,
.emergency-heading h1,
.legal-page h1 {
    margin-bottom: 8px;
    font-size: 49px;
}

.page-intro .eyebrow {
    margin-bottom: 10px;
}

.page-intro>.button {
    margin-bottom: 4px;
}

.compact-intro {
    margin-top: 26px;
}

.security-banner {
    margin: 28px 0 38px;
    padding: 16px 18px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    background: #e7f5f8;
    border-left: 3px solid var(--teal);
}

.banner-lock {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    color: white;
    background: var(--teal);
    border-radius: 50%;
    font-size: 9px;
}

.security-banner p {
    margin: 0;
    color: #345671;
    font-size: 12px;
}

.security-banner p strong {
    color: var(--navy);
}

.security-banner>a {
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.section-heading {
    margin: 0 0 12px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.section-heading h2,
.workspace-panel h2 {
    margin: 0;
    color: var(--navy);
    font-family: Georgia, serif;
    font-size: 21px;
    font-weight: 400;
}

.section-heading>span {
    color: var(--muted);
    font-size: 11px;
}

.trip-list {
    border-top: 1px solid var(--line);
}

.trip-card {
    border-bottom: 1px solid var(--line);
}

.trip-card-selected {
    background: #e4f3f7;
}

.trip-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trip-row {
    flex: 1;
    width: 100%;
    min-height: 94px;
    padding: 17px 12px;
    display: grid;
    grid-template-columns: 42px 1fr auto auto;
    align-items: center;
    gap: 16px;
    color: inherit;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.trip-row:hover {
    background: #f1f7fa;
}

.trip-marker {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: var(--teal);
    background: var(--teal-soft);
    border-radius: 50%;
    font-family: Georgia, serif;
    font-size: 12px;
}

.trip-row .trip-title {
    display: block;
    margin: 0;
    color: var(--navy);
    font-size: 14px;
}

.trip-row .trip-dates {
    display: block;
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.status-pill {
    padding: 4px 8px;
    color: #6b7d82;
    background: #eef2f2;
    border-radius: 99px;
    font-size: 10px;
    white-space: nowrap;
}

.status-open {
    color: #007d93;
    background: var(--teal-soft);
}

.trip-open-label {
    color: var(--teal);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.trip-delete {
    flex: 0 0 auto;
}

.trip-files {
    margin: 0 12px 14px 70px;
    padding: 14px 16px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 3px;
}

.trip-files-heading {
    margin-bottom: 4px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.trip-files-heading h3 {
    margin: 0;
    color: var(--navy);
    font-family: Georgia, serif;
    font-size: 18px;
    font-weight: 400;
}

.trip-files-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
}

.loading-row {
    padding: 22px 12px;
    color: var(--muted);
    font-size: 13px;
}

.empty-state {
    padding: 55px 20px;
    text-align: center;
}

.empty-mark {
    width: 46px;
    height: 46px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    color: var(--teal);
    background: var(--teal-soft);
    border-radius: 50%;
    font-size: 23px;
}

.empty-state h3 {
    margin-bottom: 7px;
    color: var(--navy);
    font-family: Georgia, serif;
    font-size: 22px;
    font-weight: 400;
}

.empty-state p {
    color: var(--muted);
    font-size: 12px;
}

.empty-state .button {
    margin-top: 8px;
}

.back-link {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    text-decoration: none;
}

.back-link span {
    margin-right: 6px;
}

.trip-form-panel {
    padding: clamp(22px, 4vw, 38px);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}

.form-field {
    min-width: 0;
}

.form-field label {
    margin-top: 0;
}

.full-field {
    grid-column: 1 / -1;
}

.form-actions {
    margin-top: 26px;
    padding-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--line);
}

.workspace-panel {
    padding: clamp(18px, 3vw, 30px);
}

.selector-row {
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: auto minmax(170px, 1fr) auto;
    align-items: center;
    gap: 14px;
}

.selector-row label {
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
}

.selector-row select {
    min-height: 42px;
}

.locked-placeholder {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    text-align: center;
}

.locked-placeholder p {
    max-width: 350px;
    margin: 14px 0 0;
    font-size: 12px;
}

.lock-outline {
    position: relative;
    width: 32px;
    height: 25px;
    margin-top: 9px;
    display: block;
    background: var(--teal-soft);
    border: 2px solid #63bdc9;
    border-radius: 4px;
}

.lock-outline::before {
    position: absolute;
    bottom: 20px;
    left: 6px;
    width: 14px;
    height: 14px;
    content: "";
    border: 2px solid #63bdc9;
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
}

.document-toolbar {
    padding: 4px 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--line);
}

.document-toolbar h2 {
    margin-bottom: 3px;
}

.document-toolbar p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
}

.upload-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.upload-controls>label:first-child {
    color: var(--muted);
    font-size: 10px;
}

.upload-controls select {
    min-height: 40px;
    max-width: 210px;
    padding: 7px 9px;
    color: var(--ink);
    background: white;
    border: 1px solid #bfd2df;
    border-radius: 3px;
    font-size: 11px;
}

.upload-button {
    cursor: pointer;
}

.document-upload-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.upload-help {
    margin: 12px 0 0;
}

.upload-status {
    margin: 12px 0 0;
    padding: 9px 12px;
    color: var(--ink-soft);
    background: #eaf5f8;
    border-left: 3px solid var(--teal);
    font-size: 12px;
}

.document-category-select {
    min-height: 34px;
    max-width: min(240px, 100%);
    margin-top: 8px;
    padding: 5px 8px;
    color: var(--ink-soft);
    background: white;
    border: 1px solid #bfd2df;
    border-radius: 3px;
    font-size: 11px;
}

.checklist {
    padding: 19px 0 17px;
    border-bottom: 1px solid var(--line);
}

.checklist h3 {
    margin-bottom: 12px;
    color: var(--navy);
    font-size: 12px;
}

.checklist-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.checklist-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 11px;
}

.checklist-grid input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--teal);
}

.document-list {
    padding-top: 6px;
}

.document-row {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #eaf0f0;
}

.document-detail {
    flex: 1;
    min-width: 0;
}

.document-title-line,
.document-title-editor {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.document-title-editor input {
    width: min(360px, 55vw);
    min-width: 120px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.document-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 4px;
}

.document-thumbnail {
    flex: 0 0 76px;
    width: 76px;
    height: 64px;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 0;
    color: var(--muted);
    background: #edf3f6;
    border: 1px solid var(--line);
    border-radius: 4px;
    cursor: zoom-in;
    font-size: 10px;
}

.document-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.document-detail strong,
.document-detail small {
    display: block;
}

.document-detail strong {
    max-width: 58vw;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 12px;
}

.document-detail small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.document-lightbox {
    width: min(1120px, calc(100vw - 32px));
    max-width: none;
    height: min(90dvh, 900px);
    max-height: none;
    padding: 0;
    overflow: hidden;
    color: #fff;
    background: transparent;
    border: 0;
}

.document-lightbox::backdrop {
    background: rgb(5 18 27 / 82%);
}

.document-lightbox-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #10222d;
    border-radius: 5px;
}

.document-lightbox-header {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 8px 52px 8px 18px;
    border-bottom: 1px solid rgb(255 255 255 / 14%);
}

.document-lightbox-header h2 {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

.document-lightbox-header .modal-close {
    color: #fff;
}

.document-lightbox-stage {
    flex: 1;
    min-height: 0;
    display: grid;
    place-items: center;
    overflow: auto;
    padding: 16px;
}

.document-lightbox-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.document-lightbox-stage iframe {
    width: 100%;
    height: 100%;
    background: #fff;
    border: 0;
}

@media (max-width: 720px) {
    .document-row {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 12px 0;
    }

    .document-detail {
        flex-basis: calc(100% - 92px);
    }

    .document-actions {
        width: 100%;
        justify-content: flex-start;
        padding-left: 88px;
    }

    .document-lightbox {
        width: calc(100vw - 16px);
        height: calc(100dvh - 24px);
    }

    .document-lightbox-stage {
        padding: 8px;
    }
}

.muted {
    color: var(--muted);
    font-size: 12px;
}

.inline-form {
    padding: 18px 0 22px;
    border-bottom: 1px solid var(--line);
}

.inline-form .form-grid {
    margin-bottom: 14px;
}

.inline-form textarea {
    resize: vertical;
}

.inline-form>.button {
    margin-top: 17px;
}

.contact-list,
.note-list {
    display: grid;
    gap: 10px;
    padding-top: 18px;
}

.contacts-toolbar,
.contact-form-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.contacts-toolbar h2,
.contact-form-heading h2 {
    margin: 0;
    color: var(--navy);
    font-family: Georgia, serif;
    font-size: 21px;
    font-weight: 400;
}

.contacts-toolbar p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.contact-form {
    margin-top: 22px;
    padding: 20px;
    background: #f5f8f8;
    border: 1px solid var(--line);
}

.contact-form .contact-form-heading {
    margin-bottom: 18px;
}

.contact-row,
.note-row {
    padding: 14px;
    display: grid;
    gap: 4px;
    background: #f5f8f8;
    border-left: 2px solid #72c5cf;
}

.contact-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.contact-details {
    display: grid;
    gap: 4px;
}

.contact-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.contact-row strong,
.note-row strong {
    color: var(--navy);
    font-size: 13px;
}

.contact-row span,
.note-row span {
    color: var(--ink-soft);
    font-size: 11px;
    overflow-wrap: anywhere;
}

.note-row span:last-child {
    white-space: pre-wrap;
}

.emergency-heading {
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.emergency-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: white;
    background: var(--amber);
    border-radius: 50%;
    font-family: Georgia, serif;
    font-size: 23px;
}

.emergency-trip-summary {
    margin: 8px 0 24px;
    padding: 18px;
    color: var(--navy);
    background: #e7f5f8;
    border-left: 3px solid var(--teal);
}

.emergency-trip-summary h2 {
    margin-bottom: 6px;
}

.emergency-trip-summary p {
    margin-bottom: 4px;
    color: #345671;
    font-size: 12px;
}

.emergency-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.emergency-columns section>h2 {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.emergency-footnote {
    margin: 25px 0 0;
    padding-top: 14px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: 10px;
}

.settings-list {
    border-top: 1px solid var(--line);
}

.settings-row {
    padding: 21px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    border-bottom: 1px solid var(--line);
}

.settings-row p {
    max-width: 550px;
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.settings-label {
    color: var(--navy);
    font-size: 13px;
    font-weight: 700;
}

.settings-row code {
    color: var(--navy);
    font-size: 14px;
    font-weight: 700;
}

.settings-warning {
    margin-top: 20px;
    padding: 18px;
    background: #f8f1e8;
    border: 0;
}

.settings-warning .settings-label {
    color: #76552d;
}

.legal-page {
    padding-block: 80px 110px;
}

.legal-page h2 {
    margin: 30px 0 8px;
    color: var(--navy);
    font-family: Georgia, serif;
    font-size: 21px;
    font-weight: 400;
}

.legal-page p:not(.eyebrow, .lead-small) {
    color: var(--ink-soft);
    font-size: 14px;
}

.faq-page {
    padding-block: 64px 100px;
}

.faq-heading {
    max-width: 800px;
    margin-bottom: 34px;
}

.faq-heading h1 {
    margin-bottom: 14px;
}

.faq-note {
    margin: 24px 0 42px;
    padding: 16px 18px;
    color: #654b29;
    background: #fff8ec;
    border-left: 3px solid var(--amber);
    font-size: 14px;
}

.faq-section {
    margin-top: 42px;
}

.faq-section h2 {
    margin-bottom: 10px;
    color: var(--navy-deep);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 25px;
    font-weight: 400;
}

.faq-item {
    border-top: 1px solid var(--line);
}

.faq-item:last-child {
    border-bottom: 1px solid var(--line);
}

.faq-item summary {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 2px;
    color: var(--ink);
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    flex: 0 0 auto;
    color: var(--teal);
    content: "+";
    font-size: 22px;
    font-weight: 400;
}

.faq-item[open] summary::after {
    content: "−";
}

.faq-item summary:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 3px;
}

.faq-answer {
    max-width: 880px;
    padding: 0 36px 18px 2px;
    color: var(--ink-soft);
    font-size: 14px;
}

.faq-answer p:last-child,
.faq-answer ul:last-child {
    margin-bottom: 0;
}

.faq-answer ul {
    padding-left: 22px;
}

.faq-answer a {
    font-weight: 600;
}

.faq-endnote {
    margin-top: 48px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.legal-rule {
    width: 100%;
    height: 1px;
    margin: 28px 0;
    background: var(--line);
}

.site-footer {
    min-height: 66px;
    padding: 18px clamp(20px, 5vw, 76px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: #718189;
    background: white;
    border-top: 1px solid #e4ebeb;
    font-size: 10px;
}

.site-footer>span:last-child {
    display: flex;
    gap: 18px;
}

@media (max-width: 760px) {
    .home-security {
        padding-top: 44px;
    }

    .home-security-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .home-security-heading h2 {
        font-size: 29px;
    }
}

.site-footer a {
    color: #657982;
    text-decoration: none;
}

.cookie-notice {
    position: fixed;
    z-index: 20;
    right: 20px;
    bottom: 18px;
    left: 20px;
    max-width: 920px;
    margin-inline: auto;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    color: var(--ink);
    background: white;
    border: 1px solid var(--line);
    border-top: 3px solid var(--teal);
    border-radius: 4px;
    box-shadow: 0 8px 30px rgb(6 46 83 / 18%);
}

.cookie-notice strong {
    color: var(--navy-deep);
    font-size: 13px;
}

.cookie-notice p {
    margin: 3px 0 0;
    color: var(--ink-soft);
    font-size: 12px;
}

@media (max-width: 560px) {
    .cookie-notice {
        right: 10px;
        bottom: 10px;
        left: 10px;
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        padding: 14px;
    }

    .cookie-notice .button {
        align-self: flex-end;
    }
}

.footer-separator {
    padding: 0 4px;
    color: #9cabad;
}

.modal {
    width: min(440px, calc(100% - 32px));
    max-width: none;
    padding: 0;
    color: var(--ink);
    background: transparent;
    border: 0;
}

.modal::backdrop {
    background: rgb(9 31 43 / 55%);
}

.modal-panel {
    position: relative;
    padding: 30px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 24px 70px rgb(0 0 0 / 20%);
}

.modal-panel h2 {
    margin-bottom: 10px;
    color: var(--navy);
    font-family: Georgia, serif;
    font-size: 27px;
    font-weight: 400;
}

.modal-panel>p:not(.eyebrow, .field-help) {
    color: var(--ink-soft);
    font-size: 12px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    padding: 4px 8px;
    color: var(--muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 22px;
}

.account-id-row {
    margin: 18px 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.account-id-row input {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
    text-align: center;
}

.toast {
    position: fixed;
    z-index: 5;
    right: 20px;
    bottom: 20px;
    max-width: min(440px, calc(100vw - 40px));
    padding: 13px 17px;
    color: white;
    background: var(--navy-deep);
    box-shadow: var(--shadow);
    font-size: 12px;
}

.toast-error {
    background: var(--danger);
}

@media (max-width: 820px) {
    .site-header {
        min-height: 66px;
        padding-inline: 20px;
        padding-block: 10px;
        flex-wrap: wrap;
    }

    .top-nav {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 13px;
    }

    .top-nav a,
    .nav-logout {
        font-size: 11px;
    }

    .landing {
        min-height: 0;
        padding-block: 64px 48px;
        gap: 35px;
    }

    .landing h1 {
        font-size: 50px;
    }

    .landing-art {
        min-height: 310px;
    }

    .auth-layout {
        gap: 40px;
    }

    .auth-aside h1 {
        font-size: 46px;
    }

    .page-intro h1,
    .emergency-heading h1,
    .legal-page h1 {
        font-size: 43px;
    }

    .security-banner {
        grid-template-columns: auto 1fr;
    }

    .security-banner>a {
        grid-column: 2;
    }

    .trip-row {
        grid-template-columns: 42px 1fr auto;
    }

    .trip-card-header {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .trip-card-header .trip-row {
        flex-basis: 100%;
    }

    .trip-delete {
        margin: 0 0 8px 50px;
    }

    .trip-row .status-pill {
        display: none;
    }
}

@media (max-width: 620px) {

    .page-width,
    .narrow-page {
        width: min(100% - 32px, 520px);
    }

    .site-header {
        min-height: 62px;
        padding-inline: 16px;
        padding-block: 10px;
    }

    .session-status {
        padding-inline: 16px;
        gap: 8px;
        font-size: 10px;
    }

    .session-progress {
        flex: 1;
        width: auto;
    }

    .brand-logo {
        width: 180px;
    }

    .top-nav {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 12px;
    }

    .top-nav .nav-login {
        padding: 8px 10px;
    }

    .landing {
        padding-top: 52px;
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .landing h1 {
        font-size: 43px;
    }

    .lead {
        font-size: 16px;
    }

    .landing-art {
        min-height: 290px;
    }

    .paper {
        width: 54%;
    }

    .landing-strip {
        margin-bottom: 42px;
        grid-template-columns: 1fr;
    }

    .landing-strip>div {
        min-height: 72px;
        padding: 15px 5px;
    }

    .landing-strip>div+div {
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .auth-layout {
        min-height: 0;
        padding-block: 50px 64px;
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .auth-aside h1 {
        font-size: 42px;
    }

    .aside-note {
        margin-top: 20px;
    }

    .auth-layout .form-panel {
        width: 100%;
        justify-self: stretch;
    }

    .panel-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .app-page {
        padding-block: 42px 65px;
    }

    .page-intro {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }

    .page-intro>.button {
        align-self: flex-start;
    }

    .page-intro h1,
    .emergency-heading h1,
    .legal-page h1 {
        font-size: 39px;
    }

    .security-banner {
        padding: 14px;
        grid-template-columns: 24px 1fr;
        gap: 10px;
    }

    .security-banner>a {
        grid-column: 2;
    }

    .trip-row {
        padding-inline: 2px;
        grid-template-columns: 36px minmax(0, 1fr) auto;
        gap: 10px;
    }

    .trip-marker {
        width: 34px;
        height: 34px;
    }

    .trip-row .button {
        padding-inline: 9px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .full-field {
        grid-column: auto;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .selector-row {
        grid-template-columns: 1fr auto;
        gap: 9px;
    }

    .selector-row label {
        grid-column: 1 / -1;
    }

    .selector-row select {
        min-width: 0;
    }

    .selector-row .button {
        padding-inline: 10px;
        font-size: 11px;
    }

    .document-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .upload-controls {
        width: 100%;
        flex-wrap: wrap;
    }

    .document-upload-actions {
        width: 100%;
    }

    .document-upload-actions .upload-button {
        flex: 1 1 150px;
    }

    .upload-controls select {
        flex: 1;
        min-width: 130px;
    }

    .checklist-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .emergency-columns {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .contacts-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .contact-row {
        grid-template-columns: 1fr;
    }

    .contact-actions {
        flex-wrap: wrap;
    }

    .settings-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .settings-warning .button {
        align-self: flex-start;
    }

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
        padding-block: 16px;
    }
}

@media (max-width: 360px) {
    .top-nav {
        gap: 7px;
    }

    .brand-logo {
        width: 160px;
    }

    .site-header {
        padding-inline: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}