:root{
  --bg:#0b1020;
  --panel:#101a33;
  --panel2:#0f1730;
  --text:#e8ecff;
  --muted:#a7b0d8;
  --brand:#7c5cff;
  --brand2:#31d3ff;
  --border:rgba(255,255,255,.08);
  --shadow:0 18px 60px rgba(0,0,0,.35);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  min-height:100vh;
  display:flex;
  flex-direction:column;
  background:
    radial-gradient(900px 500px at 20% -10%, rgba(124,92,255,.28), transparent 55%),
    radial-gradient(900px 500px at 80% 0%, rgba(49,211,255,.20), transparent 55%),
    linear-gradient(180deg, #070b16 0%, var(--bg) 55%, #070b16 100%);
  line-height:1.6;
}

main{
  flex:1 0 auto;
}

a{color:inherit;text-decoration:none}
a:hover{color:var(--text)}

.container{max-width:1100px;margin:0 auto;padding:0 18px}
.skip-link{
  position:absolute;left:-9999px;top:0;
  padding:10px 12px;background:#fff;color:#000;border-radius:10px;
}
.skip-link:focus{left:12px;top:12px;z-index:999}

.topbar{
  position:sticky;top:0;z-index:20;
  backdrop-filter: blur(10px);
  background: rgba(7,11,22,.55);
  border-bottom:1px solid var(--border);
}
.topbar-inner{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:14px 0;
  min-width:0;
}
.topbar-right{
  display:flex;align-items:center;gap:10px;
  flex:1;
  min-width:0;
  justify-content:flex-end;
}
.brand{
  display:flex;align-items:center;gap:10px;font-weight:800;letter-spacing:.2px;
  flex:0 0 auto;
  white-space:nowrap;
}
.logo{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;height:34px;border-radius:12px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 10px 26px rgba(124,92,255,.25);
  color:#ffffff;
  font-size:12px;
  font-weight:900;
  letter-spacing:.4px;
}
.logo::before{content:"AI"}
.nav{
  display:flex;gap:10px;flex-wrap:nowrap;align-items:center;justify-content:flex-end;
  min-width:0;
  overflow-x:auto;
  overflow-y:hidden;
  scrollbar-width:none;
}
.nav::-webkit-scrollbar{display:none}
.nav a{
  padding:8px 10px;border-radius:12px;color:var(--muted);
  border:1px solid transparent;
  white-space:nowrap;
  flex:0 0 auto;
}
.nav a:hover{
  color:var(--text);
  border-color:var(--border);
  background: rgba(255,255,255,.04);
}
.nav a[aria-current="page"]{
  color:var(--text);
  border-color:rgba(124,92,255,.35);
  background: rgba(124,92,255,.14);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}
.nav .cta{
  color:#0b1020;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border:0;
  font-weight:800;
}

.hero{
  padding:36px 0 18px;
}
.hero-card{
  border:1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.hero-inner{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:18px;
  padding:22px;
}
.kicker{color:var(--muted);font-weight:600;margin:0 0 6px}
h1{font-size:34px;line-height:1.15;margin:0 0 10px}
.lead{color:var(--muted);margin:0 0 16px}
.hero-actions{display:flex;gap:10px;flex-wrap:wrap}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:12px 14px;border-radius:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color:var(--text);
  font-weight:750;
  cursor:pointer;
}
.btn:hover{background: rgba(255,255,255,.08)}
.btn.primary{
  border:0;color:#0b1020;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
}
.btn.primary:hover{filter:saturate(1.05) contrast(1.02)}
.btn.ghost{background: transparent}
.locale-switch{
  display:inline-flex;
  align-items:center;
  gap:6px;
  flex:0 0 auto;
}
.locale-choice{
  min-width:44px;
  padding:8px 10px;
  border-radius:10px;
  color:var(--muted);
}
.locale-choice.is-active{
  color:var(--text);
  border-color:rgba(124,92,255,.45);
  background: rgba(124,92,255,.16);
}
.is-locale-loading .locale-choice{
  pointer-events:none;
}
.locale-choice.is-loading{
  opacity:.75;
  position:relative;
}
.locale-choice.is-loading::after{
  content:"";
  width:12px;
  height:12px;
  margin-left:6px;
  border-radius:50%;
  border:2px solid rgba(255,255,255,.35);
  border-top-color:var(--text);
  display:inline-block;
  vertical-align:middle;
  animation: locale-spin .8s linear infinite;
}
@keyframes locale-spin{
  to{transform:rotate(360deg)}
}
.global-loading-overlay{
  position:fixed;
  inset:0;
  z-index:9998;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  background:rgba(7,11,22,.48);
  backdrop-filter: blur(2px);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}
.global-loading-spinner{
  width:40px;
  height:40px;
  border-radius:50%;
  border:3px solid rgba(255,255,255,.3);
  border-top-color:#ffffff;
  animation:locale-spin .9s linear infinite;
}
.global-loading-text{
  color:var(--text);
  font-size:14px;
  letter-spacing:.2px;
}
.is-global-loading .global-loading-overlay{
  opacity:1;
  pointer-events:auto;
}
.is-global-loading{
  overflow:hidden;
}

/* Hide Google Translate injected banner/tooltips to avoid layout jump. */
body{
  top:0 !important;
}
.goog-te-banner-frame.skiptranslate,
iframe.goog-te-banner-frame{
  display:none !important;
}
body > .skiptranslate,
body > .skiptranslate > iframe.skiptranslate,
.VIpgJd-ZVi9od-ORHb-OEVmcd{
  display:none !important;
  visibility:hidden !important;
}
#goog-gt-tt,
.goog-tooltip,
.goog-tooltip:hover,
.goog-text-highlight{
  background:none !important;
  box-shadow:none !important;
}
html.translated-ltr, body.translated-ltr,
html.translated-rtl, body.translated-rtl{
  top:0 !important;
}

.hero-right{
  border-left:1px solid var(--border);
  padding-left:18px;
}
.search{
  display:flex;gap:10px;align-items:center;
  background: rgba(0,0,0,.18);
  border:1px solid var(--border);
  border-radius: 14px;
  padding:10px 12px;
}
.search input{
  width:100%;
  background:transparent;border:0;outline:0;
  color:var(--text);
  font-size:14px;
}
.search small{color:var(--muted)}

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
  padding:18px 0;
}
.card{
  grid-column: span 4;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  border-radius: var(--radius);
  padding:16px;
}
.card:hover{background: rgba(255,255,255,.05)}
.card h3{margin:0 0 6px;font-size:16px}
.meta{color:var(--muted);font-size:13px;margin:0 0 12px}
.tagrow{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.tag{
  font-size:12px;color:var(--muted);
  border:1px solid var(--border);
  padding:4px 8px;border-radius:999px;
}

.section{padding:10px 0 22px}
.section-title{
  display:flex;align-items:flex-end;justify-content:space-between;gap:12px;
  margin:0 0 10px;
}
.section-title h2{margin:0;font-size:18px}
.section-title a{color:var(--muted)}
.section-title a:hover{color:var(--text)}

.breadcrumb{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 12px;
  color:var(--muted);
  font-size:13px;
}
.breadcrumb a{color:var(--muted)}
.breadcrumb a:hover{color:var(--text)}
.breadcrumb .current{color:var(--text)}

.ad{
  border:1px dashed rgba(255,255,255,.18);
  background: rgba(0,0,0,.16);
  border-radius: var(--radius);
  padding:14px;
  color:var(--muted);
  display:none;
}
.ad strong{color:var(--text)}
.ad .adbox{
  margin-top:10px;
  border:1px solid var(--border);
  border-radius: 14px;
  padding:14px;
  background: rgba(255,255,255,.02);
}

.list{
  border:1px solid var(--border);
  border-radius: var(--radius);
  overflow:hidden;
  background: rgba(255,255,255,.02);
}
.list a{
  display:flex;align-items:flex-start;justify-content:space-between;gap:10px;
  padding:14px 16px;border-top:1px solid var(--border);
}
.list a:first-child{border-top:0}
.list a:hover{background: rgba(255,255,255,.05)}
.list .title{font-weight:800}
.list .desc{color:var(--muted);font-size:13px}
.list time{color:var(--muted);font-size:12px;white-space:nowrap}

.post{
  padding:22px 0 30px;
}
.chat-page .container{
  max-width:900px;
}
.post header{
  border:1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  background: rgba(255,255,255,.03);
  padding:18px;
  box-shadow: var(--shadow);
}
.post h1{font-size:30px;margin:0 0 8px}
.post .subtitle{color:var(--muted);margin:0}
.post .byline{display:flex;gap:10px;flex-wrap:wrap;color:var(--muted);font-size:13px;margin-top:10px}
.prose{
  margin-top:14px;
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.02);
  padding:18px;
}
.chat-panel{
  margin-top:18px;
  border-color:rgba(49,211,255,.30);
  box-shadow:0 16px 40px rgba(0,0,0,.25);
  position:relative;
}
.chat-limit-hint{
  margin:0 0 10px;
  color:var(--muted);
  font-size:13px;
}
.chat-panel.is-busy{
  pointer-events:none;
}
.chat-panel.is-busy .chat-messages,
.chat-panel.is-busy .chat-input-wrap{
  opacity:.72;
}
.chat-busy-indicator{
  position:absolute;
  top:14px;
  right:14px;
  width:18px;
  height:18px;
  border-radius:50%;
  border:2px solid rgba(255,255,255,.25);
  border-top-color:var(--text);
  animation:locale-spin .8s linear infinite;
  opacity:0;
  pointer-events:none;
}
.chat-panel.is-busy .chat-busy-indicator{
  opacity:1;
}
.prose h2{margin:18px 0 8px;font-size:18px}
.prose h3{margin:14px 0 6px;font-size:16px}
.prose p{margin:10px 0}
.prose code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.prose pre{
  margin:10px 0;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:14px;
  background: rgba(0,0,0,.18);
  overflow:auto;
}
.prose pre code{
  display:block;
  font-size:13px;
  line-height:1.55;
  white-space:pre-wrap;
  word-break:break-word;
}
.prose ul{margin:10px 0 10px 18px}
.callout{
  border:1px solid rgba(124,92,255,.35);
  background: rgba(124,92,255,.10);
  border-radius: var(--radius);
  padding:14px;
}
.tools{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:12px;
  margin:12px 0;
}
.tool{
  grid-column: span 6;
  border:1px solid var(--border);
  background: rgba(0,0,0,.14);
  border-radius: var(--radius);
  padding:14px;
}
.tool .row{display:flex;align-items:center;justify-content:space-between;gap:10px}
.tool h3{margin:0;font-size:16px}
.tool p{margin:8px 0 0;color:var(--muted);font-size:13px}
.tool .btn{padding:10px 12px;border-radius:12px}
.tool .btn.primary{font-weight:850}

