:root{--canvas:#100719;--canvas-2:#170a25;--surface:#1b0d2a;--surface-2:#241137;--raised:#2d1744;--accent:#a84ff0;--accent-soft:#d099ff;--warm:#f3a66f;--text:#faf6ff;--muted:#b7a8c8;--border:rgba(224,199,244,.14);--border-strong:rgba(211,154,255,.34);--shadow:0 24px 80px rgba(3,0,8,.38);--sidebar:298px;--topbar:72px;--radius:18px;--font-ui:Inter,"Segoe UI",system-ui,sans-serif;--font-editorial:Georgia,"Times New Roman",serif;color-scheme:dark}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:var(--canvas);color:var(--text);font-family:var(--font-ui)}button,input,textarea,select{font:inherit}button,a,select{outline:none}button{color:inherit}.lilia-app{height:100dvh;min-height:100dvh;display:grid;grid-template-columns:var(--sidebar) minmax(0,1fr);background:radial-gradient(circle at 72% 10%,rgba(126,56,166,.12),transparent 33%),var(--canvas);overflow:hidden}.sidebar{min-height:0;padding:26px 22px 18px;border-right:1px solid var(--border);background:rgba(14,5,24,.93);display:flex;flex-direction:column;position:relative;z-index:20}.brand-row{height:42px;display:flex;align-items:center;padding:0 8px;margin-bottom:22px}.brand{font:600 31px/1 var(--font-editorial);letter-spacing:-1.4px}.brand-spark{color:var(--accent-soft);margin-left:6px}.mobile-close{display:none;margin-left:auto;background:none;border:0;font-size:26px}.new-chat,.primary-action,.save-settings{border:0;border-radius:13px;background:linear-gradient(135deg,#9c43e4,#b75af2);color:white;font-weight:750;min-height:48px;display:flex;align-items:center;justify-content:center;gap:9px;box-shadow:0 11px 28px rgba(151,60,220,.2);cursor:pointer;transition:transform .18s ease,filter .18s ease,box-shadow .18s ease}.new-chat:hover,.primary-action:hover,.save-settings:hover{transform:translateY(-1px);filter:brightness(1.08);box-shadow:0 14px 35px rgba(151,60,220,.3)}.primary-nav{display:grid;gap:5px;margin-top:18px}.primary-nav button,.history-row{border:1px solid transparent;background:transparent;min-height:44px;border-radius:11px;padding:0 12px;display:flex;align-items:center;gap:12px;color:#d9cee4;cursor:pointer;text-align:left;transition:background .18s ease,border-color .18s ease,color .18s ease,transform .18s ease}.primary-nav button:hover,.history-row:hover{background:rgba(161,82,219,.09);color:white;transform:translateX(2px)}.primary-nav button:focus-visible,.history-row:focus-visible,.new-chat:focus-visible,.profile-card:focus-visible,.composer button:focus-visible,.page-view button:focus-visible{box-shadow:0 0 0 3px rgba(199,125,255,.28);border-color:var(--accent-soft)}.primary-nav button.active{background:rgba(164,74,226,.16);border-color:rgba(208,153,251,.13);color:#fff}.history{min-height:0;overflow:auto;border-top:1px solid var(--border);margin-top:22px;padding-top:18px;scrollbar-width:thin}.section-label{padding:0 11px 10px;color:#887a9b;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.12em}.history-row{width:100%;height:auto;min-height:54px;display:block}.history-row span,.history-row small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.history-row span{font-size:13px}.history-row small{font-size:10px;color:#8f80a1;margin-top:3px}.history-row.active{background:rgba(164,74,226,.13);border-color:var(--border)}.sidebar-empty{margin:4px 7px;padding:16px;border:1px dashed var(--border-strong);border-radius:12px;color:#897a9b;font-size:12px;line-height:1.55}.profile-card{margin-top:auto;border:1px solid var(--border);background:var(--surface);border-radius:14px;min-height:62px;padding:8px 10px;display:flex;align-items:center;gap:10px;cursor:pointer;text-align:left}.profile-card>span:nth-child(2){min-width:0;flex:1}.profile-card strong,.profile-card small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.profile-card strong{font-size:13px}.profile-card small{font-size:10px;color:var(--muted);margin-top:3px}.avatar{width:38px;height:38px;border-radius:12px;background:linear-gradient(145deg,#d48cff,#8c3acf);display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:white;font-size:12px;font-weight:800;overflow:hidden}.avatar.large{width:82px;height:82px;border-radius:24px;font-size:20px}.avatar img{width:100%;height:100%;object-fit:cover}.work-area{min-width:0;min-height:0;display:flex;flex-direction:column;position:relative}.topbar{height:var(--topbar);flex:0 0 var(--topbar);border-bottom:1px solid var(--border);display:flex;align-items:center;padding:0 28px;gap:13px;background:rgba(16,7,25,.76);backdrop-filter:blur(18px);z-index:10}.topbar>div{min-width:0}.topbar-kicker{font-size:9px;color:var(--warm);letter-spacing:.16em;font-weight:800;margin-right:8px}.topbar strong{font:600 16px/1.2 var(--font-editorial);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-menu{display:none;background:none;border:0;padding:7px}.project-link{margin-left:auto;display:flex;align-items:center;gap:9px;color:var(--muted);font-size:11px}.project-link select,.setting-row select{background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:10px;padding:9px 28px 9px 10px}.app-banner{position:absolute;top:82px;left:50%;z-index:30;transform:translateX(-50%);max-width:min(580px,calc(100% - 32px));border:1px solid var(--border-strong);border-radius:12px;padding:10px 12px 10px 15px;background:#28153a;box-shadow:var(--shadow);display:flex;align-items:center;gap:15px;font-size:12px}.app-banner.error{border-color:rgba(255,128,150,.4);background:#351326}.app-banner.success{border-color:rgba(153,230,192,.25)}.app-banner button{background:none;border:0;cursor:pointer}.chat-view{min-height:0;flex:1;display:flex;flex-direction:column}.chat-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-color:rgba(187,115,232,.3) transparent}.empty-chat{min-height:100%;max-width:780px;margin:auto;padding:70px 40px 210px;display:flex;flex-direction:column;justify-content:center;align-items:flex-start}.empty-kicker{color:var(--warm);font-size:10px;letter-spacing:.2em;font-weight:800}.empty-symbol{font-size:34px;color:var(--accent-soft);margin:18px 0 8px}.empty-chat h1{font:500 clamp(42px,5vw,72px)/.98 var(--font-editorial);letter-spacing:-3.6px;margin:0;max-width:760px}.empty-chat h1 em{font-style:normal;color:#c36aff}.empty-chat>p{color:var(--muted);font-size:15px;line-height:1.65;max-width:590px;margin:24px 0}.suggestions{display:flex;flex-wrap:wrap;gap:9px}.suggestions button,.filter-row button{border:1px solid var(--border);border-radius:999px;background:rgba(35,16,53,.7);color:#cfc0dd;padding:9px 13px;font-size:12px;cursor:pointer;transition:border-color .18s ease,background .18s ease,transform .18s ease}.suggestions button:hover,.filter-row button:hover,.filter-row button.active{border-color:var(--border-strong);background:var(--raised);transform:translateY(-1px)}.message-list{width:min(830px,100%);margin:0 auto;padding:48px 24px 220px}.message{display:grid;grid-template-columns:34px minmax(0,1fr);gap:15px;margin:0 0 34px;animation:message-in .24s ease both}.message.user{margin-left:12%}.message-avatar{width:34px;height:34px;border:1px solid var(--border);background:var(--surface-2);border-radius:11px;display:grid;place-items:center;color:var(--accent-soft);font-size:12px}.message.user .message-avatar{background:#4a226b;color:#fff}.message-column{min-width:0}.message-author{display:block;font-size:11px;font-weight:800;margin:3px 0 8px;color:#ddd0ea}.message-body,.rich-message-body{font-size:14px;line-height:1.72;color:#eee6f5}.rich-text-block{margin:0 0 13px}.rich-heading{font-family:var(--font-editorial);margin:18px 0 9px}.rich-list{padding-left:22px}.rich-message a{color:var(--accent-soft)}.message-action{background:none;border:0;color:#8e7ea2;font-size:11px;padding:4px 0;display:flex;gap:6px;cursor:pointer}.code-block{border:1px solid var(--border);background:#0b0610;border-radius:13px;overflow:hidden;margin:14px 0}.code-toolbar{height:38px;padding:0 12px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--border);font-size:11px;color:var(--muted)}.code-toolbar button{background:none;border:0;color:var(--accent-soft);cursor:pointer}.code-block pre{margin:0;padding:16px;overflow:auto;font:12px/1.6 Consolas,monospace}.generated-message-image{display:block;width:min(100%,620px);max-height:620px;object-fit:cover;border-radius:16px;border:1px solid var(--border);margin-bottom:14px}.activity-state{display:flex;align-items:center;gap:14px;padding:8px 0 20px 49px}.activity-state strong,.activity-state span{display:block}.activity-state strong{font-size:12px}.activity-state span{color:var(--muted);font-size:10px;margin-top:4px}.activity-orb{width:32px;height:32px;border-radius:11px;background:#311849;position:relative;overflow:hidden}.activity-orb i{position:absolute;width:11px;height:11px;border-radius:50%;background:#cf82ff;filter:blur(2px);animation:drift 1.6s ease-in-out infinite}.activity-orb i:nth-child(2){left:16px;top:8px;animation-delay:.25s}.activity-orb i:nth-child(3){left:9px;top:18px;animation-delay:.5s}.composer-zone{position:absolute;bottom:0;left:0;right:0;padding:28px 24px max(12px,env(safe-area-inset-bottom));background:linear-gradient(transparent,rgba(16,7,25,.92) 22%,var(--canvas) 60%);z-index:12}.composer{width:min(875px,100%);margin:auto;border:1px solid var(--border-strong);border-radius:19px;background:rgba(31,14,47,.97);box-shadow:0 22px 70px rgba(2,0,7,.45);transition:border-color .18s ease,box-shadow .18s ease}.composer:focus-within{border-color:rgba(208,137,255,.58);box-shadow:0 22px 70px rgba(2,0,7,.45),0 0 0 3px rgba(182,91,237,.08)}.composer.image-mode{border-color:rgba(230,149,255,.65)}.mode-banner{display:flex;align-items:center;justify-content:space-between;padding:9px 15px 0;color:#d696ff;font-size:11px;font-weight:800}.mode-banner button{border:0;background:none;color:var(--muted);cursor:pointer}.composer textarea{display:block;width:100%;min-height:70px;max-height:180px;resize:none;border:0;background:transparent;color:var(--text);padding:18px 17px 8px;font-size:15px;line-height:1.5;outline:none}.composer textarea::placeholder{color:#a38eb8}.composer-controls{min-height:52px;border-top:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:7px 9px 7px 12px;gap:10px}.composer-left,.composer-right{display:flex;align-items:center;gap:8px}.tool-trigger,.agent-trigger{border:1px solid transparent;background:transparent;border-radius:10px;min-height:36px;display:flex;align-items:center;gap:7px;color:#c8b9d7;cursor:pointer}.tool-trigger{padding:0 9px}.tool-trigger:hover,.agent-trigger:hover{background:rgba(166,81,220,.1);border-color:var(--border)}.agent-trigger{padding:4px 8px}.agent-trigger>div{text-align:left}.agent-trigger strong,.agent-trigger small{display:block}.agent-trigger strong{font-size:11px}.agent-trigger small{font-size:9px;color:#9483a8}.send-button{width:38px;height:38px;border:0;border-radius:12px;background:var(--accent);display:grid;place-items:center;cursor:pointer}.send-button:disabled{opacity:.34;cursor:not-allowed}.popup-anchor{position:relative}.tools-menu,.agent-menu{position:absolute;bottom:47px;z-index:40;border:1px solid var(--border-strong);background:#211031;box-shadow:var(--shadow);border-radius:15px;padding:7px;min-width:280px}.tools-menu{left:0}.agent-menu{right:0;min-width:345px}.tools-menu>button,.agent-menu>button{width:100%;border:0;background:transparent;border-radius:10px;padding:10px;display:flex;align-items:center;gap:11px;text-align:left;cursor:pointer}.tools-menu>button:hover,.agent-menu>button:hover,.agent-menu>button.selected{background:rgba(178,91,235,.12)}.tools-menu strong,.tools-menu small,.agent-menu strong,.agent-menu small{display:block}.tools-menu strong,.agent-menu strong{font-size:12px}.tools-menu small,.agent-menu small{font-size:10px;color:var(--muted);margin-top:2px}.tools-menu button:disabled{opacity:.38;cursor:not-allowed}.future-tool{border-top:1px solid var(--border);margin:5px;padding:10px;color:#9b8baa}.future-tool span,.future-tool small{display:block}.future-tool span{font-size:11px;font-weight:800}.future-tool small{margin-top:4px;font-size:9px}.menu-label{padding:8px 10px;color:#8b7c9b;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.12em}.agent-menu>button>div{flex:1}.reasoning{border-top:1px solid var(--border);margin-top:5px;padding:12px 10px 7px}.reasoning>span{font-size:10px;color:var(--muted)}.reasoning>div{display:flex;gap:5px;margin-top:8px}.reasoning button{flex:1;border:1px solid var(--border);background:transparent;border-radius:8px;color:#b5a5c4;padding:7px 4px;font-size:9px;cursor:pointer}.reasoning button.selected{background:#482067;border-color:#8142aa;color:#fff}.composer-note{text-align:center;color:#6f627e;font-size:9px;margin:8px 0 0}.page-view{flex:1;min-height:0;overflow-y:auto;padding:58px clamp(24px,5vw,72px) 80px}.page-heading{max-width:1040px;margin:0 auto 38px;display:flex;align-items:flex-end;justify-content:space-between;gap:25px}.page-heading>div>span{color:var(--warm);font-size:9px;letter-spacing:.2em;font-weight:800}.page-heading h1{font:500 48px/1 var(--font-editorial);letter-spacing:-2px;margin:11px 0 12px}.page-heading p{color:var(--muted);line-height:1.6;margin:0;max-width:590px}.primary-action,.secondary-action{padding:0 18px;min-height:44px}.secondary-action{border:1px solid var(--border-strong);background:var(--surface);color:var(--text);border-radius:12px;display:flex;align-items:center;gap:8px;cursor:pointer}.project-grid,.library-grid{max-width:1040px;margin:auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.project-card,.library-card,.settings-card{border:1px solid var(--border);background:linear-gradient(145deg,rgba(34,15,50,.92),rgba(24,11,37,.92));border-radius:var(--radius);overflow:hidden}.project-card{padding:22px}.project-icon{width:44px;height:44px;border-radius:13px;background:#371950;display:grid;place-items:center;color:var(--accent-soft)}.project-card h2,.library-meta h2{font-size:15px;margin:18px 0 8px}.project-card p{color:var(--muted);font-size:12px;line-height:1.6;min-height:38px}.project-card>div:last-child,.library-meta>div{border-top:1px solid var(--border);padding-top:13px;display:flex;align-items:center;justify-content:space-between;color:#8f7fa1;font-size:10px}.project-card button,.library-meta button,.library-meta a,.inline-actions button{border:0;background:none;color:var(--accent-soft);font-weight:700;font-size:10px;cursor:pointer;text-decoration:none}.filter-row{max-width:1040px;margin:-14px auto 20px;display:flex;gap:7px}.library-card img,.file-preview{width:100%;aspect-ratio:16/10;object-fit:cover;background:#14091e}.file-preview{display:grid;place-items:center;color:#977aa9}.file-preview span{margin-top:-70px;font-size:10px}.library-meta{padding:0 16px 15px}.library-meta h2{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.library-meta p{color:var(--muted);font-size:10px}.empty-page{max-width:620px;margin:100px auto 0;text-align:center}.empty-page>div{width:62px;height:62px;border-radius:20px;background:var(--surface-2);display:grid;place-items:center;margin:auto;color:var(--accent-soft)}.empty-page h2{font:500 28px var(--font-editorial);margin:22px 0 9px}.empty-page p{color:var(--muted);line-height:1.6}.empty-page .primary-action{margin:22px auto}.settings-page form{max-width:850px;margin:auto;display:grid;gap:14px}.settings-card{padding:24px}.settings-card h2{font:500 22px var(--font-editorial);margin:0 0 20px}.profile-editor{display:flex;align-items:center;gap:20px}.profile-editor>div{flex:1}.profile-editor input,.textarea-setting textarea{width:100%;border:1px solid var(--border);background:var(--canvas-2);color:var(--text);border-radius:10px;padding:10px 12px;outline:none}.profile-editor span,.profile-editor small{display:block;color:var(--muted);font-size:10px;margin-top:7px}.inline-actions{display:flex;gap:12px;margin-top:12px}.setting-row{min-height:64px;border-top:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:20px}.setting-row>div strong,.setting-row>div span{display:block}.setting-row>div strong{font-size:12px}.setting-row>div span{font-size:10px;color:var(--muted);margin-top:4px}.toggle{width:42px;height:24px;border:0;border-radius:999px;background:#3c2b48;padding:3px;cursor:pointer}.toggle span{display:block;width:18px;height:18px;border-radius:50%;background:#a898b7;transition:transform .18s ease,background .18s ease}.toggle.on{background:#7730a5}.toggle.on span{transform:translateX(18px);background:white}.textarea-setting{display:block;border-top:1px solid var(--border);padding-top:18px}.textarea-setting span,.textarea-setting small{display:block}.textarea-setting span{font-size:12px;font-weight:700}.textarea-setting small{color:var(--muted);font-size:10px;margin:5px 0 12px}.privacy-copy{color:var(--muted);font-size:11px;line-height:1.6}.signout-link{color:#f5a1b4;font-size:11px}.save-settings{justify-self:end;padding:0 20px}.loading-state{min-height:100%;display:grid;place-content:center;justify-items:center;color:var(--muted)}.loading-state span{width:110px;height:9px;border-radius:9px;background:var(--surface-2);margin:4px;animation:pulse 1.2s ease-in-out infinite}.loading-state span:nth-child(2){width:150px}.loading-state p{font-size:11px}.mobile-scrim{display:none}.signin-shell{min-height:100dvh;display:grid;place-items:center;background:radial-gradient(circle at 70% 20%,rgba(168,79,240,.2),transparent 32%),#100719;padding:24px;position:relative;overflow:hidden}.signin-atmosphere{position:absolute;inset:0;background-image:radial-gradient(circle,rgba(211,161,255,.28) 1px,transparent 1px);background-size:90px 90px;mask-image:linear-gradient(to bottom,black,transparent 75%)}.signin-card{position:relative;width:min(560px,100%);border:1px solid var(--border-strong);border-radius:28px;background:rgba(27,13,42,.91);box-shadow:var(--shadow);padding:52px;text-align:center}.signin-brand{font:600 42px var(--font-editorial)}.signin-brand span{color:var(--accent-soft);font-size:20px}.signin-kicker{color:var(--warm);font-size:10px;letter-spacing:.18em;font-weight:800}.signin-card h1{font:500 45px/1.06 var(--font-editorial);letter-spacing:-2px}.signin-copy{color:var(--muted);line-height:1.65}.signin-button{display:flex;min-height:50px;border-radius:13px;background:var(--accent);align-items:center;justify-content:center;color:white;text-decoration:none;font-weight:800;margin:28px 0}.signin-assurance{display:flex;justify-content:center;gap:13px;flex-wrap:wrap;color:#9a89aa;font-size:9px}.signin-note{color:#756680;font-size:9px;margin-top:18px}@keyframes message-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}@keyframes drift{0%,100%{transform:translate(0,0);opacity:.55}50%{transform:translate(4px,-3px);opacity:1}}@keyframes pulse{50%{opacity:.45}}@media(max-width:1050px){:root{--sidebar:260px}.project-grid,.library-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.empty-chat{padding-left:50px}.empty-chat h1{font-size:56px}}@media(max-width:760px){html,body{overflow:hidden}.lilia-app{grid-template-columns:1fr}.sidebar{position:fixed;inset:0 auto 0 0;width:min(310px,88vw);transform:translateX(-105%);transition:transform .22s ease;box-shadow:var(--shadow)}.sidebar.open{transform:none}.mobile-scrim{display:block;position:fixed;inset:0;background:rgba(3,0,7,.62);z-index:19;opacity:0;pointer-events:none;transition:opacity .2s}.mobile-scrim.visible{opacity:1;pointer-events:auto}.mobile-close,.mobile-menu{display:block}.topbar{padding:0 14px;height:62px;flex-basis:62px}.topbar strong{font-size:14px}.project-link span{display:none}.project-link select{max-width:120px}.empty-chat{align-items:center;text-align:center;padding:44px 20px 190px}.empty-chat h1{font-size:44px;letter-spacing:-2.4px}.empty-chat>p{font-size:13px}.suggestions{justify-content:center}.message-list{padding:28px 14px 190px}.message.user{margin-left:0}.message{grid-template-columns:29px minmax(0,1fr);gap:10px}.message-avatar{width:29px;height:29px;border-radius:9px}.composer-zone{padding:18px 10px max(8px,env(safe-area-inset-bottom))}.composer textarea{min-height:66px;font-size:16px}.tool-trigger{font-size:0}.tool-trigger svg{width:20px;height:20px}.agent-trigger>div{display:none}.tools-menu{left:-2px;min-width:min(300px,calc(100vw - 40px))}.agent-menu{right:-48px;min-width:min(345px,calc(100vw - 28px))}.page-view{padding:34px 18px 70px}.page-heading{align-items:flex-start;flex-direction:column}.page-heading h1{font-size:39px}.project-grid,.library-grid{grid-template-columns:1fr}.profile-editor{align-items:flex-start;flex-direction:column}.setting-row{align-items:flex-start;padding:15px 0}.filter-row{overflow-x:auto}.signin-card{padding:38px 24px}.signin-card h1{font-size:37px}.signin-assurance{display:grid}}@media(max-height:650px) and (min-width:761px){.empty-chat{padding-top:30px}.empty-chat h1{font-size:48px}.empty-chat>p{margin:14px 0}.composer-zone{padding-top:18px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}.primary-nav button:hover,.history-row:hover,.new-chat:hover{transform:none}}.reduced-motion *{animation:none!important;transition:none!important}.compact-density .primary-nav button{min-height:38px}.compact-density .message{margin-bottom:24px}

/* Ajustes puntuales sobre el diseño original de Lilia. */
.agent-trigger {
  background: #170b23;
  border-color: rgba(205, 137, 255, 0.42);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.025),
    0 8px 24px rgba(4, 0, 8, 0.2);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.agent-trigger:hover {
  background: #21102f;
  border-color: rgba(220, 167, 255, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 11px 28px rgba(3, 0, 8, 0.28);
}
.agent-trigger > span:first-child {
  color: #dda3ff;
}
.reasoning > small {
  display: block;
  color: #81718f;
  font-size: 9px;
  margin-top: 4px;
}
.login-card {
  max-width: 520px;
}
.login-form {
  display: grid;
  gap: 14px;
  margin-top: 26px;
  text-align: left;
}
.login-form label {
  display: grid;
  gap: 7px;
}
.login-form label span {
  color: #cfc0dd;
  font-size: 11px;
  font-weight: 700;
}
.login-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(16, 7, 25, 0.72);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}
.login-form input:focus {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(182, 91, 237, 0.12);
}
.login-form .signin-button {
  width: 100%;
  border: 0;
  cursor: pointer;
  font: inherit;
}
.login-form .signin-button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.login-error {
  margin: 0;
  border: 1px solid rgba(255, 128, 150, 0.4);
  border-radius: 10px;
  background: #351326;
  color: #ffc4d0;
  padding: 10px 12px;
  font-size: 11px;
}
.reference-chip {
  margin: 12px 14px 0;
  padding: 8px;
  border: 1px solid rgba(211, 154, 255, 0.28);
  border-radius: 11px;
  background: #190d25;
  display: flex;
  align-items: center;
  gap: 10px;
}
.reference-chip img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 8px;
}
.reference-chip span {
  min-width: 0;
  flex: 1;
}
.reference-chip strong,
.reference-chip small {
  display: block;
}
.reference-chip strong {
  font-size: 11px;
  color: #f1e4f8;
}
.reference-chip small {
  font-size: 9px;
  color: #9484a2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reference-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.reference-actions button {
  width: auto;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(211, 154, 255, 0.26);
  border-radius: 8px;
  background: rgba(131, 65, 180, 0.13);
  color: #dfb8f7;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}
.reference-actions button:hover,
.reference-actions button:focus-visible {
  background: rgba(167, 86, 224, 0.24);
  border-color: rgba(221, 167, 255, 0.55);
  color: #fff;
}
.reference-actions .reference-remove {
  width: 30px;
  padding: 0;
  background: transparent;
  color: #ad9bb9;
}
.message-reference {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 290px;
  margin: 0 0 13px;
  padding: 7px 10px 7px 7px;
  border: 1px solid rgba(211, 154, 255, 0.26);
  border-radius: 12px;
  background: rgba(35, 17, 52, 0.82);
  color: #f2e8f9 !important;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}
.message-reference:hover,
.message-reference:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(221, 167, 255, 0.55);
  background: rgba(52, 25, 76, 0.92);
}
.message-reference img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
}
.message-reference span {
  min-width: 0;
}
.message-reference strong,
.message-reference small {
  display: block;
}
.message-reference strong {
  font-size: 11px;
}
.message-reference small {
  margin-top: 3px;
  color: #a997b8;
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .reference-chip {
    margin: 8px 9px 0;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .reference-chip img {
    width: 38px;
    height: 38px;
  }
  .reference-chip > span {
    padding-top: 2px;
  }
  .reference-actions {
    width: 100%;
    justify-content: stretch;
  }
  .reference-actions button {
    flex: 1;
    min-height: 34px;
  }
  .reference-actions .reference-remove {
    flex: 0 0 34px;
  }
}

.pwa-update-toast { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; align-items: center; gap: 14px; max-width: min(92vw, 360px); padding: 12px 14px; border: 1px solid var(--border-strong, rgba(204, 122, 255, .45)); border-radius: 14px; background: rgba(25, 13, 44, .96); color: var(--text); box-shadow: 0 16px 42px rgba(0, 0, 0, .35); }
.pwa-update-toast button { min-height: 36px; border: 0; border-radius: 9px; padding: 0 12px; background: var(--accent, #a44ae2); color: white; font-weight: 700; cursor: pointer; }
.image-lightbox-error { display: grid; place-items: center; gap: 10px; min-height: 160px; padding: 32px; color: var(--muted); text-align: center; }
.message-actions button, .image-lightbox-actions button { min-width: 36px; min-height: 36px; }
@media (max-width: 760px) { .pwa-update-toast { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); left: 12px; justify-content: space-between; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.automation-form { display: grid; gap: 16px; margin-bottom: 18px; }
.automation-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.automation-form label, .automation-form-grid label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
.automation-form input, .automation-form textarea, .automation-form select { width: 100%; min-height: 42px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: rgba(8, 4, 21, .45); color: var(--text); font: inherit; }
.automation-form textarea { resize: vertical; }
.automation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.automation-card { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.automation-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.automation-card h2 { margin: 9px 0 0; font-size: 18px; }
.automation-card p { min-height: 48px; color: var(--muted); line-height: 1.55; white-space: pre-wrap; }
.automation-card small { color: var(--muted); }
.automation-status { display: inline-flex; border-radius: 999px; padding: 4px 8px; background: rgba(164, 74, 226, .15); color: var(--accent-soft); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.automation-status.paused { color: #f4c46b; background: rgba(244, 196, 107, .12); }
.automation-card-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.automation-card-actions button, .notification-popover header button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; background: transparent; color: var(--text); cursor: pointer; }
.notification-anchor { position: relative; margin-left: auto; }
.notification-trigger { position: relative; }
.notification-trigger b { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: #d86df4; color: #180b28; font-size: 9px; line-height: 17px; }
.notification-popover { position: absolute; top: calc(100% + 10px); right: 0; z-index: 40; width: min(360px, 88vw); max-height: min(520px, 70vh); overflow: auto; padding: 10px; border: 1px solid var(--border-strong, var(--border)); border-radius: 14px; background: rgba(23, 12, 39, .98); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
.notification-popover header { display: flex; justify-content: space-between; align-items: center; padding: 8px; }
.notification-item { width: 100%; display: flex; align-items: flex-start; gap: 9px; padding: 11px 9px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.notification-item:hover { background: rgba(164, 74, 226, .12); }
.notification-item span { min-width: 0; display: grid; gap: 4px; }
.notification-item small, .notification-item time { color: var(--muted); }
.notification-item i { width: 7px; height: 7px; flex: 0 0 auto; margin-top: 4px; border-radius: 50%; background: var(--accent-soft); }
.notification-empty { padding: 18px 10px; color: var(--muted); }
.notification-pref { width: 100%; display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.notification-pref i { width: 36px; height: 20px; position: relative; border-radius: 99px; background: rgba(255,255,255,.13); transition: background .2s ease; }
.notification-pref i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .2s ease, background .2s ease; }
.notification-pref i.on { background: rgba(164, 74, 226, .55); }
.notification-pref i.on::after { transform: translateX(16px); background: white; }
@media (max-width: 900px) { .automation-form-grid, .automation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .automation-form-grid, .automation-grid { grid-template-columns: 1fr; } }

/* Image memory and generation progress */
.image-memory-chip {
  margin: 12px 14px 0;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(151, 111, 255, 0.42);
  border-radius: 11px;
  background: linear-gradient(110deg, rgba(51, 25, 85, 0.9), rgba(26, 15, 50, 0.92));
}
.image-memory-chip img {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
}
.image-memory-chip > span {
  min-width: 0;
  flex: 1;
}
.image-memory-chip strong,
.image-memory-chip small {
  display: block;
}
.image-memory-chip strong {
  color: #f1e4f8;
  font-size: 11px;
}
.image-memory-chip small {
  margin-top: 3px;
  color: #bba9ca;
  font-size: 9px;
}
.image-memory-chip > button {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(211, 154, 255, 0.28);
  border-radius: 8px;
  background: transparent;
  color: #dfb8f7;
  cursor: pointer;
}
.image-memory-chip > button:hover,
.image-memory-chip > button:focus-visible {
  background: rgba(211, 154, 255, 0.14);
}
.image-activity {
  border-color: rgba(196, 117, 255, 0.42);
  background: linear-gradient(110deg, rgba(42, 18, 70, 0.88), rgba(17, 14, 43, 0.86));
  box-shadow: 0 10px 30px rgba(85, 36, 145, 0.16);
}
.image-activity .activity-orb {
  box-shadow: 0 0 0 7px rgba(185, 92, 255, 0.08), 0 0 30px rgba(185, 92, 255, 0.42);
}
.activity-progress {
  display: flex;
  gap: 5px;
  margin-top: 9px;
}
.activity-progress i {
  width: 28px;
  height: 3px;
  display: block;
  border-radius: 99px;
  background: rgba(209, 147, 255, 0.2);
  animation: image-progress 1.5s ease-in-out infinite;
}
.activity-progress i:nth-child(2) { animation-delay: .18s; }
.activity-progress i:nth-child(3) { animation-delay: .36s; }
.activity-progress i:nth-child(4) { animation-delay: .54s; }
@keyframes image-progress {
  0%, 100% { background: rgba(209, 147, 255, 0.2); transform: scaleX(.72); transform-origin: left; }
  45% { background: #d39aff; transform: scaleX(1); }
}
@media (prefers-reduced-motion: reduce) {
  .activity-progress i { animation: none; background: #b77bea; }
}

/* Biblioteca compacta y visor */
.library-grid {
  grid-template-columns: repeat(auto-fill, minmax(185px, 220px));
  justify-content: start;
  gap: 14px;
}
.library-card {
  cursor: pointer;
  border-radius: 14px;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
  outline: none;
}
.library-card:hover,
.library-card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(211, 154, 255, 0.48);
  background: linear-gradient(145deg, rgba(42, 20, 60, 0.98), rgba(26, 12, 39, 0.98));
  box-shadow: 0 18px 42px rgba(3, 0, 8, 0.38);
}
.library-card:focus-visible {
  box-shadow:
    0 18px 42px rgba(3, 0, 8, 0.38),
    0 0 0 3px rgba(199, 125, 255, 0.2);
}
.library-thumb {
  position: relative;
  overflow: hidden;
}
.library-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  transition:
    transform 0.28s ease,
    filter 0.28s ease;
}
.library-card:hover .library-thumb img,
.library-card:focus-visible .library-thumb img {
  transform: scale(1.045);
  filter: brightness(0.78);
}
.library-thumb > span {
  position: absolute;
  inset: auto 10px 10px auto;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(13, 6, 20, 0.72);
  backdrop-filter: blur(9px);
  font-size: 9px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}
.library-card:hover .library-thumb > span,
.library-card:focus-visible .library-thumb > span {
  opacity: 1;
  transform: none;
}
.library-card .file-preview {
  aspect-ratio: 1/1;
}
.library-card .file-preview span {
  margin-top: -52px;
}
.library-meta {
  padding: 0 13px 12px;
}
.library-meta h2 {
  font-size: 12px;
  margin: 13px 0 7px;
}
.library-meta p {
  font-size: 9px;
}
.library-meta > div {
  padding-top: 10px;
}
.library-meta > div span {
  color: var(--accent-soft);
  font-weight: 750;
}
.library-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 0, 8, 0.78);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: preview-in 0.18s ease both;
}
.library-preview {
  width: min(760px, 100%);
  max-height: min(86dvh, 820px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: #160b21;
  box-shadow: 0 35px 120px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}
.library-preview header {
  min-height: 66px;
  padding: 12px 15px 12px 19px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}
.library-preview header > div {
  min-width: 0;
  flex: 1;
}
.library-preview header strong,
.library-preview header span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.library-preview header strong {
  font-size: 13px;
}
.library-preview header span {
  color: var(--muted);
  font-size: 9px;
  margin-top: 4px;
}
.library-preview header button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  color: var(--muted);
  font-size: 20px;
}
.library-preview-media {
  min-height: 0;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #0c0612;
  overflow: auto;
}
.library-preview-media > img {
  display: block;
  max-width: 100%;
  max-height: 62dvh;
  object-fit: contain;
  border-radius: 12px;
}
.library-preview-media > div {
  display: grid;
  justify-items: center;
  gap: 12px;
  color: var(--muted);
}
.library-preview footer {
  min-height: 68px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--border);
}
.library-preview footer button,
.library-preview footer a {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.library-preview footer .preview-copy {
  background: var(--accent);
  border-color: transparent;
}
.library-preview footer .preview-delete {
  background: transparent;
  color: #f1a5b4;
  border-color: rgba(255, 128, 150, 0.26);
}
@keyframes preview-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (max-width: 760px) {
  .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .library-preview-backdrop {
    padding: 8px;
  }
  .library-preview {
    max-height: calc(100dvh - 16px);
    border-radius: 16px;
  }
  .library-preview footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .library-preview footer .preview-delete {
    grid-column: 1/-1;
  }
  .library-preview-media > img {
    max-height: 58dvh;
  }
}
@media (prefers-reduced-motion: reduce) {
  .library-card,
  .library-thumb img,
  .library-thumb > span {
    transition: none;
  }
  .library-card:hover,
  .library-card:focus-visible {
    transform: none;
  }
  .library-preview-backdrop {
    animation: none;
  }
}

/* Portada de una conversación nueva — dirección visual Nova aprobada */
:root {
  --canvas: #070716;
  --canvas-2: #0b0b22;
  --surface: #11102b;
  --surface-2: #171335;
  --raised: #201746;
  --accent: #a844f2;
  --accent-soft: #c77dff;
  --warm: #b879ff;
  --muted: #aaa6c1;
  --border: rgba(194, 181, 238, 0.15);
  --border-strong: rgba(174, 112, 239, 0.42);
  --shadow: 0 26px 90px rgba(0, 0, 12, 0.56);
}
.lilia-app {
  background:
    radial-gradient(circle at 72% 16%, rgba(88, 35, 180, 0.19), transparent 31%),
    linear-gradient(145deg, #070716 0%, #09051b 52%, #080616 100%);
}
.sidebar {
  background: linear-gradient(180deg, rgba(8, 9, 29, 0.98), rgba(8, 5, 22, 0.98));
  box-shadow: 24px 0 70px rgba(0, 0, 18, 0.15);
}
.brand {
  letter-spacing: -1px;
}
.brand-spark {
  color: #c276ff;
}
.new-chat {
  background: linear-gradient(100deg, #7438df 0%, #b541ee 70%, #d153f2 100%);
  box-shadow: 0 14px 38px rgba(130, 49, 224, 0.27);
}
.primary-nav button.active {
  background: linear-gradient(90deg, rgba(145, 69, 227, 0.19), rgba(53, 32, 88, 0.34));
  border-color: rgba(181, 111, 240, 0.34);
  box-shadow: inset 3px 0 0 #bd65f6;
}
.topbar {
  height: 80px;
  flex-basis: 80px;
  border-bottom-color: rgba(185, 168, 227, 0.12);
  background: rgba(7, 7, 22, 0.66);
  padding-inline: 30px;
}
.topbar > div {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px 0 7px;
  border: 1px solid rgba(179, 135, 231, 0.2);
  border-radius: 14px;
  background: rgba(20, 15, 48, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}
.topbar-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  margin-right: 12px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(138, 66, 219, 0.34), rgba(84, 51, 156, 0.23));
  color: #d391ff;
  letter-spacing: 0.18em;
}
.topbar strong {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: #b9b4cb;
}
.chat-scroll {
  background: radial-gradient(circle at 72% 22%, rgba(94, 33, 189, 0.09), transparent 34%);
}
.empty-chat {
  position: relative;
  isolation: isolate;
  display: block;
  max-width: none;
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: clamp(52px, 7vh, 86px) 5.5% 330px;
  overflow: hidden;
}
.empty-atmosphere {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 74% 22%, rgba(158, 81, 255, 0.68) 0 1px, transparent 2px),
    radial-gradient(circle at 91% 35%, rgba(100, 125, 255, 0.66) 0 1px, transparent 2px),
    radial-gradient(circle at 64% 48%, rgba(182, 96, 255, 0.5) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 66%, rgba(102, 71, 217, 0.5) 0 1px, transparent 2px),
    radial-gradient(circle at 53% 18%, rgba(143, 81, 236, 0.48) 0 1px, transparent 2px);
  background-size:
    210px 190px,
    270px 230px,
    320px 260px,
    240px 210px,
    360px 290px;
  opacity: 0.72;
}
.empty-atmosphere::after {
  content: "";
  position: absolute;
  inset: 6% 0 0 45%;
  background:
    repeating-linear-gradient(35deg, transparent 0 112px, rgba(109, 69, 210, 0.055) 113px, transparent 114px),
    repeating-linear-gradient(145deg, transparent 0 146px, rgba(109, 69, 210, 0.045) 147px, transparent 148px);
  mask-image: radial-gradient(ellipse at center, black 10%, transparent 72%);
}
.empty-copy {
  position: relative;
  z-index: 3;
  width: min(54%, 670px);
  margin-left: clamp(10px, 3vw, 58px);
}
.empty-kicker {
  display: block;
  color: #b979ff;
  font-size: 10px;
  letter-spacing: 0.28em;
  font-weight: 850;
  margin-bottom: 28px;
}
.empty-chat h1 {
  font: 500 clamp(48px, 5.2vw, 78px)/0.94 var(--font-editorial);
  letter-spacing: -3.8px;
  margin: 0;
  max-width: 760px;
  text-shadow: 0 8px 34px rgba(0, 0, 18, 0.28);
}
.empty-chat h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #7778ff 0%, #b66bfa 52%, #dd55e8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.empty-accent {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 15px 0 20px;
  color: #ca72ff;
}
.empty-accent span {
  font-size: 25px;
}
.empty-accent i {
  display: block;
  width: 92px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #6c7cff, #d24ee8);
  box-shadow: 0 0 18px rgba(168, 77, 239, 0.42);
}
.empty-copy > p {
  color: #b5b0c7;
  font-size: 15px;
  line-height: 1.62;
  max-width: 510px;
  margin: 0;
}
.empty-hero-media {
  position: absolute;
  z-index: 1;
  right: -2%;
  top: -1%;
  bottom: 160px;
  width: min(64%, 820px);
  pointer-events: none;
  filter: drop-shadow(-24px 30px 44px rgba(0, 0, 14, 0.45));
  mask-image: linear-gradient(to right, transparent 0%, black 13%, black 94%, transparent 100%);
}
.empty-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 62% 36%, rgba(111, 52, 233, 0.17), transparent 42%);
  z-index: -1;
}
.empty-hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 13%;
  transform-origin: 65% 40%;
  animation: hero-arrive 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.quick-actions {
  position: absolute;
  z-index: 4;
  left: 7.7%;
  right: 5.7%;
  bottom: 184px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.quick-actions button {
  min-width: 0;
  min-height: 112px;
  padding: 15px 14px 13px;
  border: 1px solid rgba(170, 119, 230, 0.32);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(22, 18, 52, 0.9), rgba(14, 12, 38, 0.86));
  color: #f3effb;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr;
  text-align: left;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.028),
    0 15px 35px rgba(0, 0, 15, 0.13);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}
.quick-actions button > svg {
  grid-column: 1/-1;
  color: #b65eff;
  margin-bottom: 10px;
}
.quick-actions button > span {
  min-width: 0;
}
.quick-actions strong,
.quick-actions small {
  display: block;
}
.quick-actions strong {
  font-size: 13px;
  line-height: 1.2;
}
.quick-actions small {
  color: #a7a0b9;
  font-size: 10px;
  line-height: 1.42;
  margin-top: 5px;
}
.quick-actions button > i {
  align-self: end;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(184, 127, 240, 0.2);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #a995c2;
  background: rgba(91, 50, 142, 0.15);
  transition:
    transform 0.2s ease,
    color 0.2s ease,
    background 0.2s ease;
}
.quick-actions button:hover,
.quick-actions button:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(201, 121, 255, 0.72);
  background: linear-gradient(145deg, rgba(35, 25, 76, 0.96), rgba(20, 14, 49, 0.94));
  box-shadow:
    0 20px 45px rgba(29, 7, 63, 0.34),
    0 0 0 1px rgba(190, 109, 255, 0.08);
}
.quick-actions button:hover > i,
.quick-actions button:focus-visible > i {
  transform: translateX(2px);
  color: #fff;
  background: rgba(151, 70, 222, 0.32);
}
.composer-zone {
  padding: 26px 5.7% max(11px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(7, 7, 22, 0.88) 24%, #070716 69%);
}
.composer {
  width: min(1048px, 100%);
  border-color: rgba(185, 108, 240, 0.48);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(30, 20, 59, 0.97), rgba(20, 15, 45, 0.98));
  box-shadow:
    0 -1px 0 rgba(215, 139, 255, 0.16),
    0 24px 74px rgba(0, 0, 15, 0.54);
}
.composer:focus-within {
  border-color: rgba(205, 126, 255, 0.8);
  box-shadow:
    0 24px 74px rgba(0, 0, 15, 0.54),
    0 0 0 3px rgba(179, 88, 236, 0.1),
    0 0 35px rgba(145, 55, 224, 0.12);
}
.composer textarea {
  min-height: 64px;
  padding: 17px 20px 8px;
}
.composer-controls {
  padding-inline: 13px;
}
.tool-trigger {
  border-color: rgba(171, 128, 218, 0.14);
  background: rgba(17, 14, 39, 0.5);
  padding-inline: 12px;
}
.send-button {
  background: linear-gradient(145deg, #8b39e7, #c946f1);
  box-shadow: 0 8px 24px rgba(137, 49, 220, 0.3);
}
.composer-note {
  color: #6f6a82;
}
@keyframes hero-arrive {
  from {
    opacity: 0;
    transform: translateX(22px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1120px) and (min-width: 761px) {
  .empty-chat {
    padding-inline: 4%;
    padding-top: 45px;
  }
  .empty-copy {
    width: 58%;
    margin-left: 0;
  }
  .empty-chat h1 {
    font-size: 54px;
  }
  .empty-copy > p {
    font-size: 13px;
  }
  .empty-hero-media {
    right: -9%;
    width: 67%;
    opacity: 0.82;
  }
  .quick-actions {
    left: 4%;
    right: 4%;
    bottom: 178px;
    gap: 8px;
  }
  .quick-actions button {
    min-height: 102px;
    padding: 12px;
  }
  .quick-actions small {
    font-size: 9px;
  }
}
@media (max-width: 760px) {
  .topbar {
    height: 62px;
    flex-basis: 62px;
    padding-inline: 13px;
  }
  .topbar > div {
    min-height: 38px;
    padding-right: 12px;
  }
  .topbar-kicker {
    min-height: 26px;
    margin-right: 9px;
    padding-inline: 9px;
  }
  .empty-chat {
    display: flex;
    flex-direction: column;
    min-height: auto;
    padding: 34px 18px 196px;
    overflow: visible;
    text-align: left;
    align-items: stretch;
  }
  .empty-copy {
    width: 100%;
    margin: 0;
    z-index: 3;
  }
  .empty-kicker {
    font-size: 8px;
    letter-spacing: 0.21em;
    margin-bottom: 18px;
  }
  .empty-chat h1 {
    font-size: clamp(42px, 13vw, 56px);
    letter-spacing: -2.7px;
    max-width: 520px;
  }
  .empty-accent {
    margin: 12px 0 15px;
  }
  .empty-copy > p {
    font-size: 12px;
    max-width: 72%;
    line-height: 1.55;
  }
  .empty-hero-media {
    top: 28px;
    right: -29%;
    bottom: auto;
    width: 89%;
    height: 330px;
    opacity: 0.48;
    mask-image: linear-gradient(to right, transparent 0%, black 20%, black 88%, transparent 100%);
  }
  .quick-actions {
    position: relative;
    inset: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 58px;
  }
  .quick-actions button {
    min-height: 104px;
    padding: 12px;
  }
  .quick-actions button > svg {
    margin-bottom: 8px;
  }
  .quick-actions strong {
    font-size: 12px;
  }
  .quick-actions small {
    font-size: 9px;
  }
  .quick-actions button > i {
    width: 27px;
    height: 27px;
  }
  .composer-zone {
    padding: 16px 9px max(8px, env(safe-area-inset-bottom));
  }
  .composer {
    border-radius: 17px;
  }
  .composer textarea {
    min-height: 62px;
    padding: 15px 14px 7px;
  }
  .composer-note {
    margin-top: 6px;
  }
}
@media (max-width: 420px) {
  .empty-copy > p {
    max-width: 82%;
  }
  .empty-hero-media {
    right: -37%;
    width: 104%;
    opacity: 0.4;
  }
  .quick-actions {
    grid-template-columns: 1fr 1fr;
  }
  .quick-actions small {
    display: none;
  }
  .quick-actions button {
    min-height: 82px;
  }
}
@media (max-height: 700px) and (min-width: 761px) {
  .empty-chat {
    padding-top: 34px;
  }
  .empty-kicker {
    margin-bottom: 18px;
  }
  .empty-chat h1 {
    font-size: 52px;
  }
  .empty-copy > p {
    font-size: 12px;
  }
  .quick-actions button {
    min-height: 92px;
  }
  .quick-actions {
    bottom: 165px;
  }
  .empty-hero-media {
    bottom: 132px;
  }
  .composer-zone {
    padding-top: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .empty-hero-media img {
    animation: none;
  }
  .quick-actions button:hover,
  .quick-actions button:focus-visible {
    transform: none;
  }
}

/* Lilia product system: streamed conversations, monogram and rich content */
.lilia-mark {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 24px rgba(127, 70, 237, 0.3));
}
.lilia-mark::before,
.lilia-mark::after {
  content: "";
  position: absolute;
  inset: 1px;
  background: linear-gradient(145deg, #6c72ff, #b35cf4 58%, #ed77db);
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
}
.lilia-mark::after {
  inset: 5px;
  background: #0c0a21;
}
.lilia-mark i {
  position: relative;
  z-index: 2;
  font: 700 21px/1 var(--font-editorial);
  font-style: normal;
  color: #eee9ff;
}
.brand-row {
  gap: 10px;
}
.brand {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 760;
  letter-spacing: 0.01em;
}
.message-list {
  width: min(920px, calc(100% - 40px));
  padding: 38px 0 210px;
}
.message {
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(185, 168, 227, 0.075);
}
.message-avatar {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #251447, #120d2d);
  border: 1px solid rgba(190, 120, 244, 0.32);
  box-shadow: 0 12px 28px rgba(0, 0, 12, 0.25);
}
.message-avatar > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
  transform: scale(1.55) translateY(8%);
}
.message.user .message-avatar {
  width: 42px;
  height: 42px;
  margin: 5px;
}
.message.user .message-avatar > .avatar {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 13px;
}
.message-author {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c9bed9;
}
.rich-message-body {
  font-size: 15px;
  line-height: 1.78;
  color: #eeeaf5;
}
.rich-heading {
  font-family: var(--font-editorial);
  letter-spacing: -0.02em;
  line-height: 1.16;
  margin: 1.25em 0 0.55em;
}
.rich-heading:first-child {
  margin-top: 0.35em;
}
.rich-text-block {
  margin: 0.55em 0;
}
.rich-list {
  padding-left: 1.4em;
  margin: 0.7em 0;
}
.rich-list li {
  padding-left: 0.25em;
  margin: 0.25em 0;
}
.rich-message blockquote {
  margin: 1em 0;
  padding: 13px 18px;
  border-left: 3px solid #9d61ee;
  border-radius: 0 12px 12px 0;
  background: rgba(136, 73, 211, 0.1);
  color: #cfc8db;
}
.rich-message hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}
.inline-code {
  padding: 0.14em 0.38em;
  border-radius: 5px;
  background: #21183a;
  color: #e8c5ff;
  font:
    500 0.9em/1.4 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.rich-table-wrap {
  max-width: 100%;
  overflow: auto;
  margin: 18px 0;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
}
.rich-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}
.rich-table-wrap th,
.rich-table-wrap td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.rich-table-wrap th {
  background: #1c1437;
  color: #f4eaff;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.rich-table-wrap tr:last-child td {
  border-bottom: 0;
}
.code-block {
  margin: 20px 0;
  border-color: rgba(164, 117, 220, 0.36);
  background: #090817;
}
.code-toolbar > div {
  display: flex;
  gap: 7px;
}
.code-preview {
  border-top: 1px solid var(--border);
  background: #fff;
}
.code-preview-note {
  padding: 8px 12px;
  background: #16132a;
  color: #b9b4c8;
  font-size: 10px;
}
.code-preview iframe {
  display: block;
  width: 100%;
  height: 300px;
  border: 0;
  background: white;
}
.message-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  opacity: 0;
  transform: translateY(-3px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}
.message:hover .message-actions,
.message:focus-within .message-actions,
.message-actions:has(:focus-visible) {
  opacity: 1;
  transform: none;
}
.message-actions button {
  min-height: 32px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #8f899f;
  font-size: 10px;
  cursor: pointer;
}
.message-actions button:hover,
.message-actions button:focus-visible {
  color: #eee8fa;
  border-color: var(--border);
  background: rgba(105, 66, 154, 0.13);
}
.stream-cursor {
  display: inline-block;
  width: 8px;
  height: 17px;
  margin-left: 4px;
  vertical-align: -3px;
  border-radius: 2px;
  background: #bd70f4;
  animation: cursor-pulse 0.8s ease-in-out infinite;
}
.message.streaming .message-avatar {
  box-shadow:
    0 0 0 3px rgba(159, 83, 235, 0.1),
    0 12px 30px rgba(84, 34, 151, 0.28);
}
@keyframes cursor-pulse {
  50% {
    opacity: 0.2;
  }
}
.send-button.stop {
  background: #eee8f5;
  color: #211331;
  box-shadow: none;
}
.activity-state {
  margin-left: 74px;
  min-height: 76px;
  border: 1px solid rgba(178, 116, 238, 0.18);
  border-radius: 15px;
  padding: 14px 17px;
  background: linear-gradient(125deg, rgba(30, 20, 61, 0.72), rgba(14, 12, 38, 0.66));
}
.activity-orb {
  width: 38px;
  height: 38px;
}
.tools-menu {
  max-height: min(520px, 62dvh);
  overflow: auto;
}
.tools-menu > button {
  min-height: 60px;
}
.future-tool {
  display: none;
}
.library-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  max-width: 1100px;
}
.library-card {
  border-radius: 15px;
}
.library-thumb {
  aspect-ratio: 4/3;
}
.library-card:hover,
.library-card:focus-visible {
  transform: translateY(-7px) scale(1.012);
  box-shadow:
    0 25px 54px rgba(0, 0, 18, 0.42),
    0 0 0 1px rgba(190, 111, 255, 0.2);
}
.settings-page {
  max-width: 1180px;
}
.settings-page form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.settings-card {
  margin: 0;
  min-height: 100%;
  background: linear-gradient(145deg, rgba(28, 19, 55, 0.85), rgba(18, 14, 42, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}
.settings-card:first-child,
.settings-card:nth-child(4),
.save-settings {
  grid-column: 1/-1;
}
.settings-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}
.settings-card h2::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a85bf0;
  box-shadow: 0 0 18px rgba(168, 91, 240, 0.55);
}
@media (max-width: 760px) {
  .brand-row .brand {
    display: block;
  }
  .lilia-mark {
    width: 36px;
    height: 36px;
  }
  .message-list {
    width: calc(100% - 24px);
    padding-top: 18px;
    padding-bottom: 190px;
  }
  .message {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 11px;
  }
  .message-avatar {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }
  .rich-message-body {
    font-size: 14px;
    line-height: 1.68;
  }
  .message-actions {
    opacity: 1;
    transform: none;
    overflow: auto;
  }
  .activity-state {
    margin-left: 0;
  }
  .settings-page form {
    grid-template-columns: 1fr;
  }
  .settings-card:first-child,
  .settings-card:nth-child(4),
  .save-settings {
    grid-column: auto;
  }
  .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .library-meta {
    padding: 11px;
  }
  .library-meta h2 {
    font-size: 11px;
  }
  .composer-zone {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
  }
  .chat-scroll {
    overscroll-behavior: contain;
  }
  .code-preview iframe {
    height: 240px;
  }
}
@media (max-width: 420px) {
  .library-grid {
    grid-template-columns: 1fr 1fr;
  }
  .message-list {
    width: calc(100% - 16px);
  }
  .message {
    grid-template-columns: 38px minmax(0, 1fr);
  }
  .message-avatar {
    width: 36px;
    height: 36px;
  }
  .message.user .message-avatar {
    width: 34px;
    height: 34px;
    margin: 1px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .message-actions,
  .stream-cursor,
  .library-card {
    transition: none;
    animation: none;
  }
  .library-card:hover,
  .library-card:focus-visible {
    transform: none;
  }
}
:where(button, a, input, textarea, select, [role="button"]):focus-visible {
  outline: 2px solid #b66cff;
  outline-offset: 3px;
}
.tool-status {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-top: 1px solid rgba(200, 177, 255, 0.11);
}
.tool-status:first-of-type {
  border-top: 0;
}
.tool-status > div {
  display: grid;
  gap: 4px;
}
.tool-status > div > span {
  color: var(--muted);
  font-size: 12px;
}
.tool-status > span {
  border: 1px solid rgba(190, 132, 255, 0.28);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  white-space: nowrap;
}
.tool-status > .ready {
  color: #d8b7ff;
  background: rgba(126, 69, 184, 0.16);
}
.tool-status > .pending {
  color: #b9afc8;
  background: rgba(255, 255, 255, 0.035);
}

/* Chat media and compact actions */
.message-reference {
  appearance: none;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}
.generated-message-image-trigger {
  display: block;
  max-width: min(100%, 540px);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
}
.generated-message-image {
  width: auto;
  max-width: 100%;
  max-height: 520px;
  height: auto;
  object-fit: contain;
  margin-bottom: 14px;
}
.message-actions {
  justify-content: flex-end;
  margin-left: auto;
}
.message-actions button,
.message-actions a {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #8f899f;
  cursor: pointer;
  text-decoration: none;
}
.message-actions button:hover,
.message-actions button:focus-visible,
.message-actions a:hover,
.message-actions a:focus-visible {
  color: #eee8fa;
  border-color: var(--border);
  background: rgba(105, 66, 154, 0.2);
}

/* Image lightbox */
.image-lightbox-backdrop,
.history-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(4, 0, 8, 0.82);
  backdrop-filter: blur(14px);
  animation: preview-in 0.18s ease both;
}
.image-lightbox {
  position: relative;
  width: min(92vw, calc(82dvh * var(--lightbox-ratio)));
  height: min(82dvh, calc(92vw / var(--lightbox-ratio)));
  min-width: min(280px, 92vw);
  min-height: min(220px, 82dvh);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: #0c0612;
  box-shadow: 0 35px 120px rgba(0, 0, 0, 0.72);
  outline: none;
}
.image-lightbox > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.image-lightbox-toolbar {
  position: absolute;
  inset: 0 0 auto;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  background: linear-gradient(rgba(7, 3, 12, 0.82), transparent);
  color: #fff;
}
.image-lightbox-toolbar > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
}
.image-lightbox-toolbar > div {
  display: flex;
  gap: 6px;
}
.image-lightbox-toolbar a,
.image-lightbox-toolbar button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(16, 7, 25, 0.72);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}
.image-lightbox-toolbar a:hover,
.image-lightbox-toolbar button:hover,
.image-lightbox-toolbar a:focus-visible,
.image-lightbox-toolbar button:focus-visible {
  border-color: var(--accent-soft);
  background: rgba(126, 56, 166, 0.78);
}

/* History and project controls */
.history {
  overflow: hidden;
  scrollbar-width: none;
}
.history::-webkit-scrollbar {
  display: none;
}
.history-row {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.history-row > svg {
  flex: 0 0 auto;
  color: var(--accent-soft);
}
.history-row > span {
  min-width: 0;
  flex: 1;
}
.history-row strong,
.history-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-all {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: transparent;
  color: var(--accent-soft);
  font-size: 11px;
  cursor: pointer;
}
.topbar-title {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
}
.topbar-title > strong {
  max-width: min(52vw, 520px);
}
.rename-trigger {
  width: 28px;
  height: 28px;
  margin-left: 6px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.rename-trigger:hover,
.rename-trigger:focus-visible {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
}
.rename-popover,
.project-menu {
  position: absolute;
  top: calc(100% + 12px);
  z-index: 60;
  width: min(300px, calc(100vw - 30px));
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: #211031;
  box-shadow: var(--shadow);
}
.rename-popover {
  left: 0;
}
.rename-popover input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--canvas-2);
  color: var(--text);
  padding: 8px 10px;
  outline: none;
}
.rename-popover > span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}
.rename-popover > div {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 9px;
}
.rename-popover button,
.project-assign {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
  font-size: 10px;
  cursor: pointer;
}
.rename-popover button[type="submit"] {
  border-color: transparent;
  background: var(--accent);
}
.project-link {
  position: relative;
}
.project-link > label {
  display: flex;
  align-items: center;
  gap: 9px;
}
.project-assign {
  color: var(--accent-soft);
}
.project-menu {
  right: 0;
  top: calc(100% + 10px);
  display: grid;
  gap: 4px;
}
.project-menu > span {
  padding: 3px 7px 7px;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.project-menu > button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.project-menu > button:hover,
.project-menu > button:focus-visible {
  background: rgba(178, 91, 235, 0.14);
}
.project-menu > small {
  padding: 8px;
  color: var(--muted);
}

/* Full history panel */
.history-panel-backdrop {
  z-index: 110;
}
.history-panel {
  width: min(520px, 100%);
  max-height: min(76dvh, 680px);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: #160b21;
  box-shadow: var(--shadow);
}
.history-panel > header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 14px 20px;
  border-bottom: 1px solid var(--border);
}
.history-panel > header span,
.history-panel > header strong {
  display: block;
}
.history-panel > header span {
  color: var(--warm);
  font-size: 9px;
  letter-spacing: .16em;
  font-weight: 800;
}
.history-panel > header strong {
  margin-top: 5px;
  font: 500 22px var(--font-editorial);
}
.history-panel > header button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.history-panel-list {
  max-height: calc(min(76dvh, 680px) - 70px);
  overflow-y: auto;
  padding: 10px;
}
.history-panel-list > button {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.history-panel-list > button:hover,
.history-panel-list > button.active {
  border-color: var(--border);
  background: rgba(164, 74, 226, 0.13);
}
.history-panel-list > button > svg {
  flex: 0 0 auto;
  color: var(--accent-soft);
}
.history-panel-list > button > span {
  min-width: 0;
}
.history-panel-list strong,
.history-panel-list small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-panel-list small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 760px) {
  .image-lightbox-backdrop,
  .history-panel-backdrop {
    padding: 10px;
  }
  .image-lightbox {
    width: min(94vw, calc(78dvh * var(--lightbox-ratio)));
    height: min(78dvh, calc(94vw / var(--lightbox-ratio)));
  }
  .topbar-title > strong {
    max-width: 45vw;
  }
  .project-link > label > span {
    display: none;
  }
}

