/* Shekar web client — design system v2.
   One stylesheet, no framework. Order: fonts, tokens, base, motion, shell,
   primitives, components, screens. Every colour is a token so light and dark
   stay in step; every motion respects prefers-reduced-motion. */

@font-face {
  font-family: Peyda;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/peyda-regular.woff2") format("woff2");
}
@font-face {
  font-family: Peyda;
  font-weight: 500 700;
  font-display: swap;
  src: url("fonts/peyda-semibold.woff2") format("woff2");
}
@font-face {
  font-family: Peyda;
  font-weight: 800 900;
  font-display: swap;
  src: url("fonts/peyda-extrabold.woff2") format("woff2");
}

/* ============================== tokens ============================== */

:root {
  color-scheme: light;

  --brand: #ee5a12;
  --brand-hi: #ff8a3d;
  --brand-lo: #d9480f;
  --brand-ink: #b93c07;
  --brand-soft: #fff1e7;
  --brand-tint: rgb(238 90 18 / 0.1);
  --on-brand: #fff;
  --brand-grad: linear-gradient(135deg, #ff8a3d 0%, #ee5a12 48%, #d9480f 100%);
  --flame: linear-gradient(120deg, #ff9f43 0%, #ff5a1f 45%, #f0285a 100%);

  --bg: #f2f3f5;
  --surface: #fff;
  --surface-2: #f7f8fa;
  --surface-3: #eceef2;
  --raised: #fff;
  --ink: #0c0e12;
  --ink-2: #393f4a;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: rgb(12 14 18 / 0.075);
  --line-strong: rgb(12 14 18 / 0.14);
  --glass: rgb(255 255 255 / 0.84);
  --glass-strong: rgb(255 255 255 / 0.88);

  --good: #0a9a64;
  --good-ink: #067a4f;
  --good-soft: #e6f6ee;
  --good-grad: linear-gradient(135deg, #16b981 0%, #079669 100%);
  --warn: #b25b05;
  --warn-soft: #fff4dc;
  --danger: #d92d20;
  --danger-soft: #fee9e7;
  --info: #2563eb;
  --info-soft: #e8efff;

  /* Hero panels stay dark in both themes: they carry the money numbers. */
  --hero-bg: radial-gradient(130% 120% at 100% 0%, #26303f 0%, #121722 52%, #0a0d13 100%);
  --hero-ink: #fff;
  --hero-muted: rgb(255 255 255 / 0.64);
  --hero-line: rgb(255 255 255 / 0.1);

  --scrim: rgb(8 10 14 / 0.46);
  --shadow-xs: 0 1px 2px rgb(16 24 40 / 0.05);
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 0.04), 0 2px 8px -2px rgb(16 24 40 / 0.06);
  --shadow-md: 0 2px 4px rgb(16 24 40 / 0.04), 0 12px 28px -8px rgb(16 24 40 / 0.14);
  --shadow-lg: 0 4px 8px rgb(16 24 40 / 0.04), 0 28px 60px -16px rgb(16 24 40 / 0.28);
  --shadow-brand: 0 10px 28px -8px rgb(238 90 18 / 0.55);
  --skeleton: #e8eaee;
  --skeleton-hi: #f5f6f8;

  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-2xl: 32px;
  --gutter: 16px;
  --topbar: 56px;
  --tabbar: 66px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0, 0.75, 0.2);
  --spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --font: Peyda, "Vazirmatn", Tahoma, system-ui, sans-serif;
}

@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, 0.006, 0.025 2.8%, 0.101 6.1%, 0.539 18.9%, 0.721 25.3%, 0.849 31.5%, 0.937 38.1%, 0.968 41.8%, 0.991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001 85.9%, 1);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --brand: #ff6a1f;
  --brand-hi: #ff9550;
  --brand-lo: #f0520a;
  --brand-ink: #ff9a5e;
  --brand-soft: rgb(255 106 31 / 0.14);
  --brand-tint: rgb(255 106 31 / 0.16);
  --on-brand: #fff;

  --bg: #07080a;
  --surface: #111317;
  --surface-2: #16191e;
  --surface-3: #1e2229;
  --raised: #181b21;
  --ink: #f3f4f6;
  --ink-2: #c8ccd3;
  --muted: #8b919c;
  --faint: #5d636e;
  --line: rgb(255 255 255 / 0.07);
  --line-strong: rgb(255 255 255 / 0.13);
  --glass: rgb(14 16 20 / 0.82);
  --glass-strong: rgb(22 25 30 / 0.9);

  --good: #2fd391;
  --good-ink: #4ade9f;
  --good-soft: rgb(47 211 145 / 0.12);
  --warn: #f5b84a;
  --warn-soft: rgb(245 184 74 / 0.12);
  --danger: #ff7b6e;
  --danger-soft: rgb(255 123 110 / 0.12);
  --info: #7aa2ff;
  --info-soft: rgb(122 162 255 / 0.12);

  --hero-bg: radial-gradient(130% 120% at 100% 0%, #222a37 0%, #12161f 50%, #0b0d12 100%);
  --hero-line: rgb(255 255 255 / 0.09);

  --scrim: rgb(0 0 0 / 0.62);
  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4), 0 0 0 1px rgb(255 255 255 / 0.02);
  --shadow-md: 0 12px 30px -10px rgb(0 0 0 / 0.7);
  --shadow-lg: 0 30px 70px -18px rgb(0 0 0 / 0.85);
  --shadow-brand: 0 10px 30px -8px rgb(255 106 31 / 0.5);
  --skeleton: #181b20;
  --skeleton-hi: #22262d;
}

/* ============================== base ============================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-padding-top: calc(var(--topbar) + 72px);
  background: var(--bg);
}

body {
  margin: 0;
  overflow-x: clip;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.7 var(--font);
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

::selection {
  background: color-mix(in srgb, var(--brand) 26%, transparent);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

.sep {
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
  vertical-align: 0.22em;
}

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

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon.fill {
  fill: currentColor;
  stroke: none;
}

.icon.flip,
.flip-x .icon {
  transform: scaleX(-1);
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

.small {
  font-size: 13px;
}

.tiny {
  font-size: 12px;
}

.strong {
  font-weight: 800;
}

/* Peyda's tabular figures drop the Persian thousands separator (U+066C),
   so numbers keep the default figures and only get isolated bidi. */
.num {
  unicode-bidi: isolate;
}

.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

.center {
  text-align: center;
}

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

.row.between {
  justify-content: space-between;
}

.row.wrap {
  flex-wrap: wrap;
}

.grow {
  flex: 1;
  min-width: 0;
}

.grid2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.stack.xs {
  gap: 4px;
}

.stack.sm {
  gap: 8px;
}

.stack.lg {
  gap: 20px;
}

.stack.xl {
  gap: 28px;
}

/* ============================== motion ============================== */

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
}

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

@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

@keyframes ping {
  0% {
    transform: scale(0.7);
    opacity: 0.75;
  }
  80%,
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

@keyframes sweep {
  to {
    transform: rotate(360deg);
  }
}

.enter > * {
  animation: rise 0.5s var(--ease) both;
}

.enter > :nth-child(2) {
  animation-delay: 0.04s;
}
.enter > :nth-child(3) {
  animation-delay: 0.08s;
}
.enter > :nth-child(4) {
  animation-delay: 0.12s;
}
.enter > :nth-child(5) {
  animation-delay: 0.16s;
}
.enter > :nth-child(6) {
  animation-delay: 0.2s;
}
.enter > :nth-child(n + 7) {
  animation-delay: 0.24s;
}

/* Page navigation uses the View Transitions API where it exists. */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.32s;
  animation-timing-function: var(--ease);
}

:root.vt-push::view-transition-old(root) {
  animation: vt-out-push 0.34s var(--ease) both;
}
:root.vt-push::view-transition-new(root) {
  animation: vt-in-push 0.34s var(--ease) both;
}
:root.vt-pop::view-transition-old(root) {
  animation: vt-out-pop 0.3s var(--ease) both;
}
:root.vt-pop::view-transition-new(root) {
  animation: vt-in-pop 0.3s var(--ease) both;
}
:root.vt-tab::view-transition-old(root) {
  animation: fade 0.18s ease reverse both;
}
:root.vt-tab::view-transition-new(root) {
  animation: vt-tab-in 0.28s var(--ease) both;
}

@keyframes vt-in-push {
  from {
    transform: translateX(-28%);
    opacity: 0;
  }
}
@keyframes vt-out-push {
  to {
    transform: translateX(10%);
    opacity: 0;
  }
}
@keyframes vt-in-pop {
  from {
    transform: translateX(10%);
    opacity: 0;
  }
}
@keyframes vt-out-pop {
  to {
    transform: translateX(-28%);
    opacity: 0;
  }
}
@keyframes vt-tab-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

