/* FPFUT Flight Test Log — sunlight-readable field UI */
:root {
  --paper: #EEF1F4;
  --panel: #FFFFFF;
  --ink: #16212D;
  --ink-soft: #5B6B7B;
  --line: #C9D2DB;
  --orange: #E85D04;   /* Cube Orange */
  --orange-deep: #C24E03;
  --green: #2E7D32;
  --red: #C62828;
  --red-soft: #FDECEA;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

/* placard-style labels */
.brand-mark {
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 1.1rem;
  color: var(--ink);
}
.brand-mark::after { content: ""; display: inline-block; width: 0.55em; height: 0.55em; margin-left: 0.4em; background: var(--orange); }
.brand-sub { display: block; color: var(--ink-soft); font-size: 0.85rem; margin-top: 0.3rem; letter-spacing: 0.04em; }

/* topbar */
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.7rem 1rem;
  padding-top: calc(0.7rem + env(safe-area-inset-top));
  background: var(--panel);
  border-bottom: 3px solid var(--ink);
  position: sticky; top: 0; z-index: 10;
}
.tabs { display: flex; gap: 0.4rem; flex: 1; }
.tab {
  border: 2px solid transparent; background: none; font: inherit; font-weight: 600;
  padding: 0.55rem 1rem; border-radius: var(--radius); color: var(--ink-soft); cursor: pointer;
  min-height: 44px;
}
.tab.active { color: var(--ink); border-color: var(--ink); }

main { max-width: 860px; margin: 0 auto; padding: 1rem 1rem 4rem; }

.view-head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; margin: 0.6rem 0 1rem; }
h1 { font-size: 1.5rem; margin: 0; letter-spacing: 0.01em; }
h2 { font-size: 1.1rem; margin: 0 0 0.6rem; text-transform: uppercase; letter-spacing: 0.08em; }
.empty { color: var(--ink-soft); }
.hint { color: var(--ink-soft); font-size: 0.9rem; }

/* buttons — big tap targets */
.btn {
  font: inherit; font-weight: 600; border-radius: var(--radius); cursor: pointer;
  min-height: 46px; padding: 0.6rem 1.2rem; border: 2px solid transparent;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:active { background: var(--orange-deep); }
.btn-ghost { background: none; border-color: var(--line); color: var(--ink); }
.btn-danger-ghost { background: none; border-color: var(--line); color: var(--red); }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 0.3rem 0.8rem; }
.btn-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }

/* panels */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; margin-bottom: 1rem;
}

/* flight cards */
.card-list { display: flex; flex-direction: column; gap: 0.6rem; }
.flight-card {
  display: flex; align-items: center; gap: 0.9rem; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.9rem 1rem; font: inherit; cursor: pointer; min-height: 64px; width: 100%;
}
.flight-card.has-incident { border-left: 5px solid var(--red); }
.flight-main { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.flight-title { font-weight: 700; }
.flight-sub { color: var(--ink-soft); font-size: 0.9rem; }
.incident-flag { color: var(--red); font-weight: 800; font-size: 0.8rem; letter-spacing: 0.08em; }

.phase-chip {
  background: var(--ink); color: #fff; font-weight: 800; border-radius: 6px;
  padding: 0.25rem 0.55rem; font-size: 0.9rem; letter-spacing: 0.04em; flex-shrink: 0;
}
.phase-chip.big { font-size: 1.05rem; padding: 0.35rem 0.7rem; }

/* meta panel */
.meta-panel .meta-name { font-weight: 600; margin-left: 0.6rem; }
.meta-grid { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin-top: 0.8rem; color: var(--ink-soft); }
.meta-notes { margin: 0.8rem 0 0; white-space: pre-wrap; }
.incident-box {
  margin-top: 0.9rem; background: var(--red-soft); border-left: 5px solid var(--red);
  border-radius: 6px; padding: 0.7rem 0.9rem;
}
.incident-box strong { color: var(--red); letter-spacing: 0.08em; }
.incident-box p { margin: 0.3rem 0 0; white-space: pre-wrap; }

/* checklist */
.cl-head { display: flex; align-items: baseline; justify-content: space-between; }
.cl-count { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--orange-deep); }
.cl-section {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-soft); margin: 1.1rem 0 0.4rem; border-bottom: 1px solid var(--line); padding-bottom: 0.25rem;
}
.cl-item {
  display: flex; align-items: flex-start; gap: 0.8rem;
  padding: 0.7rem 0.4rem; min-height: 52px; cursor: pointer;
  border-bottom: 1px dashed var(--line);
}
.cl-item input { width: 26px; height: 26px; flex-shrink: 0; accent-color: var(--green); margin-top: 1px; }
.cl-item.checked span { color: var(--ink-soft); }
.cl-item:last-child { border-bottom: none; }

/* forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.form-grid label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; font-size: 0.9rem; }
.form-grid .span2 { grid-column: span 2; }
.form-grid input, .form-grid select, .form-grid textarea {
  font: inherit; font-weight: 400; padding: 0.6rem 0.7rem; min-height: 46px;
  border: 1.5px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
.form-grid textarea { min-height: auto; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus,
.btn:focus-visible, .tab:focus-visible, .cl-item input:focus-visible {
  outline: 3px solid var(--orange); outline-offset: 1px;
}
.check-row { flex-direction: row !important; align-items: center; gap: 0.7rem !important; min-height: 46px; }
.check-row input { width: 24px; height: 24px; min-height: auto; accent-color: var(--red); }
.form-err, .login-err { color: var(--red); font-weight: 600; }

/* files */
.file-list { margin-top: 0.8rem; display: flex; flex-direction: column; gap: 0.4rem; }
.file-row {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.5rem 0.2rem; border-bottom: 1px dashed var(--line);
}
.file-row a { color: var(--ink); font-weight: 600; flex: 1; word-break: break-all; }
#fileInput { margin: 0.5rem 0.6rem 0.5rem 0; font: inherit; }

/* phase rail — the program ladder */
.phase-rail { display: flex; flex-direction: column; gap: 0.5rem; }
.phase-row {
  display: flex; align-items: center; gap: 1rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.9rem 1rem;
}
.phase-num {
  font-size: 1.6rem; font-weight: 800; width: 2.4rem; text-align: center;
  color: var(--line); flex-shrink: 0;
}
.phase-row.in_progress { border-left: 5px solid var(--orange); }
.phase-row.in_progress .phase-num { color: var(--orange); }
.phase-row.complete { border-left: 5px solid var(--green); }
.phase-row.complete .phase-num { color: var(--green); }
.phase-body { flex: 1; display: flex; flex-direction: column; gap: 0.15rem; }
.phase-name { font-weight: 700; }
.phase-meta { color: var(--ink-soft); font-size: 0.9rem; }
.phase-notes { font-size: 0.9rem; }
.phase-status {
  font: inherit; min-height: 46px; padding: 0.4rem 0.6rem;
  border: 1.5px solid var(--line); border-radius: 8px; background: #fff;
}

/* login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.login-card {
  background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--orange);
  border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 0.9rem;
}
.field-label { font-weight: 600; font-size: 0.9rem; }
.login-card input {
  font: inherit; padding: 0.7rem; min-height: 48px;
  border: 1.5px solid var(--line); border-radius: 8px;
}
.login-card input:focus { outline: 3px solid var(--orange); outline-offset: 1px; }

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: span 1; }
  .phase-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* phase accordion */
