/* Terra Nova — design system de l'application.
   Toutes les couleurs passent par les variables : changer le thème = changer :root. */
:root {
  --tn-bg: #0b1020;
  --tn-bg-2: #121a33;
  --tn-surface: #18213f;
  --tn-border: #2a3560;
  --tn-text: #e8ecf8;
  --tn-muted: #a3aed0;
  --tn-accent: #41e2c4;
  --tn-accent-2: #ff8a4c;
  --tn-danger: #ff7a86;
  --tn-ok: #4ade80;
  --tn-warn: #fbbf24;
  --tn-field-border: #6f7cae;
  --tn-on-accent: #04221c;
  --tn-on-danger: #1a0003;
  --tn-header-bg: rgba(11, 16, 32, .9);
  --tn-tabbar-bg: rgba(11, 16, 32, .97);
  --tn-glow: #1f2b5c;
  --tn-tint-accent: rgba(65, 226, 196, .1);
  --tn-tint-warn: rgba(255, 138, 76, .12);
  --tn-tint-danger: rgba(255, 93, 108, .12);
  --tn-tint-ok: rgba(74, 222, 128, .15);
  --tn-shadow: rgba(0, 0, 0, .45);
  --tn-focus: #ffd84d;
  --tn-radius: 14px;
  --tn-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Gabarit ---------- */
/* Le thème WordPress ne doit pas imposer ses couleurs / polices de titres dans l'app. */
.tn-body h1, .tn-body h2, .tn-body h3, .tn-body h4, .tn-body h5, .tn-body h6,
.tn-shell h1, .tn-shell h2, .tn-shell h3, .tn-shell h4 { color: var(--tn-text); font-family: var(--tn-font); font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.tn-body .tn-hero__title span { color: var(--tn-accent); }
body.tn-body { margin: 0; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; background: radial-gradient(1200px 600px at 80% -10%, var(--tn-glow) 0%, transparent 60%), var(--tn-bg); color: var(--tn-text); font-family: var(--tn-font); line-height: 1.5; min-height: 100vh; }
.tn-body a { color: var(--tn-accent); }
.tn-shell { min-height: 100vh; display: flex; flex-direction: column; }
.tn-header { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 1.25rem; padding: 0.875rem 1.5rem; background: var(--tn-header-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--tn-border); }
.tn-brand { display: flex; align-items: center; gap: 0.625rem; font-weight: 800; letter-spacing: .02em; font-size: 1.125rem; color: var(--tn-text) !important; text-decoration: none; }
.tn-brand__dot { width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(var(--tn-accent), var(--tn-accent-2), var(--tn-accent)); box-shadow: 0 0 14px var(--tn-accent); }
.tn-nav { display: flex; gap: 0.25rem; flex: 1; flex-wrap: wrap; }
.tn-nav__item { padding: 0.4375rem 0.75rem; border-radius: 10px; color: var(--tn-muted) !important; text-decoration: none; font-size: 0.875rem; font-weight: 500; }
.tn-nav__item:hover, .tn-nav__item.is-active { background: var(--tn-surface); color: var(--tn-text) !important; }
.tn-nav__icon { margin-right: 0.25rem; }
.tn-user { display: flex; flex-direction: column; align-items: flex-end; font-size: 0.875rem; }
.tn-user small { color: var(--tn-muted); font-size: 0.6875rem; }
.tn-burger { display: none; background: none; border: 0; color: var(--tn-text); font-size: 1.375rem; cursor: pointer; }
.tn-main { flex: 1; width: 100%; max-width: 68.75rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; box-sizing: border-box; }
.tn-page-title { font-size: 1.875rem; margin: 0 0 1.5rem; }
.tn-footer { padding: 1.25rem; text-align: center; color: var(--tn-muted); font-size: 0.8125rem; border-top: 1px solid var(--tn-border); }

@media (max-width: 780px) {
  .tn-header { flex-wrap: wrap; padding: 0.75rem 1rem; }
  .tn-burger { display: block; margin-left: auto; }
  .tn-header .tn-nav { display: none; order: 10; width: 100%; flex-direction: column; }
  .tn-header .tn-nav.is-open { display: flex; }
  .tn-user { display: none; }
  .tn-main { padding: 1.25rem 1rem 3rem; }
}

/* ---------- Accueil ---------- */
.tn-hero { padding: 1.5rem 0 2rem; }
.tn-hero__kicker { color: var(--tn-accent); text-transform: uppercase; letter-spacing: .14em; font-size: 0.75rem; font-weight: 700; margin: 0; }
.tn-hero__title { font-size: clamp(1.875rem, 5vw, 3rem); margin: 0.375rem 0 0.625rem; line-height: 1.1; }
.tn-hero__text { color: var(--tn-muted); font-size: 1.125rem; max-width: 38.75rem; margin: 0; }
.tn-session-pill { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1.125rem; padding: 0.375rem 0.875rem; border-radius: 999px; background: var(--tn-surface); border: 1px solid var(--tn-border); font-size: 0.8125rem; color: var(--tn-muted); }
.tn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tn-ok); box-shadow: 0 0 8px var(--tn-ok); }
.tn-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.75rem), 1fr)); gap: 1rem; }
.tn-tile { display: flex; flex-direction: column; gap: 0.375rem; padding: 1.25rem; border-radius: var(--tn-radius); background: var(--tn-surface); border: 1px solid var(--tn-border); color: var(--tn-text) !important; text-decoration: none; transition: transform .15s, border-color .15s; }
.tn-tile:hover { transform: translateY(-2px); border-color: var(--tn-accent); }
.tn-tile__icon { font-size: 1.75rem; }
.tn-tile__label { font-size: 1.0625rem; }
.tn-tile__desc { color: var(--tn-muted); font-size: 0.875rem; }

/* ---------- Composants ---------- */
.tn-card { background: var(--tn-surface); border: 1px solid var(--tn-border); border-radius: var(--tn-radius); padding: 1.25rem 1.375rem; margin-bottom: 1rem; }
.tn-card h2, .tn-card h3 { margin-top: 0; }
.tn-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr)); gap: 1rem; }

.tn-btn, .tn-body .login-submit input[type=submit] { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.625rem 1.125rem; border: 0; border-radius: 10px; background: var(--tn-accent); color: var(--tn-on-accent) !important; font-weight: 700; font-size: 0.9375rem; cursor: pointer; text-decoration: none; font-family: inherit; }
.tn-btn:hover { filter: brightness(1.08); }
.tn-btn:disabled { opacity: .5; cursor: wait; }
.tn-btn--ghost { background: transparent; color: var(--tn-text) !important; border: 1px solid var(--tn-border); }
.tn-btn--danger { background: var(--tn-danger); color: var(--tn-on-danger) !important; }
.tn-btn--small { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }

.tn-form, .tn-body #loginform { display: flex; flex-direction: column; gap: 0.875rem; }
.tn-form label, .tn-body #loginform label { display: flex; flex-direction: column; gap: 0.375rem; font-size: 0.875rem; color: var(--tn-muted); }
.tn-form input, .tn-form select, .tn-form textarea, .tn-body #loginform input[type=text], .tn-body #loginform input[type=password] {
  padding: 0.6875rem 0.75rem; border-radius: 10px; border: 1px solid var(--tn-field-border); background: var(--tn-bg-2); color: var(--tn-text); font: inherit; width: 100%; box-sizing: border-box; }
