@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root{
  --bg:#f5f7fb;
  --bg-elev:#ffffff;
  --bg-soft:#eef2ff;
  --text:#121826;
  --muted:#5b6475;
  --line:#d9dfeb;
  --primary:#2458ff;
  --primary-strong:#163cc9;
  --success:#0b8f55;
  --warning:#f59e0b;
  --danger:#dc2626;
  --shadow:0 14px 32px rgba(20,32,70,.08);
  --radius:20px;
}

html[data-theme="dark"]{
  --bg:#0d1220;
  --bg-elev:#141b2d;
  --bg-soft:#1c2640;
  --text:#f4f7ff;
  --muted:#a9b4c8;
  --line:#2a3554;
  --primary:#7aa2ff;
  --primary-strong:#5f85e8;
  --shadow:0 18px 40px rgba(0,0,0,.28);
}

@media (prefers-color-scheme: dark){
  html[data-theme="system"]{
    --bg:#0d1220;
    --bg-elev:#141b2d;
    --bg-soft:#1c2640;
    --text:#f4f7ff;
    --muted:#a9b4c8;
    --line:#2a3554;
    --primary:#7aa2ff;
    --primary-strong:#5f85e8;
    --shadow:0 18px 40px rgba(0,0,0,.28);
  }
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:var(--bg);
  color:var(--text);
  min-height:100vh;
}
button,input,textarea,select{
  font:inherit;
}
button, .button-link{
  cursor:pointer;
}
textarea,input,select{
  width:100%;
  border:1px solid var(--line);
  background:var(--bg-elev);
  color:var(--text);
  border-radius:14px;
  padding:.9rem 1rem;
  transition:border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
textarea:focus,input:focus,select:focus,button:focus,.button-link:focus{
  outline:none;
  border-color:var(--primary);
  box-shadow:0 0 0 4px rgba(36,88,255,.15);
}
textarea{resize:vertical;min-height:110px}
button, .button-link{
  border:0;
  border-radius:14px;
  padding:.85rem 1.1rem;
  transition:transform .18s ease, opacity .18s ease, background .18s ease;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
button:hover,.button-link:hover{transform:translateY(-1px)}
button:disabled{opacity:.55;cursor:not-allowed;transform:none}
.primary{
  background:var(--primary);
  color:#fff;
}
.primary:hover{background:var(--primary-strong)}
.ghost{
  background:transparent;
  color:var(--text);
  border:1px solid var(--line);
}
.small{padding:.55rem .8rem;font-size:.9rem}
.hidden{display:none !important}
.shell{max-width:1600px;margin:0 auto;padding:1rem}
.topbar{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;
  min-height:72px;
  padding:.6rem 1.35rem;
  margin-bottom:1.2rem;
  background:var(--bg-elev);
  border:1px solid var(--line);
  border-radius:20px;
  box-shadow:var(--shadow);
  position:sticky;top:.75rem;z-index:10;
}
.brand{display:flex;align-items:center;gap:.85rem;min-width:0}
.brand-logo-wrap{
  width:220px;
  height:54px;
  flex:0 0 auto;
  display:grid;
  place-items:center;
  overflow:visible;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  text-decoration:none;
}
.brand-logo{
  grid-area:1 / 1;
  width:100%;
  height:100%;
  object-fit:contain;
  display:none;
}
.brand-logo-light{display:block}
.brand-logo-dark{display:none}
html[data-theme="dark"] .brand-logo-light{display:none}
html[data-theme="dark"] .brand-logo-dark{display:block}
@media (prefers-color-scheme: dark){
  html[data-theme="system"] .brand-logo-light{display:none}
  html[data-theme="system"] .brand-logo-dark{display:block}
}
.nexo-badge{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  padding:.35rem .85rem;
  border-radius:999px;
  background:var(--bg-soft);
  text-decoration:none;
  font-size:.78rem;
  transition:all .2s ease;
  border:1px solid var(--line);
  margin-left:.75rem;
}
.nexo-badge:hover{
  background:rgba(6,77,115,.08); /* Nexo Teal approx */
  border-color:#e87121; /* Nexo Orange approx */
  box-shadow:0 4px 12px rgba(232,113,33,.15);
}
.nexo-text{color:var(--muted);transition:color .2s ease}
.nexo-name{color:var(--text);font-weight:800;transition:color .2s ease;letter-spacing:-.02em}
.nexo-badge:hover .nexo-text{color:#064d73}
.nexo-badge:hover .nexo-name{color:#e87121}

html[data-theme="dark"] .nexo-badge:hover {
  background:rgba(232,113,33,.1);
}
html[data-theme="dark"] .nexo-badge:hover .nexo-text {
  color:#a5d3ed;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .nexo-badge:hover { background:rgba(232,113,33,.1); }
  html[data-theme="system"] .nexo-badge:hover .nexo-text { color:#a5d3ed; }
}

.topbar-actions{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}
.account-chip{
  max-width:220px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--muted);
  font-weight:700;
}
.badge{
  padding:.35rem .65rem;border-radius:999px;
  background:var(--bg-soft);color:var(--primary);font-size:.84rem;font-weight:700;
}
.usage-badge{background:rgba(245,158,11,.12);color:var(--warning)}
.badge-pro{background:rgba(11,143,85,.14);color:var(--success)}
.auth-layout{
  min-height:calc(100vh - 120px);
  display:grid;grid-template-columns:1.2fr .8fr;gap:1.2rem;
  align-items:center;padding:1.2rem 0;
}
.hero-card,.auth-card,.card,.sidebar,.workspace .view{
  background:var(--bg-elev);
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}
.hero-card,.auth-card,.card,.sidebar,.workspace .view{border-radius:24px}
.hero-card,.auth-card{padding:2rem}
.auth-card{
  background:linear-gradient(145deg,rgba(30,36,55,0.95) 0%,rgba(55,62,82,0.85) 100%);
  backdrop-filter:blur(20px);
  -webkit-backdrop-filter:blur(20px);
  border:1px solid rgba(255,255,255,0.1);
  box-shadow:0 24px 64px rgba(0,0,0,0.4);
}
.eyebrow{
  display:inline-flex;padding:.35rem .7rem;border-radius:999px;
  background:var(--bg-soft);color:var(--primary);font-size:.82rem;font-weight:700;
}
.hero-card h1{font-size:clamp(2rem,4vw,3.6rem);line-height:1.05;margin:.85rem 0}
.hero-card p{max-width:62ch;color:var(--muted)}
.hero-points{padding-left:1.2rem;color:var(--text)}
.tabs{display:flex;gap:.45rem;margin-bottom:1.2rem;padding:4px;background:var(--bg);border-radius:14px;border:1px solid var(--line)}
.tab{flex:1;background:transparent;border-radius:11px;font-weight:700;padding:.65rem 1rem;transition:all .2s ease}
.tab:hover{background:var(--bg-soft)}
.tab.is-active{background:var(--primary);color:#fff;box-shadow:0 4px 12px rgba(36,88,255,.25)}
.auth-form{display:grid;gap:.95rem}
.auth-form label,.card label{display:grid;gap:.5rem;font-weight:600;color:var(--muted);font-size:.92rem}
.auth-form input{
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:12px;
  padding:.75rem .9rem;
  color:var(--text);
  font-size:1rem;
  transition:border-color .2s ease;
}
.auth-form input:focus{border-color:var(--primary);outline:none}
.auth-form .primary{
  background:linear-gradient(135deg,#7c3aed,#5b21b6);
  border:none;
  padding:.85rem;
  font-size:1rem;
  font-weight:700;
  border-radius:14px;
  color:#fff;
  box-shadow:0 8px 24px rgba(124,58,237,.3);
  transition:all .2s ease;
}
.auth-form .primary:hover{
  box-shadow:0 12px 32px rgba(124,58,237,.45);
  transform:translateY(-1px);
}
.microcopy{color:var(--muted);font-size:.9rem}

.app-layout{
  display:grid;
  grid-template-columns:310px 1fr;
  gap:1.2rem;
  padding-top:0;
}
.sidebar{
  padding:1rem;
  align-self:start;
  position:sticky;
  top:5.5rem;
  background:rgba(13,18,32,0.92);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}
.nav{display:grid;gap:.45rem;margin-bottom:1rem}
.nav-link{
  text-align:left;
  background:transparent;
  border:0;
  color:var(--muted);
  padding:.85rem 1rem;
  display:flex;
  align-items:center;
  gap:0.65rem;
  border-radius:14px;
  font-weight:600;
  transition:background .18s ease, color .18s ease, box-shadow .18s ease;
}
.nav-link:hover{background:var(--bg-soft);color:var(--text)}
.nav-link.is-active{
  background:linear-gradient(135deg,#5b21b6,#2458ff);
  color:#fff;
  box-shadow:0 6px 20px rgba(91,33,182,.35);
}
.nav-link.is-active svg{opacity:1}
.panel{background:var(--bg);border:1px solid var(--line);border-radius:18px;padding:1rem}
.panel-head{display:flex;justify-content:space-between;align-items:center;gap:1rem}
.panel-head h2{margin:0;font-size:1rem}
.history-list{display:grid;gap:.75rem;margin-top:1rem;max-height:60vh;overflow:auto}
.history-item{
  border:1px solid var(--line);background:var(--bg-elev);border-radius:16px;padding:.85rem .85rem .85rem 2.2rem;
  display:grid;gap:.45rem;
  position:relative;
}
.history-item button{justify-content:flex-start}
.workspace{display:grid}
.view{display:none;padding:1.25rem}
.view.is-active{display:block;animation:fadeInUp .35s ease-out}
.view-head{
  display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;flex-wrap:wrap;
  margin-bottom:1rem;
}
.view-head h1{margin:.4rem 0 0}
.row-actions{display:flex;gap:.75rem;flex-wrap:wrap}
.editor-grid{
  display:grid;grid-template-columns:1.45fr .8fr;gap:1rem;margin-bottom:1rem;
}
.enhancer-card{
  border:1px solid rgba(120,149,255,.18) !important;
  background:linear-gradient(135deg,rgba(36,88,255,.04),var(--bg-elev) 60%) !important;
}
.modules-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.85rem;
}
.card{padding:1.1rem}
.full{grid-column:1 / -1}
.modules-grid .card{
  border:1px solid var(--line);
  border-left:3px solid var(--line);
  border-radius:18px;
  background:var(--bg-elev);
  transition:border-color .2s ease, box-shadow .2s ease;
  position:relative;
}
.modules-grid .card:hover{box-shadow:0 4px 16px rgba(0,0,0,.12)}

/* Module color accents */
.mod-titulo{border-left-color:#2458ff}
.mod-titulo:hover{border-left-color:#4d7fff}
.mod-rol{border-left-color:#7c3aed}
.mod-rol:hover{border-left-color:#9b5eff}
.mod-audiencia{border-left-color:#10a37f}
.mod-audiencia:hover{border-left-color:#1dc99a}
.mod-tarea{border-left-color:#f59e0b}
.mod-tarea:hover{border-left-color:#fbbf24}
.mod-contexto{border-left-color:#06b6d4}
.mod-contexto:hover{border-left-color:#22d3ee}
.mod-restricciones{border-left-color:#dc2626}
.mod-restricciones:hover{border-left-color:#ef4444}
.mod-formato{border-left-color:#6366f1}
.mod-formato:hover{border-left-color:#818cf8}
.mod-compuesto{border-left-color:#0b8f55}

/* Module label with icon row */
.module-label{
  display:flex;
  align-items:center;
  gap:.5rem;
  font-weight:700;
  font-size:.95rem;
  color:var(--text);
  margin-bottom:.55rem;
}
.module-icon{
  width:22px;height:22px;
  border-radius:6px;
  display:grid;place-items:center;
  flex-shrink:0;
}
.module-icon svg{width:13px;height:13px}
.mod-titulo .module-icon{background:rgba(36,88,255,.15);color:#2458ff}
.mod-rol .module-icon{background:rgba(124,58,237,.15);color:#7c3aed}
.mod-audiencia .module-icon{background:rgba(16,163,127,.15);color:#10a37f}
.mod-tarea .module-icon{background:rgba(245,158,11,.15);color:#f59e0b}
.mod-contexto .module-icon{background:rgba(6,182,212,.15);color:#06b6d4}
.mod-restricciones .module-icon{background:rgba(220,38,38,.15);color:#dc2626}
.mod-formato .module-icon{background:rgba(99,102,241,.15);color:#6366f1}
.mod-compuesto .module-icon{background:rgba(11,143,85,.15);color:#0b8f55}

.modules-grid textarea,.modules-grid input[type="text"]{
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:12px;
  padding:.7rem .85rem;
  transition:border-color .2s ease;
}
.modules-grid textarea:focus,.modules-grid input[type="text"]:focus{
  border-color:var(--primary);
}
.score-card{
  display:grid;
  grid-template-columns:116px 1fr;
  align-items:center;
  gap:1rem;
}
.score-card-dual{
  grid-template-columns:1fr;
  align-items:stretch;
}
.score-result{
  display:grid;
  grid-template-columns:96px 1fr;
  align-items:center;
  gap:.85rem;
  padding:.75rem;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--bg);
  transition:border-color .3s ease;
}
/* Score state badges */
.score-label-badge{
  display:inline-flex;
  align-items:center;
  gap:.3rem;
  font-size:.78rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:var(--muted);
  margin-bottom:.25rem;
}
.score-label-badge::before{
  content:'';
  width:6px;height:6px;
  border-radius:50%;
  background:var(--muted);
  display:inline-block;
}
.score-result.is-evaluating .score-label-badge::before{
  background:var(--warning);
  animation:scorePulse 1s ease-in-out infinite;
}
.score-result.has-score .score-label-badge::before{background:var(--success)}
@keyframes scorePulse{
  0%,100%{opacity:1;transform:scale(1)}
  50%{opacity:.4;transform:scale(.7)}
}
/* Score ring - pending state (dashed) */
.score-ring-progress.is-pending{
  stroke:var(--line);
  stroke-dasharray:12 8;
  stroke-width:6;
  animation:ringRotate 2s linear infinite;
}
@keyframes ringRotate{
  from{stroke-dashoffset:0}
  to{stroke-dashoffset:-263.89}
}
/* Score ring evaluating - pulse glow */
.score-result.is-evaluating .score-ring-svg{
  filter:drop-shadow(0 0 6px rgba(245,158,11,.3));
}
.score-ring{
  width:110px;height:110px;
  display:grid;place-items:center;
  text-align:center;
  position:relative;
}
.score-result .score-ring{width:90px;height:90px}
.score-ring strong{font-size:2rem;display:block}
.score-result .score-ring strong{font-size:1.65rem}
.score-tips{
  margin:.5rem 0 0;
  padding-left:0;
  list-style:none;
  color:var(--muted);
}
.score-tips li{
  display:flex;
  align-items:flex-start;
  gap:.4rem;
  font-size:.83rem;
  line-height:1.45;
  margin-bottom:.25rem;
}
.score-tips li::before{
  content:'›';
  color:var(--primary);
  font-weight:900;
  flex-shrink:0;
  margin-top:1px;
}
.library-list,.compare-grid,.pricing-grid{
  display:grid;gap:1rem;
}
.library-list{grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}
.library-card{
  padding:1.15rem;border:1px solid var(--line);border-radius:20px;background:var(--bg-elev);
  position:relative;overflow:hidden;
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display:flex;flex-direction:column;gap:.55rem;
}
.library-card h3{margin:0;font-size:1.05rem;line-height:1.35}
.library-meta{color:var(--muted);font-size:.88rem;margin:0}
.compare-command{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:1rem;
  margin-bottom:1rem;
  padding:1.1rem;
  border:1px solid var(--line);
  border-radius:22px;
  background:var(--bg);
}
.compare-command h1{margin:.45rem 0 .35rem}
.compare-command p{
  max-width:58ch;
  margin:0;
  color:var(--muted);
  line-height:1.55;
}
.compare-command-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:.75rem;
  flex-wrap:wrap;
}
.compare-status{
  display:inline-flex;
  align-items:center;
  min-height:38px;
  padding:.45rem .7rem;
  border:1px solid rgba(36,88,255,.18);
  border-radius:999px;
  background:rgba(36,88,255,.09);
  color:var(--primary);
  font-size:.86rem;
  font-weight:800;
}
.compare-metrics{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:.8rem;
  margin-bottom:1rem;
}
.compare-metrics div{
  min-height:72px;
  padding:.8rem .9rem;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--bg);
}
.compare-metrics span{
  display:block;
  color:var(--muted);
  font-size:.82rem;
  font-weight:700;
}
.compare-metrics strong{
  display:block;
  margin-top:.2rem;
  font-size:1.15rem;
}
.compare-grid{grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
.compare-grid-premium{grid-template-columns:repeat(auto-fit,minmax(320px,1fr))}
.compare-card{
  display:flex;
  flex-direction:column;
  min-height:520px;
  overflow:hidden;
  background:var(--bg-elev);
  border:1px solid var(--line);
  border-radius:24px;
  box-shadow:var(--shadow);
  border-top:3px solid var(--line);
  transition:border-color .2s ease, box-shadow .2s ease;
}
[data-provider-card="openai"].compare-card{
  border-top-color:#10a37f;
  border-left:1px solid rgba(16,163,127,.2);
  border-right:1px solid rgba(16,163,127,.2);
}
[data-provider-card="openai"].compare-card:hover{box-shadow:0 12px 40px rgba(16,163,127,.1)}
[data-provider-card="claude"].compare-card{
  border-top-color:#d97757;
  border-left:1px solid rgba(217,119,87,.2);
  border-right:1px solid rgba(217,119,87,.2);
}
[data-provider-card="claude"].compare-card:hover{box-shadow:0 12px 40px rgba(217,119,87,.1)}
[data-provider-card="gemini"].compare-card{
  border-top-color:#4285f4;
  border-left:1px solid rgba(66,133,244,.2);
  border-right:1px solid rgba(66,133,244,.2);
}
[data-provider-card="gemini"].compare-card:hover{box-shadow:0 12px 40px rgba(66,133,244,.1)}
.compare-card-head{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:.8rem;
  padding:1rem 1rem .85rem;
  border-bottom:1px solid var(--line);
}
.compare-card-head h2{
  margin:0;
  font-size:1.12rem;
}
.compare-card-head span{
  display:block;
  margin-top:.2rem;
  color:var(--muted);
  font-size:.84rem;
  line-height:1.35;
}
.provider-mark{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:14px;
  font-weight:900;
}
[data-provider-card="openai"] .provider-mark{
  background:rgba(16,163,127,.12);
  border:1px solid rgba(16,163,127,.3);
  color:#10a37f;
}
[data-provider-card="claude"] .provider-mark{
  background:rgba(217,119,87,.12);
  border:1px solid rgba(217,119,87,.3);
  color:#d97757;
}
[data-provider-card="gemini"] .provider-mark{
  background:rgba(66,133,244,.12);
  border:1px solid rgba(66,133,244,.3);
  color:#4285f4;
}
.compare-pill{
  align-self:start;
  min-width:max-content;
  padding:.32rem .55rem;
  border:1px solid rgba(11,143,85,.22);
  border-radius:999px;
  background:rgba(11,143,85,.1);
  color:var(--success) !important;
  font-size:.75rem !important;
  font-weight:800;
}
.compare-card.is-pending .compare-pill{
  border-color:rgba(245,158,11,.28);
  background:rgba(245,158,11,.11);
  color:var(--warning) !important;
}
.compare-output{
  flex:1;
  max-height:430px;
  overflow:auto;
  padding:1rem;
  background:var(--bg);
}
.compare-card.is-expanded .compare-output{
  max-height:none;
  overflow:visible;
}
.compare-empty{
  min-height:310px;
  display:grid;
  place-items:center;
  text-align:center;
  color:var(--muted);
  border:1px dashed var(--line);
  border-radius:18px;
  background:var(--bg);
  padding:1rem;
  font-weight:700;
}
.compare-render{
  display:grid;
  gap:.78rem;
  color:var(--text);
  font-size:.95rem;
  line-height:1.62;
}
.compare-render h3,
.compare-render h4{
  margin:.25rem 0 0;
  font-size:1rem;
  line-height:1.35;
}
.compare-render p{margin:0}
.compare-render ul,
.compare-render ol{
  margin:0;
  padding-left:1.15rem;
}
.compare-render li{margin:.28rem 0}
.compare-render strong{font-weight:850}
.compare-render code{
  padding:.12rem .32rem;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--bg);
  color:var(--primary);
}
.compare-render pre{
  margin:0;
  white-space:pre-wrap;
  word-break:break-word;
  padding:.85rem;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--bg);
}
.compare-table-wrap{
  overflow:auto;
  border:1px solid var(--line);
  border-radius:14px;
}
.compare-render table{
  width:100%;
  border-collapse:collapse;
  font-size:.88rem;
}
.compare-render th,
.compare-render td{
  padding:.6rem .7rem;
  border-bottom:1px solid var(--line);
  text-align:left;
  vertical-align:top;
}
.compare-render th{
  background:var(--bg-soft);
  font-weight:850;
}
.compare-render tr:last-child td{border-bottom:0}
.compare-card-actions{
  display:flex;
  justify-content:space-between;
  gap:.65rem;
  padding:.85rem 1rem 1rem;
  border-top:1px solid var(--line);
  background:var(--bg-elev);
}
.compare-card-actions button{flex:1}
.has-compare-modal{overflow:hidden}
.compare-modal{
  position:fixed;
  inset:0;
  z-index:50;
  display:none;
}
.compare-modal.is-visible{display:block}
.compare-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(5,10,24,.72);
  backdrop-filter:blur(10px);
}
.compare-modal-panel{
  position:relative;
  width:min(1120px,calc(100vw - 2rem));
  max-height:calc(100vh - 2rem);
  margin:1rem auto;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:var(--bg-elev);
  border:1px solid var(--line);
  border-radius:24px;
  box-shadow:0 28px 80px rgba(0,0,0,.38);
}
.compare-modal-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  padding:1rem 1.1rem;
  border-bottom:1px solid var(--line);
  background:var(--bg-elev);
}
.compare-modal-head h2{
  margin:.45rem 0 0;
  font-size:1.3rem;
}
.compare-modal-body{
  overflow:auto;
  padding:1.1rem;
  background:var(--bg);
}
.compare-modal-body .compare-render{
  max-width:88ch;
  margin:0 auto;
  gap:1rem;
  font-size:1rem;
}
.compare-card > pre{
  white-space:pre-wrap;word-break:break-word;min-height:180px;
  background:var(--bg);padding:1rem;border-radius:16px;border:1px solid var(--line)
}
.pricing-grid{grid-template-columns:repeat(auto-fit,minmax(250px,1fr))}
.pricing-card ul{padding-left:1.2rem}
.pricing-card.featured{
  position:relative;
  border:1px solid rgba(124,58,237,0.5);
  background:linear-gradient(135deg,rgba(124,58,237,0.08),var(--bg-elev) 60%);
  box-shadow:0 0 48px rgba(124,58,237,0.12);
}
.price{font-size:1.35rem;font-weight:700}
.search{max-width:300px}
.toast{
  position:fixed;right:1.2rem;bottom:1.2rem;z-index:20;
  display:flex;align-items:center;gap:.55rem;
  background:var(--text);color:var(--bg-elev);
  border-radius:14px;padding:.9rem 1rem;
  opacity:0;pointer-events:none;transform:translateY(12px);
  transition:all .25s cubic-bezier(.4,0,.2,1);
  font-weight:600;font-size:.92rem;
  max-width:420px;
}
.toast.is-visible{opacity:1;pointer-events:auto;transform:translateY(0)}
.pro-banner{
  margin-bottom:1rem;padding:1rem;border-radius:16px;
  background:rgba(245,158,11,.12);border:1px solid rgba(245,158,11,.35)
}
.is-focus .sidebar,
.is-focus [data-view-panel="compare"],
.is-focus [data-view-panel="billing"],
.is-focus [data-view-panel="library"]{display:none !important}
.is-focus .app-layout{grid-template-columns:1fr}
.ai-trace-panel{
  margin-top:1rem;
  border-color:rgba(120,149,255,.2);
}
.ai-trace-summary{
  display:flex;
  align-items:center;
  gap:.6rem;
  cursor:pointer;
  list-style:none;
  font-weight:700;
}
.ai-trace-summary::-webkit-details-marker{display:none}
.ai-trace-summary small{
  color:var(--muted);
  font-weight:500;
}
.ai-trace-arrow{
  display:inline-block;
  transition:transform .18s ease;
}
.ai-trace-panel[open] .ai-trace-arrow{transform:rotate(90deg)}
.ai-trace-panel[open] .ai-trace-summary{margin-bottom:1rem}
.ai-trace-attempts{margin-top:1rem}
.ai-trace-attempts-title{
  display:block;
  margin-bottom:.55rem;
  font-size:.95rem;
}
.ai-trace-attempts ul{
  display:grid;
  gap:.55rem;
  margin:0;
  padding:0;
  list-style:none;
}
.ai-trace-attempts li{
  display:grid;
  gap:.25rem;
  padding:.75rem .85rem;
  border:1px solid rgba(120,149,255,.15);
  border-radius:14px;
  background:rgba(11,18,43,.45);
}
.ai-trace-attempts li.is-ok{border-color:rgba(36,177,106,.35)}
.ai-trace-attempts li.is-error{border-color:rgba(220,83,95,.38)}
.ai-trace-attempts span{color:var(--muted)}

@media (max-width:1100px){
  .auth-layout,.app-layout,.editor-grid,.modules-grid{
    grid-template-columns:1fr;
  }
  .sidebar{position:relative;top:0}
  .compare-command{display:grid}
  .compare-command-actions{justify-content:flex-start}
}
@media (max-width:720px){
  .shell{padding:.75rem}
  .topbar{border-radius:18px;padding:.85rem}
  .brand-logo-wrap{width:270px;height:68px}
  .hero-card h1{font-size:2.1rem}
  .score-card{grid-template-columns:1fr}
  .score-result{grid-template-columns:1fr}
  .compare-metrics{grid-template-columns:1fr}
  .compare-grid-premium{grid-template-columns:1fr}
  .compare-card{min-height:460px}
  .compare-card-head{grid-template-columns:auto minmax(0,1fr)}
  .compare-pill{grid-column:1 / -1;width:max-content}
  .compare-modal-panel{
    width:calc(100vw - 1rem);
    max-height:calc(100vh - 1rem);
    margin:.5rem auto;
    border-radius:18px;
  }
  .compare-modal-head{display:grid}
}
/* ── Provider Switcher (Segmented Control) ── */
.provider-switcher{
  display:inline-flex;
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:14px;
  padding:4px;
  gap:2px;
}
.provider-switcher button{
  padding:.55rem 1rem;
  border-radius:11px;
  border:0;
  background:transparent;
  color:var(--muted);
  font-weight:600;
  font-size:.88rem;
  transition:all .2s ease;
}
.provider-switcher button:hover{color:var(--text);background:var(--bg-soft)}
.provider-switcher button.is-active{
  background:var(--primary);
  color:#fff;
  box-shadow:0 4px 12px rgba(36,88,255,.25);
}

/* ── Score Ring SVG ── */
.score-ring{position:relative;width:110px;height:110px;border:0}
.score-result .score-ring{width:90px;height:90px}
.score-ring-svg{
  width:100%;height:100%;
  transform:rotate(-90deg);
}
.score-ring-bg{
  fill:none;
  stroke:var(--bg-soft);
  stroke-width:10;
}
.score-result .score-ring-bg{stroke-width:8}
.score-ring-progress{
  fill:none;
  stroke:var(--success);
  stroke-width:10;
  stroke-linecap:round;
  transition:stroke-dasharray .8s cubic-bezier(.4,0,.2,1), stroke .4s ease;
}
.score-result .score-ring-progress{stroke-width:8}
.score-ring-progress.score-mid{stroke:var(--warning)}
.score-ring-progress.score-low{stroke:var(--danger)}
.score-ring-label{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  text-align:center;
}
.score-ring-label strong{font-size:2rem;display:block}
.score-result .score-ring-label strong{font-size:1.65rem}

/* ── Provider-Specific Colors ── */
[data-provider-card="openai"] .provider-mark{
  background:rgba(16,163,127,.12);
  border-color:rgba(16,163,127,.3);
  color:#10a37f;
}
[data-provider-card="claude"] .provider-mark{
  background:rgba(217,119,87,.12);
  border-color:rgba(217,119,87,.3);
  color:#d97757;
}
[data-provider-card="gemini"] .provider-mark{
  background:rgba(66,133,244,.12);
  border-color:rgba(66,133,244,.3);
  color:#4285f4;
}

/* ── Compare Loading Bar ── */
.compare-card.is-pending{position:relative;overflow:hidden}
.compare-card.is-pending::after{
  content:'';
  position:absolute;
  top:0;left:-40%;
  height:3px;width:40%;
  background:linear-gradient(90deg,transparent,var(--primary),transparent);
  animation:loadingBar 1.5s ease-in-out infinite;
}
@keyframes loadingBar{
  0%{left:-40%}
  100%{left:100%}
}

/* ── History Timeline ── */
.history-item::before{
  content:'';
  position:absolute;
  left:10px;top:0;bottom:0;
  width:2px;
  background:var(--line);
}
.history-item:last-child::before{bottom:50%}
.history-item::after{
  content:'';
  position:absolute;
  left:5px;top:1rem;
  width:12px;height:12px;
  border-radius:50%;
  background:var(--primary);
  border:2px solid var(--bg-elev);
  z-index:1;
}

/* ── Library Card Enhancements ── */
.library-card:hover{
  transform:translateY(-4px);
  box-shadow:0 20px 48px rgba(0,0,0,.22);
}

/* Provider badge pills */
.provider-pill{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  padding:.28rem .65rem;
  border-radius:999px;
  font-size:.78rem;
  font-weight:700;
  white-space:nowrap;
}
.provider-pill-openai{background:rgba(16,163,127,.15);color:#10a37f;border:1px solid rgba(16,163,127,.3)}
.provider-pill-claude{background:rgba(217,119,87,.15);color:#d97757;border:1px solid rgba(217,119,87,.3)}
.provider-pill-gemini{background:rgba(66,133,244,.15);color:#4285f4;border:1px solid rgba(66,133,244,.3)}
.provider-pill .provider-dot{
  width:8px;height:8px;border-radius:50%;
  display:inline-block;
}
.provider-pill-openai .provider-dot{background:#10a37f}
.provider-pill-claude .provider-dot{background:#d97757}
.provider-pill-gemini .provider-dot{background:#4285f4}

/* Provider-specific card borders */
.library-card[data-provider="openai"]{border-color:rgba(16,163,127,.25)}
.library-card[data-provider="openai"]:hover{border-color:rgba(16,163,127,.5);box-shadow:0 16px 48px rgba(16,163,127,.1)}
.library-card[data-provider="claude"]{border-color:rgba(217,119,87,.25)}
.library-card[data-provider="claude"]:hover{border-color:rgba(217,119,87,.5);box-shadow:0 16px 48px rgba(217,119,87,.1)}
.library-card[data-provider="gemini"]{border-color:rgba(66,133,244,.25)}
.library-card[data-provider="gemini"]:hover{border-color:rgba(66,133,244,.5);box-shadow:0 16px 48px rgba(66,133,244,.1)}

/* Card header row with provider + score + star */
.library-card-header{
  display:flex;
  align-items:center;
  gap:.5rem;
  flex-wrap:wrap;
}

/* Score pill badge */
.score-pill{
  display:inline-flex;
  align-items:center;
  padding:.25rem .55rem;
  border-radius:999px;
  font-size:.78rem;
  font-weight:800;
}
.score-pill.score-high{background:rgba(11,143,85,.18);color:var(--success)}
.score-pill.score-mid{background:rgba(245,158,11,.18);color:var(--warning)}
.score-pill.score-low{background:rgba(220,38,38,.18);color:var(--danger)}

/* Favorite star */
.library-fav-star{
  margin-left:auto;
  font-size:1.15rem;
  color:#f59e0b;
  line-height:1;
}
.library-card.is-favorite{border-color:rgba(245,158,11,.3)}
.fav-star{color:#f59e0b}

/* Library action links (simplified) */
.library-actions{
  display:flex;
  gap:1rem;
  margin-top:auto;
  padding-top:.55rem;
  border-top:1px solid var(--line);
}
.library-actions button,.library-actions a{
  background:transparent;
  border:0;
  color:var(--muted);
  font-size:.85rem;
  font-weight:600;
  padding:.25rem 0;
  cursor:pointer;
  transition:color .18s ease;
}
.library-actions button:hover,.library-actions a:hover{
  color:var(--text);
  transform:none;
}
.library-actions button:first-child{
  color:var(--primary);
}

/* ── Library Filters ── */
.library-filters{
  display:flex;
  gap:.65rem;
  flex-wrap:wrap;
  align-items:center;
}
.library-filters .search{flex:1;min-width:180px;max-width:280px}

/* Filter pills row */
.library-filter-row{
  display:flex;
  align-items:center;
  gap:.5rem;
  flex-wrap:wrap;
  margin-bottom:.75rem;
}
.filter-pill{
  display:inline-flex;
  align-items:center;
  gap:.3rem;
  padding:.3rem .75rem;
  border-radius:999px;
  border:1px solid var(--line);
  background:transparent;
  color:var(--muted);
  font-size:.82rem;
  font-weight:600;
  cursor:pointer;
  transition:all .18s ease;
}
.filter-pill:hover{background:var(--bg-soft);color:var(--text);border-color:var(--primary)}
.filter-pill.is-active{background:var(--primary);color:#fff;border-color:var(--primary);box-shadow:0 3px 10px rgba(36,88,255,.25)}
.filter-pill-openai.is-active{background:#10a37f;border-color:#10a37f;box-shadow:0 3px 10px rgba(16,163,127,.3)}
.filter-pill-claude.is-active{background:#d97757;border-color:#d97757;box-shadow:0 3px 10px rgba(217,119,87,.3)}
.filter-pill-gemini.is-active{background:#4285f4;border-color:#4285f4;box-shadow:0 3px 10px rgba(66,133,244,.3)}

/* Sort select */
.library-sort{
  padding:.3rem .65rem;
  border-radius:10px;
  border:1px solid var(--line);
  background:var(--bg-elev);
  color:var(--muted);
  font-size:.82rem;
  font-weight:600;
  cursor:pointer;
  min-width:130px;
}

/* Result counter */
.library-count{
  font-size:.82rem;
  color:var(--muted);
  font-weight:600;
  margin-left:auto;
  white-space:nowrap;
}
.library-count strong{color:var(--text)}

/* ── Pricing Recommended Badge ── */
.pricing-card.featured::before{
  content:'Recomendado';
  position:absolute;
  top:-12px;left:50%;
  transform:translateX(-50%);
  padding:.3rem 1rem;
  border-radius:999px;
  background:linear-gradient(135deg,#7c3aed,#5b21b6);
  color:white;
  font-size:.8rem;
  font-weight:700;
  white-space:nowrap;
  z-index:1;
}

/* ── Usage Meter ── */
.usage-meter{
  margin-top:1.2rem;
  padding:1.2rem;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--bg-elev);
}
.usage-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:.7rem;
  font-weight:600;
}
.usage-header span{color:var(--muted)}
.usage-bar{
  height:10px;
  border-radius:99px;
  background:var(--bg-soft);
  overflow:hidden;
}
.usage-fill{
  height:100%;
  border-radius:99px;
  background:linear-gradient(90deg,var(--success),var(--warning));
  transition:width .6s cubic-bezier(.4,0,.2,1);
}

/* ── Skeleton Loading ── */
.skeleton{
  background:linear-gradient(90deg,var(--bg-soft) 25%,var(--bg-elev) 50%,var(--bg-soft) 75%);
  background-size:200% 100%;
  animation:shimmer 1.5s infinite;
  border-radius:8px;
  color:transparent !important;
  pointer-events:none;
  user-select:none;
}
.skeleton *{visibility:hidden}
@keyframes shimmer{
  0%{background-position:200% 0}
  100%{background-position:-200% 0}
}

/* ── Toast Types ── */
.toast-success{background:var(--success);color:#fff}
.toast-error{background:var(--danger);color:#fff}
.toast-warning{background:var(--warning);color:#1a1a1a}

/* ── View Animations ── */
@keyframes fadeInUp{
  from{opacity:0;transform:translateY(16px)}
  to{opacity:1;transform:translateY(0)}
}

/* ── Focus Visible ── */
button:focus-visible,.button-link:focus-visible{
  outline:2px solid var(--primary);
  outline-offset:2px;
}
input:focus-visible,textarea:focus-visible,select:focus-visible{
  outline:none;
}

/* ── Scrollbar ── */
::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--line);border-radius:99px}
::-webkit-scrollbar-thumb:hover{background:var(--muted)}

/* ── Icon Button ── */
.icon-btn{
  width:42px;height:42px;
  padding:0;
  display:grid;place-items:center;
  border-radius:12px;
}
.icon-btn svg{width:20px;height:20px}

/* ── Nav Icons ── */
.nav-link svg,.nav-link .nav-icon{width:20px;height:20px;flex-shrink:0;opacity:.8}
.nav-link.is-active svg,.nav-link.is-active .nav-icon{opacity:1}

/* ── Theme Toggle ── */
.theme-icon-sun,.theme-icon-moon{width:20px;height:20px}
html[data-theme="dark"] .theme-icon-sun{display:none}
html[data-theme="dark"] .theme-icon-moon{display:block}
html[data-theme="light"] .theme-icon-sun{display:block}
html[data-theme="light"] .theme-icon-moon{display:none}
html[data-theme="system"] .theme-icon-sun{display:block}
html[data-theme="system"] .theme-icon-moon{display:none}
@media(prefers-color-scheme:dark){
  html[data-theme="system"] .theme-icon-sun{display:none}
  html[data-theme="system"] .theme-icon-moon{display:block}
}

/* ── Provider Trust Strip ── */
.provider-trust{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:1.2rem;
  margin-top:1.5rem;
  padding:.8rem;
  border-radius:14px;
  background:var(--bg-soft);
  border:1px solid var(--line);
  color:var(--muted);
  font-size:.85rem;
  font-weight:600;
}
.provider-trust span{display:flex;align-items:center;gap:.4rem}

/* ── Auth Animation ── */
@keyframes authSlideIn{
  from{opacity:0;transform:translateY(24px)}
  to{opacity:1;transform:translateY(0)}
}
.auth-layout .hero-card{animation:authSlideIn .5s ease-out}
.auth-layout .auth-card{animation:authSlideIn .5s ease-out .1s both}

/* ── Btn icon support ── */
.btn-icon{display:inline-flex;align-items:center;gap:.45rem}
.btn-icon svg{width:18px;height:18px;flex-shrink:0}

@media (prefers-reduced-motion: reduce){
  *{scroll-behavior:auto !important;transition:none !important;animation:none !important}
}

/* Visual refresh based on docs/mockups: dark glass forge UI */
html[data-theme="dark"]{
  --bg:#070d1c;
  --bg-elev:rgba(18,27,46,.78);
  --bg-soft:rgba(127,92,255,.12);
  --text:#f7f9ff;
  --muted:#9ca8bd;
  --line:rgba(196,211,255,.16);
  --primary:#8b4dff;
  --primary-strong:#b04cff;
  --success:#35d17f;
  --warning:#ffc145;
  --danger:#ff4d5e;
  --shadow:0 28px 70px rgba(0,0,0,.38);
  --radius:18px;
  --forge-canvas:#070d1c;
  --forge-panel:rgba(13,21,38,.86);
  --forge-panel-strong:rgba(24,34,56,.86);
  --forge-control:rgba(7,13,28,.58);
  --forge-border:rgba(205,219,255,.16);
  --forge-border-hot:rgba(158,95,255,.52);
  --forge-violet:#8b4dff;
  --forge-magenta:#d952ff;
  --forge-cyan:#59c7ff;
  --forge-green:#35d17f;
  --forge-amber:#ffc145;
  --forge-red:#ff4d5e;
}

html[data-theme="light"]{
  --bg:#eef3fb;
  --bg-elev:rgba(255,255,255,.84);
  --bg-soft:rgba(124,77,255,.1);
  --text:#111827;
  --muted:#5d687a;
  --line:rgba(46,62,92,.16);
  --primary:#7048ff;
  --primary-strong:#5c35df;
  --success:#0b9f5a;
  --warning:#c47a00;
  --danger:#d73545;
  --shadow:0 24px 58px rgba(37,48,76,.14);
  --forge-canvas:#eef3fb;
  --forge-panel:rgba(255,255,255,.86);
  --forge-panel-strong:rgba(247,250,255,.92);
  --forge-control:rgba(255,255,255,.76);
  --forge-border:rgba(46,62,92,.16);
  --forge-border-hot:rgba(112,72,255,.34);
  --forge-violet:#7048ff;
  --forge-magenta:#bc42f5;
  --forge-cyan:#168bd6;
  --forge-green:#0b9f5a;
  --forge-amber:#c47a00;
  --forge-red:#d73545;
}

@media (prefers-color-scheme: dark){
  html[data-theme="system"]{
    --bg:#070d1c;
    --bg-elev:rgba(18,27,46,.78);
    --bg-soft:rgba(127,92,255,.12);
    --text:#f7f9ff;
    --muted:#9ca8bd;
    --line:rgba(196,211,255,.16);
    --primary:#8b4dff;
    --primary-strong:#b04cff;
    --success:#35d17f;
    --warning:#ffc145;
    --danger:#ff4d5e;
    --shadow:0 28px 70px rgba(0,0,0,.38);
  }
}

html[data-theme="light"] .brand-logo-light{display:block}
html[data-theme="light"] .brand-logo-dark{display:none}
html[data-theme="dark"] .brand-logo-light{display:none}
html[data-theme="dark"] .brand-logo-dark{display:block}
html[data-theme="system"] .brand-logo-light{display:block}
html[data-theme="system"] .brand-logo-dark{display:none}
@media (prefers-color-scheme: dark){
  html[data-theme="system"] .brand-logo-light{display:none}
  html[data-theme="system"] .brand-logo-dark{display:block}
}

body{
  background:
    radial-gradient(circle at 10% -8%, rgba(139,77,255,.34), transparent 30rem),
    radial-gradient(circle at 88% 4%, rgba(53,209,127,.18), transparent 26rem),
    radial-gradient(circle at 62% 96%, rgba(89,199,255,.16), transparent 32rem),
    linear-gradient(135deg,#070d1c 0%,#0a1224 46%,#101626 100%);
  background-attachment:fixed;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:-1;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size:44px 44px;
  mask-image:linear-gradient(to bottom, rgba(0,0,0,.7), transparent 78%);
}

.shell{
  max-width:1560px;
  padding:1.25rem;
}

.topbar{
  min-height:74px;
  padding:.7rem 1rem;
  margin-bottom:1.15rem;
  border-color:rgba(205,219,255,.12);
  border-radius:18px;
  background:linear-gradient(180deg,rgba(17,26,45,.82),rgba(10,17,32,.72));
  box-shadow:0 18px 56px rgba(0,0,0,.28);
  backdrop-filter:blur(22px);
  -webkit-backdrop-filter:blur(22px);
}

.brand-logo-wrap{
  width:248px;
  height:62px;
}

.topbar-actions{
  gap:.55rem;
}

.account-chip,
.badge,
.usage-badge,
.badge-pro{
  border:1px solid rgba(205,219,255,.13);
  background:rgba(255,255,255,.06);
  color:#e8ecf8;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
}

.badge-pro{
  color:#bfffd8;
  background:linear-gradient(135deg,rgba(53,209,127,.2),rgba(53,209,127,.08));
  box-shadow:0 0 26px rgba(53,209,127,.22);
}

.usage-badge{
  color:#ffdc84;
  background:rgba(255,193,69,.12);
}

textarea,
input,
select{
  border-color:rgba(205,219,255,.16);
  background:rgba(5,10,23,.58);
  color:var(--text);
  border-radius:14px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}

textarea::placeholder,
input::placeholder{
  color:rgba(201,210,231,.48);
}

textarea:focus,
input:focus,
select:focus,
button:focus,
.button-link:focus{
  border-color:rgba(139,77,255,.72);
  box-shadow:0 0 0 4px rgba(139,77,255,.16),0 0 26px rgba(139,77,255,.14);
}

button,
.button-link{
  border-radius:14px;
}

.primary{
  color:#fff;
  background:linear-gradient(135deg,#6b5cff 0%,#8b4dff 50%,#d952ff 100%);
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 0 24px rgba(139,77,255,.34), inset 0 1px 0 rgba(255,255,255,.18);
  font-weight:800;
}

.primary:hover{
  background:linear-gradient(135deg,#7668ff 0%,#985dff 50%,#e667ff 100%);
  box-shadow:0 0 34px rgba(139,77,255,.46), inset 0 1px 0 rgba(255,255,255,.2);
}

.ghost,
.button-link.ghost{
  color:#d8deec;
  border:1px solid rgba(205,219,255,.14);
  background:rgba(255,255,255,.045);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
}

.ghost:hover,
.button-link.ghost:hover{
  color:#fff;
  border-color:rgba(139,77,255,.38);
  background:rgba(139,77,255,.1);
}

.icon-btn{
  border-radius:14px;
}

.eyebrow{
  padding:.34rem .72rem;
  color:#cdbdff;
  border:1px solid rgba(139,77,255,.22);
  background:linear-gradient(135deg,rgba(139,77,255,.18),rgba(89,199,255,.08));
}

.auth-layout{
  min-height:calc(100vh - 126px);
  grid-template-columns:minmax(0,1fr) minmax(360px,.48fr);
  gap:clamp(1.4rem,4vw,4.5rem);
  align-items:center;
  padding:clamp(1.5rem,4vw,4.25rem);
  border:1px solid rgba(205,219,255,.12);
  border-radius:28px;
  overflow:hidden;
  background:
    radial-gradient(circle at 18% 82%, rgba(139,77,255,.34), transparent 24rem),
    radial-gradient(circle at 44% 28%, rgba(53,209,127,.12), transparent 20rem),
    linear-gradient(135deg,rgba(8,14,30,.92),rgba(14,22,39,.84));
  box-shadow:0 40px 110px rgba(0,0,0,.42);
}

.hero-card,
.auth-card,
.card,
.sidebar,
.workspace .view{
  border:1px solid rgba(205,219,255,.14);
  background:linear-gradient(180deg,rgba(22,32,54,.72),rgba(12,20,36,.78));
  box-shadow:var(--shadow);
  backdrop-filter:blur(22px);
  -webkit-backdrop-filter:blur(22px);
}

.hero-card,
.auth-card{
  border:0;
  box-shadow:none;
  border-radius:0;
  background:transparent;
}

.hero-card{
  position:relative;
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-height:0;
  padding:0;
  overflow:hidden;
}

.hero-card::before{
  display:none;
}

.hero-card::after{
  display:none;
}

.hero-card > *{
  position:relative;
  z-index:1;
}

.hero-card h1{
  max-width:720px;
  margin:1.1rem 0 .95rem;
  font-size:clamp(2.45rem,4.5vw,4.35rem);
  line-height:1.02;
  letter-spacing:0;
}

.hero-card p{
  max-width:62ch;
  color:#aab5c8;
  font-size:1.04rem;
  line-height:1.65;
  margin:0;
}

.hero-points{
  display:grid;
  grid-template-columns:repeat(2,minmax(260px,1fr));
  gap:.9rem;
  max-width:780px;
  margin:1.45rem 0 0;
  padding:0;
  list-style:none;
}

.hero-points li{
  min-height:82px;
  display:flex;
  align-items:center;
  padding:1rem 1.1rem 1rem 3.45rem;
  position:relative;
  border:1px solid rgba(205,219,255,.12);
  border-radius:18px;
  color:#eef3ff;
  background:rgba(255,255,255,.045);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
  line-height:1.28;
  font-weight:750;
}

.hero-points li::before{
  content:"";
  position:absolute;
  left:1rem;
  top:50%;
  transform:translateY(-50%);
  width:28px;
  height:28px;
  border-radius:10px;
  background:linear-gradient(135deg,var(--forge-violet),var(--forge-magenta));
  box-shadow:0 0 22px rgba(139,77,255,.55);
}

.hero-points li:nth-child(2)::before,
.hero-points li:nth-child(4)::before{
  background:linear-gradient(135deg,#20d884,#59c7ff);
  box-shadow:0 0 22px rgba(53,209,127,.44);
}

.auth-card{
  align-self:center;
  justify-self:end;
  width:min(420px,calc(100% - 2rem));
  padding:2rem;
  border:1px solid rgba(225,235,255,.24);
  border-radius:28px;
  background:
    linear-gradient(145deg,rgba(242,247,255,.16),rgba(138,153,181,.08)),
    radial-gradient(circle at 20% 0%,rgba(255,255,255,.22),transparent 12rem),
    rgba(27,36,53,.48);
  box-shadow:0 28px 90px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.24);
}

.tabs{
  padding:5px;
  gap:5px;
  border-color:rgba(255,255,255,.16);
  background:rgba(5,10,23,.38);
  border-radius:999px;
}

.tab{
  color:#dce4f3;
  border-radius:999px;
}

.tab.is-active{
  color:#101626;
  background:linear-gradient(180deg,#ffffff,#dfe7f8);
  box-shadow:0 9px 26px rgba(255,255,255,.16);
}

.auth-form label,
.card label{
  color:#c8d1e2;
}

.auth-form input{
  color:#f8fbff;
  border-color:rgba(255,255,255,.18);
  background:rgba(7,13,28,.42);
}

.auth-form .primary{
  background:linear-gradient(135deg,#713fff,#9b4dff 55%,#d855ff);
  box-shadow:0 0 34px rgba(139,77,255,.58);
}

.microcopy{
  color:#a8b3c7;
  line-height:1.55;
}

.provider-trust{
  border-color:rgba(255,255,255,.14);
  background:rgba(255,255,255,.07);
  color:#cbd5e7;
}

.auth-layout .hero-points,
.hero-card > p:not(.hero-lead),
.auth-card > .provider-trust,
.auth-card > .microcopy:not(.auth-terms){
  display:none;
}

.hero-card h1 span{
  display:block;
  width:max-content;
  max-width:100%;
  background:linear-gradient(135deg,#a24dff 0%,#6d72ff 48%,#3ed3d7 100%);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}

.hero-lead{
  max-width:650px !important;
  color:#c4ccdc !important;
  font-size:clamp(1.05rem,1.6vw,1.28rem) !important;
  line-height:1.55 !important;
}

.hero-benefit-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:1rem;
  max-width:980px;
  margin-top:3rem;
}

.hero-benefit-card{
  min-height:172px;
  padding:1.2rem;
  border:1px solid rgba(205,219,255,.14);
  border-radius:18px;
  background:linear-gradient(180deg,rgba(21,31,52,.72),rgba(11,18,34,.76));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05),0 18px 44px rgba(0,0,0,.18);
}

.benefit-icon{
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  margin-bottom:1rem;
  border-radius:16px;
  position:relative;
}

.benefit-icon svg{
  width:24px;
  height:24px;
  color:#fff;
  filter:drop-shadow(0 0 10px rgba(255,255,255,.38));
}

.benefit-icon-violet{background:linear-gradient(135deg,rgba(139,77,255,.56),rgba(139,77,255,.18))}
.benefit-icon-green{background:linear-gradient(135deg,rgba(16,208,190,.6),rgba(53,209,127,.16))}
.benefit-icon-blue{background:linear-gradient(135deg,rgba(58,160,255,.6),rgba(89,199,255,.14))}
.benefit-icon-purple{background:linear-gradient(135deg,rgba(178,80,255,.55),rgba(217,82,255,.14))}

.hero-benefit-card h2{
  margin:0 0 .45rem;
  color:#fff;
  font-size:1rem;
  line-height:1.25;
}

.hero-benefit-card p{
  margin:0;
  color:#b7c1d4;
  font-size:.92rem;
  line-height:1.45;
}

.auth-card .tabs{
  margin-bottom:1.45rem;
}

.auth-input-wrap{
  min-height:54px;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:.75rem;
  padding:0 .9rem;
  border:1px solid rgba(255,255,255,.14);
  border-radius:14px;
  background:rgba(5,10,23,.42);
  color:#b8c3d8;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}

.auth-input-wrap input{
  min-height:52px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}

.auth-input-wrap input:focus{
  box-shadow:none;
}

.auth-eye{
  opacity:.82;
}

.auth-options{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.9rem;
  margin-top:-.2rem;
  color:#d8deec;
  font-size:.92rem;
}

.remember-option{
  display:flex !important;
  grid-template-columns:none !important;
  align-items:center;
  gap:.45rem !important;
  color:#d8deec !important;
  font-weight:600 !important;
}

.remember-option input{
  width:20px;
  height:20px;
  accent-color:var(--forge-violet);
}

.auth-options a,
.auth-terms a{
  color:#caa9ff;
  text-decoration:underline;
  text-underline-offset:3px;
}

.auth-divider{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:1rem;
  margin:1.45rem 1.4rem 1rem;
  color:#c2cbdb;
  font-size:.92rem;
}

.auth-divider::before,
.auth-divider::after{
  content:"";
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(205,219,255,.2));
}

.auth-divider::after{
  background:linear-gradient(90deg,rgba(205,219,255,.2),transparent);
}

.auth-socials{
  display:flex;
  justify-content:center;
  gap:.75rem;
  margin-bottom:1.45rem;
}

.auth-socials button{
  width:82px;
  height:52px;
  padding:0;
  border:1px solid rgba(205,219,255,.14);
  border-radius:13px;
  background:rgba(255,255,255,.045);
  color:#e8edf8;
  font-size:1.15rem;
  font-weight:900;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
}

.auth-terms{
  display:block !important;
  margin:.7rem auto 0;
  max-width:310px;
  text-align:center;
  color:#c2cbdb;
}

.app-layout{
  grid-template-columns:300px minmax(0,1fr);
  gap:1rem;
}

.sidebar{
  top:6.6rem;
  padding:1rem;
  border-radius:24px;
}

.nav{
  gap:.72rem;
  margin-bottom:1.1rem;
}

.nav-link{
  min-height:54px;
  border-radius:16px;
  color:#b7c1d4;
  border-color:transparent;
  background:transparent;
}

.nav-link:hover{
  color:#fff;
  border-color:rgba(205,219,255,.14);
  background:rgba(255,255,255,.055);
}

.nav-link.is-active{
  color:#fff;
  border-color:rgba(205,219,255,.22);
  background:linear-gradient(135deg,rgba(73,95,255,.88),rgba(145,78,255,.82) 48%,rgba(217,82,255,.64));
  box-shadow:0 0 32px rgba(139,77,255,.36), inset 0 1px 0 rgba(255,255,255,.16);
}

.panel{
  background:rgba(5,10,23,.36);
  border-color:rgba(205,219,255,.12);
  border-radius:20px;
}

.panel-head h2,
.view-head h1,
.compare-command h1,
.library-card h3,
.compare-card-head h2,
.pricing-card h2{
  color:#fff;
}

.history-item{
  border-color:rgba(205,219,255,.12);
  background:rgba(255,255,255,.045);
}

.history-item::before{
  background:linear-gradient(to bottom,rgba(139,77,255,.58),rgba(53,209,127,.25));
}

.history-item::after{
  background:linear-gradient(135deg,var(--forge-violet),var(--forge-magenta));
  border-color:#0d1526;
  box-shadow:0 0 18px rgba(139,77,255,.62);
}

.workspace .view{
  padding:1.15rem;
  border-radius:24px;
  background:linear-gradient(180deg,rgba(12,20,36,.78),rgba(8,14,28,.72));
}

.view-head{
  padding:.25rem .1rem .8rem;
}

.row-actions{
  gap:.6rem;
}

.provider-switcher{
  border-color:rgba(205,219,255,.14);
  background:rgba(5,10,23,.46);
  border-radius:16px;
}

.provider-switcher button{
  color:#aeb8ca;
  border-radius:12px;
}

.provider-switcher button.is-active{
  color:#fff;
  background:linear-gradient(135deg,#4b71ff,#8b4dff);
  box-shadow:0 0 20px rgba(139,77,255,.32);
}

.editor-grid{
  grid-template-columns:minmax(0,1.35fr) minmax(320px,.78fr);
  gap:1rem;
}

[data-view-panel="editor"].view.is-active{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(340px,380px);
  gap:1rem;
  align-items:start;
}

[data-view-panel="editor"] .view-head{
  grid-column:1 / -1;
}

[data-view-panel="editor"] .editor-grid{
  display:contents;
}

[data-view-panel="editor"] .enhancer-card{
  grid-column:1;
  align-self:start;
}

[data-view-panel="editor"] .score-card{
  grid-column:2;
  grid-row:2 / span 2;
  position:sticky;
  top:7rem;
  max-height:calc(100vh - 8.5rem);
  overflow:auto;
  align-self:start;
}

[data-view-panel="editor"] .modules-grid{
  grid-column:1;
  align-self:start;
}

.enhancer-card{
  border-color:rgba(139,77,255,.34) !important;
  background:
    radial-gradient(circle at 85% 8%,rgba(53,209,127,.16),transparent 12rem),
    linear-gradient(135deg,rgba(139,77,255,.12),rgba(16,24,43,.78) 56%) !important;
  box-shadow:0 0 34px rgba(139,77,255,.14),var(--shadow);
}

.modules-grid{
  gap:.9rem;
}

.modules-grid .card{
  min-height:116px;
  border-radius:18px;
  border-color:rgba(205,219,255,.13);
  background:linear-gradient(180deg,rgba(22,32,54,.62),rgba(11,18,33,.68));
}

.modules-grid .card:hover{
  border-color:rgba(139,77,255,.42);
  box-shadow:0 0 28px rgba(139,77,255,.14);
}

.modules-grid textarea,
.modules-grid input[type="text"]{
  border-color:rgba(205,219,255,.12);
  background:rgba(5,10,23,.42);
}

.score-result{
  border-color:rgba(205,219,255,.12);
  background:rgba(5,10,23,.42);
}

.score-ring-bg{
  stroke:rgba(255,255,255,.09);
}

.score-ring-progress{
  stroke:var(--forge-green);
  filter:drop-shadow(0 0 8px rgba(53,209,127,.72));
}

.score-ring-progress.score-mid{
  stroke:var(--forge-amber);
  filter:drop-shadow(0 0 8px rgba(255,193,69,.7));
}

.score-ring-progress.score-low{
  stroke:var(--forge-red);
  filter:drop-shadow(0 0 8px rgba(255,77,94,.7));
}

.score-ring-label strong{
  color:#f8fbff;
}

.library-filters .search,
.search{
  max-width:430px;
  min-height:46px;
  border-radius:999px;
  background:linear-gradient(180deg,rgba(255,255,255,.09),rgba(255,255,255,.035));
}

.library-list{
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
  gap:1.05rem;
}

.library-card{
  min-height:210px;
  border-radius:18px;
  border-color:rgba(205,219,255,.14);
  background:linear-gradient(180deg,rgba(30,39,60,.78),rgba(14,22,39,.82));
  box-shadow:0 20px 58px rgba(0,0,0,.22);
}

.library-card:hover{
  transform:translateY(-3px);
}

.library-card[data-provider="openai"]{
  border-color:rgba(53,209,127,.28);
}

.library-card[data-provider="openai"]:hover{
  border-color:rgba(53,209,127,.62);
  box-shadow:0 0 34px rgba(53,209,127,.14),0 20px 58px rgba(0,0,0,.25);
}

.library-card[data-provider="claude"]{
  border-color:rgba(255,171,101,.3);
}

.library-card[data-provider="claude"]:hover{
  border-color:rgba(255,171,101,.66);
  box-shadow:0 0 34px rgba(255,171,101,.14),0 20px 58px rgba(0,0,0,.25);
}

.library-card[data-provider="gemini"]{
  border-color:rgba(89,199,255,.34);
}

.library-card[data-provider="gemini"]:hover{
  border-color:rgba(217,82,255,.56);
  box-shadow:0 0 34px rgba(89,199,255,.14),0 20px 58px rgba(0,0,0,.25);
}

.provider-pill-openai{
  color:#baffd7;
  background:linear-gradient(135deg,rgba(53,209,127,.22),rgba(53,209,127,.08));
}

.provider-pill-claude{
  color:#ffd1aa;
  background:linear-gradient(135deg,rgba(255,171,101,.22),rgba(255,171,101,.08));
}

.provider-pill-gemini{
  color:#d8e5ff;
  background:linear-gradient(135deg,rgba(89,199,255,.2),rgba(217,82,255,.12));
}

.score-pill.score-high{
  color:#071120;
  background:#35d17f;
}

.score-pill.score-mid{
  color:#171006;
  background:#ffc145;
}

.score-pill.score-low{
  color:#fff;
  background:#ff4d5e;
}

.library-actions{
  border-top-color:rgba(205,219,255,.12);
}

.library-actions button:first-child{
  color:#cdbdff;
}

.compare-command{
  border-radius:20px;
  border-color:rgba(205,219,255,.14);
  background:linear-gradient(180deg,rgba(17,26,45,.74),rgba(8,14,28,.58));
}

.compare-status{
  border-color:rgba(139,77,255,.24);
  background:rgba(139,77,255,.14);
  color:#d8caff;
}

.compare-metrics div{
  border-color:rgba(205,219,255,.13);
  background:rgba(255,255,255,.045);
}

.compare-grid-premium{
  gap:1.15rem;
}

.compare-card{
  border-radius:22px;
  border:1px solid rgba(205,219,255,.14);
  background:linear-gradient(180deg,rgba(19,28,48,.88),rgba(9,15,29,.9));
  box-shadow:0 24px 70px rgba(0,0,0,.28);
}

.compare-card-head{
  min-height:92px;
  border-bottom-color:rgba(255,255,255,.08);
}

[data-provider-card="openai"].compare-card{
  border-color:rgba(48,148,255,.5);
  box-shadow:0 0 34px rgba(48,148,255,.17),0 24px 70px rgba(0,0,0,.28);
}

[data-provider-card="openai"] .compare-card-head{
  background:linear-gradient(135deg,rgba(40,132,255,.95),rgba(45,116,229,.66));
}

[data-provider-card="claude"].compare-card{
  border-color:rgba(255,171,101,.52);
  box-shadow:0 0 34px rgba(255,171,101,.14),0 24px 70px rgba(0,0,0,.28);
}

[data-provider-card="claude"] .compare-card-head{
  background:linear-gradient(135deg,rgba(255,171,101,.9),rgba(157,98,48,.6));
}

[data-provider-card="gemini"].compare-card{
  border-color:rgba(89,199,255,.5);
  box-shadow:0 0 34px rgba(217,82,255,.14),0 24px 70px rgba(0,0,0,.28);
}

[data-provider-card="gemini"] .compare-card-head{
  background:linear-gradient(135deg,rgba(61,126,255,.9),rgba(66,216,154,.7) 48%,rgba(255,86,101,.68));
}

.provider-mark{
  color:#fff !important;
  border-color:rgba(255,255,255,.22) !important;
  background:rgba(0,0,0,.18) !important;
}

.compare-card-head span{
  color:rgba(255,255,255,.82);
}

.compare-pill{
  color:#dfffe9 !important;
  border-color:rgba(53,209,127,.24);
  background:rgba(7,17,14,.38);
}

.compare-output,
.compare-empty,
.compare-card-actions{
  background:rgba(5,10,23,.54);
}

.compare-empty{
  border-color:rgba(205,219,255,.16);
}

.compare-render code,
.compare-render pre,
.compare-table-wrap{
  background:rgba(5,10,23,.58);
}

.pricing-grid{
  grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
  max-width:860px;
  margin:0 auto;
  align-items:stretch;
  gap:1.4rem;
}

.pricing-card{
  display:flex;
  flex-direction:column;
  min-height:360px;
  padding:1.85rem;
  border-radius:22px;
  border-style:dashed;
  background:linear-gradient(180deg,rgba(31,41,61,.76),rgba(14,22,38,.72));
}

.pricing-card.featured{
  border-style:solid;
  border-color:rgba(167,88,255,.8);
  background:
    radial-gradient(circle at 88% 4%,rgba(139,77,255,.28),transparent 12rem),
    linear-gradient(180deg,rgba(30,39,63,.92),rgba(10,16,31,.88));
  box-shadow:0 0 54px rgba(139,77,255,.34),0 28px 80px rgba(0,0,0,.34);
}

.pricing-card.featured::before{
  content:"Popular";
  top:1.4rem;
  right:1.4rem;
  left:auto;
  transform:none;
  background:linear-gradient(135deg,#7b4dff,#d952ff);
  box-shadow:0 0 24px rgba(139,77,255,.36);
}

.price{
  margin:.3rem 0 1.1rem;
  color:#fff;
  font-size:clamp(2rem,4vw,3.15rem);
  font-weight:900;
  letter-spacing:0;
  line-height:1.05;
}

.price span{
  display:inline-block;
  color:#c8d1e2;
  font-size:1rem;
  font-weight:800;
}

.pricing-card ul{
  display:grid;
  gap:.75rem;
  padding:0;
  list-style:none;
  color:#e7edf8;
}

.pricing-card li{
  position:relative;
  padding-left:1.85rem;
}

.pricing-card li::before{
  content:"";
  position:absolute;
  left:0;
  top:.1rem;
  width:1.1rem;
  height:1.1rem;
  border-radius:50%;
  background:rgba(156,166,187,.32);
  box-shadow:inset 0 0 0 4px rgba(255,255,255,.08);
}

.pricing-card.featured li::before{
  background:#35d17f;
  box-shadow:0 0 16px rgba(53,209,127,.42);
}

.pricing-card form{
  margin-top:auto;
}

.pricing-card .primary{
  width:100%;
}

.usage-meter{
  max-width:860px;
  margin:1.6rem auto 0;
  border-color:rgba(205,219,255,.13);
  background:rgba(255,255,255,.045);
}

.usage-bar{
  height:14px;
  background:rgba(255,255,255,.08);
  box-shadow:inset 0 1px 2px rgba(0,0,0,.32);
}

.usage-fill{
  background:linear-gradient(90deg,#35d17f 0%,#a7d66b 56%,#ffc145 100%);
  box-shadow:0 0 18px rgba(53,209,127,.24);
}

.toast{
  border:1px solid rgba(255,255,255,.12);
  background:rgba(11,18,33,.92);
  color:#fff;
  box-shadow:0 20px 60px rgba(0,0,0,.34);
  backdrop-filter:blur(16px);
}

.compare-modal-panel{
  border-color:rgba(205,219,255,.18);
  background:linear-gradient(180deg,rgba(18,27,46,.94),rgba(8,14,28,.94));
}

.compare-modal-head,
.compare-modal-body{
  background:transparent;
}

@media (max-width:1100px){
  .auth-layout{
    grid-template-columns:1fr;
    gap:1.5rem;
  }

  .hero-card{
    min-height:auto;
    padding:0;
  }

  .hero-card::before,
  .hero-card::after{
    display:none;
  }

  .editor-grid{
    grid-template-columns:1fr;
  }

  .hero-benefit-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  [data-view-panel="editor"].view.is-active{
    grid-template-columns:1fr;
  }

  [data-view-panel="editor"] .editor-grid{
    display:grid;
    grid-template-columns:1fr;
  }

  [data-view-panel="editor"] .enhancer-card,
  [data-view-panel="editor"] .score-card,
  [data-view-panel="editor"] .modules-grid{
    grid-column:1;
  }

  [data-view-panel="editor"] .score-card{
    grid-row:auto;
    position:relative;
    top:0;
    max-height:none;
  }
}

@media (max-width:720px){
  .shell{
    padding:.75rem;
  }

  .topbar{
    position:relative;
    top:0;
  }

  .brand-logo-wrap{
    width:228px;
    height:58px;
  }

  .auth-layout{
    border-radius:22px;
  }

  .hero-card,
  .auth-card{
    padding:1.25rem;
  }

  .hero-card{
    padding:0;
  }

  .auth-card{
    width:100%;
    margin-bottom:1rem;
  }

  .hero-card h1{
    font-size:2.55rem;
  }

  .hero-points{
    grid-template-columns:1fr;
  }

  .hero-benefit-grid{
    grid-template-columns:1fr;
    margin-top:1.4rem;
  }

  .hero-benefit-card{
    min-height:auto;
  }

  .auth-options{
    align-items:flex-start;
    flex-direction:column;
  }

  .app-layout{
    gap:.8rem;
  }

  .workspace .view,
  .sidebar{
    border-radius:20px;
  }

  .pricing-card{
    min-height:auto;
  }
}

/* Explicit light theme recovery */
html[data-theme="light"] body{
  background:
    radial-gradient(circle at 8% -10%, rgba(124,77,255,.18), transparent 28rem),
    radial-gradient(circle at 92% 2%, rgba(27,180,112,.12), transparent 24rem),
    linear-gradient(135deg,#eef3fb 0%,#f8fbff 52%,#edf5f8 100%);
}

html[data-theme="light"] body::before{
  background:
    linear-gradient(rgba(40,56,86,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40,56,86,.035) 1px, transparent 1px);
  mask-image:linear-gradient(to bottom, rgba(0,0,0,.45), transparent 78%);
}

html[data-theme="light"] .topbar,
html[data-theme="light"] .hero-card,
html[data-theme="light"] .auth-card,
html[data-theme="light"] .card,
html[data-theme="light"] .sidebar,
html[data-theme="light"] .workspace .view{
  border-color:rgba(45,60,90,.16);
  background:linear-gradient(180deg,rgba(255,255,255,.9),rgba(245,248,255,.8));
  box-shadow:0 24px 58px rgba(37,48,76,.14);
}

html[data-theme="light"] .auth-layout{
  border-color:rgba(45,60,90,.14);
  background:
    radial-gradient(circle at 18% 82%, rgba(112,72,255,.16), transparent 24rem),
    radial-gradient(circle at 44% 28%, rgba(27,180,112,.08), transparent 20rem),
    linear-gradient(135deg,rgba(246,249,255,.94),rgba(235,242,251,.9));
}

html[data-theme="light"] .auth-card{
  border:1px solid rgba(45,60,90,.18);
  background:
    linear-gradient(145deg,rgba(255,255,255,.92),rgba(231,237,249,.82)),
    radial-gradient(circle at 20% 0%,rgba(112,72,255,.14),transparent 12rem);
  box-shadow:0 26px 68px rgba(37,48,76,.18), inset 0 1px 0 rgba(255,255,255,.82);
}

html[data-theme="light"] .topbar{
  background:linear-gradient(180deg,rgba(255,255,255,.92),rgba(244,248,255,.84));
}

html[data-theme="light"] .account-chip,
html[data-theme="light"] .badge,
html[data-theme="light"] .usage-badge,
html[data-theme="light"] .badge-pro,
html[data-theme="light"] .ghost,
html[data-theme="light"] .button-link.ghost,
html[data-theme="light"] .panel,
html[data-theme="light"] .history-item,
html[data-theme="light"] .compare-metrics div,
html[data-theme="light"] .usage-meter{
  color:#263247;
  border-color:rgba(45,60,90,.15);
  background:rgba(255,255,255,.68);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7);
}

html[data-theme="light"] .badge,
html[data-theme="light"] .usage-badge{
  color:#5c35df;
}

html[data-theme="light"] .badge-pro{
  color:#087746;
  background:rgba(27,180,112,.12);
}

html[data-theme="light"] textarea,
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] .auth-form input,
html[data-theme="light"] .modules-grid textarea,
html[data-theme="light"] .modules-grid input[type="text"]{
  color:#111827;
  border-color:rgba(45,60,90,.18);
  background:rgba(255,255,255,.74);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.75);
}

html[data-theme="light"] textarea::placeholder,
html[data-theme="light"] input::placeholder{
  color:rgba(80,92,113,.62);
}

html[data-theme="light"] .eyebrow{
  color:#5c35df;
  border-color:rgba(112,72,255,.2);
  background:rgba(112,72,255,.1);
}

html[data-theme="light"] .hero-card p,
html[data-theme="light"] .microcopy,
html[data-theme="light"] .library-meta,
html[data-theme="light"] .score-tips,
html[data-theme="light"] .compare-command p,
html[data-theme="light"] .compare-metrics span,
html[data-theme="light"] .compare-card-head span,
html[data-theme="light"] .ai-trace-summary small,
html[data-theme="light"] .ai-trace-attempts span{
  color:#5d687a;
}

html[data-theme="light"] .hero-points li,
html[data-theme="light"] .modules-grid .card,
html[data-theme="light"] .score-result,
html[data-theme="light"] .library-card,
html[data-theme="light"] .compare-command,
html[data-theme="light"] .compare-card,
html[data-theme="light"] .pricing-card{
  color:#111827;
  border-color:rgba(45,60,90,.15);
  background:linear-gradient(180deg,rgba(255,255,255,.8),rgba(242,246,254,.74));
}

html[data-theme="light"] .hero-points li,
html[data-theme="light"] .panel-head h2,
html[data-theme="light"] .view-head h1,
html[data-theme="light"] .compare-command h1,
html[data-theme="light"] .library-card h3,
html[data-theme="light"] .compare-card-head h2,
html[data-theme="light"] .pricing-card h2,
html[data-theme="light"] .score-ring-label strong,
html[data-theme="light"] .price{
  color:#111827;
}

html[data-theme="light"] .nav-link{
  color:#5d687a;
}

html[data-theme="light"] .nav-link:hover{
  color:#111827;
  border-color:rgba(45,60,90,.15);
  background:rgba(112,72,255,.08);
}

html[data-theme="light"] .nav-link.is-active{
  color:#fff;
}

html[data-theme="light"] .enhancer-card{
  border-color:rgba(112,72,255,.24) !important;
  background:
    radial-gradient(circle at 85% 8%,rgba(27,180,112,.1),transparent 12rem),
    linear-gradient(135deg,rgba(112,72,255,.1),rgba(255,255,255,.82) 56%) !important;
}

html[data-theme="light"] .provider-switcher,
html[data-theme="light"] .tabs,
html[data-theme="light"] .provider-trust,
html[data-theme="light"] .compare-output,
html[data-theme="light"] .compare-empty,
html[data-theme="light"] .compare-card-actions,
html[data-theme="light"] .compare-render code,
html[data-theme="light"] .compare-render pre,
html[data-theme="light"] .compare-table-wrap{
  color:#263247;
  border-color:rgba(45,60,90,.15);
  background:rgba(255,255,255,.66);
}

html[data-theme="light"] .tab{
  color:#4b5568;
}

html[data-theme="light"] .tab.is-active{
  color:#fff;
  background:linear-gradient(135deg,#7048ff,#bc42f5);
}

html[data-theme="light"] .pricing-card.featured{
  border-color:rgba(112,72,255,.48);
  background:
    radial-gradient(circle at 88% 4%,rgba(112,72,255,.16),transparent 12rem),
    linear-gradient(180deg,rgba(255,255,255,.92),rgba(239,244,255,.86));
  box-shadow:0 0 44px rgba(112,72,255,.18),0 28px 70px rgba(37,48,76,.16);
}

html[data-theme="light"] .pricing-card ul{
  color:#263247;
}

html[data-theme="light"] .price span{
  color:#5d687a;
}

html[data-theme="light"] .score-ring-bg{
  stroke:rgba(46,62,92,.14);
}

html[data-theme="light"] .usage-bar{
  background:rgba(46,62,92,.12);
}

html[data-theme="light"] .hero-lead,
html[data-theme="light"] .hero-benefit-card p,
html[data-theme="light"] .auth-divider,
html[data-theme="light"] .auth-terms{
  color:#5d687a !important;
}

html[data-theme="light"] .hero-benefit-card,
html[data-theme="light"] .auth-input-wrap,
html[data-theme="light"] .auth-socials button{
  color:#263247;
  border-color:rgba(45,60,90,.15);
  background:linear-gradient(180deg,rgba(255,255,255,.82),rgba(242,246,254,.74));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.72),0 18px 44px rgba(37,48,76,.08);
}

html[data-theme="light"] .hero-benefit-card h2{
  color:#111827;
}

html[data-theme="light"] .auth-input-wrap input{
  background:transparent;
}

html[data-theme="light"] .remember-option{
  color:#263247 !important;
}

html[data-theme="light"] .auth-divider::before,
html[data-theme="light"] .auth-divider::after{
  background:rgba(45,60,90,.18);
}

/* Eye toggler pointer style */
.auth-eye {
  cursor: pointer;
}
.auth-eye:hover {
  opacity: 1;
}
.auth-eye.is-active {
  color: var(--primary) !important;
  opacity: 1;
}

/* Spinner keyframes and loading button indicator */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

button.is-loading {
  position: relative !important;
  color: transparent !important;
  pointer-events: none !important;
}

button.is-loading svg {
  opacity: 0 !important;
}

button.is-loading::after {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 1.25rem !important;
  height: 1.25rem !important;
  margin-left: -0.625rem !important;
  margin-top: -0.625rem !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
  border-top-color: #fff !important;
  border-radius: 50% !important;
  animation: spin 0.8s linear infinite !important;
  opacity: 1 !important;
}

button.ghost.is-loading::after {
  border-color: rgba(120, 149, 255, 0.2) !important;
  border-top-color: var(--primary) !important;
}

/* Tooltip styles */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--muted);
  color: var(--bg-elev);
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
}

.info-icon:hover {
  background-color: var(--primary);
}

.info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background-color: #121826;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: normal;
  line-height: 1.4;
  white-space: pre-wrap;
  width: 200px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
}

html[data-theme="dark"] .info-icon::after {
  background-color: #ffffff;
  color: #121826;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .info-icon::after {
    background-color: #ffffff;
    color: #121826;
  }
}

.info-icon:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
