/* Progressive desktop workspace. The mobile layout remains the default. */
.desktop-nav, .desktop-only { display: none; }
.account-page { max-width: 420px; }

@media (min-width: 1024px) {
  body.workspace { --rail-width: 212px; overflow: visible; }
  .desktop-only { display: block; }
  button.desktop-only { display: grid; }
  .desktop-nav {
    position: fixed; inset: 0 auto 0 0; width: var(--rail-width); height: 100vh; height: 100dvh;
    display: flex; flex-direction: column; gap: 0; padding: 28px 16px 20px;
    background: var(--card); border-right: 1px solid var(--line); overflow-y: auto; z-index: 12;
  }
  .desktop-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 28px; font-size: 23px; font-weight: 700; letter-spacing: -.04em; }
  .desktop-brand img { border-radius: 10px; }
  .desktop-nav-label { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin: 24px 12px 10px; }
  .desktop-links { display: grid; gap: 5px; }
  .desktop-links a, .desktop-nav .switch a { display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 12px; min-height: 44px; border-radius: 9px; font-size: 14px; font-weight: 550; color: var(--dim); }
  .desktop-links svg { width: 19px; height: 19px; flex: 0 0 19px; }
  .desktop-links a:hover, .desktop-nav .switch a:hover { background: var(--card-2); color: var(--text); }
  .desktop-links [aria-current], .desktop-nav .switch a.on { color: var(--accent); background: var(--card-2); }
  .desktop-back { font-size: 13px; color: var(--dim); padding: 10px 12px; }
  .desktop-back:hover { color: var(--accent); }
  .desktop-trip-name { font-size: 17px; font-weight: 650; line-height: 1.4; padding: 0 12px; margin: 0; overflow-wrap: anywhere; }
  .desktop-nav .switch { display: flex; flex-direction: column; gap: 5px; border: 0; background: transparent; padding: 0; margin: 18px 0 12px; flex-shrink: 0; }
  .desktop-nav .switch svg { width: 19px; height: 19px; }
  .desktop-nav-hint { color: var(--dim); font-size: 12px; line-height: 1.6; padding: 0 12px; }
  .desktop-identity { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 28px 12px 0; font-size: 12px; color: var(--dim); overflow-wrap: anywhere; }
  .desktop-status { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: 0 0 7px; }
  .workspace main.app-main {
    width: calc(100% - var(--rail-width)); max-width: 1440px;
    margin-left: max(var(--rail-width), calc((100vw - 1440px + var(--rail-width)) / 2)); margin-right: 0;
    padding: 28px clamp(24px, 3vw, 48px) 64px; overflow: visible;
  }
  .app-main > .topbar { padding: 0 0 24px; gap: 16px; }
  .app-main .topbar h1 { font-size: 30px; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; letter-spacing: -.035em; }
  .app-main .topbar .sub { font-size: 14px; margin-top: 4px; }
  .app-main > .switch { display: none; }
  .app-main > .dashboard-return { margin-top: -12px; margin-bottom: 8px; }
  .app-main .card { padding: 22px; border: 1px solid var(--line); border-radius: 16px; }
  .app-main .card h2 { font-size: 19px; letter-spacing: -.02em; }
  .app-main > .btn.wide { width: fit-content; }
  .workspace a:focus-visible, .workspace button:focus-visible, .workspace summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  .app-main .btn:hover { border-color: var(--accent); }
  .dashboard-heading .mark { display: none; }
  .dashboard-heading .desktop-only { font-size: 14px; }
  .dashboard-page > a[href='/inbox'] { display: none; }
  .dashboard-overview { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(250px, 1fr); gap: 24px; margin-bottom: 34px; }
  .dashboard-overview .upnext { min-height: 300px; margin: 0; padding: 28px; display: flex; align-items: flex-end; background: linear-gradient(140deg, var(--card-2), var(--card)); }
  .dashboard-overview .upnext h2 { font-size: 34px; line-height: 1.15; margin: 10px 0; letter-spacing: -.04em; }
  .dashboard-overview .upnext .sub { font-size: 15px; line-height: 1.6; white-space: normal; }
  .dashboard-overview .upnext .hint { margin-top: 12px; }
  .dashboard-summary { margin: 0; display: flex; flex-direction: column; justify-content: center; }
  .desktop-eyebrow { color: var(--dim); font-size: 10px; text-transform: uppercase; font-weight: 700; letter-spacing: .14em; }
  .dashboard-stats { display: flex; gap: 36px; margin: 20px 0 26px; }
  .dashboard-stats strong { display: block; font-size: 38px; line-height: 1.2; font-weight: 650; letter-spacing: -.045em; }
  .dashboard-stats span { color: var(--dim); font-size: 12px; }
  .dashboard-summary .hint { line-height: 1.6; }
  .dashboard-summary .btn { margin-top: 18px; font-size: 13px; padding: 0 12px; white-space: normal; }
  .dashboard-section-title { font-size: 19px; font-weight: 650; color: var(--text); padding: 0; margin: 0 0 16px; }
  .dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; background: transparent; overflow: visible; }
  .dashboard-grid .row { display: block; padding: 0; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
  .dashboard-grid .row:hover, .dashboard-overview .upnext:hover { border-color: var(--accent); }
  .dashboard-grid .row .main { display: block; padding: 0; height: 100%; }
  .dashboard-grid .trip-thumb { display: block; width: 100%; height: 156px; border-radius: 0; }
  .dashboard-grid .main > .glyph { display: block; width: 100%; height: 156px; padding: 48px; background: var(--card-2); }
  .dashboard-grid .txt { padding: 18px; gap: 5px; }
  .dashboard-grid .nm { font-size: 18px; letter-spacing: -.02em; }
  .dashboard-grid .meta { font-size: 13px; line-height: 1.55; }
  .dashboard-page .empty { padding: 90px 24px; border: 1px dashed var(--line); border-radius: 18px; margin-top: 20px; }
  .dashboard-page .empty .btn { max-width: 320px; margin-left: auto; margin-right: auto; }
  .app-main .hero-trip { margin: 0 0 28px; border-radius: 20px; }
  .app-main .hero-trip > img { height: 290px; }
  .app-main .hero-bar { padding: 20px; }
  .app-main .hero-text { padding: 28px; }
  .app-main .hero-text h1 { font-size: 36px; line-height: 1.15; letter-spacing: -.04em; }
  .app-main .hero-text .sub { font-size: 15px; margin-top: 8px; }
  .trip-timeline { min-width: 0; }
  .trip-timeline .day { margin-bottom: 22px; scroll-margin-top: 20px; }
  .trip-timeline .dayhead { padding: 12px 0; }
  .trip-timeline .dayhead h2 { font-size: 16px; }
  .trip-timeline .seg { border: 1px solid var(--line); padding: 18px 12px 18px 20px; gap: 18px; margin-bottom: 10px; }
  .trip-timeline .seg:hover { border-color: var(--accent); }
  .trip-timeline .time { flex-basis: 88px; }
  .trip-timeline .time .t { font-size: 16px; white-space: nowrap; }
  .trip-timeline .seg.note .time .t { font-size: 12px; }
  .trip-timeline .nm { font-size: 16px; }
  .trip-timeline .meta, .trip-timeline .route { font-size: 13px; line-height: 1.6; }
  .itinerary-guide { position: sticky; top: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: 20px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow-y: auto; }
  .itinerary-guide h2 { margin: 24px 0 12px; font-size: 14px; }
  .itinerary-stats { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--dim); font-size: 12px; margin: 14px 0 18px; }
  .itinerary-stats strong { color: var(--text); }
  .itinerary-guide .btn { font-size: 13px; padding: 0 8px; }
  .day-jump { display: grid; gap: 4px; }
  .day-jump a { font-size: 12px; padding: 10px; border-radius: 8px; color: var(--dim); line-height: 1.5; }
  .day-jump a:hover, .day-jump [aria-current] { color: var(--accent); background: var(--card-2); }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .photo-tile { border-radius: 14px; }
  .photo-day { margin: 30px 0; }
  .photo-day h2 { font-size: 19px; }
  .photo-upload.compact { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
  .photo-full { max-height: calc(100vh - 230px); max-height: calc(100dvh - 230px); border-radius: 16px; }
  .photo-navigation { max-width: 600px; margin: 18px auto; }
  .photo-upload:not(.compact) { max-width: 460px; }
  .booking-workspace.has-tools { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; align-items: start; }
  .booking-details { min-width: 0; }
  .booking-tools { position: sticky; top: 24px; min-width: 0; }
  .booking-tools > .caption:first-child { margin-top: 0; }
  .booking-tools .btn { font-size: 13px; padding: 0 8px; }
  .booking-details .facts { gap: 16px 24px; }
  .booking-details .pass .code { font-size: 44px; }
  .booking-details .note-content { line-height: 1.75; padding-top: 12px; }
  .edit-trip-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); align-items: start; gap: 28px; }
  .edit-trip-layout > * { min-width: 0; }
  .edit-trip-layout #trip-cover { position: sticky; top: 24px; }
  #trip-cover input[type='file'] { display: block; width: 100%; min-width: 0; margin: 8px 0; font: inherit; color: var(--dim); }
  #trip-cover input::file-selector-button { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-right: 10px; font: inherit; color: var(--text); background: var(--card-2); cursor: pointer; }
  .travellers-layout { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); align-items: start; gap: 28px; }
  .travellers-layout > form { position: sticky; top: 24px; }
  .traveller-list { display: grid; gap: 14px; background: none; overflow: visible; }
  .traveller-list .traveller-card { margin: 0; padding: 22px; }
  .import-layout { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr); align-items: start; gap: 28px; margin-top: 24px; }
  .import-layout > * { min-width: 0; }
  .import-layout textarea { min-height: 280px; }
  .inbox-layout { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); align-items: start; gap: 28px; }
  .inbox-layout.no-unassigned { grid-template-columns: 1fr; }
  .no-unassigned .inbox-unassigned { display: none; }
  .inbox-recent > .caption { margin-top: 16px; }
  .thread { max-width: 880px; margin: 0 auto; gap: 18px; padding: 20px 0; min-height: 280px; }
  .msg { padding: 18px 22px; max-width: 80%; }
  .msg p { font-size: 16px; line-height: 1.65; }
  .ask { max-width: 880px; margin: 0 auto; padding: 16px 0; }
  .sheet { width: 640px; max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); padding: 24px; border: 1px solid var(--line); }
  .sheet-title { font-size: 23px; }
  .sheet-actions { position: sticky; bottom: -24px; background: var(--card); padding: 16px 0 4px; }
  .sheet-actions .btn { min-height: 48px; }
  main.account-page, main.passenger-page { max-width: 960px; padding: 32px 28px 64px; }
  .account-page .topbar h1, .passenger-page h1 { font-size: 30px; letter-spacing: -.03em; }
  .account-settings-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 24px; align-items: start; margin-top: 20px; }
  .account-settings-grid .card { padding: 24px; border: 1px solid var(--line); margin-top: 0; }
  .account-settings-grid p { line-height: 1.65; }
  .account-page > .btn { width: fit-content; }
  .passenger-page .card { padding: 24px; border: 1px solid var(--line); }
  .passenger-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 24px; }
  .passenger-field { min-width: 0; }
  .passenger-field:last-of-type, .passenger-form > button { grid-column: 1 / -1; }
  .passenger-form textarea { min-height: 100px; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .itinerary-guide { display: none; }
  .dashboard-overview { grid-template-columns: minmax(0, 1.3fr) minmax(230px, 1fr); gap: 18px; }
  .dashboard-overview .upnext h2 { font-size: 28px; }
  .booking-workspace.has-tools { grid-template-columns: minmax(0, 1fr) 230px; gap: 20px; }
}
@media (min-width: 1280px) {
  .trip-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 228px; gap: 28px; align-items: start; }
}
