/* ==========================================================
   VAGUE 4 — F33 suppression de compte, F34 administration des comptes,
   F35 astuces contextuelles, F36 horaires des transports.
   Même charte que features.css : fonds Void, filets 1 px, chanfreins,
   une seule couleur lumineuse, ambre rare, rouge réservé au destructif.
   ========================================================== */

/* --- Boîte de dialogue (suppression, modification, code d'accès) --- */
.tn-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(3, 7, 14, 0.85);
    backdrop-filter: blur(6px);
}
.tn-dialog {
    position: relative;
    width: min(32rem, 100%);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 1.5rem;
    border: 1px solid var(--cyber-500);
    background: var(--void-800);
    color: var(--text-100);
    clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%, 0 14px);
}
.tn-dialog:focus { outline: none; }
.tn-dialog-title { margin: 0 0 0.75rem; font: 600 1.25rem/1.3 'Chakra Petch', sans-serif; letter-spacing: 0.04em; text-transform: uppercase; color: var(--cyber-300); }
.tn-dialog-form { display: grid; gap: 0.875rem; margin-top: 1rem; }
.tn-dialog-form input, .tn-dialog-form select { width: 100%; min-height: 2.5rem; padding: 0.375rem 0.625rem; font-size: 0.875rem; }
.tn-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.75rem; margin-top: 1rem; }
.tn-form-error { min-height: 1.25rem; margin: 0; font-size: 0.8125rem; color: var(--err); }

/* --- Actions destructives --- */
.tn-btn-danger {
    min-height: 2.25rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--err);
    background: transparent;
    color: var(--err);
    font: 700 0.75rem/1 'Chakra Petch', sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}
.tn-btn-danger:hover:not(:disabled) { background: var(--err); color: var(--void-950); }
.tn-btn-danger:disabled { opacity: 0.45; cursor: not-allowed; }
.tn-danger-link { display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; padding: 0.25rem 0; background: none; border: 0; color: var(--text-500); font-size: 0.75rem; cursor: pointer; }
.tn-danger-link:hover { color: var(--err); }
.tn-danger-link[hidden] { display: none; }
.tn-tab--danger { color: var(--err); border-color: rgba(255, 84, 112, 0.5); }
.tn-tab--danger:hover { border-color: var(--err); color: var(--err); background: rgba(255, 84, 112, 0.1); }

/* --- Administration des comptes (F34) --- */
.tn-account-tools { display: grid; gap: 0.875rem; margin: 1rem 0 0.5rem; }
@media (min-width: 640px) { .tn-account-tools { grid-template-columns: 2fr 1fr; } }
.tn-account-tools input, .tn-account-tools select { width: 100%; min-height: 2.5rem; padding: 0.375rem 0.625rem; font-size: 0.875rem; }
.tn-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.375rem; }
.tn-row-actions .tn-tab { width: auto; }
.tn-audit { margin: 0.5rem 0 0; padding: 0; list-style: none; font-size: 0.75rem; color: var(--text-300); }
.tn-audit li { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.375rem 0; border-top: 1px solid var(--line-subtle); }

/* --- Horaires des transports (F36) --- */
.tn-transit-form { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 0.75rem; }
.tn-transit-form select { width: 100%; min-height: 2.5rem; padding: 0.375rem 0.625rem; font-size: 0.875rem; }
.tn-transit-form .tn-tab { width: auto; min-width: 2.5rem; min-height: 2.5rem; }
@media (max-width: 539px) { .tn-transit-form { grid-template-columns: 1fr; } .tn-transit-form .tn-tab { justify-self: start; } }
.tn-journeys, .tn-lines { margin: 0.5rem 0 0; padding: 0; list-style: none; }
.tn-journey { padding: 0.875rem 0; border-top: 1px solid var(--line-subtle); }
.tn-journey-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.875rem; }
.tn-journey-time { font: 500 1.75rem/1 'JetBrains Mono', monospace; color: var(--amber); font-variant-numeric: tabular-nums; }
.tn-journey-wait { font: 600 1rem/1.3 'Chakra Petch', sans-serif; color: var(--cyber-300); }
.tn-leg { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.625rem; margin-top: 0.375rem; font-size: 0.8125rem; color: var(--text-100); }
.tn-line-id { display: inline-block; min-width: 2.25rem; padding: 0.125rem 0.375rem; border: 1px solid var(--cyber-500); color: var(--cyber-300); font: 500 0.6875rem/1.4 'JetBrains Mono', monospace; text-align: center; }
.tn-line { padding: 0.75rem 0; border-top: 1px solid var(--line-subtle); }
.tn-line-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.625rem; margin-bottom: 0.25rem; color: var(--text-100); }
.tn-line-alert { margin-top: 0.25rem; color: var(--amber); }

/* --- Astuces contextuelles (F35) --- */
.tn-tip {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 70;
    width: min(21rem, calc(100vw - 2rem));
    padding: 1rem;
    border: 1px solid var(--cyber-500);
    border-left-width: 3px;
    background: var(--void-800);
    box-shadow: 0 0 24px rgba(0, 184, 255, 0.18);
}
.tn-tip[hidden] { display: none; }
.tn-tip-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.tn-tip-x { min-width: 2rem; min-height: 2rem; background: none; border: 0; color: var(--text-500); font-size: 1rem; cursor: pointer; }
.tn-tip-x:hover { color: var(--cyber-300); }
.tn-tip-title { margin: 0.25rem 0 0.375rem; font: 600 1.0625rem/1.3 'Chakra Petch', sans-serif; color: var(--text-100); }
.tn-tip-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 0.75rem; }
.tn-tool[aria-pressed="true"] { border-color: var(--cyber-700); }
.tn-tool[aria-pressed="false"] { opacity: 0.7; }

/* --- Focus clavier visible partout --- */
.tn-dialog :focus-visible, .tn-tip :focus-visible, #account-admin :focus-visible, #transports :focus-visible, .tn-danger-link:focus-visible {
    outline: 2px solid var(--cyber-300);
    outline-offset: 2px;
}

/* --- Contraste renforcé (F23) --- */
html.hc .tn-dialog, html.hc .tn-tip { background: #000000; border-color: #FFFFFF; box-shadow: none; }
html.hc .tn-dialog-title, html.hc .tn-tip-title, html.hc .tn-leg, html.hc .tn-line-head { color: #FFFFFF; }
html.hc .tn-danger-link, html.hc .tn-audit, html.hc .tn-tip-x { color: #FFFFFF; }
html.hc .tn-btn-danger, html.hc .tn-tab--danger, html.hc .tn-form-error { color: #FFFFFF; border-color: #FFFFFF; }
html.hc .tn-journey-time, html.hc .tn-journey-wait, html.hc .tn-line-id, html.hc .tn-line-alert { color: #FFFFFF; }
html.hc .tn-journey, html.hc .tn-line, html.hc .tn-audit li { border-color: #FFFFFF; }