::view-transition-group(hero) {
  animation-duration: 0.42s;
  animation-timing-function: var(--ease);
}
::view-transition-old(hero),
::view-transition-new(hero) {
  height: 100%;
  object-fit: cover;
  overflow: clip;
}
::view-transition-group(chrome) {
  z-index: 50;
}

/* Theme switch reveals the new palette from the tap point. */
:root.vt-theme::view-transition-old(root) {
  animation: none;
  z-index: 0;
}
:root.vt-theme::view-transition-new(root) {
  animation: theme-reveal 0.6s var(--ease) both;
  z-index: 1;
}
@keyframes theme-reveal {
  from {
    clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0%));
  }
  to {
    clip-path: circle(150vmax at var(--vt-x, 50%) var(--vt-y, 0%));
  }
}

/* ============================== shell ============================== */

.shell {
  min-height: 100dvh;
}

main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  height: calc(var(--topbar) + var(--safe-t));
  padding: var(--safe-t) 6px 0;
  background: transparent;
  transition: background-color 0.25s ease, box-shadow 0.25s ease, -webkit-backdrop-filter 0.25s, backdrop-filter 0.25s;
  view-transition-name: chrome;
}

.topbar.scrolled,
.topbar.solid {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.8) blur(20px);
  backdrop-filter: saturate(1.8) blur(20px);
  box-shadow: 0 1px 0 var(--line);
}

.topbar .title {
  flex: 1;
  min-width: 0;
  padding-inline: 6px;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.35s var(--ease);
}

.topbar.scrolled .title,
.topbar.solid .title {
  opacity: 1;
  transform: none;
}

.topbar .actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.topbar .wordmark {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-inline: 8px 4px;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.2px;
}

@media (max-width: 959px) {
  .topbar .wordmark ~ .title {
    visibility: hidden;
  }
}

.topbar.overlay {
  position: fixed;
  inset-inline: 0;
}

@media (min-width: 960px) {
  .topbar.overlay {
    position: sticky;
  }
}

.topbar.overlay:not(.scrolled) {
  background: linear-gradient(to bottom, rgb(0 0 0 / 0.45), transparent);
  color: #fff;
}

.topbar.overlay:not(.scrolled) .icon-btn {
  background: rgb(10 12 16 / 0.42);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.16);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: #fff;
}

.mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 10px;
  background: var(--brand-grad);
  color: #fff;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25), 0 4px 12px -4px rgb(238 90 18 / 0.6);
}

.mark svg {
  width: 21px;
  height: 21px;
}

.mark.lg {
  width: 56px;
  height: 56px;
  border-radius: 18px;
}

.mark.lg svg {
  width: 36px;
  height: 36px;
}

.view {
  padding-bottom: calc(var(--tabbar) + 36px + var(--safe-b));
}

.page {
  width: min(100%, 780px);
  margin-inline: auto;
  padding: 8px var(--gutter) 16px;
}

.page.wide {
  width: min(100%, 1400px);
}

.page.mid {
  width: min(100%, 1120px);
}

/* Large title block under the bar on every tab root. */
.screen-head {
  display: grid;
  gap: 4px;
  padding: 4px var(--gutter) 14px;
  width: min(100%, 780px);
  margin-inline: auto;
}

.screen-head.wide {
  width: min(100%, 1400px);
}

.screen-head h1 {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: -0.4px;
}

.screen-head .lead {
  color: var(--muted);
  font-size: 14px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

/* Mobile tab bar: a floating glass capsule with a sliding indicator. */
.tabbar {
  position: fixed;
  inset-inline: 12px;
  bottom: calc(10px + var(--safe-b));
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: var(--tabbar);
  padding: 6px;
  border-radius: 24px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: saturate(1.8) blur(24px);
  backdrop-filter: saturate(1.8) blur(24px);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line);
  view-transition-name: tabbar;
}

.tabbar .indicator {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 0;
  border-radius: 18px;
  background: var(--brand-tint);
  transition: left 0.45s var(--spring), width 0.45s var(--spring), opacity 0.2s;
  pointer-events: none;
}

.tabbar a {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  border-radius: 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  transition: color 0.2s, transform 0.2s var(--ease);
}

.tabbar a:active {
  transform: scale(0.92);
}

.tabbar a .icon {
  width: 23px;
  height: 23px;
  transition: transform 0.35s var(--spring);
}

.tabbar a[aria-current="page"] {
  color: var(--brand-ink);
}

:root[data-theme="dark"] .tabbar a[aria-current="page"] {
  color: var(--brand-hi);
}

.tabbar a[aria-current="page"] .icon {
  stroke-width: 2.2;
  transform: translateY(-1px);
}

.tabbar a[aria-disabled="true"] {
  opacity: 0.35;
}

.rail {
  display: none;
}

@media (min-width: 960px) {
  .shell {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
  }

  .rail {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: 100dvh;
    padding: 18px 14px 16px;
    border-inline-end: 1px solid var(--line);
    background: var(--surface-2);
  }

  :root[data-theme="dark"] .rail {
    background: #0c0d10;
  }

  .rail .brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 8px 22px;
    font-size: 19px;
    font-weight: 900;
    line-height: 1.3;
  }

  .rail .brand small {
    display: block;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
  }

  .rail .nav-label {
    padding: 10px 12px 6px;
    color: var(--faint);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2px;
  }

  .rail a.nav {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    color: var(--ink-2);
    font-size: 14.5px;
    font-weight: 700;
    transition: background 0.2s, color 0.2s;
  }

  .rail a.nav small {
    margin-inline-start: auto;
    color: var(--faint);
    font-size: 11px;
    font-weight: 600;
  }

  .rail a.nav:hover {
    background: var(--surface-3);
    color: var(--ink);
  }

  .rail a.nav[aria-current="page"] {
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
  }

  .rail a.nav[aria-current="page"] .icon {
    color: var(--brand);
  }

  .rail a.nav[aria-current="page"]::before {
    content: "";
    position: absolute;
    inset-inline-start: -14px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: var(--brand);
  }

  .rail a.nav[aria-disabled="true"] {
    opacity: 0.4;
  }

  .rail .rail-foot {
    display: grid;
    gap: 10px;
    margin-top: auto;
  }

  .rail .me {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
    font-size: 13px;
  }

  .tabbar {
    display: none;
  }

  .view {
    padding-bottom: 48px;
  }

  .topbar .menu-only {
    display: none;
  }

  .screen-head {
    padding-top: 18px;
  }

  .screen-head h1 {
    font-size: 36px;
  }
}

/* ============================== buttons ============================== */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--surface-3);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 0.2s, box-shadow 0.2s, color 0.2s, transform 0.18s var(--ease), opacity 0.2s;
}

.btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--surface-3) 80%, var(--ink) 6%);
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn .icon {
  width: 19px;
  height: 19px;
}

.btn.primary {
  background: var(--brand-grad);
  color: var(--on-brand);
  box-shadow: var(--shadow-brand), inset 0 1px 0 rgb(255 255 255 / 0.22);
  text-shadow: 0 1px 1px rgb(120 30 0 / 0.18);
}

.btn.primary:hover:not(:disabled) {
  background: var(--brand-grad);
  filter: brightness(1.05) saturate(1.05);
}

.btn.dark {
  background: var(--ink);
  color: var(--bg);
}

.btn.dark:hover:not(:disabled) {
  background: var(--ink);
  opacity: 0.9;
}

.btn.tonal {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.btn.tonal:hover:not(:disabled) {
  background: color-mix(in srgb, var(--brand-soft) 80%, var(--brand) 10%);
}

.btn.outline {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.btn.outline:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn.ghost {
  background: transparent;
}

.btn.ghost:hover:not(:disabled) {
  background: var(--surface-3);
}

.btn.glass {
  background: rgb(255 255 255 / 0.12);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14);
}

.btn.glass:hover:not(:disabled) {
  background: rgb(255 255 255 / 0.2);
}

.btn.block {
  display: flex;
  width: 100%;
}

.btn.lg {
  min-height: 56px;
  font-size: 15.5px;
  border-radius: 18px;
}

.btn.sm {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 13px;
}

.btn.xs {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12.5px;
}

.btn.danger {
  color: var(--danger);
}

.btn .spinner {
  width: 18px;
  height: 18px;
  border-width: 2.2px;
}

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  transition: background-color 0.2s, transform 0.18s var(--ease), color 0.2s;
}

