/* ============================================================
   Glassy Dashboard v24 — tokens, reset and shared atoms.
   One look: a warm room behind frosted glass tinted by the accent.
   ============================================================ */
@property --iris {
  syntax: '<length>';
  inherits: false;
  initial-value: 0px;
}

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;

  --page: #cfc4b6;
  --ink: #161412;
  --ink-2: #2f2b27;
  --muted: #554f48;
  --faint: #857e75;

  --card: color-mix(in srgb, var(--accent-2) 8%, rgba(255, 255, 255, 0.62));
  --card-bg: linear-gradient(155deg, color-mix(in srgb, var(--accent-2) 7%, rgba(255, 255, 255, 0.74)), color-mix(in srgb, var(--accent-2) 10%, rgba(255, 255, 255, 0.4)));
  --card-2: rgba(255, 255, 255, 0.5);
  --soft: rgba(255, 255, 255, 0.55);
  --soft-2: rgba(255, 255, 255, 0.78);
  --line: rgba(40, 24, 20, 0.09);
  --line-2: rgba(40, 24, 20, 0.14);
  --edge: color-mix(in srgb, var(--accent-2) 30%, rgba(255, 255, 255, 0.55));
  --edge-card: color-mix(in srgb, var(--accent-2) 22%, rgba(255, 255, 255, 0.7));

  /* chrome = the grey glass of the top bar and rail (white text on it) */
  --chrome: color-mix(in srgb, color-mix(in srgb, var(--accent-deep) 72%, #1e1614) 46%, transparent);
  --chrome-inset: color-mix(in srgb, color-mix(in srgb, var(--accent-deep) 55%, #120c0b) 40%, transparent);
  --chrome-hover: rgba(255, 255, 255, 0.16);
  --chrome-ink: #ffffff;
  --chrome-dim: rgba(255, 255, 255, 0.64);
  --panel: color-mix(in srgb, var(--accent-2) 14%, rgba(255, 255, 255, 0.1));

  /* the smoked teal glass of the banner and reminder */
  --smoke: color-mix(in srgb, var(--accent-deep) 34%, rgba(30, 16, 13, 0.86));
  --smoke-ink: #f1f7f4;

  --solid: #171513;
  --on-solid: #ffffff;
  --peach: #f6a36d;
  --peach-2: #ffd1b0;
  --mint: #93e6cf;
  --green: #1a9e5c;
  --green-bg: rgba(35, 170, 100, 0.16);
  --red: #e0484d;
  --red-bg: rgba(229, 72, 77, 0.14);
  --amber: #e39b12;
  --blue: #3f74f6;
  --violet: #7b55e8;

  --frost: 1;
  --glass-shadow: 0 30px 70px -34px rgba(40, 28, 16, 0.5);
  --card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 22px 44px -32px rgba(50, 36, 22, 0.55);
  --pop-shadow: 0 30px 70px -22px rgba(30, 22, 14, 0.45), 0 4px 14px -6px rgba(30, 22, 14, 0.12);
  --veil: linear-gradient(180deg, rgba(40, 30, 20, 0.06), rgba(40, 30, 20, 0.24));

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-soft: cubic-bezier(0.32, 0.72, 0, 1);
  --rail-w: 68px;
  --r-card: 30px;

  color-scheme: light;
}

/* ---------------- accents ---------------- */
:root,
[data-accent='coral'] {
  --accent: #f0694f;
  --accent-2: #ff9b82;
  --accent-deep: #cf4b35;
}
[data-accent='teal'] {
  --accent: #13a487;
  --accent-2: #46d6b4;
  --accent-deep: #0b7a65;
}
[data-accent='ocean'] {
  --accent: #2f7cf6;
  --accent-2: #74a9ff;
  --accent-deep: #1d58cc;
}
[data-accent='amber'] {
  --accent: #e08a1e;
  --accent-2: #f8bd62;
  --accent-deep: #b86a0c;
}
[data-accent='violet'] {
  --accent: #7c5cf0;
  --accent-2: #ab95ff;
  --accent-deep: #5b3bd1;
}
:root {
  --c1: var(--accent);
  --c2: #4f7df5;
  --c3: #f0a23a;
  --c4: #2aa198;
}

/* ---------------- reset ---------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss03';
  overflow-x: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
button:disabled {
  cursor: default;
}
h1,
h2,
h3,
p {
  margin: 0;
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
img {
  display: block;
  max-width: 100%;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
::selection {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
}

/* ---------------- buttons ---------------- */
.btn {
  --mg-x: 0px;
  --mg-y: 0px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 14.5px;
  white-space: nowrap;
  translate: var(--mg-x) var(--mg-y);
  transition:
    translate 0.45s var(--ease),
    transform 0.3s var(--spring),
    background-color 0.25s,
    box-shadow 0.3s,
    opacity 0.2s;
}
.btn:active:not(:disabled) {
  transform: scale(0.95);
}
.btn.sm {
  height: 36px;
  padding: 0 14px;
  font-size: 13.5px;
}
.btn.lg {
  height: 52px;
  padding: 0 28px;
  font-size: 15.5px;
}
.btn.dark {
  background: var(--solid);
  color: var(--on-solid);
  box-shadow: 0 12px 26px -14px rgba(0, 0, 0, 0.6);
}
.btn.dark:hover:not(:disabled) {
  box-shadow: 0 16px 30px -12px rgba(0, 0, 0, 0.55);
}
.btn.glass {
  background: var(--soft);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--edge-card);
}
.btn.glass:hover {
  background: var(--soft-2);
}
.btn.peach {
  height: 50px;
  padding: 0 24px;
  background: linear-gradient(180deg, #ffb27d, var(--peach));
  color: #2a1609;
  font-weight: 600;
  font-size: 15.5px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 14px 30px -12px rgba(246, 140, 80, 0.75);
}
.btn.mint {
  background: linear-gradient(180deg, var(--accent-2), color-mix(in srgb, var(--accent-2) 70%, var(--accent)));
  color: #06261f;
  font-weight: 600;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 12px 26px -12px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn.mint:disabled {
  opacity: 0.85;
}
.icon-btn {
  --mg-x: 0px;
  --mg-y: 0px;
  position: relative;
  overflow: hidden;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--soft);
  box-shadow: inset 0 0 0 1px var(--edge-card);
  translate: var(--mg-x) var(--mg-y);
  transition:
    translate 0.45s var(--ease),
    transform 0.3s var(--spring),
    background-color 0.2s,
    color 0.2s;
}
.icon-btn:hover {
  background: var(--soft-2);
}
.icon-btn:active {
  transform: scale(0.88);
}
.icon-btn.solid {
  background: var(--solid);
  color: var(--on-solid);
  box-shadow: none;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  pointer-events: none;
  z-index: 0;
}

/* ---------------- avatars ---------------- */
.avatar {
  position: relative;
  flex-shrink: 0;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--accent-2), var(--accent-deep));
  color: #fff;
  font-weight: 600;
  font-size: calc(var(--s) * 0.36);
}
.avatar img,
.avatar b {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: grid;
  place-items: center;
}
.avatar.ring {
  box-shadow:
    0 0 0 2.5px var(--card-ring, rgba(255, 255, 255, 0.85)),
    0 0 0 4.5px var(--accent);
}
.avatar .online {
  position: absolute;
  right: 2%;
  bottom: 2%;
  width: 24%;
  height: 24%;
  min-width: 9px;
  min-height: 9px;
  border-radius: 50%;
  background: #22c37a;
  border: 2px solid #fff;
}
/* ---------------- odometer ---------------- */
.odo {
  display: inline-flex;
  align-items: flex-start;
  font-variant-numeric: tabular-nums;
  line-height: 1.12;
  white-space: nowrap;
}
.odo-col {
  display: inline-block;
  height: 1.12em;
  overflow: hidden;
  -webkit-mask: linear-gradient(transparent, #000 18%, #000 82%, transparent);
  mask: linear-gradient(transparent, #000 18%, #000 82%, transparent);
}
.odo-reel {
  display: flex;
  flex-direction: column;
  transform: translateY(calc(var(--n) * -1.12em));
  transition: transform 2s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--k) * 70ms);
}
.odo.settled .odo-reel {
  transition-duration: 1s;
  transition-delay: calc(var(--k) * 30ms);
}
.odo-reel > span {
  display: block;
  height: 1.12em;
  text-align: center;
}
.odo-fix.suf {
  margin-left: 0.04em;
}

/* ---------------- segmented control + tabs (the liquid pill) ---------------- */
.seg {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--soft);
  box-shadow: inset 0 0 0 1px var(--edge-card);
  isolation: isolate;
}
.seg button {
  position: relative;
  z-index: 1;
  height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  overflow: hidden;
  transition: color 0.35s;
}
.seg button[aria-pressed='true'] {
  color: var(--on-solid);
}
.seg .pill,
.tabs .pill,
.days .pill,
.month-grid .pill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  transition:
    transform 0.6s var(--ease),
    width 0.6s var(--ease),
    height 0.6s var(--ease),
    opacity 0.3s;
}
.seg .pill {
  border-radius: 999px;
  background: var(--solid);
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.6);
}
.seg.dark {
  background: color-mix(in srgb, var(--soft) 70%, transparent);
}

