/* The preview follows the app's GPUI popup (src/popup_window/ui): Fluent
   tokens from theme.rs and the WinUI type ramp from components.rs. The site
   popup is 475px for the app's 380 DIP, so every DIP value is scaled by 1.25. */
.popup-mock {
  --demo-accent: #fb9a44;
  --demo-fill: rgb(251 154 68 / .2);
  --demo-text: #fff;
  --demo-secondary: rgb(255 255 255 / .773);
  --demo-tertiary: rgb(255 255 255 / .53);
  --demo-card: rgb(255 255 255 / .051);
  --demo-stroke: rgb(0 0 0 / .1);
  --demo-subtle: rgb(255 255 255 / .059);
  --demo-chrome: #bebebe;
  --demo-chrome-hover: #e6e6e6;
  --demo-footer: rgb(0 0 0 / .14);
  --demo-pace: #fff;
  --demo-tick: rgb(0 0 0 / .267);
  --demo-solid: rgb(32 32 32);
  --demo-codex: #809fff;
  --demo-claude: #d97757;
  --demo-cursor: #fff;
  --demo-openrouter: #c8ff00;
  --demo-cursor-spend: #fff;
  --demo-backdrop: linear-gradient(180deg, rgb(33 32 33 / .95) 8%, rgb(43 28 26 / .95) 52%, rgb(33 32 32 / .95) 90%);
  width: 475px;
  max-width: calc(100% - 32px);
  border-radius: 15px;
  border: 1px solid rgb(255 255 255 / .08);
  box-shadow: 0 24px 70px #0000006e;
  background: var(--demo-backdrop);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  color: var(--demo-text);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-size: 17.5px;
  line-height: 25px;
  font-variant-numeric: tabular-nums;
}

.popup-mock[data-demo-theme="light"],
html[data-theme="light"] .popup-mock[data-demo-theme="auto"] {
  --demo-text: rgb(0 0 0 / .894);
  --demo-secondary: rgb(0 0 0 / .62);
  --demo-tertiary: rgb(0 0 0 / .447);
  --demo-card: rgb(255 255 255 / .7);
  --demo-stroke: rgb(0 0 0 / .059);
  --demo-subtle: rgb(0 0 0 / .035);
  --demo-chrome: #111;
  --demo-chrome-hover: #111;
  --demo-footer: rgb(0 0 0 / .05);
  --demo-pace: #000;
  --demo-solid: rgb(243 243 243);
  --demo-codex: rgb(107 132 244);
  --demo-cursor: rgb(51 51 51);
  --demo-openrouter: rgb(118 36 244);
  --demo-cursor-spend: #121212;
  --demo-backdrop: rgb(243 243 243 / .94);
  border-color: rgb(0 0 0 / .08);
}

.popup-mock.is-open {
  pointer-events: auto;
}

.popup-mock:not(.is-open) {
  visibility: hidden;
}

.demo-content {
  padding: 20px;
  max-height: min(760px, calc(100dvh - 220px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--demo-text) 22%, transparent) transparent;
  display: flex;
  flex-direction: column;
  gap: 7.5px;
}

.demo-content>* {
  flex-shrink: 0;
  min-width: 0;
}

.popup-mock button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: inherit;
  transition: background-color .15s, color .15s;
}

.popup-mock :focus-visible {
  outline: 2px solid var(--demo-accent);
  outline-offset: 2px;
}

.popup-mock b {
  font-weight: 600;
}

/* ---- glyphs ---------------------------------------------------------- */

/* App icons are single-color SVGs tinted at draw time; masks do the same. */
.demo-glyph {
  display: block;
  flex: none;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--glyph) center / contain no-repeat;
  mask: var(--glyph) center / contain no-repeat;
}

.demo-chrome {
  color: var(--demo-chrome);
}

.demo-mark {
  position: relative;
  display: inline-flex;
  flex: none;
  width: 20px;
  height: 20px;
}

.demo-p-codex {
  color: var(--demo-codex);
}

.demo-p-claude {
  color: var(--demo-claude);
}

.demo-p-cursor {
  color: var(--demo-cursor);
}

.demo-p-openrouter {
  color: var(--demo-openrouter);
}