.icon-btn:hover {
  background: var(--surface-3);
}

.icon-btn:active {
  transform: scale(0.9);
}

.icon-btn.soft {
  background: var(--surface);
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--line);
}

.icon-btn.sm {
  width: 34px;
  height: 34px;
}

.icon-btn .dot {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 2px var(--bg);
}

/* ============================== chips ============================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 0.2s, box-shadow 0.2s, color 0.2s, transform 0.18s var(--ease);
}

.chip:hover:not(:disabled) {
  background: var(--surface-2);
}

.chip:active:not(:disabled) {
  transform: scale(0.95);
}

.chip:disabled {
  opacity: 0.55;
  cursor: default;
}

.chip .icon {
  width: 17px;
  height: 17px;
}

.chip[aria-pressed="true"],
.chip.on {
  background: var(--ink);
  box-shadow: none;
  color: var(--bg);
}

.chip.brand[aria-pressed="true"],
.chip.brand.on {
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--brand) 60%, transparent);
  color: var(--brand-ink);
}

.chip .count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.chip .x {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-inline-end: -4px;
  border-radius: 50%;
  background: rgb(127 127 127 / 0.2);
}

.chip .x .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.6;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips.scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1);
  padding: 2px var(--gutter);
  scroll-padding-inline: var(--gutter);
  -webkit-mask: linear-gradient(to left, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
  mask: linear-gradient(to left, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
}

.chips.scroll::-webkit-scrollbar {
  display: none;
}

.chip-divider {
  flex: none;
  width: 1px;
  margin: 8px 2px;
  background: var(--line-strong);
}

/* ============================== fields ============================== */

.field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  min-width: 0;
}

.field > span:first-child,
.label {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}

.field small {
  color: var(--muted);
  font-size: 12px;
}

.field small.err {
  color: var(--danger);
}

.input {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 52px;
  padding: 0 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: box-shadow 0.2s, background-color 0.2s;
}

.input:hover {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 24%, transparent);
}

.input:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--brand), 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}

.input.err {
  box-shadow: inset 0 0 0 1.5px var(--danger), 0 0 0 4px color-mix(in srgb, var(--danger) 12%, transparent);
}

.input input,
.input select {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 50px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15.5px;
  font-weight: 600;
}

.input input::placeholder {
  color: var(--faint);
  font-weight: 500;
}

.input input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

.input .unit {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.input > .icon {
  color: var(--muted);
}

.input.search {
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
}

.input.search:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--brand), 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent);
}

.input.lg {
  min-height: 58px;
  border-radius: 18px;
}

.input .clear {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
}

.input .clear .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

.input kbd {
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--surface-3);
  box-shadow: inset 0 -1px 0 var(--line-strong);
  color: var(--muted);
  font: 700 11px/1.6 var(--font);
}

@media (hover: none) {
  .input kbd {
    display: none;
  }
}

.select-btn {
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 8px 16px;
  white-space: normal;
  text-align: start;
  line-height: 1.5;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: 15px;
  font-weight: 700;
}

.select-btn:hover:not(:disabled) {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 24%, transparent);
}

.select-btn .icon:last-child {
  color: var(--muted);
}

.select-btn .ph {
  color: var(--faint);
  font-weight: 500;
}

.select-btn.err {
  box-shadow: inset 0 0 0 1.5px var(--danger), 0 0 0 4px color-mix(in srgb, var(--danger) 12%, transparent);
}

.swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.14), inset 0 -3px 6px rgb(0 0 0 / 0.14), inset 0 3px 5px rgb(255 255 255 / 0.25);
}

/* Segmented control with a sliding thumb (the thumb is CSS-only). */
.seg {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface-3);
}

.seg button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  min-height: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  transition: background-color 0.25s var(--ease), color 0.2s, box-shadow 0.25s;
}

.seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

:root[data-theme="dark"] .seg button[aria-pressed="true"] {
  background: #2a2f37;
}

.seg.bad button[aria-pressed="true"]:last-child {
  color: var(--danger);
}

.seg button .icon {
  width: 17px;
  height: 17px;
}

.rail .seg button {
  min-height: 36px;
  padding: 0 4px;
  font-size: 12px;
}

.switch {
  position: relative;
  width: 50px;
  height: 30px;
  flex: none;
  margin: 0;
  appearance: none;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background-color 0.25s;
  cursor: pointer;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.2);
  transition: transform 0.4s var(--spring);
}

.switch:checked {
  background: var(--good);
}

.switch:checked::after {
  transform: translateX(-20px);
}

.range {
  width: 100%;
  height: 28px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
  --p: 50%;
}

.range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to left, var(--brand) var(--p), var(--surface-3) var(--p));
}

.range::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
}

.range::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--brand);
}

.range::-webkit-slider-thumb {
  width: 26px;
  height: 26px;
  margin-top: -10px;
  appearance: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06), 0 3px 10px rgb(0 0 0 / 0.22);
}

.range::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06), 0 3px 10px rgb(0 0 0 / 0.22);
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.check input,
.cb {
  width: 20px;
  height: 20px;
  flex: none;
  margin: 0;
  accent-color: var(--brand);
}

/* ============================== surfaces ============================== */

.card {
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
}

.card.pad {
  padding: 18px;
}

.card.flat {
  box-shadow: inset 0 0 0 1px var(--line);
}

.card.hover {
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}

.card.hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--line);
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.section-title h2,
.section-title h3 {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.5;
}

.section-title p {
  color: var(--muted);
  font-size: 13px;
}

.section-title .link {
  color: var(--brand-ink);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-head .glyph {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--ink-2);
}

.card-head .glyph.brand {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.card-head .glyph.good {
  background: var(--good-soft);
  color: var(--good-ink);
}

.card-head h3 {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.45;
}

.card-head p {
  color: var(--muted);
  font-size: 12.5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

.badge.brand {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.badge.ok {
  background: var(--good-soft);
  color: var(--good-ink);
}

.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge.bad {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.info {
  background: var(--info-soft);
  color: var(--info);
}

.badge.dark {
  background: var(--ink);
  color: var(--bg);
}

.badge.live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.6s ease-in-out infinite;
}

@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.85;
}

.banner > .icon {
  margin-top: 3px;
}

.banner b {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.banner.warn {
  background: var(--warn-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 24%, transparent);
  color: color-mix(in srgb, var(--warn) 80%, var(--ink));
}

.banner.warn > .icon,
.banner.warn b {
  color: var(--warn);
}

.banner.bad {
  background: var(--danger-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 24%, transparent);
  color: color-mix(in srgb, var(--danger) 80%, var(--ink));
}

.banner.bad > .icon,
.banner.bad b {
  color: var(--danger);
}

.banner.ok {
  background: var(--good-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 24%, transparent);
}

.banner.ok > .icon,
.banner.ok b {
  color: var(--good-ink);
}

.banner.info > .icon {
  color: var(--info);
}

.banner .grow {
  flex: 1;
}

/* Empty states: a glyph inside soft concentric rings. */
.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 44px 20px 52px;
  text-align: center;
  animation: rise 0.5s var(--ease) both;
}

.empty .glyph {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 14px;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--line);
  color: var(--brand);
}

.empty .glyph::before,
.empty .glyph::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 40px;
  border: 1px solid var(--line-strong);
  opacity: 0.6;
}

.empty .glyph::after {
  inset: -38px;
  border-radius: 56px;
  opacity: 0.3;
}

.empty .glyph .icon {
  width: 32px;
  height: 32px;
  stroke-width: 1.7;
}

.empty h3 {
  margin-top: 12px;
  font-size: 18px;
  font-weight: 900;
}

.empty p {
  max-width: 340px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
}

.empty .btn {
  margin-top: 8px;
}

.list {
  display: grid;
}

.list > * + * {
  box-shadow: inset 0 1px 0 var(--line);
}

.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  text-align: start;
  transition: background-color 0.15s;
}

button.list-row:hover:not(:disabled),
a.list-row:hover {
  background: var(--surface-2);
}

.list-row:first-child {
  border-start-start-radius: inherit;
  border-start-end-radius: inherit;
}

.list-row:last-child {
  border-end-start-radius: inherit;
  border-end-end-radius: inherit;
}

.list-row .grow {
  flex: 1;
  min-width: 0;
}

.list-row .title {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.6;
}

.list-row .sub {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
}

.list-row > .icon:last-child {
  color: var(--faint);
}

.lead-ic {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 11px;
  background: var(--surface-3);
  color: var(--ink-2);
}

