/* Phone rules remain the default. Desktop gets a workspace, not a scaled phone. */
@media (min-width: 1024px) {
  :root {
    --workspace-width: min(1440px, calc(100vw - 48px));
    --workspace-edge: max(24px, calc((100vw - 1440px) / 2));
    --workspace-sidebar: 196px;
    --workspace-content: calc(var(--workspace-width) - var(--workspace-sidebar));
  }
  .phone-wrap {
    width: var(--workspace-width); max-width: none; min-height: 100dvh;
    padding-left: var(--workspace-sidebar); border-inline: 1px solid var(--border);
    box-shadow: none; overflow: clip;
  }
  .phone-wrap::before {
    content: ''; position: absolute; inset: 0 auto 0 0; width: var(--workspace-sidebar);
    background: var(--surface); border-right: 1px solid var(--border); pointer-events: none;
  }
  .header-bar {
    margin: 0 0 0 calc(-1 * var(--workspace-sidebar)); padding: 20px 28px;
    min-height: 80px; background: var(--surface);
  }
  .brand-text .name { font-size: 21px; }
  .brand-text .tag { font-size: 10px; }
  .logo-mark { width: 38px; height: 38px; }
  .icons { gap: 12px; }
  .icon-circle { width: 38px; height: 38px; cursor: pointer; }
  .phone { padding: 28px 28px 100px; }
  .bottom-fixed {
    left: calc(var(--workspace-edge) + var(--workspace-sidebar)); transform: none;
    width: var(--workspace-content); max-width: none;
  }
  #bottomFixed .bottom-nav {
    position: fixed; left: calc(var(--workspace-edge) + 16px); top: 108px; bottom: auto;
    width: calc(var(--workspace-sidebar) - 32px); padding: 0; border: 0;
    display: flex; flex-direction: column; gap: 8px; background: transparent;
    backdrop-filter: none;
  }
  .nav-btn { flex: none; width: 100%; flex-direction: row; gap: 12px; padding: 15px 16px; cursor: pointer; }
  .nav-btn span { font-size: 13px; }
  .nav-btn:hover { background: var(--surface-soft); }
  .nav-btn.active { background: var(--accent-bg); color: var(--accent); }
  .composer-bar { padding: 18px 28px; background: var(--surface); }
  .add-form { padding: 8px 8px 8px 18px; }
  .add-form input[type=text] { font-size: 14px; }
  .tool-btn, .send-btn { width: 36px; height: 36px; }
  body.champ-hors-barre #bottomFixed { display: flex; }

  .screen[data-screen="today"]:not(.focus-agenda):not(.focus-rappels) {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: 'urgent urgent' 'overdue overdue' 'day day' 'agenda-title reminders-title' 'agenda reminders';
    column-gap: 24px; align-items: start;
  }
  #urgentList { grid-area: urgent; margin: 0; border-radius: 12px 12px 0 0; }
  #overdueList { grid-area: overdue; margin: 0; border-radius: 0 0 12px 12px; }
  .context-bar { grid-area: day; margin: 22px 0 26px; padding: 17px 20px; border-radius: 12px; }
  .context-bar .cdate { font-size: 18px; }
  .day-nav { width: 34px; height: 34px; }
  #agendaLabel { grid-area: agenda-title; }
  #remindersLabel { grid-area: reminders-title; }
  .screen[data-screen="today"] > .section-label { margin: 0 0 12px; font-size: 11px; padding: 0 2px; }
  .screen[data-screen="today"]:not(.focus-agenda):not(.focus-rappels) :is(#agendaCards, #remindersList) {
    max-height: max(240px, calc(100dvh - 390px)) !important;
    min-width: 0; margin: 0; border: 1px solid var(--border); border-radius: 14px;
    background: var(--surface);
  }
  #agendaCards { grid-area: agenda; }
  #remindersList { grid-area: reminders; }
  .arow, .rrow { padding: 15px 14px; }
  .atitle, .rtitle { font-size: 14px; }
  .screen.focus-agenda #agendaLabel, .screen.focus-rappels #remindersLabel { margin: 0; padding: 18px; border-radius: 12px 12px 0 0; }
  .screen.focus-agenda #agendaCards, .screen.focus-rappels #remindersList { margin: 0; max-height: calc(100dvh - 250px) !important; }
  .screen-title { margin: 0 0 24px; padding: 20px 22px; border-radius: 12px; }
  .screen-title h1 { font-family: 'Fraunces', serif; font-size: 24px; text-transform: none; letter-spacing: 0; }

  [data-screen="calendar"] .panel { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px 28px; align-items: start; }
  [data-screen="calendar"] .cal-toggle { grid-column: 1; grid-row: 1; margin: 0; }
  [data-screen="calendar"] .cal-view { grid-column: 1; grid-row: 2; }
  [data-screen="calendar"] .panel > .section-label { grid-column: 2; grid-row: 1; align-self: center; }
  #calAgenda { grid-column: 2; grid-row: 2 / span 6; width: 100%; max-height: calc(100dvh - 320px); margin: 0; }
  [data-screen="calendar"] .panel > :not(.cal-toggle):not(.cal-view):not(.section-label):not(#calAgenda) { grid-column: 1; margin-top: 0; }
  .day-strip { gap: 6px; }
  .day-pill { flex: 1; min-width: 0; }
  .month-cell { aspect-ratio: auto; min-height: 48px; }
  .hour-row { min-height: 50px; padding: 8px 12px; }

  #carnetsListe { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
  #carnetsListe > .proj-empty { grid-column: 1 / -1; }
  .proj-search-row { margin-bottom: 24px; }
  .proj-filtre { border-radius: 10px; overflow: hidden; margin: 0 0 20px; }
  .pfiltre-btn { padding: 15px 12px; font-size: 11px; }
  .creation-page { max-width: 900px; margin: auto; }
  .creation-bande { margin-inline: 0; border-radius: 12px; padding: 18px; }
  .creation-corps { padding-inline: 18px; }

  .notif-page:not(#adminPage):not(#companyPage), #archivePage {
    top: 24px; height: calc(100dvh - 48px); max-width: 760px; width: calc(100% - 96px);
    border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 24px 100px #0005;
  }
  .notif-header { padding: 20px 24px; }
  .profile-content { padding-inline: 28px; }
  .space-dropdown { top: 100%; left: 0; right: auto; width: 100%; border: 1px solid var(--border); border-radius: 0 0 14px 14px; }
  .sheet { max-width: 720px; }
  .dt-dialog { width: 440px; max-width: calc(100vw - 64px); }
}
@media (min-width: 1280px) {
  #projListe { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
  #projListe > .proj-empty { grid-column: 1 / -1; }
  #projListe > .project-card { margin: 0; min-width: 0; }
}
