:root {
  color-scheme: dark;
  --aika-bg: #050914;
  --aika-panel: rgba(9, 13, 28, 0.72);
  --aika-line: rgba(255, 255, 255, 0.12);
  --aika-text: rgba(255, 255, 255, 0.88);
  --aika-muted: rgba(255, 255, 255, 0.62);
  --aika-brand-a: #60a5fa;
  --aika-brand-b: #2563eb;
  --aika-brand-c: #34d399;
}

html,
body {
  overflow-x: hidden;
  background: var(--aika-bg);
}

body {
  min-width: 320px;
}

.aika-topbar {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  z-index: 120;
  transform: translateX(-50%);
  width: min(1120px, calc(100% - 28px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 12px;
  border: 1px solid var(--aika-line);
  border-radius: 20px;
  background: rgba(5, 8, 18, 0.62);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.aika-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: #fff;
  text-decoration: none;
}

.aika-mark {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--aika-brand-a), var(--aika-brand-b) 58%, var(--aika-brand-c));
  box-shadow: 0 0 32px rgba(96, 165, 250, 0.34);
  font: 800 18px/1 Inter, system-ui, sans-serif;
}

.aika-mark::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #6ee7b7;
  box-shadow: 0 0 14px rgba(110, 231, 183, 0.8);
}

.aika-brand-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.aika-brand-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.aika-brand-subtitle {
  color: rgba(255, 255, 255, 0.52);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.aika-topbar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.07);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.aika-topbar-action:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.35);
  background: rgba(125, 211, 252, 0.12);
}

body.aika-route-chat .aika-topbar {
  display: none;
}

@media (max-width: 767px) {
  .aika-topbar {
    width: calc(100% - 20px);
    padding: 8px 9px;
    border-radius: 18px;
  }

  .aika-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-size: 16px;
  }

  .aika-brand-title {
    font-size: 14px;
  }

  .aika-brand-subtitle {
    display: none;
  }

  .aika-topbar-action {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }

  body.aika-route-home #root > div:first-child {
    min-height: auto !important;
    overflow: visible !important;
  }

  body.aika-route-home #root > div:first-child > div:nth-child(2) {
    height: clamp(160px, 43vw, 230px) !important;
    margin-top: 0 !important;
  }

  body.aika-route-home #root > div:first-child > div:nth-child(2) img {
    object-position: center top !important;
  }

  body.aika-route-home #root > div:first-child > div:nth-child(1) {
    flex: 0 0 auto !important;
    justify-content: flex-start !important;
    min-height: auto !important;
    padding: 18px 18px 34px !important;
  }

  body.aika-route-home #root > div:first-child > div:nth-child(1)::before {
    content: "";
    position: absolute;
    inset: 10px 12px 20px;
    z-index: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(13, 18, 38, 0.72), rgba(5, 7, 17, 0.58));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 90px rgba(0, 0, 0, 0.24);
    pointer-events: none;
  }

  body.aika-route-home #root > div:first-child > div:nth-child(1) > div:last-child {
    position: relative !important;
    z-index: 1 !important;
    max-width: none !important;
  }

  body.aika-route-home #root > div:first-child h1 {
    margin-bottom: 12px !important;
    font-size: clamp(3.4rem, 17vw, 4.9rem) !important;
    color: #fff !important;
    text-shadow: 0 10px 44px rgba(96, 165, 250, 0.24) !important;
  }

  body.aika-route-home #root > div:first-child p {
    margin-bottom: 18px !important;
    font-size: 15px !important;
    line-height: 1.55 !important;
    color: rgba(255, 255, 255, 0.9) !important;
  }

  body.aika-route-home #root > div:first-child [class*="grid-cols-3"] {
    gap: 8px !important;
    margin-bottom: 24px !important;
  }

  body.aika-route-home #root > div:first-child [class*="grid-cols-3"] > div {
    min-height: 52px;
    padding-top: 9px !important;
    padding-bottom: 9px !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    background: rgba(255, 255, 255, 0.085) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }

  body.aika-route-home #root > div:first-child [class*="grid-cols-3"] span {
    font-size: 10.5px !important;
    color: rgba(255, 255, 255, 0.76) !important;
  }

  body.aika-route-home #root > div:first-child a {
    box-shadow: 0 14px 40px rgba(96, 165, 250, 0.36) !important;
  }

  body.aika-route-home #root > div > section,
  body.aika-route-home #root > div > footer {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  body.aika-route-home #root > div > section {
    padding-top: 64px !important;
    padding-bottom: 64px !important;
  }

  body.aika-route-home #root > div > section p {
    color: rgba(255, 255, 255, 0.64) !important;
  }
}