.lead-ic .icon {
  width: 19px;
  height: 19px;
}

.lead-ic.brand {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.lead-ic.good {
  background: var(--good-soft);
  color: var(--good-ink);
}

.lead-ic.bad {
  background: var(--danger-soft);
  color: var(--danger);
}

.lead-ic.info {
  background: var(--info-soft);
  color: var(--info);
}

.kv {
  display: grid;
}

.kv > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  font-size: 14px;
}

.kv > div + div {
  box-shadow: inset 0 1px 0 var(--line);
}

.kv .k {
  color: var(--muted);
}

.kv .v {
  font-weight: 800;
  text-align: end;
}

/* ============================== skeleton & spinner ============================== */

.sk {
  border-radius: 10px;
  background: linear-gradient(90deg, var(--skeleton) 25%, var(--skeleton-hi) 37%, var(--skeleton) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.spinner {
  width: 24px;
  height: 24px;
  flex: none;
  border: 2.5px solid color-mix(in srgb, currentColor 18%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.progress {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 60;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
}

.progress::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: 3px;
  background: var(--brand-grad);
  animation: bar 1.1s var(--ease) infinite;
}

@keyframes bar {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(-250%);
  }
}

.boot {
  display: grid;
  place-items: center;
  min-height: 60dvh;
  color: var(--brand);
}

.boot .mark {
  animation: breathe 1.6s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    transform: scale(0.92);
    opacity: 0.75;
  }
}

/* ============================== feed ============================== */

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 30px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  background: var(--good-soft);
  color: var(--good-ink);
  font-size: 12.5px;
  font-weight: 800;
}

.live-pill .dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.live-pill .dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: currentColor;
  animation: ping 1.8s var(--ease) infinite;
}

.live-pill.off {
  background: var(--surface-3);
  color: var(--muted);
}

.live-pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.live-pill.off .dot::after,
.live-pill.warn .dot::after {
  animation: none;
}

.live-pill .when {
  color: color-mix(in srgb, currentColor 70%, transparent);
  font-weight: 600;
}

.feed-hero {
  display: grid;
  gap: 16px;
  width: min(100%, 1400px);
  margin-inline: auto;
  padding: 0 var(--gutter) 6px;
}

.feed-hero .title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.feed-hero h1 {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.4px;
}

.feed-hero .lead {
  color: var(--muted);
  font-size: 14px;
}

.feed-hero .lead b {
  color: var(--ink);
  font-weight: 900;
}

.pulse-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pulse-stat {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--line);
}

.pulse-stat .v {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pulse-stat .k {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pulse-stat.accent .v {
  background: var(--flame);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (min-width: 960px) {
  .feed-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
    align-items: end;
    padding-top: 18px;
  }

  .feed-hero h1 {
    font-size: 36px;
  }

  .feed-hero .search-wrap {
    grid-column: 1 / -1;
  }
}

.toolbar {
  position: sticky;
  top: calc(var(--topbar) + var(--safe-t));
  z-index: 15;
  padding: 10px 0;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  box-shadow: 0 1px 0 transparent;
  transition: box-shadow 0.25s;
}

.toolbar.stuck {
  box-shadow: 0 1px 0 var(--line);
}

.toolbar .inner {
  width: min(100%, 1400px);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.toolbar .chips.scroll {
  margin: 0 calc(var(--gutter) * -1);
}

.result-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: min(100%, 1400px);
  min-height: 34px;
  margin-inline: auto;
  padding: 6px var(--gutter) 4px;
  color: var(--muted);
  font-size: 13px;
}

.result-line b {
  color: var(--ink);
  font-weight: 900;
}

/* ---------- deal tiers ---------- */

.tier {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px 0 9px;
  border-radius: 999px;
  background: var(--good-soft);
  color: var(--good-ink);
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
}

.tier .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.6;
}

.tier.t-great {
  background: var(--good-grad);
  color: #fff;
  box-shadow: 0 4px 12px -4px rgb(10 154 100 / 0.55);
}

.tier.t-gold {
  background: var(--flame);
  color: #fff;
  box-shadow: 0 4px 14px -4px rgb(240 60 40 / 0.6);
}

.tier.t-none {
  background: var(--surface-3);
  color: var(--muted);
}

/* ---------- deal card ---------- */

.deals {
  display: grid;
  gap: 10px;
  width: min(100%, 1400px);
  margin-inline: auto;
  padding: 4px var(--gutter) 0;
}

.deal {
  position: relative;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--line);
  content-visibility: auto;
  contain-intrinsic-size: auto 150px;
  cursor: pointer;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), background-color 0.2s;
  -webkit-user-select: none;
  user-select: none;
}

.deal:hover {
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--line);
}

.deal:active {
  transform: scale(0.985);
}

.deal.fresh {
  animation: fresh 0.9s var(--ease);
}

@keyframes fresh {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    box-shadow: 0 0 0 2px var(--brand), var(--shadow-md);
  }
  60% {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 50%, transparent), var(--shadow-md);
  }
}

.deal-media {
  position: relative;
  align-self: start;
  width: 118px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 14px;
  background: var(--surface-3);
  isolation: isolate;
}

.deal-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.35s ease, transform 0.6s var(--ease);
}

.deal-media img.ok {
  opacity: 1;
  transform: none;
}

.deal:hover .deal-media img.ok {
  transform: scale(1.04);
}

.deal-media .ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--faint);
}

.deal-media .ph .icon {
  width: 30px;
  height: 30px;
  stroke-width: 1.5;
}

.deal-media .media-tier {
  display: none;
}

.src {
  position: absolute;
  bottom: 6px;
  inset-inline-start: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgb(10 12 16 / 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
}

.src::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff4b4b;
}

.src.sheypoor::before {
  background: #3aa7ff;
}

.sold {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgb(10 12 14 / 0.62);
  -webkit-backdrop-filter: grayscale(1);
  backdrop-filter: grayscale(1);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.deal-body {
  display: grid;
  align-content: start;
  gap: 2px;
  min-width: 0;
}

.deal-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deal-meta {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deal-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin-top: 2px;
}

.deal-price .amount {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.deal-price .p {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: -0.3px;
}

.deal-price .u {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.deal-price .mv {
  color: var(--faint);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: color-mix(in srgb, var(--danger) 60%, transparent);
  white-space: nowrap;
}

.deal-save {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 3px;
}

.deal-save .saving {
  color: var(--good-ink);
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
}

.deal-foot {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}

.deal-foot .icon {
  width: 14px;
  height: 14px;
}

/* Grid layout: tall cards with a hero photo. */
.deals.is-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: 14px;
}

.deals.is-grid .deal {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
  contain-intrinsic-size: auto 360px;
}

.deals.is-grid .deal:hover {
  transform: translateY(-3px);
}

.deals.is-grid .deal:active {
  transform: scale(0.985);
}

.deals.is-grid .deal-media {
  width: 100%;
  aspect-ratio: 16 / 10.5;
  border-radius: 0;
}

.deals.is-grid .deal-media:has(img.ok)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgb(0 0 0 / 0.42), transparent 42%);
  pointer-events: none;
}

.deals.is-grid .deal-media .media-tier {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  z-index: 2;
  display: inline-flex;
}

.deals.is-grid .deal-media .media-tier.t-good,
.deals.is-grid .deal-media .media-tier.t-none {
  background: rgb(255 255 255 / 0.92);
  color: var(--good-ink);
}

:root[data-theme="dark"] .deals.is-grid .deal-media .media-tier.t-good,
:root[data-theme="dark"] .mini-deals .deal-media .media-tier.t-good {
  background: rgb(10 30 22 / 0.86);
  color: var(--good-ink);
}

.deals.is-grid .src {
  bottom: 10px;
  inset-inline-start: 10px;
  min-height: 22px;
  font-size: 11px;
}

.deals.is-grid .deal-body {
  gap: 2px;
  padding: 12px 14px 14px;
}

.deals.is-grid .deal-save .tier {
  display: none;
}

.deals.is-grid .deal-price .p {
  font-size: 24px;
}

@media (min-width: 720px) {
  .deals {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
    gap: 12px;
  }
}

.deals .span-all {
  grid-column: 1 / -1;
}

/* Pull-to-refresh indicator. */
.ptr {
  position: fixed;
  top: calc(var(--topbar) + var(--safe-t) + 6px);
  left: 50%;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--line);
  color: var(--brand);
  opacity: 0;
  transform: translateY(-60px);
  pointer-events: none;
}

.ptr .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.4;
}

.ptr.ready .icon {
  color: var(--good);
}

.ptr.loading .icon {
  animation: spin 0.7s linear infinite;
}

