/* Phone layouts for the finance, jobs and launch screens (mobile m1–m24). The same pages
   and routes as desktop: a page marks what a phone drops with .ph-hide and adds its phone
   block inside .ph-only. Shared with skida/wwwroot/css/phone.css — keep the two identical.
   Rules: nothing tappable under 44px; primary buttons 50px; the primary action is pinned
   to the bottom, and when it is blocked it stays visible, disabled, with the reason above. */
.ph-only { display: none; }

@media (max-width: 640px) {
  .ph-only { display: block; }
  .ph-hide { display: none !important; }

  .ph-list { display: flex; flex-direction: column; gap: 10px; }
  .ph-card { display: block; width: 100%; box-sizing: border-box; background: #fff; border: 1px solid var(--border); border-radius: 13px; padding: 14px; text-align: left; font: inherit; color: inherit; text-decoration: none; }
  button.ph-card, a.ph-card { cursor: pointer; }
  .ph-card.selected { border-color: var(--brand-blue); background: rgba(0, 35, 149, 0.03); }
  .ph-card.flag { border: 1.5px solid var(--fin-red); }
  .ph-card.dashed { border: 1.5px dashed var(--fin-dash); background: var(--fin-head); }
  .ph-row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
  .ph-row > :first-child { min-width: 0; flex: 1; }
  .ph-title { font: 700 14px/1.3 Inter, sans-serif; color: var(--text-1); }
  .ph-sub { font: 400 11.5px/1.45 Inter, sans-serif; color: var(--text-2); margin-top: 2px; }
  .ph-meta { font: 500 10.5px "JetBrains Mono", monospace; color: #8996ae; margin-top: 6px; }
  .ph-amount { font: 700 13.5px "JetBrains Mono", monospace; color: var(--text-1); text-align: right; white-space: nowrap; }
  .ph-amount.red { color: var(--fin-red-text); }
  .ph-right { text-align: right; flex: none; }
  .ph-right .fin-chip, .ph-right .lc-chip { margin-top: 5px; }
  .ph-section { font: 700 11px Inter, sans-serif; letter-spacing: 0.07em; text-transform: uppercase; color: var(--fin-text-3); margin: 18px 0 8px; }
  .ph-note { font: 400 11.5px/1.55 Inter, sans-serif; color: var(--text-2); margin-top: 10px; }

  /* Buttons */
  .ph-btn { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 50px; box-sizing: border-box; padding: 0 14px; border-radius: 12px; border: 0; background: var(--brand-blue); color: #fff; font: 700 14px Inter, sans-serif; text-decoration: none; cursor: pointer; }
  .ph-btn .ms { font-size: 19px; }
  .ph-btn:disabled, .ph-btn[aria-disabled="true"] { background: #c7cfe3; color: #fff; cursor: not-allowed; }
  .ph-btn.sm { min-height: 48px; font-size: 13.5px; }
  .ph-btn.outline { min-height: 44px; background: #fff; color: var(--text-1); border: 1.5px solid var(--border); font: 600 12.5px Inter, sans-serif; }
  .ph-btn.danger { min-height: 44px; background: #fff; color: var(--fin-red-text); border: 1.5px solid var(--fin-red); font: 600 12.5px Inter, sans-serif; }
  .ph-btn.green { background: var(--brand-green); }
  .ph-btn.gold { background: var(--brand-yellow); color: var(--fin-gold-ink); }
  .ph-btn.navy { background: var(--brand-navy); }
  .ph-btn.muted { background: #e6eaf4; color: var(--text-2); }
  .ph-actions { display: flex; gap: 8px; margin-top: 12px; }
  .ph-actions > * { flex: 1; }
  .ph-link { display: inline-flex; align-items: center; min-height: 44px; font: 600 12.5px Inter, sans-serif; color: var(--brand-blue); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }

  /* The pinned primary action. .ph-pinned-space reserves its height at the end of the page. */
  .ph-pinned { position: fixed; left: 0; right: 0; bottom: 62px; z-index: 890; background: #fff; border-top: 1px solid var(--border); padding: 10px 16px 12px; }
  .student-shell .ph-pinned { bottom: 64px; }
  .ph-pinned-reason { display: flex; align-items: center; justify-content: center; gap: 6px; font: 600 12px/1.4 Inter, sans-serif; color: var(--fin-red-text); margin-bottom: 8px; text-align: center; }
  .ph-pinned-reason.quiet { color: var(--text-2); font-weight: 500; }
  .ph-pinned-reason .ms { font-size: 16px; }
  .ph-pinned-space { height: 112px; }

  /* Lead card in the portal colour, tiles, one stacked bar */
  .ph-hero { border-radius: 14px; padding: 16px; color: #fff; background: var(--bo-accent-phone, var(--brand-navy)); margin-bottom: 12px; }
  .ph-hero-label { font: 600 11.5px Inter, sans-serif; color: rgba(255, 255, 255, 0.75); }
  .ph-hero-value { font: 800 28px/1.2 Inter, sans-serif; letter-spacing: -0.03em; margin-top: 4px; }
  .ph-hero-sub { font: 400 11.5px/1.45 Inter, sans-serif; color: rgba(255, 255, 255, 0.78); margin-top: 4px; }
  .ph-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
  .ph-tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ph-tile { display: block; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-decoration: none; }
  .ph-tile-label { font: 700 9.5px Inter, sans-serif; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fin-text-3); }
  .ph-tile-value { font: 800 18px/1.25 Inter, sans-serif; letter-spacing: -0.02em; color: var(--text-1); margin-top: 4px; }
  .ph-tile.amber .ph-tile-value { color: var(--fin-gold-text); }
  .ph-tile.orange .ph-tile-value { color: #9a3412; }
  .ph-tile.red { border-color: rgba(220, 38, 38, 0.45); }
  .ph-tile.red .ph-tile-value { color: var(--fin-red-text); }
  .ph-tile.green .ph-tile-value { color: var(--fin-green-text); }
  .ph-stackbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--fin-row); margin: 12px 0 10px; }
  .ph-stackbar > span { display: block; height: 100%; }
  .ph-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font: 500 11.5px Inter, sans-serif; color: var(--text-2); }
  .ph-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

  /* Field rows (statement match, shared fields, settings rows) */
  .ph-field { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 0; border-top: 1px solid var(--fin-row); font: 500 12.5px Inter, sans-serif; color: var(--text-1); }
  .ph-field:first-child { border-top: 0; }
  .ph-field .ms { font-size: 18px; color: var(--fin-text-3); flex: none; }
  .ph-field .ms.ok { color: var(--fin-green-text); }
  .ph-field .ms.bad { color: var(--fin-red-text); }
  .ph-field-k { flex: 1; min-width: 0; }
  .ph-field-v { font-weight: 600; text-align: right; }
  .ph-field-v.bad { color: var(--fin-red-text); }

  /* Room-hold countdown */
  .ph-hold { height: 4px; border-radius: 2px; background: var(--fin-row); overflow: hidden; margin-top: 10px; }
  .ph-hold > span { display: block; height: 100%; background: var(--brand-green); }
  .ph-hold.low > span { background: var(--fin-red); }
  .ph-hold-left { font: 600 11px Inter, sans-serif; color: var(--text-2); margin-top: 5px; }
  .ph-hold.low + .ph-hold-left { color: var(--fin-red-text); }

  /* Chips row that scrolls sideways instead of wrapping */
  .ph-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; }
  .ph-chips > * { flex: none; }
  .ph-search { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 12px; border: 1.5px solid var(--border); border-radius: 12px; background: #fff; margin-bottom: 10px; }
  .ph-search .ms { font-size: 19px; color: var(--fin-text-3); }
  .ph-search input { flex: 1; min-width: 0; border: 0; outline: 0; font: 400 14px Inter, sans-serif; color: var(--text-1); background: transparent; }
  .ph-input { width: 100%; min-height: 50px; box-sizing: border-box; border: 1.5px solid var(--border); border-radius: 12px; padding: 0 12px; font: 500 14px Inter, sans-serif; color: var(--text-1); background: #fff; }
  textarea.ph-input { padding: 12px; min-height: 96px; }
  .ph-switch.fin-switch { width: 50px; height: 30px; border-radius: 15px; }
  .ph-switch.fin-switch::after { width: 24px; height: 24px; }
  .ph-status-saved { font: 600 11px Inter, sans-serif; color: var(--fin-green-text); }
  .ph-status-failed { font: 600 11px Inter, sans-serif; color: var(--fin-red-text); }

  /* m12: the job editor's form and its live preview are tabs, not side by side. */
  .job-editor.ph-tab-edit > aside { display: none; }
  .job-editor.ph-tab-preview > .fin-card { display: none; }
  .job-type-chips > button, .emp-size-chips > button { min-height: 44px; }

  /* m13 / m14: talent cards and filter rows keep 44px targets. */
  .job-talent-card .fin-btn { min-height: 44px; }
  .job-rail-option { min-height: 44px; }
  .ph-dashed { border: 1.5px dashed var(--fin-dash) !important; background: var(--fin-head) !important; }
  .job-select, .job-textarea, .job-input { min-height: 50px; }

  /* m17: the visibility card's one switch is 50×30 so it is easy to hit. */
  #visibility .fin-switch { width: 50px; height: 30px; border-radius: 15px; }
  #visibility .fin-switch::after { width: 24px; height: 24px; }
  #visibility .sk-btn-outline, #visibility .sk-btn-primary { min-height: 44px; }

  /* Nothing tappable under 44px: the shared desktop controls are 26–40px tall, so on a phone
     every one of them gets the minimum. Switches are 50×30 with a 44px-tall hit area. */
  .fin-btn, .fin-btn-sm, .fin-tab, .fin-seg-btn, .fin-fchip, .fin-link.fin-btn,
  .lc-type-tab, .lc-select, .lc-bulk-btn, .lc-apply-closed, .lc-mini-btn,
  .bo-menu-btn, .bo-close-btn, .fin-icon-btn, .fin-mode-card, .job-type-chips > button { min-height: 44px; }
  .bo-menu-btn, .bo-close-btn, .fin-icon-btn { min-width: 44px; }
  .fin-seg { align-items: stretch; }
  .fin-seg-btn { height: auto; }
  .fin-tab, .fin-btn-sm { height: auto; }
  .fin-switch { width: 50px; height: 30px; border-radius: 15px; }
  .fin-switch::after { width: 24px; height: 24px; }
  .fin-switch::before { content: ""; position: absolute; left: 0; right: 0; top: -7px; bottom: -7px; }
  .fin-search { min-height: 44px; }
  button.fin-link { display: inline-flex; align-items: center; min-height: 44px; }
  /* Blazor's student pages style these in scoped CSS, which outranks a plain class. */
  .inst-toggle-chip, .inst-select-chip, .inst-select-chip select, .acd-back-link, .form-select-sm { min-height: 44px !important; }
  .acd-back-link { display: inline-flex; align-items: center; }
  .fin-fchip { height: auto; }
  .fin-fchip select, .fin-fchip button { min-height: 44px; }
  .fin-fchip button { min-width: 32px; }

  /* Existing pieces, on a phone */
  .fin-drawer { width: 100vw; }
  .fin-line-payments { padding: 6px 14px 10px !important; border-radius: 0 0 13px 13px; }
  .fin-line-payments > div { grid-template-columns: 1fr auto !important; }
  .fin-line-payments > div > :nth-child(2), .fin-line-payments > div > :nth-child(3) { display: none; }
  .fs-footer .sk-btn-primary, .fs-footer .sk-btn-outline { min-height: 50px; box-sizing: border-box; }
  .fin-head-actions { width: 100%; }
}
