
:root {
  --ink-1: #0a0d13;
  --ink-2: #0c1018;
  --navy-1: #0e1522;
  --panel-hi: #131925;
  --brass-hi: #e3c58c;
  --brass-mid: #d9b06c;
  --brass-lo: #a8854a;
  --brass-deep: #4f4127;
  --brass-ink: #1a1409;
  --bone-dim: #c3cad6;
  --ash-hi: #a2adbc;
  --ash-lo: #566173;

  --brass-a06: rgba(201, 161, 92, 0.06);
  --brass-a10: rgba(201, 161, 92, 0.10);
  --brass-a16: rgba(201, 161, 92, 0.16);
  --brass-a28: rgba(201, 161, 92, 0.28);
  --brass-a45: rgba(201, 161, 92, 0.45);

  --mat-panel: linear-gradient(180deg, #121823 0%, #0f131b 100%);
  --mat-panel-2: linear-gradient(180deg, #1a212d 0%, #151a24 100%);
  --mat-well: linear-gradient(180deg, #080b10 0%, #0b0f16 100%);
  --mat-brass: linear-gradient(180deg, #dcbb7e 0%, #c9a15c 52%, #b48d4c 100%);
  --mat-brass-hover: linear-gradient(180deg, #e6c890 0%, #d3ac67 52%, #bd9653 100%);

  --edge-quiet: linear-gradient(160deg, #2e3746 0%, #1f2632 45%, #1c222d 70%, #2a3240 100%);
  --edge-lit: linear-gradient(160deg, rgba(201, 161, 92, 0.42) 0%, #2b3443 26%, #1f2632 62%, rgba(201, 161, 92, 0.18) 100%);
  --edge-hot: linear-gradient(160deg, rgba(227, 197, 140, 0.85) 0%, rgba(201, 161, 92, 0.38) 28%, rgba(46, 55, 70, 0.9) 64%, rgba(201, 161, 92, 0.5) 100%);

  --bevel: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  --bevel-brass: inset 0 1px 0 rgba(255, 246, 224, 0.5), inset 0 -1px 0 rgba(70, 48, 14, 0.4);
  --depth-1: 0 1px 0 rgba(0, 0, 0, 0.4), 0 8px 22px -14px rgba(0, 0, 0, 0.8);
  --depth-2: 0 24px 60px -24px rgba(0, 0, 0, 0.85), 0 2px 8px rgba(0, 0, 0, 0.35);

  --track-eyebrow: 0.16em;
  --num: "lnum" 1, "tnum" 1;

  --dir: 1;
}
[dir="rtl"] { --dir: -1; }

body {
  background-image:
    radial-gradient(110% 60% at 50% -14%, rgba(24, 36, 58, 0.62) 0%, rgba(12, 18, 29, 0.28) 45%, rgba(7, 9, 13, 0) 72%);
  background-repeat: no-repeat;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
  background: rgba(201, 161, 92, 0.3);
  color: var(--bone);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--brass-deep) transparent;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--brass-deep);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover { background: var(--brass-lo); }

.eyebrow {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ash);
}
:root[lang="ar"] .eyebrow,
:root[lang="ar"] .is-tracked,
:root[lang="aii"] .eyebrow,
:root[lang="aii"] .is-tracked {
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.78rem;
}

.word { display: inline-block; white-space: nowrap; }

.numeral {
  font-family: var(--font-display);
  font-feature-settings: var(--num);
  font-variant-numeric: lining-nums tabular-nums;
}

:root[lang="aii"] .numeral {
  direction: ltr;
  unicode-bidi: isolate;
}

.surface {
  background: var(--mat-panel) padding-box, var(--edge-quiet) border-box;
  border: 1px solid transparent;
  box-shadow: var(--bevel), var(--depth-1);
}
.edge-hot {
  position: relative;
}
.edge-hot::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--edge-hot);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out);
}

.search-button,
.update-check-button,
.agreement-accept {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--mat-brass);
  color: var(--brass-ink);
  border: none;
  font-weight: 650;
  letter-spacing: 0.015em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--bevel-brass), 0 6px 16px -8px rgba(0, 0, 0, 0.7);
  transition: transform var(--dur-press) var(--ease-out), box-shadow var(--dur-quick) var(--ease-out);
  touch-action: manipulation;
}
.search-button::before,
.update-check-button::before,
.agreement-accept::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--mat-brass-hover);
  opacity: 0;
  transition: opacity var(--dur-quick) var(--ease-out);
}
.search-button::after,
.update-check-button::after,
.agreement-accept::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 249, 234, 0.32) 48%, rgba(255, 249, 234, 0.08) 56%, transparent 70%);
  transform: translateX(-130%);
  pointer-events: none;
}
@media (hover: hover) {
  .search-button:hover::before,
  .update-check-button:hover::before,
  .agreement-accept:hover::before { opacity: 1; }
  .search-button:hover::after,
  .update-check-button:hover::after,
  .agreement-accept:hover::after {
    transform: translateX(130%);
    transition: transform 1.1s var(--ease-out);
  }
}
.search-button:active,
.update-check-button:active,
.agreement-accept:active {
  transform: scale(0.965);
  box-shadow: inset 0 1px 0 rgba(255, 246, 224, 0.3), inset 0 2px 6px rgba(70, 48, 14, 0.45);
}
.search-button:disabled,
.update-check-button:disabled {
  cursor: default;
  filter: saturate(0.4) brightness(0.7);
}

.arrow-glyph {
  display: inline-flex;
  transition: transform var(--dur-base) var(--ease-spring);
}
.arrow-glyph svg { display: block; }
[dir="rtl"] .arrow-glyph svg { transform: scaleX(-1); }
@media (hover: hover) {
  :hover > .arrow-glyph { transform: translateX(calc(3px * var(--dir))); }
}

.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: gm-fade var(--dur-base) var(--ease-out) 150ms backwards;
}
.skeleton-row {
  position: relative;
  overflow: hidden;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 12px;
}
.skeleton-row::before {
  content: '';
  flex: none;
  width: 16px;
  height: 9px;
  border-radius: 3px;
  background: var(--panel-2);
}
.skeleton-row span {
  height: 9px;
  border-radius: 3px;
  background: var(--panel-2);
}
.skeleton-row::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(201, 161, 92, 0.07) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: gm-sweep 1.6s var(--ease-in-out) infinite;
  animation-delay: var(--d, 0ms);
}
[dir="rtl"] .skeleton-row::after { animation-direction: reverse; }

.state-note {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 26px 12px 10px;
  text-align: center;
  color: var(--ash);
  font-size: 0.88rem;
  line-height: 1.55;
  animation: gm-rise var(--dur-slow) var(--ease-out) backwards;
}
.state-glyph {
  color: var(--brass-dim);
  display: flex;
}
.state-glyph svg { display: block; }
.state-glyph .draw {
  stroke-dasharray: var(--len, 60);
  stroke-dashoffset: var(--len, 60);
  animation: gm-draw 1.1s var(--ease-out) 120ms forwards;
}