.tn-form input:focus, .tn-form select:focus, .tn-form textarea:focus { outline: 2px solid var(--tn-accent); outline-offset: 1px; border-color: transparent; }
.tn-form textarea { min-height: 6.875rem; resize: vertical; }
.tn-body #loginform p { margin: 0; }
.tn-body .login-remember label { flex-direction: row; align-items: center; }

.tn-notice { padding: 0.75rem 1rem; border-radius: 10px; background: var(--tn-surface); border-left: 4px solid var(--tn-accent); margin-bottom: 1rem; }
.tn-notice--error { border-color: var(--tn-danger); }
.tn-notice--warn { border-color: var(--tn-warn); }

.tn-badge { display: inline-block; padding: 2px 0.625rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; background: var(--tn-bg-2); color: var(--tn-muted); border: 1px solid var(--tn-border); }
.tn-badge--ok { color: var(--tn-ok); border-color: currentColor; }
.tn-badge--warn { color: var(--tn-warn); border-color: currentColor; }
.tn-badge--info { color: var(--tn-accent); border-color: currentColor; }
.tn-badge--danger { color: var(--tn-danger); border-color: currentColor; }

.tn-list { display: flex; flex-direction: column; gap: 0.75rem; }
.tn-empty { color: var(--tn-muted); text-align: center; padding: 2rem; }
.tn-meta { color: var(--tn-muted); font-size: 0.8125rem; }
.tn-tabs { display: flex; gap: 0.375rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tn-tab { padding: 0.5rem 0.875rem; border-radius: 10px; border: 1px solid var(--tn-border); background: transparent; color: var(--tn-muted); cursor: pointer; font: inherit; font-size: 0.875rem; }
.tn-tab.is-active { background: var(--tn-surface); color: var(--tn-text); border-color: var(--tn-accent); }

.tn-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.tn-toast { padding: 0.75rem 1rem; border-radius: 10px; background: var(--tn-surface); border: 1px solid var(--tn-border); border-left: 4px solid var(--tn-ok); color: var(--tn-text); box-shadow: 0 10px 30px var(--tn-shadow); transition: opacity .4s, transform .4s; font-family: var(--tn-font); }
.tn-toast--error { border-left-color: var(--tn-danger); }
.tn-toast.is-out { opacity: 0; transform: translateY(8px); }

/* ======================================================================
   Composants des modules (comptes, services, annonces, contact, agents)
   ====================================================================== */
[hidden] { display: none !important; }
.tn-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.tn-lead { color: var(--tn-muted); font-size: 1.0625rem; max-width: 45rem; margin: 0 0 1.25rem; }
.tn-section-title { font-size: 1.25rem; margin: 2rem 0 0.875rem; }
.tn-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.tn-section-head h3, .tn-section-head .tn-section-title { margin-top: 0; }
.tn-toolbar { display: flex; flex-wrap: wrap; gap: 0.625rem; align-items: center; margin-bottom: 1rem; }
.tn-toolbar input[type=search], .tn-toolbar select { padding: 0.625rem 0.75rem; border-radius: 10px; border: 1px solid var(--tn-field-border); background: var(--tn-bg-2); color: var(--tn-text); font: inherit; min-width: 13.75rem; flex: 1; }
.tn-toolbar .tn-tabs { margin: 0; }
.tn-check { flex-direction: row !important; align-items: center; gap: 0.5rem !important; color: var(--tn-text) !important; }
.tn-check input { width: auto !important; }
.tn-check--inline { align-self: end; padding-bottom: 0.75rem; }
.tn-form__error { color: var(--tn-danger); margin: 0; font-weight: 600; }
.tn-notice--ok { border-color: var(--tn-ok); }
.tn-prose p { margin: 0 0 0.75rem; }
.tn-hero__title span { color: var(--tn-accent); }
.tn-hero__actions { display: flex; flex-wrap: wrap; gap: 0.625rem; margin-top: 1.375rem; }

/* Rôles */
.tn-role { display: inline-block; padding: 1px 0.5625rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; background: var(--tn-bg-2); border: 1px solid var(--tn-border); color: var(--tn-accent); }
.tn-role--agent, .tn-role--haut_conseil { color: var(--tn-accent-2); }
.tn-role--admin { color: var(--tn-danger); }
.tn-locked { text-align: center; padding: 2.5rem 1.5rem; }

/* Indicateurs */
.tn-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.375rem), 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.tn-kpi { background: var(--tn-surface); border: 1px solid var(--tn-border); border-radius: var(--tn-radius); padding: 0.875rem 1rem; display: flex; flex-direction: column; gap: 2px; }
.tn-kpi strong { font-size: 1.5rem; line-height: 1.2; }
.tn-kpi span { color: var(--tn-muted); font-size: 0.8125rem; }
.tn-kpi--warn strong { color: var(--tn-warn); }
.tn-kpi--ok strong { color: var(--tn-ok); }
.tn-kpi--info strong { color: var(--tn-accent); }
.tn-kpis--compact .tn-kpi strong { font-size: 1.0625rem; }

/* Tableaux */
.tn-table-wrap { overflow-x: auto; border-radius: var(--tn-radius); border: 1px solid var(--tn-border); }
.tn-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.tn-table th { text-align: left; padding: 0.625rem 0.75rem; background: var(--tn-bg-2); color: var(--tn-muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; }
.tn-table td { padding: 0.625rem 0.75rem; border-top: 1px solid var(--tn-border); vertical-align: top; }
.tn-table select { padding: 0.375rem 0.5rem; border-radius: 8px; border: 1px solid var(--tn-field-border); background: var(--tn-bg-2); color: var(--tn-text); font: inherit; }
.tn-table tr.is-new td { background: var(--tn-tint-accent); }

/* Espace citoyen */
.tn-space__head { display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.tn-space__head h2 { margin: 2px 0 0.375rem; }
.tn-space__head .tn-kpis { margin: 0; min-width: 16.25rem; }
.tn-tiles--small { grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr)); }
.tn-tiles--small .tn-tile { padding: 0.875rem; }
.tn-request__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.tn-request__head h4 { margin: 2px 0 0; font-size: 1.0625rem; }
.tn-request__reply { background: var(--tn-bg-2); border-radius: 10px; padding: 0.625rem 0.75rem; margin: 0.75rem 0 0; }
.tn-request details, .tn-ticket details { margin-top: 0.625rem; }
.tn-request summary, .tn-ticket summary { cursor: pointer; color: var(--tn-muted); font-size: 0.875rem; }
.tn-timeline { list-style: none; margin: 0.625rem 0 0; padding: 0 0 0 0.875rem; border-left: 2px solid var(--tn-border); display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.875rem; }
.tn-auth { max-width: 32.5rem; }
.tn-grid-2 > .tn-auth { max-width: none; }

