/* Claudbar · diseño de panel con barra de iconos a la derecha (colores y mascota propios) */
body { overflow: hidden; }
.shell { display: flex; height: 100vh; background: var(--bg); }
.shell > .app { flex: 1; min-width: 0; height: 100vh; }

/* ---------- Barra de iconos ---------- */
.rail { flex: none; width: 62px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px 10px;
  background: #11121b; border-left: 1px solid rgba(255, 255, 255, .06); overflow-y: auto; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-btn { width: 54px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px; border: 0; border-radius: 12px;
  background: transparent; color: #b8b9cc; cursor: pointer; font: inherit; transition: background .15s, color .15s, transform .15s var(--ease); }
.rail-btn .ri { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; font-size: 17px; line-height: 1; transition: background .15s, box-shadow .2s; }
.rail-btn .rl { font-size: 10.5px; line-height: 1.1; letter-spacing: .01em; white-space: nowrap; }
.rail-btn:hover { color: #fff; }
.rail-btn:hover .ri { background: rgba(167, 139, 250, .14); }
.rail-btn[aria-current="true"], .rail-btn[aria-pressed="true"], .rail-btn[aria-expanded="true"] { color: #c4b5fd; }
.rail-btn[aria-current="true"] .ri, .rail-btn[aria-pressed="true"] .ri, .rail-btn[aria-expanded="true"] .ri { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(124, 58, 237, .4); }
.rail-btn.small .ri { width: 32px; height: 32px; font-size: 16px; }
.rail-sep { width: 30px; height: 1px; margin: 6px 0; background: rgba(255, 255, 255, .08); }
.rail .spacer { flex: 1; }
.rail-avatar { width: 34px; height: 34px; margin-top: 4px; border-radius: 50%; border: 2px solid rgba(167, 139, 250, .5); background: var(--grad) center / cover no-repeat;
  color: #fff; font-size: 15px; cursor: pointer; display: grid; place-items: center; }
.rail-avatar.has-photo { color: transparent; }

/* Cabecera: definida solo en ui/r6-polish.css */

/* ---------- Inicio ---------- */
.hero { display: flex; flex-direction: column; text-align: left; padding: 18px 18px 8px; gap: 0; overflow-y: auto; justify-content: flex-start; }
.hero-top { display: flex; align-items: flex-end; gap: 10px; min-height: 92px; margin-top: auto; }
.hero .hero-mascot { width: 96px; height: 80px; margin: 0; flex: none; }
.hero .cloud-bubble { margin: 0 0 18px; max-width: none; flex: 1; padding: 8px 12px; text-align: left; border-radius: 14px 14px 14px 4px; }
.hero .cloud-bubble::before { left: -6px; top: auto; bottom: 10px; margin: 0; transform: rotate(-45deg); }
.hero .cloud-bubble #greet-main { font-size: 13px; font-weight: 600; margin: 0; line-height: 1.4; }
.hero .cloud-bubble .greet-sub { font-size: 11.5px; margin: 2px 0 0; min-height: 0; }
.hero .cloud-bubble .greet-sub:empty { display: none; }
.hero .hero-hello { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin: 14px 0 2px; line-height: 1.1; }
.hero .hero-ask { font-size: 17px; font-weight: 700; color: var(--text); margin: 0 0 18px; max-width: none; text-align: left; }
.hero .cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: auto; }

.feature-card { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; text-align: left; color: var(--text);
  background: #1a1b27; border: 1px solid rgba(255, 255, 255, .07); font: inherit; transition: border-color .2s, transform .2s var(--ease), box-shadow .2s; animation: fade-up .4s var(--ease) both; }
.feature-card:nth-child(2) { animation-delay: .05s; } .feature-card:nth-child(3) { animation-delay: .1s; }
button.feature-card { cursor: pointer; width: 100%; }
.feature-card:hover { border-color: rgba(167, 139, 250, .5); }
.feature-card .fc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.feature-card b { font-size: 15px; font-weight: 700; }
.feature-card p, .feature-card small { font-size: 12.5px; color: #a9abc0; line-height: 1.45; margin: 0; }
.feature-card .fc-arrow { font-size: 18px; color: #c9cadb; transition: transform .2s var(--ease); }
.feature-card:hover .fc-arrow { color: #fff; }

.feature-agent { padding: 16px 16px 16px; overflow: hidden;
  background: radial-gradient(260px 160px at 100% 100%, rgba(34, 211, 238, .18), transparent 70%), radial-gradient(300px 180px at 0% 0%, rgba(124, 58, 237, .28), transparent 70%), #1c1a2e;
  border-color: rgba(167, 139, 250, .25); }
.fc-cta { align-self: flex-start; margin-top: 10px; padding: 7px 14px; border: 0; border-radius: 999px; background: #fff; color: #17142a; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .25); transition: transform .15s var(--ease), box-shadow .15s; }
.fc-mascot { position: relative; flex: none; width: 70px; height: 70px; align-self: flex-end; margin: 0 -4px -6px 0; }
.fc-cloud { position: absolute; inset: 8px 0 0 0; display: grid; place-items: center; font-size: 46px; filter: drop-shadow(0 8px 14px rgba(124, 58, 237, .5)); animation: m-float 3.2s ease-in-out infinite; }
.fc-hand { position: absolute; right: -2px; top: 0; font-size: 22px; transform: rotate(18deg); animation: m-gesture 1.6s ease-in-out infinite alternate; transform-origin: bottom left; }

.quick-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.quick-row .example-btn { display: inline-flex; flex-direction: row; padding: 6px 11px; border-radius: 999px; font-size: 12px; background: transparent; border: 1px solid var(--border); color: #c9cadb; }
.quick-row .example-btn:hover { border-color: var(--accent-primary); color: #fff; background: rgba(167, 139, 250, .08); transform: none; }

/* ---------- Herramientas sobre el cuadro de texto ---------- */
.composer-tools { display: flex; align-items: center; gap: 4px; padding: 6px 12px 6px; }
.composer-tools .spacer { flex: 1; }
.composer-tools .model-btn { flex: 0 1 auto; max-width: 62%; padding: 5px 10px 5px 8px; border-radius: 999px; background: #1a1b27; border: 1px solid rgba(255, 255, 255, .08); gap: 6px; }
.composer-tools .model-btn:hover { border-color: rgba(167, 139, 250, .5); }
.composer-tools .model-text small { display: none; }
.composer-tools .model-text strong { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-tools .model-dot { font-size: 13px; }
.tool-icon { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: #c9cadb; font-size: 15px; cursor: pointer; transition: background .15s, color .15s; }
.tool-icon:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.tool-icon.accent { background: var(--grad); color: #fff; font-weight: 700; box-shadow: 0 4px 12px rgba(124, 58, 237, .35); }
.tool-icon.accent:hover { filter: brightness(1.1); }

.app .composer { margin: 0 12px; border-radius: 16px; border: 1px solid #34364c; background: #161722; padding: 10px 12px 8px; transition: border-color .2s, box-shadow .2s; }
.app .composer:focus-within { border-color: rgba(167, 139, 250, .7); box-shadow: 0 0 0 3px rgba(167, 139, 250, .15); }
.app .composer textarea { min-height: 44px; font-size: 14px; background: transparent; border: 0; }
.panel-foot { display: flex; align-items: center; gap: 6px; padding: 7px 16px 10px; font-size: 11px; color: var(--muted); }
.panel-foot .spacer { flex: 1; }
.foot-plan { font-weight: 600; background: linear-gradient(90deg, #a78bfa, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.foot-icon { width: 24px; height: 24px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.foot-icon:hover { color: #fff; background: rgba(255, 255, 255, .07); }

/* El menú de modelos se abre ahora desde abajo */
.app #model-menu { bottom: 150px; }

@media (max-width: 360px) {
  .rail { width: 52px; } .rail-btn { width: 46px; } .rail-btn .rl { font-size: 9.5px; }
  .hero-hello { font-size: 28px; }
}
:root[data-reduce-motion] .fc-cloud, :root[data-reduce-motion] .fc-hand, :root[data-reduce-motion] .feature-card { animation: none !important; } 

/* ---------- Scrollbars oscuras y discretas en todo el panel ---------- */
* { scrollbar-width: thin; scrollbar-color: transparent transparent; }
*:hover { scrollbar-color: rgba(167, 139, 250, .35) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; background: transparent; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: transparent; border-radius: 6px; }
:hover::-webkit-scrollbar-thumb { background: rgba(167, 139, 250, .35); }
::-webkit-scrollbar-button { display: none; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- Inicio compacto: cabe sin desplazarse ---------- */
.hero { padding: 14px 16px 6px; }
.hero-top { min-height: 0; margin-top: 0; }
.hero .hero-mascot { width: 82px; height: 68px; }
.hero .cloud-bubble { margin-bottom: 14px; }
.hero .hero-hello { font-size: 30px; margin: 8px 0 2px; }
.hero .hero-ask { font-size: 15.5px; margin: 0 0 14px; }
.hero .cards { gap: 10px; margin-bottom: 0; }
.feature-agent { padding: 14px 14px; }
.feature-agent p { max-width: 230px; }
.fc-cta { margin-top: 8px; }
.fc-mascot { width: 60px; height: 60px; }
.fc-cloud { font-size: 40px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tiles .feature-row { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 13px; }
.tiles .feature-row .fc-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; background: rgba(167, 139, 250, .14); }
.tiles .feature-row b { font-size: 13.5px; }
.tiles .feature-row small { font-size: 11.5px; line-height: 1.35; }
.tiles .feature-row .fc-arrow { position: absolute; right: 12px; top: 12px; font-size: 15px; }
.hero .quick-row { margin-top: 0; }
@media (max-height: 760px) { .hero .quick-row { display: none; } .hero .hero-mascot { width: 70px; height: 58px; } .hero .hero-hello { font-size: 26px; } }

/* ---------- Estilo profesional: barra delgada, iconos de línea, menos color ---------- */
.rail { width: 48px; gap: 2px; padding: 10px 3px 8px; background: #0f1017; border-left: 1px solid rgba(255, 255, 255, .05); }
.rail-btn { width: 42px; gap: 2px; padding: 5px 0; border-radius: 10px; color: #8b8da3; }
.rail-btn .ri { width: 30px; height: 30px; border-radius: 9px; font-size: 0; }
.rail-btn .rl { font-size: 9.5px; font-weight: 500; letter-spacing: 0; }
.rail-btn:hover { color: #e8e8f0; }
.rail-btn:hover .ri { background: rgba(255, 255, 255, .06); }
.rail-btn[aria-current="true"], .rail-btn[aria-pressed="true"], .rail-btn[aria-expanded="true"] { color: #e8e8f0; }
.rail-btn[aria-current="true"] .ri, .rail-btn[aria-pressed="true"] .ri, .rail-btn[aria-expanded="true"] .ri { background: rgba(167, 139, 250, .16); color: #c4b5fd; box-shadow: none; }
.rail-btn.small .ri { width: 30px; height: 30px; }
.rail-sep { width: 22px; }
.rail-avatar { width: 28px; height: 28px; border-width: 1px; font-size: 12px; }
svg { flex: none; }

.feature-card { background: #15161f; border-color: rgba(255, 255, 255, .06); border-radius: 14px; }
.feature-card:hover { border-color: rgba(255, 255, 255, .16); box-shadow: none; transform: none; }
.feature-agent { background: #15161f; border-color: rgba(167, 139, 250, .22); }
.feature-agent b { display: inline-flex; align-items: center; gap: 8px; }
.fc-badge { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 600; color: #c4b5fd; background: rgba(167, 139, 250, .14); vertical-align: middle; }
.fc-cta { background: #f2f2f7; color: #14141c; box-shadow: none; padding: 6px 13px; font-weight: 600; }
.fc-cta:hover { box-shadow: none; background: #fff; }
.fc-mascot { display: grid; place-items: center; width: 52px; height: 52px; margin: 0; align-self: center; border-radius: 14px; color: #c4b5fd; background: rgba(167, 139, 250, .1); }
.tiles .feature-row .fc-ico { background: rgba(255, 255, 255, .05); color: #c9cadb; }
.tiles .feature-row .fc-arrow { color: #6f7188; }
.quick-row .example-btn { gap: 6px; align-items: center; color: #a9abc0; }
.quick-row .example-btn svg { width: 14px; height: 14px; }
.tool-icon { color: #8b8da3; }
.tool-icon.accent { background: rgba(255, 255, 255, .08); color: #e8e8f0; box-shadow: none; }
.tool-icon.accent:hover { background: rgba(255, 255, 255, .14); filter: none; }
.app .composer { border-color: rgba(255, 255, 255, .1); background: #12131b; }
.app .composer:focus-within { border-color: rgba(167, 139, 250, .55); box-shadow: none; }
.send-btn, .icon-btn.mic { display: inline-grid; place-items: center; }
.foot-plan { background: none; color: var(--muted); font-weight: 500; -webkit-text-fill-color: currentColor; }
.foot-icon { display: inline-grid; place-items: center; }
.foot-icon svg { width: 15px; height: 15px; }
.hero .hero-hello { font-weight: 700; }

/* ---------- v4: corporativo, sin elementos caricaturescos ---------- */
.fc-mascot, .brand-logo { display: none !important; }
.hero { justify-content: center; }
.hero .hero-hello { margin-top: 0; }
.ai-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; color: #8b8da3; white-space: nowrap; }
.ai-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #6b6d80; }
.ai-status.ok { color: #9fd8b5; } .ai-status.ok::before { background: #34d399; }
.ai-status.wait::before { background: #fbbf24; } .ai-status.err::before { background: #f87171; }
.composer-tools .model-btn { max-width: 52%; }
.msg-actions .act { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: 7px; color: #8b8da3; }
.msg-actions .act:hover { color: #e8e8f0; background: rgba(255, 255, 255, .07); }
.menu-item.tier b { display: inline-flex; align-items: center; gap: 6px; }
.brand-logo { border-radius: 6px; }
.composer-tools #ai-status { display: none !important; }

/* ---------- Menú "Más": sobrio y elegante ---------- */
.library { background: #0d0e14; backdrop-filter: none; }
.drawer .lib-head { padding: 16px 16px 10px; border-bottom: 1px solid rgba(255,255,255,.05); }
.drawer-title strong { font-size: 15px; font-weight: 600; }
.drawer-title small { font-size: 11.5px; color: #8b8da3; }
.drawer .lib-head .btn-primary { background: rgba(255,255,255,.08); box-shadow: none; color: #e8e8f0; font-weight: 500; border-radius: 8px; }
.drawer-switch { margin: 12px 16px 4px; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.04); }
.drawer-tab { font-weight: 500; border-radius: 8px; color: #8b8da3; }
.drawer[data-view="tools"] .drawer-tab[data-view="tools"], .drawer[data-view="library"] .drawer-tab[data-view="library"] { background: rgba(255,255,255,.09); color: #fff; box-shadow: none; }
.ai-tools { padding: 8px 16px 20px; }
.tool-group { margin-top: 14px; }
.tool-group h4 { font-size: 10.5px; font-weight: 600; color: #6f7188; letter-spacing: .1em; margin: 0 4px 6px; }
.tool-grid { grid-template-columns: 1fr; gap: 1px; border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.05); }
.tool-tile { display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; align-items: center; padding: 10px 12px; border: 0; border-radius: 0; background: #12131b; animation: none; transform: none !important; box-shadow: none !important; }
.tool-tile::before { display: none; }
.tool-tile:hover { background: #181924; }
.tool-tile.active { background: rgba(167,139,250,.1); }
.tool-ico { grid-row: span 2; width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.05); color: #a9abc0; font-size: 14px; }
.tool-tile:hover .tool-ico { color: #e8e8f0; }
.tool-tile.active .tool-ico { background: rgba(167,139,250,.18); color: #c4b5fd; }
.tool-tile b { font-size: 13px; font-weight: 500; color: #ecebf5; }
.tool-tile small { font-size: 11.5px; color: #7d7f95; }

.feature-agent b { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.fc-badge { flex: none; margin-left: 0; }

/* Pie: plan con medalla */
.foot-plan#foot-plan { display: inline-flex; align-items: center; gap: 7px; border: 0; padding: 2px 4px; margin-left: -4px; border-radius: 8px; cursor: pointer; text-align: left; font: inherit; color: var(--muted); -webkit-text-fill-color: currentColor; background: none; }
.foot-plan#foot-plan:hover { background: rgba(127,127,127,.12); }
.plan-txt { display: grid; line-height: 1.25; }
.plan-txt b { font-weight: 600; font-size: 11px; color: var(--text, inherit); -webkit-text-fill-color: currentColor; }
.plan-txt small { font-size: 10.5px; opacity: .8; }
.plan-medal { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: inset 0 -1px 2px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.18); }
.plan-medal.gold { background: radial-gradient(circle at 35% 30%, #fff6c4, #f5c542 45%, #b8860b 100%); box-shadow: 0 0 6px rgba(245,197,66,.55), inset 0 -1px 2px rgba(0,0,0,.3); }
.plan-medal.silver { background: radial-gradient(circle at 35% 30%, #ffffff, #c9ced6 45%, #7c8591 100%); box-shadow: 0 0 6px rgba(201,206,214,.45), inset 0 -1px 2px rgba(0,0,0,.3); }
.plan-medal.bronze { background: radial-gradient(circle at 35% 30%, #ffd9b0, #cd7f32 45%, #7a4a1c 100%); box-shadow: 0 0 6px rgba(205,127,50,.45), inset 0 -1px 2px rgba(0,0,0,.3); }

/* Fondo de pantalla (Ajustes > Apariencia avanzada) */
html.cb-has-wall body { background: var(--cb-wallpaper-color, transparent) var(--cb-wallpaper) center / cover no-repeat fixed; }
html.cb-has-wall body::before { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, var(--cb-wallpaper-dim, .4)); pointer-events: none; z-index: 0; }
html.cb-has-wall #app { position: relative; z-index: 1; background: transparent; }

/* Pantalla grande: barra lateral expandida con todas las herramientas */
html.cb-full .rail { width: 220px; align-items: stretch; overflow-y: auto; padding: 12px 8px; }
html.cb-full .rail-btn { width: auto; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 4px 8px; }
html.cb-full .rail-btn .rl { font-size: 13px; }
.rail-extra { display: none; }
html.cb-full .rail-extra { display: flex; }
.rail-group { display: none; }
html.cb-full .rail-group { display: block; margin: 10px 8px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; opacity: .55; }