@media (min-width: 768px) {
  body.aika-route-home #root > div > div:first-child > div:first-child {
    padding-top: 96px !important;
  }
}


/* Per-domain polish */
.aika-topbar-action:hover {
  border-color: color-mix(in srgb, var(--aika-brand-a) 55%, transparent);
  background: color-mix(in srgb, var(--aika-brand-a) 16%, transparent);
}
body.aika-route-chat {
  background: #050914;
}
body.aika-route-chat .bg-\[hsl\(228\,50\%\,4\%\)\] {
  background-color: #050914 !important;
}
body.aika-route-home .aika-topbar {
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.34), 0 0 48px rgba(96, 165, 250, 0.12);
}

/* Mobile optimization 20260628 */
@media (max-width: 767px) {
  html {
    scroll-padding-top: 78px;
  }

  body {
    width: 100%;
    min-height: 100svh;
  }

  .aika-topbar {
    top: max(8px, env(safe-area-inset-top));
    width: calc(100% - 18px);
    gap: 10px;
    padding: 8px 9px;
  }

  .aika-brand {
    min-width: 0;
  }

  .aika-topbar-action {
    min-width: 86px;
    min-height: 34px;
    padding: 0 11px;
    white-space: nowrap;
  }

  body.aika-route-home #root > div:first-child {
    min-height: 100svh !important;
  }

  body.aika-route-home #root > div:first-child > div:nth-child(2) {
    height: clamp(220px, 62vw, 300px) !important;
  }

  body.aika-route-home #root > div:first-child > div:nth-child(1) {
    padding: 18px 18px 30px !important;
  }

  body.aika-route-home #root > div:first-child > div:nth-child(1)::before {
    inset: 8px 10px 18px !important;
    border-radius: 24px !important;
  }

  body.aika-route-home #root > div:first-child h1 {
    font-size: clamp(3rem, 14vw, 4.35rem) !important;
    line-height: 0.92 !important;
    overflow-wrap: anywhere;
  }

  body.aika-route-home #root > div:first-child p {
    font-size: 14.5px !important;
    line-height: 1.5 !important;
  }

  body.aika-route-home #root > div:first-child [class*="grid-cols-3"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body.aika-route-home #root > div:first-child [class*="grid-cols-3"] > div {
    min-height: 56px !important;
  }

  body.aika-route-home #root > div:first-child a[href*="chat"] {
    width: 100% !important;
    min-height: 50px !important;
    border-radius: 18px !important;
  }

  body.aika-route-home #root > div:first-child a[href*="chat"] + p {
    text-align: center;
  }

  body.aika-route-chat {
    height: 100svh;
    overflow: hidden;
  }

  body.aika-route-chat #root,
  body.aika-route-chat #root > div:first-child {
    height: 100svh !important;
    min-height: 100svh !important;
    overflow: hidden !important;
  }

  body.aika-route-chat #root > div:first-child {
    display: flex !important;
    flex-direction: column !important;
  }

  body.aika-route-chat #root > div:first-child > div:first-child {
    display: none !important;
  }

  body.aika-route-chat #root > div:first-child > div:nth-child(2) {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  body.aika-route-chat #root > div:first-child > div:nth-child(2) > header {
    min-height: 58px !important;
    padding: 10px 12px !important;
  }

  body.aika-route-chat #root > div:first-child > div:nth-child(2) > div[class*="overflow-y-auto"] {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    overflow-y: auto !important;
    padding-bottom: 10px !important;
  }

  body.aika-route-chat #root > div:first-child > div:nth-child(2) > div[class*="pb-safe-area-bottom"] {
    padding: 10px 16px max(14px, env(safe-area-inset-bottom)) !important;
  }

  body.aika-route-chat #root > div:first-child > div:nth-child(2) > div[class*="pb-safe-area-bottom"] .max-w-xl {
    max-width: none !important;
  }

  body.aika-route-chat [data-registration-link] {
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.16);
  }

  body.aika-route-chat [data-registration-link][class*="inline-flex"] {
    width: min(100%, 340px) !important;
    justify-content: center !important;
  }

  body.aika-route-chat [data-registration-link][class*="overflow-hidden"][class*="h-64"] {
    width: min(58vw, 224px) !important;
    height: min(74vw, 288px) !important;
  }
}