.jump {
  position: fixed;
  left: 50%;
  top: calc(var(--topbar) + var(--safe-t) + 66px);
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translate(-50%, -14px) scale(0.92);
  pointer-events: none;
  transition: opacity 0.22s, transform 0.4s var(--spring);
}

.jump .icon {
  width: 17px;
  height: 17px;
  stroke-width: 2.4;
}

.jump.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
}

.jump.brand {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: var(--shadow-brand);
}

@media (min-width: 960px) {
  .jump,
  .ptr {
    left: calc(50% + 126px);
  }
}

.footer-note {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 28px var(--gutter);
  color: var(--faint);
  font-size: 12.5px;
  text-align: center;
}

.footer-note .end-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 360px);
}

.footer-note .end-mark::before,
.footer-note .end-mark::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}

/* ============================== sheet (dialog) ============================== */

dialog.sheet {
  width: 100%;
  max-width: 580px;
  max-height: min(92dvh, 880px);
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  overscroll-behavior: contain;
}

dialog.sheet[open] {
  display: flex;
  flex-direction: column;
  animation: sheet-in 0.45s var(--ease);
}

dialog.sheet.closing {
  animation: sheet-out 0.24s var(--ease-in) forwards;
}

dialog.sheet.dragging {
  transition: none;
  animation: none;
}

dialog.sheet.settle {
  transition: transform 0.35s var(--ease);
}

dialog.sheet::backdrop {
  background: var(--scrim);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade 0.3s ease;
}

dialog.sheet.closing::backdrop {
  animation: fade 0.24s ease reverse forwards;
}

@keyframes sheet-in {
  from {
    transform: translateY(100%);
  }
}

@keyframes sheet-out {
  to {
    transform: translateY(100%);
  }
}

@media (min-width: 720px) {
  dialog.sheet {
    margin: auto;
    border-radius: var(--r-2xl);
  }

  dialog.sheet[open] {
    animation: modal-in 0.38s var(--ease);
  }

  dialog.sheet.closing {
    animation: modal-out 0.2s ease-in forwards;
  }

  @keyframes modal-in {
    from {
      opacity: 0;
      transform: translateY(16px) scale(0.97);
    }
  }

  @keyframes modal-out {
    to {
      opacity: 0;
      transform: translateY(10px) scale(0.98);
    }
  }

  .sheet-grip {
    display: none;
  }
}

.sheet-grip {
  display: grid;
  place-items: center;
  height: 22px;
  flex: none;
  cursor: grab;
  touch-action: none;
}

.sheet-grip::before {
  content: "";
  width: 40px;
  height: 5px;
  border-radius: 999px;
  background: var(--line-strong);
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 2px 12px 12px 12px;
  padding-inline-start: 22px;
  touch-action: none;
}

@media (min-width: 720px) {
  .sheet-head {
    padding-top: 16px;
  }
}

.sheet-head h2 {
  font-size: 19px;
  font-weight: 900;
  line-height: 1.5;
}

.sheet-head p {
  color: var(--muted);
  font-size: 13px;
}

.sheet-head .icon-btn {
  background: var(--surface-3);
  width: 36px;
  height: 36px;
  margin-top: 2px;
}

.sheet-head .icon-btn .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  overscroll-behavior: contain;
  padding: 4px 22px 22px;
}

.sheet-foot {
  display: flex;
  gap: 10px;
  padding: 12px 22px calc(14px + var(--safe-b));
  background: var(--surface);
  box-shadow: 0 -1px 0 var(--line);
}

.sheet-foot .btn {
  flex: 1;
}

.sheet-foot .btn.ghost {
  flex: 0 1 auto;
}

.options {
  display: grid;
  gap: 6px;
}

.options.grid {
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}

.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14.5px;
  font-weight: 700;
  text-align: start;
  transition: background-color 0.18s, box-shadow 0.18s, transform 0.15s var(--ease);
}

.opt:active {
  transform: scale(0.98);
}

.options.grid .opt {
  justify-content: center;
  padding: 0 8px;
  min-height: 50px;
}

.opt:hover {
  background: var(--surface-3);
}

.opt[aria-selected="true"] {
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1.5px var(--brand);
  color: var(--brand-ink);
}

.opt > .icon:last-child {
  color: inherit;
}

.opt small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.opt .swatch {
  width: 22px;
  height: 22px;
}

.options.swatches {
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.options.swatches .opt {
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 86px;
  padding: 10px 6px;
  font-size: 13px;
  text-align: center;
}

.options.swatches .opt .swatch {
  width: 34px;
  height: 34px;
}

/* ============================== toast ============================== */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar) + 22px + var(--safe-b));
  z-index: 80;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(92vw, 460px);
  transform: translateX(-50%);
  pointer-events: none;
}

.is-stacked .toasts {
  bottom: calc(96px + var(--safe-b));
}

@media (min-width: 960px) {
  .toasts,
  .is-stacked .toasts {
    left: calc(50% + 126px);
    bottom: 28px;
  }
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  min-height: 48px;
  padding: 8px 18px 8px 10px;
  padding-inline-start: 12px;
  border-radius: 999px;
  background: rgb(18 20 26 / 0.92);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgb(255 255 255 / 0.08);
  pointer-events: auto;
  animation: toast-in 0.5s var(--spring);
  touch-action: pan-y;
}

:root[data-theme="dark"] .toast {
  background: rgb(44 48 56 / 0.92);
}

.toast .t-ic {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.12);
}

.toast .t-ic .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.4;
}

.toast.ok .t-ic {
  background: var(--good);
  color: #fff;
}

.toast.bad .t-ic {
  background: #ef4444;
  color: #fff;
}

.toast .grow {
  flex: 1;
  line-height: 1.6;
}

.toast button {
  margin-inline-start: 6px;
  padding: 6px 2px;
  border: 0;
  background: transparent;
  color: #ffa66e;
  font-weight: 900;
}

.toast.out {
  animation: toast-out 0.22s ease-in forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.9);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
}

/* ============================== listing ============================== */

.listing {
  width: min(100%, 1240px);
  margin-inline: auto;
}

.listing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}

.l-side,
.l-rest {
  padding-inline: var(--gutter);
}

@media (min-width: 980px) {
  .listing {
    padding: 16px 28px 0;
  }

  .listing-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr);
    grid-template-areas: "gallery side" "rest side";
    align-items: start;
    gap: 28px 32px;
  }

  .l-gallery {
    grid-area: gallery;
  }

  .l-side {
    grid-area: side;
    position: sticky;
    top: calc(var(--topbar) + 16px);
    padding: 0;
  }

  .l-rest {
    grid-area: rest;
    padding: 0;
  }
}

.gallery {
  position: relative;
  aspect-ratio: 4 / 3;
  max-height: 64dvh;
  overflow: hidden;
  background: #0b0d10;
  isolation: isolate;
}

@media (min-width: 980px) {
  .gallery {
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-md);
  }
}

.gallery .track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.gallery .track::-webkit-scrollbar {
  display: none;
}

.gallery .slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: center;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: zoom-in;
}

.gallery .slide .bg {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center;
  filter: blur(26px) brightness(0.55) saturate(1.2);
  transform: scale(1.1);
}

.gallery .slide img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery .slide img.cover {
  object-fit: cover;
}

.gallery .nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.88);
  color: #111;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(-50%) scale(0.9);
  transition: opacity 0.2s, transform 0.25s var(--ease);
}

.gallery:hover .nav {
  opacity: 1;
  transform: translateY(-50%);
}

.gallery .nav:disabled {
  opacity: 0 !important;
  pointer-events: none;
}

.gallery .nav.prev {
  right: 14px;
}

.gallery .nav.next {
  left: 14px;
}

@media (hover: none) {
  .gallery .nav {
    display: none;
  }
}

.gallery .counter {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgb(10 12 16 / 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.gallery .counter .icon {
  width: 15px;
  height: 15px;
}

.gallery .dots {
  position: absolute;
  bottom: 18px;
  left: 50%;
  z-index: 2;
  display: flex;
  gap: 5px;
  transform: translateX(-50%);
}

.gallery .dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.5);
  transition: width 0.3s var(--ease), background-color 0.3s;
}

.gallery .dots i.on {
  width: 18px;
  background: #fff;
}

.gallery .ph {
  display: grid;
  place-items: center;
  height: 100%;
  color: #8d949c;
  gap: 8px;
  align-content: center;
  font-size: 13px;
}

.gallery .ph .icon {
  width: 36px;
  height: 36px;
  stroke-width: 1.4;
}

