/* ---------------------------------------------------------------- the Event planner (DECISIONS D35)
   The card at the side of the constellation (desktop, a phone held sideways), a sheet at the bottom on a tablet or a
   phone held upright; the plan's markers, thread and links on the map. The three colours only: white, ink, cyan. */

/* the card: the left half of the screen on a computer (« la moitié de l'écran », 2026-10-18), the constellation and
   the plan's map in the right half; its lines keep a reading length, the steps take two or three columns past 1 700 px */
.pl-card {
  position: absolute; left: 16px; top: 16px; bottom: 16px; z-index: 5; width: calc(50% - 16px);
  display: flex; flex-direction: column; pointer-events: auto;
  /* no backdrop blur here: the canvas behind changes every frame and the blur would be redone each time */
  border-radius: var(--r-lg); background: color-mix(in oklab, var(--card) 96%, transparent);
  box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-2);
}
.pl-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: clamp(22px, 2.6vw, 44px) clamp(22px, 2.6vw, 44px) 32px; scrollbar-width: thin; }
.pl-handle { display: none; }
.pl-title { font-size: var(--step-4); line-height: 1; }
.pl-lede { margin-top: 12px; color: var(--ink-soft); max-width: 60ch; }
.pl-form, .pl-head, .pl-summary, .pl-partial, .pl-ai, .pl-osm, .pl-zero, .pl-waiting, .pl-error, .pl-fallback-title, .pl-fallback { max-width: 760px; }