@media (max-width: 380px) {
  .aika-brand-title {
    font-size: 13px;
    letter-spacing: 0.08em;
  }

  .aika-topbar-action {
    min-width: 78px;
    padding: 0 9px;
    font-size: 11.5px;
  }

  body.aika-route-home #root > div:first-child h1 {
    font-size: clamp(2.75rem, 13vw, 3.8rem) !important;
  }
}

body.aika-route-chat [data-registration-link][class*="overflow-hidden"] img[alt=""] {
  filter: blur(9px) saturate(0.92) brightness(0.9) !important;
  transform: scale(1.14) !important;
}

/* Mobile home refinement 20260628 */
@media (max-width: 767px) {
  body.aika-route-home {
    background:
      radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--aika-brand-a) 18%, transparent), transparent 42%),
      var(--aika-bg);
  }

  body.aika-route-home #root {
    padding-top: calc(70px + env(safe-area-inset-top)) !important;
  }

  body.aika-route-home #root > div:first-child {
    gap: 12px !important;
    min-height: auto !important;
    padding-bottom: 22px !important;
    overflow: visible !important;
  }

  body.aika-route-home #root > div:first-child > div:nth-child(2) {
    width: calc(100% - 20px) !important;
    height: clamp(224px, 60vw, 286px) !important;
    margin: 0 auto !important;
    border: 1px solid rgba(255, 255, 255, 0.11) !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.32) !important;
  }

  body.aika-route-home #root > div:first-child > div:nth-child(2) img {
    object-position: center 16% !important;
  }

  body.aika-route-home #root > div:first-child > div:nth-child(2) > div[class*="bottom-8"][class*="right-6"] {
    left: 14px !important;
    right: 14px !important;
    bottom: 14px !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 10px 12px !important;
    gap: 10px !important;
    border-radius: 18px !important;
  }

  body.aika-route-home #root > div:first-child > div:nth-child(2) > div[class*="bottom-8"][class*="right-6"] p {
    margin: 0 !important;
    line-height: 1.25 !important;
  }

  body.aika-route-home #root > div:first-child > div:nth-child(1) {
    width: calc(100% - 20px) !important;
    margin: 0 auto 18px !important;
    padding: 16px 14px 22px !important;
    border-radius: 24px !important;
  }

  body.aika-route-home #root > div:first-child > div:nth-child(1)::before {
    inset: 0 !important;
    border-radius: 24px !important;
    background: linear-gradient(180deg, rgba(18, 20, 42, 0.92), rgba(8, 9, 22, 0.82)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 72px rgba(0, 0, 0, 0.28) !important;
  }

  body.aika-route-home #root > div:first-child h1 {
    margin-bottom: 8px !important;
    font-size: clamp(2.6rem, 11.6vw, 3.45rem) !important;
    line-height: 0.98 !important;
  }

  body.aika-route-home #root > div:first-child p {
    margin-bottom: 14px !important;
    font-size: 14px !important;
    line-height: 1.52 !important;
  }

  body.aika-route-home #root > div:first-child [class*="grid-cols-3"] {
    gap: 8px !important;
    margin-bottom: 16px !important;
  }

  body.aika-route-home #root > div:first-child [class*="grid-cols-3"] > div {
    min-height: 50px !important;
    padding: 8px 7px !important;
    border-radius: 16px !important;
  }

  body.aika-route-home #root > div:first-child a[href*="chat"] {
    min-height: 50px !important;
    border-radius: 18px !important;
  }

  body.aika-route-home #root > div:first-child a[href*="chat"] + p {
    margin: 10px 0 0 !important;
    color: rgba(255, 255, 255, 0.58) !important;
    font-size: 13px !important;
    text-align: center !important;
  }
}

