:root {
  color-scheme: dark;
  --bg: oklch(0.105 0 0);
  --bg-deep: oklch(0.075 0 0);
  --surface: oklch(0.15 0.014 275);
  --surface-raised: oklch(0.19 0.025 275);
  --surface-active: oklch(0.235 0.06 274);
  --primary: oklch(0.59 0.17 272);
  --primary-bright: oklch(0.7 0.18 272);
  --gold: oklch(0.81 0.16 82);
  --gold-strong: oklch(0.74 0.17 72);
  --ink: oklch(0.96 0.008 275);
  --muted: oklch(0.72 0.025 275);
  --faint: oklch(0.56 0.025 275);
  --line: oklch(0.34 0.035 275 / 0.64);
  --line-soft: oklch(0.28 0.025 275 / 0.55);
  --success: oklch(0.72 0.16 148);
  --danger: oklch(0.67 0.19 25);
  --white-on-color: oklch(0.99 0 0);
  --font-ui: "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --sidebar-width: 248px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 160ms;
  --duration-normal: 220ms;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  max-width: 100vw;
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  width: 100%;
  max-width: 100vw;
  min-height: 100svh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 48% 0%, oklch(0.23 0.065 263 / 0.44), transparent 38rem),
    radial-gradient(circle at 84% 82%, oklch(0.21 0.05 282 / 0.18), transparent 34rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
textarea,
input {
  font: inherit;
}

button,
a,
textarea,
input {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:not(:disabled),
a {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 3px solid oklch(0.81 0.16 82 / 0.72);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

img,
svg {
  display: block;
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  min-width: 320px;
  overflow: auto;
  background: var(--bg-deep);
}

.auth-gate[hidden] {
  display: none;
}

.auth-stage {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1.08fr);
  min-height: 100svh;
}

.auth-story {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding: clamp(28px, 5vw, 72px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, oklch(0.42 0.14 256 / 0.72), transparent 19rem),
    linear-gradient(150deg, oklch(0.19 0.08 264), oklch(0.1 0.025 279) 72%);
}

.auth-story::after {
  position: absolute;
  inset: auto -18% -32% auto;
  width: 34rem;
  aspect-ratio: 1;
  border: 1px solid oklch(0.81 0.16 82 / 0.14);
  border-radius: 50%;
  content: "";
}

.auth-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 850;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.auth-brand img {
  width: 58px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 45% 38%;
}

.auth-brand b {
  color: var(--gold);
}

.auth-mascot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(28rem, 78%);
  margin: auto;
  aspect-ratio: 1.22;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: oklch(0.16 0.035 267 / 0.7);
}

.auth-mascot img {
  width: 112%;
  height: 112%;
  object-fit: cover;
  object-position: 48% 42%;
}

.auth-promise,
.auth-features {
  position: relative;
  z-index: 1;
}

.auth-promise > span {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 780;
}

.auth-promise h1 {
  max-width: 12ch;
  margin: 5px 0 8px;
  color: var(--ink);
  font-size: clamp(2rem, 3.7vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.auth-promise p {
  max-width: 45ch;
  margin: 0;
  color: oklch(0.83 0.025 275);
  font-size: 0.94rem;
}

.auth-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 24px;
  color: oklch(0.88 0.02 275);
  font-size: 0.78rem;
}

.auth-features span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.auth-features svg {
  width: 17px;
  height: 17px;
  color: var(--gold);
}

.auth-panel {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: clamp(28px, 6vw, 88px);
  background: var(--bg);
}

.auth-loading {
  display: grid;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
}

.auth-loader {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: auth-spin 760ms linear infinite;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

.auth-content {
  width: min(100%, 460px);
}

.auth-heading {
  margin-bottom: 24px;
}

.auth-heading p {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 780;
}

.auth-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.auth-heading > span:last-child {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.auth-mobile-mark {
  display: none;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-md);
  background: var(--surface);
}

.auth-tabs button {
  min-height: 44px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 720;
}

.auth-tabs button:hover {
  color: var(--ink);
}

.auth-tabs button.is-active {
  background: var(--surface-active);
  color: var(--gold);
}

.auth-form {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.guest-form {
  margin-top: 26px;
}

.auth-form[hidden] {
  display: none;
}

.auth-form label {
  margin-top: 5px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out);
}

.auth-form input::placeholder {
  color: oklch(0.68 0.025 275);
}

.auth-form input:hover {
  border-color: oklch(0.46 0.06 274);
}

.auth-form input:focus {
  border-color: var(--primary-bright);
  background: var(--surface-raised);
  outline: 3px solid oklch(0.59 0.17 272 / 0.18);
  outline-offset: 1px;
}

.password-hint {
  color: var(--faint);
  font-size: 0.7rem;
}

.auth-submit {
  min-height: 52px;
  margin-top: 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--gold);
  color: oklch(0.16 0.035 72);
  font-size: 0.9rem;
  font-weight: 850;
  transition:
    background var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.auth-submit:hover {
  background: var(--gold-strong);
}

.auth-submit:active {
  transform: translateY(1px);
}

.auth-submit.is-loading {
  color: transparent;
}

.auth-submit.is-loading::after {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid oklch(0.16 0.035 72 / 0.35);
  border-top-color: oklch(0.16 0.035 72);
  border-radius: 50%;
  animation: auth-spin 700ms linear infinite;
  content: "";
}

.auth-submit {
  position: relative;
  display: grid;
  place-items: center;
}

.auth-feedback {
  margin: 14px 0 0;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  background: oklch(0.67 0.19 25 / 0.13);
  color: oklch(0.87 0.09 25);
  font-size: 0.78rem;
}

.auth-feedback.is-success {
  background: oklch(0.72 0.16 148 / 0.13);
  color: oklch(0.87 0.1 148);
}

.auth-privacy {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 18px 0 0;
  color: var(--faint);
  font-size: 0.7rem;
}

.auth-privacy svg {
  width: 17px;
  height: 17px;
  color: var(--success);
}

.app-shell[aria-hidden="true"] {
  visibility: hidden;
}

.account-details {
  display: grid;
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--line-soft);
}

.account-details > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 54px;
  padding: 10px 14px;
  background: var(--surface-raised);
}

.account-details span {
  color: var(--muted);
  font-size: 0.76rem;
}

.account-details strong {
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
}

.logout-button {
  color: oklch(0.82 0.1 25);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  grid-template-areas: "workspace sidebar";
  min-height: 100svh;
  direction: ltr;
}

.side-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  height: 100svh;
  padding: 28px 18px 22px;
  overflow: hidden;
  background: oklch(0.115 0.018 274 / 0.96);
  border-inline-start: 1px solid var(--line-soft);
  direction: rtl;
}

