[hidden] { display: none !important; }
:root {
  --bg: #faf9f5; --side: #f0eee6; --panel: #ffffff; --text: #1f1e1d; --muted: #73726c;
  --border: #e5e3da; --accent: #c96442; --accent-text: #fff; --user-bubble: #f0eee6;
  --code: #f3f1ea; --danger: #b3261e; --ok: #2e7d32;
  --serif: "Tiempos Text", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #262624; --side: #1f1e1d; --panel: #30302e; --text: #f5f4ef; --muted: #a6a39b;
    --border: #3e3e3a; --user-bubble: #141413; --code: #1a1a18;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); }
button { font: inherit; cursor: pointer; }
.logo { color: var(--accent); }
.muted { color: var(--muted); font-size: .85rem; }
.error { color: var(--danger); min-height: 1.2em; }

/* Login */
.login-body { display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; box-shadow: 0 4px 24px rgba(0,0,0,.06); }
.login-card form { display: grid; gap: 14px; margin-top: 18px; }
.login-card label { display: grid; gap: 6px; font-size: .9rem; }
.login-card input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text); font-size: 1rem; }
.primary { background: var(--accent); color: var(--accent-text); border: 0; border-radius: 10px; padding: 11px; font-weight: 600; }
.brand { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }

/* Layout */
.layout { display: flex; height: 100vh; }
#sidebar { width: 260px; flex-shrink: 0; background: var(--side); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px 10px; gap: 8px; }
#sidebar .brand { padding: 4px 8px 10px; }
.new-chat { text-align: left; background: transparent; border: 0; border-radius: 8px; padding: 9px 10px;
  color: var(--accent); font-weight: 600; }
.new-chat:hover, .conv:hover { background: rgba(0,0,0,.05); }
.side-label { font-size: .75rem; color: var(--muted); padding: 10px 10px 2px; }
#conv-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.conv { display: flex; align-items: center; border-radius: 8px; }
.conv.active { background: rgba(0,0,0,.08); }
.conv button.open { flex: 1; text-align: left; background: none; border: 0; color: var(--text);
  padding: 8px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.conv button.del { background: none; border: 0; color: var(--muted); opacity: 0; padding: 4px 8px; }
.conv:hover button.del { opacity: 1; }
.side-footer { display: flex; justify-content: space-between; align-items: center; padding: 10px 8px 2px;
  border-top: 1px solid var(--border); font-size: .9rem; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; }

#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; min-height: 48px; }
#conv-title { flex: 1; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: .75rem; border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; color: var(--ok); background: var(--panel); }
.icon { background: none; border: 0; font-size: 1.2rem; color: var(--text); display: none; }

#messages { flex: 1; overflow-y: auto; padding: 8px 16px 24px; }
.msg { max-width: 760px; margin: 0 auto 22px; line-height: 1.6; }
.msg.user { display: flex; flex-direction: column; align-items: flex-end; }
.msg.user .bubble { background: var(--user-bubble); border-radius: 14px; padding: 10px 14px;
  max-width: 85%; white-space: pre-wrap; word-wrap: break-word; }
.msg.assistant .bubble { font-family: var(--serif); font-size: 1.02rem; }
.msg .note { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.msg.error .bubble { color: var(--danger); font-family: var(--sans); }
.bubble pre { background: var(--code); border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  overflow-x: auto; font-size: .85rem; font-family: ui-monospace, Consolas, monospace; }
.bubble code { background: var(--code); border-radius: 4px; padding: 1px 4px; font-size: .88em; font-family: ui-monospace, Consolas, monospace; }
.bubble pre code { background: none; padding: 0; }
.bubble h1, .bubble h2, .bubble h3 { font-size: 1.1rem; margin: 1em 0 .4em; }
.bubble a { color: var(--accent); }
.cursor::after { content: "▍"; color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.empty { display: none; text-align: center; padding: 0 16px; }
.empty h1 { font-family: var(--serif); font-weight: 400; font-size: 2.2rem; margin: 0 0 24px; }
#main.is-empty #messages { flex: 0; }
#main.is-empty .empty { display: block; margin-top: 22vh; }

#composer { width: calc(100% - 32px); max-width: 760px; margin: 0 auto; background: var(--panel);
  border: 1px solid var(--border); border-radius: 18px; padding: 12px 12px 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,.05); }
#input { width: 100%; border: 0; outline: none; resize: none; background: transparent; color: var(--text);
  font: inherit; font-size: 1rem; max-height: 40vh; padding: 4px 6px; }