.acc { display: flex; flex-direction: column; gap: 12px; }
.acc-row { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.acc-row.in_progress { border-left: 5px solid var(--orange); }
.acc-row.complete { border-left: 5px solid var(--green); }
.acc-head {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 14px 16px; background: none; border: 0; font: inherit; text-align: left; cursor: pointer;
}
.acc-head:hover { background: rgba(0,0,0,0.03); }
.acc-title { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acc-chev { color: var(--ink-soft); font-size: 1rem; }
.inc-meta { color: var(--red); font-weight: 600; }
.acc-body { padding: 4px 16px 18px; border-top: 1px solid var(--line); }

/* flight chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 0; }
.chip-label { font-size: 0.85rem; color: var(--ink-soft); }
.chip {
  font: inherit; font-size: 0.9rem; padding: 7px 14px; min-height: 40px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--panel); cursor: pointer;
}
.chip.active { border-color: var(--orange); background: #FFF3E8; font-weight: 600; }
.chip-incident { border-color: var(--red); }
.chip-new { color: var(--ink-soft); border-style: dashed; }

/* sub tabs */
.subtabs { display: flex; gap: 2px; border-bottom: 1.5px solid var(--line); overflow-x: auto; }
.subtabs button {
  font: inherit; font-size: 0.95rem; padding: 10px 16px; min-height: 44px;
  background: none; border: 0; border-bottom: 3px solid transparent; cursor: pointer; color: var(--ink-soft); white-space: nowrap;
}
.subtabs button.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--orange); }
.subtab-content { padding-top: 14px; }
.cl-progress { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 6px; }

/* checklist value inputs */
.cl-label { flex: 1; }
.cl-valwrap { flex-shrink: 0; }
.cl-val {
  width: 90px; font: inherit; font-size: 0.9rem; padding: 6px 8px; min-height: 40px;
  border: 1.5px solid var(--line); border-radius: 8px; text-align: right;
}
.cl-val:focus { outline: 2px solid var(--orange); }

.debrief textarea {
  width: 100%; font: inherit; padding: 0.7rem;
  border: 1.5px solid var(--line); border-radius: 8px;
}
.upload-block { margin-top: 16px; }

/* retest + preview */
.retest-block { display: block; margin-bottom: 14px; font-weight: 600; font-size: 0.95rem; }
.retest-block textarea {
  width: 100%; margin-top: 6px; font: inherit; font-weight: 400; padding: 0.7rem;
  border: 1.5px solid var(--orange); border-radius: 8px; background: #FFF8F2;
}
.cl-preview { opacity: 0.75; }