.side-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 70% 10%, oklch(0.42 0.12 269 / 0.16), transparent 17rem);
}

.brand,
.nav-list,
.side-foot {
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-avatar {
  width: 64px;
  height: 52px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-raised);
}

.brand-avatar img {
  width: 108%;
  height: 108%;
  object-fit: cover;
  object-position: 45% 39%;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 850;
  letter-spacing: -0.025em;
}

.brand-name b,
.mobile-brand b {
  color: var(--gold);
}

.nav-list {
  display: grid;
  gap: 6px;
  margin-top: 48px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--muted);
  font-size: 0.98rem;
  text-align: right;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.nav-item svg {
  width: 23px;
  height: 23px;
}

.nav-item:hover {
  background: var(--surface);
  color: var(--ink);
}

.nav-item.is-active {
  background: var(--surface-active);
  color: var(--gold);
}

.side-foot {
  margin-top: auto;
  padding: 16px 12px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--faint);
  font-size: 0.76rem;
  line-height: 1.65;
}

.side-foot p {
  margin: 8px 0 0;
}

.online-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 650;
}

.online-dot span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px oklch(0.72 0.16 148 / 0.12);
}

.online-dot.is-demo span {
  background: var(--gold);
  box-shadow: 0 0 0 4px oklch(0.81 0.16 82 / 0.12);
}