:root {
  --cyber-black: #050509;
  --cyber-panel: rgba(12, 11, 20, 0.92);
  --cyber-panel-2: rgba(24, 15, 42, 0.94);
  --cyber-line: rgba(211, 157, 255, 0.34);
  --cyber-line-bright: rgba(215, 144, 255, 0.78);
  --cyber-purple: #a855f7;
  --cyber-purple-bright: #d78bff;
  --cyber-text: #f8f5ff;
  --cyber-muted: #a99bbd;
}

html,
body {
  background: var(--cyber-black);
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--cyber-purple-bright);
  outline-offset: 3px;
}

.lilia-app {
  background: radial-gradient(circle at 75% 7%, rgba(109, 32, 166, 0.18), transparent 28%), var(--cyber-black);
}
.sidebar {
  background: linear-gradient(180deg, rgba(5, 5, 12, 0.98), rgba(13, 7, 23, 0.97));
  border-right: 1px solid var(--cyber-line);
}
.brand-row {
  height: 68px;
  padding: 0 4px;
  margin-bottom: 20px;
  background: url("/brand/lilia-wordmark.svg") left center / min(250px, 94%) auto no-repeat;
}
.brand-row .lilia-mark,
.brand-row .brand {
  visibility: hidden;
}
.new-chat,
.primary-action,
.save-settings {
  border-radius: 7px;
  border: 1px solid var(--cyber-line-bright);
  background: linear-gradient(135deg, #6820bb, #bd43f4);
  box-shadow:
    0 0 22px rgba(165, 61, 255, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.primary-nav button,
.history-row {
  border-radius: 5px;
}
.primary-nav button.active,
.history-row.active {
  background: linear-gradient(90deg, rgba(133, 45, 214, 0.24), rgba(57, 18, 90, 0.2));
  border-color: var(--cyber-line);
  box-shadow: inset 3px 0 var(--cyber-purple-bright);
}
.work-area {
  background: linear-gradient(180deg, rgba(8, 7, 15, 0.74), rgba(5, 5, 9, 0.96));
}
.topbar {
  background: rgba(5, 5, 10, 0.78);
  border-bottom-color: var(--cyber-line);
}
.topbar-kicker {
  color: var(--cyber-purple-bright);
}
.topbar-title {
  position: relative;
}
.topbar strong {
  font-family: var(--font-ui);
  letter-spacing: 0.01em;
}
.project-link select,
.setting-row select {
  border-radius: 6px;
  background: var(--cyber-panel);
  border-color: var(--cyber-line);
}
.empty-chat {
  max-width: none;
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: clamp(44px, 6vh, 76px) 5.5% 175px;
  position: relative;
  overflow: hidden;
}
.chat-scroll:has(.empty-chat) {
  overflow: hidden;
}
.empty-copy {
  position: relative;
  z-index: 2;
  max-width: 650px;
}
.empty-chat h1 {
  font-family: var(--font-editorial);
  font-size: clamp(48px, 5.2vw, 78px);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.055em;
  text-shadow: 0 0 28px rgba(166, 75, 255, 0.16);
}
.empty-chat h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #8f8cff 0%, #c176ff 52%, #ed70e7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.empty-hero-media {
  right: -9%;
  width: min(70%, 940px);
  bottom: 140px;
  filter: saturate(1.12) contrast(1.08);
  opacity: 0.9;
}
.quick-actions {
  position: absolute;
  z-index: 3;
  left: 50%;
  right: auto;
  bottom: 190px;
  width: calc(100% - 11.4%);
  margin: 0;
  transform: translateX(-50%);
}
.composer {
  width: 100%;
}
.quick-actions > button,
.project-card,
.library-card,
.settings-card {
  border-radius: 5px;
  border-color: var(--cyber-line);
  background: linear-gradient(145deg, rgba(23, 20, 31, 0.94), rgba(11, 9, 16, 0.97));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.05),
    0 14px 35px rgba(0, 0, 0, 0.18);
}
.quick-actions > button:hover,
.project-card:hover,
.library-card:hover {
  border-color: var(--cyber-line-bright);
  box-shadow: 0 0 22px rgba(148, 53, 229, 0.17);
}
.message-list {
  width: min(950px, 100%);
}
.message {
  animation-duration: 0.35s;
}
.message-body,
.rich-message-body {
  color: var(--cyber-text);
}
.generated-message-image {
  object-fit: contain;
  width: min(100%, 600px);
  max-height: min(640px, 64dvh);
  background: #07070b;
  border-radius: 6px;
  border-color: var(--cyber-line-bright);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.composer-zone {
  background: linear-gradient(transparent, rgba(5, 5, 9, 0.96) 28%, var(--cyber-black) 72%);
}
.composer {
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(27, 15, 42, 0.98), rgba(8, 8, 13, 0.98));
  border-color: var(--cyber-line-bright);
  box-shadow:
    0 20px 80px rgba(0, 0, 0, 0.5),
    0 0 25px rgba(138, 44, 225, 0.12);
}
.composer-controls {
  border-top-color: var(--cyber-line);
}
.send-button {
  border-radius: 6px;
  background: linear-gradient(135deg, #8f32e4, #d04dff);
  box-shadow: 0 0 18px rgba(196, 74, 255, 0.38);
  min-width: 44px;
  min-height: 44px;
}
.tool-trigger,
.agent-trigger {
  min-height: 44px;
}
.signin-shell {
  background:
    radial-gradient(circle at 72% 12%, rgba(156, 63, 239, 0.23), transparent 30%),
    radial-gradient(circle at 20% 80%, rgba(69, 25, 105, 0.24), transparent 32%), #050509;
}
.signin-card {
  width: min(520px, 100%);
  padding: 42px clamp(24px, 6vw, 56px);
  border-radius: 8px;
  border-color: var(--cyber-line-bright);
  background: linear-gradient(145deg, rgba(20, 16, 29, 0.96), rgba(8, 8, 13, 0.96));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 24px 90px rgba(0, 0, 0, 0.65),
    0 0 35px rgba(142, 44, 231, 0.18);
}
.signin-brand {
  width: min(360px, 100%);
  height: 94px;
  margin: 0 auto 20px;
  background: url("/brand/lilia-wordmark.svg") center / contain no-repeat;
  font-size: 0;
}
.signin-kicker {
  color: var(--cyber-purple-bright);
}
.signin-card h1 {
  font-family: var(--font-ui);
  font-size: clamp(30px, 5vw, 45px);
  font-weight: 800;
  letter-spacing: -0.05em;
}
.login-form label {
  text-align: left;
}
.login-form input {
  border: 1px solid var(--cyber-line);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--cyber-text);
  min-height: 48px;
}
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}
.password-field input {
  padding-right: 66px;
}
.password-toggle {
  position: absolute;
  right: 8px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--cyber-line);
  border-radius: 4px;
  background: rgba(120, 38, 190, 0.12);
  color: var(--cyber-purple-bright);
  cursor: pointer;
  font-size: 11px;
}
.signin-button {
  min-height: 52px;
  border-radius: 6px;
  border: 1px solid var(--cyber-line-bright);
  background: linear-gradient(135deg, #7428ce, #c44aff);
  box-shadow: 0 0 22px rgba(174, 65, 255, 0.24);
}
.pwa-update-toast {
  border: 1px solid var(--cyber-line-bright) !important;
  border-radius: 6px !important;
  background: rgba(18, 10, 30, 0.98) !important;
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.45);
}
.pwa-update-toast button {
  min-height: 36px;
  border-radius: 5px;
  background: var(--cyber-purple);
  color: white;
}