.thumbs {
  display: none;
}

@media (min-width: 980px) {
  .thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 4px;
  }

  .thumbs button {
    width: 84px;
    height: 62px;
    flex: none;
    padding: 0;
    border: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-3);
    opacity: 0.55;
    box-shadow: inset 0 0 0 2px transparent;
    transition: opacity 0.2s, box-shadow 0.2s;
  }

  .thumbs button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .thumbs button.on,
  .thumbs button:hover {
    opacity: 1;
  }

  .thumbs button.on {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
  }
}

/* Fullscreen photo viewer. */
dialog.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  color: #fff;
}

dialog.lightbox[open] {
  display: grid;
  animation: fade 0.25s ease;
}

dialog.lightbox::backdrop {
  background: #000;
}

dialog.lightbox .track {
  display: flex;
  height: 100dvh;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

dialog.lightbox .track::-webkit-scrollbar {
  display: none;
}

dialog.lightbox .slide {
  flex: 0 0 100vw;
  height: 100%;
  display: grid;
  place-items: center;
  scroll-snap-align: center;
}

dialog.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

dialog.lightbox .lb-bar {
  position: fixed;
  top: 0;
  inset-inline: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + var(--safe-t)) 12px 10px;
  background: linear-gradient(to bottom, rgb(0 0 0 / 0.6), transparent);
  font-size: 14px;
  font-weight: 800;
}

dialog.lightbox .icon-btn {
  background: rgb(255 255 255 / 0.14);
  color: #fff;
}

.listing-title {
  display: grid;
  gap: 8px;
}

.listing-title h1 {
  font-size: 23px;
  font-weight: 900;
  line-height: 1.55;
  letter-spacing: -0.2px;
}

.listing-title .when {
  color: var(--muted);
  font-size: 13px;
}

/* The money card: asking price, valuation and where it sits on the scale. */
.price-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--line);
}

.price-card .k {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

.price-card .big {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 34px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.6px;
}

.price-card .big small {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.price-card .verdict {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.price-card .verdict .saving {
  color: var(--good-ink);
  font-size: 14px;
  font-weight: 800;
}

.price-card .verdict .saving.over {
  color: var(--danger);
}

.price-card .pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--line);
  box-shadow: inset 0 0 0 1px var(--line);
}

.price-card .pair > div {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  background: var(--surface-2);
}

.price-card .pair .v {
  font-size: 16px;
  font-weight: 900;
}

.price-card .pair .v.good {
  color: var(--good-ink);
}

/* Horizontal market gauge. Inline-start is the cheap end. */
.gauge {
  position: relative;
  padding: 30px 0 30px;
}

.gauge .track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(to left, #16b981 0%, #84cc16 32%, #f5b041 58%, #f97316 78%, #ef4444 100%);
  opacity: 0.92;
}

.gauge .zone {
  position: absolute;
  top: -3px;
  bottom: -3px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px var(--surface), 0 0 0 1.5px color-mix(in srgb, var(--ink) 30%, transparent);
}

.gauge .pin {
  position: absolute;
  top: 50%;
  display: grid;
  justify-items: center;
  transform: translate(50%, -50%);
  transition: inset-inline-start 0.9s var(--ease);
}

.gauge .pin .dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--ink), 0 4px 10px rgb(0 0 0 / 0.3);
}

.gauge .pin.market .dot {
  width: 4px;
  height: 22px;
  border-radius: 3px;
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--surface);
}

.gauge .pin .lbl {
  position: absolute;
  bottom: calc(100% + 6px);
  padding: 2px 9px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.gauge .pin.market .lbl {
  top: calc(100% + 6px);
  bottom: auto;
  background: var(--surface-3);
  color: var(--ink-2);
}

.gauge .ends {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
}

.quick-specs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.qspec {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 14px 6px 12px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--line);
  text-align: center;
}

.qspec .icon {
  width: 22px;
  height: 22px;
  color: var(--brand);
  stroke-width: 1.7;
}

.qspec .v {
  max-width: 100%;
  font-size: 13.5px;
  font-weight: 900;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qspec .k {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.spec {
  display: grid;
  gap: 1px;
  padding: 12px 16px;
  box-shadow: inset 0 -1px 0 var(--line);
}

.spec:nth-child(odd) {
  box-shadow: inset 0 -1px 0 var(--line), inset -1px 0 0 var(--line);
}

.spec .k {
  color: var(--muted);
  font-size: 12px;
}

.spec .v {
  font-size: 14px;
  font-weight: 800;
}

/* The AI read of the seller's text: a softly glowing card. */
.ai-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--brand) 9%, transparent), transparent 60%),
    radial-gradient(90% 70% at 0% 100%, color-mix(in srgb, #7c5cff 8%, transparent), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
}

.ai-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 70%, transparent), transparent 40%, transparent 60%, color-mix(in srgb, #7c5cff 60%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

.ai-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 13px;
  background: linear-gradient(135deg, #ff8a3d, #f0285a 55%, #7c5cff);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgb(240 40 90 / 0.6);
}

.ai-mark .icon {
  width: 21px;
  height: 21px;
}

.ai-summary {
  font-size: 15px;
  line-height: 2;
  font-weight: 600;
}

.findings {
  display: grid;
  gap: 8px;
}

.finding {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13.5px;
  line-height: 1.85;
}

.finding .f-ic {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 10px;
  background: var(--warn-soft);
  color: var(--warn);
}

.finding .f-ic .icon {
  width: 17px;
  height: 17px;
}

.finding.bad .f-ic {
  background: var(--danger-soft);
  color: var(--danger);
}

.finding .evidence {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
}

.sub-label {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 800;
}

.desc {
  white-space: pre-line;
  font-size: 15px;
  line-height: 2.05;
  color: var(--ink-2);
}

.desc.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-mask: linear-gradient(to bottom, #000 60%, transparent);
  mask: linear-gradient(to bottom, #000 60%, transparent);
}

.cta-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding: 12px var(--gutter) calc(12px + var(--safe-b));
  background: var(--glass-strong);
  -webkit-backdrop-filter: saturate(1.8) blur(20px);
  backdrop-filter: saturate(1.8) blur(20px);
  box-shadow: 0 -1px 0 var(--line);
}

.cta-bar .btn.primary {
  flex: 1;
}

.cta-bar .cta-price {
  display: grid;
  align-content: center;
  min-width: 0;
  padding-inline-end: 6px;
  line-height: 1.35;
}

.cta-bar .cta-price b {
  font-size: 17px;
  font-weight: 900;
  white-space: nowrap;
}

.cta-bar .cta-price span {
  color: var(--good-ink);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

@media (min-width: 980px) {
  .cta-bar.listing-cta {
    display: none;
  }
}

/* Detail pages are full-screen: the tab bar steps aside for their own
   bottom actions and the back button in the top bar. */
.is-stacked .tabbar {
  display: none;
}

.view.stacked {
  padding-bottom: calc(28px + var(--safe-b));
}

.view.stacked:has(> .cta-bar:not([hidden])) {
  padding-bottom: 0;
}

/* ============================== hero panels ============================== */

.hero {
  position: relative;
  overflow: hidden;
  padding: 24px 22px;
  border-radius: var(--r-xl);
  background: var(--hero-bg);
  color: var(--hero-ink);
  isolation: isolate;
  box-shadow: var(--shadow-md);
}

.hero::before {
  content: "";
  position: absolute;
  inset-inline-end: -80px;
  bottom: -120px;
  z-index: -1;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 106 31 / 0.5), transparent 68%);
  filter: blur(6px);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgb(255 255 255 / 0.09) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-mask: radial-gradient(120% 100% at 0% 0%, #000, transparent 70%);
  mask: radial-gradient(120% 100% at 0% 0%, #000, transparent 70%);
}

.hero h2 {
  font-size: 23px;
  font-weight: 900;
  line-height: 1.55;
  letter-spacing: -0.2px;
}

.hero p {
  margin-top: 6px;
  color: var(--hero-muted);
  font-size: 14px;
  line-height: 1.85;
}

.hero .pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.hero .pills span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.09);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1);
  font-size: 12px;
  font-weight: 700;
}

.hero .pills .icon {
  width: 15px;
  height: 15px;
  color: #ffb07a;
}

.hero .input.search {
  margin-top: 18px;
  background: rgb(255 255 255 / 0.97);
  color: #0c0e12;
  box-shadow: 0 10px 30px -8px rgb(0 0 0 / 0.5);
}

.hero .input.search input::placeholder {
  color: #8a909b;
}

.hero .input.search > .icon {
  color: #6b7280;
}