.online-dot.is-error span {
  background: var(--danger);
  box-shadow: 0 0 0 4px oklch(0.67 0.19 25 / 0.12);
}

.workspace {
  grid-area: workspace;
  min-width: 0;
  min-height: 100svh;
  direction: rtl;
}

.view {
  min-height: 100svh;
}

.view[hidden] {
  display: none;
}

.mobile-topbar,
.bottom-nav,
.mobile-menu {
  display: none;
}

.chat-layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  grid-template-areas: "rail chat";
  min-height: 100svh;
  direction: ltr;
}

.chat-panel {
  grid-area: chat;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100svh;
  padding: 42px clamp(26px, 4vw, 68px) 28px;
  direction: rtl;
}

.chat-intro {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 5vw, 72px);
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 10px 0 20px;
}

.chat-intro > div:first-child {
  max-width: 610px;
}

.welcome-line {
  margin: 0 0 2px;
  color: var(--gold);
  font-size: 0.92rem;
  font-weight: 750;
}

.chat-intro h1,
.page-heading h1 {
  margin: 0;
  color: var(--ink);
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1.18;
  text-wrap: balance;
}

.chat-intro h1 {
  font-size: 3.15rem;
}

.chat-intro > div:first-child > p:last-child {
  max-width: 52ch;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1rem;
  text-wrap: pretty;
}

.mascot-frame {
  width: 150px;
  aspect-ratio: 1.1;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-raised);
  box-shadow: 0 6px 8px oklch(0 0 0 / 0.24);
}

.mascot-frame img {
  width: 130%;
  height: 120%;
  object-fit: cover;
  object-position: 40% 39%;
  transform: translate(-3%, -2%);
}

.conversation {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 8px 0 28px;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 780px;
}

.message-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-raised);
  border: 1px solid oklch(0.81 0.16 82 / 0.55);
}

.message-avatar img {
  width: 132%;
  height: 115%;
  object-fit: cover;
  object-position: 40% 38%;
  transform: translate(-4%, -1%);
}

.message-content {
  min-width: 0;
  padding: 16px 18px;
  border-radius: var(--r-lg) var(--r-sm) var(--r-lg) var(--r-lg);
  background: var(--surface-raised);
  border: 1px solid var(--line-soft);
}

.message-content p {
  margin: 0;
  color: var(--ink);
  line-height: 1.85;
  white-space: pre-line;
  text-wrap: pretty;
}

.assistant-message.is-streaming .message-content > p::after {
  display: inline-block;
  width: 7px;
  height: 1.05em;
  margin-inline-start: 4px;
  border-radius: 2px;
  background: var(--gold);
  vertical-align: -0.16em;
  animation: stream-caret 720ms steps(2, end) infinite;
  content: "";
}

.assistant-message.is-waiting .message-content > p {
  color: var(--muted);
}

@keyframes stream-caret {
  50% { opacity: 0; }
}

.message-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.message-meta strong {
  font-size: 0.84rem;
}

.message-meta span {
  color: var(--faint);
  font-size: 0.7rem;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.inline-actions button {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--primary-bright);
  font-size: 0.76rem;
  font-weight: 720;
}

.inline-actions button:hover {
  border-color: var(--primary);
  background: var(--surface-active);
  color: var(--ink);
}

.user-message {
  align-self: flex-start;
  flex-direction: row-reverse;
  max-width: min(610px, 88%);
}

.user-message .message-content {
  border: 0;
  border-radius: var(--r-lg) var(--r-lg) var(--r-sm) var(--r-lg);
  background: var(--primary);
  color: var(--white-on-color);
}

.user-message .message-content p {
  color: var(--white-on-color);
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--surface-active);
  color: var(--ink);
  font-size: 0.83rem;
  font-weight: 800;
}

