/* Mobile content popups: Figma page 03. Existing desktop components remain shared. */
@media (max-width: 600px), (orientation: landscape) and (pointer: coarse) and (max-height: 500px) {
  #toast {
    bottom: max(53px, calc(env(safe-area-inset-bottom) + 16px));
    min-height: 52px;
    font-size: 14px;
  }
  .profile-contact-popover,
  .intro-popover,
  .reader-phone-popover { border-color: #e2e4e7; border-radius: 4px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.08); }
  .profile-contact-popover { width: calc(100vw - 32px); }
  .profile-contact-popover input { color: #29333b; }
  .profile-contact-popover input:focus { background: #fff !important; box-shadow: none; }
  .profile-contact-popover input:focus-visible { outline: 2px solid #66737c; outline-offset: -2px; }
  .profile-contact-popover form > button:hover:not(:disabled) { background: #fff34d; }
  .profile-contact-popover-close img,
  .intro-popover .intro-popover-close img { content: url('/mobile-popup-close.svg'); width: 17px; height: 17px; }
  .profile-contact-popover-close { display: flex; align-items: center; justify-content: center; padding: 0; border-right: 0; }
  .reader-phone-popover { width: calc(100vw - 32px); }
  .reader-phone-popover:focus { outline: none; }
  .reader-phone-number { color: #29333b; font-size: 14px; }
  .reader-phone-copy, .reader-phone-close { background: #fff; }
  .intro-popover--template, .intro-popover--custom, .intro-popover.intro-prerequisites { width: calc(100vw - 32px); }
  .intro-popover { margin-top: 0; }
  .intro-popover:focus { outline: none; }
  .intro-popover--template .intro-popover-editor,
  .intro-popover--custom .intro-custom-editor { color: #29333b; }
  .intro-popover--custom .intro-custom-editor,
  .intro-popover--custom .intro-custom-editor:focus { border: 0; outline: 0; box-shadow: none; background: #fff !important; }
  .workspace:not(.reader) .about-section textarea:focus,
  .workspace:not(.reader) .about-section textarea:focus-visible { background: transparent !important; outline: 0; box-shadow: none; }
  .intro-popover--custom .intro-custom-editor { min-height: 0; }
  .intro-popover--template .intro-fragment { background: transparent; }
  .intro-popover--template .intro-fragment:focus { outline: 1px solid #66737c; }
  .intro-popover--template .intro-popover-save:hover:not(:disabled),
  .intro-popover--custom .intro-popover-save:hover:not(:disabled) { background: #fff34d; }
  .workspace .pitch-label,
  .workspace .pitch-section > span.pitch-label,
  .workspace .intro-title h3 { display: flex; align-items: center; }
  @media (max-height: 700px) {
    .intro-popover--template .intro-popover-save { top: 583px; bottom: auto; }
  }

}

@media (max-width: 600px), (orientation: landscape) and (pointer: coarse) and (max-height: 500px) {
  #modal[data-kind="pitch-deck-pdf"] {
    position: fixed; right: 16px; left: 16px; top: min(305px, calc(100dvh - 421px)); bottom: auto;
    width: calc(100vw - 32px); height: 405px; max-width: none; max-height: calc(100dvh - 24px);
    min-height: 0; margin: 0; padding: 0 19px; overflow: auto; box-sizing: border-box;
    border: 1px solid #e2e4e7; border-radius: 4px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.08);
  }
  #modal[data-kind="pitch-deck-pdf"][data-state="uploaded"] { top: min(432px, calc(100dvh - 262px)); height: 246px; }
  #modal[data-kind="pitch-deck-pdf"] h2 {
    position: absolute; top: 0; left: 0; right: 0; width: auto; height: 65px; min-height: 65px;
    margin: 0; padding: 16px 45px 0 18px; border-bottom: 1px solid #e2e4e7;
    background: #fff; color: #29333b; font: 500 20px/30px Inter,sans-serif;
  }
  #modal[data-kind="pitch-deck-pdf"] .close {
    position: absolute; z-index: 3; top: 1px; right: 5px; width: 44px; height: 44px;
    padding: 13px; background: transparent;
  }
  #modal[data-kind="pitch-deck-pdf"] .close img { content: url('/mobile-popup-close.svg'); width: 17px; height: 17px; }
  #modal[data-kind="pitch-deck-pdf"] .upload-form { position: absolute; top: 90px; left: 19px; right: 19px; width: auto; height: 300px; }
  #modal[data-kind="pitch-deck-pdf"] .upload-drop { width: 100%; height: 145px; margin: 0; background: #fcfcfb; }
  #modal[data-kind="pitch-deck-pdf"] .upload-drop > img { content: url('/mobile-popup-upload.svg'); top: 13px; left: calc(50% - 10.5px); width: 21px; height: 21px; }
  #modal[data-kind="pitch-deck-pdf"] .upload-drop strong { top: 54px; font: 500 14px/21px Inter,sans-serif; }
  #modal[data-kind="pitch-deck-pdf"] .upload-constraints { top: 86px; font: 400 12px/20px Inter,sans-serif; }
  #modal[data-kind="pitch-deck-pdf"] .browse-files { top: 119px; left: calc(50% - 57px); width: 114px; height: 29px; font: 500 12px/27px Inter,sans-serif; }
  #modal[data-kind="pitch-deck-pdf"] .upload-file-status,
  #modal[data-kind="pitch-deck-pdf"] .upload-error { top: 165px; height: 26px; font: 400 12px/20px Inter,sans-serif; }
  #modal[data-kind="pitch-deck-pdf"] .upload-file-status { color: #626d76; }
  #modal[data-kind="pitch-deck-pdf"] .upload-error:not(:empty),
  #modal[data-kind="pitch-deck-pdf"] .upload-file-status.is-error { color: #b23d3d; }
  #modal[data-kind="pitch-deck-pdf"] .upload-progress { top: 190px; }
  #modal[data-kind="pitch-deck-pdf"] .upload-actions {
    position: absolute; top: 205px; left: 0; width: 100%; display: flex; flex-direction: column-reverse; gap: 13px;
  }
  #modal[data-kind="pitch-deck-pdf"] .upload-actions button { width: 100%; height: 40px; min-height: 40px; font: 400 13px/20px Inter,sans-serif; }
  #modal[data-kind="pitch-deck-pdf"] .upload-actions .primary { height: 43px; min-height: 43px; font-weight: 500; }
  #modal[data-kind="pitch-deck-pdf"] .upload-actions .primary:disabled { background: #f7f8f9; color: #29343b; }
  #modal[data-kind="pitch-deck-pdf"][data-state="uploaded"] .uploaded-file {
    position: absolute; top: 90px; left: 19px; right: 19px; width: auto; height: 67px;
    grid-template-columns: 36px minmax(0,1fr); padding: 0 13px; background: #f7f8f9;
  }
  #modal[data-kind="pitch-deck-pdf"][data-state="uploaded"] .uploaded-file > img { width: 21px; height: 21px; }
  #modal[data-kind="pitch-deck-pdf"][data-state="uploaded"] .uploaded-file strong { height: 25px; font-size: 13px; line-height: 21px; }
  #modal[data-kind="pitch-deck-pdf"][data-state="uploaded"] .uploaded-file span { font-size: 12px; }
  #modal[data-kind="pitch-deck-pdf"][data-state="uploaded"] .delete-pdf {
    position: absolute; top: 178px; left: 19px; right: 19px; width: auto; height: 44px; min-height: 44px;
    margin: 0; padding: 0 14px; gap: 15px; color: #b84343; font-size: 14px;
  }
  #modal[data-kind="pitch-deck-pdf"][data-state="uploaded"] .delete-pdf img { width: 22px; height: 22px; }
}