/* Instance badge plate in the icon's lower-right corner (badge_plate). */
.demo-badge {
  position: absolute;
  right: -5.6px;
  bottom: -3.7px;
  box-sizing: border-box;
  height: 12.4px;
  min-width: 12.4px;
  padding: 0 2.7px;
  border-radius: 3.7px;
  border: 1px solid color-mix(in srgb, var(--demo-solid) 90%, transparent);
  background: var(--badge);
  color: #fff;
  font-size: 8.4px;
  line-height: 10.4px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

/* ---- text ------------------------------------------------------------ */

.demo-caption {
  display: block;
  font-size: 15px;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-secondary {
  color: var(--demo-secondary);
}

.demo-tertiary {
  color: var(--demo-tertiary);
}

.demo-accent {
  color: var(--demo-accent);
  white-space: nowrap;
}

.demo-status {
  display: inline-flex;
  align-items: center;
  gap: 7.5px;
  white-space: nowrap;
}

.demo-status>span:first-child {
  color: var(--demo-tertiary);
}

.demo-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.25px;
}

.demo-split {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.demo-split>* {
  flex: none;
}

.demo-split>.demo-lead {
  flex: 1;
  min-width: 0;
}

.demo-lead>.demo-stack {
  align-items: flex-start;
}

/* ---- sections and headings ------------------------------------------- */

.demo-section {
  display: flex;
  flex-direction: column;
  gap: 7.5px;
}

.demo-heading {
  padding: 0 5px;
  margin-bottom: 2.5px;
}

.demo-section+.demo-section>.demo-heading:first-child {
  margin-top: 10px;
}

.demo-heading-title {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.demo-heading-title>.demo-mark {
  margin-right: 5px;
}

.demo-heading-title>.demo-mark.has-badge {
  margin-right: 12.5px;
}

.demo-heading-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  white-space: nowrap;
  color: var(--demo-secondary);
}

.demo-heading-link span {
  color: var(--demo-tertiary);
}

button.demo-heading-link:hover,
button.demo-heading-link:hover span {
  color: var(--demo-accent);
}

.demo-stats-title {
  gap: 10px;
}

.demo-trail {
  display: flex;
  align-items: center;
  gap: 5px;
}

.demo-grip {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 5px;
  color: var(--demo-chrome);
  cursor: grab !important;
}

.demo-grip .demo-glyph {
  width: 17.5px;
  height: 17.5px;
}

.demo-grip:hover {
  background: var(--demo-subtle) !important;
  color: var(--demo-chrome-hover);
}

.demo-text-tabs {
  display: flex;
  align-items: center;
  gap: 15px;
}

.demo-text-tabs button {
  font-weight: 600;
  white-space: nowrap;
  color: var(--demo-tertiary);
}

.demo-text-tabs button:hover {
  color: var(--demo-secondary);
}

.demo-text-tabs button[aria-pressed="true"] {
  color: var(--demo-accent);
}

/* ---- cards ----------------------------------------------------------- */

.demo-card {
  position: relative;
  overflow: hidden;
  border-radius: 12.5px;
  background: var(--demo-card);
  border: 1px solid var(--demo-stroke);
}

.demo-pad {
  position: relative;
  padding: 15px;
}

.demo-limit {
  background:
    linear-gradient(to right, var(--demo-fill) var(--fill), transparent var(--fill)),
    var(--demo-card);
}

/* Equal buckets with a tick pinned to the right end of each interior one. */
.demo-ticks {
  position: absolute;
  inset: 0;
  display: flex;
}

.demo-ticks>* {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.demo-ticks>i::after {
  content: "";
  width: 2.5px;
  height: 7.5px;
  border-radius: 1.25px 1.25px 0 0;
  background: var(--demo-tick);
}

.demo-pace {
  position: absolute;
  top: 0;
  left: var(--pace);
  width: 2.5px;
  height: 7.5px;
  border-radius: 0 0 1.25px 1.25px;
  background: var(--demo-pace);
}

.demo-banked {
  padding: 15px 20px;
}

.popup-mock .demo-stats-card {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 15px;
  border-radius: 12.5px;
  background: var(--demo-card);
}

.popup-mock .demo-stats-card:hover {
  background: linear-gradient(var(--demo-subtle), var(--demo-subtle)), var(--demo-card);
}

.demo-donut {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 155px;
  height: 155px;
}

.demo-donut svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.demo-donut>span {
  position: relative;
  font-size: 22.5px;
  line-height: 30px;
  font-weight: 600;
}

.demo-legend-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex: 1;
  min-width: 0;
}

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

.demo-legend-row b:first-of-type {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-account {
  padding: 0 5px;
  margin-top: 10px;
}

/* ---- footer ---------------------------------------------------------- */

.demo-footer {
  display: flex;
  align-items: center;
  gap: 7.5px;
  height: 63.75px;
  padding: 0 17.5px 0 15px;
  background: var(--demo-footer);
}

.demo-tabs {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2.5px;
  min-width: 0;
}

.demo-actions {
  display: flex;
  align-items: center;
  gap: 2.5px;
  margin-left: auto;
}

.demo-footer button {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 5px;
}

.demo-actions button {
  border-radius: 7.5px;
}

.demo-footer button:hover {
  background: var(--demo-subtle);
}

.demo-footer button:hover .demo-chrome,
.demo-tab[aria-pressed="true"] .demo-chrome {
  color: var(--demo-chrome-hover);
}

/* One sliding selection indicator under the active tab. */
.demo-indicator {
  position: absolute;
  bottom: 0;
  left: calc(var(--tab) * 42.5px + 11.25px);
  width: 17.5px;
  height: 3.75px;
  border-radius: 1.9px;
  background: var(--demo-accent);
  transition: left .3s cubic-bezier(.16, 1, .3, 1);
}

/* ---- Usage, provider and OpenRouter pages ---------------------------- */

.demo-surface {
  padding: 15px;
}

.demo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.demo-spacer {
  flex: 1 1 auto;
  min-width: 8px;
}

.demo-total {
  display: block;
  font-size: 35px;
  line-height: 45px;
  font-weight: 600;
}

.popup-mock small {
  display: block;
  font-size: 15px;
  line-height: 20px;
  color: var(--demo-tertiary);
}

.popup-mock em {
  font-style: normal;
  color: var(--demo-tertiary);
}

.demo-right {
  text-align: right;
}

.demo-stacked {
  display: flex;
  gap: 5px;
  height: 12.5px;
  margin: 10px 0 20px;
}

.demo-stacked i {
  border-radius: 5px;
  min-width: 5px;
}

.demo-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 10px;
}

.demo-legend>* {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 3px 10px;
  min-width: 0;
}

.demo-legend>*>span:not(.demo-mark),
.demo-legend small {
  grid-column: 1 / -1;
  font-size: 15px;
}

.demo-usage-head {
  display: flex;
  align-items: center;
  gap: 7.5px;
}

.demo-usage-head b {
  color: var(--demo-secondary);
}

.demo-usage-head em {
  font-size: 15px;
  white-space: nowrap;
}

.demo-segments {
  display: flex;
  background: var(--demo-subtle);
  padding: 5px;
  border-radius: 10px;
}

.demo-segments button {
  flex: 1;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  text-align: center;
}

.demo-segments button[aria-pressed="true"] {
  color: #161616;
  background: var(--demo-accent);
}

.demo-inline-segments {
  padding: 3px;
  border-radius: 8px;
}

.demo-inline-segments button {
  padding: 2px 12px;
}

.demo-chart {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.demo-chart svg {
  width: calc(100% - 48px);
  height: 165px;
  overflow: visible;
  color: var(--demo-text);
}

.demo-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--demo-tertiary);
  min-width: 40px;
}

.demo-chart-dates {
  margin: 8px 0 0 50px;
}

.demo-chart-dates small {
  font-size: 12.5px;
}

.demo-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0 0;
}