.tabs {
  position: relative;
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--line);
}
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  overflow: hidden;
  transition: color 0.3s;
}
.tab[aria-selected='true'] {
  color: var(--ink);
}
.tab em {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  animation: popIn 0.5s var(--spring);
}
.tabs .pill {
  border-radius: 2px;
}
.tabs .pill::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

/* ---------------- small atoms ---------------- */
.trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 24px;
  padding: 0 8px 0 6px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}
.trend.up {
  color: var(--green);
  background: var(--green-bg);
}
.trend.down {
  color: var(--red);
  background: var(--red-bg);
}

.spark {
  overflow: visible;
  color: var(--accent);
}
.spark.down {
  color: var(--red);
}
.spark-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.spark-area {
  opacity: 0;
}
.spark-dot {
  fill: currentColor;
  stroke: #fff;
  stroke-width: 2;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.spark.on .spark-line {
  animation: draw 1.4s var(--ease) forwards;
}
.spark.on .spark-area {
  animation: fade 1s ease 0.6s forwards;
}
.spark.on .spark-dot {
  animation: popIn 0.5s var(--spring) 1.2s forwards;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.dot.profit {
  background: var(--accent);
}
.dot.cost {
  background: var(--solid);
}

.count-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 10px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  vertical-align: 4px;
  color: var(--accent-deep);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.count-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

kbd {
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  color: inherit;
  opacity: 0.85;
}

.switch {
  position: relative;
  width: 52px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--line-2);
  transition: background-color 0.3s;
}
.switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  transition:
    translate 0.5s var(--spring),
    width 0.25s var(--ease);
}
.switch:active i {
  width: 30px;
}
.switch.on {
  background: var(--accent);
}
.switch.on i {
  translate: 22px 0;
}
.switch.on:active i {
  translate: 16px 0;
}

