:root{color-scheme:light;--ink:#17352f;--muted:#62756e;--paper:#f4f7f3;--card:#fff;--accent:#16735f;--line:#dbe5de;--soft:#e8f2ec;--shadow:0 12px 35px rgba(18,60,54,.08)}
*{box-sizing:border-box}body{margin:0;background:radial-gradient(circle at 10% 0,#e1f0e7 0,transparent 32rem),var(--paper);color:var(--ink);font-family:'DM Sans',system-ui,-apple-system,sans-serif;min-height:100vh}.app{width:min(100% - 32px,760px);margin:0 auto;padding:30px 0 36px}.hero{text-align:center;padding:30px 12px 26px}.brand-lockup{width:min(100%,420px);margin:0 auto 14px;background:#f2e2c6;padding:8px;border-radius:18px}.brand-logo{display:block;width:auto;height:min(82vw,320px);max-width:100%;object-fit:contain;margin:0 auto}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.eyebrow{font-size:.74rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--accent);margin:0 0 7px}h1,h2{font-family:Manrope,system-ui,sans-serif}h1{font-size:clamp(2.1rem,8vw,3.2rem);letter-spacing:-.055em;margin:0}h2{font-size:1.2rem;margin:0}.intro{color:var(--muted);max-width:450px;margin:10px auto 0;line-height:1.55}.search-form,.saved-section{background:var(--card);border:1px solid var(--line);border-radius:22px;padding:20px;box-shadow:var(--shadow)}.search-form label{display:block;font-weight:700;margin-bottom:10px}.search-row{display:flex;gap:9px}input{width:100%;min-width:0;border:1px solid #c9d8cf;border-radius:14px;padding:14px 15px;font:inherit;color:var(--ink);background:#fcfdfb}input:focus{outline:3px solid #bfe2d1;border-color:var(--accent)}button{font:inherit;cursor:pointer}.search-row button{border:0;border-radius:14px;background:var(--accent);color:#fff;font-weight:700;padding:0 18px;min-width:93px}.search-row button:disabled{opacity:.55;cursor:wait}.status{color:var(--muted);font-size:.93rem;line-height:1.5;margin:14px 4px}.results{display:grid;gap:12px;margin:14px 0 28px}.result-card{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:18px;box-shadow:var(--shadow)}.result-card h2{font-size:1.08rem;line-height:1.35;margin-bottom:8px}.result-card p{margin:0;color:#354c45;line-height:1.62;white-space:pre-wrap}.result-card a{display:inline-block;margin-top:12px;color:var(--accent);font-weight:700;text-decoration-thickness:1px;text-underline-offset:3px}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.quiet-button{border:1px solid var(--line);background:#fff;color:var(--muted);padding:8px 12px;border-radius:11px;font-weight:600}.history{display:grid;gap:8px}.history-empty{margin:0;color:var(--muted);font-size:.92rem}.history-item{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;text-align:left;border:1px solid var(--line);background:#fbfdfb;border-radius:12px;padding:11px 12px;color:var(--ink)}.history-item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.history-item small{flex:none;color:var(--muted)}footer{padding:20px 5px 0;color:var(--muted);font-size:.8rem;line-height:1.5}footer p{margin:5px 0}.owner-link{margin-top:15px;border:1px solid var(--line);background:#fff;color:var(--accent);padding:9px 13px;border-radius:12px;font-weight:700}.owner-link:focus-visible,#owner-close:focus-visible{outline:3px solid #bfe2d1}#owner-dialog{width:min(100% - 32px,420px);border:1px solid var(--line);border-radius:22px;padding:23px;color:var(--ink);box-shadow:var(--shadow)}#owner-dialog::backdrop{background:rgba(13,38,33,.55);backdrop-filter:blur(3px)}#owner-dialog h2{margin-bottom:12px}#owner-dialog>p:not(.eyebrow){color:var(--muted);line-height:1.5}#owner-dialog label{display:block;margin:16px 0 7px;font-weight:700}#owner-key{background:#f1f3f2;cursor:not-allowed}#owner-key::placeholder{color:#87938e}.owner-warning{font-size:.85rem;color:#8a4b24!important}.owner-actions{display:flex;justify-content:flex-end;margin-top:18px}.owner-actions button{border:0;background:var(--accent);color:#fff;padding:10px 16px;border-radius:12px;font-weight:700}.owner-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:18px 0 10px}.owner-tab{border:1px solid var(--line);background:#fff;color:var(--muted);padding:9px;border-radius:11px;font-weight:700}.owner-tab.active{background:var(--soft);border-color:var(--accent);color:var(--accent)}.owner-panel[hidden]{display:none}.owner-panel{padding-top:2px}.owner-panel p{line-height:1.5;color:var(--muted)}#owner-key-confirm{background:#f1f3f2;cursor:not-allowed}#owner-key-confirm::placeholder{color:#87938e}.owner-disabled{width:100%;margin-top:8px;border:0;background:#a5b8af;color:#fff;padding:11px;border-radius:12px;font-weight:700;cursor:not-allowed}.owner-panel-link{text-align:center;margin:15px 0 0}.owner-panel-link a,.back-link a{color:var(--accent);font-weight:700;text-underline-offset:3px}.back-link{text-align:center;margin:20px 0 0;color:var(--muted)}.owner-app .search-form{margin-bottom:14px}.owner-data-preview textarea{width:100%;margin-top:8px;resize:vertical;border:1px solid var(--line);border-radius:12px;padding:12px;font:inherit;line-height:1.5;background:#f1f3f2;color:var(--ink);cursor:not-allowed}.recovery-placeholder{padding:15px;margin:14px 0;background:#f1f3f2;border:1px dashed #95a79d;border-radius:12px;text-align:center;letter-spacing:.12em;font:700 1.1rem monospace;color:#66776f}#owner-dialog{max-height:min(92vh,760px);overflow-y:auto}.network-panel,.voice-panel{background:var(--card);border:1px solid var(--line);border-radius:20px;padding:18px;margin:0 0 14px;box-shadow:var(--shadow)}.switch-row{display:flex;align-items:center;gap:12px;font-weight:700;line-height:1.4}.switch-row input{appearance:none;flex:0 0 50px;width:50px;height:28px;margin:0;border:1px solid #9aac9f;border-radius:18px;background:#dce5df;position:relative;cursor:pointer}.switch-row input:after{content:"";position:absolute;left:3px;top:3px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #0003;transition:transform .18s}.switch-row input:checked{background:var(--accent);border-color:var(--accent)}.switch-row input:checked:after{transform:translateX(21px)}.switch-row input:focus-visible{outline:3px solid #bfe2d1}.control-note{color:var(--muted);font-size:.88rem;line-height:1.5;margin:10px 0 0}.voice-panel h2{margin:0 0 12px}.voice-panel>label{display:block;font-weight:700;margin:12px 0 7px}.voice-panel select{width:100%;border:1px solid #c9d8cf;border-radius:12px;padding:12px;font:inherit;color:var(--ink);background:#fcfdfb}.voice-indicator-row{display:flex;align-items:center;justify-content:center;gap:15px;margin:0 0 10px}.voice-orb{display:block;width:24px;height:24px;border-radius:50%;background:#aabbc6;box-shadow:0 0 0 6px #aabbc622}.voice-wave{height:28px;display:flex;align-items:center;gap:5px}.voice-wave i{display:block;width:4px;height:8px;border-radius:4px;background:#aabbc6}.voice-panel.listening .voice-orb,.voice-panel.speaking .voice-orb{background:#1673d1;box-shadow:0 0 0 7px #1673d122}.voice-panel.listening .voice-wave i,.voice-panel.speaking .voice-wave i{background:#1673d1;animation:kb-wave .72s ease-in-out infinite alternate}.voice-panel.listening .voice-wave i:nth-child(2),.voice-panel.speaking .voice-wave i:nth-child(2){animation-delay:.12s}.voice-panel.listening .voice-wave i:nth-child(3),.voice-panel.speaking .voice-wave i:nth-child(3){animation-delay:.24s}.voice-panel.listening .voice-wave i:nth-child(4),.voice-panel.speaking .voice-wave i:nth-child(4){animation-delay:.36s}.voice-panel.listening .voice-wave i:nth-child(5),.voice-panel.speaking .voice-wave i:nth-child(5){animation-delay:.48s}@keyframes kb-wave{to{height:24px}}.voice-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}.voice-buttons button{border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--accent);padding:11px 9px;font-weight:700}.voice-buttons button:disabled{opacity:.5;cursor:not-allowed}.voice-buttons #voice-start{background:var(--accent);color:#fff;border-color:var(--accent)}.voice-buttons #voice-export{grid-column:1/-1;background:var(--soft)}
@media(max-width:520px){.app{width:min(100% - 22px,760px);padding-top:16px}.hero{padding-top:20px}.search-form,.saved-section{padding:16px;border-radius:18px}.search-row{flex-direction:column}.search-row button{padding:13px}.result-card{padding:15px}}
.memory-panel select{width:100%;border:1px solid #c9d8cf;border-radius:12px;padding:12px;margin:7px 0;font:inherit;color:var(--ink);background:#fcfdfb}.memory-panel>label{display:block;font-weight:700;margin:12px 0 7px}.memory-turn{display:grid;grid-template-columns:auto 1fr;align-items:center}.memory-turn small{justify-self:end}.memory-turn .memory-turn-text{grid-column:1/-1;margin:7px 0 0;white-space:pre-wrap;line-height:1.5}.memory-panel .section-heading{margin-top:18px}#owner-key,#owner-key-confirm,#owner-unlock-key,#owner-recovery-input,#owner-new-key,#owner-new-key-confirm{background:#fcfdfb;cursor:text}#owner-dialog .owner-primary{display:block;width:100%;margin-top:12px;border:0;border-radius:12px;background:var(--accent);color:#fff;padding:12px 14px;font-weight:700}#owner-dialog button:disabled{opacity:.5;cursor:not-allowed}#owner-dialog .owner-primary:disabled{opacity:.5;cursor:not-allowed}#owner-dialog .quiet-button{display:block;width:100%;margin-top:10px}#owner-dialog .owner-check-row{display:flex;align-items:center;gap:9px;font-weight:600}#owner-dialog .owner-check-row input{width:auto;min-width:20px;margin:0}#owner-dialog .recovery-code{display:block;margin:12px 0;padding:15px;border:1px dashed #95a79d;border-radius:12px;background:#f1f3f2;text-align:center;font:700 1.08rem monospace;letter-spacing:.08em;overflow-wrap:anywhere}#owner-dialog .owner-warning{font-size:.83rem;color:#8a4b24!important;line-height:1.45}#owner-dialog .owner-panel{padding-top:4px}.auto-learning-panel h2{margin-bottom:6px}.learning-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.learning-button{border:0;border-radius:12px;background:var(--accent);color:#fff;padding:11px 13px;font-weight:700}.learning-button:disabled{opacity:.5;cursor:not-allowed}.learning-card{margin-top:14px;padding:15px;background:#fbfdfb;border:1px dashed #95a79d;border-radius:14px}.learning-card[hidden]{display:none}.learning-card h3{margin:0 0 8px;font-size:1rem}.learning-card p{line-height:1.5}.learning-label{font-size:.73rem;font-weight:800;color:#8a4b24}.learning-card dl{display:grid;grid-template-columns:minmax(88px,.6fr) 1fr;gap:7px 10px;margin:12px 0;font-size:.88rem;line-height:1.4}.learning-card dt{font-weight:700}.learning-card dd{margin:0}/* Vista previa: perfil local, arena, turquesa y verde */
.memory-panel{background:linear-gradient(145deg,#fff8eb,#f2e2c6);border:2px solid #36b7a1;border-radius:24px;box-shadow:0 14px 32px rgba(67,49,32,.14);color:#4b3528}
.memory-panel .eyebrow{color:#0b756c}
.memory-panel h2,.memory-panel h3{color:#4b3528}
.memory-panel .control-note{color:#5f5247}
.memory-panel select,.memory-panel input[type="text"]{background:#fffdf8;border-color:#8ec9ba;color:#44362d}
.memory-panel select:focus,.memory-panel input[type="text"]:focus{outline:3px solid rgba(22,147,130,.22);border-color:#0b756c}
.memory-panel .section-heading{border-top:1px solid #d9c7a9;padding-top:16px}
.memory-panel .quiet-button{border:1px solid #36a998;background:#e9f6f2;color:#0b756c}
.memory-panel .history-item{background:#fffdf8;border-color:#dccdb5;color:#4b3528}
/* Killoblan: chat y controles */
.killoblan-chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-height: calc(100vh - 120px);
  box-sizing: border-box;
  padding: 14px;
  border: 1px solid #293a48;
  border-radius: 18px;
  background: #101820;
  color: #f3f6f8;
}

.killoblan-chat__header,
.killoblan-chat__identity {
  display: flex;
  align-items: center;
}

.killoblan-chat__header {
  justify-content: space-between;
  gap: 10px;
}

.killoblan-chat__identity {
  gap: 10px;
}

.killoblan-chat__orb {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #9beaff, #258bd3 58%, #174b85);
  box-shadow: 0 0 14px rgba(54, 174, 239, 0.45);
}

.killoblan-chat__eyebrow {
  margin: 0 0 2px;
  color: #91a6b5;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.killoblan-chat__header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.killoblan-chat__log {
  flex: 1 1 auto;
  min-height: 220px;
  overflow-y: auto;
  padding: 12px;
  border-radius: 14px;
  background: #151f29;
}

.killoblan-chat__welcome {
  margin: 0;
  color: #d9e5eb;
  line-height: 1.45;
}

.killoblan-chat__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.killoblan-chat button {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #344957;
  border-radius: 11px;
  background: #192833;
  color: #f3f6f8;
  font: inherit;
  font-size: 0.82rem;
}

.killoblan-chat button:focus-visible {
  outline: 2px solid #52c9d2;
  outline-offset: 2px;
}

.killoblan-chat__composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px;
  border: 1px solid #344957;
  border-radius: 14px;
  background: #151f29;
}

.killoblan-chat__composer textarea {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 42px;
  max-height: 110px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.killoblan-chat__composer textarea::placeholder {
  color: #91a1ad;
}

.killoblan-chat__composer #killoblan-chat-send {
  border-color: #279c9e;
  background: #197c80;
}

.killoblan-chat__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .killoblan-chat {
    gap: 9px;
    padding: 10px;
  }

  .killoblan-chat__tools button {
    padding: 6px 8px;
    font-size: 0.8rem;
  }
}
/* Burbujas de mensajes del chat */
#killoblan-chat-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.killoblan-chat-message {
  max-width: 88%;
  margin: 4px 0;
  padding: 10px 13px;
  border-radius: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.killoblan-chat-message--user {
  align-self: flex-end;
  background: #28445e;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.killoblan-chat-message--assistant {
  align-self: flex-start;
  background: #26323f;
  color: #f7f4ec;
  border-bottom-left-radius: 4px;
}

/* Preparación de integración: tema azul único y chat como única interfaz visible */
:root {
  color-scheme: dark;
  --ink: #eaf4ff;
  --muted: #a9c0d8;
  --paper: #0b1423;
  --card: #122238;
  --accent: #348cf5;
  --line: #29486b;
  --soft: #1a3556;
  --shadow: 0 12px 35px rgba(0, 10, 30, .35);
}
body { background: radial-gradient(circle at 10% 0, #18365c 0, transparent 34rem), #0b1423; color: var(--ink); }
.app { max-width: 760px; }
.hero { padding-top: 14px; padding-bottom: 14px; }
.brand-lockup { width: min(100%, 190px); padding: 5px; background: #13243b; border: 1px solid #29486b; }
.brand-logo { height: 110px; }
.intro, footer, .status { color: var(--muted); }
.owner-link, .quiet-button, .history-item, .network-panel, .voice-panel,
.search-form, .saved-section, .result-card, #owner-dialog, .settings-panel,
.settings-card, .settings-group { background: #122238; color: var(--ink); border-color: #29486b; }
input, textarea, select { color: var(--ink); background: #0d1b2d; border-color: #34577e; }
input:focus, textarea:focus, select:focus { outline-color: #59a9ff; }
button, .search-row button, .owner-link, .owner-primary, .learning-button { background: #1769d2; color: #fff; border-color: #388cf4; }
.memory-panel { background: #122238 !important; color: var(--ink) !important; border: 1px solid #29486b !important; box-shadow: var(--shadow) !important; }
.memory-panel .eyebrow, .memory-panel h2, .memory-panel h3, .memory-panel .control-note { color: var(--ink) !important; }
.memory-panel select, .memory-panel input[type="text"], .memory-panel .history-item { background: #0d1b2d !important; color: var(--ink) !important; border-color: #34577e !important; }
.killoblan-chat { min-height: min(76vh, 760px); background: #0e1b2d; border-color: #29486b; color: #eaf4ff; }
.killoblan-chat__log, .killoblan-chat__composer { background: #101f33; border-color: #29486b; }
.killoblan-chat__tools button, .killoblan-chat button { background: #172c46; color: #eaf4ff; border-color: #34577e; }
.killoblan-chat .killoblan-chat__composer #killoblan-chat-send { background: #1769d2; border-color: #388cf4; }
.killoblan-chat-message--user { background: #18549a; }
.killoblan-chat-message--assistant { background: #1a2b40; }
/* Voice button remains in the chat as the requested round blue speaking orb. */
.killoblan-chat__voice-orb-button { flex: 0 0 44px; width: 44px; height: 44px; padding: 0 !important; border-radius: 50% !important; display: inline-grid; place-items: center; background: radial-gradient(circle at 35% 30%, #a5e4ff, #348cf5 55%, #174b9a) !important; box-shadow: 0 0 0 5px rgba(52,140,245,.15), 0 0 18px rgba(52,140,245,.45); font-size: 25px !important; color: white; }
.killoblan-chat__composer { align-items: center; }
/* Legacy query controls stay hidden but in the DOM: current JS uses them internally to fetch/render results for chat. */
.search-form, .voice-panel, #status, #results, .saved-section { display: none !important; }
@media (max-width: 520px) { .brand-logo { height: 88px; } .killoblan-chat { min-height: 72vh; } }

/* UI shell refinements: single blue chat surface; optional controls live in Settings */
:root { color-scheme: dark; --ink:#eaf4ff; --muted:#aac1dc; --paper:#091525; --card:#12243a; --accent:#3b92ff; --line:#2a4a70; --soft:#19385b; --shadow:0 14px 38px rgba(0,8,24,.42); }
html,body { background:#091525 !important; color:#eaf4ff !important; }
.hero { display:none !important; }
.app { width:min(100% - 20px,760px); padding:10px 0 12px; }
.killoblan-chat { min-height:min(72dvh, 620px); max-height:calc(100dvh - 24px); background:#0d1b2d; border:1px solid #29486b; }
.killoblan-chat__header { justify-content:flex-start; }
.killoblan-chat__identity { flex:1; }
.killoblan-chat__logo { width:38px; height:38px; object-fit:contain; border-radius:8px; }
.killoblan-chat__settings-button { flex:0 0 40px; width:40px; height:40px; padding:0 !important; font-size:20px !important; color:#eaf4ff; background:#17385f !important; }
.killoblan-chat__log { min-height:0; }
.killoblan-chat__composer { margin-top:auto; }
.killoblan-chat__voice-orb-button { flex:0 0 44px; width:44px; height:44px; padding:0 !important; border-radius:50% !important; display:inline-grid; place-items:center; background:radial-gradient(circle at 35% 30%,#a5e4ff,#348cf5 55%,#174b9a) !important; box-shadow:0 0 0 5px rgba(52,140,245,.15),0 0 18px rgba(52,140,245,.45); font-size:25px !important; color:#fff; }
#kb-settings-panel[hidden] { display:none !important; }
#kb-settings-panel:not([hidden]) { display:block !important; position:fixed; inset:0; z-index:10000; overflow:auto; padding:20px 12px; background:rgba(4,12,24,.88); backdrop-filter:blur(8px); }
#kb-settings-panel .settings-card { width:min(100%,680px); margin:0 auto; max-height:none; background:#102139; color:#eaf4ff; border:1px solid #315783; border-radius:20px; padding:18px; }
#kb-settings-panel .settings-group, #kb-settings-panel .network-panel, #kb-settings-panel .memory-panel, #kb-settings-panel .voice-panel, #kb-settings-panel .saved-section { margin:12px 0; padding:14px; border:1px solid #29486b; border-radius:16px; background:#142a45 !important; color:#eaf4ff !important; }
#kb-settings-panel h2,#kb-settings-panel h3,#kb-settings-panel h4,#kb-settings-panel label,#kb-settings-panel p { color:#eaf4ff; }
#kb-settings-panel .control-note { color:#aac1dc !important; }
#kb-settings-panel button { min-height:40px; padding:9px 13px; border:1px solid #3b92ff; border-radius:11px; background:#1769d2; color:#fff; }
#kb-settings-panel input,#kb-settings-panel select,#kb-settings-panel textarea { color:#eaf4ff; background:#0b1b30; border-color:#34577e; }
#kb-settings-panel .switch-row input { background:#253a53; }
#kb-settings-panel .settings-close { float:right; }
/* Source results/search form stay as internal machinery; user sees them only as chat replies. */
.search-form,#status,#results,footer { display:none !important; }
.owner-link--hidden { display:none !important; }
@media(max-width:520px) { .killoblan-chat { min-height:min(70dvh, 600px); max-height:calc(100dvh - 20px); padding:10px; } .killoblan-chat__log { min-height:120px; } }

#owner-dialog { background:#102139 !important; color:#eaf4ff !important; border-color:#315783 !important; }
#owner-dialog label,#owner-dialog p,#owner-dialog h2,#owner-dialog h3 { color:#eaf4ff; }
#owner-dialog input,#owner-dialog textarea,#owner-dialog select { background:#0b1b30 !important; color:#eaf4ff !important; border-color:#34577e !important; }
#owner-dialog .owner-warning { color:#ffd19b !important; }
#owner-dialog .recovery-code { color:#eaf4ff; background:#0b1b30; border-color:#4a77a8; }

.search-archive-controls { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin:10px 0; }
.search-archive-list { display:grid; gap:9px; margin-top:10px; }
.search-archive-entry { border:1px solid #315783; border-radius:12px; background:#0b1b30; overflow:hidden; }
.search-archive-summary { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:6px 12px; padding:12px; cursor:pointer; color:#eaf4ff; }
.search-archive-summary small { color:#aac1dc; }
.search-archive-detail { padding:0 13px 13px; color:#eaf4ff; }
.search-archive-detail h4 { margin:14px 0 5px; }
.search-archive-answer,.search-archive-sources p { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.5; }
.search-archive-sources { padding-left:20px; }
.search-archive-sources li { margin:10px 0; }
.search-archive-sources a { display:block; margin-top:5px; color:#8cc7ff; overflow-wrap:anywhere; }
.search-archive-label { color:#aac1dc; font-size:.84rem; }
.search-archive-delete { margin-top:8px; }

/* Ajuste pantalla compacta: controles accesibles bajo el historial de mensajes. */
.killoblan-chat { min-height:min(72dvh,620px); height:auto; max-height:none; }
.killoblan-chat__log { flex:1 1 220px; min-height:130px; max-height:44dvh; }
.killoblan-chat__tools { flex:0 0 auto; max-height:24dvh; overflow-y:auto; padding:2px 1px; }
.killoblan-chat__tools button { min-height:34px; }
.killoblan-chat__composer { flex:0 0 auto; }
@media(max-width:520px) { .killoblan-chat { min-height:min(68dvh,580px); } .killoblan-chat__log { max-height:38dvh; } .killoblan-chat__tools { max-height:25dvh; } }


.owner-change-panel input{display:block;width:100%;margin:7px 0 12px;padding:12px;border:1px solid #34577e;border-radius:12px;background:#0d1b2d;color:#eaf4ff}.memory-panel .section-heading h3{margin:0}

/* Ajustes Chat Azul: controles prioritarios al principio y tarjetas de lectura clara. */
#kb-settings-panel:not([hidden]) { padding: max(14px, env(safe-area-inset-top)) 12px max(18px, env(safe-area-inset-bottom)); }
#kb-settings-panel .settings-card { width: min(100%, 600px); padding: 18px; border-radius: 24px; background: linear-gradient(160deg,#102641 0%,#0d1d32 100%); box-shadow: 0 20px 60px rgba(0,0,0,.48); }
#kb-settings-panel .settings-header { position: sticky; top: -18px; z-index: 2; display:flex; align-items:center; justify-content:space-between; gap:12px; margin:-18px -18px 14px; padding:18px; background:rgba(16,38,65,.96); border-bottom:1px solid #29486b; border-radius:24px 24px 0 0; backdrop-filter:blur(10px); }
#kb-settings-panel .settings-header h2 { font-size:1.45rem; letter-spacing:-.03em; }
#kb-settings-panel .settings-header .settings-close { float:none; flex:0 0 40px; width:40px; height:40px; padding:0; border-radius:13px; font-size:1.3rem; }
#kb-settings-panel .network-panel { padding:16px; margin:10px 0; border-radius:18px; border-color:#34577e; background:linear-gradient(145deg,#173454,#132943) !important; box-shadow:0 8px 20px rgba(0,8,24,.2); }
#kb-settings-panel .settings-control-kicker { margin:0 0 10px; color:#80baff !important; font-size:.72rem; font-weight:800; letter-spacing:.11em; text-transform:uppercase; }
#kb-settings-panel .switch-row { align-items:center; gap:14px; font-size:1rem; }
#kb-settings-panel .switch-row input { flex-basis:54px; width:54px; height:30px; border:1px solid #426080; background:#29405b; }
#kb-settings-panel .switch-row input:after { width:22px; height:22px; }
#kb-settings-panel .switch-row input:checked { background:linear-gradient(90deg,#2387ff,#28b9d4); border-color:#58b8ff; box-shadow:0 0 16px rgba(50,153,255,.26); }
#kb-settings-panel .switch-row input:checked:after { transform:translateX(23px); }
#kb-settings-panel .network-panel .control-note { margin:10px 0 0 68px; font-size:.84rem; line-height:1.45; }
#kb-settings-panel .settings-group { border-radius:18px; }
@media(max-width:520px) { #kb-settings-panel:not([hidden]) { padding-left:10px; padding-right:10px; } #kb-settings-panel .settings-card { padding:14px; border-radius:20px; } #kb-settings-panel .settings-header { top:-14px; margin:-14px -14px 12px; padding:14px; border-radius:20px 20px 0 0; } #kb-settings-panel .network-panel { padding:14px; } #kb-settings-panel .network-panel .control-note { margin-left:0; } }

/* Guía de uso incluida al final de Ajustes. */
#app-guide { margin-top:16px !important; border-color:#3b92ff !important; background:linear-gradient(150deg,#173454,#11243b) !important; }
#app-guide h3 { margin:0 0 7px; font-size:1.08rem; }
#app-guide .guide-details { margin-top:14px; border-top:1px solid #315783; padding-top:12px; }
#app-guide summary { cursor:pointer; padding:11px 13px; border:1px solid #3b92ff; border-radius:12px; background:#17385f; color:#eaf4ff; font-weight:750; }
#app-guide .guide-content { padding:8px 3px 0; }
#app-guide .guide-content h4 { margin:16px 0 5px; color:#8cc7ff !important; font-size:.98rem; }
#app-guide .guide-content p { margin:0; color:#c5d7ea !important; font-size:.9rem; line-height:1.55; }
#app-guide .guide-content strong { color:#fff; }

/* Acceso permanente y evidente para borrar la conversación actual. */
.killoblan-chat__header-actions { display:flex; flex:0 0 auto; align-items:center; gap:8px; }
.killoblan-chat__header-actions button { flex:0 0 40px; width:40px; height:40px; min-width:40px; padding:0 !important; display:inline-grid; place-items:center; border-radius:13px; }
.killoblan-chat__clear-button { background:#30233a !important; border:1px solid #79516c !important; color:#ffd7e5 !important; font-size:22px !important; }
.killoblan-chat__clear-button:hover { background:#4b2940 !important; border-color:#d07b9b !important; }
.killoblan-chat__clear-button:focus-visible { outline:3px solid #ffb5d1; outline-offset:2px; }
.killoblan-chat__clear-button span { line-height:1; transform:rotate(180deg); }
@media(max-width:360px) { .killoblan-chat__identity { gap:6px; } .killoblan-chat__logo { width:30px; height:30px; } .killoblan-chat__header-actions { gap:5px; } .killoblan-chat__header-actions button { flex-basis:36px; width:36px; height:36px; min-width:36px; } }

#kb-settings-panel #local-ai-download,#kb-settings-panel #local-ai-reload { margin:10px 8px 0 0; }

/* Previsualización de imagen adjunta, siempre local hasta autorización */
.killoblan-attachment__image { display:block; max-width:min(100%,320px); max-height:260px; object-fit:contain; margin:8px auto 0; border-radius:10px; }
/* Confirmación explícita antes de transmitir cada fotografía a Cloudflare */
#killoblan-image-consent { width:min(92vw,440px); border:1px solid #597400; border-radius:16px; padding:20px; background:#080a03; color:#fff; }
#killoblan-image-consent::backdrop { background:rgba(0,0,0,.78); }
#killoblan-image-consent p { line-height:1.5; }
.killoblan-image-consent__actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:8px; margin-top:16px; }
.killoblan-image-consent__actions button { border:1px solid #597400; border-radius:10px; padding:10px 12px; background:#172100; color:#b7ff00; }
/* Adjuntos locales: identificación y previsualización de texto */
.killoblan-chat-message--attachment { align-self:flex-end; max-width:88%; }
.killoblan-attachment__label { font-weight:600; overflow-wrap:anywhere; }
.killoblan-attachment__note { margin:8px 0 0; font-size:.86rem; }
.killoblan-attachment__preview { margin-top:8px; padding-top:6px; border-top:1px solid currentColor; }
.killoblan-attachment__preview summary { cursor:pointer; }
.killoblan-attachment__preview pre { max-height:220px; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; }
/* Copia 1: reproductor compacto para mensajes de voz grabados localmente. */
.killoblan-chat-message--voice { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; width:min(78%,360px); max-width:88%; padding:9px 12px; }
.killoblan-voice-message__status { flex:1 1 100%; font-size:.84rem; line-height:1.3; }
.killoblan-voice-message__player { display:block; flex:1 1 180px; width:100%; max-width:260px; height:38px; accent-color:#b7ff00; }
.killoblan-voice-message__duration { font-size:.78rem; opacity:.9; }
.killoblan-chat-message--voice-error .killoblan-voice-message__status { color:#ffb2a8 !important; }
/* Copy 1: clear listening state on the chat microphone. */
.killoblan-chat__voice-orb-button.is-listening { background: radial-gradient(circle at 35% 30%, #ffaaa5, #ef3434 56%, #9e1414) !important; box-shadow: 0 0 0 5px rgba(239,52,52,.22), 0 0 20px rgba(239,52,52,.62) !important; }
.killoblan-chat__voice-orb-button[aria-pressed="true"] { outline: 2px solid #ff716a; outline-offset: 2px; }

/* Copia 1: alternar visibilidad de cada clave; ocultarla al limpiar el panel. */
.owner-password-field { display:flex; align-items:stretch; gap:7px; width:100%; margin:7px 0 12px; }
#owner-dialog .owner-password-field input { flex:1 1 auto; min-width:0; margin:0; }
#owner-dialog .owner-password-toggle { flex:0 0 auto; min-width:76px; border:1px solid #3b92ff; border-radius:10px; padding:9px 12px; background:#1769d2; color:#fff; font-weight:700; }
#owner-dialog .owner-password-toggle:focus-visible { outline:3px solid #8cc7ff; outline-offset:2px; }

/* Pantalla principal de Copia 1: chat a pantalla completa, negro y verde fluorescente. */
:root { color-scheme:dark; --ink:#b7ff00; --muted:#a8df35; --paper:#000; --card:#050505; --accent:#b7ff00; --line:#344400; --soft:#111800; --shadow:0 0 18px rgba(183,255,0,.08); }
html,body { width:100%; height:100%; min-height:100%; margin:0; overflow:hidden; background:#000 !important; color:#b7ff00 !important; }
.app { width:100%; height:100vh; height:100dvh; max-width:none; min-height:0; margin:0; padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.killoblan-chat { position:relative; width:100%; height:100%; min-height:0; max-height:none; padding:10px clamp(10px,2vw,22px) max(10px,env(safe-area-inset-bottom)); gap:10px; border:0; border-radius:0; background:#000 !important; color:#b7ff00 !important; }
.killoblan-chat__header { flex:0 0 auto; min-height:54px; gap:10px; color:#b7ff00; }
.killoblan-chat__identity { gap:9px; flex:0 0 auto; }
.killoblan-chat__context { display:flex; flex:1 1 auto; min-width:0; flex-direction:column; gap:2px; padding:0 8px; overflow:hidden; color:#b7ff00; }
.killoblan-chat__context-profile { overflow:hidden; color:#8eb82a; font-size:.78rem; font-weight:750; text-overflow:ellipsis; white-space:nowrap; }
.killoblan-chat__context-title { overflow:hidden; color:#fff; font-size:.84rem; line-height:1.25; text-overflow:ellipsis; white-space:nowrap; }
@media(max-width:520px) { .killoblan-chat__context { padding:0 2px; } .killoblan-chat__context-profile { font-size:.7rem; } .killoblan-chat__context-title { font-size:.76rem; } }
.killoblan-chat__identity h2,.killoblan-chat__eyebrow { color:#b7ff00 !important; }
.killoblan-chat__eyebrow { opacity:.82; }
.killoblan-chat__menu-button { flex:0 0 44px; width:44px; height:44px; padding:0 !important; border:1px solid #536d00 !important; border-radius:12px !important; background:#050505 !important; color:#b7ff00 !important; font-size:23px !important; }
.killoblan-chat__header-actions button { background:#050505 !important; color:#b7ff00 !important; border-color:#536d00 !important; }
.killoblan-chat__clear-button { color:#b7ff00 !important; border-color:#536d00 !important; }
.killoblan-chat__log { flex:1 1 auto; min-height:0; max-height:none; padding:14px clamp(8px,3vw,28px); overflow:auto; border:1px solid #263500; border-radius:14px; background:#030303 !important; color:#b7ff00 !important; }
.killoblan-chat__welcome { color:#b7ff00 !important; }
.killoblan-chat-message { font-size:clamp(17px,4.8vw,20px); line-height:1.5; padding:14px 17px; }
.killoblan-chat-message--user { background:#5b4b35 !important; color:#b7ff00 !important; border:1px solid #8a7350; }
.killoblan-chat-message--assistant { background:#5b4b35 !important; color:#fff !important; border:1px solid #8a7350; }
.killoblan-chat-message--voice { font-size:22px; }
.killoblan-chat-message--thinking { font-size:22px; }
.killoblan-chat-message--assistant * { color:#fff !important; }
.killoblan-chat-message--thinking { color:#b7ff00 !important; }
.killoblan-chat-message--thinking * { color:inherit; }
.killoblan-chat-message--thinking { color:#b7ff00; }
.killoblan-chat__composer { flex:0 0 auto; align-items:flex-end; min-height:58px; padding:8px; border:1px solid #587500; border-radius:18px; background:#080a03 !important; }
.killoblan-chat__composer textarea { min-height:42px; max-height:30dvh; padding:8px 10px; resize:vertical; color:#b7ff00 !important; caret-color:#b7ff00; }
.killoblan-chat__composer textarea::placeholder { color:#8eb82a !important; }
.killoblan-chat__composer #killoblan-chat-send { min-height:42px; border:1px solid #b7ff00 !important; border-radius:12px; background:#172100 !important; color:#d2ff69 !important; }
.killoblan-chat__voice-orb-button { color:#b7ff00 !important; }
.killoblan-chat__tools[hidden] { display:none !important; }
.killoblan-chat__tools:not([hidden]) { position:fixed; inset:0; z-index:12000; display:block; max-height:none; padding:0; overflow:hidden; }
.killoblan-chat__tools-scrim { position:absolute; inset:0; background:rgba(0,0,0,.74); }
.killoblan-chat__tools-panel { position:absolute; inset:0 auto 0 0; display:flex; flex-direction:column; gap:10px; width:min(84vw,360px); padding:max(12px,env(safe-area-inset-top)) 14px max(14px,env(safe-area-inset-bottom)); overflow-y:auto; border-right:1px solid #587500; background:#030303; color:#b7ff00; box-shadow:12px 0 38px #000b; animation:kb-drawer-in .18s ease-out; }
.killoblan-chat__tools-header { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 0 12px; border-bottom:1px solid #344400; }
.killoblan-chat__tools-header h3 { margin:0; color:#b7ff00; font-size:1.2rem; }
.killoblan-chat__tools-list { display:grid; gap:8px; }
.killoblan-chat__tools-list button { width:100%; min-height:46px; padding:11px 14px; text-align:left; border:1px solid #344900; border-radius:12px; background:#080a03; color:#b7ff00; font-size:.96rem; }
.killoblan-chat__tools-list button:hover,.killoblan-chat__tools-list button:focus-visible { outline:2px solid #b7ff00; outline-offset:1px; background:#151d00; }
.killoblan-chat__tools-list .killoblan-chat__tools-close { width:40px; min-height:40px; padding:0; text-align:center; font-size:24px; }
@keyframes kb-drawer-in { from { transform:translateX(-12px); opacity:.65; } to { transform:translateX(0); opacity:1; } }
#kb-settings-panel:not([hidden]) { background:rgba(0,0,0,.9) !important; color:#b7ff00 !important; }
.killoblan-chat__tools-group { display:grid; gap:7px; padding:9px 0 11px; border-bottom:1px solid #263500; }
.killoblan-chat__tools-group h4 { margin:0 2px 3px; color:#8eb82a; font-size:.72rem; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }
#kb-settings-panel .settings-card { background:#030303 !important; color:#b7ff00 !important; border-color:#587500 !important; }
#kb-settings-panel .settings-header { background:#030303 !important; border-color:#344400 !important; }
#kb-settings-panel .settings-group,#kb-settings-panel .network-panel,#kb-settings-panel .memory-panel,#kb-settings-panel .voice-panel,#kb-settings-panel .saved-section { background:#080a03 !important; color:#b7ff00 !important; border-color:#344900 !important; }
#kb-settings-panel h2,#kb-settings-panel h3,#kb-settings-panel h4,#kb-settings-panel label,#kb-settings-panel p,#kb-settings-panel .control-note,#kb-settings-panel .settings-control-kicker { color:#b7ff00 !important; }
#kb-settings-panel button,#kb-settings-panel input,#kb-settings-panel select,#kb-settings-panel textarea { background:#050505 !important; color:#b7ff00 !important; border-color:#587500 !important; }
#kb-settings-panel input::placeholder,#kb-settings-panel textarea::placeholder { color:#8eb82a !important; }
#kb-settings-panel .switch-row input:checked { background:#344900 !important; border-color:#b7ff00 !important; }
#owner-dialog { background:#030303 !important; color:#b7ff00 !important; border-color:#587500 !important; }
#owner-dialog label,#owner-dialog p,#owner-dialog h2,#owner-dialog h3 { color:#b7ff00 !important; }
#owner-dialog input,#owner-dialog textarea,#owner-dialog select,#owner-dialog button { background:#050505 !important; color:#b7ff00 !important; border-color:#587500 !important; }
@media(max-width:520px) { .app { padding-top:env(safe-area-inset-top); } .killoblan-chat { min-height:0; height:100vh; height:100dvh; padding-left:10px; padding-right:10px; } .killoblan-chat__log { max-height:none; min-height:0; } .killoblan-chat__tools:not([hidden]) { max-height:none; } }

/* Indicador de espera propio de Killoblan: emblema Horus en una insignia circular animada. */
.killoblan-chat-message--thinking { display:inline-flex; align-items:center; gap:10px; min-height:50px; padding:7px 12px 7px 7px; }
.killoblan-thinking__emblem { position:relative; display:grid; flex:0 0 36px; width:36px; height:36px; place-items:center; border-radius:50%; background:#102b4b; box-shadow:0 0 0 3px rgba(59,146,255,.13); }
.killoblan-thinking__emblem::before { content:""; position:absolute; inset:-3px; border-radius:50%; border:2px solid transparent; border-top-color:#67b2ff; border-right-color:rgba(103,178,255,.38); animation:killoblan-thinking-spin 1.15s linear infinite; }
.killoblan-thinking__emblem img { display:block; width:25px; height:25px; object-fit:contain; animation:killoblan-thinking-pulse 1.55s ease-in-out infinite; }
.killoblan-thinking__label { color:#fff; font-size:1rem; line-height:1.3; }
.killoblan-thinking__text-group { display:flex; flex-direction:column; gap:4px; }
.killoblan-thinking__slow-message { color:#fff; font-size:.9rem; line-height:1.35; opacity:1; }
.killoblan-thinking__share-link { color:#b7ff00; text-decoration:underline; text-underline-offset:2px; cursor:pointer; }
.killoblan-thinking__share-link:hover,.killoblan-thinking__share-link:focus-visible { color:#d2ff69; outline:2px solid #b7ff00; outline-offset:3px; }
.killoblan-thinking__slow-message[hidden] { display:none; }
@keyframes killoblan-thinking-spin { to { transform:rotate(360deg); } }
@keyframes killoblan-thinking-pulse { 0%,100% { transform:scale(.94); opacity:.82; } 50% { transform:scale(1.06); opacity:1; } }
@media (prefers-reduced-motion: reduce) { .killoblan-thinking__emblem::before,.killoblan-thinking__emblem img { animation:none; } }

/* Cabecera compacta en móvil: mantiene visibles menú, borrar y Ajustes. */
@media(max-width:520px) {
  .killoblan-chat__header { width:100%; min-width:0; gap:6px; flex-wrap:nowrap; }
  .killoblan-chat__menu-button { flex:0 0 38px; width:38px; }
  .killoblan-chat__identity { flex:1 1 auto; min-width:0; gap:6px; }
  .killoblan-chat__logo { width:32px; height:32px; }
  .killoblan-chat__orb,.killoblan-chat__eyebrow,.killoblan-chat__context { display:none; }
  .killoblan-chat__identity>div { min-width:0; }
  .killoblan-chat__identity h2 { overflow:hidden; font-size:.95rem; text-overflow:ellipsis; white-space:nowrap; }
  .killoblan-chat__header-actions { flex:0 0 auto; gap:5px; }
  .killoblan-chat__header-actions button { flex-basis:36px; width:36px; min-width:36px; height:36px; }
}

/* Móvil: chat amplio, pero deja un margen inferior para navegación y escritura. */
@media(max-width:520px) {
  .app {
    width:100%;
    height:calc(100vh - 72px);
    height:calc(100dvh - 72px);
    min-height:0;
    padding:max(6px,env(safe-area-inset-top)) 8px max(10px,env(safe-area-inset-bottom));
  }
  .killoblan-chat {
    width:100%;
    height:100%;
    min-height:0;
    max-height:100%;
    margin:0 auto;
    padding:8px;
    border:1px solid #536d00;
    border-radius:16px;
  }
  .killoblan-chat__log { flex:1 1 0; min-height:0; overflow-y:auto; }
  .killoblan-chat__composer { flex:0 0 auto; }
}

/* Controles de lectura local debajo de cada respuesta del asistente. */
.killoblan-answer-audio { display:flex; align-items:center; gap:7px; margin-top:9px; }
.killoblan-answer-audio button { display:inline-grid; place-items:center; flex:0 0 34px; width:34px; min-width:34px; min-height:34px; height:34px; padding:0 !important; border:1px solid #8a7350 !important; border-radius:50% !important; background:#453925 !important; color:#fff !important; font-size:16px !important; line-height:1; }
.killoblan-answer-audio button:focus-visible { outline:2px solid #fff !important; outline-offset:2px; }
.killoblan-answer-audio__play::before { content:'🔊'; }
.killoblan-answer-audio__stop::before { content:'⏹'; font-size:13px; }

/* Memory suite prototype: readable compact controls in Settings only. */
#memory-suite details { margin:10px 0; padding:10px; border:1px solid #3f5368; border-radius:10px; }
#memory-suite summary { cursor:pointer; color:#b7ff00; font-weight:700; padding:8px 0; }
#memory-suite form { display:grid; gap:8px; margin:10px 0; }
#memory-suite textarea, #memory-suite input, #memory-suite select { max-width:100%; box-sizing:border-box; }
#memory-suite .memory-suite-row { display:flex; gap:10px; justify-content:space-between; align-items:center; padding:8px; margin:5px 0; border:1px solid #394b5e; border-radius:8px; }
.memory-suggestion-card { margin:10px 0; padding:12px; border:1px solid #83b923; border-radius:12px; background:#101811; color:#f7f4ec; }
.memory-suggestion-card div { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.memory-suggestion-card button { padding:8px 12px; }

.killoblan-response-rating { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:10px; }
.killoblan-response-rating small { opacity:.8; }
.killoblan-response-rating button { border:1px solid #506578; border-radius:8px; padding:5px 9px; background:#101820; color:#f7f4ec; }

.killoblan-screen-ocr-preview { max-height: 28dvh; overflow: auto; padding: 8px 12px; color: #dce8f4; background: #101f33; border: 1px solid #29486b; border-radius: 10px; }
.killoblan-screen-ocr-preview pre { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }

/* Copia 4: chat algo menor que la pantalla completa, fondo azul, consultas verde fluorescente y respuestas blancas. */
:root {
  --ink:#eaf4ff;
  --muted:#aac1dc;
  --paper:#071a35;
  --card:#0d2444;
  --accent:#b7ff00;
  --line:#294b73;
  --soft:#102b4c;
}
html, body { background:#071a35 !important; color:#eaf4ff !important; }
.app, .killoblan-chat { background:#071a35 !important; color:#eaf4ff !important; }
.killoblan-chat__header,
.killoblan-chat__identity h2,
.killoblan-chat__eyebrow { color:#eaf4ff !important; }
.killoblan-chat__log { background:#0a2040 !important; color:#eaf4ff !important; border-color:#294b73 !important; }
.killoblan-chat__welcome { color:#eaf4ff !important; }
.killoblan-chat-message--user { background:#102b4c !important; color:#b7ff00 !important; border-color:#b7ff00 !important; }
.killoblan-chat-message--user * { color:#b7ff00 !important; }
.killoblan-chat-message--assistant { background:#102b4c !important; color:#ffffff !important; border-color:#294b73 !important; }
.killoblan-chat-message--assistant * { color:#ffffff !important; }
.killoblan-chat-message--thinking { background:#102b4c !important; color:#ffffff !important; }
.killoblan-chat__composer { background:#0a2040 !important; border-color:#294b73 !important; }
.killoblan-chat__composer textarea { background:#071a35 !important; color:#b7ff00 !important; border-color:#42658d !important; }
.killoblan-chat__composer textarea::placeholder { color:#aac1dc !important; }
/* Lectura aprobada: mensajes grandes; se conserva el margen inferior para escritura y navegación. */
.killoblan-chat-message { font-size:28px; line-height:1.45; }
@media(max-width:520px) {
  .app { height:calc(100vh - 72px); height:calc(100dvh - 72px); }
  .killoblan-chat { height:100%; max-height:100%; }
}

/* Guía ilustrada de Killoblan 4: pictogramas, diagramas en tarjetas y lectura cómoda. */
#app-guide .guide-legend { display:flex; flex-wrap:wrap; gap:7px; margin:10px 0 16px; }
#app-guide .guide-legend span { padding:6px 9px; border:1px solid #315783; border-radius:999px; background:#0b1b30; color:#d9eaff; font-size:.86rem; }
#app-guide .guide-grid,#app-guide .guide-memory-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,275px),1fr)); gap:10px; margin:10px 0 16px; }
#app-guide .guide-card,#app-guide .guide-memory { display:flex; align-items:flex-start; gap:11px; padding:12px; border:1px solid #315783; border-radius:15px; background:linear-gradient(145deg,#102844,#0b1b30); box-shadow:0 5px 16px rgba(0,0,0,.18); }
#app-guide .guide-icon { display:grid; flex:0 0 42px; width:42px; height:42px; place-items:center; border:1px solid #4381ba; border-radius:13px; background:#16395d; color:#fff; font-size:23px; line-height:1; }
#app-guide .guide-card>div { min-width:0; }
#app-guide .guide-card strong,#app-guide .guide-memory strong { display:block; margin:1px 0 5px; color:#fff; font-size:.97rem; line-height:1.35; }
#app-guide .guide-card p,#app-guide .guide-memory p { margin:4px 0 0; color:#d6e5f4 !important; font-size:.92rem; line-height:1.58; }
#app-guide .guide-memory { display:block; border-color:#42678d; background:linear-gradient(145deg,#153354,#0d2037); }
#app-guide .guide-memory-title { display:flex; align-items:center; gap:10px; }
#app-guide .guide-memory-title .guide-icon { margin-bottom:4px; }
#app-guide .guide-note { margin:11px 0 16px !important; padding:12px 14px; border-left:4px solid #62b7ff; border-radius:8px 13px 13px 8px; background:#102b49; color:#e3f2ff !important; }
#app-guide .guide-illustration { margin:12px 0 18px; padding:12px; border:1px solid #315783; border-radius:17px; background:linear-gradient(145deg,#102844,#0b1b30); }
#app-guide .guide-illustration svg { display:block; width:100%; height:auto; }
#app-guide .guide-illustration figcaption { margin-top:8px; color:#c5d7ea; font-size:.88rem; line-height:1.45; text-align:center; }
#app-guide .guide-content h4 { margin-top:25px; padding-bottom:7px; border-bottom:1px solid #315783; font-size:1.07rem; }
@media(max-width:520px) { #app-guide .guide-card,#app-guide .guide-memory { padding:11px; gap:9px; } #app-guide .guide-icon { flex-basis:38px; width:38px; height:38px; font-size:21px; } #app-guide .guide-card p,#app-guide .guide-memory p { font-size:.91rem; } }

/* Revisión 4.4: asegurar que el progreso y la valoración se vean dentro del chat. */
#killoblan-chat-log .killoblan-chat-message--thinking { display:flex !important; visibility:visible; opacity:1; }
#killoblan-chat-log .killoblan-chat-message--thinking .killoblan-thinking__label { color:#fff !important; }
#killoblan-chat-log .killoblan-response-rating { display:flex; align-items:center; flex-wrap:wrap; gap:8px; width:100%; margin-top:12px; }
#killoblan-chat-log .killoblan-response-rating small { flex:1 1 100%; color:#fff !important; font-size:.78em; }
#killoblan-chat-log .killoblan-response-rating button { min-width:44px; min-height:38px; border:1px solid #b7ff00 !important; border-radius:9px; padding:6px 12px; background:#101820 !important; color:#fff !important; }
#killoblan-chat-log .killoblan-response-rating button:focus-visible { outline:3px solid #b7ff00; outline-offset:2px; }
#killoblan-chat-log .killoblan-chat-message--voice-status { border-color:#f0a45d !important; color:#fff !important; }

/* Windows 4.4 PWA: desktop-friendly layout and the remembered compact chat. */
@media (min-width: 850px) { .app { max-width: 1200px; margin-inline:auto; } .killoblan-chat { max-width: 1100px; margin-inline:auto; } }
.killoblan-chat-message { font-size: clamp(15px, 1.25vw, 18px) !important; }
.killoblan-chat__voice-orb-button.is-listening { background:#d71920 !important; box-shadow:0 0 0 5px rgba(215,25,32,.2),0 0 20px rgba(215,25,32,.55) !important; }

/* Windows PWA: consent preview shows the exact complete thread candidate. */
#killoblan-thread-consent { width:min(96vw,760px); max-height:90vh; overflow:auto; border:1px solid #315783; border-radius:18px; padding:22px; background:#030d19; color:#eaf4ff; }
#killoblan-thread-consent::backdrop { background:rgba(0,0,0,.78); }
#killoblan-thread-consent h3,#killoblan-thread-consent p { color:#eaf4ff; line-height:1.5; }
#killoblan-thread-consent-preview { max-height:35vh; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; padding:12px; border:1px solid #34577e; border-radius:10px; color:#eaf4ff; background:#0b1b30; }
#killoblan-thread-consent .killoblan-image-consent__actions button { min-height:42px; }

#killoblan-memory-consent-preview { max-height:25vh; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; padding:12px; border:1px solid #34577e; border-radius:10px; color:#eaf4ff; background:#0b1b30; }
#killoblan-thread-consent h4 { color:#b7ff00; margin:14px 0 4px; }

.memory-research-results,.memory-research-papers { display:grid; gap:10px; margin-top:12px; }
.memory-research-result,.memory-research-paper { padding:12px; border:1px solid #315783; border-radius:12px; background:#0b1b30; color:#eaf4ff; }
.memory-research-result h4,.memory-research-paper h4 { margin:0 0 6px; color:#b7ff00; }
.memory-research-result p,.memory-research-paper p { white-space:pre-wrap; line-height:1.5; }
.memory-research-result a,.memory-research-paper a { color:#8cc7ff; }
.memory-research-guide { line-height:1.6; }
.memory-research-guide h2,.memory-research-guide h3 { color:#b7ff00; }
.memory-research-guide a { color:#8cc7ff; }
#memory-research-section input[type=search] { margin:6px 0; }
#memory-research-share-toggle { width:24px; min-width:24px; }
#killoblan-research-consent-preview { max-height:25vh; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; padding:12px; border:1px solid #34577e; border-radius:10px; background:#0b1b30; color:#eaf4ff; }

.memory-evolution-preview { display:block; max-height:32vh; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; padding:12px; margin:12px 0; border:1px solid #315783; border-radius:12px; background:#0b1b30; color:#eaf4ff; line-height:1.5; }
#memory-evolution-section input[type=password] { width:100%; margin:8px 0; }
#memory-evolution-apply:disabled,#memory-evolution-import-apply:disabled { opacity:.55; }

.web-result-image{display:block;width:100%;max-height:360px;object-fit:contain;background:#eef2ee;border-radius:12px;margin:8px 0 10px}
