/* Smartphone-first refinements loaded after the main portal styles. */
@media (max-width: 760px) {
  html {
    scroll-padding-top: 150px;
  }

  body {
    overflow-x: hidden;
  }

  .portal-hero {
    min-height: 590px;
    padding: 68px 20px 72px;
  }

  .portal-hero .eyebrow {
    margin-bottom: 22px;
    font-size: 10px;
  }

  .portal-hero h1 {
    font-size: clamp(44px, 13.5vw, 58px);
    line-height: 1.02;
  }

  .portal-hero .hero-text {
    margin: 26px 0;
    font-size: 15px;
    line-height: 1.55;
  }

  .portal-hero .hero-actions {
    align-items: stretch;
    gap: 12px;
  }

  .portal-hero .hero-actions > * {
    width: 100%;
    justify-content: space-between;
    text-align: left;
  }

  .hub {
    padding: 58px 10px 70px;
  }

  .hub-heading {
    padding: 0 10px;
    margin-bottom: 30px;
  }

  .hub-heading h2,
  .panel-intro h2,
  .ai-help h2 {
    font-size: clamp(34px, 10.5vw, 45px);
    line-height: 1.02;
    letter-spacing: -0.045em;
  }

  /* Four connected browser tabs contained inside the phone viewport. */
  .workspace-tabs {
    position: static;
    top: auto;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    gap: 0;
    padding: 10px 10px 0;
    margin: 0 -10px;
    width: calc(100% + 20px);
    overflow: visible;
    overscroll-behavior-inline: auto;
    scroll-snap-type: none;
    scrollbar-width: none;
    background: rgba(221, 228, 222, 0.97);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
  }

  .workspace-tabs::-webkit-scrollbar {
    display: none;
  }

  .workspace-tabs button,
  .workspace-tabs button[aria-selected="true"] {
    flex: none;
    width: 100%;
    min-width: 0;
    min-height: 64px;
    height: 64px;
    padding: 9px 4px 10px;
    margin: 0;
    border: 0;
    border-right: 1px solid rgba(8, 17, 14, 0.11);
    border-radius: 10px 10px 0 0;
    background: transparent;
    scroll-snap-align: none;
  }

  .workspace-tabs button span {
    margin-bottom: 7px;
    font-size: 7px;
    text-align: center;
  }

  .workspace-tabs button strong {
    font-size: 0;
    line-height: 1;
    text-align: center;
    letter-spacing: 0;
  }

  .workspace-tabs button strong::after {
    display: block;
    font: 700 10px/1.1 Manrope, sans-serif;
    letter-spacing: -0.01em;
    white-space: nowrap;
  }

  .workspace-tabs button[data-tab="shoot"] strong::after { content: "Shooting"; }
  .workspace-tabs button[data-tab="upload"] strong::after { content: "Uploading"; }
  .workspace-tabs button[data-tab="inspiration"] strong::after { content: "Inspiration"; }
  .workspace-tabs button[data-tab="scripts"] strong::after { content: "Scripts"; }

  .workspace-tabs button small {
    display: none;
  }

  .workspace-tabs button[aria-selected="true"] {
    height: 70px;
    min-height: 70px;
    color: var(--ink);
    background: white;
    border-right-color: transparent;
    box-shadow: none;
    z-index: 2;
  }

  .workspace-tabs button[aria-selected="true"]::before {
    left: 13px;
    right: 13px;
    top: 0;
    bottom: auto;
    width: auto;
    height: 3px;
    border-radius: 0 0 4px 4px;
  }

  .workspace-panel {
    margin: 0;
    padding: 34px 16px 42px;
    border-radius: 0 0 12px 12px;
    border-top-color: white;
    border-color: rgba(8, 17, 14, 0.11);
  }

  .panel-intro {
    display: block;
    padding-bottom: 34px;
  }

  .panel-intro > span {
    display: block;
    margin-bottom: 14px;
  }

  .panel-intro p {
    margin-top: 18px;
    font-size: 14px;
    line-height: 1.6;
  }

  .quick-check,
  .final-check {
    display: block;
    margin-top: 30px;
    padding: 25px 18px;
    border-radius: 10px;
  }

  .quick-check h3,
  .final-check h3 {
    font-size: 23px;
  }

  .check-grid {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-top: 20px;
  }

  .check-grid label {
    min-height: 48px;
    padding: 11px 12px;
    border-radius: 7px;
    line-height: 1.35;
  }

  .guide-section {
    padding: 40px 0;
  }

  .guide-title {
    gap: 12px;
    margin-bottom: 24px;
  }

  .guide-title h3,
  .folder-builder h3,
  .upload-method h3 {
    font-size: 29px;
    line-height: 1.06;
  }

  .choice-grid,
  .rule-grid,
  .role-grid,
  .split-guide,
  .step-cards,
  .video-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .choice,
  .rule-grid article,
  .role-grid article,
  .step-cards li {
    padding: 20px;
    border-radius: 8px;
  }

  .choice h4,
  .role-grid h4,
  .rule-grid h4 {
    margin-top: 12px;
    font-size: 18px;
  }

  .spec-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .phone-frame {
    width: 190px;
    height: 335px;
    margin: 0 auto;
    border-width: 7px;
    border-radius: 30px;
  }

  .phone-frame span {
    font-size: 58px;
  }

  .phone-frame small {
    margin-top: 30px;
  }

  .spec-list {
    grid-template-columns: 1fr;
  }

  .spec-list div {
    padding: 16px 4px;
  }

  .shot-list,
  .example-row {
    grid-template-columns: 1fr;
  }

  .shot-list li {
    min-height: 54px;
    padding: 16px;
  }

  .inline-cta {
    width: 100%;
    justify-content: space-between;
    gap: 15px;
    border-radius: 7px;
  }

  .folder-builder {
    grid-template-columns: 1fr;
    margin-top: 30px;
    border-radius: 10px;
    overflow: hidden;
  }

  .folder-copy {
    padding: 27px 20px;
  }

  .folder-tree {
    padding: 20px 12px;
  }

  .folder {
    grid-template-columns: 16px minmax(0, 1fr);
    padding: 13px 11px;
    overflow-wrap: anywhere;
  }

  .folder small {
    display: none;
  }

  .level-1 {
    margin-left: 10px;
  }

  .level-2 {
    margin-left: 20px;
  }

  .code-example {
    align-items: center;
    gap: 10px;
    padding: 17px 14px;
    overflow-wrap: anywhere;
  }

  .code-example code {
    min-width: 0;
    font-size: 11px;
  }

  .example-row > div {
    padding: 18px;
    overflow-x: auto;
  }

  .method-head {
    align-items: flex-start;
    gap: 12px;
  }

  .method-head > span {
    white-space: nowrap;
    font-size: 7px;
  }

  .step-cards li {
    display: flex;
    gap: 17px;
    align-items: flex-start;
  }

  .backup-method summary {
    gap: 18px;
  }

  .backup-method summary strong {
    display: block;
    margin-top: 5px;
    font-size: 15px;
    line-height: 1.3;
  }

  .category-panel summary {
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    min-height: 68px;
    padding: 18px 2px;
  }

  .category-name {
    font-size: 23px;
    line-height: 1.1;
  }

  .category-content {
    padding: 4px 0 22px;
  }

  .compact-card .cover {
    aspect-ratio: 1.65;
  }

  .compact-card .card-body > p {
    min-height: 0;
  }

  .ai-help {
    grid-template-columns: 1fr;
    gap: 30px;
    margin: 0 10px 24px;
    padding: 42px 18px 18px;
    border-radius: 12px;
  }

  .ai-copy > p:not(.eyebrow) {
    font-size: 14px;
  }

  .suggestion-chips {
    display: none;
  }

  .ai-chat {
    min-height: 410px;
    border-radius: 9px;
    overflow: hidden;
  }

  .chat-log {
    padding: 16px;
    max-height: 300px;
  }

  .chat-message {
    max-width: 92%;
  }

  .ai-chat form {
    padding: 12px;
  }

  .ai-chat form > div {
    grid-template-columns: minmax(0, 1fr) 66px;
  }

  .ai-chat textarea {
    min-width: 0;
  }

  .portal-cta {
    padding: 52px 22px;
  }

  .preview-modal,
  .video-modal {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
  }
}

@media (max-width: 390px) {
  .workspace-tabs button,
  .workspace-tabs button[aria-selected="true"] {
    width: 100%;
    min-width: 0;
  }

  .workspace-tabs button strong::after {
    font-size: 9px;
  }

  .workspace-panel {
    padding-right: 13px;
    padding-left: 13px;
  }

  .portal-hero h1 {
    font-size: 43px;
  }
}