/* Services */
.tn-service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18.75rem), 1fr)); gap: 0.875rem; }
.tn-service-card { display: flex; gap: 0.875rem; color: var(--tn-text) !important; text-decoration: none; margin: 0; transition: border-color .15s, transform .15s; }
.tn-service-card:hover { border-color: var(--tn-accent); transform: translateY(-2px); }
.tn-service-card h3 { margin: 2px 0 0.375rem; font-size: 1.0625rem; }
.tn-service-card p { margin: 0 0 0.375rem; color: var(--tn-muted); font-size: 0.875rem; }
.tn-service-card__icon { font-size: 2rem; line-height: 1; }
.tn-service__head { display: flex; gap: 1.125rem; align-items: center; }
.tn-service__head h2 { margin: 2px 0 0.375rem; }
.tn-service__body { display: grid; grid-template-columns: 1fr 20rem; gap: 1rem; align-items: start; }
.tn-service__infos dl { margin: 0 0 1rem; }
.tn-service__infos dt { color: var(--tn-muted); font-size: 0.8125rem; margin-top: 0.625rem; }
.tn-service__infos dd { margin: 2px 0 0; }
.tn-checklist { padding-left: 0; list-style: none; }
.tn-checklist li { padding: 0.375rem 0 0.375rem 1.625rem; position: relative; }
.tn-checklist li::before { content: "→"; position: absolute; left: 4px; color: var(--tn-accent); }
@media (max-width: 780px) { .tn-service__body { grid-template-columns: 1fr; } }

/* Actualités */
.tn-news-card { display: flex; gap: 1rem; color: var(--tn-text) !important; text-decoration: none; margin: 0; }
.tn-news-card:hover { border-color: var(--tn-accent); }
.tn-news-card.is-pinned { border-color: var(--tn-accent-2); }
.tn-news-card h3 { margin: 0.25rem 0 0.375rem; }
.tn-news-card p { margin: 0; }
.tn-news-card__icon { font-size: 1.75rem; }
.tn-news-recent__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.25rem), 1fr)); gap: 0.875rem; }
.tn-news-mini { color: var(--tn-text) !important; text-decoration: none; margin: 0; }
.tn-news-mini:hover { border-color: var(--tn-accent); }
.tn-news-mini h3 { font-size: 1rem; margin: 0.25rem 0 0.375rem; }
.tn-news-mini p { margin: 0; color: var(--tn-muted); font-size: 0.875rem; }
.tn-news-row { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin: 0; }
.tn-news-row h4 { margin: 2px 0 0; }
.tn-news-row__actions { display: flex; gap: 0.375rem; flex-wrap: wrap; }
.tn-article__title { font-size: 1.625rem; margin: 0.5rem 0 1rem; }
.tn-pager { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; }
.tn-alert-banner { display: flex; align-items: center; gap: 0.625rem; flex-wrap: wrap; padding: 0.75rem 1rem; border-radius: var(--tn-radius); margin: 0 0 1.25rem; text-decoration: none; color: var(--tn-text) !important; background: var(--tn-tint-warn); border: 1px solid var(--tn-accent-2); }
.tn-alert-banner--alerte { background: var(--tn-tint-danger); border-color: var(--tn-danger); }
.tn-alert-banner em { margin-left: auto; font-style: normal; color: var(--tn-accent); }

/* Contact */
.tn-contact__layout { display: grid; grid-template-columns: 1fr 18.75rem; gap: 1rem; align-items: start; }
.tn-steps-list { padding-left: 1.125rem; display: flex; flex-direction: column; gap: 0.625rem; color: var(--tn-muted); }
.tn-steps-list strong { color: var(--tn-text); }
.tn-confirm { text-align: center; padding: 2.5rem 1.5rem; }
.tn-confirm:focus { outline: none; }
.tn-confirm__icon { width: 4rem; height: 4rem; border-radius: 50%; margin: 0 auto 0.75rem; display: grid; place-items: center; font-size: 2rem; background: var(--tn-tint-ok); color: var(--tn-ok); }
.tn-confirm__ref { font-size: 1.125rem; }
.tn-confirm__ref strong { color: var(--tn-accent); letter-spacing: .05em; }
@media (max-width: 780px) { .tn-contact__layout { grid-template-columns: 1fr; } }

/* Accueil */
.tn-home .tn-hero { padding-top: 0.75rem; }
.tn-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.75rem), 1fr)); gap: 0.875rem; }
.tn-steps li { background: var(--tn-surface); border: 1px solid var(--tn-border); border-radius: var(--tn-radius); padding: 1.125rem; }
.tn-steps li span { display: inline-grid; place-items: center; width: 1.875rem; height: 1.875rem; border-radius: 50%; background: var(--tn-accent); color: var(--tn-on-accent); font-weight: 800; margin-bottom: 0.5rem; }
.tn-steps li strong { display: block; }
.tn-steps li p { margin: 0.25rem 0 0; color: var(--tn-muted); font-size: 0.875rem; }
.tn-band { display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin-top: 2rem; padding: 1.5rem; border-radius: var(--tn-radius); background: linear-gradient(120deg, var(--tn-tint-accent), var(--tn-tint-warn)); border: 1px solid var(--tn-border); }
.tn-band h2 { margin: 0 0 0.25rem; font-size: 1.25rem; }
.tn-band p { margin: 0; color: var(--tn-muted); }

/* Espace agents : interface distincte (accent orange) */
.tn-workspace { --tn-accent: #ff9f5a; --tn-bg: #120f14; --tn-bg-2: #1c1720; --tn-surface: #231d29; --tn-border: #3a2f42; --tn-muted: #b3a9bd; --tn-field-border: #8a7699; --tn-on-accent: #2a1200; --tn-glow: #3a2338; --tn-header-bg: rgba(18, 15, 20, .9); --tn-tabbar-bg: rgba(18, 15, 20, .97); --tn-tint-accent: rgba(255, 159, 90, .1); }
body.tn-workspace { background: radial-gradient(1000px 500px at 90% -10%, var(--tn-glow) 0%, transparent 60%), var(--tn-bg); }

.tn-workspace .tn-btn--ghost { color: var(--tn-text) !important; }
.tn-brand__tag { margin-left: 0.375rem; padding: 2px 0.5rem; border-radius: 6px; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--tn-accent); color: var(--tn-on-accent); }
.tn-agent__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.tn-agent__head h2 { margin: 2px 0 0.25rem; }
.tn-agent__grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 860px) { .tn-agent__grid { grid-template-columns: 1fr; } }
.tn-todo { list-style: none; margin: 0; padding: 0; }
.tn-todo li { display: flex; justify-content: space-between; align-items: center; gap: 0.625rem; padding: 0.625rem 0; border-top: 1px solid var(--tn-border); }
.tn-todo a { display: flex; flex-direction: column; color: var(--tn-text) !important; text-decoration: none; }
.tn-tools { display: grid; gap: 0.5rem; }
.tn-tool { display: grid; grid-template-columns: 2rem 1fr; column-gap: 0.5rem; padding: 0.625rem 0.75rem; border-radius: 10px; border: 1px solid var(--tn-border); color: var(--tn-text) !important; text-decoration: none; }
.tn-tool:hover { border-color: var(--tn-accent); }
.tn-tool span { grid-row: span 2; font-size: 1.375rem; }
.tn-tool small { color: var(--tn-muted); }
.tn-ticket { margin: 0; }
.tn-ticket.is-action { border-left: 4px solid var(--tn-warn); }
.tn-ticket.is-closed { opacity: .75; }
.tn-ticket.is-focus { box-shadow: 0 0 0 2px var(--tn-accent); }
.tn-ticket__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; flex-wrap: wrap; }
.tn-ticket__head h3 { margin: 0.25rem 0 0; font-size: 1.0625rem; }
.tn-ticket__body { white-space: pre-line; }
.tn-ticket__form { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.875rem; padding-top: 0.875rem; border-top: 1px solid var(--tn-border); }
.tn-ticket__form select, .tn-ticket__form input { padding: 0.5rem 0.625rem; border-radius: 8px; border: 1px solid var(--tn-field-border); background: var(--tn-bg-2); color: var(--tn-text); font: inherit; font-size: 0.875rem; }
.tn-ticket__form input { flex: 1; min-width: 12.5rem; }
.tn-feed { margin-top: 0.5rem; }
.tn-feed .tn-kpis { margin: 0.75rem 0; }