.composer-bar { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
#model { border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 8px; padding: 5px 8px; font-size: .85rem; max-width: 45%; }
.hint { flex: 1; font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.send { margin-left: auto; width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--accent); color: var(--accent-text); font-size: 1.1rem; font-weight: 700; }
.send:disabled { opacity: .4; cursor: default; }
.send.stop { background: var(--text); color: var(--bg); }
.disclaimer { text-align: center; font-size: .72rem; color: var(--muted); margin: 8px 0 12px; }

@media (max-width: 760px) {
  #sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; transform: translateX(-100%); transition: transform .2s; }
  #sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .icon { display: block; }
  .hint { display: none; }
  #model { max-width: 70%; }
}

/* ---- Adjuntos y menú "+" (estilo Claude) ---- */
#main { position: relative; }
.tool-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: transparent;
  color: var(--muted); display: grid; place-items: center; }
.tool-btn:hover, .tool-btn[aria-expanded="true"] { background: var(--bg); color: var(--text); }
.plus-wrap { position: relative; }
.menu { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 20; min-width: 270px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; padding: 6px; box-shadow: 0 8px 28px rgba(0,0,0,.14); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-radius: 8px;
  padding: 9px 10px; color: var(--text); text-align: left; font-size: .9rem; }
.menu button:hover, .menu button:focus-visible { background: var(--bg); outline: none; }
.menu button svg { color: var(--muted); flex-shrink: 0; }
.menu-note { font-size: .72rem; color: var(--muted); padding: 6px 10px 4px; border-top: 1px solid var(--border); margin-top: 4px; line-height: 1.4; }

.attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 2px 10px; }
.att { position: relative; display: flex; align-items: center; gap: 8px; height: 64px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg); padding: 0 12px 0 8px; max-width: 220px; }
.att.image { width: 64px; padding: 0; overflow: hidden; }
.att.image img { width: 100%; height: 100%; object-fit: cover; }
.att .ext { width: 40px; height: 44px; border-radius: 6px; background: var(--accent); color: var(--accent-text);
  display: grid; place-items: center; font-size: .65rem; font-weight: 700; flex-shrink: 0; text-transform: uppercase; }
.att .info { min-width: 0; display: flex; flex-direction: column; }
.att .name { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att .sub { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att .remove { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: .7rem; line-height: 1; display: none; padding: 0; }
.att:hover .remove, .att:focus-within .remove { display: block; }
.att.loading { opacity: .6; }
.att.loading::after { content: ""; position: absolute; inset: 0; border-radius: 10px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (hover: none) { .att .remove { display: block; } }

.msg-atts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-bottom: 6px; max-width: 85%; }
.msg-atts .att { background: var(--panel); }
.msg-atts .att.image { width: auto; height: auto; max-width: 240px; max-height: 240px; }
.msg-atts .att.image img { width: auto; height: auto; max-width: 240px; max-height: 240px; display: block; }

.drop-overlay { position: absolute; inset: 0; z-index: 30; background: rgba(201,100,66,.08); border: 2px dashed var(--accent);
  border-radius: 16px; display: grid; place-items: center; pointer-events: none; }
.drop-overlay div { background: var(--panel); padding: 14px 20px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.1); font-size: .95rem; }
.toast { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 40; background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-size: .85rem; max-width: calc(100% - 32px); box-shadow: 0 4px 20px rgba(0,0,0,.2); }

/* ---- Búsqueda web ---- */
.menu .switch { margin-left: auto; width: 30px; height: 18px; border-radius: 999px; background: var(--border); position: relative; flex-shrink: 0; transition: background .15s; }
.menu .switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.menu [aria-checked="true"] .switch { background: var(--accent); }
.menu [aria-checked="true"] .switch::after { transform: translateX(12px); }
.web-chip { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--accent);
  background: rgba(201,100,66,.08); color: var(--accent); font-size: .8rem; font-weight: 600; }