.hero .input.search .clear {
  background: #eceef2;
}

.hero .input.search kbd {
  background: #eef0f3;
  color: #6b7280;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 16px;
}

.hero-stats > div {
  display: grid;
}

.hero-stats .v {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.35;
}

.hero-stats .k {
  color: var(--hero-muted);
  font-size: 12px;
}

/* ============================== appraisal ============================== */

.recents {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1);
  padding: 2px var(--gutter) 4px;
}

.recents::-webkit-scrollbar {
  display: none;
}

.recent {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  min-height: 46px;
  padding: 0 14px 0 6px;
  padding-inline-start: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--line);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 0.18s var(--ease);
}

.recent:active {
  transform: scale(0.96);
}

.recent .logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.recent .logo img {
  width: 24px;
  height: 24px;
}

.brands {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(102px, 1fr));
  gap: 10px;
}

.brand-tile {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  padding: 16px 6px 12px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--line);
  text-align: center;
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}

.brand-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--line);
}

.brand-tile:active {
  transform: scale(0.96);
}

.logo {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  flex: none;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgb(12 14 18 / 0.07);
}

:root[data-theme="dark"] .logo {
  background: #f1f3f6;
}

.logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.logo .letter {
  color: #3b4048;
  font-size: 19px;
  font-weight: 900;
}

.logo.sm {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.logo.sm img {
  width: 28px;
  height: 28px;
}

.logo.lg {
  width: 64px;
  height: 64px;
  border-radius: 20px;
}

.logo.lg img {
  width: 46px;
  height: 46px;
}

.brand-tile .name {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.brand-tile .sub {
  margin-top: -6px;
  color: var(--muted);
  font-size: 11px;
}

.model-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 0 4px;
}

.model-head h1 {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.5;
}

.model-head p {
  color: var(--muted);
  font-size: 13px;
}

/* Valuation report. */
.report {
  overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--line);
  animation: rise 0.55s var(--ease) both;
}

.report-top {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 22px 22px 20px;
  background: var(--hero-bg);
  color: var(--hero-ink);
  isolation: isolate;
  overflow: hidden;
}

.report-top::before {
  content: "";
  position: absolute;
  inset-inline-start: -90px;
  top: -110px;
  z-index: -1;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 106 31 / 0.42), transparent 66%);
}

.report-top .k {
  color: var(--hero-muted);
  font-size: 13px;
  font-weight: 600;
}

.report-top .p {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 34px;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.6px;
}

.report-top .p small {
  color: var(--hero-muted);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.report-top .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.report-top .tags > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.1);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1);
  font-size: 12px;
  font-weight: 700;
}

.report-top .tags > .up {
  background: rgb(47 211 145 / 0.16);
  color: #6ef0b8;
}

.report-top .tags > .down {
  background: rgb(255 123 110 / 0.16);
  color: #ffa69b;
}

.report-body {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.range-band {
  display: grid;
  gap: 10px;
}

.range-band .bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: var(--surface-3);
}

.range-band .fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: var(--brand-grad);
  opacity: 0.9;
}

.range-band .pt {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--brand), 0 3px 8px rgb(0 0 0 / 0.25);
  transform: translate(50%, -50%);
}

.range-band .labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
}

.range-band .labels > div {
  display: grid;
}

.range-band .labels > div:last-child {
  text-align: end;
}

.range-band .labels b {
  font-size: 14px;
  font-weight: 900;
}

.range-band .labels span {
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.metric {
  display: grid;
  gap: 2px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}

.metric .k {
  color: var(--muted);
  font-size: 12px;
}

.metric .v {
  font-size: 16px;
  font-weight: 900;
}

.factor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  padding: 11px 0;
  font-size: 13.5px;
}

.factor + .factor {
  box-shadow: inset 0 1px 0 var(--line);
}

.factor .name {
  font-weight: 700;
}

.factor .amt {
  font-weight: 900;
  white-space: nowrap;
}

.factor .amt.neg {
  color: var(--danger);
}

.factor .amt.pos {
  color: var(--good-ink);
}

.factor .fbar {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.factor .fbar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--danger);
  opacity: 0.8;
  transform-origin: right;
  animation: grow-x 0.8s var(--ease) both;
}

.factor .fbar i.pos {
  background: var(--good);
}

@keyframes grow-x {
  from {
    transform: scaleX(0);
  }
}

.chart {
  position: relative;
  touch-action: pan-y;
}

.chart svg {
  display: block;
  width: 100%;
  height: 132px;
  overflow: visible;
}

.chart .line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.chart .area {
  stroke: none;
}

.chart .grid {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  vector-effect: non-scaling-stroke;
}

.chart .cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: color-mix(in srgb, var(--ink) 40%, transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.chart .cursor::after {
  content: "";
  position: absolute;
  top: var(--y, 50%);
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand);
  transform: translate(-50%, -50%);
}

.chart .tip {
  position: absolute;
  top: -8px;
  padding: 4px 10px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(50%, -100%);
  transition: opacity 0.15s;
}

.chart.active .cursor,
.chart.active .tip {
  opacity: 1;
}

.chart .end-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent);
  transform: translate(-50%, -50%);
}

details.group {
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--line);
  transition: box-shadow 0.25s;
}

details.group[open] {
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
}

details.group > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 16px;
  list-style: none;
  cursor: pointer;
  border-radius: inherit;
  -webkit-user-select: none;
  user-select: none;
}

details.group > summary::-webkit-details-marker {
  display: none;
}

details.group > summary:hover {
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

details.group > summary .grow {
  flex: 1;
}

details.group > summary .title {
  display: block;
  font-size: 15px;
  font-weight: 800;
}

details.group > summary .sub {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
}

details.group > summary .chev {
  color: var(--muted);
  transition: transform 0.35s var(--spring);
}

details.group[open] > summary .chev {
  transform: rotate(180deg);
}

details.group > summary .s-ic {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--ink-2);
}

details.group > .inner {
  display: grid;
  gap: 16px;
  padding: 4px 16px 18px;
  animation: rise 0.35s var(--ease);
}

details.group.flush > .inner {
  padding: 0 16px 6px;
}

/* Sticky submit area for long forms. */
.dock {
  position: sticky;
  bottom: 0;
  z-index: 10;
  margin-inline: calc(var(--gutter) * -1);
  padding: 24px var(--gutter) calc(12px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) calc(100% - 20px), color-mix(in srgb, var(--bg) 0%, transparent));
}

.view:not(.stacked) .dock {
  bottom: calc(var(--tabbar) + 12px + var(--safe-b));
  background: none;
  padding-bottom: 0;
}

@media (min-width: 960px) {
  .view:not(.stacked) .dock {
    bottom: 0;
    padding-bottom: 16px;
    background: linear-gradient(to top, var(--bg) 60%, transparent);
  }
}

.dock .hint {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* ============================== trade ============================== */

.slot {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
}

.slot .slot-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slot .num-badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 11px;
  background: var(--ink);
  color: var(--bg);
  font-size: 15px;
  font-weight: 900;
}

.slot .num-badge.b {
  background: var(--brand-grad);
  color: #fff;
}

.slot-pick {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 76px;
  padding: 12px 16px;
  border: 0;
  border-radius: 18px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  text-align: start;
  transition: box-shadow 0.2s, background-color 0.2s;
}

.slot-pick.empty-pick {
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  background-image: repeating-linear-gradient(-45deg, transparent 0 10px, color-mix(in srgb, var(--ink) 2.5%, transparent) 10px 20px);
}

.slot-pick:hover {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--brand) 50%, transparent);
}

.slot-pick .plus {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.slot-pick .title {
  display: block;
  font-size: 15.5px;
  font-weight: 900;
}

.slot-pick .sub {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
}

.vs {
  position: relative;
  display: grid;
  place-items: center;
  height: 18px;
  margin: -6px 0;
  z-index: 2;
}

.vs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--line);
  font-size: 13px;
  font-weight: 900;
  transition: transform 0.4s var(--spring);
}

.vs button:hover .icon {
  transform: rotate(180deg);
}

.vs button .icon {
  transition: transform 0.45s var(--spring);
  color: var(--brand);
}

.balance {
  display: grid;
  gap: 14px;
}

.balance .bar-row {
  display: grid;
  gap: 6px;
}

.balance .bar-row .row {
  font-size: 13px;
}

.balance .bar-row b {
  font-weight: 900;
}

.balance .bar {
  height: 14px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.balance .bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transform-origin: right;
  animation: grow-x 0.9s var(--ease) both;
}

.balance .bar i.b {
  background: var(--brand-grad);
}

