/* Espace organisateur : la DA de l'app (écran de connexion, listes, réglages). Jetons de couleur de .hbrp. */
.hbrp.tgp-org { max-width: 640px; padding: 40px 20px 120px; }
.tgp-org ::selection { background: rgba(200, 243, 29, .35); color: inherit; }
.tgp-org a { color: var(--accent); text-underline-offset: .2em; }
.tgp-org :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tgp-org h1 { margin: 0; font-weight: 400; font-size: clamp(34px, 6vw, 48px); line-height: 1.08; letter-spacing: -.03em; text-wrap: balance; }
.tgp-org h1 em, .tgp-org .tgp-h em { font-family: 'Crimson Pro', Georgia, serif; font-style: italic; font-weight: 400; font-size: 1.19em; line-height: 1; letter-spacing: -.01em; color: var(--accent); }
.tgp-org .tgp-intro { margin: 12px 0 0; color: var(--muted); font-size: 16px; line-height: 1.5; max-width: 60ch; }
.tgp-org .tgp-h { margin: 0 0 10px; font-weight: 400; font-size: 22px; line-height: 1.2; letter-spacing: -.02em; }
.tgp-org .tgp-h-l { font-size: 28px; margin-top: 8px; }
.tgp-lbl { margin: 0 0 10px; font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
#tgp-org-app { display: flex; flex-direction: column; gap: 16px; margin-top: 28px; }

/* Cartes et sections */
.tgp-org-card { padding: 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--ink2); }
.tgp-org-card p { margin: 0 0 16px; color: var(--muted); line-height: 1.5; }
.tgp-org-card p strong { color: var(--paper); font-weight: 500; }
.tgp-org-ctx { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, var(--ink2)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); font-size: 14px; color: var(--paper) !important; }
.tgp-org-sec { display: flex; flex-direction: column; gap: 12px; }
.tgp-org-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.tgp-org-who { min-width: 0; overflow-wrap: anywhere; }
.tgp-org-who strong { color: var(--paper); font-weight: 500; }
.tgp-org-foot { margin: 4px 0 0; text-align: center; font-size: 14px; }
.tgp-org-loading, .tgp-org-empty { margin: 0; padding: 18px 16px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); font-size: 14px; }
.tgp-org-loading { border: 0; padding: 0; }

/* Boutons (pilule) et liens */
.hbrp.tgp-org .tgp-btn, .hbrp.tgp-org .tgp-btn:hover, .hbrp.tgp-org .tgp-btn:focus { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--line); background: var(--ink2); color: var(--paper); font: 500 16px/1 Aeonik, system-ui, sans-serif; text-decoration: none; white-space: nowrap; cursor: pointer; }
.hbrp.tgp-org .tgp-btn-p, .hbrp.tgp-org .tgp-btn-p:hover, .hbrp.tgp-org .tgp-btn-p:focus { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.hbrp.tgp-org .tgp-btn-s, .hbrp.tgp-org .tgp-btn-s:hover, .hbrp.tgp-org .tgp-btn-s:focus { min-height: 44px; padding: 0 16px; font-size: 14px; }
.tgp-btn-w { width: 100%; }
.hbrp.tgp-org .tgp-btn:active { transform: scale(.98); }
.hbrp.tgp-org .tgp-btn[disabled] { opacity: .5; }
.hbrp.tgp-org .tgp-link, .hbrp.tgp-org .tgp-link:hover, .hbrp.tgp-org .tgp-link:focus { min-height: 44px; padding: 0; border: 0; background: none; color: var(--accent); font: 400 15px/1.2 Aeonik, system-ui, sans-serif; cursor: pointer; }

/* Formulaires (comme l'écran de connexion de l'app) */
.tgp-org-form { display: flex; flex-direction: column; gap: 12px; }
.tgp-org-f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.tgp-org-f small { font-size: 12px; color: var(--muted); }
.hbrp.tgp-org input[type="text"], .hbrp.tgp-org input[type="email"], .hbrp.tgp-org input[type="url"], .hbrp.tgp-org input[type="date"], .hbrp.tgp-org input[type="datetime-local"], .hbrp.tgp-org input[type="number"], .hbrp.tgp-org select, .hbrp.tgp-org textarea {
	width: 100%; min-height: 52px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background-color: var(--ink2); color: var(--paper); font: 400 17px/1.3 Aeonik, system-ui, sans-serif; color-scheme: dark; }
.hbrp.tgp-org textarea { min-height: 0; padding: 14px 16px; line-height: 1.5; resize: vertical; }
.hbrp.tgp-org input:focus, .hbrp.tgp-org select:focus, .hbrp.tgp-org textarea:focus { outline: none; border-color: var(--accent); }
.hbrp.tgp-org .tgp-org-card input, .hbrp.tgp-org .tgp-org-card textarea, .hbrp.tgp-org .tgp-org-edit fieldset input, .hbrp.tgp-org .tgp-org-edit fieldset select, .hbrp.tgp-org .tgp-org-edit fieldset textarea { background-color: var(--ink); }
.tgp-org-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tgp-org-note { margin: 0; padding: 12px 14px; border-radius: 14px; font-size: 14px; }
.tgp-org-note.is-ok { background: color-mix(in srgb, var(--accent) 12%, var(--ink2)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); color: var(--paper); }
.tgp-org-note.is-bad { background: var(--ko-bg); color: var(--ko); }

/* Mes courses : lignes façon app, étiquette sur la ligne secondaire */
.tgp-org-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--ink2); overflow: hidden; }
.tgp-org-race { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
.tgp-org-race:first-child { border-top: 0; }
.tgp-org-race-b { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tgp-org-race-b strong { font-weight: 500; font-size: 17px; overflow-wrap: anywhere; }
.tgp-org-race-b small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--muted); font-size: 13px; }
.tgp-org-st { padding: 2px 8px; border-radius: 99px; font-style: normal; font-size: 12px; background: var(--hover); color: var(--muted); }
.tgp-org-st.is-ok { background: var(--accent-fill); color: var(--on-accent); }
.tgp-org-st.is-wait { background: var(--warn-bg); color: var(--warn); }
.tgp-org-st.is-bad { background: var(--ko-bg); color: var(--ko); }
.tgp-org-acts { display: flex; gap: 8px; }
.tgp-org-acts .tgp-btn { flex: 1 1 0; }