@media (max-width: 760px) {
  .brand-row {
    background-size: 205px auto;
  }
  .empty-hero-media {
    right: -16%;
    width: 78%;
    opacity: 0.45;
    transform: scale(0.86);
    transform-origin: bottom right;
  }
  .chat-scroll:has(.empty-chat) {
    overflow-y: auto;
  }
  .quick-actions {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    margin: 38px 0 0;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quick-actions > button {
    min-height: 88px;
  }
  .generated-message-image {
    max-height: 50dvh;
  }
  .signin-card {
    padding: 32px 22px;
  }
}

@media (max-width: 1120px) and (min-width: 761px) {
  .quick-actions {
    left: 4%;
    right: 4%;
    width: auto;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .empty-hero-media,
  .quick-actions > button:hover,
  .project-card:hover,
  .library-card:hover {
    transform: none;
  }
}

/* Responsive polish and welcome motion */
.brand-row { cursor: pointer; transition: filter .22s ease, transform .22s ease; }
.brand-row:hover, .brand-row:focus-visible { filter: drop-shadow(0 0 12px rgba(194, 92, 255, .34)); transform: translateX(2px); }
.settings-page { width: 100%; max-width: none !important; }
.settings-page form { width: 100%; max-width: none !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-page .settings-card { min-width: 0; min-height: 0; transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease; }
.settings-page .settings-card:hover { border-color: var(--cyber-line-bright); box-shadow: 0 18px 42px rgba(5, 0, 18, .22), 0 0 24px rgba(142, 50, 226, .1); transform: translateY(-2px); }
.settings-page .profile-editor, .settings-page .profile-editor > div, .settings-page textarea { min-width: 0; max-width: 100%; }
.settings-page textarea { min-height: 142px; }
.welcome-particles { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; mask-image: radial-gradient(ellipse at center, black 25%, transparent 88%); }
.welcome-particles i { position: absolute; left: var(--x); top: var(--y); width: var(--size); height: var(--size); border-radius: 999px; background: radial-gradient(circle, rgba(224, 166, 255, .92), rgba(128, 75, 255, .18) 70%, transparent); box-shadow: 0 0 14px rgba(177, 93, 255, .55); opacity: 0; animation: welcome-fluid var(--duration) ease-in-out var(--delay) infinite alternate; }
@keyframes welcome-fluid { 0% { opacity: 0; transform: translate3d(-12px, 10px, 0) scale(.65); } 45% { opacity: .72; } 100% { opacity: .08; transform: translate3d(22px, -24px, 0) scale(1.35); } }
@media (max-width: 1120px) and (min-width: 761px) { .settings-page { padding-inline: 32px; } .settings-page form { gap: 12px; } }
@media (max-width: 760px) { .settings-page { padding: 28px 14px 120px; } .settings-page form { grid-template-columns: 1fr; gap: 12px; } .settings-page .settings-card { padding: 18px; } .settings-page .profile-editor { align-items: stretch; } .settings-page .profile-editor .avatar.large { align-self: flex-start; } .settings-page .inline-actions { flex-wrap: wrap; gap: 8px; } .settings-page .setting-row { gap: 12px; } .settings-page .setting-row select { max-width: 48%; } .welcome-particles { opacity: .62; } }
@media (prefers-reduced-motion: reduce) { .brand-row, .settings-page .settings-card, .welcome-particles i { animation: none !important; transition: none !important; } .welcome-particles { display: none; } }

.skill-menu { width: min(420px, calc(100vw - 32px)); }
.skill-menu-heading { display: flex; justify-content: space-between; gap: 12px; padding: 4px 6px 10px; color: #f5ecff; font-size: 13px; }
.skill-menu-heading span { color: #b98cff; font-size: 11px; }
.skill-menu-tabs { display: flex; gap: 5px; overflow-x: auto; padding: 0 0 8px; }
.skill-menu-tabs button { border: 1px solid rgba(190, 118, 255, .24); background: rgba(24, 12, 42, .82); color: #cdb8e9; border-radius: 999px; padding: 6px 9px; white-space: nowrap; font-size: 11px; }
.skill-menu-tabs button.active, .skill-menu-tabs button:hover { background: #7d2bd3; color: white; border-color: #be65ff; }
.skill-quick-action { width: 100%; margin: 0 0 7px; border: 1px solid rgba(190, 118, 255, .35); color: #f5ecff; background: rgba(147, 52, 220, .18); border-radius: 10px; padding: 9px 10px; text-align: left; }
.mode-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mode-banner label { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; color: #cdb8e9; font-size: 12px; }
.mode-banner select { border: 1px solid rgba(190, 118, 255, .4); color: #fff; background: #170c28; border-radius: 7px; padding: 5px 8px; }
.message-usage { margin-top: 10px; color: #9e83bf; font-size: 10px; letter-spacing: .02em; }
.usage-mini { position: absolute; right: 74px; top: 12px; z-index: 3; display: inline-flex; gap: 5px; align-items: baseline; color: #9e83bf; font-size: 10px; pointer-events: none; }
.usage-mini strong { color: #d8bdff; font-weight: 600; }
.usage-mini small { color: #856da7; }
@media (max-width: 700px) { .skill-menu { right: 0; left: auto; } .mode-banner label { margin-left: 0; } .mode-banner { gap: 8px; } }
@media (max-width: 600px) { .usage-mini { display: none; } }

/* Lilia 2.2 — Motion & Identity. Final visual layer shared by Next and cPanel. */
:root {
  --lilia-ink: #050409;
  --lilia-ink-soft: #090711;
  --lilia-surface: rgba(17, 12, 27, 0.86);
  --lilia-surface-strong: rgba(24, 15, 39, 0.96);
  --lilia-violet: #9b4dff;
  --lilia-violet-bright: #d78aff;
  --lilia-magenta: #ef67da;
  --lilia-warm: #ff9f78;
  --lilia-line: rgba(207, 145, 255, 0.22);
  --lilia-line-bright: rgba(219, 158, 255, 0.62);
  --lilia-shadow: 0 24px 80px rgba(0, 0, 0, 0.44);
  --motion-fast: 140ms;
  --motion-base: 190ms;
  --motion-slow: 320ms;
  --motion-hero: 680ms;
  --ease-lilia: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.16, 1.25, 0.3, 1);
}

::selection {
  background: rgba(180, 91, 255, 0.34);
  color: white;
}

.lilia-app::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

/* Bespoke icon language */
.lilia-icon {
  overflow: visible;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 0 transparent);
  transition:
    color var(--motion-fast) ease,
    filter var(--motion-base) ease,
    transform var(--motion-base) var(--ease-spring);
}
.lilia-icon .icon-signal {
  color: var(--lilia-violet-bright);
  opacity: 0.62;
  transition:
    opacity var(--motion-fast) ease,
    transform var(--motion-base) var(--ease-spring);
  transform-origin: center;
}
button:hover > .lilia-icon,
a:hover > .lilia-icon,
.active > .lilia-icon {
  color: #f4e9ff;
  filter: drop-shadow(0 0 7px rgba(196, 99, 255, 0.42));
}
button:hover > .lilia-icon .icon-signal,
a:hover > .lilia-icon .icon-signal,
.active > .lilia-icon .icon-signal {
  opacity: 1;
  transform: scale(1.08);
}
.send-button:not(:disabled):hover .lilia-icon-send {
  transform: translate(2px, -2px) rotate(-2deg);
}
.send-button:not(:disabled):active .lilia-icon-send {
  transform: translate(5px, -5px) scale(0.86);
}
.notification-trigger[aria-expanded="true"] .lilia-icon-bell {
  animation: lilia-bell 0.48s var(--ease-spring);
}
.automation-status.running + h2 .lilia-icon-calendar,
.activity-state .lilia-icon {
  animation: lilia-signal-spin 1.8s linear infinite;
}

/* Shell */
.lilia-app {
  background:
    radial-gradient(circle at 76% -10%, rgba(120, 38, 194, 0.2), transparent 35%),
    linear-gradient(145deg, #050409, #080511 55%, #050409);
}
.sidebar {
  width: var(--sidebar);
  padding: 22px 20px 17px;
  background: linear-gradient(180deg, rgba(5, 4, 10, 0.985), rgba(10, 6, 17, 0.97));
  box-shadow: 14px 0 60px rgba(0, 0, 0, 0.2);
}
.brand-row {
  position: relative;
  display: flex;
  align-items: center;
  height: 72px;
  padding: 0;
  margin: 0 0 16px;
  background: none;
  cursor: default;
  transform: none;
}
.brand-row:hover,
.brand-row:focus-visible {
  filter: none;
  transform: none;
}
.brand-home {
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
  background: url("/brand/lilia-wordmark.svg") left center / min(214px, 90%) auto no-repeat;
  cursor: pointer;
  border-radius: 10px;
  text-align: left;
  transition:
    filter var(--motion-base) ease,
    transform var(--motion-base) var(--ease-spring);
}
.brand-home::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 7px;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--lilia-violet-bright), transparent);
  box-shadow: 0 0 8px var(--lilia-violet);
  transition: width var(--motion-slow) var(--ease-lilia);
}
.brand-home:hover,
.brand-home:focus-visible {
  filter: drop-shadow(0 0 13px rgba(190, 91, 255, 0.3));
  transform: translateX(3px);
}
.brand-home:hover::after,
.brand-home:focus-visible::after {
  width: 174px;
}
.brand-home .lilia-mark,
.brand-home .brand {
  position: absolute;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.mobile-close {
  position: absolute;
  right: 0;
  z-index: 2;
}
.new-chat {
  position: relative;
  overflow: hidden;
  min-height: 49px;
  border-radius: 10px;
  isolation: isolate;
}
.new-chat::before {
  content: "";
  position: absolute;
  inset: -120% -40%;
  z-index: -1;
  background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, 0.22) 48%, transparent 58%);
  transform: translateX(-60%);
  transition: transform 0.72s var(--ease-lilia);
}
.new-chat:hover::before {
  transform: translateX(60%);
}
.primary-nav {
  gap: 7px;
}
.primary-nav button {
  position: relative;
  min-height: 46px;
  border-radius: 9px;
  overflow: hidden;
  transition:
    color var(--motion-fast) ease,
    background var(--motion-base) ease,
    border-color var(--motion-base) ease,
    transform var(--motion-base) var(--ease-lilia);
}
.primary-nav button::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 50%;
  width: 3px;
  height: 0;
  transform: translateY(-50%);
  border-radius: 3px;
  background: linear-gradient(var(--lilia-violet-bright), var(--lilia-magenta));
  box-shadow: 0 0 14px rgba(199, 91, 255, 0.7);
  transition: height var(--motion-base) var(--ease-lilia);
}
.primary-nav button.active::before {
  height: 62%;
}
.primary-nav button.active {
  background: linear-gradient(90deg, rgba(151, 55, 229, 0.2), rgba(79, 27, 121, 0.08));
  border-color: rgba(213, 146, 255, 0.3);
}
.primary-nav button:hover {
  transform: translateX(3px);
}
.history-row {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
}
.history-row > span {
  min-width: 0;
}
.history-row.active {
  box-shadow:
    inset 2px 0 var(--lilia-violet-bright),
    0 8px 22px rgba(0, 0, 0, 0.14);
}
.profile-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(28, 18, 47, 0.9), rgba(15, 11, 26, 0.96));
  transition:
    border-color var(--motion-base) ease,
    transform var(--motion-base) var(--ease-spring),
    box-shadow var(--motion-base) ease;
}
.profile-card::after {
  content: "";
  position: absolute;
  right: -26px;
  top: -28px;
  width: 70px;
  height: 70px;
  border: 1px solid rgba(202, 125, 255, 0.18);
  transform: rotate(45deg);
  transition: transform var(--motion-slow) var(--ease-lilia);
}
.profile-card:hover {
  transform: translateY(-2px);
  border-color: var(--lilia-line-bright);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.2);
}
.profile-card:hover::after {
  transform: rotate(65deg) scale(1.12);
}

.work-area {
  isolation: isolate;
}
.topbar {
  height: 76px;
  flex-basis: 76px;
  padding-inline: clamp(18px, 2.3vw, 38px);
  background: linear-gradient(180deg, rgba(7, 5, 12, 0.9), rgba(7, 5, 12, 0.68));
  border-bottom-color: rgba(204, 141, 255, 0.18);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 28%;
  height: 1px;
  background: linear-gradient(90deg, var(--lilia-violet), transparent);
  opacity: 0.62;
}
.topbar-title {
  display: flex;
  align-items: center;
  gap: 9px;
}
.topbar-kicker {
  padding: 6px 10px;
  border: 1px solid rgba(202, 131, 255, 0.25);
  border-radius: 7px;
  background: rgba(140, 54, 211, 0.16);
}
.view-signal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #8e7aa5;
  margin-left: 2px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.view-signal i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lilia-violet-bright);
  box-shadow: 0 0 9px var(--lilia-violet);
  animation: lilia-breathe 2.2s ease-in-out infinite;
}
.view-signal b {
  font-weight: 700;
}
.notification-trigger {
  transition:
    transform var(--motion-base) var(--ease-spring),
    background var(--motion-base) ease,
    border-color var(--motion-base) ease;
}
.notification-trigger:hover {
  transform: translateY(-2px);
}
.usage-mini {
  top: 19px;
  right: 84px;
  min-height: 34px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(203, 132, 255, 0.14);
  border-radius: 9px;
  color: #9682aa;
  background: rgba(17, 10, 28, 0.62);
  backdrop-filter: blur(12px);
}
.usage-mini > .lilia-icon {
  color: #c87dff;
}
.page-view,
.chat-view {
  animation: lilia-view-in var(--motion-slow) var(--ease-lilia) both;
}

/* Welcome stage */
.empty-chat {
  padding-inline: clamp(42px, 7vw, 116px);
  background: radial-gradient(circle at 72% 40%, rgba(94, 26, 150, 0.17), transparent 33%);
}
.empty-atmosphere {
  background-image: radial-gradient(circle, rgba(160, 95, 255, 0.26) 1px, transparent 1.5px);
  background-size: 145px 145px;
  opacity: 0.75;
  mask-image: linear-gradient(to bottom, black, transparent 92%);
}
.empty-copy {
  animation: lilia-copy-reveal 0.74s var(--ease-lilia) 0.08s both;
}
.empty-kicker {
  color: #da92ff;
  text-shadow: 0 0 15px rgba(195, 86, 255, 0.32);
}
.empty-chat h1 {
  max-width: 760px;
  text-wrap: balance;
}
.empty-chat h1 em {
  background: linear-gradient(100deg, #8d8bff 0%, #bf70ff 46%, #f16fd6 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.empty-accent {
  display: flex;
  align-items: center;
  gap: 10px;
}
.empty-accent span {
  animation: lilia-spark 2.4s ease-in-out infinite;
}
.empty-accent i {
  position: relative;
  overflow: visible;
}
.empty-accent i::after {
  content: "";
  position: absolute;
  right: -6px;
  top: -3px;
  width: 6px;
  height: 6px;
  border: 1px solid var(--lilia-violet-bright);
  transform: rotate(45deg);
  opacity: 0.65;
}
.empty-hero-media {
  animation: lilia-hero-reveal 0.86s var(--ease-lilia) 0.04s both;
  transform-origin: 70% 80%;
}
.empty-hero-media::before {
  content: "";
  position: absolute;
  inset: 12% 8% 2% 18%;
  z-index: -1;
  background: radial-gradient(ellipse, rgba(138, 51, 225, 0.24), transparent 67%);
  filter: blur(18px);
  animation: lilia-hero-aura 4.8s ease-in-out infinite;
}
.empty-hero-media img {
  filter: saturate(1.08) contrast(1.05) drop-shadow(0 30px 45px rgba(0, 0, 0, 0.38));
}
.lilia-particle-field {
  z-index: 1;
}
.lilia-particle-field i {
  animation-name: lilia-particle-drift;
  will-change: transform, opacity;
}
.particle-orbit {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px solid rgba(184, 105, 255, 0.11);
  box-shadow: inset 0 0 28px rgba(151, 57, 229, 0.035);
  animation: lilia-orbit 20s linear infinite;
}
.particle-orbit::after {
  content: "";
  position: absolute;
  left: 13%;
  top: 13%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lilia-violet-bright);
  box-shadow: 0 0 12px var(--lilia-violet);
}
.orbit-one {
  right: 16%;
  top: 12%;
}
.orbit-two {
  right: 4%;
  bottom: 22%;
  width: 150px;
  height: 150px;
  animation-direction: reverse;
  animation-duration: 14s;
}
.energy-thread {
  position: absolute;
  width: 34%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(206, 133, 255, 0.34), transparent);
  transform: rotate(-14deg);
  filter: blur(0.2px);
  opacity: 0.4;
  animation: lilia-thread 5s ease-in-out infinite;
}
.thread-one {
  left: 34%;
  top: 30%;
}
.thread-two {
  left: 56%;
  top: 62%;
  animation-delay: -2.2s;
}
.quick-actions {
  gap: 12px;
  animation: lilia-actions-reveal 0.68s var(--ease-lilia) 0.22s both;
}
.quick-actions > button {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  border-radius: 11px;
  transition:
    transform var(--motion-base) var(--ease-spring),
    border-color var(--motion-base) ease,
    box-shadow var(--motion-base) ease;
}
.quick-actions > button::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 42%;
  height: 1px;
  background: linear-gradient(90deg, var(--lilia-violet-bright), transparent);
  opacity: 0.52;
}
.quick-actions > button::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -28px;
  width: 70px;
  height: 70px;
  border: 1px solid rgba(195, 113, 255, 0.13);
  transform: rotate(45deg);
  transition: transform var(--motion-slow) var(--ease-lilia);
}
.quick-actions > button:hover {
  transform: translateY(-5px);
  box-shadow:
    0 20px 45px rgba(0, 0, 0, 0.28),
    0 0 22px rgba(159, 63, 235, 0.12);
}
.quick-actions > button:hover::after {
  transform: rotate(64deg) scale(1.15);
}