/* ======================================================================
   Téléphone & tablette
   ====================================================================== */

/* Barre d'onglets façon application (téléphone uniquement) */
.tn-tabbar { display: none; }
.tn-install { display: none; }

/* Survols réservés aux appareils à souris : pas d'effets « collés » au toucher */
@media (hover: none) {
  .tn-tile:hover, .tn-service-card:hover { transform: none; }
}

/* Tablette (≤ 1024 px) */
@media (max-width: 1024px) {
  .tn-main { padding: 1.5rem 1.25rem 3.5rem; }
  .tn-header { gap: 0.75rem; padding: 0.75rem 1.25rem; }
  .tn-nav__item { padding: 0.4375rem 0.5625rem; font-size: 0.8125rem; }
  .tn-service__body { grid-template-columns: 1fr 17.5rem; }
  .tn-contact__layout { grid-template-columns: 1fr 16.25rem; }
}

/* Petite tablette / grand téléphone (≤ 860 px) : menu tiroir */
@media (max-width: 860px) {
  .tn-header { flex-wrap: wrap; padding: 0.625rem 1rem; padding-top: max(0.625rem, env(safe-area-inset-top)); }
  .tn-burger { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; margin-left: auto; border-radius: 10px; }
  .tn-burger:active { background: var(--tn-surface); }
  .tn-header .tn-nav { display: none; order: 10; width: 100%; flex-direction: column; gap: 2px; padding: 0.5rem 0 0.25rem; border-top: 1px solid var(--tn-border); margin-top: 0.5rem; max-height: 70vh; overflow-y: auto; }
  .tn-header .tn-nav.is-open { display: flex; }
  .tn-header .tn-nav__item { padding: 0.75rem 0.625rem; font-size: 1rem; }
  .tn-user { display: none; }
  .tn-header .tn-nav .tn-nav__account { display: flex; }
  .tn-service__body, .tn-contact__layout, .tn-agent__grid { grid-template-columns: 1fr; }
  .tn-contact__aside { order: -1; }
}
.tn-nav__account { display: none; }