.suggestions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 2px;
  padding-inline-start: 56px;
}

.suggestions button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: oklch(0.14 0.015 275 / 0.78);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: right;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.suggestions button:hover {
  border-color: oklch(0.59 0.17 272 / 0.72);
  background: var(--surface-raised);
  color: var(--ink);
}

.suggestions svg {
  flex: 0 0 auto;
  color: var(--primary-bright);
}

.composer {
  position: sticky;
  bottom: 20px;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: min(900px, 100%);
  margin: auto auto 0;
  padding: 10px;
  border: 1px solid oklch(0.46 0.08 272 / 0.84);
  border-radius: var(--r-lg);
  background: oklch(0.135 0.018 275 / 0.96);
}

.composer:focus-within {
  border-color: var(--primary-bright);
}

.composer textarea {
  width: 100%;
  max-height: 132px;
  min-height: 44px;
  resize: none;
  padding: 10px 8px 8px;
  overflow-y: auto;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  line-height: 1.55;
}

.composer textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

.send-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg-deep);
  box-shadow: 0 6px 8px oklch(0 0 0 / 0.22);
  transition:
    transform var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out);
}

.send-button:hover {
  background: var(--gold-strong);
  transform: translateY(-2px);
}

.send-button:active {
  transform: translateY(0) scale(0.96);
}

.send-button svg {
  width: 20px;
  height: 20px;
  transform: rotate(180deg);
}

.match-rail {
  grid-area: rail;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100svh;
  padding: 40px 20px 24px;
  background: oklch(0.12 0.01 275 / 0.7);
  border-inline-end: 1px solid var(--line-soft);
  direction: rtl;
}

.rail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.rail-heading p {
  margin: 0 0 2px;
  color: var(--faint);
  font-size: 0.75rem;
}

.rail-heading h2 {
  margin: 0;
  font-size: 1.1rem;
}

.rail-heading svg {
  color: var(--primary-bright);
}

.mini-match {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: transparent;
  text-align: right;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out);
}

.rail-match-list {
  display: grid;
  gap: 14px;
  max-height: min(720px, calc(100vh - 300px));
  padding-inline-end: 4px;
  overflow-y: auto;
  scrollbar-color: var(--line) transparent;
}

.mini-match:hover {
  border-color: oklch(0.59 0.17 272 / 0.68);
  background: var(--surface);
}

.competition {
  color: var(--faint);
  font-size: 0.74rem;
}

.mini-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.mini-teams > span {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
}

.team-orb {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--white-on-color);
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-style: normal;
  overflow: hidden;
}

.team-orb img {
  width: 78%;
  height: 78%;
  object-fit: contain;
}

.team-orb.is-flag {
  background: var(--surface-raised);
  border: 1px solid var(--line-soft);
  font-size: 1.55rem;
  line-height: 1;
}

.team-orb.barca { background: oklch(0.44 0.15 275); }
.team-orb.real { background: oklch(0.37 0.045 265); color: var(--gold); }
.team-orb.city { background: oklch(0.67 0.11 230); color: var(--bg-deep); }
.team-orb.arsenal { background: oklch(0.52 0.2 25); }
.team-orb.paris { background: oklch(0.36 0.15 260); }
.team-orb.inter { background: oklch(0.29 0.12 255); }
.team-orb.tone-0 { background: oklch(0.44 0.15 275); }
.team-orb.tone-1 { background: oklch(0.67 0.11 230); color: var(--bg-deep); }
.team-orb.tone-2 { background: oklch(0.52 0.2 25); }
.team-orb.tone-3 { background: oklch(0.37 0.045 265); color: var(--gold); }

.team-names {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.78rem;
}

.team-names i {
  color: var(--faint);
  font-style: normal;
}

.analyze-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 720;
}

.analyze-link svg {
  width: 15px;
  height: 15px;
  transform: rotate(180deg);
}