/* Composer and chat */
.composer-zone {
  padding-inline: clamp(14px, 4vw, 64px);
}
.composer {
  position: relative;
  overflow: visible;
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(22, 13, 36, 0.98), rgba(7, 6, 12, 0.985));
  transition:
    border-color var(--motion-base) ease,
    box-shadow var(--motion-slow) ease,
    transform var(--motion-base) var(--ease-lilia);
}
.composer::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: conic-gradient(from 160deg, transparent 0 48%, rgba(205, 117, 255, 0.3), transparent 61%);
  opacity: 0;
  transition: opacity var(--motion-base) ease;
}
.composer:focus-within {
  transform: translateY(-2px);
  border-color: var(--lilia-line-bright);
  box-shadow:
    0 26px 85px rgba(0, 0, 0, 0.5),
    0 0 34px rgba(143, 46, 221, 0.14);
}
.composer:focus-within::before {
  opacity: 1;
}
.composer textarea {
  padding: 19px 20px 11px;
}
.composer-controls {
  padding-inline: 13px;
}
.tool-trigger,
.agent-trigger {
  border-radius: 9px;
  transition:
    transform var(--motion-fast) ease,
    background var(--motion-fast) ease,
    border-color var(--motion-fast) ease;
}
.tool-trigger:hover,
.agent-trigger:hover {
  transform: translateY(-1px);
}
.send-button {
  position: relative;
  overflow: visible;
  border-radius: 9px;
  transition:
    transform var(--motion-base) var(--ease-spring),
    filter var(--motion-fast) ease,
    box-shadow var(--motion-base) ease;
}
.send-button:not(:disabled):hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 8px 24px rgba(183, 66, 255, 0.38),
    0 0 26px rgba(201, 79, 255, 0.28);
}
.send-button:not(:disabled)::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid rgba(208, 127, 255, 0.2);
  border-radius: 12px;
  opacity: 0;
  transform: scale(0.72);
}
.send-button:not(:disabled):active::after {
  animation: lilia-send-ring 0.48s var(--ease-lilia);
}
.mode-banner {
  padding: 11px 13px 3px;
}
.mode-banner > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.aspect-picker {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 4px;
  border: 1px solid rgba(204, 133, 255, 0.2);
  border-radius: 10px;
  background: rgba(6, 4, 11, 0.42);
  overflow-x: auto;
}
.aspect-picker button {
  display: inline-flex;
  min-width: 44px;
  height: 37px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #9382a8;
  cursor: pointer;
  transition:
    color var(--motion-fast) ease,
    background var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    transform var(--motion-fast) var(--ease-spring);
}
.aspect-picker button:hover {
  color: white;
  transform: translateY(-1px);
}
.aspect-picker button.active {
  color: white;
  background: rgba(145, 55, 220, 0.22);
  border-color: rgba(211, 135, 255, 0.45);
  box-shadow: inset 0 0 14px rgba(168, 74, 238, 0.1);
}
.aspect-shape {
  display: block;
  max-width: 20px;
  max-height: 20px;
  border: 1.3px solid currentColor;
  border-radius: 2px;
  box-shadow: inset 0 0 5px rgba(193, 104, 255, 0.1);
}
.aspect-picker small {
  font-size: 9px;
}
.message {
  padding: 4px 0;
  animation: lilia-message-in 0.42s var(--ease-lilia) both;
}
.message-avatar {
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}
.message-avatar > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.message.assistant .message-column {
  position: relative;
}
.message.assistant .message-column::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 6px;
  width: 1px;
  height: 0;
  background: linear-gradient(var(--lilia-violet-bright), transparent);
  animation: lilia-message-line 0.52s var(--ease-lilia) 0.08s forwards;
}
.message-actions {
  opacity: 0.35;
  transform: translateY(2px);
  transition:
    opacity var(--motion-fast) ease,
    transform var(--motion-fast) ease;
}
.message:hover .message-actions,
.message:focus-within .message-actions {
  opacity: 1;
  transform: none;
}
.activity-state {
  animation: lilia-message-in 0.34s var(--ease-lilia) both;
}
.activity-orb {
  border: 1px solid rgba(205, 128, 255, 0.25);
  box-shadow: 0 0 22px rgba(147, 52, 222, 0.16);
}

