/* Road — noir et blanc de Hosted, Host Grotesk, clair et sombre suivant le système (?theme=dark|light). */
:root {
  --bg: #FFFFFF; --fg: #000000; --muted: #4A4A4A; --line: #000000; --soft: #E6E6E6; --surface: #F4F4F4;
  --warn: #8A5A00; --warn-bg: #FFF4D6; --ok: #1F6B3A; --err: #B00020; --bar-h: 60px; --radius: 14px;
  font-family: "Host Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #000000; --fg: #FFFFFF; --muted: #BFC3C9; --line: #FFFFFF; --soft: #2A2A2A; --surface: #141414; --warn: #FFD27A; --warn-bg: #2B2410; --ok: #7BD89A; --err: #FF8A9A; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #000000; --fg: #FFFFFF; --muted: #BFC3C9; --line: #FFFFFF; --soft: #2A2A2A; --surface: #141414; --warn: #FFD27A; --warn-bg: #2B2410; --ok: #7BD89A; --err: #FF8A9A; color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1 { font-size: 32px; line-height: 1.1; margin: 0 0 12px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 22px; margin: 0 0 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
a { color: inherit; }

.hbar { position: sticky; top: 0; z-index: 20; height: var(--bar-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; background: var(--bg); border-bottom: 1px solid var(--line); }
.hbar-brand { display: flex; align-items: center; gap: 12px; }
.hbar-home, .hbar-tool { color: inherit; text-decoration: none; }
.hbar-home { display: block; line-height: 0; }
.hbar-logo { display: block; width: 120px; aspect-ratio: 1790 / 286; background: currentColor; -webkit-mask: url(/assets/hosted-logo.webp) center / contain no-repeat; mask: url(/assets/hosted-logo.webp) center / contain no-repeat; }
.hbar-tool { font-weight: 600; font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; padding-left: 12px; border-left: 1px solid var(--line); }
.hbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hbar-email { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }

.pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border: 1px solid var(--fg); border-radius: 999px; background: var(--fg); color: var(--bg); font-weight: 500; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.pill.ghost { background: transparent; color: var(--fg); }
.pill.big { min-height: 52px; padding: 0 28px; font-size: 16px; }
.pill.wide { width: 100%; }
.pill:disabled { opacity: 0.5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; padding: 3px 8px; border: 1px solid var(--fg); border-radius: 999px; white-space: nowrap; }
.tag.done { background: var(--fg); color: var(--bg); }
.note { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.error { color: var(--err); font-size: 14px; }

/* Progression. */
.meter { display: block; height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--fg); }

/* Formulaire généré à partir du schéma. */
.section { border-top: 1px solid var(--line); padding: 20px 0 8px; }
.section h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.section h2 .tag { font-size: 10px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.leg { grid-column: 1 / -1; border: 1px solid var(--soft); border-radius: var(--radius); padding: 14px; }
.leg h3 { margin: 0 0 10px; font-size: 16px; }
.leg .grid { gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.field .who { font-size: 12px; font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--soft); border-radius: 10px; background: var(--bg); }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--fg); outline: none; box-shadow: 0 0 0 1px var(--fg); }
.field.missing input, .field.missing select, .field.missing textarea { border-color: var(--warn); border-style: dashed; }
.field.saved input, .field.saved select, .field.saved textarea { border-color: var(--ok); }
.field .err { color: var(--err); font-size: 13px; }

/* Fiche du jour. */
.day { list-style: none; margin: 0; padding: 0; }
.day li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--soft); }
.day .time { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.day .time.none { color: var(--muted); font-weight: 400; font-size: 15px; }
.day .what { font-weight: 600; }
.day .kind-transport .what { font-weight: 500; }
.day .kind-set .what { font-size: 18px; }
.day .place a, .day .contact a { font-size: 14px; }
.day .info, .day .place, .day .contact { font-size: 14px; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.fact { border: 1px solid var(--soft); border-radius: var(--radius); padding: 14px; font-size: 14px; }
.fact h3 { margin: 0 0 6px; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; }
.fact p { margin: 0 0 4px; white-space: pre-line; }

@media (max-width: 700px) {
  .hbar { padding: 0 16px; }
  .hbar-email { display: none; }
  .hbar-logo { width: 96px; }
  .grid, .facts { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 26px; }
}

@media print {
  /* Le PDF est toujours en clair, même si l'écran est en sombre (sinon texte gris clair et marges noires). */
  :root, :root:not([data-theme="light"]), :root[data-theme="dark"] {
    --bg: #FFFFFF; --fg: #000000; --muted: #4A4A4A; --line: #000000; --soft: #E6E6E6; --surface: #F4F4F4;
    --warn: #8A5A00; --warn-bg: #FFF4D6; --ok: #1F6B3A; --err: #B00020; color-scheme: light;
  }
  .hbar, .no-print, .actions, .tabs { display: none !important; }
  body { background: #fff; color: #000; }
  .day li { break-inside: avoid; }
}

/* Menu Hosted dans l'en-tête de l'outil (décisions de François, 01/10) : le même partout, Radio · Tools · Label, et
   STUDIO en plus dès qu'on est connecté (studio.hosted.art : tous ses outils), souligné dans un outil. Tools est la
   présentation publique. Connecté = l'e-mail du compte est affiché dans la barre (.hbar-email sans « hidden »).
   Sous 900 px, un seul lien reste : Studio si connecté, Tools sinon. */
.hbar-nav { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 30px); margin-right: 6px; }
.hbar-nav a { font-weight: 500; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; color: inherit; white-space: nowrap; padding: 10px 0; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.hbar-nav a:hover, .hbar-nav a[aria-current="page"] { text-decoration-line: underline; }
.hbar-nav .hbar-studio { display: none; }
.hbar:has(.hbar-email:not([hidden])) .hbar-nav .hbar-studio { display: inline; }
@media (max-width: 900px) {
  .hbar-nav a { display: none; }
  .hbar-nav .hbar-tools-link { display: inline; }
  .hbar:has(.hbar-email:not([hidden])) .hbar-nav .hbar-tools-link { display: none; }
}

/* Téléphone (audit du 03/10) : la barre tient sur 360 px, le bouton de compte ne sort plus de l'écran.
   Le nom de l'outil peut se couper (…), le bouton jamais. */
.hbar-brand { min-width: 0; }
.hbar-tool { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-right { flex-shrink: 0; }
@media (max-width: 520px) {
  .hbar { gap: 10px; padding: 0 14px; }
  .hbar-brand { gap: 8px; }
  .hbar-logo { width: 80px; }
  .hbar-tool { font-size: 13px; letter-spacing: 0.1em; padding-left: 8px; }
  .hbar-right { gap: 10px; }
  .hbar-nav { margin-right: 0; }
  .hbar-nav a { font-size: 13px; }
  .hbar-right .pill { min-height: 36px; height: 36px; padding: 0 14px; font-size: 14px; }
}

/* ---------- Menu à gauche (essai du 03/10) : HOSTED | ROADTOUR ▾ (changer d'outil) ; à droite STUDIO + son nom ---------- */
.hbar-switch, .hbar-acct { position: relative; }
.hbar-tool { display: inline-flex; align-items: center; gap: 6px; height: 40px; border: 0; border-left: 1px solid var(--line); background: none; color: inherit; font: inherit; font-weight: 600; font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; }
.hbar-tool svg, .hbar-acct-btn svg { width: 12px; height: 12px; flex: none; }
.hbar-tool[aria-expanded="true"] svg, .hbar-acct-btn[aria-expanded="true"] svg { rotate: 180deg; }
.hbar-dd { position: absolute; top: calc(100% + 10px); left: 0; z-index: 30; display: grid; min-width: 240px; padding: 8px 0; background: var(--bg); border: 1px solid var(--fg); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14); }
.hbar-dd[hidden] { display: none; }
.hbar-dd-right { left: auto; right: 0; }
.hbar-dd a, .hbar-dd button { display: block; padding: 10px 18px; border: 0; background: none; color: inherit; font: inherit; font-size: 16px; text-align: left; text-decoration: none; cursor: pointer; }
.hbar-dd a:hover, .hbar-dd button:hover { background: rgba(127, 127, 127, 0.12); }
.hbar-dd a[aria-current="page"] { font-weight: 700; }
.hbar-dd hr { margin: 6px 0; border: 0; border-top: 1px solid rgba(127, 127, 127, 0.3); }
.hbar-dd .hbar-email { display: block; max-width: none; padding: 6px 18px 10px; font-size: 13px; }
.hbar-studio-link { color: inherit; font-weight: 700; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.hbar-login { color: inherit; font-weight: 500; font-size: 15px; text-decoration: none; white-space: nowrap; }
.hbar-studio-link:hover, .hbar-login:hover { text-decoration: underline; text-underline-offset: 6px; }
.hbar-acct-btn { gap: 8px; padding-left: 7px; }
.hbar-ini { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: 13px; font-weight: 700; }
@media (max-width: 700px) {
  .hbar-studio-link, .hbar-create, .hbar-name, .hbar-acct-btn svg { display: none; }
  .hbar-right .hbar-acct-btn { width: 40px; height: 40px; min-height: 40px; padding: 0; justify-content: center; }
  .hbar-dd { position: fixed; top: calc(var(--bar-h) + 6px); left: 12px; right: 12px; }
}

/* Trajets de l'artiste (onglet Travel et fiche du jour) */
.travel { margin: 0 0 24px; }
.travel h2 { margin: 0 0 4px; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; }
.trips { list-style: none; margin: 12px 0 20px; padding: 0; border-top: 1px solid var(--line); }
.trips > li { border-bottom: 1px solid var(--soft); padding: 14px 0; }
.trip { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 6px 16px; align-items: start; }
.trip-when { display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.trip-when span { color: var(--muted); font-size: 14px; }
.trip-what .what { font-weight: 700; overflow-wrap: anywhere; }
.trip-what .info { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.trip-ticket { margin-top: 6px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.trip-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.trip-file:focus-visible + span { outline: 2px solid var(--fg); }
label.link { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.trip-acts { display: flex; gap: 12px; }
.trip-form { display: grid; gap: 14px; padding: 6px 0; }
.trip-form .row { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) {
  .trip { grid-template-columns: minmax(0, 1fr); }
  .trip-when { grid-auto-flow: column; justify-content: start; gap: 10px; align-items: baseline; }
}
