/* Palette adaptable au thème WordPress hôte via ses couleurs standard. */
.stl {
    --stl-green: var(--wp--preset--color--primary, #287a3b);
    --stl-dark: var(--wp--preset--color--secondary, #205c32);
    --stl-ink: var(--wp--preset--color--contrast, #17231a);
    --stl-soft: var(--wp--preset--color--tertiary, #edf5e9);
    --stl-border: #d5e4d5; /* Ne pas reprendre une couleur de thème parfois noire. */
    color: var(--stl-ink);
    font-family: inherit;
    line-height: 1.65;
    max-width: 1160px;
    margin: 24px auto;
}
/* La page Angular peut dépasser la colonne étroite du thème sans déborder de l'écran. */
.stl.stl-angular-host {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: min(1160px, calc(100vw - 32px));
    max-width: none;
    margin: 24px 0;
}
.stl-angular-host app-root { display: block; width: 100%; }
.stl *, .stl *::before, .stl *::after { box-sizing: border-box; }
/* Espacement des seuls panneaux principaux ; les sections internes gardent leurs marges propres. */
.stl > section[data-stl-page] { margin-block: 5px !important; scroll-margin-top: 140px; min-height: 0; }
.stl h2, .stl h3, .stl h4 { color: var(--stl-ink); line-height: 1.25; margin: 0 0 16px; }
.stl h2 { font-size: clamp(30px, 5vw, 48px); max-width: 750px; }
.stl h3 { font-size: clamp(24px, 3vw, 30px); }
.stl h4 { font-size: 21px; }
.stl p { margin: 0 0 16px; }
.stl a { color: var(--stl-dark); text-underline-offset: 4px; }
.stl-hero { background: var(--stl-soft); border-radius: 22px; padding: clamp(24px, 5vw, 54px); border: 1px solid var(--stl-border); }
.stl .stl-tutorial-link { display: inline-block; font-weight: 700; text-decoration: underline; }
.stl .stl-eyebrow { color: var(--stl-dark); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.stl-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.stl button, .stl .stl-button { display: inline-block; background: var(--stl-green); color: #fff; border: 1px solid var(--stl-green); border-radius: 10px; padding: 11px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; }
.stl button:hover, .stl .stl-button:hover { background: var(--stl-dark); color: #fff; }
.stl button.stl-secondary { background: #fff; color: var(--stl-dark); border-color: var(--stl-border); }
.stl :is(a,button,input,select,textarea):focus-visible { outline: 3px solid #032b8c; outline-offset: 3px; }
.stl label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.stl input:not([type=checkbox]), .stl select, .stl textarea { width: 100%; min-width: 0; border: 1px solid #82917c; background: #fff; color: var(--stl-ink); border-radius: 8px; padding: 11px 12px; font: inherit; }
.stl textarea { resize: vertical; }
/* La lecture seule de l’e-mail se distingue sans ajouter de texte au libellé. */
.stl input.stl-readonly-email:disabled { background: #e9edeb; color: #536157; border-color: #aebbb0; opacity: 1; cursor: not-allowed; }

.stl .stl-check { display: flex; align-items: center; gap: 9px; }
.stl .stl-rules-agreement { color: brown; }
.stl .stl-rules-text { font-size: 14px; font-weight: 600; line-height: 1.5; cursor: text; }
.stl .stl-rules-agreement a { color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.stl .stl-rules-agreement input:disabled { opacity: 1; }
.stl input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--stl-green); flex: 0 0 auto; }
.stl-filters { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; margin-bottom: 20px; }
.stl-filters > label:first-child { flex: 1; min-width: 220px; }
.stl-filters .stl-check { min-height: 48px; }
.stl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.stl-card { padding: 24px; border: 1px solid var(--stl-border); border-radius: 16px; background: #fff; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.stl-card > :last-child { margin-top: auto; }
.stl-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 12px; margin-bottom: 22px; }
.stl-badge { background: var(--stl-soft); color: var(--stl-dark); border-radius: 30px; padding: 4px 10px; font-size: 12px; font-weight: 600; display: inline-block; }
/* Même code couleur que le calendrier pour les réservations et demandes. */
.stl .stl-status-pending { background: #fff0ce; color: #745009; border-color: #dcb558; }
.stl .stl-status-accepted { background: #fde3e3; color: #8f1d24; border-color: #d25a62; }
.stl-loan-counters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 22px; }
.stl-loan-counter { display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 9px; border: 1px solid var(--stl-border); border-radius: 8px; background: #f7faf5; color: var(--stl-ink); font-size: 12px; line-height: 1.35; }
.stl-loan-counter strong { font-size: 13px; }

.stl .stl-muted { background: #f4eee3; color: #725318; }
.stl-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.stl-panel { background: #f8fbf5; padding: clamp(20px, 4vw, 32px); border: 1px solid var(--stl-border); border-radius: 16px; margin-top: 26px; }
.stl-panel label { margin-bottom: 18px; }
.stl-panel small { display: block; margin-top: 14px; }
.stl-notice { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; background: var(--stl-soft); border-left: 4px solid var(--stl-green); padding: 16px; margin-top: 20px !important; }
.stl-notice [data-stl-notice-text] { flex: 1; }
.stl .stl-notice .stl-notice-close { flex: 0 0 auto; margin: -6px -8px 0 0; padding: 2px 8px; border: 0 !important; background: transparent !important; color: inherit !important; font-size: 24px; line-height: 1.2; }
.stl-loan { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 18px 0; padding: 22px; border: 1px solid var(--stl-border); border-radius: 14px; background: #fff; box-shadow: 0 4px 16px rgb(32 49 36 / 6%); }
.stl-loan h4 { margin: 8px 0 16px; }
.stl-loan > div { flex: 1; min-width: 0; }
.stl-loan-heading { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stl-loan-heading h4 { margin-bottom: 10px; }
.stl-loan-people { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 8px 0 18px; }
.stl-loan-person { min-width: 0; padding: 14px 16px; border: 1px solid var(--stl-border); border-radius: 10px; background: #f7faf5; }
.stl-loan-person > strong { display: block; margin-bottom: 5px; color: var(--stl-dark); }
.stl-loan-person p { margin: 0 0 4px; }
.stl-loan-person a { overflow-wrap: anywhere; }
.stl-loan-area { margin-top: 8px !important; font-size: 14px; }
.stl-loan-refusal { padding: 12px 14px; border-left: 4px solid #bc806d; border-radius: 4px; background: #fbf5f2; white-space: pre-wrap; }
.stl-editor { max-width: 720px; }
.stl-field-label { display: inline-flex; align-items: baseline; gap: .25em; }
.stl-required { color: #a12626; font-weight: 700; }
.stl-required-help { margin: 0 0 12px; font-size: 13px; color: var(--stl-ink); }
.stl-field-help { margin: -10px 0 16px !important; font-size: 13px; color: var(--stl-ink); }
@media (max-width: 900px) { .stl-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 600px) {
    .stl-grid { grid-template-columns: 1fr; }
    .stl-loan { flex-direction: column; padding: 16px; }
    .stl-filters { align-items: stretch; flex-direction: column; }
    .stl-hero { border-radius: 14px; }
}

/* Navigation seule : le logo et le nom sont fournis par le site hôte. */
.stl [hidden] { display: none !important; }
.stl-header {
    position: sticky;
    top: var(--stl-header-offset, 0px);
    z-index: 50;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--stl-border);
}
body.admin-bar .stl-header { --stl-header-offset: 32px; }
.stl-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.stl-tabs a { padding: 12px 14px; border-radius: 10px; text-decoration: none; font-size: 14px; font-weight: 600; }
.stl .stl-tabs a[aria-selected="true"] { color: #fff; background: var(--stl-green); }
.stl-request-count { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 99px; background: #fff0ce; color: #745009; font-size: 12px; line-height: 1.5; text-align: center; vertical-align: middle; }
.stl-request-notifications { margin: 24px 0 36px; padding: 22px; background: #f8fbf5; border: 1px solid var(--stl-border); border-radius: 16px; }
.stl-request-notification { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 8px 0; padding: 12px 16px; border-left: 4px solid var(--stl-green); border-radius: 6px; background: #fff; }
.stl-request-notification p { margin: 0; }
.stl .stl-request-notification button { padding: 5px 10px; font-size: 13px; white-space: nowrap; }
.stl-request-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin: 24px 0 18px; }
.stl-request-heading form { min-width: 220px; }
.stl-request-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.stl-request-card { padding: 22px; border: 1px solid var(--stl-border); border-radius: 16px; background: #fff; overflow-wrap: anywhere; }
.stl-request-card h4 { margin: 14px 0 8px; }
.stl-request-card .stl-actions { margin-top: 18px; }
.stl-request-meta { color: #58665d; font-size: 13px; }
.stl-request-offer { margin: 10px 0; padding: 12px; border-radius: 8px; background: #f8fbf5; }
.stl-request-offer p { margin: 4px 0; }
.stl-request-dialog label { margin: 16px 0; }
.stl-request-dialog .stl-request-close-notify { display: flex; align-items: center; width: 100%; }
.stl-request-dialog .stl-request-close-message { width: 100%; }
@media (max-width: 700px) {
    .stl-request-grid { grid-template-columns: 1fr; }
    .stl-request-notification { align-items: flex-start; flex-direction: column; }
}

.stl-hero { margin-bottom: 30px; }
.stl-dialog {
    color: var(--stl-ink);
    background: #fff;
    border: 1px solid var(--stl-border);
    border-radius: 18px;
    padding: clamp(20px, 4vw, 36px);
    width: min(680px, calc(100% - 32px));
    max-height: 85dvh;
    overflow-y: auto;
    margin: auto;
}
.stl-dialog::backdrop { background: #0f172a99; }
.stl-dialog .stl-close { display: block; margin: 0 0 20px auto; }
.stl-tool-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.stl-tool-fields > :first-child, .stl-tool-fields > :last-child { grid-column: 1 / -1; }
.stl-tool-fields .stl-field { min-width: 0; }
.stl-tool-location { grid-column: 1 / -1; padding: 12px 16px; border: 1px solid var(--stl-border); border-radius: 10px; background: #fff; }
.stl-tool-location small { margin-top: 5px; }
.stl-field strong { font-size: 13px; color: var(--stl-dark); }
.stl-field p { margin: 4px 0 0; }
.stl-request { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--stl-border); }
.stl-request label { margin-bottom: 16px; }
.stl button:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 782px) { body.admin-bar .stl-header { --stl-header-offset: 46px; } }
@media (max-width: 600px) {
    body.admin-bar .stl-header { --stl-header-offset: 0px; }
    .stl-header { gap: 8px; }
    .stl-tabs { width: 100%; }
    .stl-tabs a { padding: 8px; font-size: 12px; }
    .stl-tool-fields { grid-template-columns: 1fr; }
}

.stl-pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.stl-actions a[aria-current=page] { font-weight: 700; text-decoration-thickness: 3px; }
.stl-tool-fields > label:has(textarea) { grid-column: 1 / -1; }

/* Connexion intégrée : hérite de la charte du site, sans en-tête supplémentaire. */
.stl .stl-login { max-width: 540px; margin: 32px auto; }
.stl .stl-login h2 { font-size: clamp(26px, 4vw, 34px); }
.stl-login input:not([type=checkbox]) { margin-bottom: 20px; }
.stl-login .stl-password-field { position: relative; }
.stl-login .stl-password-field input { padding-right: 54px; }
.stl .stl-login .stl-password-toggle {
    position: absolute; top: 5px; right: 5px; width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0; border: 0; background: transparent; color: var(--stl-dark);
}
.stl .stl-login .stl-password-toggle:hover { background: var(--stl-soft); color: var(--stl-dark); }
.stl-login .stl-check { margin-block: 8px 22px; }
.stl-login button { width: 100%; }
.stl .stl-login-help { margin-top: 18px; text-align: center; }


/* Neutralise les bordures natives et celles des thèmes dans la fenêtre d’emprunt. */
.stl dialog.stl-dialog {
    border: 1px solid #d5e4d5 !important;
    outline: 0 !important;
    box-shadow: none !important;
}
.stl dialog.stl-dialog { border-radius: 18px; }

/* Calendrier mensuel : texte et couleur indiquent tous deux le statut. */
.stl-availability { margin: 20px 0; padding: 16px; border: 1px solid var(--stl-border); border-radius: 12px; background: #f8fbf5; }
.stl-availability h4 { margin-bottom: 8px; font-size: 18px; }
.stl-calendar-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.stl-calendar-key { display: inline-block; width: 14px; height: 14px; margin-left: 8px; border-radius: 3px; border: 1px solid #82917c; }
.stl-calendar-controls { display: flex; align-items: center; justify-content: space-between; margin: 12px 0; }
.stl .stl-calendar-controls button { min-width: 42px; padding: 4px 10px; }
.stl-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.stl-calendar-grid > span { padding: 5px 0; font-size: 12px; font-weight: 600; }
.stl .stl-calendar-grid button { min-width: 0; width: 100%; padding: 6px 0; border-radius: 6px; font-size: 13px; }
.stl .stl-day-free { background: #e7f5e7; color: #205c32; border-color: #a5c9a5; }
.stl .stl-day-pending { background: #fff0ce; color: #745009; border-color: #dcb558; }
.stl .stl-day-accepted { background: #fde3e3; color: #8f1d24; border-color: #d25a62; }
.stl .stl-calendar-grid button:disabled { opacity: 1; cursor: default; }
.stl .stl-calendar-grid button.stl-day-past { opacity: .45; }

.stl .stl-calendar-grid button.stl-day-selected { background: #174a94; border-color: #174a94; color: #fff; }
.stl .stl-calendar-grid button.stl-day-preview-invalid { background: #f9dedb; border-color: #ae5146; color: #6b241c; }
.stl-calendar-selection { min-height: 2.2em; margin: 12px 0 4px !important; font-weight: 600; }
.stl-calendar-selection-pending { color: #a12626; }
.stl-calendar-error { color: #8a2c25; font-weight: 600; }
.stl .stl-availability [data-calendar-clear] { margin: 0 0 12px; padding: 6px 10px; font-size: 13px; }
.stl-availability small { display: block; }

/* Mes outils : les actions du prêteur restent visibles avant les autres fiches. */
.stl-my-tools-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.stl-my-tools-header h3 { margin-bottom: 5px; }
.stl-my-tools-group { margin: 26px 0 12px !important; font-size: 19px !important; }
.stl-owned-tool { padding: 20px; margin-bottom: 14px; border: 1px solid var(--stl-border); border-radius: 14px; background: #fff; box-shadow: 0 3px 12px rgb(32 49 36 / 5%); }
.stl-owned-tool .stl-loan-heading h4 { margin: 0; }
.stl-owned-tool-main > p { margin: 9px 0 12px; }
.stl-my-tools-pending { background: #fff0ce; color: #745009; }
.stl-my-tools-return { background: #fde3e3; color: #8f1d24; }
.stl-owned-tool-action { padding: 13px 15px; margin: 9px 0; border-radius: 9px; background: #f8fbf5; border: 1px solid var(--stl-border); }
.stl-owned-tool-action p { margin: 0 0 10px; }
.stl-owned-tool-links { margin-top: 14px; }
.stl-owned-tool-links form { margin: 0; }
.stl-my-tools-pagination { justify-content: center; margin-top: 22px; }
.stl-tool-editor { width: min(720px, calc(100% - 32px)); }

/* Les adresses longues restent lisibles sans dominer les fiches et le profil. */
.stl .stl-email, .stl .stl-loan-phone, .stl .stl-loan a[href^="tel:"], .stl input[type="email"] { font-size: 14px; }
.stl-profile-selector { margin-bottom: 18px; }
.stl-profile-results { max-height: 290px; overflow-y: auto; margin: 10px 0 18px; border: 1px solid var(--stl-border); border-radius: 10px; background: #fff; }
.stl-profile-results a { display: block; padding: 9px 12px; overflow-wrap: anywhere; }
.stl .stl-profile-result { display: block; width: 100%; padding: 9px 12px; text-align: left; border: 0; border-radius: 0; background: #fff; color: var(--stl-ink); font-weight: 400; }
.stl .stl-profile-result:hover, .stl .stl-profile-result:focus-visible { background: var(--stl-soft); color: var(--stl-ink); }
.stl-profile-results a:hover, .stl-profile-results a:focus-visible { background: var(--stl-soft); }
.stl-profile-results p { padding: 10px 12px; margin: 0; }
.stl .stl-email { overflow-wrap: anywhere; }