.web-chip:hover { background: rgba(201,100,66,.16); }
.steps { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-family: var(--sans); }
.step { font-size: .8rem; color: var(--muted); display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.step span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.warn { color: var(--danger); }
.step.active span::after { content: " …"; animation: blink 1s steps(1) infinite; }
.sources { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; font-family: var(--sans); }
.sources-title { font-size: .75rem; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.sources ol { margin: 0; padding-left: 20px; display: grid; gap: 3px; }
.sources li { font-size: .82rem; }
.sources a { color: var(--text); text-decoration: none; }
.sources a:hover { text-decoration: underline; }
.sources .dom { color: var(--muted); margin-left: 6px; font-size: .75rem; }

/* ---- Dictado por voz ---- */
.mic { margin-left: auto; }
.mic:not([hidden]) + .send { margin-left: 0; }
.rec-bar { display: flex; align-items: center; gap: 10px; padding: 6px 4px 10px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1.2s ease-in-out infinite; flex-shrink: 0; }
@keyframes pulse { 50% { opacity: .3; transform: scale(.8); } }
.rec-time { font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--muted); min-width: 36px; }
.rec-wave { flex: 1; min-width: 0; height: 32px; }
.rec-status { font-size: .8rem; color: var(--muted); }
.rec-done { width: 32px; height: 32px; border-radius: 8px; border: 0; background: var(--accent); color: var(--accent-text); font-weight: 700; }
.rec-bar.busy .rec-dot { background: var(--muted); }
.rec-bar.busy .rec-wave, .rec-bar.busy .rec-done, .rec-bar.busy #rec-cancel { display: none; }
.rec-bar.busy .rec-status::after { content: " …"; animation: blink 1s steps(1) infinite; }
#composer.recording #input { display: none; }

/* ---- Archivos generados ---- */
.gen-files { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-top: 12px; font-family: var(--sans); }
.gen-file { display: flex; flex-direction: column; width: 300px; max-width: 100%; border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel); color: var(--text); text-decoration: none; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.gen-file:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.gen-file img { width: 100%; max-height: 220px; object-fit: contain; background: #fff; border-bottom: 1px solid var(--border); }
.gen-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.gen-row .ext { width: 40px; height: 44px; border-radius: 6px; display: grid; place-items: center; font-size: .65rem; font-weight: 700;
  text-transform: uppercase; color: #fff; background: #7a7a72; flex-shrink: 0; }
.gen-row .ext-docx { background: #2b579a; } .gen-row .ext-xlsx, .gen-row .ext-csv { background: #217346; }
.gen-row .ext-pptx { background: #c43e1c; } .gen-row .ext-pdf { background: #b30b00; }
.gen-row .ext-png, .gen-row .ext-svg { background: var(--accent); }
.gen-row .info { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.gen-row .name { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gen-row .sub { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gen-row .dl { color: var(--muted); display: grid; place-items: center; }
.gen-file:hover .dl { color: var(--accent); }
/* ---- Tablas en las respuestas ---- */
.table-wrap { overflow-x: auto; margin: 10px 0; }
.bubble table { border-collapse: collapse; font-family: var(--sans); font-size: .88rem; min-width: 50%; }
.bubble th, .bubble td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.bubble th { background: var(--side); font-weight: 600; }
.bubble tbody tr:nth-child(even) td { background: var(--bg); }

/* ---- Logo de Alvea (arriba a la derecha) ---- */
.brand-logo { height: 55px; width: auto; display: block; flex-shrink: 0; user-select: none; }
.topbar { padding-top: 8px; padding-bottom: 8px; }
.login-logo { position: fixed; top: 20px; right: 24px; height: 65px; }
@media (prefers-color-scheme: dark) {
  .brand-logo { background: #fff; border-radius: 10px; padding: 4px 6px; box-sizing: content-box; }
}
@media (max-width: 760px) {
  .brand-logo { height: 40px; }
  .login-logo { top: 12px; right: 12px; height: 48px; }
}
/* Pantalla de acceso en pantallas estrechas: el logo va encima de la tarjeta, no superpuesto */
.login-card input { width: 100%; min-width: 0; }
@media (max-width: 760px) {
  /* Centrado "seguro": si no cabe en alto, se puede desplazar hasta arriba (no queda contenido inaccesible) */
  .login-body { display: flex; flex-direction: column; align-items: center; height: auto; min-height: 100vh; }
  .login-logo { position: static; align-self: flex-end; margin: auto 0 12px; }
  .login-card { margin-bottom: auto; }
}
/* Barra del compositor en pantallas muy estrechas: el selector de modelo cede espacio */
.composer-bar > * { flex-shrink: 0; }
.composer-bar #model { flex: 0 1 auto; min-width: 0; }
.composer-bar .hint { flex-shrink: 1; }

/* ---- Administración de usuarios ---- */
.admin-body { min-height: 100%; height: auto; }
.admin-top { display: flex; align-items: center; gap: 16px; padding: 10px 24px; border-bottom: 1px solid var(--border); background: var(--side); }
.admin-top .brand { flex: 1; }
.back { color: var(--muted); text-decoration: none; font-size: .9rem; white-space: nowrap; }
.back:hover { color: var(--accent); }
.admin-main { max-width: 1150px; margin: 0 auto; padding: 24px 16px 40px; }
.admin-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.admin-bar input[type=search] { flex: 1; min-width: 180px; max-width: 340px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit; }
.admin-bar .primary { margin-left: auto; padding: 9px 16px; }
.admin-table-wrap { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--bg); white-space: nowrap; }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr.is-disabled td:not(.actions) { opacity: .55; }
.admin-table .right { text-align: right; }
.actions { white-space: nowrap; }
.act { background: transparent; border: 1px solid var(--border); border-radius: 7px; padding: 4px 9px; margin-left: 4px; font-size: .78rem; color: var(--text); }
.act:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.act.danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }
.act:disabled { opacity: .35; cursor: not-allowed; }
.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill.admin { background: rgba(201,100,66,.14); color: var(--accent); }
.pill.user { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.pill.on { background: rgba(46,125,50,.12); color: var(--ok); }
.pill.off { background: rgba(179,38,30,.12); color: var(--danger); }
.pill.muted-pill { background: var(--bg); color: var(--muted); }
.small { font-size: .75rem; }
.admin-note { margin-top: 14px; line-height: 1.5; }

/* Diálogos (también usados en el chat) */
.dlg { border: 1px solid var(--border); border-radius: 16px; padding: 24px; width: min(460px, calc(100vw - 32px)); background: var(--panel); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dlg::backdrop { background: rgba(0,0,0,.35); }
.dlg h2 { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; margin: 0 0 16px; }
.dlg form { display: grid; gap: 12px; }
.dlg label { display: grid; gap: 6px; font-size: .9rem; }
.dlg label.check { display: flex; align-items: center; gap: 8px; }
.dlg input[type=text], .dlg input[type=password], .dlg input:not([type]) { padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; width: 100%; min-width: 0; }
.dlg-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 8px; }
.dlg-actions .primary { padding: 9px 18px; }
.primary.danger { background: var(--danger); }
.secret { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px dashed var(--border); border-radius: 10px; padding: 10px 12px; margin: 6px 0 12px; }
.secret code { flex: 1; font-size: 1.05rem; letter-spacing: .03em; user-select: all; word-break: break-all; }
.dlg img[data-qr-img] { display: block; margin: 8px auto; background: #fff; border-radius: 8px; image-rendering: pixelated; }
.side-links { display: flex; flex-direction: column; gap: 2px; padding: 0 2px 6px; }
.side-links a, .side-links button { text-align: left; font-size: .85rem; color: var(--muted); text-decoration: none; background: none; border: 0; padding: 6px 8px; border-radius: 6px; }
.side-links a:hover, .side-links button:hover { background: rgba(0,0,0,.05); color: var(--text); }
@media (max-width: 760px) {
  .admin-top { padding: 8px 12px; gap: 10px; }
  .admin-top .brand { font-size: 1rem; }
  .admin-table-wrap { overflow-x: auto; }
}
.login-card #change-form { display: grid; gap: 14px; margin-top: 18px; }
.login-card #change-form[hidden] { display: none; }
.login-card #change-form label { display: grid; gap: 6px; font-size: .9rem; }
.login-card #change-form input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 1rem; }
.change-intro { margin: 0; font-size: .9rem; line-height: 1.45; background: rgba(201,100,66,.08); border-radius: 10px; padding: 10px 12px; }
.admin-table td.actions { white-space: normal; }
.admin-table td.actions .act { margin: 2px 0 2px 4px; }
.admin-table th:last-child { width: 1%; }
@media (min-width: 761px) { .admin-table td.actions { min-width: 240px; } }
.admin-table th { white-space: normal; }
.forgot-link { justify-self: center; font-size: .85rem; margin-top: -4px; }
.login-card #forgot-form { display: grid; gap: 14px; margin-top: 18px; }
.login-card #forgot-form[hidden] { display: none; }
.login-card #forgot-form label { display: grid; gap: 6px; font-size: .9rem; }
.login-card #forgot-form input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 1rem; }
/* ---- Página de enlaces de cuenta (/cuenta) ---- */
.account-card form { display: grid; gap: 14px; margin-top: 14px; }
.account-card form[hidden] { display: none; }
.account-card label { display: grid; gap: 6px; font-size: .9rem; margin-bottom: 8px; }
.account-card input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 1rem; width: 100%; min-width: 0; }
.acc-title { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin: 14px 0 4px; }
.totp-box { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font-size: .9rem; }
.totp-box p { margin: 0 0 8px; line-height: 1.4; }
.totp-box img { display: block; margin: 6px auto; background: #fff; border-radius: 8px; image-rendering: pixelated; }
.totp-box details { margin-top: 6px; font-size: .8rem; }
.secret-inline { display: block; margin-top: 6px; word-break: break-all; font-size: .95rem; letter-spacing: .04em; user-select: all; }
.btn-link { display: inline-block; text-decoration: none; padding: 10px 18px; }
/* ---- Administración: menú por fila, avisos ---- */
.row-menu { position: fixed; bottom: auto; min-width: 300px; z-index: 50; }
.row-menu button:disabled { opacity: .4; cursor: not-allowed; }
.row-menu .danger-item { color: var(--danger); }
.pill.pending { background: rgba(212,160,58,.18); color: #9a6a00; }
.warn { color: #9a6a00; }
.u-name { display: flex; align-items: center; gap: 6px; }
.mail-warning { background: rgba(212,160,58,.14); border: 1px solid rgba(212,160,58,.45); border-radius: 10px; padding: 10px 14px; font-size: .85rem; line-height: 1.45; margin: 0 0 14px; }
.manual-box { display: grid; gap: 12px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 10px; }
.manual-box[hidden] { display: none; }
.dlg input[type=email] { padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; width: 100%; min-width: 0; }
/* ---- Botón "ojo" para ver la contraseña ---- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 44px !important; }
.pw-eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 34px; height: 34px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.pw-eye:hover { color: var(--text); background: rgba(0,0,0,.05); }
.pw-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pw-eye[aria-pressed="true"] { color: var(--accent); }
/* Oculta el ojo nativo de Edge para que no aparezcan dos */
input::-ms-reveal, input::-ms-clear { display: none; }