/* Téléphone (≤ 640 px) */
@media (max-width: 640px) {
  :root { --tn-radius: 12px; }
  body.tn-body { padding-bottom: calc(4.25rem + env(safe-area-inset-bottom)); }
  .tn-main { padding: 1rem 0.875rem 2rem; padding-left: max(0.875rem, env(safe-area-inset-left)); padding-right: max(0.875rem, env(safe-area-inset-right)); }
  .tn-page-title { font-size: 1.5rem; margin-bottom: 1rem; }
  .tn-brand { font-size: 1.0625rem; }
  .tn-brand__tag { font-size: 0.625rem; padding: 2px 0.375rem; }

  /* Barre d'onglets en bas */
  .tn-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--tn-tabbar-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--tn-border); padding: 0.375rem 0.25rem calc(0.375rem + env(safe-area-inset-bottom)); }
  .tn-tabbar a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0.375rem 2px; border-radius: 10px; color: var(--tn-muted) !important; text-decoration: none; font-size: 0.6875rem; font-weight: 600; }
  .tn-tabbar a span { font-size: 1.25rem; line-height: 1; }
  .tn-tabbar a em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tn-tabbar a.is-active { color: var(--tn-accent) !important; background: var(--tn-surface); }

  /* Texte et titres */
  .tn-hero { padding: 0.5rem 0 1.25rem; }
  .tn-hero__title { font-size: 1.875rem; }
  .tn-hero__text { font-size: 1rem; }
  .tn-hero__actions .tn-btn { flex: 1 1 auto; justify-content: center; }
  .tn-section-title { font-size: 1.125rem; margin: 1.5rem 0 0.75rem; }
  .tn-lead { font-size: 0.9375rem; }
  .tn-card { padding: 1rem; }
  .tn-article__title { font-size: 1.375rem; }

  /* Cibles tactiles ≥ 44 px, champs à 16 px (évite le zoom automatique d'iOS) */
  .tn-btn { min-height: 2.75rem; padding: 0.625rem 1rem; }
  .tn-btn--small { min-height: 2.375rem; }
  .tn-form input, .tn-form select, .tn-form textarea, .tn-toolbar input, .tn-toolbar select,
  .tn-ticket__form input, .tn-ticket__form select, .tn-sig__actions input, .tn-sig__actions select,
  .tn-body #loginform input[type=text], .tn-body #loginform input[type=password] { font-size: 1rem; min-height: 2.75rem; }
  .tn-check input { width: 1.375rem !important; height: 1.375rem; min-height: 0; }
  .tn-grid-2 { grid-template-columns: 1fr; gap: 0 0.75rem; }
  .tn-form { gap: 0.75rem; }

  /* Onglets / filtres : défilement horizontal au lieu de 3 lignes de boutons */
  .tn-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-left: -14px; margin-right: -14px; padding: 0 0.875rem 2px; }
  .tn-tabs::-webkit-scrollbar { display: none; }
  .tn-tab { flex: 0 0 auto; min-height: 2.5rem; white-space: nowrap; }
  .tn-toolbar { flex-direction: column; align-items: stretch; }
  .tn-toolbar input[type=search], .tn-toolbar select { min-width: 0; width: 100%; }
  .tn-toolbar .tn-tabs { margin-left: -14px; margin-right: -14px; }

  /* Grilles */
  .tn-tiles { grid-template-columns: repeat(2, 1fr); gap: 0.625rem; }
  .tn-tile { padding: 0.875rem; gap: 0.25rem; }
  .tn-tile__icon { font-size: 1.5rem; }
  .tn-tile__label { font-size: 0.9375rem; }
  .tn-tile__desc { font-size: 0.7812rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .tn-service-grid, .tn-news-recent__grid { grid-template-columns: 1fr; gap: 0.625rem; }
  .tn-service-card { gap: 0.75rem; }
  .tn-service-card__icon { font-size: 1.625rem; }
  .tn-service__head { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .tn-service__infos .tn-btn { width: 100%; justify-content: center; }
  .tn-news-card { gap: 0.75rem; }
  .tn-news-card h3 { font-size: 1rem; }
  .tn-news-row { flex-direction: column; align-items: stretch; }
  .tn-news-row__actions .tn-btn { flex: 1; justify-content: center; }
  .tn-steps { grid-template-columns: 1fr; }
  .tn-band { padding: 1.125rem; }
  .tn-band .tn-btn { width: 100%; justify-content: center; }
  .tn-pager { flex-wrap: wrap; gap: 0.5rem; }

  /* Indicateurs : 2 colonnes */
  .tn-kpis { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-bottom: 0.875rem; }
  .tn-kpi { padding: 0.75rem; }
  .tn-kpi strong { font-size: 1.375rem; }
  .tn-kpis--compact .tn-kpi strong { font-size: 0.9375rem; }

  /* Espaces citoyen / agent */
  .tn-space__head, .tn-agent__head { flex-direction: column; align-items: stretch; }
  .tn-space__head .tn-kpis { min-width: 0; }
  .tn-agent__head .tn-btn { justify-content: center; }
  .tn-request__head, .tn-ticket__head, .tn-sig__head { flex-direction: column; align-items: flex-start; gap: 0.375rem; }
  .tn-ticket__form, .tn-sig__actions { flex-direction: column; align-items: stretch; }
  .tn-ticket__form input, .tn-sig__actions input { min-width: 0; }
  .tn-todo li { flex-direction: column; align-items: flex-start; gap: 0.25rem; }

  /* Tableaux → cartes empilées */
  .tn-table-wrap { border: 0; overflow: visible; }
  .tn-table thead { display: none; }
  .tn-table, .tn-table tbody, .tn-table tr, .tn-table td { display: block; width: 100%; box-sizing: border-box; }
  .tn-table tr { background: var(--tn-bg-2); border: 1px solid var(--tn-border); border-radius: var(--tn-radius); padding: 0.625rem 0.75rem; margin-bottom: 0.625rem; }
  .tn-table td { border: 0; padding: 0.25rem 0; }
  .tn-table td[data-label]::before { content: attr(data-label); display: block; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: .05em; color: var(--tn-muted); margin-bottom: 1px; }
  .tn-table td.tn-empty { text-align: center; }
  .tn-table select { width: 100%; min-height: 2.75rem; font-size: 1rem; }

  /* Notifications au-dessus de la barre d'onglets */
  .tn-toasts { left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .tn-toast { text-align: center; }

  /* Bandeau d'installation de l'app */
  .tn-install { display: flex; align-items: center; gap: 0.625rem; position: fixed; left: 10px; right: 10px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 70; padding: 0.75rem 0.875rem; border-radius: 14px; background: var(--tn-surface); border: 1px solid var(--tn-accent); box-shadow: 0 12px 30px var(--tn-shadow); }
  .tn-install[hidden] { display: none !important; }
  .tn-install p { margin: 0; flex: 1; font-size: 0.875rem; }
  .tn-install button { min-height: 2.375rem; }
  .tn-install .tn-install__close { background: none; border: 0; color: var(--tn-muted); font-size: 1.25rem; padding: 0.25rem 0.5rem; }
}

/* Très petits écrans (≤ 360 px) */
@media (max-width: 360px) {
  .tn-hero__title { font-size: 1.625rem; }
  .tn-tiles { grid-template-columns: 1fr; }
  .tn-tabbar a { font-size: 0.625rem; }
}

/* Mode paysage téléphone : la barre du bas prend moins de place */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 950px) {
  .tn-tabbar a span { font-size: 1.0625rem; }
  .tn-tabbar a { padding: 3px 2px; }
}

/* App installée (mode plein écran) */
@media (display-mode: standalone) {
  .tn-install { display: none !important; }
  .tn-header { padding-top: max(0.75rem, env(safe-area-inset-top)); }
}

/* Ajustements après tests sur appareils */
.tn-btn { box-sizing: border-box; max-width: 100%; text-align: center; }
.tn-section-head { margin: 1.75rem 0 0.75rem; align-items: center; }
.tn-section-head h2, .tn-section-head h3, .tn-section-head .tn-section-title { margin: 0; }
.tn-card > .tn-section-head:first-child { margin-top: 0; }
.tn-service__infos dd, .tn-meta, .tn-ticket__body { overflow-wrap: anywhere; }
.tn-toolbar > * { min-width: 0; max-width: 100%; }
@media (max-width: 640px) {
  .tn-body h2 { font-size: 1.375rem; }
  .tn-body h3 { font-size: 1.125rem; }
  .tn-body .tn-hero__title { font-size: 1.875rem; }
  .tn-toolbar .tn-tabs { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; max-width: 100%; }
  .tn-section-head { margin: 1.375rem 0 0.625rem; }
}


/* ======================================================================
   Accessibilité : socle (RGAA / WCAG 2.1 AA)
   ====================================================================== */
/* Texte lu par les lecteurs d'écran mais invisible à l'écran */
.tn-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
/* Lien d'évitement : premier élément atteint au clavier */
.tn-skip { position: absolute; left: 0.75rem; top: 0.75rem; z-index: 1000; padding: 0.75rem 1.125rem; border-radius: 10px; background: var(--tn-accent); color: var(--tn-on-accent) !important; font-weight: 700; text-decoration: none; }
/* Masqué tant qu'il n'a pas le focus clavier, quelle que soit la taille du texte */
.tn-skip:not(:focus) { clip: rect(0, 0, 0, 0); clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; padding: 0; white-space: nowrap; }
/* Focus toujours visible au clavier */
.tn-body :focus-visible, .tn-shell :focus-visible, .tn-a11y :focus-visible { outline: 3px solid var(--tn-focus); outline-offset: 2px; border-radius: 6px; }
.tn-body .tn-form input:focus-visible, .tn-body .tn-form select:focus-visible, .tn-body .tn-form textarea:focus-visible { outline: 3px solid var(--tn-focus); outline-offset: 1px; }
.tn-main:focus { outline: none; }
.tn-body ::placeholder { color: var(--tn-muted); opacity: .85; }
/* Champs en erreur */
.tn-body [aria-invalid="true"] { border-color: var(--tn-danger) !important; box-shadow: 0 0 0 1px var(--tn-danger); }
.tn-req { color: var(--tn-danger); font-weight: 700; }
.tn-hint { display: block; font-size: 0.8125rem; color: var(--tn-muted); }
.tn-footer a { color: var(--tn-muted); }
.tn-footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.25rem; margin-top: 0.375rem; }
/* Préférence système : moins d'animations */
@media (prefers-reduced-motion: reduce) {
  .tn-body *, .tn-body *::before, .tn-body *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
/* Mode « couleurs forcées » de Windows : on garde des contours lisibles */
@media (forced-colors: active) {
  .tn-btn, .tn-tab, .tn-card, .tn-tile, .tn-badge, .tn-kpi { border: 1px solid CanvasText; }
  .tn-tab.is-active, .tn-tabbar a.is-active { outline: 2px solid Highlight; }
}
@media (max-width: 640px) {
  .tn-footer { padding-bottom: 1.5rem; font-size: 0.875rem; }
}

/* Titres de cartes : niveau h2 pour les lecteurs d'écran, taille visuelle inchangée */
.tn-body .tn-service-card h2, .tn-body .tn-news-card h2, .tn-body .tn-ticket__head h2, .tn-body .tn-sig__head h2 { font-size: 1.0625rem; margin: 0.125rem 0 0.375rem; }
.tn-body .tn-ticket__head h2, .tn-body .tn-sig__head h2 { margin: 0.25rem 0 0; }
.tn-body .tn-contact__aside h2 { font-size: 1.125rem; margin-top: 0; }
.tn-body .tn-news-card h2 { margin-top: 0.25rem; }


/* Fil d'Ariane (repère de navigation) */
.tn-breadcrumb { margin: 0 0 0.75rem; font-size: 0.875rem; }
.tn-breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.tn-breadcrumb li { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--tn-muted); }
.tn-breadcrumb li + li::before { content: "›"; color: var(--tn-muted); padding: 0 0.25rem; }
.tn-breadcrumb a { color: var(--tn-accent); }
.tn-breadcrumb [aria-current] { color: var(--tn-text); font-weight: 600; }