/* Menus and notifications */
.tools-menu,
.agent-menu,
.notification-popover,
.rename-popover,
.project-menu {
  transform-origin: bottom left;
  animation: lilia-menu-in var(--motion-base) var(--ease-lilia) both;
  backdrop-filter: blur(22px);
}
.agent-menu,
.notification-popover,
.project-menu {
  transform-origin: top right;
}
.skill-menu {
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(28, 15, 44, 0.985), rgba(8, 6, 14, 0.985));
}
.skill-menu-tabs button {
  transition:
    transform var(--motion-fast) var(--ease-spring),
    background var(--motion-fast) ease,
    color var(--motion-fast) ease;
}
.skill-menu-tabs button:hover {
  transform: translateY(-1px);
}
.tools-menu > button {
  position: relative;
}
.tools-menu > button::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(206, 135, 255, 0.12), transparent);
}
.notification-item {
  transition:
    background var(--motion-fast) ease,
    transform var(--motion-fast) var(--ease-lilia);
}
.notification-item:hover {
  transform: translateX(2px);
}

/* Content pages */
.page-view {
  padding-inline: clamp(24px, 4vw, 72px);
}
.page-heading {
  max-width: 1180px;
}
.page-heading-copy {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
  gap: 15px;
}
.page-heading-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(205, 132, 255, 0.24);
  border-radius: 11px;
  color: #d58aff !important;
  background: linear-gradient(145deg, rgba(126, 42, 194, 0.18), rgba(12, 8, 20, 0.72));
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.16),
    inset 0 0 14px rgba(169, 63, 236, 0.06);
}
.page-heading-copy > div > span {
  color: #d78aff;
}
.page-heading-copy h1 {
  text-wrap: balance;
}
.project-grid,
.library-grid {
  max-width: 1180px;
}
.project-card,
.library-card,
.settings-card,
.automation-card {
  position: relative;
  isolation: isolate;
  border-radius: 13px;
  transition:
    transform var(--motion-base) var(--ease-spring),
    border-color var(--motion-base) ease,
    box-shadow var(--motion-slow) ease;
}
.project-card::before,
.settings-card::before,
.automation-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 34%;
  height: 1px;
  background: linear-gradient(90deg, var(--lilia-violet-bright), transparent);
  opacity: 0.5;
}
.project-card::after,
.automation-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -34px;
  top: -38px;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(199, 117, 255, 0.12);
  transform: rotate(45deg);
  transition: transform 0.5s var(--ease-lilia);
}
.project-card:hover,
.library-card:hover,
.automation-card:hover {
  transform: translateY(-5px);
  border-color: var(--lilia-line-bright);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.28),
    0 0 28px rgba(151, 56, 228, 0.1);
}
.project-card:hover::after,
.automation-card:hover::after {
  transform: rotate(72deg) scale(1.12);
}
.project-icon {
  border: 1px solid rgba(203, 126, 255, 0.22);
  background: linear-gradient(145deg, rgba(111, 40, 173, 0.32), rgba(32, 16, 48, 0.74));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.library-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, transparent 45%, rgba(147, 49, 222, 0.14));
  opacity: 0;
  transition: opacity var(--motion-base) ease;
}
.library-card:hover .library-thumb::after {
  opacity: 1;
}
.library-card:hover .library-thumb img {
  transform: scale(1.035);
}
.filter-row {
  max-width: 1180px;
  margin-inline: auto;
  padding-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.filter-pills {
  display: flex;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
}
.filter-row button {
  position: relative;
  overflow: hidden;
}
.library-search {
  display: flex;
  width: min(300px, 34vw);
  min-height: 39px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid rgba(205, 135, 255, 0.18);
  border-radius: 10px;
  color: #927da7;
  background: rgba(7, 5, 12, 0.46);
  transition:
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}
.library-search:focus-within {
  border-color: var(--lilia-line-bright);
  box-shadow: 0 0 0 3px rgba(173, 73, 237, 0.08);
}
.library-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #f3ebfa;
  background: transparent;
  font-size: 11px;
}
.library-search button {
  display: grid;
  width: 25px;
  min-width: 25px;
  height: 25px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
}
.filter-row button.active::after {
  content: "";
  position: absolute;
  left: 28%;
  right: 28%;
  bottom: 2px;
  height: 1px;
  background: var(--lilia-violet-bright);
  box-shadow: 0 0 8px var(--lilia-violet);
}
.empty-page > div {
  position: relative;
}
.empty-page > div::after {
  content: "";
  position: absolute;
  inset: -12px;
  border: 1px solid rgba(204, 125, 255, 0.18);
  transform: rotate(45deg);
  animation: lilia-orbit 12s linear infinite;
}

