:root {
  --brand: #a61d90;
  --brand-dark: #7f166f;
  --ink: #1f2430;
  --muted: #667085;
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e4e7ec;
  --ok: #147a4b;
  --warn: #9a6700;
  --danger: #b42318;
  --shadow: 0 12px 35px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #faf7fb 0, var(--bg) 260px);
}
a { color: var(--brand); }
.shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 56px; }
.shell.narrow { width: min(760px, calc(100% - 28px)); }
.brandbar { height: 6px; background: var(--brand); }
.header { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom:24px; }
.eyebrow { color:var(--brand); font-size:13px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
h1 { font-size:clamp(28px, 5vw, 42px); line-height:1.05; margin:7px 0 8px; letter-spacing:-.03em; }
h2 { margin:0 0 14px; font-size:21px; }
p.lead { margin:0; color:var(--muted); max-width:720px; line-height:1.55; }
.card { background:var(--card); border:1px solid rgba(16,24,40,.06); border-radius:20px; box-shadow:var(--shadow); padding:28px; }
.card + .card { margin-top:20px; }
.grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.field.full { grid-column:1 / -1; }
label { display:block; font-size:14px; font-weight:700; margin:0 0 7px; }
input, select, textarea {
  width:100%; min-height:48px; border:1px solid #d0d5dd; border-radius:11px; padding:11px 13px;
  font:inherit; color:var(--ink); background:#fff; outline:none; transition:.15s border,.15s box-shadow;
}
textarea { min-height:125px; resize:vertical; }
input:focus, select:focus, textarea:focus { border-color:var(--brand); box-shadow:0 0 0 4px rgba(166,29,144,.11); }
.help { color:var(--muted); font-size:12px; margin-top:6px; line-height:1.4; }
.product-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.product-option { display:flex; align-items:center; gap:10px; min-height:50px; margin:0; padding:11px 13px; border:1px solid #d0d5dd; border-radius:12px; background:#fff; cursor:pointer; font-weight:700; transition:.15s border,.15s background,.15s box-shadow; }
.product-option:hover { border-color:#b6bac3; background:#fcfcfd; }
.product-option:has(input:checked) { border-color:var(--brand); background:rgba(166,29,144,.055); box-shadow:0 0 0 3px rgba(166,29,144,.08); }
.product-option input { width:19px; height:19px; min-height:auto; margin:0; padding:0; accent-color:var(--brand); flex:0 0 auto; }
.product-option span { line-height:1.25; }

.actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:22px; }
.btn { min-height:48px; border:0; border-radius:12px; padding:0 18px; display:inline-flex; align-items:center; justify-content:center; gap:8px; font-weight:800; text-decoration:none; cursor:pointer; font-size:15px; }
.btn-primary { color:#fff; background:var(--brand); }
.btn-primary:hover { background:var(--brand-dark); }
.btn-secondary { color:var(--ink); background:#f2f4f7; border:1px solid var(--line); }
.btn-whatsapp { color:#fff; background:#1f9d55; }
.btn-sms { color:#fff; background:#344054; }
.alert { border-radius:12px; padding:13px 15px; margin:0 0 18px; font-size:14px; line-height:1.45; }
.alert-error { background:#fef3f2; color:var(--danger); border:1px solid #fecdca; }
.alert-ok { background:#ecfdf3; color:var(--ok); border:1px solid #abefc6; }
.alert-warn { background:#fffaeb; color:var(--warn); border:1px solid #fedf89; }
.signature-wrap { border:1px solid #d0d5dd; border-radius:13px; overflow:hidden; background:#fff; }
#signatureCanvas { display:block; width:100%; height:220px; touch-action:none; cursor:crosshair; background:#fff; }
.signature-tools { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px 12px; border-top:1px solid var(--line); background:#fafafa; }
.linkbox { display:flex; gap:10px; margin-top:16px; }
.linkbox input { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:13px; }
.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:14px; }
table { width:100%; border-collapse:collapse; min-width:820px; }
th,td { padding:12px 14px; border-bottom:1px solid var(--line); text-align:left; font-size:13px; vertical-align:top; }
th { background:#f9fafb; color:#475467; font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
.badge { display:inline-flex; border-radius:999px; padding:5px 9px; font-size:11px; font-weight:800; }
.badge-pending { background:#fffaeb; color:#9a6700; }
.badge-received { background:#ecfdf3; color:#147a4b; }
.badge-expired,.badge-cancelled { background:#f2f4f7; color:#475467; }
.badge-manual { background:#f4ebff; color:#6941c6; }
.topnav { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.topnav-form { margin:0; }
.small { font-size:13px; color:var(--muted); }
.footer { margin-top:22px; color:var(--muted); font-size:12px; text-align:center; }
.confirmation-reference { margin:4px 0 6px; font-size:32px; line-height:1.2; letter-spacing:-.02em; }
.confirmation-reference-help { margin:0 0 18px; font-size:16px; line-height:1.5; color:var(--ink); }

@media (max-width: 720px) {
  .shell { width:min(100% - 22px, 1080px); padding-top:24px; }
  .grid { grid-template-columns:1fr; }
  .support-create-grid { grid-template-columns:1fr; }
  .product-options { grid-template-columns:1fr; }
  .field.full { grid-column:auto; }
  .card { padding:20px; border-radius:16px; }
  .header { flex-direction:column; }
  .actions .btn { width:100%; }
  .linkbox { flex-direction:column; }
  #signatureCanvas { height:190px; }
}


/* Creación de enlaces de soporte por teléfono o email */
.support-create-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; align-items:stretch; }
.support-create-panel { display:flex; flex-direction:column; min-width:0; padding:18px; border:1px solid var(--line); border-radius:14px; background:#fafafa; }
.support-create-panel .field { flex:1 1 auto; }
.support-create-actions { margin-top:18px; }
.support-create-actions .btn { flex:1 1 160px; }

/* Gestión de solicitudes */
.shell-wide { width:min(1440px, calc(100% - 32px)); }
.results-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:16px; }
.search-form { display:flex; gap:10px; align-items:flex-end; margin:0 0 18px; }
.search-input-wrap { flex:1 1 420px; }
.list-filter-check { display:inline-flex; align-items:center; gap:9px; min-height:44px; padding:0 2px; margin:0 0 18px; color:var(--ink); font-size:13px; font-weight:700; cursor:pointer; white-space:nowrap; }
.list-filter-check input[type="checkbox"] { width:18px; height:18px; min-height:18px; margin:0; padding:0; accent-color:var(--brand); box-shadow:none; cursor:pointer; }
.list-filter-check-disabled { opacity:0.62; cursor:not-allowed; }
.list-filter-check-disabled input[type="checkbox"] { cursor:not-allowed; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.requests-table th:last-child, .requests-table td:last-child { width:1%; min-width:140px; max-width:160px; white-space:normal; overflow-wrap:anywhere; }
.btn-small { min-height:34px; padding:0 10px; border-radius:9px; font-size:12px; }
.btn-danger { color:#fff; background:#b42318; }
.btn-danger:hover { background:#912018; }
.btn-accepted { color:#166534; background:#dcfce7; border:1px solid #bbf7d0; }
.btn-accepted:hover { background:#bbf7d0; }
.badge-accepted { background:#dcfce7; color:#166534; }
.badge-unaccepted { background:#fef3c7; color:#92400e; }
.empty-state { padding:18px 4px; color:var(--muted); text-align:center; }
.pagination { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; margin-top:18px; }
.page-link { min-width:38px; min-height:38px; padding:0 10px; display:inline-flex; align-items:center; justify-content:center; border:1px solid var(--line); border-radius:9px; text-decoration:none; color:var(--ink); background:#fff; font-size:13px; font-weight:700; }
.page-link:hover { border-color:#c7a0c0; color:var(--brand); }
.page-link.active { background:var(--brand); color:#fff; border-color:var(--brand); }
.page-dots { color:var(--muted); padding:0 4px; }
.modal-backdrop { position:fixed; inset:0; z-index:2147483000; background:rgba(16,24,40,.62); display:flex; align-items:center; justify-content:center; padding:24px; overflow-y:auto; overscroll-behavior:contain; backdrop-filter:blur(2px); -webkit-backdrop-filter:blur(2px); }
.modal-card { position:relative; width:min(680px, 100%); background:#fff; border:1px solid rgba(16,24,40,.08); border-radius:18px; box-shadow:0 28px 90px rgba(16,24,40,.34); padding:24px; margin:auto; }
.modal-header { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; margin-bottom:18px; }
.modal-header h2 { margin-top:5px; }
.modal-close { border:0; background:#f2f4f7; width:38px; height:38px; border-radius:999px; font-size:26px; line-height:1; cursor:pointer; color:#475467; }
.modal-open { overflow:hidden; }

@media (max-width: 720px) {
  .shell-wide { width:min(100% - 18px, 1440px); }
  .search-form { flex-direction:column; align-items:stretch; }
  .search-input-wrap { flex-basis:auto; }
  .list-filter-check { margin:0; min-height:36px; }
  .modal-card { padding:20px; }
}

/* Filas clicables y acciones dentro del modal */
.requests-table-clickable { min-width:980px; }
.requests-table-clickable tbody .request-row { cursor:pointer; transition:background .14s ease, box-shadow .14s ease; }
.requests-table-clickable tbody .request-row:hover { background:#fcf7fb; }
.requests-table-clickable tbody .request-row:focus { outline:0; background:#fcf7fb; box-shadow:inset 4px 0 0 var(--brand); }
.requests-table-clickable tbody .request-row td:first-child { box-shadow:inset 3px 0 0 transparent; }
.requests-table-clickable tbody .request-row:hover td:first-child { box-shadow:inset 3px 0 0 rgba(166,29,144,.42); }

.modal-card-management { width:min(820px, 100%); max-height:calc(100vh - 48px); overflow:auto; }
.modal-card-ticket-wide { width:min(1540px, calc(100vw - 32px)); }
.ticket-timer-bar { display:flex; align-items:center; gap:14px; margin:2px 0 18px; padding:12px 14px; border-radius:14px; background:#fafafa; }
.ticket-timer-button { width:52px; height:52px; flex:0 0 52px; display:grid; place-items:center; border:0; border-radius:999px; cursor:pointer; transition:transform .12s ease, opacity .12s ease, box-shadow .12s ease; box-shadow:0 1px 3px rgba(16,24,40,.12); }
.ticket-timer-button:hover:not(:disabled) { transform:translateY(-1px); box-shadow:0 3px 8px rgba(16,24,40,.16); }
.ticket-timer-button:disabled { cursor:default; opacity:.55; }
.ticket-timer-play { background:#ecfdf3; }
.ticket-timer-stop { background:#fef3f2; }
.ticket-timer-icon { display:block; width:0; height:0; }
.ticket-timer-play .ticket-timer-icon { margin-left:4px; border-top:10px solid transparent; border-bottom:10px solid transparent; border-left:16px solid #147a4b; }
.ticket-timer-stop .ticket-timer-icon { width:18px; height:18px; background:#b42318; border-radius:2px; }
.ticket-timer-values { display:flex; flex-direction:column; gap:3px; min-width:180px; }
.ticket-timer-value { display:flex; align-items:baseline; gap:10px; }
.ticket-timer-value span { min-width:88px; color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.04em; font-weight:800; }
.ticket-timer-value strong { font-size:18px; line-height:1.25; font-variant-numeric:tabular-nums; white-space:nowrap; }
.ticket-timer-total strong { font-size:14px; color:#475467; }
.ticket-timer-message { flex:1 1 auto; min-width:0; margin:0 0 0 10px; text-align:right; }
.ticket-modal-layout { display:grid; grid-template-columns:minmax(300px,.65fr) minmax(420px,1fr) minmax(260px,.5fr); gap:26px; align-items:stretch; }
.ticket-modal-main, .ticket-modal-comments-column, .ticket-modal-properties-column { min-width:0; }
.ticket-modal-comments-column, .ticket-modal-properties-column { display:flex; min-height:0; }
.ticket-comments-section, .ticket-properties-section { display:flex; flex-direction:column; width:100%; min-height:min(420px, calc(100vh - 335px)); max-height:calc(100vh - 335px); }
.modal-card-ticket-wide .modal-section { border-top:0; padding-top:0; }
.ticket-comments-section h3, .ticket-properties-section h3 { font-size:16px; margin:0 0 10px; }
.modal-status-line { display:flex; flex-wrap:wrap; gap:8px; margin:-4px 0 20px; }
.request-summary-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.summary-item { border:1px solid var(--line); border-radius:12px; padding:12px 14px; background:#fafafa; min-width:0; }
.summary-item span, .summary-detail span { display:block; color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.05em; font-weight:800; margin-bottom:4px; }
.summary-item strong { display:block; font-size:14px; line-height:1.4; overflow-wrap:anywhere; }
.summary-detail { margin-top:10px; border:1px solid var(--line); border-radius:12px; padding:12px 14px; background:#fafafa; font-size:14px; line-height:1.45; }
.summary-detail > div { white-space:pre-wrap; overflow-wrap:anywhere; }
.modal-section { border-top:1px solid var(--line); margin-top:22px; padding-top:20px; }
.modal-section h3 { font-size:16px; margin:0 0 10px; }
.modal-section-help { color:var(--muted); font-size:13px; line-height:1.5; margin:0 0 12px; }
.modal-action-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.modal-action-grid form, .modal-action-grid .btn, #acceptForm .btn, #cancelForm .btn { width:100%; }
.modal-danger-zone { border-top-color:#fecdca; }
.modal-danger-zone h3 { color:var(--danger); }

@media (max-width:720px) {
  .request-summary-grid { grid-template-columns:1fr; }
  .modal-action-grid { grid-template-columns:1fr; }
  .modal-card-management { max-height:calc(100vh - 20px); }
}


/* Formulario público: consentimientos */
.consent-list { display:grid; gap:12px; margin-top:2px; }
.consent-check { display:flex; align-items:flex-start; gap:12px; margin:0; padding:15px 16px; border:1px solid var(--line); border-radius:13px; background:#fafafa; font-weight:400; line-height:1.5; cursor:pointer; }
.consent-check input[type="checkbox"] { width:20px; height:20px; min-height:20px; flex:0 0 20px; margin:2px 0 0; padding:0; accent-color:var(--brand); box-shadow:none; }
.consent-check span { min-width:0; font-size:13px; color:var(--ink); }
.consent-check strong { font-weight:800; }
.consent-check a { color:var(--brand); overflow-wrap:anywhere; }
input[readonly] { background:#f8f9fb; color:#475467; cursor:default; }
.live-search-status { min-height:18px; margin-top:5px; font-size:12px; color:var(--muted); }


/* Botón para limpiar la búsqueda */
.search-control { position:relative; }
.search-control input { padding-right:46px; }
.search-clear { position:absolute; top:50%; right:9px; transform:translateY(-50%); width:30px; height:30px; border:0; border-radius:999px; background:#eef0f3; color:#667085; font-size:21px; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.search-clear:hover, .search-clear:focus-visible { background:#e3e6ea; color:#1f2430; outline:none; }

/* Portal interno: menú principal 3 columnas x 3 filas; tamaños adaptados a la ventana. */
.portal-shell { width:min(1250px, calc(100% - 32px)); padding-top:clamp(20px,3vh,32px); padding-bottom:clamp(16px,3vh,28px); }
.portal-shell .header { margin-bottom:clamp(12px,2vh,20px); }
.portal-shell .footer { margin-top:clamp(10px,1.5vh,20px); }
.portal-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:clamp(8px,1.8vh,18px); margin-top:6px; }
.portal-tile { min-width:0; height:clamp(88px,calc((100dvh - 295px) / 3),176px); border-radius:18px; background:#fff; border:1px solid var(--line); box-shadow:0 14px 38px rgba(16,24,40,.08); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; text-align:center; padding:clamp(10px,1.4vw,20px); text-decoration:none; color:var(--ink); transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
a.portal-tile:hover, a.portal-tile:focus-visible { transform:translateY(-2px); border-color:rgba(166,29,144,.45); box-shadow:0 18px 46px rgba(16,24,40,.13); outline:none; }
.portal-tile span { max-width:100%; font-size:clamp(14px,1.6vw,21px); line-height:1.2; font-weight:900; letter-spacing:.015em; overflow-wrap:anywhere; }
.portal-tile small { font-size:12px; color:#98a2b3; font-weight:700; }
.portal-tile-disabled { background:#eaecf0; border-color:#d0d5dd; color:#98a2b3; box-shadow:none; cursor:not-allowed; }
.portal-tile-placeholder { cursor:default; }

.config-layout { display:grid; grid-template-columns:minmax(320px,.85fr) minmax(520px,1.35fr); gap:20px; align-items:start; }
.section-title-row { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; }
.form-subtitle { margin:22px 0 10px; font-size:16px; }
.permission-grid { display:grid; gap:10px; }
.permission-option { display:flex; align-items:flex-start; gap:11px; padding:13px 14px; border:1px solid var(--line); border-radius:12px; background:#fafafa; cursor:pointer; margin:0; }
.permission-option input { width:20px; height:20px; min-height:20px; flex:0 0 20px; margin:1px 0 0; padding:0; accent-color:var(--brand); }
.permission-option span { display:flex; flex-direction:column; gap:3px; min-width:0; }
.permission-option strong { font-size:13px; }
.permission-option small { color:var(--muted); font-size:12px; line-height:1.4; }
.permission-help { margin-top:10px; }
.switch-line { display:flex; align-items:center; gap:10px; cursor:pointer; margin:0; }
.switch-line input { width:20px; height:20px; min-height:20px; margin:0; padding:0; accent-color:var(--brand); }
.users-table { min-width:700px; }
code { background:#f2f4f7; border-radius:6px; padding:1px 5px; font-size:.9em; }

@media (max-width:900px) {
  .config-layout { grid-template-columns:1fr; }
}
@media (max-width:720px) {
  /* Mantener las tres columnas también en pantallas estrechas. */
  .portal-shell { width:calc(100% - 22px); padding-top:16px; padding-bottom:16px; }
  .portal-shell .header { gap:10px; margin-bottom:12px; }
  .portal-shell .topnav { gap:8px; }
  .portal-shell .topnav .btn { min-height:40px; padding:0 12px; font-size:13px; }
  .portal-shell .small { margin:4px 0; }
  .portal-grid { gap:clamp(6px,1.6vw,12px); }
  .portal-tile { height:clamp(78px,calc((100dvh - 350px) / 3),122px); padding:clamp(6px,1.5vw,10px); border-radius:14px; gap:4px; }
  .portal-tile span { font-size:clamp(11px,2.8vw,16px); letter-spacing:0; }
  .portal-tile small { font-size:10px; }
}



/* Avisos de solicitudes pendientes de aceptar */
.results-actions { display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-end; }
.notification-toggle-active { border-color:#86c9a7; background:#ecfdf3; color:#147a4b; }
#notificationPermissionButton:disabled { opacity:.5; cursor:not-allowed; }
.support-notification-toast { position:fixed; right:24px; bottom:24px; z-index:2147482500; width:min(390px, calc(100% - 32px)); padding:16px 18px; border:1px solid rgba(166,29,144,.25); border-radius:15px; background:#fff; box-shadow:0 20px 60px rgba(16,24,40,.22); }
.support-notification-toast strong { display:block; font-size:14px; margin-bottom:4px; color:var(--ink); }
.support-notification-toast span { display:block; color:var(--muted); font-size:13px; line-height:1.45; }
@media (max-width:720px) {
  .results-header { flex-direction:column; }
  .results-actions { width:100%; }
  .results-actions .btn { flex:1 1 180px; }
  .support-notification-toast { right:16px; bottom:16px; }
}


/* Soporte SAT */
.tickets-table { min-width: 1080px; }
.tickets-table th:nth-child(1), .tickets-table td:nth-child(1),
.tickets-table th:nth-child(2), .tickets-table td:nth-child(2) { width: 1%; white-space: nowrap; }
.tickets-table th:nth-child(6), .tickets-table td:nth-child(6),
.tickets-table th:nth-child(7), .tickets-table td:nth-child(7) { width: 1%; white-space: nowrap; }
.tickets-table-clickable tbody .ticket-row { cursor:pointer; transition:background .14s ease, box-shadow .14s ease; }
.tickets-table-clickable tbody .ticket-row:hover { background:#fcf7fb; }
.tickets-table-clickable tbody .ticket-row:focus { outline:0; background:#fcf7fb; box-shadow:inset 4px 0 0 var(--brand); }
.tickets-table-clickable tbody .ticket-row td:first-child { box-shadow:inset 3px 0 0 transparent; }
.tickets-table-clickable tbody .ticket-row:hover td:first-child { box-shadow:inset 3px 0 0 rgba(166,29,144,.42); }
.badge-ticket-open { background:#ecfdf3; color:#147a4b; }
.badge-ticket-in-progress { background:#eff8ff; color:#175cd3; }
.badge-ticket-waiting-customer,
.badge-ticket-waiting-others { background:#fffaeb; color:#9a6700; }
.badge-ticket-finished { background:#f2f4f7; color:#344054; }
.badge-ticket-cancelled { background:#fef3f2; color:#b42318; }

/* Soporte SAT: comentarios y propiedades de ticket */
.ticket-comments-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  gap:6px 14px;
  margin-bottom:10px;
}
.ticket-comments-heading h3 { margin:0; }
.ticket-comments-filter {
  display:inline-flex;
  align-items:center;
  gap:7px;
  cursor:pointer;
  font-size:12px;
  color:var(--muted);
  line-height:1.3;
}
.ticket-comments-filter input { margin:0; width:16px; height:16px; flex:0 0 auto; cursor:pointer; }
.ticket-comments-filter span { display:inline; }

.ticket-comments-list {
  display:grid;
  align-content:start;
  gap:10px;
  flex:1 1 auto;
  min-height:0;
  max-height:none;
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:6px;
  scrollbar-gutter:stable;
}
.ticket-properties-list {
  display:grid;
  align-content:start;
  gap:10px;
  flex:1 1 auto;
  min-height:0;
  max-height:none;
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:6px;
  scrollbar-gutter:stable;
}
.ticket-comment {
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px 14px;
  background:#fafafa;
}
.ticket-comment-meta {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:8px 14px;
  margin-bottom:7px;
  font-size:12px;
}
.ticket-comment-meta strong { color:var(--ink); }
.ticket-comment-meta span { color:var(--muted); }
.ticket-comment-text {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  font-size:14px;
  line-height:1.5;
  max-height:6em;
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:4px;
}
.ticket-property-row {
  display:block;
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px 14px;
  background:#fafafa;
}
.ticket-property-content { min-width:0; flex:1 1 auto; }
.ticket-property-content strong { display:block; margin-bottom:4px; font-size:13px; }
.ticket-property-value { white-space:pre-wrap; overflow-wrap:anywhere; font-size:14px; line-height:1.45; }
.ticket-property-value-empty { color:var(--muted); font-style:italic; }
.ticket-property-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; }
.ticket-inline-form { margin-top:14px; }
.ticket-comments-section > .ticket-inline-form, .ticket-properties-section > .ticket-inline-form { flex:0 0 auto; margin-top:14px; }
#modalTicketComment { min-height:82px; }
.ticket-property-form-grid { display:grid; grid-template-columns:1fr; gap:10px; }
.ticket-property-form-grid input[type="text"],
.ticket-property-form-grid select { min-height:46px; }
.ticket-property-checkbox-field { margin-top:2px; }
.ticket-property-checkbox { display:flex; align-items:center; gap:10px; min-height:46px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:#fafafa; cursor:pointer; }
.ticket-property-checkbox input { width:20px; height:20px; min-height:20px; margin:0; padding:0; accent-color:var(--brand); box-shadow:none; }
.ticket-property-checkbox span { font-weight:700; font-size:14px; }
.ticket-compact-actions { margin-top:12px; }
.ticket-form-message { min-height:20px; margin-top:8px; font-size:12px; line-height:1.4; }
.ticket-form-message-ok { color:var(--ok); }
.ticket-form-message-error { color:var(--danger); }
.ticket-form-message-info { color:var(--muted); }
.ticket-modal-properties-column .ticket-compact-actions { display:grid; grid-template-columns:1fr; gap:8px; }
.ticket-modal-properties-column .ticket-compact-actions .btn { width:100%; }

@media (max-width:1100px) {
  .modal-card-ticket-wide { width:min(920px, calc(100vw - 28px)); }
  .ticket-timer-message { text-align:left; }
  .ticket-modal-layout { grid-template-columns:1fr; gap:22px; }
  .ticket-modal-comments-column, .ticket-modal-properties-column { padding-top:0; }
  .ticket-comments-section, .ticket-properties-section { min-height:0; max-height:none; }
  .ticket-comments-list, .ticket-properties-list { min-height:0; max-height:360px; }
}

@media (max-width:720px) {
  .modal-card-ticket-wide { width:100%; }
  .ticket-timer-bar { align-items:flex-start; flex-wrap:wrap; }
  .ticket-timer-button { width:46px; height:46px; flex-basis:46px; }
  .ticket-timer-values { min-width:0; flex:1 1 190px; }
  .ticket-timer-message { flex-basis:100%; margin-left:0; }
  .ticket-property-row { flex-direction:column; }
  .ticket-property-actions { width:100%; }
  .ticket-property-actions .btn { flex:1 1 0; }
  .ticket-property-form-grid { grid-template-columns:1fr; }
}


/* Soporte SAT 1.3.15+: alineación exacta de búsqueda y producto */
.ticket-filters-form {
  align-items:flex-start;
}
.ticket-filters-form .ticket-product-filter {
  margin-bottom:0;
}
.ticket-filters-form .list-filter-check {
  min-height:48px;
  margin:24px 0 0;
}

/* Soporte SAT 1.3.13+: filtro múltiple de producto, asignación y temporizador en cabecera */
.ticket-product-filter {
  position:relative;
  flex:0 0 min(260px, 28vw);
  min-width:220px;
  margin:0 0 18px;
}
.ticket-assignee-filter {
  flex-basis:min(240px, 26vw);
}
.ticket-search-label {
  display:block;
  margin:0 0 7px;
  font-size:14px;
  font-weight:700;
}
.ticket-product-filter-label {
  display:block;
  margin:0 0 7px;
  font-size:14px;
  font-weight:700;
}
.ticket-product-filter-menu {
  position:relative;
}
.ticket-product-filter-menu > summary {
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:11px 40px 11px 13px;
  border:1px solid #d0d5dd;
  border-radius:11px;
  background:#fff;
  color:var(--ink);
  cursor:pointer;
  list-style:none;
  font-size:14px;
  font-weight:700;
  user-select:none;
}
.ticket-product-filter-menu > summary::-webkit-details-marker { display:none; }
.ticket-product-filter-menu > summary::after {
  content:"";
  position:absolute;
  right:15px;
  top:20px;
  width:8px;
  height:8px;
  border-right:2px solid #667085;
  border-bottom:2px solid #667085;
  transform:rotate(45deg);
  transition:transform .15s ease;
}
.ticket-product-filter-menu[open] > summary {
  border-color:var(--brand);
  box-shadow:0 0 0 4px rgba(166,29,144,.11);
}
.ticket-product-filter-menu[open] > summary::after {
  transform:rotate(225deg);
  top:24px;
}
.ticket-product-filter-panel {
  position:absolute;
  z-index:40;
  top:calc(100% + 7px);
  left:0;
  width:min(360px, calc(100vw - 48px));
  padding:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  box-shadow:0 14px 34px rgba(16,24,40,.16);
}
.ticket-product-filter-options {
  display:grid;
  gap:4px;
  max-height:300px;
  overflow-y:auto;
  overscroll-behavior:contain;
}
.ticket-product-filter-option {
  display:flex;
  align-items:center;
  gap:9px;
  min-height:38px;
  margin:0;
  padding:7px 8px;
  border-radius:9px;
  cursor:pointer;
  font-size:13px;
  font-weight:650;
}
.ticket-product-filter-option:hover { background:#f9fafb; }
.ticket-product-filter-option input {
  width:18px;
  height:18px;
  min-height:18px;
  margin:0;
  padding:0;
  flex:0 0 18px;
  accent-color:var(--brand);
  box-shadow:none;
}
.ticket-product-filter-clear {
  width:100%;
  margin-top:8px;
  padding:9px 10px;
  border:0;
  border-top:1px solid var(--line);
  background:#fff;
  color:var(--brand);
  cursor:pointer;
  font:inherit;
  font-size:12px;
  font-weight:800;
}
.ticket-product-filter-clear:hover { background:#fcf7fb; }

.tickets-table { min-width:1220px; }
.tickets-table th:nth-child(6), .tickets-table td:nth-child(6),
.tickets-table th:nth-child(7), .tickets-table td:nth-child(7),
.tickets-table th:nth-child(8), .tickets-table td:nth-child(8) {
  width:1%;
  white-space:nowrap;
}

.ticket-modal-header {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:center;
  gap:18px;
}
.ticket-modal-heading {
  min-width:0;
  justify-self:start;
}
.ticket-modal-header .modal-close {
  justify-self:end;
}
.ticket-timer-header {
  justify-self:center;
  margin:0;
  padding:8px 12px;
}
.ticket-timer-header .ticket-timer-button {
  width:44px;
  height:44px;
  flex-basis:44px;
}
.ticket-timer-header .ticket-timer-values {
  flex-direction:row;
  align-items:center;
  gap:18px;
  min-width:0;
}
.ticket-timer-header .ticket-timer-value {
  flex-direction:column;
  align-items:flex-start;
  gap:1px;
}
.ticket-timer-header .ticket-timer-value span {
  min-width:0;
}
.ticket-timer-header-message {
  min-height:0;
  margin:-10px 0 12px;
  text-align:center;
}

@media (max-width: 900px) {
  .ticket-modal-header {
    grid-template-columns:minmax(0,1fr) auto;
    align-items:start;
  }
  .ticket-timer-header {
    grid-column:1 / -1;
    grid-row:2;
    justify-self:center;
  }
}

@media (max-width: 720px) {
  .ticket-filters-form {
    align-items:stretch;
  }
  .ticket-filters-form .list-filter-check {
    margin:0;
    min-height:36px;
  }
  .ticket-product-filter {
    flex:1 1 auto;
    width:100%;
    min-width:0;
    margin:0;
  }
  .ticket-product-filter-panel {
    width:100%;
  }
  .ticket-timer-header {
    align-items:center;
    flex-wrap:nowrap;
  }
  .ticket-timer-header .ticket-timer-values {
    flex:1 1 auto;
    gap:12px;
  }
  .ticket-timer-header-message {
    margin:-6px 0 12px;
  }
}


/* Facturación 1.3.19 */
.billing-search-form { align-items:flex-start; }
.billing-search-form .search-input-wrap { max-width:760px; }
.billing-table { min-width:620px; }
.billing-table th, .billing-table td { width:50%; }

/* Facturación 1.3.20 */
.billing-table { min-width:1580px; }
.billing-table th, .billing-table td { width:auto; vertical-align:top; }
.billing-table th:nth-child(1), .billing-table td:nth-child(1),
.billing-table th:nth-child(2), .billing-table td:nth-child(2) { min-width:180px; }
.billing-table th:nth-child(3), .billing-table td:nth-child(3) { min-width:120px; }
.billing-table th:nth-child(4), .billing-table td:nth-child(4),
.billing-table th:nth-child(5), .billing-table td:nth-child(5) { min-width:90px; }
.billing-table th:nth-child(6), .billing-table td:nth-child(6) { min-width:220px; }
.billing-table th:nth-child(7), .billing-table td:nth-child(7) { min-width:125px; white-space:nowrap; }
.billing-table th:nth-child(8), .billing-table td:nth-child(8) { min-width:100px; text-align:center; }
.billing-table th:nth-child(9), .billing-table td:nth-child(9) { min-width:120px; }
.billing-table th:nth-child(10), .billing-table td:nth-child(10) { min-width:205px; }
.billing-primary-value { line-height:1.3; }
.billing-original-value { margin-top:5px; color:var(--muted); font-size:12px; line-height:1.35; }
.billing-number-cell, .billing-duration-cell { white-space:nowrap; }
.billing-number-link { font-weight:800; text-decoration:none; }
.billing-number-link:hover, .billing-number-link:focus-visible { text-decoration:underline; }
.billing-billable-symbol {
    display:inline-block;
    min-width:1.5em;
    font-size:18px;
    line-height:1;
    font-family:"Noto Color Emoji", "Segoe UI Emoji", "Apple Color Emoji", "Twemoji Mozilla", sans-serif;
}

.user-active-symbol {
    display:inline-block;
    min-width:1.5em;
    font-size:18px;
    line-height:1;
    font-family:"Noto Color Emoji", "Segoe UI Emoji", "Apple Color Emoji", "Twemoji Mozilla", sans-serif;
}
.billing-status-select { min-width:190px; width:100%; padding:9px 34px 9px 10px; }
.billing-status-select:disabled { opacity:.65; cursor:wait; }


/* Facturación / Tickets SAT 1.3.21 */
.billing-table { min-width:1260px; }
.billing-table th:nth-child(1), .billing-table td:nth-child(1) { min-width:180px; }
.billing-table th:nth-child(2), .billing-table td:nth-child(2) { min-width:108px; }
.billing-table th:nth-child(3), .billing-table td:nth-child(3) { min-width:102px; }
.billing-table th:nth-child(4), .billing-table td:nth-child(4),
.billing-table th:nth-child(5), .billing-table td:nth-child(5) {
  min-width:58px;
  width:58px;
  max-width:72px;
  text-align:center;
}
.billing-table th:nth-child(6), .billing-table td:nth-child(6) { min-width:187px; }
.billing-table th:nth-child(7), .billing-table td:nth-child(7) { min-width:75px; }
.billing-table th:nth-child(8), .billing-table td:nth-child(8) { min-width:100px; text-align:center; }
.billing-table th:nth-child(9), .billing-table td:nth-child(9) { min-width:120px; }
.billing-table th:nth-child(10), .billing-table td:nth-child(10) { min-width:195px; }
.billing-number-heading { line-height:1.05; white-space:normal; text-align:center; }
.billing-status-select { min-width:180px; }


/* Facturación 1.3.32: modal de Solicitud/Ticket sin abandonar Facturación */
.billing-embedded-modal { padding:18px; }
.billing-embedded-modal-card { width:min(1580px, calc(100vw - 36px)); height:min(920px, calc(100vh - 36px)); display:flex; flex-direction:column; background:#fff; border:1px solid rgba(16,24,40,.08); border-radius:18px; box-shadow:0 28px 90px rgba(16,24,40,.34); overflow:hidden; }
.billing-embedded-modal-header { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding:18px 20px 14px; border-bottom:1px solid var(--line); background:#fff; }
.billing-embedded-modal-header h2 { margin:4px 0 0; }
.billing-embedded-frame { flex:1 1 auto; width:100%; min-height:0; border:0; background:#fff; }

.embedded-modal-page { background:#fff; overflow:auto; }
.embedded-request-page > .brandbar,
.embedded-request-page > main,
.embedded-request-page > .footer { display:none !important; }
.embedded-request-page #manualRequestModal { display:none !important; }
.embedded-ticket-page > .brandbar { display:none !important; }
.embedded-ticket-page > main { width:100%; max-width:none; margin:0; padding:0; }
.embedded-ticket-page > main > :not(#ticketModal) { display:none !important; }
.embedded-request-page #requestModal,
.embedded-ticket-page #ticketModal { position:static; inset:auto; min-height:100vh; padding:14px; overflow:visible; background:#fff; backdrop-filter:none; -webkit-backdrop-filter:none; }
.embedded-request-page #requestModal .modal-card,
.embedded-ticket-page #ticketModal .modal-card { width:100%; max-width:none; max-height:none; margin:0; border:0; box-shadow:none; border-radius:0; }
.embedded-request-page #requestModal .modal-close,
.embedded-ticket-page #ticketModal .modal-close { display:none; }

@media (max-width: 720px) {
  .billing-embedded-modal { padding:8px; }
  .billing-embedded-modal-card { width:calc(100vw - 16px); height:calc(100vh - 16px); }
  .billing-embedded-modal-header { padding:14px 14px 10px; }
  .embedded-request-page #requestModal,
  .embedded-ticket-page #ticketModal { padding:8px; }
}

/* Página pública de autosolicitud de soporte */
.public-support-shell { padding-top:32px; }
.public-support-header { align-items:center; }
.public-login-button { flex:0 0 auto; min-width:104px; }
.public-support-card { margin-top:10px; }
.public-support-copy { margin:0; color:var(--ink); font-size:16px; line-height:1.65; }
.public-support-form { display:flex; align-items:flex-end; gap:12px; margin-top:24px; }
.public-support-phone-field { flex:1 1 auto; min-width:0; }
.public-support-submit { flex:0 0 auto; white-space:nowrap; }
.public-support-poster-section { margin:28px auto 42px; text-align:center; }
.public-support-poster-link { display:inline-block; width:100%; max-width:540px; overflow:hidden; border-radius:18px; background:#111; box-shadow:0 18px 42px rgba(23,31,46,.16); line-height:0; transition:transform .16s ease, box-shadow .16s ease; }
.public-support-poster-link:hover { transform:translateY(-2px); box-shadow:0 22px 48px rgba(23,31,46,.20); }
.public-support-poster-link:focus-visible { outline:3px solid var(--brand); outline-offset:4px; }
.public-support-poster-image { display:block; width:100%; height:auto; }
.public-support-poster-help { margin-top:8px; }

@media (max-width:720px) {
  .public-support-header { flex-direction:row; align-items:flex-start; }
  .public-login-button { margin-left:auto; }
  .public-support-form { flex-direction:column; align-items:stretch; }
  .public-support-submit { width:100%; }
}


/* Facturación 1.3.46: columna Guardia */
.billing-table { min-width:1340px; }
.billing-table th:nth-child(9), .billing-table td:nth-child(9) { min-width:82px; text-align:center; }
.billing-table th:nth-child(10), .billing-table td:nth-child(10) { min-width:120px; }
.billing-table th:nth-child(11), .billing-table td:nth-child(11) { min-width:195px; }
.billing-guardia-cell { font-weight:800; white-space:nowrap; }

/* Facturación 1.3.48: filtros de Facturable, Estado y Facturación */
.billing-search-form { flex-wrap:wrap; }
.billing-search-form .search-input-wrap { flex:1 1 420px; max-width:none; }
.billing-filter-field { flex:0 0 170px; min-width:150px; }
.billing-filter-field-wide { flex-basis:220px; }
.billing-filter-field select { width:100%; min-height:48px; }
@media (max-width:720px) {
  .billing-filter-field,
  .billing-filter-field-wide { width:100%; min-width:0; flex:1 1 auto; }
}

/* Clientes Web v1.3.55: seis datos generales agrupados por usuario (rowspan). */
.web-clients-table { min-width:1180px; }
.web-clients-table thead th { white-space:nowrap; }
.web-clients-table .web-client-group:not(:first-of-type) tr:first-child > * { border-top:2px solid #d0d5dd; }
.web-clients-table .web-client-user { background:#f9f6fa; vertical-align:middle; overflow-wrap:anywhere; }
.web-clients-table th.web-client-user { color:var(--ink); font-size:13px; text-transform:none; letter-spacing:0; }
.web-clients-table td { overflow-wrap:anywhere; }
.badge-web-expired { background:#fef3f2; color:#b42318; }
.badge-web-current { background:#ecfdf3; color:#147a4b; }

/* Confirmación de incidencia existente (administración y autoservicio). */
.duplicate-support-backdrop { z-index:2147483100; }
.duplicate-support-card { width:min(540px, 100%); }
.duplicate-support-card h2 { margin:0 0 18px; }
.duplicate-support-messages p { margin:0 0 10px; font-weight:600; line-height:1.55; color:var(--ink); }
.duplicate-support-question { margin:18px 0 12px; font-weight:700; font-size:17px; }
.duplicate-support-actions { gap:12px; }
.duplicate-support-actions .btn { min-width:100px; }

/* v1.3.67: Gran Cuenta y resolución visible al cliente */
.manual-large-account-option { display:inline-flex; align-items:center; gap:11px; margin:0; padding:10px 14px; border:1px solid var(--line); border-radius:11px; background:#f9fafb; cursor:pointer; }
.manual-large-account-option input[type="checkbox"] { width:20px; height:20px; min-height:20px; margin:0; padding:0; accent-color:var(--brand); }
.ticket-resolution-backdrop { z-index:2147483001; }
.ticket-resolution-card { width:min(620px,100%); }
.ticket-resolution-card .modal-section-help { line-height:1.6; margin-bottom:18px; }
.ticket-resolution-card textarea { min-height:170px; }
.public-ticket-resolution { margin-top:22px; }

/* v1.3.69 - Confirmación pública de resolución */
.resolution-public-shell { padding-bottom:36px; }
.resolution-public-section { margin-bottom:18px; }
.resolution-information-list { margin:16px 0 0; }
.resolution-information-list > div { display:grid; grid-template-columns:minmax(125px,32%) minmax(0,1fr); gap:15px; padding:12px 0; border-bottom:1px solid var(--border, #e4e7eb); }
.resolution-information-list dt { font-weight:700; }
.resolution-information-list dd { margin:0; overflow-wrap:anywhere; white-space:pre-wrap; }
.resolution-long-value dd { line-height:1.6; }
.resolution-confirmation-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:18px; }
.resolution-confirmation-actions .btn { flex:1 1 180px; white-space:normal; }
.resolution-disclaimer p { margin:12px 0; line-height:1.65; }
.billing-confirmation-cell { min-width:125px; white-space:normal; }
@media (max-width:600px) {
  .resolution-information-list > div { grid-template-columns:minmax(0,1fr); gap:4px; }
  .resolution-confirmation-actions { flex-direction:column; }
  .resolution-confirmation-actions .btn { width:100%; }
}

/* Facturación v1.3.73: ancho más compacto de Producto (-20%),
   Gran Cuenta (-30%) y Confirmación resolución (-30%).
   El texto puede partirse sin obligar a ensanchar la columna. */
.billing-table th:nth-child(6),
.billing-table td:nth-child(6) {
  width:150px;
  min-width:150px;
  max-width:150px;
  overflow-wrap:anywhere;
}
.billing-table th:nth-child(10),
.billing-table td:nth-child(10) {
  width:84px;
  min-width:84px;
  max-width:84px;
  text-align:center;
}
.billing-table th:nth-child(11),
.billing-table td:nth-child(11) {
  width:137px;
  min-width:137px;
  max-width:137px;
  overflow-wrap:anywhere;
}

/* Facturación v1.3.74: celdas compactas y alineación vertical centrada.
   Alcance exclusivo de Facturación; no cambia otras tablas. */
.billing-table th,
.billing-table td {
  padding:6px 6px;
  vertical-align:middle;
}


/* Facturación v1.3.75: estrechar Empresa (-10px), CIF (-10px)
   y Confirmación resolución (-20px); mantener padding y centrado v1.3.74. */
.billing-table th:nth-child(1),
.billing-table td:nth-child(1) {
  width:170px;
  min-width:170px;
  max-width:170px;
  overflow-wrap:anywhere;
}
.billing-table th:nth-child(3),
.billing-table td:nth-child(3) {
  width:92px;
  min-width:92px;
  max-width:92px;
  overflow-wrap:anywhere;
}
.billing-table th:nth-child(11),
.billing-table td:nth-child(11) {
  width:117px;
  min-width:117px;
  max-width:117px;
  overflow-wrap:anywhere;
}

/* v1.3.78 - Estadísticas: gráfico circular de tickets por técnico asignado. */
.stats-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:0 0 20px; }
.stats-summary-item { padding:18px 20px; background:#fff; border:1px solid var(--line); border-radius:14px; display:flex; flex-direction:column; gap:8px; box-shadow:0 9px 24px rgba(16,24,40,.04); }
.stats-summary-item span { color:var(--muted); font-size:13px; }
.stats-summary-item strong { font-size:clamp(25px,3vw,36px); line-height:1.05; font-variant-numeric:tabular-nums; }
.stats-card { margin-bottom:20px; }
.stats-billing-total { margin:14px 0 4px; color:var(--muted); font-size:14px; }
.stats-billing-total strong { color:var(--ink); font-size:22px; font-variant-numeric:tabular-nums; margin-left:6px; }
.stats-chart-layout { display:grid; grid-template-columns:minmax(250px,340px) minmax(250px,1fr); gap:clamp(15px,3vw,42px); align-items:center; margin-top:18px; }
.stats-pie-wrap { display:flex; justify-content:center; }
.stats-pie { display:block; width:min(100%,320px); height:auto; overflow:visible; }
.stats-legend { display:flex; flex-direction:column; gap:2px; max-height:510px; overflow-y:auto; }
.stats-legend-item { display:grid; grid-template-columns:15px minmax(0,1fr) 68px 66px; gap:10px; align-items:center; padding:9px 5px; border-bottom:1px solid var(--line); font-size:14px; }
.stats-legend-swatch { width:13px; height:13px; border-radius:4px; }
.stats-legend-name { overflow-wrap:anywhere; }
.stats-legend-count { text-align:right; font-variant-numeric:tabular-nums; }
.stats-legend-percent { text-align:right; color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; }
.stats-table { width:100%; min-width:420px; border-collapse:collapse; }
.stats-table th, .stats-table td { padding:10px 12px; border-bottom:1px solid var(--line); text-align:left; }
.stats-table th:nth-child(n+2), .stats-table td:nth-child(n+2) { text-align:right; font-variant-numeric:tabular-nums; }
.stats-table tfoot th, .stats-table tfoot td { font-weight:800; background:#faf7fc; }
.stats-empty { margin-top:20px; padding:34px 16px; border:1px dashed var(--line); border-radius:12px; text-align:center; color:var(--muted); }
@media (max-width:780px) {
  .stats-chart-layout { grid-template-columns:1fr; }
  .stats-summary { gap:8px; }
  .stats-summary-item { padding:12px; }
  .stats-legend { max-height:none; }
}
@media (max-width:440px) {
  .stats-summary { grid-template-columns:1fr; }
  .stats-legend-item { grid-template-columns:13px minmax(0,1fr) 48px 55px; gap:6px; }
}