/* ============================== hunts ============================== */

.hunt {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.hunt-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hunt .title {
  display: block;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.5;
}

.ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: none;
}

.ring .ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg) scaleY(-1);
}

.ring circle {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
}

.ring .bg {
  stroke: var(--surface-3);
}

.ring .fg {
  stroke: var(--brand);
  transition: stroke-dashoffset 1s linear;
}

.ring.paused .fg {
  stroke: var(--warn);
}

.ring.done .fg {
  stroke: var(--faint);
}

.ring .icon {
  width: 22px;
  height: 22px;
  color: var(--brand);
}

.ring.paused .icon {
  color: var(--warn);
}

.ring.done .icon {
  color: var(--faint);
}

.ring.lg {
  width: 92px;
  height: 92px;
}

.ring.lg circle {
  stroke-width: 6;
}

.ring .cd-text {
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.ring .cd-text small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stat {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 12px 6px;
  border-radius: 16px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}

.stat .v {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.4;
}

.stat .k {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.stat.hi {
  background: var(--good-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 22%, transparent);
  color: var(--good-ink);
}

.stat.hi .k {
  color: inherit;
}

.hero .stats .stat {
  background: rgb(255 255 255 / 0.07);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.09);
}

.hero .stats .stat .k {
  color: var(--hero-muted);
}

.hero .stats .stat.hi {
  background: rgb(47 211 145 / 0.14);
  color: #6ef0b8;
}

.fab {
  position: fixed;
  inset-inline-start: auto;
  inset-inline-end: 18px;
  bottom: calc(var(--tabbar) + 24px + var(--safe-b));
  z-index: 24;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 22px 0 20px;
  border: 0;
  border-radius: 20px;
  background: var(--brand-grad);
  color: #fff;
  font-weight: 900;
  box-shadow: var(--shadow-brand), var(--shadow-md);
  animation: pop 0.45s var(--spring) both;
  transition: transform 0.2s var(--ease);
}

.fab:active {
  transform: scale(0.95);
}

.fab .icon {
  stroke-width: 2.4;
}

@media (min-width: 960px) {
  .fab {
    bottom: 32px;
    inset-inline-end: 32px;
  }
}

.form-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--line);
}

.step {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step .n {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 900;
}

.step h3 {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.4;
}

.step p {
  color: var(--muted);
  font-size: 12.5px;
}

.suggest {
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--line);
  animation: rise 0.25s var(--ease);
}

/* ============================== account ============================== */

.auth {
  display: grid;
  gap: 20px;
  width: min(100%, 440px);
  margin: 0 auto;
  padding-top: 12px;
}

.auth-hero {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 18px 0 4px;
  text-align: center;
}

.auth-hero .mark-wrap {
  position: relative;
  margin-bottom: 8px;
}

.auth-hero .mark-wrap::before {
  content: "";
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 106 31 / 0.35), transparent 65%);
  animation: breathe 3s ease-in-out infinite;
}

.auth-hero .mark-wrap .mark {
  position: relative;
}

.auth-hero h1 {
  font-size: 26px;
  font-weight: 900;
  line-height: 1.5;
}

.auth-hero p {
  max-width: 340px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
}

.auth-card {
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--line);
}

.phone-input {
  display: flex;
  align-items: center;
  gap: 10px;
  direction: ltr;
  min-height: 60px;
  padding: 0 16px;
  border-radius: 18px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: box-shadow 0.2s, background-color 0.2s;
}

.phone-input:focus-within {
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--brand), 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}

.phone-input .cc {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-inline-end: 12px;
  box-shadow: 1px 0 0 var(--line-strong);
  color: var(--muted);
  font-weight: 800;
}

.phone-input .flag {
  display: block;
  width: 22px;
  height: 15px;
  border-radius: 3px;
  background: linear-gradient(#239f40 0 33.3%, #fff 33.3% 66.6%, #da0000 66.6%);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.1);
}

.phone-input input {
  flex: 1;
  min-width: 0;
  height: 58px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.phone-input input::placeholder {
  color: var(--faint);
  font-weight: 600;
}

.otp-boxes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  direction: ltr;
}

.otp-boxes input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 1px;
  opacity: 0.01;
}

.otp-boxes .box {
  display: grid;
  place-items: center;
  height: 64px;
  border-radius: 18px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: 26px;
  font-weight: 900;
  transition: box-shadow 0.2s, background-color 0.2s, transform 0.25s var(--spring);
}

.otp-boxes .box.filled {
  background: var(--surface);
  transform: scale(1.02);
}

.otp-boxes:focus-within .box.active {
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--brand), 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}

.otp-boxes:focus-within .box.active:empty::after {
  content: "";
  width: 2px;
  height: 28px;
  border-radius: 2px;
  background: var(--brand);
  animation: blink 1s steps(1) infinite;
}

.otp-boxes.shake {
  animation: shake 0.42s var(--ease);
}

.otp-boxes.shake .box {
  box-shadow: inset 0 0 0 1.5px var(--danger);
}

@keyframes shake {
  20%,
  60% {
    transform: translateX(-8px);
  }
  40%,
  80% {
    transform: translateX(8px);
  }
}

.trust-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trust-row .icon {
  width: 16px;
  height: 16px;
  color: var(--good);
}

.profile-card {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: var(--r-xl);
  background: var(--hero-bg);
  color: var(--hero-ink);
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-md);
}

.profile-card::before {
  content: "";
  position: absolute;
  inset-inline-end: -60px;
  top: -80px;
  z-index: -1;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 106 31 / 0.45), transparent 66%);
}

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

.avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: none;
  border-radius: 20px;
  background: var(--brand-grad);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25), 0 8px 20px -6px rgb(255 106 31 / 0.6);
}

.avatar.sm {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 13px;
}

.plan-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgb(255 255 255 / 0.07);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1);
}

.plan-strip .p-ic {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 13px;
  background: linear-gradient(135deg, #ffd27a, #f5a524);
  color: #4a2a00;
}

.plan-strip b {
  display: block;
  font-size: 14.5px;
  font-weight: 900;
}

.plan-strip span {
  color: var(--hero-muted);
  font-size: 12px;
}

.plan-strip .btn {
  margin-inline-start: auto;
}

.mini-deals {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1);
  padding: 4px var(--gutter) 8px;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
}

.mini-deals::-webkit-scrollbar {
  display: none;
}

.mini-deals .deal {
  flex: 0 0 min(76%, 290px);
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
  scroll-snap-align: start;
  contain-intrinsic-size: auto 320px;
}

.mini-deals .deal-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 0;
}

.mini-deals .deal-media .media-tier {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  z-index: 2;
  display: inline-flex;
}

.mini-deals .deal-media .media-tier.t-good,
.mini-deals .deal-media .media-tier.t-none {
  background: rgb(255 255 255 / 0.92);
  color: var(--good-ink);
}

.mini-deals .deal-body {
  padding: 10px 14px 14px;
}

.mini-deals .deal-save .tier {
  display: none;
}

.settings {
  overflow: hidden;
}

.plans {
  display: grid;
  gap: 12px;
}

.plan {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 20px;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  text-align: start;
}

.plan.featured {
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--flame) border-box;
  border: 2px solid transparent;
  box-shadow: var(--shadow-brand);
}

.plan .ribbon {
  position: absolute;
  top: -12px;
  inset-inline-end: 18px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--flame);
  color: #fff;
  font-size: 11.5px;
  font-weight: 900;
  box-shadow: var(--shadow-brand);
}

.plan .name {
  font-size: 17px;
  font-weight: 900;
}

.plan .price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.4px;
}

.plan .price small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.plan ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  color: var(--ink-2);
}

.plan li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan li .icon {
  width: 17px;
  height: 17px;
  color: var(--good);
  stroke-width: 2.4;
}

/* Maintenance overlay. */
.maintenance {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

/* Narrow phones (320–380 px): tighter tiles and cards. */
@media (max-width: 380px) {
  :root {
    --gutter: 12px;
  }

  .pulse-stats {
    gap: 6px;
  }

  .pulse-stat {
    padding: 10px;
  }

  .pulse-stat .v {
    font-size: 16px;
  }

  .pulse-stat .k {
    white-space: normal;
    line-height: 1.45;
  }

  .deal {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
  }

  .deal-media {
    width: 96px;
  }

  .deal-price .p {
    font-size: 20px;
  }

  .feed-hero h1,
  .screen-head h1 {
    font-size: 28px;
  }

  .quick-specs {
    gap: 6px;
  }

  .qspec {
    padding: 12px 4px 10px;
  }
}

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