/* Usage and settings */
.settings-page {
  max-width: none;
}
.settings-page > .page-heading {
  margin-bottom: 24px;
}
.settings-page form {
  max-width: 1180px !important;
  margin-inline: auto;
  gap: 16px;
}
.settings-card {
  overflow: hidden;
  background: linear-gradient(145deg, rgba(24, 16, 35, 0.92), rgba(11, 8, 17, 0.96));
}
.settings-card:hover {
  transform: translateY(-2px);
}
.settings-card h2 {
  display: flex;
  align-items: center;
  gap: 9px;
}
.settings-card h2::before {
  width: 7px;
  height: 7px;
  border-radius: 1px;
  transform: rotate(45deg);
  background: var(--lilia-violet-bright);
  box-shadow: 0 0 10px rgba(196, 91, 255, 0.48);
}
.setting-row select,
.profile-editor input,
.textarea-setting textarea {
  transition:
    border-color var(--motion-fast) ease,
    background var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}
.setting-row select:focus,
.profile-editor input:focus,
.textarea-setting textarea:focus {
  border-color: var(--lilia-line-bright);
  box-shadow: 0 0 0 3px rgba(174, 74, 237, 0.09);
}
.usage-dashboard {
  max-width: 1180px;
  margin: 0 auto 18px;
  padding: 20px;
  border: 1px solid var(--lilia-line);
  border-radius: 15px;
  background:
    radial-gradient(circle at 86% 0, rgba(130, 42, 203, 0.18), transparent 35%),
    linear-gradient(145deg, rgba(24, 15, 39, 0.95), rgba(10, 7, 16, 0.98));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: lilia-view-in 0.42s var(--ease-lilia) both;
}
.usage-dashboard > header {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 17px;
  border-bottom: 1px solid rgba(206, 144, 255, 0.13);
}
.usage-dashboard > header span {
  display: block;
  color: #a791ba;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.usage-dashboard > header h2 {
  margin: 4px 0 0;
  font: 600 22px/1.1 var(--font-editorial);
}
.usage-emblem {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(207, 137, 255, 0.3);
  border-radius: 11px;
  color: #d78aff;
  background: rgba(129, 40, 199, 0.13);
}
.provider-health {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(110, 219, 164, 0.16);
  border-radius: 999px;
  background: rgba(56, 158, 107, 0.07);
}
.provider-health i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #73e7aa;
  box-shadow: 0 0 9px #57cf91;
  animation: lilia-breathe 1.9s ease-in-out infinite;
}
.provider-health span {
  color: #9dd6b9 !important;
  letter-spacing: 0.02em !important;
  font-weight: 600 !important;
}
.usage-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}
.usage-metrics article {
  padding: 14px;
  border: 1px solid rgba(206, 142, 255, 0.11);
  border-radius: 10px;
  background: rgba(5, 4, 9, 0.27);
}
.usage-metrics small,
.usage-metrics span,
.usage-metrics strong {
  display: block;
}
.usage-metrics small {
  color: #9383a6;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.usage-metrics strong {
  margin: 5px 0 2px;
  font-size: 21px;
}
.usage-metrics span {
  color: #746681;
  font-size: 9px;
}
.usage-bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.usage-bars > div > span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #b6a5c8;
}
.usage-bars b {
  font-size: 10px;
}
.usage-bars small {
  margin-left: auto;
  color: #887699;
  font-size: 9px;
}
.usage-bars > div > i {
  display: block;
  height: 3px;
  margin-top: 7px;
  border-radius: 4px;
  background: rgba(195, 126, 255, 0.1);
  overflow: hidden;
}
.usage-bars > div > i > b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7d3ce5, #d867e5);
  box-shadow: 0 0 9px rgba(190, 80, 255, 0.25);
  transition: width 0.6s var(--ease-lilia);
}

