/* Artist Space layout: retain existing type, icons and control dimensions. */
.artist-mobile-stage-nav,.artist-mobile-project-links{display:none}
.artist-mobile-menu-toggle,.artist-mobile-menu-label{display:none}
@media(max-width:800px){
  .artist-space-page .artist-space-header{height:74px;min-height:74px;flex-wrap:nowrap;gap:12px;padding-block:0}
  .artist-space-header .artist-space-home-link{min-width:0;flex-wrap:wrap}
  .artist-space-page .artist-space-header .artist-space-nav{display:none;position:fixed;inset:74px 0 0;height:calc(100dvh - 74px);padding:24px calc(clamp(12px,1.5vw,24px) + 28px);min-width:0;flex-direction:column;flex-wrap:nowrap;align-items:stretch;justify-content:flex-start;gap:8px;overflow-y:auto;overscroll-behavior:contain;background:var(--paper);border-top:1px solid var(--line)}
  .artist-space-page .artist-space-header .artist-space-nav.is-open{display:flex}
  .artist-space-page .artist-space-nav[hidden]{display:none!important}
  .artist-space-page.artist-menu-open{overflow:hidden!important}
  .artist-mobile-menu-toggle:not([hidden]){display:block;flex:none;padding:8px 11px;border:1px solid var(--line);background:transparent;color:var(--ink);font:11px var(--mono);cursor:pointer}
  .artist-mobile-menu-label{display:inline}
  .artist-space-page .artist-space-nav>a:not(.artist-space-account-button){display:flex;align-items:center;justify-content:flex-start;gap:14px;width:auto;height:auto;min-height:44px;padding:12px 10px;border-radius:12px;border:0}
  .artist-space-nav>a{flex-shrink:0}
  .artist-space-nav .artist-space-account-button{align-self:flex-start;margin:0 0 16px}
  .artist-space-page .artist-space-main,.artist-space-page .artist-portal-shell,.artist-space-page [data-auth-view]{min-width:0}
  .artist-space-page .artist-space-footer{grid-template-columns:minmax(0,1fr)}
  .artist-space-return{overflow-wrap:anywhere}

  /* Home: the feed follows the quick actions in normal page flow. */
  body.artist-space-page:has(.artist-portal-shell:not([hidden])>.artist-home-view:not([hidden])){height:auto;overflow:visible}
  .artist-space-page .artist-space-main:has(.artist-home-view:not([hidden])),
  .artist-space-page .artist-portal-shell:not([hidden]):has(>.artist-home-view:not([hidden])),
  .artist-space-page .artist-home-view:not([hidden]){display:block;flex:none}
  .artist-space-page .artist-home-dashboard-grid{grid-template-columns:minmax(0,1fr)}
  .artist-home-identity{flex-wrap:wrap}
  .artist-home-actions{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto}
  .artist-home-actions .artist-home-upload{flex-wrap:wrap}
  .artist-home-upload-copy{flex:1 1 140px;min-width:0}
  .artist-home-feed-header .artist-files-toggle{max-width:100%;flex-wrap:wrap}
  .artist-space-page .artist-home-feed-card{min-height:0;max-height:none;overflow:visible}
  .artist-space-page [data-home-feed]{flex:none;overflow:visible}

  /* Authentication, account and messages: wrap existing fields and actions. */
  .artist-auth-shell,.artist-auth-card,.artist-auth-form label{min-width:0}
  .artist-auth-intro h1{overflow-wrap:anywhere}
  .artist-account-identity{flex-wrap:wrap}
  .artist-account-identity>div:not(.artist-account-avatar){flex:1 1 150px}
  .artist-account-profile-heading,.artist-account-session-actions{flex-wrap:wrap}
  .artist-sidebar-header{flex-wrap:wrap}
  .artist-sidebar .artist-account-profile-details>div{grid-template-columns:minmax(0,1fr);gap:6px}
  .artist-sidebar .artist-billing-heading{flex-wrap:wrap;justify-content:flex-start}
  .artist-sidebar .artist-account-connections .button{max-width:100%;white-space:normal}
  .artist-space-page .artist-messages-composer{grid-template-columns:minmax(0,1fr)}
  .artist-space-page .artist-messages-composer .button{justify-self:end}
  .artist-space-page .artist-message-bubble{min-width:0}

  /* Document list: keep the timestamp visible beneath the document title. */
  .artist-space-page .artist-documents-title-search{flex-wrap:wrap}
  .artist-space-page .artist-documents-title-actions{flex-wrap:wrap;margin-left:0}
  .artist-space-page .artist-document-folder-section-header,.artist-space-page .artist-document-folder-heading{flex-wrap:wrap}
  .artist-space-page .artist-document-row{display:grid;grid-template-columns:auto minmax(0,1fr);min-width:0}
  .artist-space-page .artist-document-row>div{min-width:0}
  .artist-space-page .artist-document-row>time{display:block;grid-column:2}

  /* Call detail: actions follow the date; notes and tasks retain their controls. */
  .artist-space-page .artist-call-detail-heading{flex-wrap:wrap}
  .artist-call-detail-heading>div{min-width:0}
  .artist-space-page .artist-call-detail-meta,.artist-space-page [data-call-detail-actions]{flex-wrap:wrap}
  .artist-space-page .artist-call-prep-form{grid-template-columns:minmax(0,1fr)}
  .artist-space-page .artist-call-notes-toolbar{flex-wrap:wrap}

  /* Schedule list: avoid trapping long lists inside a short phone viewport. */
  .artist-space-page:has(.artist-schedule-view:not([hidden])):not(:has(.artist-schedule-month-calendar)){height:auto;overflow:visible}
  .artist-space-page .artist-schedule-view [data-schedule-events]:not(:has(>.artist-schedule-month-calendar)){flex:none;overflow:visible}
  .artist-space-page .schedule-toolbar,.artist-space-page .schedule-filters{flex-wrap:wrap;min-width:0}
  .artist-space-page .schedule-toolbar .artist-files-toggle{max-width:100%;flex-wrap:wrap}
  .artist-space-page .artist-schedule-title-row{flex-wrap:nowrap;align-items:flex-start;flex-direction:column}
  .artist-space-page .artist-schedule-title-copy{min-width:0}
  .artist-space-page .artist-schedule-title-actions{flex:none;width:100%;align-items:flex-start;flex-direction:column}
  .artist-space-page [data-schedule-controls]{width:100%;min-width:0}
  .artist-space-page:has(.artist-schedule-view:not([hidden])):not(:has(.artist-schedule-month-calendar)) .artist-space-main,
  .artist-space-page:has(.artist-schedule-view:not([hidden])):not(:has(.artist-schedule-month-calendar)) .artist-portal-shell,
  .artist-space-page:has(.artist-schedule-view:not([hidden])):not(:has(.artist-schedule-month-calendar)) .artist-schedule-view,
  .artist-space-page:has(.artist-schedule-view:not([hidden])):not(:has(.artist-schedule-month-calendar)) [data-artist-schedule]{display:block;flex:none}

  /* Booking keeps calendar navigation above the selected day's times. */
  .artist-booking-dialog .artist-calendar-toolbar,.artist-booking-dialog .artist-booking-week-heading{flex-wrap:wrap}
  .artist-booking-dialog .artist-booking-day-nav{min-width:0;max-width:100%}

  /* The document paper scrolls inside the available screen, below its controls. */
  body.artist-space-page:has([data-document-root].is-document-open:not([hidden])){height:100dvh;overflow:hidden}
  .artist-space-page .artist-space-main:has([data-document-root].is-document-open:not([hidden])),
  .artist-space-page .artist-portal-shell:has(>[data-document-root].is-document-open:not([hidden])){display:flex;flex-direction:column;flex:1;min-height:0}
  .artist-space-page [data-document-root].is-document-open:not([hidden]){flex:1;min-height:0}
  .artist-space-page [data-document-root].is-document-open>.artist-document-editor{min-height:0;overflow:auto}
  .artist-space-page [data-document-root]>.artist-document-toolbar{position:static}

  /* One stage workspace, with task and note regions that scroll independently. */
  .artist-space-page .artist-mobile-stage-nav{display:flex;align-items:center;gap:12px;margin:16px 0}
  .artist-mobile-stage-nav select{flex:1;min-width:0;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink);font:inherit}
  .artist-space-page .artist-song-project-heading{flex-direction:row;align-items:flex-start}
  .artist-space-page .artist-song-sections{flex-wrap:wrap}
  .artist-space-page [data-song-stages]{display:block;overflow:hidden}
  .artist-space-page [data-song-stages]>.artist-song-stage-column[data-mobile-stage-active=false]{display:none}
  .artist-space-page [data-song-stages]>.artist-song-stage-column[data-mobile-stage-active=true]{display:grid;height:calc(100dvh - 150px);min-height:560px;grid-template-rows:auto minmax(100px,.65fr) minmax(180px,1.35fr)}
  .artist-space-page .artist-song-column-todos{display:flex;flex-direction:column;min-height:0;overflow:hidden}
  .artist-space-page .artist-song-column-todos>.artist-call-todo-list{flex:1;min-height:0;max-height:none;overflow:auto;align-content:start}
  .artist-space-page .artist-song-column-notes{height:auto;min-height:0;max-height:none;display:flex;flex-direction:column;overflow:hidden}
  .artist-space-page .artist-song-column-notes-editor{flex:1;min-height:0;overflow:auto}
  .artist-space-page .artist-song-stage-workspace{height:calc(100dvh - 150px);min-height:560px;max-height:none}
  .artist-space-page .artist-song-stage-workspace>.artist-call-prep-form{height:100%;grid-template-rows:minmax(100px,.65fr) minmax(180px,1.35fr) auto}
  .artist-space-page .artist-song-stage-workspace .artist-call-todos,.artist-space-page .artist-song-stage-workspace .artist-call-notes{display:flex;flex-direction:column;min-height:0;overflow:hidden}
  .artist-space-page .artist-song-stage-workspace .artist-call-todo-list{max-height:none;flex:1;min-height:0;overflow:auto}
  .artist-space-page .artist-song-stage-workspace .artist-call-notes-editor{height:auto;flex:1;min-height:0;overflow:auto}

  /* The dedicated stage route fills the available phone working area. */
  .artist-space-page .artist-mobile-project-links{display:flex;flex-wrap:wrap;gap:16px;margin:12px 0;flex:none}
  body.artist-space-page:has(.artist-song-stage-view:not([hidden])){height:100dvh;overflow:hidden}
  .artist-space-page:has(.artist-song-stage-view:not([hidden])) .artist-space-main,
  .artist-space-page:has(.artist-song-stage-view:not([hidden])) .artist-portal-shell,
  .artist-space-page:has(.artist-song-stage-view:not([hidden])) [data-project-system],
  .artist-space-page:has(.artist-song-stage-view:not([hidden])) .artist-song-stage-view{display:flex;flex-direction:column;flex:1;min-height:0}
  .artist-space-page .artist-song-stage-view>.artist-song-stage-heading,.artist-space-page .artist-song-stage-view>.artist-mobile-stage-nav{flex:none}
  .artist-space-page .artist-song-stage-workspace{flex:1;height:auto;min-height:0;margin-top:0}
  .artist-space-page .artist-song-stage-workspace>.artist-call-prep-form{min-height:0;grid-template-rows:minmax(60px,.5fr) minmax(100px,1fr) auto}
  .artist-space-page .artist-song-stage-workspace .artist-call-todo-list{align-content:start}
  body.artist-space-page .artist-space-main:has(>.artist-portal-shell>[data-project-system]:not([hidden]) .artist-song-stage-view:not([hidden])),
  body.artist-space-page .artist-portal-shell:has(>[data-project-system]:not([hidden]) .artist-song-stage-view:not([hidden])){display:flex;flex-direction:column;flex:1;min-height:0}

  /* A seven-column date picker followed by full selected-day event cards. */
  body.artist-space-page:has(.artist-schedule-view:not([hidden])){height:auto;overflow:visible}
  .artist-space-page:has(.artist-schedule-view:not([hidden])) .artist-space-main,
  .artist-space-page:has(.artist-schedule-view:not([hidden])) .artist-portal-shell,
  .artist-space-page .artist-schedule-view:not([hidden]),
  .artist-space-page .artist-schedule-view>[data-artist-schedule],
  .artist-space-page .artist-schedule-view [data-schedule-events]:has(>.artist-schedule-month-calendar){display:block;flex:none;overflow:visible}
  .artist-space-page .artist-schedule-month-calendar{display:block}
  .artist-space-page .artist-schedule-month-calendar>.artist-month-grid{flex:none;grid-template-columns:repeat(7,minmax(0,1fr));grid-template-rows:auto!important;grid-auto-rows:minmax(46px,auto);overflow:visible}
  .artist-space-page .artist-schedule-month-calendar .artist-availability-date{min-height:46px;padding:4px 2px;align-items:center;justify-content:center;overflow:visible}
  .artist-space-page .artist-schedule-month-calendar .artist-calendar-event-list,.artist-space-page .artist-calendar-desktop-hint{display:none}
  .artist-space-page .artist-calendar-mobile-hint{display:inline}
  .artist-space-page .artist-schedule-day-details{display:grid;gap:14px;margin-top:24px}
  .artist-schedule-day-details>h3{margin:0}
  .artist-schedule-day-details>.schedule-empty{margin:0;color:var(--muted)}
}
@media(max-width:560px){.artist-space-page .artist-space-header .artist-space-nav{padding-inline:16px}}

@media(max-width:800px){
  .artist-space-page .artist-song-files>.artist-files-list-heading>h2{display:none}
  .artist-space-page .artist-song-files>.artist-files-list-heading{gap:0;flex-direction:row;margin:0}
  .artist-space-page .artist-song-files>[data-song-files-status]:empty{display:none}
}