.swatch {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
[data-accent-swatch='teal'] {
  background: linear-gradient(135deg, #46d6b4, #13a487);
}
[data-accent-swatch='ocean'] {
  background: linear-gradient(135deg, #74a9ff, #2f7cf6);
}
[data-accent-swatch='amber'] {
  background: linear-gradient(135deg, #f8bd62, #e08a1e);
}
[data-accent-swatch='violet'] {
  background: linear-gradient(135deg, #ab95ff, #7c5cf0);
}
[data-accent-swatch='coral'] {
  background: linear-gradient(135deg, #ff9b82, #f0694f);
}

.burst-layer {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}

/* words that rise in, one after another */
.words .w {
  display: inline-block;
  animation: wordIn 0.9s var(--ease-out) both;
  animation-delay: calc(var(--base, 0ms) + var(--wd, 0ms) + 120ms + var(--w) * 90ms);
}
@keyframes wordIn {
  from {
    opacity: 0;
    transform: translateY(0.55em) rotate(4deg);
    filter: blur(10px);
  }
}

/* ---------------- shared keyframes ---------------- */
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes fade {
  to {
    opacity: 1;
  }
}
@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 1;
  }
}
@keyframes beat {
  50% {
    transform: scale(1.35);
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}
@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(-14px) scale(0.85);
  }
}

/* ---------------- reduced motion ---------------- */
[data-motion='reduced'] *,
[data-motion='reduced'] *::before,
[data-motion='reduced'] *::after {
  animation-duration: 0.01ms !important;
  animation-delay: 0ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  transition-delay: 0ms !important;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