/* Automation studio */
.automation-page .page-heading p {
  max-width: 720px;
}
.automation-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr) 56px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  max-width: 860px;
  margin: -8px auto 24px;
  padding: 12px;
  border: 1px solid rgba(203, 131, 255, 0.14);
  border-radius: 13px;
  background: rgba(11, 7, 18, 0.52);
}
.automation-flow > span {
  display: grid;
  grid-template-columns: 28px 22px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #bfaacf;
}
.automation-flow > span > svg {
  color: #d58aff;
}
.automation-flow > span b {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(205, 127, 255, 0.24);
  border-radius: 50%;
  color: #d7b3ef;
  font-size: 9px;
}
.automation-flow > span small {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.automation-flow > i {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(204, 130, 255, 0.5), transparent);
}
.automation-form {
  position: relative;
  overflow: hidden;
}
.automation-form::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -70px;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(200, 123, 255, 0.08);
  transform: rotate(45deg);
  pointer-events: none;
}
.automation-card {
  overflow: hidden;
}
.automation-card-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: start;
}
.automation-card-signal {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(206, 133, 255, 0.22);
  border-radius: 9px;
  color: #ce83ff;
  background: rgba(126, 42, 193, 0.12);
  box-shadow: inset 0 0 14px rgba(164, 69, 230, 0.08);
}
.automation-card-signal.scheduled .lilia-icon {
  animation: lilia-breathe 2.6s ease-in-out infinite;
}
.automation-card-signal.paused {
  color: #f0bf70;
  border-color: rgba(240, 191, 112, 0.2);
  background: rgba(210, 152, 62, 0.08);
}
.automation-status {
  border: 1px solid rgba(196, 116, 255, 0.2);
}
.automation-status.scheduled {
  color: #bc91ff;
}
.automation-status.running {
  color: #75e5ad;
  background: rgba(69, 187, 126, 0.1);
  border-color: rgba(91, 221, 154, 0.18);
}
.automation-card-actions button {
  transition:
    transform var(--motion-fast) var(--ease-spring),
    border-color var(--motion-fast) ease,
    background var(--motion-fast) ease;
}
.automation-card-actions button:hover {
  transform: translateY(-2px);
  border-color: var(--lilia-line-bright);
}

/* Login */
.signin-shell {
  overflow: hidden;
}
.signin-shell::before,
.signin-shell::after {
  content: "";
  position: fixed;
  width: 38vw;
  height: 38vw;
  min-width: 320px;
  min-height: 320px;
  border-radius: 50%;
  border: 1px solid rgba(190, 102, 255, 0.1);
  pointer-events: none;
  animation: lilia-orbit 24s linear infinite;
}
.signin-shell::before {
  left: -17vw;
  top: -16vw;
}
.signin-shell::after {
  right: -16vw;
  bottom: -17vw;
  animation-direction: reverse;
}
.signin-card {
  animation: lilia-login-in 0.72s var(--ease-lilia) both;
  border-radius: 15px;
}
.signin-brand {
  animation: lilia-copy-reveal 0.62s var(--ease-lilia) 0.14s both;
}
.login-form label {
  transition: color var(--motion-fast) ease;
}
.login-form label:focus-within {
  color: #dda1ff;
}

.login-form input:-webkit-autofill,
.login-form input:-webkit-autofill:hover,
.login-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f7f1fb;
  caret-color: #f7f1fb;
  box-shadow: 0 0 0 1000px #100918 inset;
  border-color: rgba(205, 142, 248, 0.48);
  transition: background-color 9999s ease-out 0s;
}
.signin-button {
  position: relative;
  overflow: hidden;
  transition:
    transform var(--motion-base) var(--ease-spring),
    filter var(--motion-fast) ease,
    box-shadow var(--motion-base) ease;
}
.signin-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.07);
  box-shadow: 0 14px 35px rgba(174, 62, 244, 0.26);
}

