/* ======================================================================
   Structure commune : mise en page et composants (l'apparence « Pop »
   est dans theme.css, la mise en page de l'accueil dans landing/v*.css)
   ====================================================================== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
html, body { min-height: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.45;
}
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--link, var(--primary)); }
h1, h2, h3, h4 { margin: 0; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.tiny { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; opacity: .7; }
:focus-visible { outline: 3px solid var(--focus, var(--primary)); outline-offset: 2px; }
code { font-family: var(--font-mono); font-size: .92em; padding: 1px 5px; border-radius: 5px; background: var(--surface-2); }

/* ----- Boutons ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; position: relative;
  border: 1px solid transparent; border-radius: var(--radius-sm); padding: 10px 18px;
  font-weight: 700; cursor: pointer; transition: transform .12s, background .15s, box-shadow .15s, border-color .15s; white-space: nowrap; text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.busy { color: transparent !important; cursor: progress; }
.btn.busy::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--text); border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-primary { background: var(--primary); color: var(--primary-contrast); }
.btn-primary:hover { background: var(--primary-hover, var(--primary)); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13.5px; }
.btn-lg { padding: 14px 24px; font-size: 16.5px; }
.btn-block { width: 100%; padding: 13px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm); flex: none;
  border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--muted); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.on { color: var(--star); }
.icon-btn.on .ico { fill: currentColor; }
.icon-btn.danger:hover { color: var(--danger); }
.link-btn { border: 0; background: none; padding: 0; color: var(--link); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; font-size: inherit; }
.link-btn:hover { text-decoration-color: var(--primary); }

/* ----- Champs ----- */
input:not([type=file]):not([type=checkbox]):not([type=radio]), textarea, select {
  width: 100%; background: var(--input-bg, var(--surface)); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 13px; outline: none; transition: border-color .15s, box-shadow .15s;
}
select { appearance: none; cursor: pointer; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); }
/* Les champs de texte ont leur propre indicateur de focus (bordure + ombre) */
input:not([type=checkbox]):not([type=radio]):focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }
input[readonly] { background: var(--surface-2); }
textarea { resize: vertical; line-height: 1.5; }
label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--label, var(--text)); }
.opt { font-weight: 500; font-size: 12px; color: var(--muted); margin-left: 4px; }
.hint { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.hint.ok { color: var(--ok); } .hint.bad { color: var(--danger); }
.form-error { color: var(--danger); font-size: 13.5px; font-weight: 600; margin: 0; }
.form-error:empty { display: none; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }

.addr-field, .pw-field { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--input-bg, var(--surface)); overflow: hidden; }
.addr-field input, .pw-field input { border: 0 !important; background: transparent !important; box-shadow: none !important; min-width: 0; border-radius: 0 !important; }
.addr-suffix { display: flex; align-items: center; padding: 0 13px; color: var(--muted); font-weight: 700; font-family: var(--font-mono); font-size: 13px; background: var(--suffix-bg, transparent); border-left: 1px solid var(--border); white-space: nowrap; }
.pw-toggle { border: 0; background: transparent; padding: 0 12px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.pw-toggle.on { color: var(--primary); }
.addr-preview { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--preview-bg, var(--surface-2)); border: 1px dashed var(--border); font-size: 13px; color: var(--muted); }
.addr-preview strong { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.strength { height: 5px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.strength span { display: block; height: 100%; width: 0; transition: width .25s, background .25s; background: var(--danger); }
.strength span[data-level=mid] { background: #f0a500; }
.strength span[data-level=strong] { background: var(--ok); }

.switch { position: relative; display: inline-block; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 30px; background: var(--surface-2); border: 2px solid var(--border); cursor: pointer; transition: background .2s; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: var(--text); transition: transform .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(22px); background: #fff; }
.switch input:disabled + span { opacity: .5; cursor: not-allowed; }
.switch input:focus-visible + span { outline: 3px solid var(--focus, var(--primary)); outline-offset: 2px; }

/* ----- Puces ----- */
.status-chip, .role-chip, .cat-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid var(--border); }
.status-chip.ok { background: #d9f7e6; color: #0b6b3a; }
.status-chip.pending { background: #fff1c2; color: #7a5a00; }
.status-chip.warn { background: #ffe1d6; color: #9a2a0e; }
.status-chip.bad { background: #ffd6dc; color: #9a0f23; }
.role-chip.role-admin { background: #ffd6ec; } .role-chip.role-support { background: #d9e6ff; } .role-chip.role-user { background: var(--surface-2); }
.cat-chip { background: var(--surface-2); }
.cat-chip.cat-recovery { background: #ffe066; } .cat-chip.cat-login { background: #d9e6ff; } .cat-chip.cat-abuse { background: #ffd6dc; } .cat-chip.cat-other { background: #e6f7f1; }

/* ----- Marque ----- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.logo { width: 34px; height: 34px; border-radius: var(--logo-radius, 10px); background: var(--logo-bg, var(--primary)); position: relative; flex: none; }
.logo::before { content: ""; position: absolute; inset: 7px; background: var(--logo-fg, #fff); -webkit-mask: var(--envelope) center/contain no-repeat; mask: var(--envelope) center/contain no-repeat; }
:root { --envelope: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2.5'/%3E%3Cpath d='M3.5 7l8.5 6 8.5-6'/%3E%3C/svg%3E"); }

/* ======================================================================
   Accueil (structure par défaut ; chaque version la réorganise)
   ====================================================================== */
.landing { min-height: 100dvh; display: flex; flex-direction: column; }
.lp-nav { display: flex; align-items: center; gap: 16px; padding: 16px clamp(16px, 5vw, 64px); }
.lp-links { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.lp-link { border: 0; background: none; cursor: pointer; padding: 8px 12px; font-weight: 700; color: var(--text); text-decoration: none; border-radius: var(--radius-sm); }
.lp-link:hover { background: var(--hover); }
.lp-hero { display: grid; gap: 40px; padding: 40px clamp(16px, 5vw, 64px); align-items: center; }
.lp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--surface); border: 1px solid var(--border); }
.hero-title { font-size: clamp(36px, 5vw, 64px); line-height: 1.02; letter-spacing: -.035em; margin: 22px 0 18px; font-weight: 800; }
.hero-sub { font-size: 18px; color: var(--muted); max-width: 32em; margin: 0 0 24px; line-height: 1.55; }
.hero-sub strong { color: var(--text); }
.hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.hero-points li { display: flex; gap: 12px; align-items: center; font-weight: 600; }
.hero-points li::before { content: "✓"; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--check-bg, var(--surface-2)); font-weight: 800; font-size: 13px; flex: none; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.lp-badges { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 14px; font-weight: 700; }
.lp-badges li { display: flex; align-items: center; gap: 6px; }
.lp-mock, .lp-side-art, .auth-close { display: none; }

.auth-wrap { display: grid; justify-items: center; }
.auth-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; width: 100%; max-width: 460px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--radius-sm); margin-bottom: 22px; border: 1px solid var(--border); }
.tab { border: 0; background: transparent; padding: 10px 6px; border-radius: calc(var(--radius-sm) - 3px); font-weight: 700; cursor: pointer; color: var(--muted); white-space: nowrap; }
.tab.active { background: var(--surface); color: var(--text); }
.auth-form { display: grid; gap: 15px; }
.form-row-end { display: flex; justify-content: flex-end; margin-top: -8px; font-size: 13.5px; }
.auth-foot { margin: 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.view-head { display: grid; gap: 6px; margin-bottom: 2px; }
.view-head .back { justify-self: start; font-size: 13.5px; text-decoration: none; }
.view-head h2 { font-size: 24px; letter-spacing: -.02em; }
.view-head p { margin: 0; font-size: 14px; }
.methods { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.method { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-weight: 500; background: var(--surface); }
.method input { position: absolute; opacity: 0; pointer-events: none; }
.method-ico { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); font-size: 18px; flex: none; }
.method-text { display: grid; gap: 1px; }
.method-text b { font-size: 14.5px; }
.method-text small { color: var(--muted); font-size: 12.5px; }
.method:has(input:checked) { background: var(--selected); }
.method:has(input:focus-visible) { outline: 3px solid var(--focus, var(--primary)); outline-offset: 2px; }
.code-input { font-family: var(--font-mono); font-size: 17px !important; letter-spacing: .08em; text-transform: uppercase; }
.auth-done { display: grid; gap: 12px; text-align: center; justify-items: center; padding: 8px 0 2px; }
.auth-done h2 { font-size: 23px; letter-spacing: -.02em; }
.auth-done p { margin: 0 0 6px; color: var(--muted); line-height: 1.55; }
.done-ico { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; font-size: 34px; background: var(--surface-2); }
.captcha:empty { display: none; }
.captcha { display: flex; justify-content: center; min-height: 0; }
.captcha.captcha-error { font-size: 13px; color: var(--danger); font-weight: 600; text-align: center; padding: 8px 10px; border-radius: var(--radius-sm); background: #fff0f0; }

.lp-band { display: none; }
.lp-section { padding: 72px clamp(16px, 5vw, 64px); }
.lp-h2 { font-size: clamp(28px, 3.6vw, 44px); letter-spacing: -.03em; line-height: 1.08; text-align: center; }
.lp-lead { text-align: center; color: var(--muted); font-size: 17px; max-width: 40em; margin: 14px auto 0; }
.lp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 40px auto 0; max-width: 1180px; }
.lp-card { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.lp-card h3 { font-size: 19px; margin: 14px 0 8px; letter-spacing: -.01em; }
.lp-card p { margin: 0; color: var(--muted); line-height: 1.55; }
.lp-ico { width: 52px; height: 52px; display: grid; place-items: center; font-size: 25px; border-radius: 14px; background: var(--surface-2); }
.lp-steps-list { list-style: none; padding: 0; margin: 40px auto 0; max-width: 1180px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.lp-steps-list li { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.lp-steps-list b { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-size: 20px; }
.lp-steps-list h3 { margin: 14px 0 6px; font-size: 19px; }
.lp-steps-list p { margin: 0; color: var(--muted); }
.lp-steps-cta { display: flex; justify-content: center; margin-top: 32px; }
.faq-list { max-width: 820px; margin: 36px auto 0; display: grid; gap: 12px; }
.faq-list details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.faq-list summary { cursor: pointer; padding: 18px 22px; font-weight: 800; font-size: 16.5px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font-size: 22px; line-height: 1; transition: transform .2s; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { margin: 0; padding: 0 22px 20px; color: var(--muted); line-height: 1.6; }
.lp-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding: 28px clamp(16px, 5vw, 64px); margin-top: auto; }
.lp-footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.lp-footer-links .link-btn { text-decoration: none; }
.lp-footer small { margin-left: auto; }
.hl { padding: 0 .12em; }

/* ======================================================================
   Application
   ====================================================================== */
.app { height: 100dvh; display: grid; grid-template-columns: var(--sidebar-w, 248px) var(--list-w, 390px) minmax(0, 1fr); overflow: hidden; }
.sidebar { background: var(--sidebar-bg); padding: 20px 14px; display: flex; flex-direction: column; gap: 16px; min-height: 0; overflow-y: auto; }
.sidebar .brand { padding: 0 8px; }
.btn-compose { padding: 13px; }
.folders { display: grid; gap: 4px; }
.folders a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--sidebar-muted, var(--muted)); font-weight: 700; transition: background .15s, color .15s; }
.folders a:hover { background: var(--sidebar-hover, var(--surface-2)); color: var(--text); }
.folders a.active { background: var(--sidebar-active-bg, var(--selected)); color: var(--text); }
.folders a span { flex: 1; }
.folders .admin-link { margin-top: 10px; }
.count { font-size: 12px; min-width: 22px; padding: 1px 7px; border-radius: 999px; text-align: center; background: var(--count-bg, var(--primary)); color: var(--count-text, #fff); font-style: normal; }
.count:empty { display: none; }
.side-help { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: none; cursor: pointer; font-weight: 700; color: var(--sidebar-muted, var(--muted)); border-radius: var(--radius-sm); text-align: left; }
.side-help:hover { background: var(--sidebar-hover); color: var(--text); }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius); background: var(--me-bg, var(--surface-2)); }
.me-info { min-width: 0; flex: 1; display: grid; }
.me-info strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-info span { font-size: 11.5px; color: var(--sidebar-muted, var(--muted)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 38px; height: 38px; border-radius: var(--avatar-radius, 50%); display: grid; place-items: center; flex: none; font-weight: 700; font-size: 13.5px; color: #111; background: hsl(var(--h, 250) var(--av-s, 65%) var(--av-l, 55%)); letter-spacing: .02em; }
.avatar.big { width: 58px; height: 58px; font-size: 19px; }

.list-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--list-bg, var(--surface)); }
.list-header { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px; flex-wrap: wrap; }
.list-header h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { order: 3; flex-basis: 100%; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--input-bg, var(--surface)); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted); }
.search input { border: 0 !important; background: transparent !important; padding: 10px 0 !important; box-shadow: none !important; }
.sec-banner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 6px 10px; margin: 0 12px 10px; padding: 10px 8px 12px 12px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; }
.sec-banner p { margin: 2px 0 0; line-height: 1.4; overflow-wrap: anywhere; }
.sec-banner-ico { font-size: 20px; line-height: 1.2; }
#sec-banner-go { grid-column: 2; grid-row: 2; justify-self: start; }
#sec-banner-close { grid-column: 3; grid-row: 1; width: 30px; height: 30px; }
.list-toolbar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: 12.5px; }
.message-list { list-style: none; margin: 0; padding: 4px 8px 16px; overflow-y: auto; flex: 1; }
.msg { display: flex; gap: 12px; padding: 12px; border-radius: var(--radius-sm); cursor: pointer; position: relative; transition: background .12s; border: 1px solid transparent; margin-bottom: 6px; }
.msg:hover { background: var(--hover); }
.msg.selected { background: var(--selected); }
.msg-main { min-width: 0; flex: 1; }
.msg-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.msg-from { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.msg time { font-size: 12px; color: var(--muted); flex: none; }
.msg-subject { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.msg-preview { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.msg.unread .msg-from, .msg.unread .msg-subject { font-weight: 750; }
.msg.unread::before { content: ""; position: absolute; left: 2px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--unread-dot, var(--primary)); }
.msg .avatar { width: 40px; height: 40px; }
.star { align-self: center; background: none; border: 0; padding: 4px; cursor: pointer; color: var(--muted); opacity: .45; border-radius: 6px; }
.msg:hover .star, .star.on { opacity: 1; }
.star.on { color: var(--star); }
.star.on .ico { fill: currentColor; }
.list-empty { text-align: center; padding: 60px 20px; color: var(--muted); display: grid; justify-items: center; gap: 14px; }
.list-loading { display: grid; gap: 10px; padding: 12px; }
.list-loading span { height: 62px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface-2), var(--hover), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.read-pane { min-height: 0; min-width: 0; overflow-y: auto; background: var(--reader-bg, var(--bg)); }
.empty-state { height: 100%; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--muted); }
.empty-illu { width: 96px; height: 96px; border-radius: 28px; background: var(--illu-bg, var(--surface-2)); position: relative; }
.empty-illu::before { content: ""; position: absolute; inset: 24px; background: var(--illu-fg, var(--muted)); -webkit-mask: var(--envelope) center/contain no-repeat; mask: var(--envelope) center/contain no-repeat; }
.empty-illu.small { width: 64px; height: 64px; border-radius: 20px; }
.empty-illu.small::before { inset: 16px; }
.reader { max-width: 900px; margin: 0 auto; padding: 18px clamp(16px, 3vw, 40px) 60px; }
.reader-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; position: sticky; top: 0; padding: 8px 0 12px; background: var(--reader-bg, var(--bg)); z-index: 2; }
.reader-subject { font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -.025em; line-height: 1.2; margin: 12px 0 18px; word-break: break-word; }
.reader-meta { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); }
.reader-meta .avatar { width: 46px; height: 46px; font-size: 15px; }
.meta-text { flex: 1; min-width: 0; }
.meta-text > div { overflow: hidden; text-overflow: ellipsis; }
.reader-body { margin-top: 18px; padding: 24px 26px; background: var(--surface); border-radius: var(--radius); white-space: pre-wrap; word-wrap: break-word; font-size: 15.5px; line-height: 1.65; }
.reader-html { margin-top: 18px; width: 100%; border-radius: var(--radius); background: #fff; }
.remote-note { margin: 14px 0 0; font-size: 13px; padding: 8px 12px; border-radius: var(--radius-sm); }
.attachments { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.att { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface); text-decoration: none; color: var(--text); max-width: 280px; }
.att span { display: grid; min-width: 0; }
.att strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att small { color: var(--muted); }

/* ======================================================================
   Administration
   ====================================================================== */
.app.admin-mode .list-pane, .app.admin-mode .read-pane { display: none; }
.admin-pane { grid-column: 2 / 4; min-height: 0; min-width: 0; overflow-y: auto; display: flex; flex-direction: column; background: var(--bg); }
.admin-head { display: flex; align-items: center; gap: 12px; padding: 18px 24px 8px; }
.admin-head h2 { font-size: 24px; letter-spacing: -.01em; text-transform: uppercase; }
.admin-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.3fr); gap: 12px; padding: 10px 24px; }
.stat { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); }
.stat-ico { grid-row: span 3; font-size: 22px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); }
.stat b { font-size: 24px; line-height: 1.1; }
.stat span:not(.stat-ico) { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.stat small { font-size: 11.5px; color: var(--muted); }
.stat.sys { grid-template-columns: auto 1fr; }
.sys-line { font-size: 12.5px !important; font-weight: 700 !important; display: flex; align-items: center; gap: 6px; color: var(--text) !important; }
.sys-line::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex: none; }
.sys-line.on::before { background: var(--ok); }
.admin-tabs { display: flex; gap: 6px; padding: 10px 24px 0; flex-wrap: wrap; }
.atab { border: 1px solid var(--border); background: var(--surface); padding: 9px 16px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.atab.active { background: var(--selected); }
.admin-body { flex: 1; min-height: 0; padding: 0 24px 24px; }
.adm-split { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; border-radius: 0 var(--radius) var(--radius) var(--radius); }
.adm-list, .adm-detail, .adm-audit, .adm-settings { min-width: 0; }
.adm-list { display: flex; flex-direction: column; border-radius: 0 0 var(--radius) var(--radius); background: var(--surface); max-height: calc(100dvh - 250px); }
.adm-toolbar { padding: 12px; display: flex; gap: 10px; align-items: center; }
.adm-toolbar .search { order: 0; flex: 1; }
.seg { display: inline-flex; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.seg button { border: 0; background: var(--surface); padding: 7px 12px; font-weight: 700; cursor: pointer; font-size: 13px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--selected); }
.adm-items { list-style: none; margin: 0; padding: 0 10px 10px; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; }
.adm-items > li { min-width: 0; }
.adm-empty { text-align: center; color: var(--muted); padding: 30px 10px; font-weight: 600; }
.t-row, .u-row { padding: 12px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent; background: var(--surface); }
.t-row:hover, .u-row:hover { background: var(--hover); }
.t-row.selected, .u-row.selected { background: var(--selected); }
.t-row.resolved { opacity: .7; }
.t-top { display: flex; align-items: center; gap: 8px; }
.t-top time { margin-left: auto; font-size: 12px; color: var(--muted); }
.t-subj { font-weight: 700; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-from { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-row { display: flex; align-items: center; gap: 10px; }
.u-row.disabled { opacity: .65; }
.u-main { min-width: 0; flex: 1; display: grid; }
.u-main b, .u-main span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-main span { font-size: 12px; color: var(--muted); }
.u-chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.adm-detail { border-radius: var(--radius); background: var(--surface); padding: 20px 22px; max-height: calc(100dvh - 210px); overflow-y: auto; }
.adm-placeholder { height: 100%; min-height: 260px; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted); font-weight: 600; }
.adm-placeholder span { font-size: 40px; }
.adm-back { display: none; margin-bottom: 10px; text-decoration: none; }
.t-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.t-head h3 { font-size: 20px; letter-spacing: -.01em; }
.t-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 10px 0 14px; font-size: 13.5px; color: var(--muted); }
.t-account { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); flex-wrap: wrap; }
.t-acc-main { display: grid; min-width: 0; flex: 1; }
.t-acc-main small { color: var(--muted); font-size: 12px; }
.t-acc-main .mono { font-size: 12.5px; }
.t-acc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-warn { font-size: 13px; padding: 10px 12px; border-radius: var(--radius-sm); background: #fff6d6; margin: 12px 0 0; line-height: 1.5; }
.t-thread { display: grid; gap: 12px; margin: 18px 0; }
.bubble { padding: 12px 14px; border-radius: var(--radius); max-width: 92%; }
.bubble.from-user { background: var(--surface-2); justify-self: start; }
.bubble.from-staff { background: #e9f9ff; justify-self: end; }
.bubble.note { background: #fff6d6; justify-self: stretch; max-width: none; font-size: 13.5px; }
.b-head { display: flex; gap: 10px; justify-content: space-between; font-size: 12.5px; margin-bottom: 6px; }
.b-head time { color: var(--muted); }
.b-body { white-space: pre-wrap; word-wrap: break-word; line-height: 1.55; }
.t-reply { display: grid; gap: 10px; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.u-head { display: flex; align-items: center; gap: 14px; }
.u-head h3 { font-size: 21px; }
.u-head .mono { font-size: 13px; color: var(--muted); }
.u-head .u-chips { justify-content: flex-start; margin-top: 6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 16px 0; }
.facts div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.facts dt { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 3px 0 0; font-weight: 600; font-size: 13.5px; word-break: break-word; }
.ok-mark { color: var(--ok); font-weight: 700; } .warn-mark { color: var(--danger); font-weight: 700; }
.u-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.role-select { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.role-select select { width: auto; padding: 6px 34px 6px 10px; }
.reset-link { margin-top: 12px; padding: 12px; border-radius: var(--radius-sm); background: #e9f9ff; font-size: 13.5px; }
.reset-link p { margin: 0 0 8px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-size: 12.5px !important; }
.adm-h4 { margin: 22px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mini-tickets { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.mini-tickets li { display: flex; align-items: center; gap: 10px; }
.adm-audit, .adm-settings { border-radius: 0 var(--radius) var(--radius) var(--radius); background: var(--surface); padding: 6px 6px 10px; }
.adm-settings { display: grid; gap: 14px; padding: 16px; }
.table-wrap { overflow-x: auto; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.adm-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; white-space: nowrap; }
.adm-table td { padding: 9px 10px; border-top: 1px solid var(--line, #eee); vertical-align: top; }
.adm-table tr.bad td { background: #fff3f1; }
.adm-table .ev { white-space: nowrap; font-weight: 700; }
.sys-list { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 8px; }
.sys-list li { display: grid; grid-template-columns: auto minmax(0, 220px) 1fr; align-items: center; gap: 10px; font-size: 14px; }
.sys-list .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.sys-list li.on .dot { background: var(--ok); }
.sys-list small { grid-column: 2 / -1; color: var(--muted); font-size: 12.5px; margin-top: -4px; }
.roles-help { margin: 4px 0 0; padding-left: 0; list-style: none; display: grid; gap: 10px; font-size: 14px; line-height: 1.55; }

/* ======================================================================
   Modales
   ====================================================================== */
.modal-backdrop { position: fixed; inset: 0; background: var(--backdrop, rgba(10, 10, 25, .45)); display: grid; place-items: center; padding: 20px; z-index: 50; backdrop-filter: blur(3px); animation: fade .15s; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal { width: min(720px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-lg); animation: pop .18s; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 14px 22px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 18px 22px; overflow-y: auto; display: grid; gap: 14px; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px 12px 22px; }
.compose-fields { display: grid; }
.compose-fields .row { display: flex; align-items: center; gap: 10px; padding: 0 22px; font-weight: 600; }
.compose-fields .row span { width: 46px; flex: none; font-size: 13.5px; }
.compose-fields input { border: 0 !important; background: transparent !important; border-radius: 0 !important; padding: 13px 0 !important; box-shadow: none !important; }
.compose textarea { border: 0 !important; border-radius: 0 !important; background: transparent !important; min-height: 300px; flex: 1; resize: none; padding: 18px 22px !important; line-height: 1.6; box-shadow: none !important; }
.compose-fields input:focus-visible, .compose textarea:focus-visible, .addr-field input:focus-visible, .pw-field input:focus-visible, .search input:focus-visible { outline: none; }
.compose-atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 22px; }
.compose-atts:not(:empty) { padding-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }
.chip small { color: var(--muted); }
.chip button { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; padding: 0 6px; color: var(--muted); }

.settings { width: min(640px, 100%); }
.stabs { display: flex; gap: 6px; padding: 12px 22px 0; }
.stab { border: 0; background: none; padding: 9px 14px; font-weight: 700; cursor: pointer; border-radius: var(--radius-sm) var(--radius-sm) 0 0; display: flex; align-items: center; gap: 6px; color: var(--muted); }
.stab.active { color: var(--text); }
.warn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.settings-body { overflow-y: auto; padding: 18px 22px 24px; display: grid; gap: 14px; }
.settings-body > div { display: grid; gap: 14px; }
.stack { display: grid; gap: 12px; }
.stack .btn { justify-self: start; }
.sec-card { padding: 16px; border-radius: var(--radius); background: var(--surface); display: grid; gap: 12px; }
.sec-head { display: flex; align-items: flex-start; gap: 12px; }
.sec-head > div { flex: 1; min-width: 0; }
.sec-head h4 { font-size: 15.5px; }
.sec-head p { margin: 2px 0 0; }
.sec-ico { width: 40px; height: 40px; display: grid; place-items: center; font-size: 19px; border-radius: 12px; background: var(--surface-2); flex: none; }
.sec-form { display: grid; gap: 10px; }
.sec-form.inline { grid-template-columns: 1fr auto; }
.activity { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.activity li { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; font-size: 13.5px; }
.activity li + li { border-top: 1px dashed var(--line, #ddd); }
.activity li.bad b { color: var(--danger); }
.act-ico { width: 28px; text-align: center; font-size: 16px; flex: none; }
.act-main { flex: 1; min-width: 0; display: grid; }
.act-main small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.by-support { font-style: normal; font-size: 11.5px; padding: 1px 6px; border-radius: 6px; background: #d9e6ff; margin-left: 4px; }
.danger-zone { padding: 14px 16px; border-radius: var(--radius); }
.danger-zone summary { cursor: pointer; color: var(--danger); font-weight: 700; font-size: 14px; }
.danger-zone form { padding-top: 12px; }

.support-box { width: min(620px, 100%); }
.support-intro { margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13.5px; line-height: 1.5; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.support-done { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 34px 26px 30px; }
.support-done p { margin: 0 0 8px; color: var(--muted); max-width: 30em; line-height: 1.55; }
.codebox { width: min(520px, 100%); }
.code-display { font-family: var(--font-mono); font-size: clamp(20px, 5vw, 27px); font-weight: 700; letter-spacing: .06em; text-align: center; padding: 18px 10px; border-radius: var(--radius); user-select: all; word-break: break-all; }
.code-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; padding: 12px 20px; border-radius: var(--radius-sm); font-weight: 600; animation: pop .2s; max-width: calc(100% - 32px); }

.only-mobile { display: none; }

/* ======================================================================
   Responsive
   ====================================================================== */
@media (max-width: 1180px) {
  .app { grid-template-columns: var(--sidebar-w, 230px) var(--list-w-md, 340px) minmax(0, 1fr); }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat.sys { grid-column: 1 / -1; grid-template-columns: auto repeat(3, auto); justify-content: start; gap: 6px 16px; }
  .stat.sys .stat-ico { grid-row: auto; }
}
@media (max-width: 900px) {
  .lp-grid, .lp-steps-list { grid-template-columns: 1fr; }
  .lp-section { padding: 52px 16px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .only-mobile { display: inline-grid; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40; transform: translateX(-100%); visibility: hidden; transition: transform .22s, visibility .22s; }
  body.menu-open .sidebar { transform: none; visibility: visible; }
  body.menu-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }
  .read-pane { position: fixed; inset: 0; z-index: 20; transform: translateX(100%); transition: transform .22s; background: var(--reader-solid, var(--bg)); }
  body.reading .read-pane { transform: none; }
  .reader-toolbar .btn span { display: none; }
  .reader-body { padding: 18px; }
  .reader-meta { flex-wrap: wrap; align-items: flex-start; }
  .reader-meta time { flex-basis: 100%; padding-left: 60px; margin-top: -6px; }
  .meta-text > div { white-space: nowrap; }
  .admin-pane { grid-column: 1; }
  .admin-head { padding: 14px 16px 6px; }
  .admin-stats, .admin-tabs { padding-left: 16px; padding-right: 16px; }
  .admin-head h2 { font-size: 20px; }
  #admin-role { display: none; }
  .admin-stats { gap: 10px; }
  .stat { padding: 10px 12px; grid-template-columns: 1fr; }
  .stat-ico { display: none; }
  .stat b { font-size: 21px; }
  .stat small { display: none; }
  .stat.sys { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
  .admin-tabs { flex-wrap: nowrap; gap: 4px; overflow-x: auto; }
  .atab { padding: 8px 10px; font-size: 14px; flex: none; }
  .admin-body { padding: 0 16px 16px; }
  .adm-split { grid-template-columns: minmax(0, 1fr); }
  .adm-split.has-detail .adm-list { display: none; }
  .adm-split:not(.has-detail) .adm-detail { display: none; }
  .adm-back { display: inline-block; }
  .adm-list, .adm-detail { max-height: none; }
  .modal-backdrop { padding: 0; place-items: stretch; }
  .modal { max-height: 100dvh; height: 100dvh; border-radius: 0 !important; width: 100%; }
  .grid2 { grid-template-columns: 1fr; }
  .sec-form.inline { grid-template-columns: 1fr; }
  #draft-status { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