.demo-totals>div {
  min-width: 0;
}

.demo-totals dt {
  color: var(--demo-tertiary);
  font-size: 15px;
}

.demo-totals dd {
  margin: 2px 0 0;
  font-weight: 600;
}

.demo-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  font-size: 15px;
  line-height: 20px;
}

.demo-table th {
  color: var(--demo-tertiary);
  font-weight: 400;
}

.demo-table td,
.demo-table th {
  text-align: right;
  padding: 7px 0;
}

.demo-table td:first-child,
.demo-table th:first-child {
  text-align: left;
}

.demo-table tbody tr+tr td {
  border-top: 1px solid color-mix(in srgb, var(--demo-text) 8%, transparent);
}

.demo-table .demo-mark {
  vertical-align: -4px;
  margin-right: 8px;
}

.demo-table .demo-badge {
  display: none;
}

.demo-bars {
  height: 78px;
  display: flex;
  align-items: end;
  gap: 3px;
  margin: 16px 0;
}

.demo-bars>div {
  flex: 1;
  background: var(--demo-accent);
  border-radius: 2px 2px 0 0;
  min-width: 0;
}

.demo-spark .demo-row {
  align-items: start;
}

.demo-spark b {
  font-size: 20px;
  font-weight: 600;
}

.demo-spark em {
  font-size: 15px;
}

