/* V0.8 pilot çalışma alanı gezinmesi (CSP: satır içi <style> yasak olduğu için ayrı dosya) */
.workspace-nav{display:flex;gap:9px;flex-wrap:wrap;margin:14px 16px;padding:10px;border:1px solid #374151;border-radius:16px;background:#10151e;position:relative;z-index:3}
.workspace-nav button{flex:1 1 135px;min-height:45px;border:1px solid #55647a;border-radius:11px;background:#172335;color:#f5f7fc;font-weight:650;cursor:pointer}
.workspace-nav button[aria-current="page"]{background:#8d1521;border-color:#e4414e;color:white}
.workspace-preview{margin:12px 16px!important;padding:18px!important}
.workspace-preview h2{margin:0 0 10px}.workspace-preview .workspace-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin:14px 0}
.workspace-preview .workspace-tile{padding:14px;background:#151e2a;border:1px solid #435064;border-radius:12px}
.workspace-preview .workspace-tile strong{display:block;margin-bottom:7px}
.workspace-preview .workspace-tile span{color:#cbd5e1;font-size:14px}
.workspace-preview .workspace-action{display:inline-block;margin-top:12px;padding:11px 15px;background:#8d1521;border-radius:9px;color:white}
@media(max-width:760px){.workspace-nav{margin:10px 12px;gap:7px;padding:8px}.workspace-nav button{flex:1 1 42%;font-size:13px}.workspace-preview{margin:10px 12px!important}}

.desktop-home { margin-top: 12px; }
body.mobile-ui .desktop-home { display: none; }
.workspace-home h1 { margin: 0 0 12px; font-size: clamp(1.3rem, 4vw, 2rem); overflow-wrap: anywhere; }
.workspace-home nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: 8px; }
.workspace-home nav button { min-width: 0; min-height: 48px; white-space: normal; overflow-wrap: anywhere; }

/* Üyelik V1.0: giriş seçenekleri */
.auth-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 8px 0 14px; }
.auth-tabs button { min-height: 44px; border-radius: 11px; border: 1px solid #55647a; background: #172335; color: #f5f7fc; font-weight: 600; }
.auth-tabs button[aria-current="page"] { background: #8d1521; border-color: #e4414e; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; }
.auth-form input { min-height: 44px; font-size: 16px; }
.auth-form button { min-height: 46px; }
@media (min-width: 761px) { .auth-tabs { grid-template-columns: repeat(4, 1fr); } }
/* Çıkış: tek düğme, sayfanın / alt panelin en altında */
.logout-bar { display: flex; justify-content: center; margin: 28px 0 18px; }
.logout-bar button { min-height: 48px; min-width: 200px; font-size: 16px; }
#adminNavBtn { flex: 1 1 135px; min-height: 45px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #55647a; border-radius: 11px; background: #2a1d0b; color: #f5f7fc; font-weight: 650; text-decoration: none; }
#adminNavBtn.hidden { display: none; }

/* Çıkış: sabit, kaydırmadan erişilir, güvenli alan + Safari alt çubuğu uyumlu (PR #13'ün satır içi stili CSP'ye takılıyordu) */
.logout-fixed { position: fixed; right: max(12px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 9990; min-height: 46px; padding: 10px 18px; background: #182336; color: #fff; border: 1px solid #8c9ab0;
  border-radius: 12px; box-shadow: 0 4px 18px rgba(0,0,0,.6); font-size: 16px; }
body.mobile-ui .logout-fixed { top: calc(10px + env(safe-area-inset-top)); bottom: auto; min-height: 40px; padding: 8px 14px; font-size: 15px; }
body.login-view .logout-fixed, body.mode-wall .logout-fixed { display: none; }

/* ---------- Telefon: alt sekmeler + ayrı bölüm sayfaları ---------- */
.mobile-tabs, .section-page { display: none; }
body.mobile-ui .mobile-tabs:not(.hidden) { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1500;
  gap: 2px; padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  overflow-x: auto; -webkit-overflow-scrolling: touch; background: rgba(10,14,20,.97);
  border-top: 1px solid #2a3747; }
body.mobile-ui .mobile-tabs button { flex: 1 0 44px; min-width: 44px; min-height: 50px; padding: 4px 2px; font-size: .78125rem; line-height: 1.15;
  border: 0; border-radius: 10px; background: transparent; color: #c5cfdb; white-space: normal; overflow-wrap: anywhere; }
body.mobile-ui .mobile-tabs button[aria-current="page"] { background: #8d1521; color: #fff; }
/* Narrow phones use a 3-column touch grid; family users with 3 tabs use
   one row. ResizeObserver keeps the account strip / content above its true height. */
@media (max-width: 390px) {
  body.mobile-ui .mobile-tabs:not(.hidden) {
    display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px;
  }
  body.mobile-ui .mobile-tabs button {
    width: 100%; min-height: 46px; padding: 5px 3px;
    font-size: clamp(.72rem,2.7vw,.82rem); line-height: 1.2;
  }
}

body.mobile-ui .section-page:not(.hidden) { display: block; position: fixed; z-index: 1400; left: 0; right: 0;
  top: var(--mobile-top); overflow-y: auto;
  -webkit-overflow-scrolling: touch; scroll-padding-block: 8px 24px;
  padding: 8px max(10px, env(safe-area-inset-right)) 24px max(10px, env(safe-area-inset-left)); background: #0b1016; }
body.mobile-ui .section-page .sec > * { margin-bottom: 12px; }
body.mobile-ui #pilotWorkspaceNav, body.mobile-ui #workspacePreview { display: none !important; }
body.mobile-ui:not([data-section="flight"]) .sheet { visibility: hidden; }
body.mobile-ui .section-page #adminNavBtn { display: flex; margin: 0 0 12px; min-height: 48px; }
body.mobile-ui .section-page #adminNavBtn.hidden { display: none; }
body.mode-wall .mobile-tabs, body.mode-wall .section-page, body.login-view .mobile-tabs, body.login-view .section-page { display: none !important; }
/* aile ana sayfası */
#viewerHome .vh-list { list-style: none; padding: 0; margin: 8px 0 0; }
#viewerHome .vh-list li { padding: 9px 0; border-bottom: 1px solid #222d3a; font-size: 15px; }
/* sade roster yükleme */
.sr-upload { display: flex; flex-direction: column; gap: 10px; }
.sr-file { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 2px dashed #55647a; border-radius: 12px; font-weight: 600; }
.sr-file input { font-size: 15px; }
.sr-go { min-height: 50px; font-size: 17px; }
.sr-adv { font-size: 14px; color: #a9b6c6; }
.sr-adv label { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.sr-summary { font-weight: 650; font-size: 17px; margin: 6px 0; }
body.mobile-ui .dstatus:empty::after { content: none; }
/* Audio Studio — touch-friendly, accessible controls */
.hiko-audio-lab{margin:18px 0;padding:18px;border:1px solid #52647d;border-radius:16px;background:#121d2c;color:#f5f7fc}
.hiko-audio-lab h3{margin:0 0 8px;font-size:1.2rem}
.hiko-audio-lab .note{color:#c9d6e5}
.hiko-audio-row{display:flex;justify-content:space-between;gap:12px;margin:14px 0 8px}
#hikoAudioVolume{width:100%;min-height:34px;accent-color:#70b7ff}
.hiko-audio-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}
.hiko-audio-actions button{min-height:48px;border:1px solid #6d829c;border-radius:12px;background:#21354d;color:white;font-size:15px}
.hiko-audio-actions button:focus-visible{outline:3px solid #90c9ff;outline-offset:2px}
@media(max-width:380px){.hiko-audio-actions{grid-template-columns:1fr}}

/* Davet iPhone: genel .controls satır düzenini kullanma; üç alan da tam genişlik. */
#inviteBox { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
#inviteBox .invite-form { display: flex; flex-direction: column; align-items: stretch; gap: 12px; width: 100%; min-width: 0; margin: 14px 0; }
#inviteBox .invite-form label { display: flex; flex-direction: column; align-items: stretch; gap: 6px; width: 100%; min-width: 0; max-width: 100%; flex: 0 0 auto; white-space: normal; font-size: 14px; }
#inviteBox .invite-form input { display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 48px; font-size: 16px; }
#inviteBox .invite-form button { width: 100%; min-height: 50px; white-space: normal; font-size: 16px; }
#inviteBox > button, #inviteBox > a.btn { display: block; width: 100%; max-width: 100%; text-align: center; margin: 10px 0 0; white-space: normal; }
#inviteBox > .hidden { display: none !important; }
/* Pilot yöneticinin onay paneli telefonda her sayfadan erişilebilir. */
body.mobile-ui .account-admin { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  min-height: 43px; padding: 8px 9px; border: 1px solid #7e6c48; border-radius: 10px; background: #28200f;
  font-size: 13px; font-weight: 700; color: #fff; text-decoration: none; white-space: nowrap; }
body.mobile-ui .account-admin:focus-visible { outline: 3px solid #90c9ff; outline-offset: 2px; }
@media (max-width: 380px) { body.mobile-ui .account-admin { font-size: 12px; padding: 7px; }
  body.mobile-ui .account-bar .logout-fixed { font-size: 13px; padding: 8px; } }

/* ---------- Telefon: hesap şeridi + Çıkış Yap (alt sekmelerin hemen üstünde, sekmelerden ayrı eylem) ---------- */
.account-bar { display: none; }
body.mobile-ui .account-bar:not(.hidden) { display: flex; align-items: center; gap: 10px; position: fixed; z-index: 1501;
  left: 0; right: 0; bottom: var(--mobile-tabs-size); min-height: 50px;
  padding: 3px max(10px, env(safe-area-inset-right)) 3px max(12px, env(safe-area-inset-left));
  background: #0d131b; border-top: 1px solid #2a3747; }
body.mobile-ui .account-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #a9b6c6; font-size: 14px; }
body.mobile-ui .account-bar .logout-fixed { position: static; flex: 0 0 auto; min-height: 44px; min-width: 44px; padding: 8px 16px;
  font-size: .9375rem; font-weight: 600; background: transparent; color: #ffb3a8; border: 1.5px solid #b44a3e; border-radius: 10px;
  box-shadow: none; }
body.mobile-ui .account-bar .logout-fixed.armed { background: #8d1521; color: #fff; border-color: #8d1521; }
body.mobile-ui .account-bar .logout-fixed:focus-visible { outline: 3px solid #90c9ff; outline-offset: 2px; }
/* içerik hesap şeridinin altında kalmasın */
body.mobile-ui .section-page:not(.hidden), body.mobile-ui .sheet { bottom: var(--mobile-dock); }
body.mobile-ui.mobile-keyboard-open .section-page:not(.hidden) {
  top: max(var(--mobile-top), var(--editing-viewport-top)); bottom: var(--editing-viewport-bottom); }
body.mobile-ui.mobile-keyboard-open :is(.account-bar, .mobile-tabs),
body.mobile-ui.hiko-map-fullscreen :is(.account-bar, .mobile-tabs, .sheet) { visibility: hidden; }
body.mobile-ui .grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.mobile-ui .grid-form > * { min-width: 0; }
body.mobile-ui .grid-form .wide { grid-column: 1 / -1; }
body.mobile-ui .section-page :is(input, select, textarea) { min-width: 0; max-width: 100%; font-size: 1rem; }
#importReview .table-wrap { max-width: 100%; }
#importReview .table-wrap:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
#importReview .inline { flex-wrap: wrap; }
#ocrRaw { white-space: pre-wrap; overflow-wrap: anywhere; }
body.login-view .account-bar, body.mode-wall .account-bar { display: none !important; }
@media (prefers-reduced-motion: reduce) { body.mobile-ui .account-bar .logout-fixed { transition: none; } }
@media (min-width: 500px) and (max-height: 500px) {
  body.mobile-ui {
    --mobile-account-width: calc(clamp(150px, 28vw, 210px) + env(safe-area-inset-right));
    --mobile-dock: max(var(--mobile-account-size), var(--mobile-tabs-size));
  }
  body.mobile-ui:has(#adminQuickLink:not(.hidden)) {
    --mobile-account-width: calc(clamp(215px, 34vw, 255px) + env(safe-area-inset-right));
  }
  body.mobile-ui .mobile-tabs:not(.hidden) {
    right: var(--mobile-account-width); padding-right: 6px;
  }
  body.mobile-ui .account-bar:not(.hidden) {
    left: auto; bottom: 0; width: var(--mobile-account-width);
    min-height: calc(63px + env(safe-area-inset-bottom));
    padding-left: 8px; padding-bottom: calc(3px + env(safe-area-inset-bottom));
  }
  body.mobile-ui .account-bar :is(.account-admin, .logout-fixed) { flex: 0 1 auto; white-space: normal; }
}

/* Yolculuk listeleri */
.journey-list{list-style:none;padding:0;margin:8px 0 0}
.journey-list .jr-day{list-style:none;margin:12px 0 2px;font-weight:700;color:#cfe3ff}
.journey-list .jr-item{list-style:none;display:flex;gap:10px;align-items:flex-start;padding:9px 0;border-top:1px solid #2a3747}
.journey-list .jr-ic{font-size:1.35rem;min-width:28px;text-align:center}
.journey-list .jr-body{display:flex;flex-direction:column;gap:2px}
.journey-list .jr-sub{color:#a9b6c6;font-size:.92em}
.journey-list .jr-bus strong{font-weight:600}


/* Aile üyesi daveti TV ekran tokenından ayrıdır; mobil sekmede kaydırırken görünür. */
.family-invite-access { border: 1px solid #6d5845; background: #171b22; }
.family-invite-access-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.family-invite-access-title { flex: 1 1 175px; min-width: 0; }
.family-invite-access-title strong { display: block; font-size: 16px; color: #f5f7fc; }
.family-invite-access-title .note { margin: 5px 0 0; }
.family-invite-cta { flex: 0 1 auto; min-height: 48px; padding: 10px 14px; border-radius: 11px;
  color: #fff; background: #9b1626; border: 1px solid #db4553; font-weight: 700; font-size: 15px; }
.family-invite-cta:disabled { opacity: .6; }
#familyInviteQuickResult { margin-top: 12px; }
#familyInviteQuickResult label { display: block; margin-bottom: 6px; font-size: 13px; color: #c9d6e5; }
#familyInviteQuickLink { display: block; width: 100%; max-width: 100%; min-height: 72px; resize: vertical;
  padding: 10px; background: #0b1420; color: #f5f7fc; border: 1px solid #64748b; border-radius: 9px;
  font-size: 14px; overflow-wrap: anywhere; }
#familyInviteCopy { margin: 8px 0 0; min-height: 44px; }
body.mobile-ui .section-page .sec[data-sec="family"] #familyInviteAccess { position: sticky; top: -8px; z-index: 5;
  margin-bottom: 12px; padding: 12px; box-shadow: 0 7px 22px rgba(0,0,0,.6); }
body.mobile-ui .family-invite-access-row { gap: 8px; }
body.mobile-ui .family-invite-access-title .note { font-size: 12px; line-height: 1.35; }
body.mobile-ui .family-invite-cta { width: 100%; flex: 1 1 100%; }
@media (max-height: 500px) {
  body.mobile-ui .section-page .sec[data-sec="family"] #familyInviteAccess { position: static; }
}


/* P1 opt-in smart notifications — readable on small phones, no hidden controls. */
.smart-notify-controls { margin-top: 14px; border: 1px solid #3b5168; border-radius: 14px; padding: 14px 12px; min-width: 0; }
.smart-notify-controls legend { font-weight: 700; font-size: 15px; color: #f5f7fc; padding: 0 6px; }
.smart-notify-controls .check { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0; }
.smart-notify-controls .check input { flex: 0 0 auto; width: 18px; height: 18px; }
.smart-notify-hours { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.smart-notify-hours label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; min-width: 0; }
.smart-notify-hours input { width: 100%; min-width: 0; min-height: 44px; font-size: 16px;
  background: #0b1623; color: #f5f7fc; border: 1px solid #748699; border-radius: 9px; padding: 7px; }
#shortcutShareFlight { display: block; margin: 12px 0; min-height: 46px; max-width: 100%; white-space: normal; text-align: left; }


/* Aile izleyicisi: bildirimleri açma yolunu uçuş listesi üzerinde görünür kıl. */
.viewer-alert-setup { display: grid; gap: 8px; padding: 12px; margin: 10px 0 16px;
  border: 1px solid #4a6380; border-radius: 12px; background: #132131; color: #f3f7ff; }
.viewer-alert-setup strong { font-size: 16px; }
.viewer-alert-setup p { margin: 0; font-size: 13px; line-height: 1.4; }
.viewer-alert-setup button { justify-self: start; min-height: 44px; padding: 9px 13px;
  border: 1px solid #7ba8d7; border-radius: 9px; color: #fff; background: #15395b; }
.viewer-alert-setup button:focus-visible { outline: 3px solid #90c9ff; outline-offset: 2px; }
body.mobile-ui .viewer-alert-setup button { width: 100%; }


/* Family-only narrative. No generated current location or pseudo-live interpolation. */
.family-narrative { box-sizing: border-box; width: 100%; max-width: 100%; padding: 13px 15px;
  margin: 10px 0; background: #111e2d; border: 1px solid #5b7088;
  border-radius: 14px; color: #eef4fd; overflow-wrap: anywhere; }
.family-narrative-top { display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 7px 10px; }
.family-narrative-top strong { font-size: 15px; font-weight: 700; }
.family-narrative-tag { font-size: 11px; font-weight: 750; letter-spacing: .03em; text-transform: uppercase;
  color: #e6d9a9; border: 1px solid #8d7545; border-radius: 25px; padding: 4px 9px; }
.family-narrative[data-state="live"] .family-narrative-tag,
.family-narrative[data-state="landed"] .family-narrative-tag {
  color: #a2efd0; border-color: #38866a; }
.family-narrative[data-state="stale"] .family-narrative-tag,
.family-narrative[data-state="unavailable"] .family-narrative-tag {
  color: #ffd4a9; border-color: #be7843; }
.family-narrative-text { margin: 10px 0 7px; font-size: 15px; line-height: 1.48; font-weight: 550; }
.family-narrative-caption { margin: 0; font-size: 11px; line-height: 1.4; color: #b2c0d3; }
body.mobile-ui .sheet-live .family-narrative { margin: 0 0 12px; padding: 11px 13px; }
body.mobile-ui .sheet-live .family-narrative-text { font-size: 14px; }


/* The mobile flight sheet uses an explicit 2-column CSS grid. Without a named
   first row, narrative auto-places into a narrow route/photo column. */
body.mobile-ui.role-viewer .sheet-live {
  grid-template-areas: "narrative narrative" "route photo" "tele tele";
}
body.mobile-ui.role-viewer .sheet-live #familyStatusQuick {
  grid-area: narrative;
  grid-column: 1 / -1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  margin: 0 0 4px;
}


/* Flight Memory V1: responsive, owner-only historical roster summary. */
.hiko-history{margin-top:22px;border-top:1px solid rgba(147,163,184,.3);padding-top:15px;min-width:0}
.hiko-history h3{margin:0 0 8px}
.hiko-history-list{list-style:none;margin:0;padding:0;display:grid;gap:9px;max-width:100%}
.hiko-history-item{display:flex;gap:12px;align-items:flex-start;padding:13px;border:1px solid rgba(147,163,184,.28);border-radius:12px;background:rgba(15,23,42,.3);min-width:0}
.hiko-history-status-icon{flex:0 0 26px;text-align:center;font-size:23px;color:#cbd5e1}
.hiko-history-details{display:flex;flex-direction:column;min-width:0;gap:3px;overflow-wrap:anywhere}
.hiko-history-details strong{color:#f1f5f9}
.hiko-history-times{font-size:13px;color:#cbd5e1}
.hiko-history-unverified{font-size:12px;color:#fbbf24}
#hikoFlightHistoryMore{min-height:44px;max-width:100%;margin-top:9px}
@media(max-width:430px){.hiko-history{padding-top:12px}.hiko-history-item{padding:11px;gap:9px}.hiko-history-status-icon{flex-basis:20px}}


/* Flight Memory pilot-private notes */
.hiko-history-editor{display:flex;flex-direction:column;align-items:flex-start;gap:7px;margin-top:6px;width:100%;min-width:0}
.hiko-history-note-text{font-size:13px;color:#d9e4ef;overflow-wrap:anywhere;white-space:pre-wrap}
.hiko-history-note-form{display:flex;flex-direction:column;gap:9px;width:100%;max-width:100%;padding:10px;border:1px solid rgba(147,163,184,.3);border-radius:10px}
.hiko-history-note-form[hidden]{display:none}
.hiko-history-note-form label{display:block;font-size:13px;font-weight:600;width:100%}
.hiko-history-note-input{display:block;width:100%;max-width:100%;box-sizing:border-box;min-height:78px;margin-top:5px;resize:vertical}
.hiko-history-edit-note,.hiko-history-save-note,.hiko-history-note-form button{min-height:44px}
.hiko-history-note-feedback{font-size:12px}

#boardingPassImport summary { display: flex; align-items: center; min-height: 48px; cursor: pointer; font-weight: 700; }
#boardingPassImport summary::after { content: "+"; margin-inline-start: auto; padding-inline: 10px; }
#boardingPassImport details[open] summary::after { content: "−"; }
#boardingPassActions { margin-block: 10px; }
#boardingPassActions button { flex: 1 1 9rem; white-space: normal; }
#boardingPassForm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#boardingPassForm .wide { grid-column: 1 / -1; }
#boardingPassForm :is(label, input, select) { min-width: 0; }
#boardingPassForm :is(input, select) { font-size: 1rem; }
#boardingPassForm :is(label.check, button) { min-height: 44px; }
.personal-travel-label { display: block; font-size: .75rem; line-height: 1.3; color: var(--muted); white-space: normal; }
.display-pref-hidden { display: none !important; }
.display-large-text .route-times,
.display-large-text .idle-when,
.display-large-text .journey-list { font-size: 1.2rem; }
.display-large-text .route-names,
.display-large-text .jr-sub { font-size: 1.05rem; }
.display-contrast #dash, .display-contrast #viewerHome, .display-contrast #settingsPanel {
  --card: #000;
  --muted: #dedede;
  --text: #fff;
  color: #fff;
  background-color: #000;
}
.display-contrast :focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.display-reduced-motion *, .display-reduced-motion *::before, .display-reduced-motion *::after {
  animation-duration: 0.001ms !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}