/* the field */
.pl-form { margin-top: 18px; }
.pl-label { display: block; font-weight: 650; font-size: var(--step--1); color: var(--ink-soft); margin-bottom: 6px; }
.pl-field { position: relative; }
.pl-field textarea {
  display: block; width: 100%; min-height: 76px; max-height: 180px; resize: vertical; padding: 13px 15px; border-radius: var(--r-md);
  background: var(--paper); color: var(--ink); border: 1px solid var(--line-strong); font: inherit; font-size: var(--step-0); line-height: 1.45;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.pl-field textarea:hover { border-color: var(--ink-muted); }
.pl-field textarea:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--cyan-soft); }
.pl-example { position: absolute; left: 16px; right: 16px; top: 14px; color: var(--ink-muted); pointer-events: none; font-size: var(--step-0); line-height: 1.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.pl-submit { min-width: 148px; }
.pl-card.is-busy .pl-submit { opacity: 0.6; cursor: progress; }
.pl-error-input { margin-top: 8px; color: var(--ink); font-weight: 600; font-size: var(--step--1); min-height: 0; }
.pl-error-input:empty { display: none; }
.pl-notice { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; color: var(--ink-muted); font-size: var(--step--2); line-height: 1.45; }
.pl-notice .icon { flex: none; width: 15px; height: 15px; margin-top: 1px; }

/* the plan */
.pl-result { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.pl-plan-title { font-size: var(--step-2); line-height: 1.15; }
.pl-plan-title:focus { outline: none; }
.pl-plan-title:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: var(--r-xs); }
.pl-where { display: flex; gap: 6px; align-items: center; margin-top: 6px; color: var(--ink-soft); font-size: var(--step--1); }
.pl-where .icon { width: 15px; height: 15px; flex: none; }
.pl-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 12px; margin-top: 16px; counter-reset: none; }
.pl-step {
  position: relative; display: grid; gap: 10px; padding: 14px; border-radius: var(--r-md); background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.3s var(--ease-out), background-color 0.3s;
}
.pl-step.is-active { box-shadow: inset 0 0 0 2px var(--cyan-deep), 0 0 0 4px var(--cyan-soft); }
.pl-step-go { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0; background: none; border: 0; text-align: left; color: var(--ink); cursor: pointer; font: inherit; border-radius: var(--r-sm); }
.pl-step-go:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.pl-num {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--paper); color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--cyan-deep); font-weight: 750; font-size: var(--step--1); font-variant-numeric: tabular-nums;
}
.pl-step.is-active .pl-num { background: var(--cyan); color: var(--on-cyan); box-shadow: none; }
.pl-when-need { display: grid; min-width: 0; }
.pl-when { color: var(--ink-muted); font-size: var(--step--2); font-weight: 650; text-transform: none; letter-spacing: 0.01em; }
.pl-need { font-weight: 700; font-size: var(--step-0); line-height: 1.25; }
.pl-biz {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 18px; gap: 12px; align-items: center; padding: 6px 12px 6px 6px; border-radius: var(--r-pill);
  color: var(--ink); text-decoration: none; background: var(--raised); transition: box-shadow 0.25s, background-color 0.25s;
}
.pl-biz:hover { box-shadow: inset 0 0 0 1.5px var(--u); }
.pl-biz:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pl-biz-face { width: 44px; height: 44px; font-size: 0.8rem; box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--u) 85%, transparent); }
.pl-biz-text { display: grid; min-width: 0; }
.pl-biz-name, .pl-biz-meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-biz-name { font-weight: 700; }
.pl-biz-meta { color: var(--ink-soft); font-size: var(--step--1); }
.pl-biz > .icon { width: 16px; height: 16px; color: var(--ink-soft); }
.pl-why { color: var(--ink-soft); font-size: var(--step--1); line-height: 1.5; }
.pl-linked { display: flex; gap: 6px; align-items: center; color: var(--ink-muted); font-size: var(--step--2); font-weight: 600; }
.pl-linked .icon { width: 14px; height: 14px; flex: none; }
.pl-swap { justify-self: start; }
.pl-summary { margin-top: 16px; color: var(--ink); line-height: 1.5; }
.pl-partial, .pl-ai { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; color: var(--ink-muted); font-size: var(--step--2); line-height: 1.45; }
.pl-partial .icon, .pl-ai .icon { flex: none; width: 15px; height: 15px; margin-top: 1px; }
.pl-osm { margin-top: 6px; color: var(--ink-muted); font-size: var(--step--2); }
.pl-zero { margin-top: 14px; color: var(--ink); font-weight: 600; line-height: 1.45; }
.pl-waiting { display: flex; gap: 10px; align-items: center; margin-top: 14px; color: var(--ink-soft); font-size: var(--step--1); }
.pl-dots { display: inline-flex; gap: 4px; }
.pl-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan-deep); animation: pl-dot 1.2s var(--ease-in-out) infinite; }
.pl-dots i:nth-child(2) { animation-delay: 0.15s; }
.pl-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pl-dot { 0%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.pl-error { display: grid; gap: 12px; margin-top: 4px; }
.pl-error p { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); font-weight: 600; line-height: 1.45; }
.pl-error .icon { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.pl-error .btn { justify-self: start; }
.pl-fallback-title { margin-top: 18px; color: var(--ink-soft); font-size: var(--step--1); font-weight: 650; }
.pl-fallback { display: grid; gap: 8px; margin-top: 10px; }
.pl-card .net-text { margin-top: 22px; }

/* the constellation while the plan is composed: it breathes, the orbs of the words shimmer, the plan's are numbered */
.net-layer.is-breathing .net-orbs { animation: pl-breathe 3.2s var(--ease-in-out) infinite; transform-origin: 60% 50%; }
@keyframes pl-breathe { 0%, 100% { scale: 1; } 50% { scale: 1.015; } }
.is-paused .net-layer.is-breathing .net-orbs, .is-reduced .net-layer.is-breathing .net-orbs { animation: none; }
.orb-n {
  position: absolute; right: -6px; top: -6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: var(--r-pill); display: grid; place-items: center;
  background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 2px var(--cyan-deep), 0 2px 6px -2px rgba(0, 0, 0, 0.25);
  font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; pointer-events: none;
}

/* the plan on the map */
.plan-layer { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.plan-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.plan-halo { fill: none; stroke: var(--paper); stroke-width: 7; stroke-linecap: round; opacity: 0.9; }
.plan-line { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; transition: stroke 0.3s; }
.plan-line.is-active { stroke: var(--cyan-deep); }
.plan-tie { fill: none; stroke: var(--ink-muted); stroke-width: 1.6; stroke-linecap: round; opacity: 0.9; transition: stroke 0.3s; }
.plan-tie.is-knows { stroke-dasharray: 0.012 0.018; }
.plan-tie.is-active { stroke: var(--cyan-deep); }
.plan-marks { position: absolute; inset: 0; }
.pl-mk {
  position: absolute; left: 0; top: 0; width: 48px; height: 48px; margin: -24px 0 0 -24px; padding: 0; border: 0; border-radius: 50%;
  background: none; cursor: pointer; pointer-events: auto; will-change: translate;
}
.pl-mk-face { width: 48px; height: 48px; font-size: 0.85rem; box-shadow: inset 0 0 0 2.5px var(--paper), 0 0 0 2px var(--ink), 0 6px 16px -6px rgba(0, 0, 0, 0.35); }
.pl-mk-n {
  position: absolute; right: -8px; top: -8px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: var(--r-pill); display: grid; place-items: center;
  background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 2px var(--cyan-deep), 0 2px 6px -2px rgba(0, 0, 0, 0.3);
  font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums;
}
.pl-mk.is-active .pl-mk-n { background: var(--cyan); color: var(--on-cyan); box-shadow: 0 2px 6px -2px rgba(0, 0, 0, 0.3); }
.pl-mk.is-active .pl-mk-face { box-shadow: inset 0 0 0 2.5px var(--paper), 0 0 0 2px var(--cyan-deep), 0 0 0 6px var(--cyan-soft); }
.pl-mk:focus-visible { outline: none; }
.pl-mk:focus-visible .pl-mk-face { box-shadow: inset 0 0 0 2.5px var(--paper), 0 0 0 3px var(--ink), 0 0 0 7px var(--cyan-soft); }
.pl-mk.is-occluded { visibility: hidden; }
.plan-layer.has-active .pl-mk:not(.is-active) .pl-mk-face { filter: grayscale(0.7) brightness(0.92); }
.pl-place { position: absolute; left: 0; top: 0; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 4px var(--cyan-soft); }
.pl-place.is-occluded { visibility: hidden; }

/* tablet, phone held upright: the card becomes a sheet at the bottom; its handle folds it to see the map */
@media (max-width: 1127px) and (min-height: 501px) {
  .pl-card { top: auto; bottom: 88px; left: 10px; right: 10px; width: auto; max-height: 58vh; transition: max-height 0.45s var(--ease-out); }
  .pl-card.is-folded { max-height: 132px; }
  .pl-handle {
    display: grid; place-items: center; flex: none; width: 100%; height: 26px; padding: 0; border: 0; background: none; cursor: pointer;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
  .pl-handle span { width: 40px; height: 5px; border-radius: var(--r-pill); background: var(--line-strong); }
  .pl-handle:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }
  .pl-body { padding: 4px 16px 18px; }
  .pl-title { font-size: var(--step-3); }
  .pl-form { margin-top: 12px; }
  .pl-field textarea { min-height: 60px; }
  .is-planned .pl-card:not(.is-folded) { max-height: 52vh; }
}
@media (max-width: 1127px) and (max-height: 500px) {
  .pl-card { top: 12px; bottom: 84px; left: 12px; right: auto; width: min(320px, 42vw); }
}
@media (prefers-reduced-motion: reduce) {
  .pl-dots i { animation: none; opacity: 0.7; }
  .pl-card { transition: none; }
}