.demo-spark small:last-child {
  margin-top: 4px;
  font-size: 13.75px;
}

/* ---- motion ---------------------------------------------------------- */

@keyframes demo-enter {
  from {
    opacity: .35;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

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

.demo-content>* {
  animation: demo-enter .22s ease-out;
}

.is-refreshing .demo-glyph {
  animation: demo-spin .7s linear infinite;
}

[data-motion="false"] *,
[data-motion="false"] {
  animation: none !important;
  transition: none !important;
}

@media (prefers-reduced-motion:reduce) {

  .popup-mock,
  .popup-mock * {
    animation: none !important;
    transition: none !important;
  }
}

@media (min-width:901px) {
  .popup-mock {
    --popup-scale: 1 !important;
  }
}

@media (max-width:1100px) and (min-width:901px) {
  .popup-mock {
    width: 440px;
    right: 16px;
  }

  .hero h1 {
    font-size: 3.3rem;
  }
}

@media (max-width:900px) {
  .screen-stage {
    height: auto;
    overflow: visible;
  }

  .hero {
    height: auto;
    padding-bottom: 0;
  }

  .screen-shell {
    height: auto;
    min-height: 100dvh;
  }

  .hero-grid {
    display: flex;
    flex-direction: column;
    padding-top: 3rem;
    padding-bottom: 0;
    gap: 32px;
  }

  .hero-copy {
    width: 100%;
  }

  .hero-visual {
    position: relative;
    inset: auto;
    width: 100%;
    height: 780px;
    flex-shrink: 0;
    z-index: 3;
  }

  .desk {
    position: relative;
    height: 100%;
  }

  .popup-mock {
    right: 50%;
    bottom: 80px;
    max-width: calc(100% - 8px);
    transform: translateX(50%) !important;
    --popup-scale: 1 !important;
  }

  .demo-content {
    max-height: 600px;
  }

  .win-taskbar {
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width:480px) {
  .demo-content {
    padding: 14px 12px;
  }

  .demo-footer {
    height: 54px;
    padding: 0 8px;
    gap: 4px;
  }

  .demo-tabs,
  .demo-actions {
    gap: 2px;
  }

  .demo-footer button {
    width: 34px;
    height: 34px;
  }

  .demo-footer .demo-glyph,
  .demo-footer .demo-mark {
    width: 18px;
    height: 18px;
  }

  .demo-indicator {
    left: calc(var(--tab) * 36px + 9px);
    width: 16px;
  }

  .popup-mock .demo-stats-card {
    gap: 14px;
    padding: 12px;
  }

  .demo-donut {
    width: 112px;
    height: 112px;
  }

  .demo-donut>span {
    font-size: 18px;
  }

  .demo-legend-list {
    gap: 10px;
  }

  .demo-legend-row {
    font-size: 14px;
    gap: 8px;
  }

  .demo-text-tabs {
    gap: 8px;
  }

  .demo-text-tabs button {
    font-size: 13px;
  }

  .demo-heading {
    font-size: 15px;
  }

  .demo-status,
  .demo-accent {
    font-size: 15px;
  }

  .demo-caption {
    font-size: 13px;
  }

  .demo-segments button {
    padding: 6px 8px;
  }
}