.chat-limiter{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin:12px 0;
}
.chat-conn-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin:10px 0;
}
.chat-conn-grid label{
  display:block;
  color:var(--muted);
  font-size:13px;
  margin-bottom:4px;
}
.chat-conn-grid input,
.chat-conn-grid select{
  width:100%;
  background:rgba(255,255,255,.04);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:10px;
  padding:8px 10px;
}
.chat-limiter select{
  background:rgba(255,255,255,.04);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:10px;
  padding:8px 10px;
}
.chat-messages{
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(5,10,20,.68);
  padding:12px;
  min-height:280px;
  max-height:460px;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.chat-message{
  margin:0;
  padding:10px 12px;
  border-radius:10px;
  font-size:14px;
  max-width:min(78%, 720px);
  white-space:pre-wrap;
  word-break:break-word;
}
.chat-message.user{
  background:rgba(49,211,255,.14);
  border:1px solid rgba(49,211,255,.35);
  align-self:flex-end;
}
.chat-message.assistant{
  background:rgba(124,92,255,.14);
  border:1px solid rgba(124,92,255,.35);
  align-self:flex-start;
}
.chat-message.system{
  background:rgba(245,158,11,.14);
  border:1px solid rgba(245,158,11,.35);
  align-self:center;
}
.chat-message.loading{
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--muted);
  background:rgba(255,255,255,.04);
  border:1px dashed var(--border);
  align-self:flex-start;
}
.chat-message.loading::before{
  content:"";
  width:12px;
  height:12px;
  border-radius:50%;
  border:2px solid rgba(255,255,255,.28);
  border-top-color:var(--text);
  animation:locale-spin .8s linear infinite;
}
.chat-input-wrap{
  margin-top:12px;
}
.chat-input-row{
  display:flex;
  align-items:stretch;
  gap:10px;
}
.chat-input-wrap textarea{
  width:100%;
  flex:1;
  resize:vertical;
  min-height:72px;
  background:rgba(255,255,255,.03);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  outline:none;
}
.chat-input-row .btn{
  flex:0 0 auto;
  align-self:center;
  min-width:104px;
}
.chat-input-wrap textarea:focus{
  border-color:rgba(49,211,255,.48);
  box-shadow:0 0 0 2px rgba(49,211,255,.14);
}
.chat-input-wrap.is-busy textarea{
  opacity:.78;
}
@media (max-width: 560px){
  .chat-input-row{
    flex-direction:column;
  }
  .chat-input-row .btn{
    width:100%;
  }
}

.footer{
  border-top:1px solid var(--border);
  padding:22px 0;
  color:var(--muted);
  background: rgba(0,0,0,.12);
  margin-top:auto;
}
.footer a{color:var(--muted)}
.footer a:hover{color:var(--text)}
.footer-inner{display:flex;flex-wrap:wrap;gap:10px;justify-content:space-between}
.footer-links{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

@media (max-width: 900px){
  .hero-inner{grid-template-columns: 1fr; }
  .hero-right{border-left:0;border-top:1px solid var(--border);padding-left:0;padding-top:16px}
  .card{grid-column: span 6}
  .tool{grid-column: span 12}
}
@media (max-width: 560px){
  h1{font-size:28px}
  .card{grid-column: span 12}
  .topbar-inner{
    flex-wrap:wrap;
    row-gap:10px;
  }
  .topbar-right{
    width:100%;
    justify-content:space-between;
  }
  .nav{
    display:flex;
    max-width:100%;
  }
  .chat-conn-grid{
    grid-template-columns:1fr;
  }
}

