@import url("personal-schedule-narrative-desktop-core.e9f7b63ba9aa.css");
@import url("../calendaring/recurrence-form.7aa323e583e3.css");
@import url("personal-event-rail.4ba254d50584.css");

/* #1055 — la navigation précédente/suivante appartient à la primitive Date de référence. */
.narrative-reference-navigation {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: stretch;
  gap: var(--space-1);
}

.narrative-reference-navigation .narrative-reference-trigger {
  min-width: 0;
}

/* #1062 — le texte central absorbe les variations de longueur sans déplacer les chevrons. */
@media (min-width: 901px) {
  .narrative-reference-step + .narrative-reference-trigger {
    width: 15rem;
    flex: 0 0 15rem;
    justify-content: center;
    text-align: center;
  }
}

.narrative-reference-step {
  width: var(--control-height-compact);
  min-height: var(--control-height-compact);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: var(--border-width-default) solid var(--color-line);
  border-radius: var(--radius-control);
  padding: 0;
  background: var(--color-surface);
  color: var(--color-ink);
  text-decoration: none;
}

.narrative-reference-step svg {
  width: 1rem;
  height: 1rem;
}

.narrative-reference-step:hover {
  border-color: var(--color-brand-strong);
  color: var(--color-brand-strong);
}

.narrative-reference-step:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .narrative-reference-navigation {
    width: 100%;
  }

  .narrative-reference-navigation .narrative-reference-trigger {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }

  .narrative-reference-step {
    width: 44px;
    min-height: 44px;
  }
}

/* #989 P1 — le pilotage Espaces / Organiser reste sur une ligne quand la place le permet,
   puis se replie sans créer de débordement à la transition desktop. */
@media (min-width: 901px) {
  .narrative-control-row--scope {
    flex-wrap: wrap;
  }

  .narrative-control-row--organize {
    flex: 0 0 auto;
    margin-left: auto;
  }
}

/* #1005 — compartiments desktop post-#986 : renforcer la hiérarchie sans déplacer les repères. */
@media (min-width: 901px) {
  .narrative-command-bar {
    width: fit-content;
    justify-self: end;
    padding: var(--space-1) var(--space-2);
    border: var(--border-width-default) solid var(--color-line);
    border-radius: var(--radius-surface);
    background: color-mix(in srgb, var(--color-canvas) 34%, var(--color-surface));
  }

  .narrative-controls--unified {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .narrative-controls--unified > .narrative-command-bar {
    grid-column: 2;
    grid-row: 1;
    width: fit-content;
    align-self: center;
    justify-self: end;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .narrative-controls--unified > .narrative-filter-group--scope {
    grid-column: 1;
    grid-row: 1;
  }

  .narrative-controls--unified > .narrative-filter-grid {
    grid-column: 1 / -1;
  }

  .narrative-controls {
    background: color-mix(in srgb, var(--color-canvas) 18%, var(--color-surface));
  }

  .narrative-control-row--period {
    border-top: var(--border-width-default) solid var(--color-line);
  }

  .narrative-control-row--organize {
    padding: 0 var(--space-2);
    border-radius: var(--radius-control);
    background: var(--color-surface);
    box-shadow: inset 0 0 0 var(--border-width-default) var(--color-line);
  }
}


/* #1079 — recette propriétaire : lisibilité locale et hiérarchie du rail. */
@media (min-width: 901px) {
  .narrative-side-tabs a,
  .narrative-panel-head p,
  .narrative-panel-head > span,
  .narrative-allday,
  .narrative-workspace-event-when span,
  .narrative-event-time span,
  .narrative-event-provenance,
  .narrative-gaps span,
  .narrative-note,
  .narrative-empty,
  .narrative-day-row span,
  .narrative-day-preview small,
  .narrative-segment-row span,
  .narrative-week-group > header,
  .narrative-detail-entry-link time,
  .narrative-detail-entry-link > span,
  .narrative-detail-entry-link small,
  .narrative-detail-back {
    font-size: var(--typography-size-meta);
  }

  .narrative-event-detail-grid dt {
    font-size: var(--typography-size-meta);
  }

  .narrative-event-detail-grid dd {
    font-size: var(--typography-size-body);
    line-height: 1.45;
  }
}

@media (min-width: 1180px) {
  .narrative-controls--unified :is(a, button, select, input) {
    font-size: var(--typography-size-meta);
  }
}

/* #1118/#1281: scroll only the workspace chips; keep the sibling
   "Ajouter un espace" action visible even with three long workspace names. */
@media (min-width: 901px) {
  .narrative-controls--unified > .narrative-filter-group--scope {
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: visible;
    padding-bottom: var(--space-1);
  }
  .narrative-controls--unified .narrative-scope {
    min-width: 0;
    flex-wrap: nowrap;
    flex: 1 1 auto;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    padding-bottom: var(--space-1);
  }
  .narrative-controls--unified .narrative-scope button {
    flex: 0 0 auto;
  }
  .narrative-controls--unified .narrative-space-add,
  .narrative-controls--unified .narrative-space-open {
    flex: 0 0 auto;
  }
}