.all-matches-link {
  min-height: 46px;
  margin-top: auto;
  border: 0;
  background: transparent;
  color: var(--primary-bright);
  font-size: 0.85rem;
  font-weight: 720;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 54px clamp(24px, 5vw, 72px) 32px;
}

.page-heading p {
  margin: 0 0 3px;
  color: var(--gold);
  font-size: 0.83rem;
  font-weight: 750;
}

.page-heading h1 {
  font-size: 2.45rem;
}

.date-switcher {
  display: flex;
  gap: 3px;
  padding: 4px;
  border-radius: var(--r-md);
  background: var(--surface);
}

.date-switcher button {
  min-width: 64px;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
}

.date-switcher button.is-active {
  background: var(--primary);
  color: var(--white-on-color);
}

.matches-list {
  display: grid;
  gap: 12px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 72px) 60px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 32px;
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  color: var(--muted);
  text-align: center;
}

.match-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(360px, 1.5fr) minmax(136px, 0.55fr);
  align-items: center;
  gap: 24px;
  padding: 22px 24px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.match-row.featured-match {
  border-color: oklch(0.59 0.17 272 / 0.65);
  background: var(--surface-raised);
}

.league-block {
  display: grid;
  gap: 1px;
}

.league-block span {
  font-weight: 750;
}

.league-block small,
.kickoff small {
  color: var(--faint);
  font-size: 0.74rem;
}

.match-clubs {
  display: grid;
  grid-template-columns: 1fr 90px 1fr;
  align-items: center;
  gap: 16px;
}

.match-clubs > div:not(.kickoff) {
  display: flex;
  align-items: center;
  gap: 10px;
}

.match-clubs > div:last-child {
  justify-content: flex-end;
}

.kickoff {
  display: grid;
  place-items: center;
}

.kickoff strong {
  font-size: 1.15rem;
}

.primary-action,
.secondary-action {
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-sm);
  font-size: 0.82rem;
  font-weight: 760;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.primary-action {
  border: 0;
  background: var(--gold);
  color: var(--bg-deep);
}

.primary-action:hover {
  background: var(--gold-strong);
  transform: translateY(-1px);
}

.secondary-action {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.secondary-action:hover {
  border-color: var(--primary);
  background: var(--surface-raised);
}

.count-badge {
  color: var(--muted);
  font-size: 0.84rem;
}

.count-badge b {
  color: var(--gold);
  font-size: 1rem;
}

.saved-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 72px) 60px;
}

.saved-prediction {
  padding: 24px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.saved-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--faint);
  font-size: 0.76rem;
}

.save-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
}

.save-toggle:hover,
.save-toggle.is-saved {
  border-color: var(--gold);
  color: var(--gold);
}

.save-toggle.is-saved svg {
  fill: currentColor;
}

.saved-prediction h2 {
  margin: 20px 0 16px;
  font-size: 1.18rem;
}

.prediction-score {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 16px 0;
  border-block: 1px solid var(--line-soft);
}

.prediction-score span,
.prediction-score em {
  color: var(--faint);
  font-size: 0.75rem;
  font-style: normal;
}

.prediction-score strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--gold);
  font-size: 2.1rem;
  line-height: 1;
  direction: ltr;
  unicode-bidi: isolate;
}

.micro-probabilities {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.72rem;
}

.text-action {
  margin-top: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary-bright);
  font-size: 0.82rem;
  font-weight: 750;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 72px) 60px;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-chip > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-active);
  font-weight: 800;
}

.profile-chip div {
  display: grid;
  line-height: 1.45;
}

.profile-chip small {
  color: var(--gold);
  font-size: 0.7rem;
}

.settings-section {
  padding: 24px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.settings-section h2 {
  margin: 0 0 16px;
  font-size: 1.08rem;
}

.setting-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
  cursor: pointer;
}

.setting-row > span {
  display: grid;
  gap: 2px;
}

