/* ============================================================
   AdBoard site — app-faithful components
   Phone frame, dashboard replica, cards, pills, charts
   ============================================================ */

/* ---------- Phone frame ---------- */

.phone-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0;
}

.phone {
  --phone-w: min(300px, 72vw);
  position: relative;
  width: var(--phone-w);
  border-radius: 52px;
  background: #050607;
  padding: 11px;
  box-shadow:
    0 0 0 1.5px rgba(255, 255, 255, 0.13),
    0 0 0 7px rgba(20, 21, 23, 0.9),
    0 50px 120px rgba(0, 0, 0, 0.55),
    var(--glow-accent);
}

.phone__screen {
  position: relative;
  overflow: hidden;
  border-radius: 42px;
  background: var(--bg);
  aspect-ratio: 300 / 614;
  display: flex;
  flex-direction: column;
}

.phone__notch {
  position: absolute;
  top: 11px;
  left: 50%;
  z-index: 5;
  width: 96px;
  height: 25px;
  border-radius: 999px;
  background: #050607;
  transform: translateX(-50%);
}

.phone__statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 26px 4px;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
}

.phone__statusbar .status-icons {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.phone__statusbar .icon {
  width: 13px;
  height: 13px;
}

.phone__body {
  flex: 1;
  overflow: hidden;
  padding: 10px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.phone__navbar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 6px 20px;
  border-top: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}

.phone__navitem {
  display: grid;
  justify-items: center;
  gap: 3px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 500;
}

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

.phone__navitem.is-active {
  color: var(--accent-text);
}

/* ---------- Mini app UI (mirrors Compose screens) ---------- */

.mini-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 0;
}

.mini-topbar__title {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.mini-account {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
}

.mini-account .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.mini-pills {
  display: flex;
  gap: 6px;
}

.mini-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.mini-pill.is-selected {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.mini-updated {
  display: flex;
  justify-content: space-between;
  padding-inline: 2px;
  font-size: 9px;
  color: var(--muted-2);
}

.mini-updated .est {
  color: var(--accent-text);
  font-weight: 600;
}

.mini-card {
  border: 1px solid color-mix(in srgb, var(--line) 66%, transparent);
  border-radius: 20px;
  background: var(--surface);
  padding: 13px 13px 12px;
  box-shadow: var(--shadow-sm);
}

.mini-card__label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.mini-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.mini-hero-value {
  margin-top: 2px;
  font-size: 31px;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.mini-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(141, 229, 176, 0.13);
  color: var(--positive);
  font-size: 10px;
  font-weight: 600;
}

.mini-delta.is-down {
  background: rgba(255, 155, 142, 0.12);
  color: var(--negative);
}

.mini-delta .icon {
  width: 11px;
  height: 11px;
}

.mini-range {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 9.5px;
}

.mini-range .partial {
  color: var(--accent-text);
  font-weight: 600;
}

.spark {
  width: 100%;
  height: auto;
  margin-top: 8px;
  overflow: visible;
}

.spark .spark-area {
  fill: var(--accent);
  opacity: 0.1;
}

.spark .spark-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spark .spark-dot {
  fill: var(--accent);
}

.mini-glance {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
}

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

.mini-tile {
  flex: 0 0 96px;
  scroll-snap-align: start;
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: 14px;
  background: var(--surface);
  padding: 9px 8px;
  min-width: 0;
}

.mini-tile__label {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-tile__value {
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mini-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.mini-kpi {
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: 14px;
  background: var(--surface);
  padding: 9px 10px 8px;
}

.mini-kpi__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.mini-kpi__label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.mini-kpi__value {
  margin-top: 1px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.mini-kpi__delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 9px;
  font-weight: 600;
}

.mini-kpi__delta .icon {
  width: 10px;
  height: 10px;
}

.mini-kpi__delta.is-up {
  color: var(--positive);
}

.mini-kpi__delta.is-down {
  color: var(--negative);
}

.mini-list {
  display: grid;
  gap: 0;
}

.mini-list__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.mini-list__title a,
.mini-list__title span.link {
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 600;
}

.mini-bar-row {
  display: grid;
  gap: 4px;
  padding-block: 5px;
}

.mini-bar-row__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
}

.mini-bar-row__name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-bar-row__value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mini-bar-track {
  height: 5px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: left;
}

.mini-insight {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-block: 7px;
  border-top: 1px solid color-mix(in srgb, var(--line) 48%, transparent);
  font-size: 10px;
}

.mini-insight:first-of-type {
  border-top: 0;
}

.mini-insight .dot {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.mini-insight__title {
  font-weight: 600;
  font-size: 10.5px;
}

.mini-insight__body {
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.4;
}

.mini-trend-head {
  display: flex;
  gap: 5px;
  margin-block: 8px 6px;
}

.trend-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.trend-svg .grid {
  stroke: var(--chart-grid);
  stroke-width: 1;
}

.trend-svg .compare {
  fill: none;
  stroke: var(--chart-compare);
  stroke-width: 1.6;
  stroke-dasharray: 5 4;
  stroke-linecap: round;
}

.trend-svg .main-area {
  fill: var(--accent);
  opacity: 0.1;
}

.trend-svg .main-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-svg .main-dot {
  fill: var(--accent);
}

/* Floating chips beside hero phone */

.float-chip {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--line-2) 60%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: var(--shadow-md);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  animation: drift 5.5s ease-in-out infinite alternate;
}

.float-chip .icon {
  width: 16px;
  height: 16px;
  color: var(--accent-text);
}

.float-chip small {
  color: var(--positive);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.float-chip--1 {
  top: 9%;
  left: -88px;
  --rot: -5deg;
}

.float-chip--2 {
  top: 34%;
  right: -96px;
  --rot: 4deg;
  animation-delay: -1.8s;
}

.float-chip--3 {
  top: 58%;
  left: -100px;
  --rot: 3deg;
  animation-delay: -3.4s;
}

.float-chip--4 {
  bottom: 9%;
  right: -88px;
  --rot: -4deg;
  animation-delay: -2.6s;
}

@media (max-width: 560px) {
  .float-chip {
    font-size: 11px;
    padding: 8px 11px;
  }

  .float-chip .icon {
    width: 14px;
    height: 14px;
  }

  .float-chip--1 {
    top: 4%;
    left: 0;
  }
  .float-chip--2 {
    top: 32%;
    right: -2px;
  }
  .float-chip--3 {
    top: 56%;
    left: -2px;
  }
  .float-chip--4 {
    bottom: 14%;
    right: 0;
  }
}