/* Avancement d'une demande (Envoyée → Prise en charge → Traitée) */
.tn-stepper { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.25rem; margin: 0.875rem 0 0.5rem; padding: 0; counter-reset: none; }
.tn-stepper__step { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.25rem; font-size: 0.8125rem; color: var(--tn-muted); }
.tn-stepper__step::before { content: ""; position: absolute; top: 0.875rem; left: -50%; width: 100%; height: 3px; background: var(--tn-border); z-index: 0; }
.tn-stepper__step:first-child::before { display: none; }
.tn-stepper__step.is-done::before, .tn-stepper__step.is-current::before { background: var(--tn-accent); }
.tn-stepper__dot { position: relative; z-index: 1; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; border: 2px solid var(--tn-field-border); background: var(--tn-surface); color: var(--tn-muted); font-weight: 700; font-size: 0.8125rem; }
.tn-stepper__step.is-done .tn-stepper__dot { background: var(--tn-accent); border-color: var(--tn-accent); color: var(--tn-on-accent); }
.tn-stepper__step.is-current .tn-stepper__dot { border-color: var(--tn-accent); color: var(--tn-text); box-shadow: 0 0 0 3px var(--tn-tint-accent); }
.tn-stepper__step.is-done, .tn-stepper__step.is-current { color: var(--tn-text); }
.tn-stepper__label { font-weight: 600; }
.tn-stepper__date { font-size: 0.75rem; color: var(--tn-muted); }
.tn-request.is-focus { box-shadow: 0 0 0 2px var(--tn-accent); }
.tn-request__title { margin: 0.125rem 0 0; font-size: 1.0625rem; }
.tn-request__body { white-space: pre-line; }
.tn-band__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Guide « Bien démarrer » */
.tn-onboarding { border-color: var(--tn-accent); margin-bottom: 1.25rem; }
.tn-onboarding__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 0.75rem; flex-wrap: wrap; }
.tn-onboarding__head h2 { margin: 0.125rem 0 0; font-size: 1.25rem; }
.tn-onboarding__count { margin: 0; color: var(--tn-muted); }
.tn-progress { width: 100%; height: 0.625rem; margin: 0.75rem 0; accent-color: var(--tn-accent); border-radius: 999px; overflow: hidden; border: 1px solid var(--tn-border); background: var(--tn-bg-2); }
.tn-progress::-webkit-progress-bar { background: var(--tn-bg-2); }
.tn-progress::-webkit-progress-value { background: var(--tn-accent); border-radius: 999px; }
.tn-progress::-moz-progress-bar { background: var(--tn-accent); }
.tn-onboarding__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.tn-onboarding__steps li { display: grid; grid-template-columns: 2rem 1fr auto; gap: 0.75rem; align-items: center; padding: 0.625rem 0.75rem; border-radius: 10px; background: var(--tn-bg-2); }
.tn-onboarding__steps li p { margin: 0.125rem 0 0; font-size: 0.875rem; color: var(--tn-muted); }
.tn-onboarding__steps li.is-done strong { text-decoration: line-through; color: var(--tn-muted); }
.tn-onboarding__check { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; border: 2px solid var(--tn-field-border); font-weight: 700; }
.is-done .tn-onboarding__check { background: var(--tn-ok); border-color: var(--tn-ok); color: var(--tn-bg); }
.tn-onboarding__hide { margin-top: 0.5rem; text-align: right; }
.tn-linkbtn { background: none; border: 0; padding: 0.375rem; color: var(--tn-accent); text-decoration: underline; font: inherit; font-size: 0.875rem; cursor: pointer; }
@media (max-width: 640px) { .tn-onboarding__steps li { grid-template-columns: 2rem 1fr; } .tn-onboarding__steps li .tn-btn { grid-column: 1 / -1; justify-content: center; } }
html[data-tn-big="1"] .tn-onboarding__steps li { grid-template-columns: 2rem 1fr; }
html[data-tn-big="1"] .tn-onboarding__steps li .tn-btn { grid-column: 1 / -1; }
html[data-tn-big="1"] .tn-stepper { grid-template-columns: 1fr; }
html[data-tn-big="1"] .tn-stepper__step { flex-direction: row; text-align: left; gap: 0.5rem; }
html[data-tn-big="1"] .tn-stepper__step::before { display: none; }

.tn-confirm__next { font-size: 1.0625rem; margin: 1.25rem 0 0.5rem; }
.tn-confirm__steps { text-align: left; display: inline-block; margin: 0 auto 1rem; padding-left: 1.25rem; color: var(--tn-muted); }
.tn-confirm__steps strong { color: var(--tn-text); }
.tn-sig__photo { display: block; max-width: 100%; max-height: 16rem; margin-top: 0.625rem; border-radius: 10px; border: 1px solid var(--tn-border); }

/* Charge de travail des agents (D17) */
.tn-workload { margin-bottom: 1.25rem; }
.tn-workload__main { display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; align-items: center; padding: 1rem 1.25rem; border-radius: var(--tn-radius); background: var(--tn-surface); border: 1px solid var(--tn-border); margin-bottom: 0.75rem; }
.tn-workload__main.is-alert { border-color: var(--tn-warn); border-left-width: 6px; }
.tn-workload__num { grid-row: span 2; font-size: 2.75rem; line-height: 1; color: var(--tn-warn); }
.tn-workload__main span { font-weight: 700; font-size: 1.125rem; }
.tn-workload__main small { color: var(--tn-muted); }
.tn-kpi--big { grid-column: span 2; }
.tn-kpi--big strong { font-size: 2rem; }
.tn-ticket__take { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem; margin: 0.75rem 0 0; }
.tn-ticket__owner { margin-top: 0.5rem; }
@media (max-width: 640px) { .tn-kpi--big { grid-column: 1 / -1; } }

/* Services mis en avant (F28) */
.tn-popular { margin-bottom: 0.5rem; }
.tn-popular .tn-badge { align-self: flex-start; margin-top: 0.25rem; }
.tn-common__title { font-size: 1rem; margin: 1.125rem 0 0.5rem; }
.tn-common { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); gap: 0.375rem 1rem; }
.tn-common li { padding: 0.375rem 0; border-bottom: 1px solid var(--tn-border); }

/* Recherche globale */
.tn-search__form { background: var(--tn-surface); border: 1px solid var(--tn-border); border-radius: var(--tn-radius); padding: 1rem 1.125rem; margin-bottom: 1.25rem; }
.tn-search__label { display: block; font-weight: 700; font-size: 1.125rem; margin-bottom: 0.5rem; }
.tn-search__row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tn-search__row input { flex: 1 1 14rem; min-width: 0; padding: 0.75rem 0.875rem; border-radius: 10px; border: 1px solid var(--tn-field-border); background: var(--tn-bg-2); color: var(--tn-text); font: inherit; font-size: 1.0625rem; }
.tn-search__summary { margin: 0 0 0.5rem; }
.tn-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.tn-results li { background: var(--tn-surface); border: 1px solid var(--tn-border); border-radius: 12px; padding: 0.75rem 0.875rem; }
.tn-results li > a { font-weight: 700; font-size: 1.0625rem; }
.tn-results li .tn-meta { display: block; margin-top: 0.125rem; }
.tn-results li p { margin: 0.375rem 0 0; color: var(--tn-muted); font-size: 0.9375rem; }
.tn-attention__item--danger { border-left: 5px solid var(--tn-danger) !important; }
.tn-attention__item--warn { border-left: 5px solid var(--tn-warn) !important; }
.tn-attention__item--info { border-left: 5px solid var(--tn-accent) !important; }
.tn-body fieldset { min-width: 0; }