.setting-row strong {
  font-size: 0.9rem;
}

.setting-row small {
  color: var(--muted);
  font-size: 0.75rem;
}

.setting-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.setting-row i {
  position: relative;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: oklch(0.32 0.025 275);
  transition: background var(--duration-fast) var(--ease-out);
}

.setting-row i::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform var(--duration-fast) var(--ease-out);
}

.setting-row input:checked + i {
  background: var(--primary);
}

.setting-row input:checked + i::after {
  transform: translateX(-20px);
}

.setting-row input:focus-visible + i {
  outline: 3px solid oklch(0.81 0.16 82 / 0.72);
  outline-offset: 3px;
}

.trust-note {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: var(--surface-raised);
  border-radius: var(--r-md);
}

.trust-note svg {
  flex: 0 0 auto;
  color: var(--gold);
}

.trust-note strong {
  font-size: 0.9rem;
}

.trust-note p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.75;
}

.wide {
  width: 100%;
  margin-top: 16px;
}

.typing-message .message-content {
  min-width: 70px;
  min-height: 48px;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 16px;
}

.typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing 1s infinite ease-in-out;
}

.typing-dots i:nth-child(2) { animation-delay: 120ms; }
.typing-dots i:nth-child(3) { animation-delay: 240ms; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.match-analysis {
  width: 100%;
  margin-top: 4px;
  padding: 22px;
  border: 1px solid oklch(0.59 0.17 272 / 0.6);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.analysis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.analysis-head span {
  color: var(--faint);
  font-size: 0.74rem;
}

.analysis-head h2 {
  margin: 2px 0 0;
  font-size: 1.3rem;
}

.analysis-head h2 b {
  color: var(--gold);
}

.analysis-topline {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 24px;
  align-items: center;
  padding: 22px 0;
}

.forecast-copy {
  display: grid;
  gap: 1px;
}

.forecast-copy span,
.forecast-copy em {
  color: var(--muted);
  font-size: 0.75rem;
  font-style: normal;
}

.forecast-copy strong {
  color: var(--gold);
  font-size: 2.5rem;
  line-height: 1.15;
  direction: ltr;
  unicode-bidi: isolate;
}

.probability-chart {
  display: grid;
  gap: 12px;
}

.probability-bar {
  display: flex;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-raised);
}

.probability-bar i { display: block; height: 100%; }
.p-barca { width: 38%; background: var(--primary); }
.p-draw { width: 29%; background: oklch(0.58 0.018 275); }
.p-real { width: 33%; background: var(--ink); }

.probability-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.72rem;
}

.probability-labels span {
  display: grid;
}

.probability-labels b {
  color: var(--ink);
  font-size: 1rem;
}

.analysis-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid var(--line-soft);
}

.analysis-strip > div {
  display: grid;
  gap: 2px;
  padding: 16px;
}

.analysis-strip > div + div {
  border-inline-start: 1px solid var(--line-soft);
}

.analysis-strip span,
.analysis-strip small {
  color: var(--faint);
  font-size: 0.7rem;
}

.analysis-strip strong {
  font-size: 0.86rem;
}

.advanced-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 0 2px;
}

.metric-card {
  position: relative;
  display: grid;
  gap: 3px;
  min-height: 104px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--surface-raised);
}

.metric-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--metric-color);
  content: "";
}

.metric-card span,
.metric-card small {
  color: var(--muted);
  font-size: 0.68rem;
}

.metric-card strong {
  align-self: center;
  color: var(--metric-color);
  font-size: 1.02rem;
  line-height: 1.35;
}

.metric-card.tone-gold { --metric-color: var(--gold); }
.metric-card.tone-blue { --metric-color: oklch(0.72 0.16 245); }
.metric-card.tone-violet { --metric-color: oklch(0.72 0.17 302); }
.metric-card.tone-mint { --metric-color: oklch(0.78 0.14 165); }

.reason-list {
  margin-top: 18px;
}

