/* dpa-layout.css - DPA adapter for the 3.3 template layout (capture strip buttons, manager header, sport indicator).
 * Hand-written part first; the generated block at the end is the app-agnostic .tl-* editor/guard rules copied from shared/layout/layout.css
 * by `node shared/layout/sync.mjs` (do not edit between the markers). DPA tokens (--surface, --accent, --border-mid ...) are defined in dpa.css. */

/* ── Capture strip: direct and grouped buttons (plain buttons are unchanged) ── */
/* [3.3.1 R2] Rows size to their content (never clip a label), a label's qualifier sits beside the name when the button is wide enough and wraps under it when not,
 * and the list scrolls as a last resort (dpa-capture.js fitCaptureBand grows the band first). */
#dpa-strip-event-list { grid-template-rows: repeat(4, minmax(min-content, 1fr)); grid-auto-rows: minmax(min-content, 1fr); }
#dpa-strip-events { overflow-y: auto; }
#dpa-band-video { flex-shrink: 1; }   /* the video band gives back exactly the height the capture band grows by (fitCaptureBand); no change when the band does not grow */
.dpa-strip-direct-btn,
.dpa-strip-group-btn { flex-flow: row wrap; align-items: center; align-content: center; justify-content: flex-start; column-gap: 6px; row-gap: 0; padding-top: 2px; padding-bottom: 2px; min-height: 1.6rem; text-align: left; position: relative; }
.dpa-strip-group-btn { padding-right: 22px; }
.dpa-strip-main { font-weight: 700; line-height: 1.2; }
.dpa-strip-direct-btn .dpa-strip-main, .dpa-strip-group-btn .dpa-strip-main { white-space: normal; min-width: 0; }   /* [3.3.1 R2] a long name (for example 'Two points from placed ball') wraps instead of being cut; the row grows to fit */
.dpa-strip-sub { font-size: 0.72em; font-weight: 600; opacity: 0.85; line-height: 1.2; }
.dpa-strip-group-btn::after { content: "\203A"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 1.4em; line-height: 1; font-weight: 700; }

/* ── Manage Template header: sport indicator, layout status and Save beside Close; stays in view while the manager scrolls ── */
.dpa-template-header { position: sticky; top: 0; z-index: 30; flex-wrap: wrap; gap: 8px 12px; border-radius: 12px 12px 0 0; }
.dpa-header-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 10px; margin-left: auto; }
.dpa-sport-badge {
  display: inline-block; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--border-mid); background: var(--bg); color: var(--text);
  font-family: var(--mono); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap;
  user-select: none; cursor: default;                 /* read-only: not a control */
}
.dpa-header-controls .dpa-toolbar-btn { min-height: 40px; }
#dpa-template-overlay .tl-host { margin-bottom: 16px; }
#dpa-template-overlay .tl-btn { background: var(--surface-2); color: var(--text); font-family: var(--sans); }
#dpa-template-overlay .tl-section { background: var(--surface); }
#dpa-template-overlay .tl-opt input[type="radio"] { margin-top: 4px; }
#dpa-template-overlay { scroll-padding-top: 70px; }

/* >>> shared/layout/layout.css (generated copy; edit the source and run sync) >>> */
.tl-host { margin-bottom: 16px; }
.tl-section { border: 1px solid var(--border-mid); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.tl-heading { margin: 0 0 6px; font-size: 0.95rem; }
.tl-help { margin: 4px 0 10px; font-size: 0.82rem; line-height: 1.4; color: var(--subtext); }
.tl-preset-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.tl-preset-note { font-size: 0.8rem; color: var(--subtext); flex: 1 1 220px; }
.tl-family { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px 10px; margin: 0 0 10px; min-width: 0; }
.tl-legend { font-weight: 700; font-size: 0.9rem; padding: 0 6px; }
.tl-opt { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 6px 4px; cursor: pointer; }
.tl-opt input { margin-top: 4px; width: 22px; height: 22px; flex: 0 0 auto; }
.tl-opt-text { display: flex; flex-direction: column; min-width: 0; }
.tl-opt-title { font-weight: 700; font-size: 0.88rem; }
.tl-opt-desc { font-size: 0.78rem; color: var(--subtext); line-height: 1.35; }
.tl-fam-note { font-size: 0.78rem; color: var(--subtext); margin: 2px 4px; }
.tl-btn { min-height: 44px; min-width: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border-mid); background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 0.85rem; cursor: pointer; }
.tl-btn:disabled { opacity: 0.45; cursor: default; }
.tl-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tl-team-btn.tl-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tl-preview { margin-top: 6px; }
.tl-preview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tl-preview-title { margin: 0; font-size: 0.88rem; }
.tl-team-toggle { display: flex; gap: 6px; }
.tl-cat { margin-top: 10px; font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.tl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.tl-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.tl-chip { display: inline-flex; flex-direction: column; border: 1px solid var(--border-mid); border-radius: 10px; padding: 6px 10px; background: var(--surface-2); position: relative; }
.tl-chip-main { font-weight: 700; font-size: 0.85rem; }
.tl-chip-sub { font-size: 0.72rem; color: var(--subtext); }
.tl-chip-group { padding-right: 26px; }
.tl-chip-chev { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-size: 1.2rem; font-weight: 700; }
.tl-row-acts { display: flex; gap: 6px; }
.tl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.tl-save { border-color: var(--accent); }
.tl-status { font-size: 0.8rem; color: var(--subtext); flex: 1 1 200px; }
.tl-hdr-status { font-size: .8rem; font-weight: 700; color: var(--subtext, #9aa4b2); min-height: 1em; }
.tl-hdr-status[data-state="dirty"] { color: #ffd98a; }
.tl-hdr-status[data-state="failed"] { color: #ff9b9b; }
.tl-hdr-status[data-state="saved"] { color: #9be7b9; }
.tl-hdr-save { min-height: 44px; padding: 7px 16px; border-radius: 8px; border: 1px solid var(--border-mid, #3a4558); background: transparent; color: var(--subtext, #9aa4b2); font: inherit; font-weight: 700; opacity: .65; }
.tl-hdr-save:not(:disabled), .tl-btn.tl-save-on { opacity: 1; background: var(--accent, #63b3ed); border-color: var(--accent, #63b3ed); color: #0b1220; box-shadow: 0 0 0 2px rgba(99,179,237,.35); }
.tl-status-error { color: #ff9b9b; font-weight: 700; }
.tl-guard { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.6); }
.tl-guard[hidden] { display: none; }
.tl-guard-card { max-width: 30rem; width: 100%; padding: 18px; border-radius: 12px; background: var(--surface, #1b2230); border: 1px solid var(--accent, #63b3ed); color: var(--text, #e6ebf2); }
.tl-guard-title { margin: 0 0 8px; font-size: 1.05rem; }
.tl-guard-text { margin: 0 0 14px; font-size: .9rem; line-height: 1.4; }
.tl-guard-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tl-guard-actions .tl-btn { min-height: 48px; flex: 1 1 8rem; }
/* <<< shared/layout/layout.css <<< */