/* flight review */
.btn-success { background: var(--green); color: #fff; border: 0; }
.btn-danger { background: var(--red); color: #fff; border: 0; }
.review-status { margin: 6px 0 10px; }
.review-chat {
  max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
  border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--paper);
}
.rmsg { padding: 10px 14px; border-radius: 12px; max-width: 92%; white-space: pre-wrap; font-size: 0.95rem; }
.rmsg.ai { background: var(--panel); border: 1px solid var(--line); align-self: flex-start; }
.rmsg.me { background: #FFF3E8; border: 1px solid var(--orange); align-self: flex-end; }
.rmsg.sys { align-self: center; color: var(--ink-soft); font-size: 0.8rem; background: none; }
.review-input { display: flex; gap: 8px; margin-top: 10px; }
.review-input textarea { flex: 1; font: inherit; padding: 0.6rem; border: 1.5px solid var(--line); border-radius: 8px; }
.review-actions { margin-top: 8px; }
.review-doc { margin-top: 14px; border-top: 2px solid var(--orange); padding-top: 10px; }
.review-doc pre { white-space: pre-wrap; font-size: 0.9rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }

/* ask bar + mic */
.askbar-wrap { max-width: 900px; margin: 0 auto; padding: 12px 16px 0; }
.askbar { display: flex; gap: 8px; }
.askbar input {
  flex: 1; font: inherit; padding: 10px 14px; min-height: 44px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--panel);
}
.askbar input:focus { outline: 2px solid var(--orange); }
.mic { font-size: 1.1rem; min-width: 44px; }
.mic.rec { background: var(--red); color: #fff; border-color: var(--red); animation: micpulse 1.2s infinite; }
@keyframes micpulse { 50% { opacity: 0.6; } }
.ask-panel { margin-top: 10px; }
.ask-a { background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px; }
.ask-q { font-weight: 600; margin-bottom: 8px; }
.ask-cached { font-size: 0.75rem; color: var(--green); border: 1px solid var(--green); border-radius: 999px; padding: 2px 8px; margin-left: 6px; font-weight: 400; }
.ask-body { white-space: pre-wrap; font-size: 0.95rem; margin-bottom: 10px; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- AI-age restyle ---------- */
.topbar { flex-wrap: wrap; gap: 10px; }
.askwrap { flex: 1 1 260px; min-width: 220px; position: relative; display: flex; gap: 8px; }
.micwrap { position: relative; flex: 1; display: flex; }
.micwrap.grow { flex: 1; }
.micwrap input, .micwrap textarea {
  width: 100%; font: inherit; padding: 10px 46px 10px 14px; min-height: 44px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--panel);
}
.micwrap textarea { border-radius: 14px; }
.micwrap input:focus, .micwrap textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,93,4,0.18); }
.micbtn {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent;
  color: var(--ink-soft); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 7px;
}
.micbtn svg { width: 100%; height: 100%; }
.micbtn:hover { background: rgba(232,93,4,0.12); color: var(--orange); }
.micbtn.rec { background: var(--red); color: #fff; animation: micpulse 1.2s infinite; }
.voicebtn { min-width: 44px; padding: 8px; }
.voicebtn svg { width: 22px; height: 22px; }
.voicebtn.voice-off .v-on { display: none; }
.voicebtn.voice-off { opacity: 0.45; }
.ask-panel { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60; }
.ask-a { box-shadow: 0 12px 40px rgba(22,33,45,0.18); border-radius: 16px; }

/* chat restyle */
.review-chat { border-radius: 18px; background: linear-gradient(180deg, #F6F8FA, #EDF1F5); border: 1px solid var(--line); }
.rmsg { border-radius: 16px; line-height: 1.5; }
.rmsg.ai { background: #fff; border: 1px solid #E2E8EF; border-left: 3px solid var(--orange); box-shadow: 0 2px 10px rgba(22,33,45,0.06); white-space: normal; }
.rmsg.me { background: linear-gradient(135deg, #FFF3E8, #FFE7D3); border: 1px solid #F3C9A8; }
.rmsg.ai .rq { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; margin: 2px 0 4px; }
.rmsg.ai em { color: var(--ink-soft); }
.rmsg.ai ul { margin: 4px 0 4px 20px; }
.rmsg.ai code { background: var(--paper); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: 0.88em; }
.rgap { height: 8px; }
.review-doc-body { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; font-size: 0.95rem; }
.review-doc-body .rq { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; margin: 10px 0 4px; }
.review-doc-body ul { margin: 4px 0 8px 20px; }

/* pulsing AI orb */
.ai-orb {
  position: fixed; right: 22px; bottom: 22px; z-index: 100;
  width: 74px; height: 74px; cursor: pointer;
}
.ai-orb img {
  position: absolute; inset: 7px; width: 60px; height: 60px; border-radius: 50%;
  box-shadow: 0 6px 24px rgba(22,33,45,0.35);
}
.ai-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--orange); opacity: 0;
}
.ai-orb.speaking .ai-ring { animation: ring 1.6s ease-out infinite; }
.ai-orb.speaking .ai-ring.r2 { animation-delay: 0.8s; }
.ai-orb.speaking img { animation: breathe 1.6s ease-in-out infinite; }
.ai-orb.thinking .ai-ring { border-color: #7A8CA0; animation: ring 1.1s ease-out infinite; }
.ai-orb.thinking .ai-ring.r2 { animation-delay: 0.55s; }
@keyframes ring { 0% { transform: scale(0.85); opacity: 0.9; } 100% { transform: scale(1.55); opacity: 0; } }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }

@media (max-width: 760px) {
  .askwrap { order: 10; flex-basis: 100%; }
}

/* ---------- FPF FLIGHT INTEL — dark AI panel ---------- */
.review-wrap.intel {
  background: radial-gradient(120% 140% at 20% 0%, #16283F 0%, #0C1626 55%, #0A121F 100%);
  border-radius: 20px;
  padding: 18px;
  border: 1px solid #22354D;
  box-shadow: 0 18px 50px rgba(6, 12, 22, 0.35);
}
.intel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.intel-ava { position: relative; width: 58px; height: 58px; flex-shrink: 0; }
.intel-ava img { position: absolute; inset: 5px; width: 48px; height: 48px; border-radius: 50%; filter: invert(1) brightness(1.6) drop-shadow(0 0 8px rgba(232,93,4,0.45)); }
.intel-ava .ir { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--orange); opacity: 0; }
.intel-ava.speaking .ir { animation: ring 1.5s ease-out infinite; }
.intel-ava.speaking .ir.i2 { animation-delay: 0.75s; }
.intel-ava.speaking img { animation: breathe 1.5s ease-in-out infinite; }
.intel-ava.thinking .ir { border-color: #5E7A9B; animation: ring 1s ease-out infinite; }
.intel-ava.thinking .ir.i2 { animation-delay: 0.5s; }
.intel-id { flex: 1; min-width: 0; }
.intel-title { color: #EDF2F8; font-weight: 800; letter-spacing: 0.24em; font-size: 0.82rem; }
.intel-status { color: #6E87A3; font-size: 0.68rem; letter-spacing: 0.3em; margin-top: 3px; }
.intel-outcome { font-size: 0.68rem; letter-spacing: 0.2em; padding: 4px 12px; border-radius: 999px; border: 1px solid; }
.intel-outcome.success { color: #6FE3A1; border-color: #2E7D5B; background: rgba(46,125,91,0.15); }
.intel-outcome.issues { color: #FF9E8A; border-color: #A5453A; background: rgba(165,69,58,0.15); }
.intel-restart {
  background: transparent; color: #8AA2BD; border: 1px solid #2C425E;
  font-size: 0.72rem; letter-spacing: 0.1em; padding: 7px 14px;
}
.intel-restart:hover { color: #EDF2F8; border-color: #5E7A9B; }

.intel .review-chat {
  background: rgba(10, 18, 31, 0.5);
  border: 1px solid #1E3049;
  border-radius: 16px;
}
.intel .rmsg.ai {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-left: 3px solid var(--orange);
  color: #DCE6F1;
  box-shadow: none;
  backdrop-filter: blur(4px);
}
.intel .rmsg.ai .rq { color: #FFFFFF; text-decoration-color: var(--orange); }
.intel .rmsg.ai em { color: #92A9C2; }
.intel .rmsg.ai code { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); color: #FFD9BC; }
.intel .rmsg.me {
  background: linear-gradient(135deg, #E85D04, #C24E03);
  border: 0; color: #fff;
}
.intel .rmsg.sys { color: #55708E; }
.intel .review-input textarea {
  background: rgba(255,255,255,0.06); border-color: #2C425E; color: #EDF2F8; border-radius: 14px;
}
.intel .review-input textarea::placeholder { color: #55708E; }
.intel .review-input textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,93,4,0.25); }
.intel .micbtn { color: #8AA2BD; }
.intel .micbtn:hover { color: var(--orange); }
.intel .review-actions .btn-ghost { background: transparent; color: #8AA2BD; border: 1px solid #2C425E; }
.intel .review-actions .btn-ghost:hover { color: #EDF2F8; border-color: #5E7A9B; }
.intel .cl-section, .intel h3 { color: #EDF2F8; }
.intel .review-doc { border-top-color: var(--orange); }
.intel .review-doc-body { background: rgba(255,255,255,0.97); }

/* ---------- work + doc ---------- */
.work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .work-grid { grid-template-columns: 1fr; } }
.work-h { font-size: 1.05rem; margin-bottom: 10px; }
.work-h .hint { font-weight: 400; }
.new-item { background: var(--panel); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 14px; }
.new-item input { width: 100%; font: inherit; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.new-item-row { display: flex; gap: 8px; }
.new-item-row select { font: inherit; padding: 7px; border: 1.5px solid var(--line); border-radius: 8px; }
.work-item { background: var(--panel); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.work-item.done { opacity: 0.55; }
.work-item.active { border-left: 4px solid var(--orange); }
.wi-head { display: flex; align-items: center; gap: 8px; }
.wi-title { font-weight: 600; }
.wi-meta { font-size: 0.8rem; color: var(--ink-soft); margin: 4px 0 8px; }
.wi-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.wi-actions select { font: inherit; font-size: 0.85rem; padding: 6px; border: 1.5px solid var(--line); border-radius: 8px; }
.prio { font-size: 0.68rem; letter-spacing: 0.08em; padding: 2px 8px; border-radius: 999px; border: 1px solid; }
.prio.high { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.prio.medium { color: var(--orange); border-color: var(--orange); background: #FFF3E8; }
.prio.low { color: var(--ink-soft); border-color: var(--line); }
.cmts { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.cmt { font-size: 0.9rem; margin-bottom: 8px; }
.cmt-new { display: flex; gap: 8px; }
.cmt-new input { flex: 1; font: inherit; padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 8px; }
.doc-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.doc-bar #docSave { margin-left: auto; }
.doc-edit { width: 100%; min-height: 420px; font: 0.95rem/1.5 ui-monospace, Menlo, monospace; padding: 16px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--panel); }
.doc-edit:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,93,4,0.15); }
.rev-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }

/* aircraft selector + gating */
.ac-select { display: flex; gap: 10px; margin-bottom: 16px; }
.ac-btn {
  font: inherit; font-weight: 600; padding: 10px 22px; min-height: 44px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel); cursor: pointer; color: var(--ink-soft);
}
.ac-btn.active { border-color: var(--orange); color: var(--ink); background: #FFF3E8; box-shadow: 0 2px 10px rgba(232,93,4,0.15); }
.acc-row.locked { opacity: 0.5; }
.acc-row.locked .acc-head { cursor: not-allowed; }
.phase-meta-box {
  background: var(--paper); border: 1px dashed var(--line); border-radius: 10px;
  padding: 10px 14px; font-size: 0.88rem; color: var(--ink-soft); margin: 10px 0 2px;
}

/* ---------- training ---------- */
.tr-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.tr-pilot { font-weight: 600; font-size: 0.9rem; display: flex; flex-direction: column; gap: 4px; }
.tr-pilot select { font: inherit; padding: 8px; border: 1.5px solid var(--line); border-radius: 8px; }
.tr-hours { display: flex; gap: 10px; flex: 1; }
.tr-hour { background: var(--panel); border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 16px; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); text-align: center; }
.tr-hour span { display: block; font-size: 1.3rem; font-weight: 700; color: var(--ink); letter-spacing: 0; }
.tr-hour.combined { border-color: var(--orange); }
.tr-rule { white-space: normal; }
.tr-item { display: flex; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.tr-item input[type=checkbox] { width: 26px; height: 26px; accent-color: var(--green); flex-shrink: 0; margin-top: 2px; }
.tr-item.checked .tr-item-title { color: var(--green); }
.tr-item-main { flex: 1; }
.tr-item-pass { font-size: 0.88rem; color: var(--ink-soft); }
.tr-item-meta { display: flex; gap: 8px; align-items: center; font-size: 0.8rem; color: var(--ink-soft); margin-top: 6px; flex-wrap: wrap; }
.tr-att { width: 64px; font: inherit; font-size: 0.85rem; padding: 4px 6px; border: 1.5px solid var(--line); border-radius: 6px; }
.tr-notes { flex: 1; min-width: 140px; font: inherit; font-size: 0.85rem; padding: 4px 8px; border: 1.5px solid var(--line); border-radius: 6px; }
.seclabel-tr h2 { font-size: 1.05rem; margin: 26px 0 10px; }
.tr-sess { display: flex; gap: 12px; align-items: baseline; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 0.92rem; flex-wrap: wrap; }
.tr-sess-type { font-size: 0.65rem; letter-spacing: 0.12em; padding: 3px 8px; border-radius: 999px; }
.tr-sess-type.sim { background: #E8F0FE; color: #1A56DB; }
.tr-sess-type.aircraft { background: #FFF3E8; color: var(--orange-deep); }
.tr-form-overlay { position: fixed; inset: 0; background: rgba(12, 20, 32, 0.55); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.tr-form { background: var(--panel); border-radius: 16px; padding: 22px; width: 100%; max-width: 440px; max-height: 92vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.tr-form label { font-size: 0.82rem; font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.tr-form input, .tr-form select, .tr-form textarea { font: inherit; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 8px; }
.tr-est { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-size: 0.72rem; }