.reason-list h3 {
  margin: 0 0 8px;
  font-size: 0.96rem;
}

.reason-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 13px 2px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: transparent;
  text-align: right;
}

.reason-row span {
  display: grid;
}

.reason-row b {
  font-size: 0.82rem;
}

.reason-row small {
  color: var(--muted);
  font-size: 0.72rem;
}

.reason-row svg {
  width: 18px;
  height: 18px;
  transition: transform var(--duration-normal) var(--ease-out);
}

.reason-row[aria-expanded="true"] svg {
  transform: rotate(-90deg);
}

.reason-detail {
  max-height: 0;
  overflow: hidden;
  padding: 0 2px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.7;
  opacity: 0;
  transition:
    max-height var(--duration-normal) var(--ease-out),
    opacity var(--duration-normal) var(--ease-out),
    padding var(--duration-normal) var(--ease-out);
}

.reason-detail.is-open {
  max-height: 110px;
  padding: 0 2px 14px;
  opacity: 1;
}

.analysis-disclaimer {
  margin: 14px 0 0;
  color: var(--faint);
  font-size: 0.68rem;
}

.body-reduced-motion *,
.body-reduced-motion *::before,
.body-reduced-motion *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

@media (max-width: 1200px) {
  .chat-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "chat";
  }

  .match-rail {
    display: none;
  }

  .chat-panel {
    padding-inline: clamp(28px, 7vw, 86px);
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 216px;
  }

  .brand-avatar {
    width: 52px;
    height: 46px;
  }

  .brand-name {
    font-size: 1rem;
  }

  .match-row {
    grid-template-columns: 1fr auto;
  }

  .match-row .league-block {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  html,
  body {
    min-width: 0;
    width: 100%;
    overflow-x: hidden;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  .auth-stage {
    display: block;
  }

  .auth-story {
    display: grid;
    grid-template-columns: 1fr 118px;
    align-items: center;
    gap: 12px;
    min-height: 220px;
    padding: 22px 20px;
  }

  .auth-brand {
    grid-column: 1 / -1;
  }

  .auth-brand img {
    width: 48px;
    height: 42px;
  }

  .auth-mascot {
    grid-column: 2;
    grid-row: 2;
    width: 118px;
    margin: 0;
  }

  .auth-promise {
    grid-column: 1;
    grid-row: 2;
  }

  .auth-promise h1 {
    max-width: 14ch;
    font-size: 1.7rem;
  }

  .auth-promise p {
    font-size: 0.8rem;
  }

  .auth-features {
    display: none;
  }

  .auth-panel {
    min-height: calc(100svh - 220px);
    padding: 28px 20px max(34px, env(safe-area-inset-bottom));
  }

  .auth-heading h2 {
    font-size: 1.65rem;
  }

  .app-shell {
    display: block;
    padding-bottom: 76px;
  }

  .side-nav {
    display: none;
  }

  .workspace,
  .view {
    min-height: calc(100svh - 76px);
  }

  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    padding: 8px 16px;
    background: oklch(0.105 0 0 / 0.94);
    border-bottom: 1px solid var(--line-soft);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 850;
    text-decoration: none;
  }

  .mobile-brand img {
    width: 52px;
    height: 46px;
    object-fit: cover;
    object-position: 44% 39%;
    border-radius: 50%;
  }

  .icon-button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
  }

  .mobile-menu {
    position: fixed;
    top: 64px;
    left: 12px;
    z-index: 50;
    width: min(260px, calc(100vw - 24px));
    padding: 8px;
    border-radius: var(--r-md);
    background: var(--surface-raised);
    box-shadow: 0 6px 8px oklch(0 0 0 / 0.28);
  }

  .mobile-menu:not([hidden]) {
    display: grid;
  }

  .mobile-menu button {
    min-height: 46px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    text-align: right;
  }

  .mobile-menu button:hover {
    background: var(--surface-active);
  }

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    height: 76px;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
    background: oklch(0.115 0.018 274 / 0.98);
    border-top: 1px solid var(--line-soft);
    direction: rtl;
  }

  .bottom-nav button {
    position: relative;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0.68rem;
  }

  .bottom-nav button::before {
    content: "";
    position: absolute;
    top: 0;
    right: 22%;
    left: 22%;
    height: 2px;
    border-radius: 999px;
    background: transparent;
  }

  .bottom-nav button.is-active {
    color: var(--gold);
  }

  .bottom-nav button.is-active::before {
    background: var(--gold);
  }

  .bottom-nav svg {
    width: 21px;
    height: 21px;
  }

  .chat-panel {
    min-height: calc(100svh - 146px);
    padding: 24px 16px 12px;
  }

  .chat-intro {
    justify-content: space-between;
    gap: 16px;
    padding: 2px 4px 16px;
  }

  .chat-intro h1 {
    font-size: 2.25rem;
  }

  .chat-intro > div:first-child > p:last-child {
    display: none;
  }

  .mascot-frame {
    width: 96px;
  }

  .conversation {
    gap: 14px;
    padding: 2px 0 104px;
  }

  .suggestions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-inline-start: 0;
  }

  .suggestions button:last-child {
    display: none;
  }

  .composer {
    position: fixed;
    right: 16px;
    bottom: 84px;
    left: 16px;
    z-index: 44;
    width: auto;
    padding: 7px;
  }

  .page-heading {
    align-items: flex-start;
    padding: 28px 18px 22px;
  }

  .page-heading h1 {
    font-size: 2rem;
  }

  .matches-list,
  .saved-grid,
  .settings-layout {
    padding: 0 16px 30px;
  }

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

  .analysis-topline {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 15px;
  }

  .chat-intro h1 {
    font-size: 2rem;
  }

  .welcome-line {
    font-size: 0.78rem;
  }

  .mascot-frame {
    width: 84px;
  }

  .message-avatar {
    width: 38px;
    height: 38px;
  }

  .message-content {
    padding: 13px 14px;
  }

  .suggestions button {
    min-height: 64px;
    padding: 10px;
    font-size: 0.78rem;
  }

  .suggestions button svg {
    width: 19px;
    height: 19px;
  }

  .page-heading {
    display: grid;
  }

  .date-switcher {
    width: 100%;
  }

  .date-switcher button {
    flex: 1;
  }

  .match-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .match-row .league-block {
    grid-column: 1;
  }

  .match-clubs {
    grid-template-columns: 1fr 70px 1fr;
    gap: 8px;
  }

  .match-clubs > div:not(.kickoff) {
    flex-direction: column;
    text-align: center;
  }

  .match-clubs > div:last-child {
    justify-content: initial;
  }

  .match-row .primary-action,
  .match-row .secondary-action {
    width: 100%;
  }

  .analysis-head {
    align-items: flex-start;
  }

  .match-analysis {
    padding: 16px;
  }

  .analysis-strip {
    grid-template-columns: 1fr;
  }

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

  .analysis-strip > div + div {
    border-inline-start: 0;
    border-top: 1px solid var(--line-soft);
  }

  .probability-labels {
    font-size: 0.66rem;
  }

  .probability-labels b {
    font-size: 0.9rem;
  }

  .profile-chip div {
    display: none;
  }

  .auth-story {
    grid-template-columns: 1fr 92px;
    min-height: 190px;
    padding: 18px 16px;
  }

  .auth-mascot {
    width: 92px;
  }

  .auth-promise h1 {
    font-size: 1.45rem;
  }

  .auth-promise p {
    display: none;
  }

  .auth-panel {
    min-height: calc(100svh - 190px);
    padding: 24px 16px max(28px, env(safe-area-inset-bottom));
  }

  .auth-heading {
    margin-bottom: 18px;
  }

  .auth-heading > span:last-child {
    font-size: 0.78rem;
  }

  .auth-form {
    margin-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
