/* Hanami on a phone: the same screens as the Mac, re-laid out for a narrow touch screen.
   Loaded only by phone.html / pair.html (the Mac window never sees this file). */

/* ---------------------------------------------------------------- always on the phone */
html.phone, html.phone body { height: 100%; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
html.phone body { font-size: 15px; -webkit-tap-highlight-color: rgba(194,100,143,.15); }
html.phone .keys, html.phone .dropzone { display: none !important; }      /* no keyboard, no drag & drop */
html.phone .add-phone { width: 100%; justify-content: center; margin: -4px 0 18px; border-style: dashed; }
html.phone .sound-drop .sd-head { flex-wrap: wrap; }
html.phone .sound-drop .sd-head .btn { flex: 1 1 100%; justify-content: center; min-height: 40px; font-size: 14px; }
html.phone .sound-drop .sd-where { margin: 12px 0 -4px; }
html.phone .set-grid { grid-template-columns: 1fr; }
html.phone .btn .k { display: none; }                                     /* keyboard hints */
html.phone .app { grid-template-rows: auto 1fr; height: 100vh; height: 100dvh; }
html.phone .topbar { -webkit-app-region: none; padding: calc(8px + env(safe-area-inset-top)) 16px 8px; min-height: 52px; gap: 10px; }
html.phone .toasts { bottom: calc(18px + env(safe-area-inset-bottom)); width: calc(100% - 32px); }
html.phone .toast { text-align: center; }
html.phone .btn, html.phone .seg button, html.phone .chip { min-height: 38px; }
html.phone .tl2 .sg .h { width: 18px; touch-action: none; }               /* edges big enough for a finger */
html.phone .tl2 .sg { touch-action: none; }

/* pairing page */
.pairing { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.pairing .card { padding: 30px 26px; max-width: 420px; text-align: center; }
.pairing h1 { font-family: var(--serif); font-weight: 500; font-size: 34px; margin: 14px 0 6px; }
.pairing p { line-height: 1.6; }

/* ---------------------------------------------------------------- phone-sized screens */
@media (max-width: 820px) {
  .wordmark { font-size: 18px; }
  .nav { margin-left: 2px; }
  .nav a { padding: 6px 12px; }
  .status-chip { padding: 4px 9px; }
  .status-chip.job { max-width: 46vw; }
  .canopy.big { width: 92vw; height: 190px; opacity: .55; }
  .canopy.small { width: 70vw; height: 120px; opacity: .45; }

  .scroll { padding: 4px 16px calc(40px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
  .title { font-size: 36px; margin: 16px 0 6px; }
  .title.sm { font-size: 26px; }
  .lede { font-size: 14px; margin-bottom: 18px; }

  /* inbox */
  .batch-card, .dl-card { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; }
  .batch-card .info, .dl-card .info { flex: none; }
  .batch-card .name { font-size: 23px; white-space: normal; }
  .thumbs { overflow-x: auto; padding-bottom: 2px; }
  .thumbs::-webkit-scrollbar { display: none; }
  .batch-card .go, .dl-card .btn.ink { align-self: stretch; justify-content: center; }
  .dl-card > div:last-child { display: flex; flex-wrap: wrap; gap: 8px; }
  .decided-row { flex-wrap: wrap; gap: 6px 12px; }
  .decided-row .n { min-width: 0; flex: 1 1 100%; }
  .empty { flex-direction: column; align-items: flex-start; padding: 22px; }

  /* review: video first, the clips as a strip under it, then the buttons + notes */
  .review { display: flex; flex-direction: column; gap: 12px; padding: 4px 12px calc(28px + env(safe-area-inset-bottom)); overflow-y: auto; height: 100%; }
  .review .stage { order: 1; flex: none; }
  .review .rail { order: 2; flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 4px 2px 6px; gap: 8px; flex: none; }
  .review .rail .r { flex: 0 0 52px; }
  .review .side { order: 3; overflow: visible; padding-bottom: 0; }
  .stage-head { flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
  .stage-head .crumb { font-size: 19px; flex: 1 1 100%; }
  .stage-head .btn { padding: 6px 11px; min-height: 36px; }
  .stage-head .seg button { padding: 6px 10px; min-height: 30px; }
  .stage-head .prog { flex: 1 1 100%; max-width: none; margin-left: 0; }
  .stage-head .prog .small { text-align: left !important; }
  .players { flex: none; height: min(64vh, 150vw); gap: 8px; }
  .players .player { height: 100%; max-width: calc(50% - 4px); }
  .players .player:only-child { max-width: 100%; }
  .tl { width: 100%; }
  .tl .track { height: 30px; }
  .tl .track .base, .tl .track .fill { top: 13px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; height: auto; overflow: visible; }
  .side .card { padding: 16px; }
  .acts .btn { justify-content: center; }
  .note .x { opacity: 1; }

  /* the One-Take editor: video, timeline, Claude, then the text / sound / part cards */
  .editor { display: flex; flex-direction: column; gap: 12px; padding: 4px 12px calc(28px + env(safe-area-inset-bottom)); overflow-y: auto; height: 100%; }
  .ed-stage { display: contents; }
  .ed-head { order: 0; gap: 8px; }
  .ed-head .crumb { flex: 1 1 60%; font-size: 18px; max-width: none; }
  .ed-head > div[style*="flex: 1"] { display: none; }
  .lens { order: 5; flex: 1 1 100%; flex-wrap: wrap; gap: 4px 10px; }
  .lens b { font-size: 16px; }
  .ed-head .seg { order: 6; }
  .ed-head .btn.ink { order: 2; }
  .ed-stage .player { order: 1; height: min(60vh, 140vw); align-self: center; flex: none; }
  .timeline { order: 2; padding: 12px; }
  .timeline .legend { display: none; }
  .editor > *, .review > * { flex-shrink: 0; }   /* scroll the page; never squash a card */
  .chat { order: 3; min-height: auto; max-height: none; height: auto; overflow: hidden; }
  .chat .msgs { flex: none; min-height: 110px; max-height: 42vh; }
  .chat-foot textarea { font-size: 16px; } /* 16px stops iPhones zooming in when you type */
  .ed-info .label { white-space: nowrap; }
  .ed-info .card > div:first-child { flex-wrap: wrap; row-gap: 4px; }
  .ed-info { order: 4; overflow: visible; min-width: 0; flex: none; }
  .insp-row .lbl { width: 100%; }
  .input, textarea.input { font-size: 16px; }
  .insp-row .seg { flex-wrap: wrap; }

  /* modals become sheets */
  .overlay { align-items: flex-end; }
  .modal, .modal.wide { width: 100vw; max-height: 90vh; max-height: 90dvh; border-radius: 22px 22px 0 0; padding: 20px 16px calc(14px + env(safe-area-inset-bottom)); }
  .modal h2 { font-size: 23px; }
  .modal .two { grid-template-columns: 1fr; gap: 6px; }
  .modal .actions { bottom: calc(-14px - env(safe-area-inset-bottom)); padding-bottom: 8px; }
  .modal .actions .btn { flex: 1; justify-content: center; }
  .modal .seg { flex-wrap: wrap; }
  .pick-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
  .keylist { font-size: 13px; }
}

/* ---------------------------------------------------------------- 1.11.0 */
html.phone .set-grid { grid-template-columns: minmax(0, 1fr); }
html.phone .set-grid .card { min-width: 0; padding: 18px 16px; }
html.phone .pathrow { min-width: 0; }
html.phone .pathrow code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
/* messages at the top on the phone, so they never cover a sheet's buttons */
html.phone .toasts { top: calc(58px + env(safe-area-inset-top)); bottom: auto; }