/* Keyframes */
@keyframes lilia-view-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes lilia-copy-reveal {
  from {
    opacity: 0;
    transform: translate3d(-18px, 10px, 0);
    filter: blur(5px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
@keyframes lilia-hero-reveal {
  from {
    opacity: 0;
    transform: translate3d(34px, 20px, 0) scale(0.96);
    filter: blur(8px) saturate(0.8);
  }
  to {
    opacity: 0.94;
    transform: none;
    filter: saturate(1.12) contrast(1.08);
  }
}
@keyframes lilia-actions-reveal {
  from {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
@keyframes lilia-message-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes lilia-message-line {
  to {
    height: 34px;
  }
}
@keyframes lilia-menu-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.975);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
@keyframes lilia-login-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
@keyframes lilia-particle-drift {
  0% {
    opacity: 0;
    transform: translate3d(0, 12px, 0) scale(0.55);
  }
  35% {
    opacity: 0.65;
  }
  100% {
    opacity: 0.08;
    transform: translate3d(var(--drift), -34px, 0) scale(1.4);
  }
}
@keyframes lilia-orbit {
  to {
    transform: rotate(360deg);
  }
}
@keyframes lilia-thread {
  0%,
  100% {
    opacity: 0.1;
    transform: rotate(-14deg) scaleX(0.6);
  }
  50% {
    opacity: 0.5;
    transform: rotate(-14deg) scaleX(1);
  }
}
@keyframes lilia-hero-aura {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.94);
  }
  50% {
    opacity: 0.86;
    transform: scale(1.05);
  }
}
@keyframes lilia-spark {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.86) rotate(0);
  }
  50% {
    opacity: 1;
    transform: scale(1.12) rotate(35deg);
    text-shadow: 0 0 14px #c269ff;
  }
}
@keyframes lilia-breathe {
  0%,
  100% {
    opacity: 0.48;
    transform: scale(0.82);
  }
  50% {
    opacity: 1;
    transform: scale(1.12);
  }
}
@keyframes lilia-send-ring {
  0% {
    opacity: 0.75;
    transform: scale(0.72);
  }
  100% {
    opacity: 0;
    transform: scale(1.45);
  }
}
@keyframes lilia-bell {
  0%,
  100% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(-16deg);
  }
  55% {
    transform: rotate(13deg);
  }
  80% {
    transform: rotate(-6deg);
  }
}
@keyframes lilia-signal-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive choreography */
@media (max-width: 1180px) and (min-width: 761px) {
  :root {
    --sidebar: 250px;
  }
  .empty-chat {
    padding-inline: 48px;
  }
  .empty-hero-media {
    width: 64%;
    right: -12%;
    opacity: 0.78;
  }
  .quick-actions {
    width: calc(100% - 8%);
    animation-name: lilia-view-in;
  }
  .page-view {
    padding-inline: 32px;
  }
  .usage-dashboard {
    margin-inline: 0;
  }
  .filter-row {
    align-items: stretch;
    flex-direction: column-reverse;
  }
  .filter-pills {
    padding-bottom: 2px;
  }
  .library-search {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .lilia-app::before {
    opacity: 0.08;
  }
  .sidebar {
    width: min(320px, 88vw);
    padding: 18px 16px 14px;
  }
  .brand-row {
    height: 66px;
  }
  .brand-home {
    background-size: 190px auto;
  }
  .topbar {
    height: 64px;
    flex-basis: 64px;
    padding-inline: 12px;
  }
  .topbar-kicker {
    padding: 5px 7px;
  }
  .view-signal {
    display: none;
  }
  .page-view {
    padding: 30px 15px 120px;
  }
  .page-heading {
    margin-bottom: 25px;
  }
  .page-heading-copy {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 11px;
  }
  .page-heading-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
  }
  .page-heading h1 {
    font-size: clamp(36px, 11vw, 44px);
  }
  .empty-chat {
    min-height: auto;
    padding: 40px 18px 196px;
    align-items: flex-start;
    text-align: left;
  }
  .empty-copy {
    max-width: 88%;
  }
  .empty-chat h1 {
    font-size: clamp(42px, 12.5vw, 56px);
  }
  .empty-chat > .empty-copy > p {
    font-size: 13px;
  }
  .empty-hero-media {
    right: -28%;
    width: 92%;
    bottom: 230px;
    opacity: 0.34;
  }
  .particle-orbit {
    display: none;
  }
  .lilia-particle-field i:nth-child(n + 13) {
    display: none;
  }
  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 34px;
    animation-name: lilia-view-in;
  }
  .quick-actions > button {
    min-height: 96px;
    padding: 13px;
  }
  .composer-zone {
    padding-inline: 8px;
  }
  .composer {
    border-radius: 12px;
  }
  .composer:focus-within {
    transform: none;
  }
  .mode-banner {
    align-items: flex-start;
  }
  .aspect-picker {
    order: 3;
    width: 100%;
    margin: 4px 0 0;
    justify-content: space-between;
  }
  .aspect-picker button {
    min-width: 42px;
    flex: 1;
  }
  .message-list {
    padding-inline: 13px;
  }
  .message.assistant .message-column::before {
    display: none;
  }
  .usage-dashboard {
    padding: 15px;
  }
  .usage-dashboard > header {
    align-items: flex-start;
  }
  .provider-health {
    padding: 6px;
  }
  .provider-health span {
    display: none !important;
  }
  .usage-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .usage-bars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .settings-page form {
    gap: 12px;
  }
  .project-card:hover,
  .library-card:hover,
  .automation-card:hover,
  .settings-card:hover {
    transform: none;
  }
  .automation-flow {
    grid-template-columns: 1fr;
    margin-top: 0;
  }
  .automation-flow > i {
    width: 1px;
    height: 12px;
    margin-left: 16px;
    background: linear-gradient(transparent, rgba(204, 130, 255, 0.5), transparent);
  }
}

@media (max-width: 430px) {
  .empty-copy {
    max-width: 100%;
  }
  .empty-chat {
    padding-inline: 15px;
  }
  .empty-chat h1 {
    font-size: 43px;
    letter-spacing: -0.045em;
  }
  .quick-actions {
    gap: 8px;
  }
  .quick-actions > button {
    min-height: 91px;
  }
  .quick-actions > button small {
    font-size: 9px;
  }
  .aspect-picker small {
    display: none;
  }
  .usage-metrics article {
    padding: 11px;
  }
  .usage-bars {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-height: 720px) and (min-width: 761px) {
  .empty-chat {
    padding-top: 30px;
  }
  .empty-chat h1 {
    font-size: clamp(46px, 4.6vw, 64px);
  }
  .empty-chat .empty-copy > p {
    margin-block: 14px;
  }
  .quick-actions {
    bottom: 166px;
  }
  .quick-actions > button {
    min-height: 94px;
  }
  .composer-zone {
    padding-top: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lilia-particle-field,
  .particle-orbit,
  .energy-thread {
    display: none !important;
  }
  .empty-copy,
  .empty-hero-media,
  .quick-actions,
  .page-view,
  .chat-view,
  .message,
  .tools-menu,
  .agent-menu,
  .notification-popover,
  .rename-popover,
  .project-menu,
  .signin-card,
  .signin-brand {
    animation: none !important;
  }
  .empty-hero-media {
    transform: none !important;
    filter: none !important;
  }
  .view-signal i,
  .provider-health i,
  .empty-accent span {
    animation: none !important;
  }
}

.reduced-motion .lilia-particle-field,
.reduced-motion .particle-orbit,
.reduced-motion .energy-thread {
  display: none !important;
}

/* Visor visual contenido: siempre vive sobre la ventana, nunca dentro del flujo del chat. */
.composer textarea {
  height: auto;
  overflow-y: auto;
}

.reference-fidelity {
  display: flex !important;
  align-items: center;
  gap: 5px;
}

.reference-fidelity i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #b968f0;
  box-shadow: 0 0 10px rgba(185, 104, 240, 0.85);
}

.jump-to-latest {
  position: absolute;
  left: 50%;
  bottom: 164px;
  z-index: 14;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(210, 148, 255, 0.35);
  border-radius: 999px;
  background: rgba(24, 13, 39, 0.92);
  color: #e7daf0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.38);
  transform: translateX(-50%);
  cursor: pointer;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: lilia-jump-in 180ms var(--ease-lilia) both;
}

.jump-to-latest svg {
  transform: rotate(90deg);
}

.jump-to-latest span {
  font-size: 10px;
  font-weight: 750;
}

@keyframes lilia-jump-in {
  from {
    opacity: 0;
    transform: translate(-50%, 7px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.action-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 2, 8, 0.78);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  animation: lilia-lightbox-backdrop 170ms var(--ease-lilia) both;
}

.action-dialog {
  width: min(460px, 100%);
  overflow: hidden;
  border: 1px solid rgba(211, 151, 255, 0.35);
  border-radius: 19px;
  background: linear-gradient(150deg, rgba(27, 15, 43, 0.99), rgba(12, 9, 22, 0.99));
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.66);
  outline: none;
  animation: lilia-lightbox-panel 200ms var(--ease-lilia) both;
}

.action-dialog > header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px 14px;
}

.action-dialog > header > span {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(154, 63, 219, 0.2);
  color: #d898ff;
}

.action-dialog.danger > header > span {
  background: rgba(212, 72, 105, 0.14);
  color: #ff9bb2;
}

.action-dialog > header > div {
  min-width: 0;
  flex: 1;
}

.action-dialog > header strong {
  display: block;
  color: #fff;
  font-size: 15px;
}

.action-dialog > header p {
  margin: 6px 0 0;
  color: #a998b8;
  font-size: 11px;
  line-height: 1.55;
}

.action-dialog > header > button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: #a796b4;
  cursor: pointer;
}

.action-dialog > label {
  display: grid;
  gap: 7px;
  padding: 4px 20px 18px;
  color: #b9a9c6;
  font-size: 10px;
  font-weight: 750;
}

.action-dialog > label input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(208, 148, 250, 0.25);
  border-radius: 12px;
  background: rgba(8, 7, 18, 0.72);
  color: #fff;
  padding: 0 13px;
  outline: none;
  transition:
    border-color var(--motion-fast),
    box-shadow var(--motion-fast);
}

.action-dialog > label input:focus {
  border-color: rgba(215, 151, 255, 0.68);
  box-shadow: 0 0 0 3px rgba(164, 75, 224, 0.11);
}

.action-dialog > footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 20px 18px;
  border-top: 1px solid rgba(218, 169, 255, 0.1);
}

.action-dialog > footer button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 11px;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.action-dialog > footer .secondary {
  background: transparent;
  color: #c8b9d3;
}

.action-dialog > footer .confirm {
  border-color: transparent;
  background: linear-gradient(135deg, #9136d5, #bd4cf0);
  color: #fff;
}

.action-dialog.danger > footer .confirm {
  background: linear-gradient(135deg, #a92f51, #d94b6e);
}

.action-dialog > footer button:disabled {
  opacity: 0.45;
  cursor: wait;
}

.reference-thumb-button {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(218, 160, 255, 0.28);
  border-radius: 9px;
  background: #09070e;
  cursor: zoom-in;
  transition:
    transform var(--motion-fast),
    border-color var(--motion-fast),
    box-shadow var(--motion-fast);
}

.reference-thumb-button > img {
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: cover;
  border-radius: 0 !important;
}

.reference-thumb-button > span {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 20px;
  height: 20px;
  display: grid !important;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  background: rgba(7, 5, 12, 0.8);
  color: #eedbff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.reference-thumb-button:hover,
.reference-thumb-button:focus-visible {
  transform: translateY(-1px) scale(1.03);
  border-color: rgba(221, 164, 255, 0.72);
  box-shadow: 0 8px 22px rgba(127, 47, 190, 0.25);
}

.image-lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 36px);
  background: radial-gradient(circle at 50% 42%, rgba(153, 70, 220, 0.15), transparent 38%), rgba(3, 2, 8, 0.84);
  -webkit-backdrop-filter: blur(18px) saturate(0.82);
  backdrop-filter: blur(18px) saturate(0.82);
  animation: lilia-lightbox-backdrop 180ms var(--ease-lilia) both;
}

.image-lightbox {
  position: relative;
  width: min(920px, calc(100vw - 48px));
  height: auto;
  max-height: min(88dvh, 820px);
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(210, 146, 255, 0.42);
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(24, 13, 39, 0.98), rgba(8, 7, 18, 0.99));
  box-shadow:
    0 38px 120px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(255, 255, 255, 0.025) inset,
    0 0 54px rgba(155, 67, 224, 0.1);
  outline: none;
  animation: lilia-lightbox-panel 220ms var(--ease-lilia) both;
}

.image-lightbox-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 18px;
  border-bottom: 1px solid rgba(218, 169, 255, 0.13);
  background: rgba(17, 10, 29, 0.86);
}

.image-lightbox-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(205, 132, 255, 0.35);
  border-radius: 12px;
  color: #dc9cff;
  background: linear-gradient(145deg, rgba(152, 62, 216, 0.25), rgba(56, 23, 85, 0.28));
}

.image-lightbox-header > div {
  min-width: 0;
  flex: 1;
}

.image-lightbox-kicker,
.image-lightbox-header strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-lightbox-kicker {
  margin-bottom: 4px;
  color: #b78acb;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.image-lightbox-header strong {
  color: #fbf7ff;
  font-size: 13px;
}

.image-lightbox-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(218, 169, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: #b9a9c6;
  cursor: pointer;
  transition:
    color var(--motion-fast),
    border-color var(--motion-fast),
    background var(--motion-fast),
    transform var(--motion-fast);
}

.image-lightbox-close:hover,
.image-lightbox-close:focus-visible {
  color: #fff;
  border-color: rgba(220, 158, 255, 0.58);
  background: rgba(158, 67, 220, 0.2);
  transform: rotate(4deg);
}

.image-lightbox-media {
  position: relative;
  min-height: min(420px, 56dvh);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(14px, 2vw, 24px);
  background:
    linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.018) 25%,
      transparent 25%,
      transparent 75%,
      rgba(255, 255, 255, 0.018) 75%
    ),
    #07070d;
  background-size: 22px 22px;
}

.image-lightbox-glow {
  position: absolute;
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(146, 57, 218, 0.2);
  filter: blur(80px);
  pointer-events: none;
}

.image-lightbox-media > img {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(62dvh, 620px);
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}

.image-lightbox-footer {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px 12px 18px;
  border-top: 1px solid rgba(218, 169, 255, 0.13);
  background: rgba(17, 10, 29, 0.9);
}

.image-lightbox-footer p {
  min-width: 0;
  margin: 0;
  color: #8e819b;
  font-size: 10px;
}

.image-lightbox-footer p span {
  display: block;
  margin-bottom: 3px;
  color: #decfe8;
  font-size: 11px;
  font-weight: 750;
}

.image-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.image-lightbox-actions a,
.image-lightbox-actions button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid rgba(212, 153, 255, 0.25);
  border-radius: 11px;
  background: rgba(74, 35, 105, 0.3);
  color: #eee7f5;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--motion-fast),
    border-color var(--motion-fast),
    background var(--motion-fast);
}

.image-lightbox-actions button:last-child {
  min-width: 76px;
  border-color: transparent;
  background: linear-gradient(135deg, #8f35d4, #bc4bf0);
  color: #fff;
}

.image-lightbox-actions a:hover,
.image-lightbox-actions a:focus-visible,
.image-lightbox-actions button:hover,
.image-lightbox-actions button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(222, 165, 255, 0.58);
  background-color: rgba(126, 56, 166, 0.5);
}

@keyframes lilia-lightbox-backdrop {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes lilia-lightbox-panel {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 760px) {
  .jump-to-latest {
    left: 50%;
    bottom: 150px;
  }
  .image-lightbox-backdrop {
    padding: 8px;
  }
  .image-lightbox {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 17px;
  }
  .image-lightbox-header {
    min-height: 60px;
    padding: 10px;
  }
  .image-lightbox-mark {
    width: 34px;
    height: 34px;
  }
  .image-lightbox-media {
    min-height: 0;
    padding: 10px;
  }
  .image-lightbox-media > img {
    max-height: calc(100dvh - 196px);
  }
  .image-lightbox-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
    padding: 10px;
  }
  .image-lightbox-footer p {
    display: none;
  }
  .image-lightbox-actions {
    width: 100%;
  }
  .image-lightbox-actions a,
  .image-lightbox-actions button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .image-lightbox-backdrop,
  .image-lightbox {
    animation: none !important;
  }
}