/* ------------------------------------------------------------------ */
/* En-tête : logo · navigation · outils (🔔 🌐 🔍 ♿) · compte          */
/* ------------------------------------------------------------------ */
.tn-header__tools { display: flex; align-items: center; gap: 0.375rem; flex-shrink: 0; }
.tn-header .tn-header__tools .tn-a11y-btn { min-width: 2.75rem; padding: 0 0.625rem; justify-content: center; }
.tn-header .tn-header__tools .tn-a11y-btn__label { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.tn-nav { min-width: 0; }
.tn-nav__item { white-space: nowrap; }
.tn-user { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 1280px) {
  .tn-header { gap: 0.875rem; }
  .tn-nav__icon { display: none; }
}
@media (max-width: 860px) {
  .tn-header .tn-header__tools { margin-left: auto; }
  .tn-header .tn-header__tools + .tn-burger { margin-left: 0.125rem; }
  .tn-nav__icon { display: inline; }
}
html[data-tn-big="1"] .tn-header .tn-header__tools { margin-left: auto; flex-wrap: wrap; }
html[data-tn-big="1"] .tn-header .tn-header__tools + .tn-burger { margin-left: 0.125rem; }

/* « Plus ▾ » : rubriques qui ne tiennent pas sur une ligne */
.tn-nav__more { position: relative; }
.tn-nav__more[hidden] { display: none; }
.tn-nav__more-btn { background: none; border: 0; font-family: inherit; font-size: 0.875rem; font-weight: 500; line-height: inherit; cursor: pointer; }
@media (max-width: 1024px) { .tn-nav__more-btn { font-size: 0.8125rem; } }
.tn-nav__more-list { position: absolute; left: 0; top: calc(100% + 0.375rem); z-index: 85; min-width: 13rem; display: grid; gap: 2px; padding: 0.375rem; background: var(--tn-bg); border: 1px solid var(--tn-border); border-radius: 12px; box-shadow: 0 12px 30px var(--tn-shadow); }
.tn-nav__more-list[hidden] { display: none; }
.tn-nav__more-list .tn-nav__item { display: flex; align-items: center; padding: 0.625rem 0.75rem; }
.tn-nav__more-list .tn-nav__icon { display: inline; }
.tn-nav { flex-wrap: wrap; align-items: center; }
@media (max-width: 640px) {
  .tn-header .tn-header__tools { gap: 0.25rem; }
  .tn-header .tn-header__tools .tn-a11y-btn { min-width: 2.5rem; min-height: 2.5rem; padding: 0 0.375rem; }
}
html[data-tn-big="1"] .tn-header .tn-header__tools { flex-shrink: 1; min-width: 0; max-width: 100%; }

.tn-header .tn-header__tools .tn-search-btn { min-width: 2.75rem; }
@media (max-width: 640px) {
  .tn-header { gap: 0.5rem; }
  .tn-header .tn-lang__code { display: none; }
  .tn-header .tn-burger { width: 2.5rem; height: 2.5rem; }
}
/* Très petits écrans : la recherche passe dans le menu ☰ */
@media (max-width: 400px) {
  .tn-header .tn-header__tools .tn-search-btn { display: none; }
}

/* Guide « Bien démarrer » : étape validée directement dans le guide */
.tn-onboarding__panel { grid-column: 1 / -1; margin-top: 0.25rem; padding: 0.75rem; border-radius: 10px; border: 1px solid var(--tn-border); background: var(--tn-surface); }
.tn-onboarding__panel[hidden] { display: none; }
.tn-onboarding__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.625rem 0.75rem; }
.tn-onboarding__form > label:not(.tn-check) { flex-basis: 100%; font-weight: 600; }
.tn-onboarding__form select { flex: 1 1 14rem; max-width: 100%; min-width: 0; }
.tn-onboarding__form .tn-check { flex-basis: 100%; }
.tn-onboarding__choices { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; }
.tn-onboarding [data-tn-disclose]::after { content: " ▾"; }
.tn-onboarding [data-tn-disclose][aria-expanded="true"]::after { content: " ▴"; }