/* Éditeur : une carte par groupe, titre dans la carte */
.tgp-org-edit { gap: 16px; }
.tgp-org-edit > p { margin: -4px 0 0; color: var(--muted); }
.tgp-org-edit fieldset { display: block; min-width: 0; margin: 0; border: 0; padding: 0; }
.tgp-org-edit > fieldset { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--ink2); }
.tgp-org-edit fieldset > legend { float: left; width: 100%; margin: 0 0 16px; padding: 0; font-weight: 400; font-size: 20px; line-height: 1.2; letter-spacing: -.02em; }
.tgp-org-edit fieldset > legend + * { clear: both; }
.tgp-org-edit fieldset > * + *:not(legend) { margin-top: 14px; }
.tgp-org-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 620px) { .tgp-org-grid { grid-template-columns: 1fr; } .tgp-org-card, .tgp-org-edit > fieldset { padding: 16px; } }
.tgp-org-checks { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.tgp-org-checks label { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 16px; border-top: 1px solid var(--line); font-size: 15px; color: var(--paper); cursor: pointer; }
.tgp-org-checks label:first-child { border-top: 0; }
.tgp-org-checks input { order: 2; flex: none; width: 22px; height: 22px; accent-color: var(--accent-fill); }
.tgp-org-sub { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.tgp-org-sub h3 { margin: 0 0 2px; font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tgp-org-sub .tgp-link { align-self: flex-start; }
.tgp-org-sub .tgp-fine2 { margin: 0; font-size: 14px; color: var(--muted); }
.tgp-org-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) 170px 44px; gap: 8px; width: 100%; }
.tgp-org-row:has([type="datetime-local"]) { grid-template-columns: 88px minmax(0, 1fr) 220px 44px; }
@media (max-width: 620px) { .tgp-org-row, .tgp-org-row:has([type="datetime-local"]) { grid-template-columns: 80px minmax(0, 1fr) 44px; } .tgp-org-row > :nth-child(2) { grid-column: 2 / 4; } .tgp-org-row > :nth-child(3) { grid-column: 1 / 3; } }
.hbrp.tgp-org .tgp-org-x, .hbrp.tgp-org .tgp-org-x:hover, .hbrp.tgp-org .tgp-org-x:focus { display: grid; place-items: center; width: 44px; height: 52px; padding: 0; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 400 22px/1 Aeonik, system-ui, sans-serif; cursor: pointer; }
.hbrp.tgp-org .tgp-org-del, .hbrp.tgp-org .tgp-org-del:hover, .hbrp.tgp-org .tgp-org-del:focus { align-self: flex-start; color: var(--ko); }

/* Fichiers : bouton pilule, nom du fichier à côté */
.tgp-org-file { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.tgp-org-file input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.tgp-org-file b { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--ink); color: var(--paper); font: 500 14px/1 Aeonik, system-ui, sans-serif; cursor: pointer; }
.tgp-org-file input:focus-visible ~ b { outline: 2px solid var(--accent); outline-offset: 2px; }
.tgp-org-file small { flex: 1 1 140px; }
.tgp-org-file img { width: 52px; height: 52px; border-radius: 12px; object-fit: contain; background: #fff; padding: 4px; }
.tgp-org-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.tgp-org-photos figure { position: relative; margin: 0; }
.tgp-org-photos img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; }
.hbrp.tgp-org .tgp-org-photos .tgp-org-x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--glass); color: var(--paper); font-size: 16px; }
.tgp-org-addph { display: grid; place-items: center; aspect-ratio: 3 / 2; border-radius: 12px; border: 1px dashed var(--line); color: var(--muted); font-size: 14px; cursor: pointer; }

/* Enregistrer : barre collée en bas, comme dans l'app */
.tgp-org-save { position: sticky; bottom: 0; display: flex; flex-direction: column; gap: 10px; margin: 0 -20px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.tgp-org-save .tgp-btn { width: 100%; }