/* ------------------------------------------------------------------ */
/* F38 : état des services (icône + texte + bordure : jamais la couleur seule) */
/* ------------------------------------------------------------------ */
.tn-status { --st: var(--tn-warn); border: 1px solid var(--tn-border); border-left: 6px solid var(--st); border-radius: 12px; padding: 0.875rem 1rem; margin: 0 0 1rem; background-color: var(--tn-surface); background-image: linear-gradient(var(--tn-tint-warn), var(--tn-tint-warn)); }
.tn-status--danger { --st: var(--tn-danger); background-image: linear-gradient(var(--tn-tint-danger), var(--tn-tint-danger)); }
.tn-status--info { --st: var(--tn-accent); background-image: linear-gradient(var(--tn-tint-accent), var(--tn-tint-accent)); }
.tn-status p { margin: 0 0 0.375rem; }
.tn-status__title { font-size: 1.0625rem; display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: baseline; }
.tn-status__icon { font-size: 1.25rem; }
.tn-status__reason { color: var(--tn-muted); }
.tn-status__when { display: grid; gap: 0.375rem; margin: 0.5rem 0 0; }
.tn-status__when > div { display: grid; grid-template-columns: minmax(min(100%, 9rem), max-content) 1fr; gap: 0.75rem; }
.tn-status__when dt { font-weight: 700; }
.tn-status__when dd { margin: 0; }
@media (max-width: 40rem) { .tn-status__when > div { grid-template-columns: 1fr; gap: 0; } }
html[data-tn-big="1"] .tn-status__when > div { grid-template-columns: 1fr; gap: 0; }
.tn-status-pill { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.25rem 0 0.375rem !important; padding: 0.125rem 0.5rem; border-radius: 8px; font-size: 0.875rem; font-weight: 700; border: 1px solid var(--tn-warn); color: var(--tn-text); background: var(--tn-tint-warn); }
.tn-status-pill--ferme { border-color: var(--tn-danger); background: var(--tn-tint-danger); }
.tn-status-pill--info { border-color: var(--tn-accent); background: var(--tn-tint-accent); }
.tn-status-list { margin-bottom: 1.25rem; }
.tn-service-status-box:empty { display: none; }
.tn-status-admin { display: grid; gap: 0.75rem; }
.tn-status-admin__row > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; min-height: 2.75rem; font-size: 1.0625rem; }
.tn-status-admin__row > summary .tn-badge { margin-left: auto; }
.tn-status-admin__form { margin-top: 0.75rem; }
.tn-status-admin__form fieldset { border: 1px solid var(--tn-border); border-radius: 10px; padding: 0.625rem 0.875rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

/* Utilitaires partagés */
.tn-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.tn-inline-form { display: inline; margin: 0; }
.tn-btn--big { font-size: 1.0625rem; padding: 0.875rem 1.25rem; white-space: normal; text-align: center; }
.tn-pagination { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 1rem; }
.tn-pagination a { min-width: 2.75rem; min-height: 2.75rem; display: inline-grid; place-items: center; border: 1px solid var(--tn-field-border); border-radius: 10px; text-decoration: none; }
.tn-pagination a.is-active { background: var(--tn-accent); color: var(--tn-on-accent) !important; border-color: var(--tn-accent); font-weight: 700; }

/* Accès rapides au clavier (F41) : visibles dès qu'ils reçoivent le focus */
.tn-skiplinks .tn-skip { border: 0; font: inherit; font-weight: 700; cursor: pointer; }
html[data-tn-focus="1"] .tn-skiplinks { display: flex; flex-wrap: wrap; gap: 0.375rem; padding: 0.375rem 0.75rem; background: var(--tn-surface); border-bottom: 1px solid var(--tn-border); }
html[data-tn-focus="1"] .tn-skiplinks .tn-skip { position: static; clip: auto; clip-path: none; width: auto; height: auto; overflow: visible; white-space: normal; padding: 0.375rem 0.75rem; font-size: 0.875rem; }

/* F42 : erreurs de formulaire (texte + icône + bordure, jamais la couleur seule) */
.tn-label { display: inline; }
.tn-error-summary { border: 2px solid var(--tn-danger); border-left-width: 6px; border-radius: 10px; padding: 0.75rem 1rem; background: var(--tn-tint-danger); color: var(--tn-text); }
.tn-error-summary:focus { outline: 3px solid var(--tn-focus); outline-offset: 2px; }
.tn-error-summary__title { margin: 0 0 0.375rem; font-weight: 800; }
.tn-error-summary ul { margin: 0; padding-left: 1.25rem; }
.tn-error-summary a { color: var(--tn-text) !important; text-decoration: underline; }
.tn-field-error { display: block; margin-top: 0.25rem; color: var(--tn-text); font-size: 0.875rem; font-weight: 700; padding-left: 0.5rem; border-left: 3px solid var(--tn-danger); }
.tn-body [aria-invalid="true"] { border: 2px solid var(--tn-danger) !important; box-shadow: 0 0 0 1px var(--tn-danger); }
.tn-body [aria-invalid="true"]:focus { outline-color: var(--tn-focus); }

/* F43 : liens du texte toujours soulignés (repérables sans la couleur) */
.tn-body main p a:not(.tn-btn):not(.tn-linkbtn), .tn-body main li a:not(.tn-btn):not(.tn-tile):not(.tn-card), .tn-body main dd a:not(.tn-btn), .tn-body .tn-hint a { text-decoration: underline; text-underline-offset: 0.18em; }
.tn-body input[type=datetime-local]:focus-within, .tn-body input[type=date]:focus-within, .tn-body input[type=time]:focus-within { outline: 3px solid var(--tn-focus); outline-offset: 1px; }

/* F44 : texte agrandi sur petit écran — tout se replie, rien ne dépasse */
.tn-body main .tn-card, .tn-body main li, .tn-body main section, .tn-body main details, .tn-body main summary { min-width: 0; }
.tn-body main h1, .tn-body main h2, .tn-body main h3, .tn-body main h4, .tn-body main p, .tn-body main dd, .tn-body main dt, .tn-body main label, .tn-body main summary, .tn-body main a { overflow-wrap: anywhere; }
html[data-tn-big="1"] .tn-body main [class*="__head"], html[data-tn-big="1"] .tn-body main summary { flex-wrap: wrap; }
html[data-tn-big="1"] .tn-body main .tn-badge { white-space: normal; max-width: 100%; }
.tn-body input, .tn-body select, .tn-body textarea { min-width: 0; max-width: 100%; }
html[data-tn-big="1"] .tn-body input[type=datetime-local], html[data-tn-big="1"] .tn-body input[type=date], html[data-tn-big="1"] .tn-body input[type=time] { font-size: 0.875em; }
.tn-grid-2 > *, .tn-form > *, .tn-form p, .tn-form label { min-width: 0; }
.tn-a11y-choice, .tn-a11y-choice span, .tn-a11y-choice strong, .tn-a11y-choice small { min-width: 0; overflow-wrap: anywhere; }

/* Tuiles en liste (Mon espace) */
ul.tn-tiles { list-style: none; margin: 0 0 1.25rem; padding: 0; }
ul.tn-tiles > li { display: flex; min-width: 0; }
ul.tn-tiles > li > .tn-tile { flex: 1; }
.tn-account-tiles .tn-badge { align-self: flex-start; margin-top: 0.375rem; }
.tn-space-section__title { margin: 0.25rem 0 0.5rem; }

/* F49 : demandes mises à jour depuis la dernière visite */
.tn-updates { border-bottom: 1px solid var(--tn-border); border-left: 6px solid var(--tn-accent); background-color: var(--tn-surface); background-image: linear-gradient(var(--tn-tint-accent), var(--tn-tint-accent)); }
.tn-updates__inner { max-width: 68.75rem; margin: 0 auto; padding: 0.75rem 1.5rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; box-sizing: border-box; }
.tn-updates__icon { font-size: 1.5rem; }
.tn-updates__body { flex: 1 1 18rem; min-width: 0; }
.tn-updates__body p { margin: 0 0 0.125rem; overflow-wrap: anywhere; }
.tn-updates__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
@media (max-width: 40rem) { .tn-updates__inner { padding: 0.625rem 0.875rem; } }
.tn-status-ok { border: 1px solid var(--tn-border); border-left: 6px solid var(--tn-ok); border-radius: 12px; padding: 0.625rem 1rem; margin: 0 0 1rem; background: var(--tn-surface); }
html[data-tn-cvd="1"] .tn-status-ok { border-left-style: solid; }

/* F63 : service en ligne coupé (bandeau + message à la place du formulaire) */
.tn-paused-bar { border-bottom: 1px solid var(--tn-border); border-left: 6px solid var(--tn-danger, #ff6b6b); background: var(--tn-surface); }
.tn-paused-bar__inner { max-width: 68.75rem; margin: 0 auto; padding: 0.6rem 1.5rem; box-sizing: border-box; }
.tn-paused { border-left: 6px solid var(--tn-danger, #ff6b6b); }
.tn-paused h2 { margin-top: 0; }
.tn-paused__alt { padding: 0.75rem 1rem; border-radius: 10px; background: var(--tn-bg, transparent); border: 1px solid var(--tn-border); }
.tn-paused__agent { font-size: 0.9rem; opacity: .9; }

/* F59/F61/F62 : version légère (connexion lente, appareil peu puissant) */
.tn-lite-suggest { border-bottom: 1px solid var(--tn-border); border-left: 6px solid var(--tn-accent); background: var(--tn-surface); }
.tn-lite-suggest__inner { max-width: 68.75rem; margin: 0 auto; padding: 0.6rem 1.5rem; display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; box-sizing: border-box; }
.tn-lite-suggest[hidden] { display: none; }
body.tn-lite { background: var(--tn-bg) !important; }
.tn-lite *, .tn-lite *::before, .tn-lite *::after { animation: none !important; transition: none !important; box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; text-shadow: none !important; }
.tn-lite .tn-hero, .tn-lite .tn-card { background-image: none !important; }
.tn-lite .tn-header { position: static; }
.tn-lite img:not(.tn-sig__preview) { max-height: 14rem; object-fit: contain; }
.tn-lite .tn-brand__dot { background: var(--tn-accent) !important; }
