/*
 * GRAPHITE — LIVING METAL — "LIVING METAL"
 * Standalone enhancement layer for the existing Graphite theme.
 * Load AFTER app.css.
 *
 * Goals:
 * - visible, fun motion
 * - Card-like specular highlights
 * - tactile neumorphism
 * - jumping / pulsing navigation
 * - animated charts
 * - zero text/value rewriting
 */

:root[data-theme="graphite"] {
  --graphite-bg:#1c1e23;
  --graphite-hi:#272a31;
  --graphite-lo:#131519;
  --graphite-panel:#1c1e23;
  --graphite-text:#e7e9ee;
  --graphite-muted:#82868f;
  --graphite-blue:#6ec3ff;
  --graphite-blue-soft:rgba(110,195,255,.18);
  --graphite-warm:#d9bd8c;
  --graphite-nav-x:0px;
  --graphite-nav-w:24px;
}


/* =========================================================
   AMBIENT BACKGROUND
========================================================= */

[data-theme="graphite"] body {
  position:relative;
  isolation:isolate;
}

[data-theme="graphite"] body::before {
  content:"";
  position:fixed;
  inset:-18vh -18vw;
  z-index:-2;
  pointer-events:none;
  background:
    radial-gradient(
      38vw 28vh at 18% 16%,
      rgba(110,195,255,.10),
      transparent 68%
    ),
    radial-gradient(
      34vw 28vh at 82% 62%,
      rgba(110,195,255,.045),
      transparent 72%
    );
  animation:graphiteAmbient 10s ease-in-out infinite alternate;
  will-change:transform;
}

@keyframes graphiteAmbient {
  0% { transform:translate3d(-2vw,-1vh,0) scale(1); }
  50% { transform:translate3d(2.5vw,1vh,0) scale(1.035); }
  100% { transform:translate3d(4vw,-1.5vh,0) scale(1.015); }
}


/* =========================================================
   CARD-LIKE SPECULAR HIGHLIGHTS
========================================================= */

[data-theme="graphite"] :is(
  .balance-hero,
  .income-expense-card,
  .metric,
  .dynamics-stat,
  .settings-block,
  .debt-card,
  .debt-summary-card,
  .expense-template-card,
  .template-suggestion-box
).graphite-metal {
  position:relative !important;
  overflow:hidden !important;
  isolation:isolate;
}

[data-theme="graphite"] :is(
  .balance-hero,
  .income-expense-card,
  .metric,
  .dynamics-stat,
  .settings-block,
  .debt-card,
  .debt-summary-card,
  .expense-template-card,
  .template-suggestion-box
).graphite-metal::after {
  content:"";
  position:absolute;
  top:-28%;
  bottom:-28%;
  left:-42%;
  width:25%;
  z-index:10;
  pointer-events:none;
  transform:skewX(-18deg);
  opacity:0;
  background:
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(255,255,255,.02) 18%,
      rgba(255,255,255,.15) 48%,
      rgba(110,195,255,.12) 62%,
      transparent 100%
    );
  filter:blur(.2px);
}

[data-theme="graphite"] .graphite-metal.graphite-shine::after {
  animation:graphiteSpecular 1.05s cubic-bezier(.2,.65,.25,1);
}

@keyframes graphiteSpecular {
  0% { left:-42%; opacity:0; }
  12% { opacity:.75; }
  78% { opacity:.34; }
  100% { left:122%; opacity:0; }
}


/* HERO gets a stronger Card-like shine */
[data-theme="graphite"] .balance-hero {
  position:relative !important;
  transform:translateZ(0);
  background:
    radial-gradient(
      120% 110% at 18% -10%,
      rgba(110,195,255,.085),
      transparent 56%
    ),
    linear-gradient(
      145deg,
      #202329 0%,
      #1b1d22 52%,
      #181a1f 100%
    ) !important;
  box-shadow:
    10px 12px 24px rgba(8,9,11,.55),
    -7px -7px 17px rgba(48,52,61,.55),
    inset 0 1px 0 rgba(255,255,255,.035) !important;
  animation:graphiteHeroBreath 4.8s ease-in-out infinite alternate;
}

@keyframes graphiteHeroBreath {
  from {
    box-shadow:
      10px 12px 24px rgba(8,9,11,.55),
      -7px -7px 17px rgba(48,52,61,.55),
      inset 0 1px 0 rgba(255,255,255,.035);
  }
  to {
    box-shadow:
      12px 15px 29px rgba(8,9,11,.62),
      -8px -8px 20px rgba(50,56,66,.62),
      inset 0 1px 0 rgba(255,255,255,.055),
      0 0 22px rgba(110,195,255,.055);
  }
}


/* =========================================================
   ENTRANCE CHOREOGRAPHY
========================================================= */

[data-theme="graphite"] .graphite-rise {
  animation:graphiteRise .64s cubic-bezier(.2,.78,.22,1) both;
  animation-delay:var(--graphite-delay,0ms);
}

@keyframes graphiteRise {
  0% {
    opacity:0;
    transform:translate3d(0,18px,0) scale(.975);
    filter:blur(2px);
  }
  65% {
    opacity:1;
    transform:translate3d(0,-2px,0) scale(1.005);
    filter:blur(0);
  }
  100% {
    opacity:1;
    transform:translate3d(0,0,0) scale(1);
  }
}


/* =========================================================
   TACTILE PRESS / HOVER
========================================================= */

[data-theme="graphite"] .graphite-press {
  transform:translateZ(0);
  transition:
    transform .14s cubic-bezier(.2,.8,.2,1),
    box-shadow .14s ease,
    filter .14s ease !important;
  -webkit-tap-highlight-color:transparent;
}

@media (hover:hover) {
  [data-theme="graphite"] .graphite-press:hover {
    transform:translateY(-2px) scale(1.008);
    filter:brightness(1.035);
  }
}

[data-theme="graphite"] .graphite-press.graphite-down {
  transform:translateY(2px) scale(.975) !important;
  filter:brightness(.95);
  box-shadow:
    inset 5px 5px 10px var(--graphite-lo),
    inset -4px -4px 9px var(--graphite-hi) !important;
}


/* =========================================================
   ACTIVE CONTROLS — PULSE / GLOSS
========================================================= */

[data-theme="graphite"] :is(
  .theme-option.active,
  .chart-style-option.active,
  .theme-bar-item.selected,
  .nav-item.active
) {
  position:relative;
}

[data-theme="graphite"] :is(
  .theme-option.active,
  .chart-style-option.active
) {
  animation:graphiteControlPulse 1.9s ease-in-out infinite;
}

@keyframes graphiteControlPulse {
  0%,100% {
    box-shadow:
      inset 0 0 0 1px rgba(110,195,255,.48),
      0 0 0 rgba(110,195,255,0);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(110,195,255,.85),
      0 0 16px rgba(110,195,255,.14);
  }
}


/* =========================================================
   BOTTOM NAV — BOUNCE + MOVING LIGHT
========================================================= */

[data-theme="graphite"] .nav-inner {
  position:relative !important;
  isolation:isolate;
}

[data-theme="graphite"] .nav-inner::after {
  content:"";
  position:absolute;
  left:0;
  bottom:5px;
  z-index:0;
  width:var(--graphite-nav-w);
  height:4px;
  border-radius:999px;
  transform:translate3d(var(--graphite-nav-x),0,0);
  background:
    linear-gradient(
      90deg,
      rgba(110,195,255,.10),
      #6ec3ff 50%,
      rgba(110,195,255,.10)
    );
  box-shadow:
    0 0 8px rgba(110,195,255,.55),
    0 0 18px rgba(110,195,255,.18);
  transition:
    transform .34s cubic-bezier(.2,.9,.25,1.2),
    width .28s cubic-bezier(.2,.8,.2,1);
}

[data-theme="graphite"] .nav-item {
  z-index:1;
  transition:
    transform .2s cubic-bezier(.2,.85,.25,1.2),
    color .2s ease,
    filter .2s ease !important;
}

[data-theme="graphite"] .nav-item.active {
  transform:translateY(-3px);
  filter:drop-shadow(0 0 6px rgba(110,195,255,.25));
}

[data-theme="graphite"] .nav-item.graphite-nav-bounce {
  animation:graphiteNavBounce .55s cubic-bezier(.22,.9,.28,1.25);
}

@keyframes graphiteNavBounce {
  0% { transform:translateY(0) scale(1); }
  35% { transform:translateY(-9px) scale(1.09); }
  58% { transform:translateY(1px) scale(.98); }
  78% { transform:translateY(-4px) scale(1.03); }
  100% { transform:translateY(-3px) scale(1); }
}


/* =========================================================
   HERO VALUE — PURE VISUAL PULSE, NO TEXT REWRITING
========================================================= */

[data-theme="graphite"] .hero-value.graphite-value-pulse {
  animation:graphiteValuePulse .55s cubic-bezier(.2,.8,.2,1);
}

@keyframes graphiteValuePulse {
  0% { transform:scale(.94); opacity:.55; filter:blur(1px); }
  55% { transform:scale(1.035); opacity:1; filter:blur(0); }
  100% { transform:scale(1); }
}


/* =========================================================
   CHART — DRAW, PULSE, CROSSHAIR
========================================================= */

[data-theme="graphite"] .user-chart-line.graphite-draw {
  stroke-dasharray:var(--graphite-path-length,1000);
  stroke-dashoffset:var(--graphite-path-length,1000);
  animation:graphiteDrawLine .9s cubic-bezier(.25,.75,.2,1) forwards;
}

@keyframes graphiteDrawLine {
  to { stroke-dashoffset:0; }
}

[data-theme="graphite"] .user-chart-area.graphite-area-in {
  animation:graphiteAreaIn .75s ease-out .18s both;
}

@keyframes graphiteAreaIn {
  from { opacity:0 !important; }
}

[data-theme="graphite"] .user-chart-selected {
  filter:
    drop-shadow(0 0 4px rgba(110,195,255,.70))
    drop-shadow(0 0 12px rgba(110,195,255,.25)) !important;
}

[data-theme="graphite"] .user-chart-selected.show {
  animation:graphitePointPulse 1.35s ease-in-out infinite;
}

@keyframes graphitePointPulse {
  0%,100% { r:5px; }
  50% { r:7px; }
}

[data-theme="graphite"] .graphite-crosshair {
  stroke:rgba(110,195,255,.30);
  stroke-width:1;
  stroke-dasharray:3 4;
  opacity:0;
  pointer-events:none;
  vector-effect:non-scaling-stroke;
  transition:opacity .15s ease;
}

[data-theme="graphite"] .graphite-crosshair.show {
  opacity:1;
}


/* Bar charts grow in with a bounce */
[data-theme="graphite"] .theme-bar-item.graphite-bar-in .theme-bar-stick {
  transform-origin:bottom center;
  animation:graphiteBarGrow .62s cubic-bezier(.18,.78,.22,1.15) both;
  animation-delay:var(--graphite-bar-delay,0ms);
}

@keyframes graphiteBarGrow {
  from { transform:scaleY(.02); opacity:.18; }
  75% { transform:scaleY(1.06); opacity:1; }
  to { transform:scaleY(1); opacity:1; }
}

[data-theme="graphite"] .theme-bar-item.selected .theme-bar-stick {
  animation:graphiteSelectedBar 1.2s ease-in-out infinite;
}

@keyframes graphiteSelectedBar {
  0%,100% {
    box-shadow:0 0 7px rgba(110,195,255,.25);
    filter:brightness(1);
  }
  50% {
    box-shadow:
      0 0 11px rgba(110,195,255,.60),
      0 0 24px rgba(110,195,255,.18);
    filter:brightness(1.16);
  }
}


/* =========================================================
   CATEGORY / LIST CASCADE
========================================================= */

[data-theme="graphite"] .graphite-list-in {
  animation:graphiteListIn .46s cubic-bezier(.2,.78,.2,1) both;
  animation-delay:var(--graphite-list-delay,0ms);
}

@keyframes graphiteListIn {
  from {
    opacity:0;
    transform:translate3d(-10px,6px,0);
  }
  to {
    opacity:1;
    transform:translate3d(0,0,0);
  }
}

[data-theme="graphite"] .theme-cat-meter i.graphite-meter {
  transform-origin:left center;
  animation:graphiteMeter 1s cubic-bezier(.16,.8,.2,1) both;
}

@keyframes graphiteMeter {
  from { transform:scaleX(.02); filter:brightness(.75); }
  70% { filter:brightness(1.35); }
  to { transform:scaleX(1); filter:brightness(1); }
}


/* =========================================================
   BUTTON GLINT
========================================================= */

[data-theme="graphite"] :is(
  .btn-primary,
  .settings-add,
  .chart-style-option.active
) {
  position:relative;
  overflow:hidden;
}

[data-theme="graphite"] :is(
  .btn-primary,
  .settings-add,
  .chart-style-option.active
)::after {
  content:"";
  position:absolute;
  inset:-40% auto -40% -35%;
  width:24%;
  transform:skewX(-16deg);
  pointer-events:none;
  background:linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,.18),
    transparent
  );
  animation:graphiteButtonGlint 4.2s ease-in-out infinite;
}

@keyframes graphiteButtonGlint {
  0%,72% { left:-35%; opacity:0; }
  78% { opacity:.7; }
  92% { left:122%; opacity:.18; }
  100% { left:122%; opacity:0; }
}


/* =========================================================
   SHEETS / MODALS
========================================================= */

[data-theme="graphite"] .sheet.graphite-sheet-in {
  animation:graphiteSheetIn .38s cubic-bezier(.18,.82,.24,1) both;
}

@keyframes graphiteSheetIn {
  from {
    opacity:.3;
    transform:translate3d(0,28px,0) scale(.985);
  }
  to {
    opacity:1;
    transform:translate3d(0,0,0) scale(1);
  }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion:reduce) {
  [data-theme="graphite"] *,
  [data-theme="graphite"] *::before,
  [data-theme="graphite"] *::after {
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    scroll-behavior:auto !important;
  }
}


/* =========================================================
   GRAPHITE — LIVING METAL
   Production polish layer
   ========================================================= */

:root[data-theme="graphite"] {
  --graphite-bg: #1b1d22;
  --graphite-bg-elevated: #1f2228;

  --graphite-surface: #1d2025;
  --graphite-surface-hi: #252930;
  --graphite-surface-lo: #17191e;

  --graphite-text: #eceef3;
  --graphite-muted: #8d929c;

  --graphite-steel: #aeb9c6;
  --graphite-blue: #74c5ff;
  --graphite-blue-soft: rgba(116,197,255,.16);

  --graphite-warm: #d2b17d;
  --graphite-danger: #c97d79;

  --graphite-shadow-dark: rgba(7,8,10,.58);
  --graphite-shadow-light: rgba(48,53,62,.42);

  --graphite-radius-sm: 12px;
  --graphite-radius-md: 17px;
  --graphite-radius-lg: 23px;

  --graphite-ease: cubic-bezier(.2,.78,.22,1);
  --graphite-spring: cubic-bezier(.22,.88,.28,1.16);

  --bg: var(--graphite-bg);
  --card: var(--graphite-surface);
  --card2: var(--graphite-bg-elevated);
  --text: var(--graphite-text);
  --muted: var(--graphite-muted);
  --accent: var(--graphite-blue);
  --income: var(--graphite-blue);
  --danger: var(--graphite-danger);
}


/* =========================================================
   BACKGROUND
   ========================================================= */

[data-theme="graphite"] body {
  background:
    radial-gradient(
      90% 55% at 4% -8%,
      rgba(116,197,255,.075),
      transparent 64%
    ),
    radial-gradient(
      70% 55% at 104% 46%,
      rgba(174,185,198,.035),
      transparent 66%
    ),
    repeating-linear-gradient(
      118deg,
      rgba(255,255,255,.006) 0,
      rgba(255,255,255,.006) 1px,
      transparent 1px,
      transparent 4px
    ),
    linear-gradient(
      180deg,
      #1d1f24 0%,
      #1a1c21 52%,
      #181a1e 100%
    ) !important;
}


/* =========================================================
   TYPOGRAPHY / MONEY
   ========================================================= */

[data-theme="graphite"] :is(
  .hero-value,
  .income-expense-value,
  .metric-value,
  .dynamics-stat-value,
  .theme-cat-value,
  .expense-amount,
  .operations-summary-value,
  .debt-hero-value,
  .debt-summary-value
) {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

[data-theme="graphite"] .hero-value {
  color: var(--graphite-text) !important;
  font-weight: 760;
  letter-spacing: -.035em;
  text-shadow:
    0 1px 0 rgba(255,255,255,.035),
    0 10px 26px rgba(0,0,0,.20);
}

[data-theme="graphite"] .hero-label,
[data-theme="graphite"] :is(
  .metric-label,
  .income-expense-label,
  .dynamics-stat-label,
  .settings-hint
) {
  color: var(--graphite-muted);
  letter-spacing: .01em;
}

[data-theme="graphite"] .income-value,
[data-theme="graphite"] .income-amount,
[data-theme="graphite"] .income-text {
  color: var(--graphite-blue) !important;
}

[data-theme="graphite"] .expense-value {
  color: var(--graphite-warm) !important;
}


/* =========================================================
   UNIFIED MACHINED SURFACE
   ========================================================= */

[data-theme="graphite"] :is(
  .income-expense-card,
  .metric,
  .dynamics-stat,
  .settings-block,
  .operations-summary-item,
  .recurring-payment,
  .debt-summary-card,
  .debt-card,
  .expense-template-card,
  .template-suggestion-box,
  .previous-month-card
) {
  border:
    1px solid
    rgba(174,185,198,.075) !important;

  background:
    radial-gradient(
      120% 95% at 0% 0%,
      rgba(255,255,255,.026),
      transparent 45%
    ),
    linear-gradient(
      145deg,
      #202329 0%,
      #1c1f24 54%,
      #191b20 100%
    ) !important;

  box-shadow:
    7px 8px 17px rgba(7,8,10,.36),
    -5px -5px 13px rgba(47,51,59,.23),
    inset 0 1px 0 rgba(255,255,255,.027),
    inset 0 -1px 0 rgba(0,0,0,.22) !important;
}


/* =========================================================
   HERO — MAIN SHOWCASE SURFACE
   ========================================================= */

[data-theme="graphite"] .balance-hero {
  border:
    1px solid
    rgba(174,185,198,.095) !important;

  border-radius:
    var(--graphite-radius-lg) !important;

  background:
    radial-gradient(
      125% 105% at 12% -12%,
      rgba(116,197,255,.115),
      transparent 48%
    ),
    radial-gradient(
      70% 100% at 100% 100%,
      rgba(210,177,125,.032),
      transparent 64%
    ),
    linear-gradient(
      142deg,
      #24272e 0%,
      #1e2127 27%,
      #1a1c21 67%,
      #17191e 100%
    ) !important;

  box-shadow:
    12px 15px 31px rgba(6,7,9,.53),
    -7px -7px 18px rgba(51,56,66,.42),
    inset 0 1px 0 rgba(255,255,255,.055),
    inset 1px 0 0 rgba(255,255,255,.018),
    inset 0 -1px 0 rgba(0,0,0,.36) !important;

  animation:
    graphiteHeroBreath 10.5s
    ease-in-out infinite alternate !important;
}

[data-theme="graphite"] .balance-hero::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;

  background:
    linear-gradient(
      118deg,
      rgba(255,255,255,.045),
      transparent 17%,
      transparent 71%,
      rgba(116,197,255,.018)
    );

  opacity: .62;
}

[data-theme="graphite"] .balance-hero > * {
  position: relative;
  z-index: 2;
}

@keyframes graphiteHeroBreath {
  from {
    box-shadow:
      11px 14px 29px rgba(6,7,9,.51),
      -7px -7px 17px rgba(51,56,66,.39),
      inset 0 1px 0 rgba(255,255,255,.048),
      inset 0 -1px 0 rgba(0,0,0,.34);
  }

  to {
    box-shadow:
      13px 17px 34px rgba(6,7,9,.59),
      -8px -8px 20px rgba(53,59,69,.44),
      inset 0 1px 0 rgba(255,255,255,.062),
      inset 0 -1px 0 rgba(0,0,0,.38),
      0 0 24px rgba(116,197,255,.048);
  }
}


/* =========================================================
   SPECULAR
   ========================================================= */

[data-theme="graphite"] .graphite-metal::after {
  width: 20% !important;

  background:
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(255,255,255,.015) 16%,
      rgba(218,231,244,.13) 45%,
      rgba(116,197,255,.105) 61%,
      rgba(255,255,255,.025) 75%,
      transparent 100%
    ) !important;

  filter: blur(1.1px) !important;
}

[data-theme="graphite"] .balance-hero.graphite-metal::after {
  width: 23% !important;
}


/* =========================================================
   SUMMARY
   ========================================================= */

[data-theme="graphite"] .income-expense-summary,
[data-theme="graphite"] .metrics {
  gap: 11px;
}

[data-theme="graphite"] .income-expense-card,
[data-theme="graphite"] .metric {
  position: relative;
  border-radius:
    var(--graphite-radius-md) !important;
}

[data-theme="graphite"] .income-expense-card:first-child {
  background:
    radial-gradient(
      90% 90% at 0 0,
      rgba(116,197,255,.055),
      transparent 55%
    ),
    linear-gradient(
      145deg,
      #20242a,
      #1a1d22
    ) !important;
}

[data-theme="graphite"] .income-expense-card:last-child {
  background:
    radial-gradient(
      90% 90% at 100% 0,
      rgba(210,177,125,.04),
      transparent 56%
    ),
    linear-gradient(
      145deg,
      #202329,
      #1a1c21
    ) !important;
}


/* =========================================================
   SECTIONS
   ========================================================= */

[data-theme="graphite"] #overviewView > .section {
  border-radius: 20px;
}

[data-theme="graphite"] .section-title {
  color: #dfe3e9;
  letter-spacing: -.018em;
}

[data-theme="graphite"] .section-head {
  position: relative;
}


/* =========================================================
   CHART SURFACE
   ========================================================= */

[data-theme="graphite"] .themed-chart-graphite,
[data-theme="graphite"] .user-line-chart {
  position: relative;
}

[data-theme="graphite"] .theme-bars {
  gap: 4px;
}

[data-theme="graphite"] .theme-bar-stick {
  background:
    linear-gradient(
      180deg,
      rgba(143,183,213,.68),
      rgba(83,119,145,.36)
    ) !important;

  box-shadow:
    inset 1px 0 0 rgba(255,255,255,.12),
    inset -1px 0 0 rgba(0,0,0,.18);

  border-radius:
    5px 5px 2px 2px !important;
}

[data-theme="graphite"]
.theme-bar-item.peak
.theme-bar-stick {
  background:
    linear-gradient(
      180deg,
      #92d4ff,
      #4e89b0
    ) !important;
}

[data-theme="graphite"]
.theme-bar-item.selected
.theme-bar-stick {
  background:
    linear-gradient(
      180deg,
      #a6dcff,
      #5e9ac2
    ) !important;
}

[data-theme="graphite"] .user-chart-line,
[data-theme="graphite"] .line-chart-path {
  stroke: var(--graphite-blue) !important;

  filter:
    drop-shadow(
      0 0 3px
      rgba(116,197,255,.32)
    );
}

[data-theme="graphite"] .user-chart-area,
[data-theme="graphite"] .line-chart-area {
  opacity: .16;
}

[data-theme="graphite"] .user-chart-selected,
[data-theme="graphite"] .line-chart-selected-point {
  fill: #d9efff !important;
  stroke: var(--graphite-blue) !important;
}


/* TOOLTIP — preserve JS positioning */
[data-theme="graphite"] .line-chart-tooltip {
  border:
    1px solid
    rgba(116,197,255,.16) !important;

  background:
    linear-gradient(
      145deg,
      rgba(35,39,46,.97),
      rgba(24,27,32,.97)
    ) !important;

  color:
    var(--graphite-text) !important;

  box-shadow:
    0 12px 28px rgba(5,6,8,.42),
    inset 0 1px 0 rgba(255,255,255,.035) !important;

  backdrop-filter:
    blur(14px);

  -webkit-backdrop-filter:
    blur(14px);
}


/* =========================================================
   CATEGORY ROWS
   ========================================================= */

[data-theme="graphite"] .theme-category-list {
  display: grid;
  gap: 8px;
}

[data-theme="graphite"] .theme-cat-row,
[data-theme="graphite"] .settings-category {
  border:
    1px solid
    rgba(174,185,198,.065) !important;

  border-radius:
    15px !important;

  background:
    linear-gradient(
      145deg,
      rgba(34,37,43,.90),
      rgba(25,27,32,.92)
    ) !important;

  box-shadow:
    4px 5px 11px rgba(7,8,10,.24),
    inset 0 1px 0 rgba(255,255,255,.022) !important;
}

[data-theme="graphite"] .theme-cat-row {
  padding: 11px 12px !important;
}

[data-theme="graphite"] .theme-cat-icon,
[data-theme="graphite"] .settings-category-emoji {
  background:
    linear-gradient(
      145deg,
      #24272d,
      #191c20
    ) !important;

  border:
    1px solid
    rgba(174,185,198,.075) !important;

  box-shadow:
    inset 2px 2px 5px rgba(7,8,10,.22),
    inset -2px -2px 5px rgba(53,58,68,.20);
}

[data-theme="graphite"] .theme-cat-meter {
  background:
    rgba(7,8,10,.40) !important;

  box-shadow:
    inset 1px 1px 3px rgba(0,0,0,.42) !important;
}

[data-theme="graphite"] .theme-cat-meter i {
  background:
    linear-gradient(
      90deg,
      color-mix(
        in srgb,
        var(--cat-color, var(--graphite-blue)) 68%,
        #687582
      ),
      var(--cat-color, var(--graphite-blue))
    ) !important;
}


/* =========================================================
   CONTROLS / SETTINGS
   ========================================================= */

[data-theme="graphite"] :is(
  .dynamics-switch,
  .operations-segment,
  .operations-search,
  .operations-category-select,
  .chart-style-picker
) {
  border-color:
    rgba(174,185,198,.075) !important;

  background:
    linear-gradient(
      145deg,
      #1a1d21,
      #202329
    ) !important;

  box-shadow:
    inset 3px 3px 7px rgba(7,8,10,.30),
    inset -2px -2px 6px rgba(47,52,61,.18) !important;
}

[data-theme="graphite"] :is(
  input,
  select,
  textarea
) {
  color:
    var(--graphite-text) !important;

  background:
    linear-gradient(
      145deg,
      #191b20,
      #1e2126
    ) !important;

  border:
    1px solid
    rgba(174,185,198,.075) !important;

  box-shadow:
    inset 3px 3px 7px rgba(6,7,9,.32),
    inset -2px -2px 5px rgba(51,56,65,.15) !important;
}

[data-theme="graphite"] :is(
  input,
  select,
  textarea
):focus {
  border-color:
    rgba(116,197,255,.30) !important;

  box-shadow:
    inset 3px 3px 7px rgba(6,7,9,.32),
    inset -2px -2px 5px rgba(51,56,65,.15),
    0 0 0 2px rgba(116,197,255,.055) !important;

  outline: none;
}

[data-theme="graphite"] :is(
  .dynamics-switch-btn.active,
  .chart-style-option.active
) {
  color:
    #dff2ff !important;

  background:
    linear-gradient(
      145deg,
      rgba(80,128,161,.40),
      rgba(42,74,96,.34)
    ) !important;

  box-shadow:
    inset 0 0 0 1px rgba(116,197,255,.23),
    0 0 14px rgba(116,197,255,.07) !important;
}


/* Disable permanent showcase-demo pulse */
[data-theme="graphite"] :is(
  .theme-option.active,
  .chart-style-option.active
) {
  animation: none !important;
}


/* No permanent button shimmer */
[data-theme="graphite"] :is(
  .btn-primary,
  .settings-add,
  .chart-style-option.active
)::after {
  animation: none !important;
}


/* =========================================================
   BUTTONS
   ========================================================= */

[data-theme="graphite"] :is(
  .btn,
  .small-btn,
  .settings-add,
  .sheet-close
) {
  border:
    1px solid
    rgba(174,185,198,.075) !important;

  background:
    linear-gradient(
      145deg,
      #23262c,
      #191b20
    ) !important;

  color:
    var(--graphite-text);

  box-shadow:
    4px 5px 10px rgba(6,7,9,.30),
    -3px -3px 8px rgba(48,53,62,.18),
    inset 0 1px 0 rgba(255,255,255,.025) !important;
}

[data-theme="graphite"] .btn-primary {
  border:
    1px solid
    rgba(116,197,255,.24) !important;

  background:
    linear-gradient(
      145deg,
      #3f789e,
      #285979
    ) !important;

  color:
    #f3faff !important;

  box-shadow:
    5px 7px 15px rgba(5,8,11,.36),
    inset 0 1px 0 rgba(255,255,255,.12),
    0 0 18px rgba(116,197,255,.065) !important;
}


/* =========================================================
   OPERATIONS / RECURRING / DEBTS
   ========================================================= */

[data-theme="graphite"] .history-expense {
  border-color:
    rgba(174,185,198,.055) !important;
}

[data-theme="graphite"] :is(
  .recurring-payment,
  .debt-card,
  .expense-template-card
) {
  border-radius:
    var(--graphite-radius-md) !important;
}

[data-theme="graphite"] .recurring-next-line {
  color:
    var(--graphite-blue) !important;
}


/* =========================================================
   BOTTOM NAV
   ========================================================= */

[data-theme="graphite"] .nav-inner {
  border:
    1px solid
    rgba(174,185,198,.085) !important;

  background:
    linear-gradient(
      180deg,
      rgba(35,38,44,.96),
      rgba(24,26,31,.97)
    ) !important;

  box-shadow:
    0 10px 30px rgba(4,5,7,.38),
    -3px -3px 10px rgba(49,54,63,.18),
    inset 0 1px 0 rgba(255,255,255,.028) !important;

  backdrop-filter:
    blur(14px);

  -webkit-backdrop-filter:
    blur(14px);
}

[data-theme="graphite"] .nav-item {
  color:
    var(--graphite-muted);
}

[data-theme="graphite"] .nav-item.active {
  color:
    #dcefff !important;

  background:
    transparent !important;
}


/* Strong enough to be visible, still not cartoonish */
@keyframes graphiteNavBounce {
  0% {
    transform:
      translateY(-3px)
      scale(1);
  }

  34% {
    transform:
      translateY(-7px)
      scale(1.08);
  }

  58% {
    transform:
      translateY(1px)
      scale(.99);
  }

  79% {
    transform:
      translateY(-4px)
      scale(1.025);
  }

  100% {
    transform:
      translateY(-3px)
      scale(1);
  }
}


/* =========================================================
   SHEETS
   IMPORTANT:
   NO overflow/max-height/sticky/touch-action overrides here.
   Global sheet fix from app.css stays authoritative.
   ========================================================= */

[data-theme="graphite"] .sheet-overlay > .sheet {
  border:
    1px solid
    rgba(174,185,198,.085) !important;

  border-bottom:
    0 !important;

  background:
    radial-gradient(
      110% 70% at 0% 0%,
      rgba(116,197,255,.045),
      transparent 52%
    ),
    linear-gradient(
      160deg,
      #23262c,
      #1a1c21 55%
    ) !important;

  box-shadow:
    0 -20px 48px rgba(4,5,7,.48),
    inset 0 1px 0 rgba(255,255,255,.035) !important;
}

[data-theme="graphite"]
.sheet-overlay
.sheet-buttons {
  background:
    linear-gradient(
      180deg,
      rgba(29,32,37,.88),
      rgba(26,28,33,.98)
    ) !important;

  backdrop-filter:
    blur(12px);

  -webkit-backdrop-filter:
    blur(12px);
}


/* =========================================================
   THEME PICKER PREVIEW
   ========================================================= */

.theme-preview-graphite {
  position: relative;
  overflow: hidden;

  background:
    radial-gradient(
      circle at 24% 20%,
      rgba(116,197,255,.25),
      transparent 34%
    ),
    linear-gradient(
      145deg,
      #2c3037,
      #1d2025 46%,
      #121418
    ) !important;

  border:
    1px solid
    rgba(174,185,198,.20) !important;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.07);
}

.theme-preview-graphite::after {
  content: "";
  position: absolute;
  top: -40%;
  bottom: -40%;
  left: 20%;
  width: 14%;

  transform:
    skewX(-18deg);

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(216,234,248,.32),
      transparent
    );
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 430px) {
  [data-theme="graphite"] .balance-hero {
    border-radius: 21px !important;
  }

  [data-theme="graphite"] .hero-value {
    font-size:
      clamp(32px, 10.5vw, 44px);
  }
}

@media (max-width: 360px) {
  [data-theme="graphite"] .income-expense-summary,
  [data-theme="graphite"] .metrics {
    gap: 8px;
  }

  [data-theme="graphite"] .theme-cat-row {
    padding:
      10px 9px !important;
  }
}

@media (max-width: 330px) {
  [data-theme="graphite"] .hero-value {
    font-size:
      31px;
  }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  [data-theme="graphite"] .balance-hero {
    animation:
      none !important;
  }

  [data-theme="graphite"] .nav-inner::after {
    transition:
      none !important;
  }

  [data-theme="graphite"] .graphite-crosshair {
    transition:
      none !important;
  }
}



/* =========================================================
   GRAPHITE OVERVIEW — V6
   ========================================================= */

[data-theme="graphite"] #overviewView.active {
  display:block;
}

[data-theme="graphite"] #overviewView > .top,
[data-theme="graphite"] #overviewView > .balance-hero,
[data-theme="graphite"] #overviewView > .income-expense-summary,
[data-theme="graphite"] #overviewView > .metrics,
[data-theme="graphite"] #overviewView > .section {
  display:none !important;
}

[data-theme="graphite"] .graphite-overview-v6 {
  display:block;
  padding-bottom:18px;
}

[data-theme="graphite"] .graphite-v6-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

[data-theme="graphite"] .graphite-v6-logo {
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  color:var(--graphite-text);
  font-size:25px;
  line-height:1;
  font-weight:780;
  letter-spacing:-.035em;
}

[data-theme="graphite"] .graphite-v6-period {
  color:var(--graphite-muted);
  font-size:15px;
  white-space:nowrap;
}


/* HERO */

[data-theme="graphite"] .graphite-v6-hero {
  position:relative;
  overflow:hidden;
  border-radius:24px;
  border:1px solid rgba(143,181,213,.18);
  background:
    linear-gradient(
      180deg,
      #172433,
      #101820 53%,
      #0d1218
    );
  box-shadow:
    0 22px 44px rgba(3,5,8,.42),
    inset 0 1px 0 rgba(255,255,255,.045);
  isolation:isolate;
}

[data-theme="graphite"] .graphite-v6-landscape {
  position:absolute;
  inset:0 0 116px;
  z-index:0;
  pointer-events:none;
}

[data-theme="graphite"] .graphite-v6-landscape svg {
  display:block;
  width:100%;
  height:100%;
}

[data-theme="graphite"] .graphite-v6-hero-shade {
  position:absolute;
  inset:0;
  z-index:1;
  pointer-events:none;
  background:
    linear-gradient(
      180deg,
      rgba(6,10,16,.02) 0%,
      rgba(5,8,12,.08) 45%,
      rgba(5,8,12,.58) 70%,
      #0d1218 100%
    );
}

[data-theme="graphite"] .graphite-v6-hero-main {
  position:relative;
  z-index:3;
  min-height:324px;
  padding:18px 22px 22px;
  display:flex;
  flex-direction:column;
}

[data-theme="graphite"] .graphite-v6-period-pill {
  align-self:flex-start;
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:8px 12px;
  border-radius:999px;
  color:#aebac7;
  font-size:13px;
  border:1px solid rgba(181,209,233,.13);
  background:rgba(12,20,29,.38);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}

[data-theme="graphite"] .graphite-v6-signal {
  position:absolute;
  top:21px;
  right:22px;
  display:flex;
  align-items:flex-end;
  gap:4px;
  height:22px;
}

[data-theme="graphite"] .graphite-v6-signal i {
  display:block;
  width:4px;
  border-radius:999px;
  background:#68bdff;
  box-shadow:0 0 9px rgba(104,189,255,.24);
}

[data-theme="graphite"] .graphite-v6-signal i:nth-child(1){height:9px}
[data-theme="graphite"] .graphite-v6-signal i:nth-child(2){height:14px}
[data-theme="graphite"] .graphite-v6-signal i:nth-child(3){height:7px;opacity:.35}
[data-theme="graphite"] .graphite-v6-signal i:nth-child(4){height:17px}
[data-theme="graphite"] .graphite-v6-signal i:nth-child(5){height:12px}
[data-theme="graphite"] .graphite-v6-signal i:nth-child(6){height:21px}

[data-theme="graphite"] .graphite-v6-balance {
  margin:auto 0 42px;
  text-align:center;
}

[data-theme="graphite"] .graphite-v6-balance-label {
  color:#a7b1bd;
  text-transform:uppercase;
  font-size:12px;
  letter-spacing:.08em;
}

[data-theme="graphite"] .graphite-v6-balance-value {
  margin-top:10px;
  color:#f1f4f8;
  font-size:48px;
  line-height:1;
  font-weight:760;
  letter-spacing:-.045em;
  font-variant-numeric:tabular-nums;
  text-shadow:
    0 12px 32px rgba(0,0,0,.34),
    0 0 28px rgba(124,193,244,.06);
}

[data-theme="graphite"] .graphite-v6-flow {
  margin-top:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-size:14px;
}

[data-theme="graphite"] .graphite-v6-flow-expense {
  color:#d9a071;
}

[data-theme="graphite"] .graphite-v6-flow-arrow {
  color:#dde5ed;
  opacity:.85;
}

[data-theme="graphite"] .graphite-v6-flow-income {
  color:#68bdff;
}


/* HERO INSIGHTS */

[data-theme="graphite"] .graphite-v6-insights {
  position:relative;
  z-index:4;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  border-top:1px solid rgba(160,190,216,.10);
  background:
    linear-gradient(
      180deg,
      rgba(12,18,25,.76),
      rgba(10,15,21,.94)
    );
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
}

[data-theme="graphite"] .graphite-v6-insight {
  min-width:0;
  padding:16px 15px 17px;
}

[data-theme="graphite"] .graphite-v6-insight + .graphite-v6-insight {
  border-left:1px solid rgba(160,190,216,.09);
}

[data-theme="graphite"] .graphite-v6-insight-label {
  color:#858f9b;
  font-size:11px;
  margin-bottom:8px;
}

[data-theme="graphite"] .graphite-v6-insight-main {
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}

[data-theme="graphite"] .graphite-v6-insight-icon {
  flex:0 0 auto;
  font-size:22px;
}

[data-theme="graphite"] .graphite-v6-insight-copy {
  min-width:0;
}

[data-theme="graphite"] .graphite-v6-insight-title {
  color:#ebeff4;
  font-size:14px;
  font-weight:680;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

[data-theme="graphite"] .graphite-v6-insight-value {
  margin-top:4px;
  color:#f0f3f7;
  font-size:15px;
  font-weight:720;
  font-variant-numeric:tabular-nums;
}

[data-theme="graphite"] .graphite-v6-insight-note {
  margin-top:5px;
  color:#8994a0;
  font-size:11px;
  line-height:1.25;
}

[data-theme="graphite"] .graphite-v6-insight-note.blue {
  color:#68bdff;
}

[data-theme="graphite"] .graphite-v6-insight-note.warm {
  color:#cf8079;
}


/* SECTIONS */

[data-theme="graphite"] .graphite-v6-section {
  margin-top:28px;
}

[data-theme="graphite"] .graphite-v6-section-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
  padding:0 2px;
}

[data-theme="graphite"] .graphite-v6-section-title {
  color:#ebeff3;
  font-size:20px;
  font-weight:760;
  letter-spacing:-.025em;
}

[data-theme="graphite"] .graphite-v6-section-link {
  color:#68bdff;
  font-size:13px;
}


/* CHART */

[data-theme="graphite"] .graphite-v6-chart-card {
  display:grid;
  grid-template-columns:minmax(0,1fr) 124px;
  gap:12px;
  min-height:188px;
  padding:15px;
  border-radius:22px;
  border:1px solid rgba(151,179,202,.11);
  background:
    radial-gradient(
      100% 120% at 0 0,
      rgba(84,137,177,.055),
      transparent 55%
    ),
    linear-gradient(145deg,#171c22,#11161c);
  box-shadow:
    0 14px 30px rgba(4,6,8,.26),
    inset 0 1px 0 rgba(255,255,255,.025);
}

[data-theme="graphite"] .graphite-v6-chart {
  display:flex;
  align-items:flex-end;
  gap:5px;
  min-width:0;
  height:142px;
  padding:8px 0 20px;
  border-bottom:1px solid rgba(142,169,192,.08);
}

[data-theme="graphite"] .graphite-v6-chart-bar {
  position:relative;
  flex:1;
  min-width:4px;
  max-width:18px;
  height:var(--h);
  border-radius:4px 4px 1px 1px;
  background:
    linear-gradient(
      180deg,
      #c06f63,
      #824941
    );
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10);
  transform-origin:bottom;
  animation:
    graphiteV6BarIn .7s
    var(--graphite-ease) both;
}

[data-theme="graphite"] .graphite-v6-chart-bar.selected {
  background:
    linear-gradient(
      180deg,
      #de8373,
      #a7554d
    );
  box-shadow:
    0 0 16px rgba(211,104,91,.16);
}

@keyframes graphiteV6BarIn {
  from {
    opacity:0;
    transform:scaleY(.1);
  }
  to {
    opacity:1;
    transform:scaleY(1);
  }
}

[data-theme="graphite"] .graphite-v6-chart-stats {
  display:grid;
  grid-template-rows:1fr 1fr;
  border-radius:16px;
  border:1px solid rgba(145,177,203,.09);
  background:rgba(17,22,28,.55);
}

[data-theme="graphite"] .graphite-v6-chart-stat {
  padding:14px 13px;
}

[data-theme="graphite"] .graphite-v6-chart-stat + .graphite-v6-chart-stat {
  border-top:1px solid rgba(145,177,203,.08);
}

[data-theme="graphite"] .graphite-v6-chart-stat span {
  display:block;
  color:#8e99a5;
  font-size:11px;
}

[data-theme="graphite"] .graphite-v6-chart-stat strong {
  display:block;
  margin-top:6px;
  color:#edf1f5;
  font-size:17px;
  font-variant-numeric:tabular-nums;
}


/* CATEGORY CAROUSEL */

[data-theme="graphite"] .graphite-v6-categories {
  display:flex;
  gap:10px;
  overflow-x:auto;
  overflow-y:hidden;
  margin-left:-2px;
  margin-right:-16px;
  padding:2px 16px 10px 2px;

  scroll-snap-type:x proximity;
  overscroll-behavior-x:contain;
  touch-action:pan-x;

  scrollbar-width:none;
}

[data-theme="graphite"] .graphite-v6-categories::-webkit-scrollbar {
  display:none;
}

[data-theme="graphite"] .graphite-v6-category {
  flex:0 0 168px;
  scroll-snap-align:start;
  position:relative;
  overflow:hidden;
  padding:14px;
  border-radius:18px;
  border:1px solid rgba(151,181,206,.11);
  background:
    radial-gradient(
      90% 100% at 0 0,
      rgba(79,137,180,.055),
      transparent 55%
    ),
    linear-gradient(145deg,#1a2027,#13181e);
  box-shadow:
    0 10px 22px rgba(4,6,9,.20),
    inset 0 1px 0 rgba(255,255,255,.025);
}

[data-theme="graphite"] .graphite-v6-category-icon {
  width:42px;
  height:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  font-size:23px;
  background:
    linear-gradient(145deg,#24313d,#17212a);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035);
}

[data-theme="graphite"] .graphite-v6-category-name {
  margin-top:10px;
  color:#c5ced8;
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

[data-theme="graphite"] .graphite-v6-category-value {
  margin-top:5px;
  color:#f0f3f6;
  font-size:17px;
  font-weight:720;
}

[data-theme="graphite"] .graphite-v6-category-meter {
  display:flex;
  align-items:center;
  gap:7px;
  margin-top:10px;
}

[data-theme="graphite"] .graphite-v6-category-track {
  flex:1;
  height:5px;
  overflow:hidden;
  border-radius:999px;
  background:#252c34;
}

[data-theme="graphite"] .graphite-v6-category-track i {
  display:block;
  width:var(--pct);
  height:100%;
  transform-origin:left;
  border-radius:inherit;
  background:
    linear-gradient(90deg,#cf766b,#d99b78);
}

[data-theme="graphite"] .graphite-v6-category-pct {
  color:#8f99a5;
  font-size:11px;
}


/* LAST OPERATIONS */

[data-theme="graphite"] .graphite-v6-operation {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto auto;
  align-items:center;
  gap:11px;
  min-height:70px;
  padding:13px 15px;
  border-radius:20px;
  border:1px solid rgba(150,180,205,.10);
  background:
    linear-gradient(145deg,#181e24,#11161b);
}

[data-theme="graphite"] .graphite-v6-operation + .graphite-v6-operation {
  margin-top:8px;
}

[data-theme="graphite"] .graphite-v6-operation-icon {
  font-size:28px;
}

[data-theme="graphite"] .graphite-v6-operation-name {
  color:#eef1f4;
  font-size:15px;
  font-weight:690;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

[data-theme="graphite"] .graphite-v6-operation-category,
[data-theme="graphite"] .graphite-v6-operation-time {
  margin-top:3px;
  color:#7f8995;
  font-size:11px;
}

[data-theme="graphite"] .graphite-v6-operation-value {
  color:#d17870;
  font-size:16px;
  font-weight:680;
  white-space:nowrap;
}

[data-theme="graphite"] .graphite-v6-operation-value.income {
  color:#68bdff;
}

[data-theme="graphite"] .graphite-v6-operation-chevron {
  color:#84909c;
  font-size:24px;
}


/* MOBILE */

@media (max-width:360px) {
  [data-theme="graphite"] .graphite-v6-balance-value {
    font-size:42px;
  }

  [data-theme="graphite"] .graphite-v6-insight {
    padding:13px 10px;
  }

  [data-theme="graphite"] .graphite-v6-insight-title {
    font-size:12px;
  }

  [data-theme="graphite"] .graphite-v6-chart-card {
    grid-template-columns:minmax(0,1fr) 108px;
  }

  [data-theme="graphite"] .graphite-v6-category {
    flex-basis:150px;
  }
}



/* =========================================================
   GRAPHITE V6 — POLISH
   ========================================================= */


/* HERO COMPACT */

[data-theme="graphite"] .graphite-v6-hero-main {
  min-height: 255px;
  padding:
    16px 20px 14px;
}

[data-theme="graphite"] .graphite-v6-balance {
  margin:
    auto 0 22px;
}

[data-theme="graphite"] .graphite-v6-balance-value {
  font-size:
    clamp(42px, 11vw, 54px);
}

[data-theme="graphite"] .graphite-v6-landscape {
  display:none !important;
}

[data-theme="graphite"] .graphite-v6-hero {
  background:
    radial-gradient(
      110% 80% at 50% 22%,
      rgba(94,145,184,.12),
      transparent 48%
    ),
    linear-gradient(
      180deg,
      #172432 0%,
      #111a23 52%,
      #0c1218 100%
    );
}


/* =========================================================
   HERO INSIGHTS — 2 + 1
   ========================================================= */

[data-theme="graphite"] .graphite-v6-insights {
  grid-template-columns:
    1fr 1fr;

  gap:0;

  border-top:
    1px solid
    rgba(160,190,216,.10);
}

[data-theme="graphite"] .graphite-v6-insight {
  min-height:104px;
}

[data-theme="graphite"]
.graphite-v6-insight:nth-child(3) {
  grid-column:
    1 / -1;

  display:grid;
  grid-template-columns:
    auto 1fr;

  align-items:center;

  min-height:74px;

  border-left:0 !important;

  border-top:
    1px solid
    rgba(160,190,216,.09);
}

[data-theme="graphite"]
.graphite-v6-insight:nth-child(3)
.graphite-v6-insight-label {
  margin-bottom:0;
}

[data-theme="graphite"]
.graphite-v6-insight:nth-child(3)
.graphite-v6-insight-main {
  justify-self:end;
}

[data-theme="graphite"]
.graphite-v6-insight-title {
  overflow:visible;
  text-overflow:clip;
  white-space:normal;
}

[data-theme="graphite"]
.graphite-v6-insight-value {
  white-space:nowrap;
}


/* =========================================================
   CHART LOW-DATA MODE
   ========================================================= */

[data-theme="graphite"]
.graphite-v6-chart.low-data {
  justify-content:center;
  gap:18px;
}

[data-theme="graphite"]
.graphite-v6-chart.low-data
.graphite-v6-chart-bar {
  flex:
    0 0 34px;

  max-width:
    34px;

  min-height:
    32px;

  border-radius:
    7px 7px 2px 2px;
}

[data-theme="graphite"]
.graphite-v6-chart.low-data
.graphite-v6-chart-bar.selected {
  box-shadow:
    0 0 24px
    rgba(211,104,91,.22),
    inset 0 1px 0
    rgba(255,255,255,.11);
}


/* =========================================================
   CATEGORY CAROUSEL
   ========================================================= */

[data-theme="graphite"] .graphite-v6-categories {
  margin-right:-20px;

  padding-right:58px;

  scroll-padding-left:2px;
}

[data-theme="graphite"] .graphite-v6-category {
  flex:
    0 0
    min(158px, 43vw);
}

[data-theme="graphite"] .graphite-v6-section {
  position:relative;
}

[data-theme="graphite"]
.graphite-v6-section.categories-section::after {
  content:"";

  position:absolute;

  top:42px;
  right:-2px;
  bottom:5px;

  width:32px;

  pointer-events:none;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(17,20,24,.78)
    );

  opacity:.55;
}


/* =========================================================
   CLICKABLE LINKS
   ========================================================= */

[data-theme="graphite"]
.graphite-v6-section-link {
  cursor:pointer;

  transition:
    opacity .15s ease,
    transform .15s ease;
}

[data-theme="graphite"]
.graphite-v6-section-link:active {
  opacity:.7;
  transform:
    translateY(1px);
}


/* =========================================================
   OPERATIONS COMPACT
   ========================================================= */

[data-theme="graphite"]
.graphite-v6-operation {
  min-height:64px;

  padding:
    11px 14px;
}

[data-theme="graphite"]
.graphite-v6-operation-icon {
  font-size:25px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width:360px) {

  [data-theme="graphite"]
  .graphite-v6-hero-main {
    min-height:235px;
  }

  [data-theme="graphite"]
  .graphite-v6-insight {
    padding:
      13px 11px;
  }

  [data-theme="graphite"]
  .graphite-v6-insight-title {
    font-size:13px;
  }

  [data-theme="graphite"]
  .graphite-v6-insight-value {
    font-size:14px;
  }

  [data-theme="graphite"]
  .graphite-v6-category {
    flex-basis:145px;
  }

}



/* =========================================================
   GRAPHITE V6 HERO BG + SIGNAL ANIMATION
   ========================================================= */

/*
  Hero background strategy:
  - default: premium layered fallback (no external file required)
  - enhanced: if JS detects /static/graphite/hero-landscape.webp,
    hero gets .has-photo and uses real image background
*/

[data-theme="graphite"] .graphite-v6-landscape {
  display: none !important;
}

[data-theme="graphite"] .graphite-v6-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

[data-theme="graphite"] .graphite-v6-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  background:
    radial-gradient(
      95% 58% at 50% 34%,
      rgba(162, 207, 242, .16) 0%,
      rgba(102, 161, 206, .09) 26%,
      transparent 58%
    ),
    radial-gradient(
      120% 72% at 50% 102%,
      rgba(176, 216, 244, .10) 0%,
      rgba(64, 102, 132, .04) 30%,
      transparent 54%
    ),
    linear-gradient(
      180deg,
      rgba(7, 12, 18, .05) 0%,
      rgba(10, 16, 24, .16) 28%,
      rgba(8, 14, 20, .40) 62%,
      rgba(8, 12, 17, .76) 100%
    ),
    linear-gradient(
      180deg,
      #203245 0%,
      #162331 32%,
      #101821 61%,
      #0b1016 100%
    );

  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;

  filter: saturate(1.04) contrast(1.02);
}

[data-theme="graphite"] .graphite-v6-hero.has-photo::before {
  background:
    radial-gradient(
      95% 58% at 50% 34%,
      rgba(162, 207, 242, .14) 0%,
      rgba(102, 161, 206, .07) 26%,
      transparent 58%
    ),
    linear-gradient(
      180deg,
      rgba(7, 12, 18, .02) 0%,
      rgba(8, 13, 19, .08) 28%,
      rgba(7, 11, 17, .34) 62%,
      rgba(8, 12, 17, .76) 100%
    ),
    url("/static/graphite/hero-landscape.webp"),
    linear-gradient(
      180deg,
      #203245 0%,
      #162331 32%,
      #101821 61%,
      #0b1016 100%
    );

  background-repeat: no-repeat;
  background-size:
    cover,
    cover,
    cover,
    cover;

  background-position:
    center center,
    center center,
    center 52%,
    center center;
}

[data-theme="graphite"] .graphite-v6-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;

  background:
    radial-gradient(
      120% 80% at 50% 52%,
      transparent 40%,
      rgba(4, 8, 13, .10) 62%,
      rgba(5, 8, 13, .24) 82%,
      rgba(5, 8, 13, .40) 100%
    ),
    linear-gradient(
      180deg,
      rgba(255,255,255,.018) 0%,
      transparent 22%,
      transparent 76%,
      rgba(0,0,0,.18) 100%
    );

  mix-blend-mode: normal;
}

[data-theme="graphite"] .graphite-v6-hero-main,
[data-theme="graphite"] .graphite-v6-insights {
  position: relative;
  z-index: 3;
}

[data-theme="graphite"] .graphite-v6-hero-main {
  min-height: 265px;
}

[data-theme="graphite"] .graphite-v6-balance {
  margin: auto 0 24px;
}

[data-theme="graphite"] .graphite-v6-period-pill {
  border-color: rgba(181, 209, 233, .17);
  background: rgba(12, 20, 29, .42);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    0 10px 24px rgba(3, 6, 10, .16);
}

[data-theme="graphite"] .graphite-v6-balance-value {
  text-shadow:
    0 10px 30px rgba(0,0,0,.34),
    0 0 32px rgba(116,197,255,.08);
}

[data-theme="graphite"] .graphite-v6-flow {
  text-shadow:
    0 2px 8px rgba(0,0,0,.24);
}

[data-theme="graphite"] .graphite-v6-insights {
  background:
    linear-gradient(
      180deg,
      rgba(9, 15, 22, .72),
      rgba(8, 12, 18, .90)
    );
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}


/* =========================================================
   SIGNAL BARS ANIMATION
   ========================================================= */

[data-theme="graphite"] .graphite-v6-signal {
  align-items: flex-end;
  gap: 5px;
  height: 24px;
}

[data-theme="graphite"] .graphite-v6-signal i {
  display: block;
  width: 5px;
  border-radius: 999px;
  background:
    linear-gradient(
      180deg,
      #8fd3ff 0%,
      #68bdff 55%,
      #4194da 100%
    );

  box-shadow:
    0 0 12px rgba(104,189,255,.26),
    inset 0 1px 0 rgba(255,255,255,.22);

  transform-origin: center bottom;
  will-change: transform, opacity;
  animation: graphiteV6SignalMove 1.9s ease-in-out infinite;
}

[data-theme="graphite"] .graphite-v6-signal i:nth-child(1) {
  animation-delay: -1.05s;
  animation-duration: 1.75s;
}

[data-theme="graphite"] .graphite-v6-signal i:nth-child(2) {
  animation-delay: -.76s;
  animation-duration: 1.95s;
}

[data-theme="graphite"] .graphite-v6-signal i:nth-child(3) {
  animation-delay: -1.32s;
  animation-duration: 1.65s;
}

[data-theme="graphite"] .graphite-v6-signal i:nth-child(4) {
  animation-delay: -.48s;
  animation-duration: 2.05s;
}

[data-theme="graphite"] .graphite-v6-signal i:nth-child(5) {
  animation-delay: -.92s;
  animation-duration: 1.82s;
}

[data-theme="graphite"] .graphite-v6-signal i:nth-child(6) {
  animation-delay: -.28s;
  animation-duration: 2.1s;
}

@keyframes graphiteV6SignalMove {
  0%, 100% {
    transform: scaleY(.72) translateY(0);
    opacity: .58;
  }

  20% {
    transform: scaleY(1.02) translateY(-1px);
    opacity: .95;
  }

  45% {
    transform: scaleY(.52) translateY(1px);
    opacity: .42;
  }

  68% {
    transform: scaleY(1.16) translateY(-1px);
    opacity: 1;
  }

  85% {
    transform: scaleY(.82) translateY(0);
    opacity: .68;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-theme="graphite"] .graphite-v6-signal i {
    animation: none !important;
    opacity: .85;
    transform: none !important;
  }
}



/* =========================================================
   GRAPHITE HERO PHOTO FIX
   Fix crooked photo integration for Graphite overview
   ========================================================= */

/* 1) Убираем конфликтующий shine/glare у hero */
[data-theme="graphite"] .graphite-v6-hero.graphite-metal::after {
  content: none !important;
  animation: none !important;
}

/* 2) Сбрасываем старые псевдослои и собираем hero заново */
[data-theme="graphite"] .graphite-v6-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;

  background:
    linear-gradient(
      180deg,
      #152231 0%,
      #0f1822 54%,
      #0a0f14 100%
    ) !important;
}

/* старую svg-заглушку не показываем */
[data-theme="graphite"] .graphite-v6-landscape,
[data-theme="graphite"] .graphite-v6-hero-shade {
  display: none !important;
}

/* Основной photo layer */
[data-theme="graphite"] .graphite-v6-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  background:
    radial-gradient(
      88% 58% at 50% 48%,
      rgba(188,224,248,.12) 0%,
      rgba(103,154,198,.07) 26%,
      transparent 58%
    ),
    linear-gradient(
      180deg,
      rgba(6,10,15,.08) 0%,
      rgba(8,13,18,.14) 24%,
      rgba(7,11,16,.30) 48%,
      rgba(7,10,14,.60) 72%,
      rgba(7,10,14,.90) 100%
    ),
    linear-gradient(
      180deg,
      rgba(255,255,255,.015) 0%,
      transparent 20%,
      transparent 76%,
      rgba(0,0,0,.10) 100%
    );

  background-repeat: no-repeat;
  background-size: cover, cover, cover;
  background-position: center center, center center, center center;

  opacity: 1;
}

/* Если photo asset найден — используем его корректно */
[data-theme="graphite"] .graphite-v6-hero.has-photo::before {
  background:
    radial-gradient(
      88% 58% at 50% 48%,
      rgba(188,224,248,.11) 0%,
      rgba(103,154,198,.065) 26%,
      transparent 58%
    ),
    linear-gradient(
      180deg,
      rgba(6,10,15,.04) 0%,
      rgba(8,13,18,.09) 22%,
      rgba(7,11,16,.24) 45%,
      rgba(7,10,14,.55) 69%,
      rgba(7,10,14,.91) 100%
    ),
    url("/static/graphite/hero-landscape.webp");

  background-repeat: no-repeat;
  background-size:
    cover,
    cover,
    auto 100%;

  background-position:
    center center,
    center center,
    center 44%;

  filter:
    brightness(.80)
    saturate(.92)
    contrast(1.04);
}

/* Дополнительная нижняя вуаль, чтобы инсайты сидели аккуратно */
[data-theme="graphite"] .graphite-v6-hero.has-photo .graphite-v6-insights,
[data-theme="graphite"] .graphite-v6-hero .graphite-v6-insights {
  position: relative;
  z-index: 3;

  background:
    linear-gradient(
      180deg,
      rgba(8,13,19,.78),
      rgba(7,10,14,.94)
    ) !important;

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Контент поверх фото */
[data-theme="graphite"] .graphite-v6-hero-main {
  position: relative;
  z-index: 2;
  min-height: 248px !important;
  padding: 16px 20px 12px !important;
}

[data-theme="graphite"] .graphite-v6-balance {
  margin: auto 0 18px !important;
}

[data-theme="graphite"] .graphite-v6-period-pill,
[data-theme="graphite"] .graphite-v6-signal {
  position: relative;
  z-index: 3;
}

[data-theme="graphite"] .graphite-v6-period-pill {
  background: rgba(10,16,22,.42) !important;
  border-color: rgba(181,209,233,.16) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    0 8px 20px rgba(2,5,8,.16) !important;
}

[data-theme="graphite"] .graphite-v6-balance-label {
  color: #b2bcc8 !important;
}

[data-theme="graphite"] .graphite-v6-balance-value {
  color: #f4f7fa !important;
  text-shadow:
    0 10px 24px rgba(0,0,0,.36),
    0 0 20px rgba(116,197,255,.06) !important;
}

[data-theme="graphite"] .graphite-v6-flow {
  text-shadow:
    0 2px 10px rgba(0,0,0,.25);
}

/* Чтобы фото не уезжало на узких экранах */
@media (max-width: 430px) {
  [data-theme="graphite"] .graphite-v6-hero.has-photo::before {
    background-size:
      cover,
      cover,
      auto 100%;

    background-position:
      center center,
      center center,
      center 46%;
  }

  [data-theme="graphite"] .graphite-v6-hero-main {
    min-height: 238px !important;
  }
}

@media (max-width: 360px) {
  [data-theme="graphite"] .graphite-v6-hero.has-photo::before {
    background-position:
      center center,
      center center,
      center 48%;
  }

  [data-theme="graphite"] .graphite-v6-hero-main {
    min-height: 228px !important;
  }
}



/* =========================================================
   GRAPHITE HERO — FINAL PHOTO LAYOUT FIX
   Photo belongs ONLY to upper scene.
   ========================================================= */


/* ---------------------------------------------------------
   1. Hero container itself is just the metal shell
   --------------------------------------------------------- */

[data-theme="graphite"] .graphite-v6-hero {
  position: relative !important;
  overflow: hidden !important;
  isolation: isolate;

  background:
    #0a0f15 !important;

  border:
    1px solid rgba(126,166,198,.17) !important;

  box-shadow:
    0 20px 42px rgba(2,5,8,.40),
    inset 0 1px 0 rgba(255,255,255,.025) !important;
}


/*
  IMPORTANT:
  old hero-wide photo pseudo is killed completely.
*/
[data-theme="graphite"] .graphite-v6-hero::before,
[data-theme="graphite"] .graphite-v6-hero::after {
  content: none !important;
  display: none !important;
  animation: none !important;
}


/* old SVG */
[data-theme="graphite"] .graphite-v6-landscape,
[data-theme="graphite"] .graphite-v6-hero-shade {
  display: none !important;
}


/* ---------------------------------------------------------
   2. Upper scene
   --------------------------------------------------------- */

[data-theme="graphite"] .graphite-v6-hero-main {
  position: relative !important;
  z-index: 1;

  min-height: 268px !important;

  padding:
    16px 20px 16px !important;

  overflow: hidden;

  background:
    linear-gradient(
      180deg,
      #142130,
      #0d151e
    );

  isolation: isolate;
}


/*
  Actual photo.
  Its coordinate system is now ONLY the 268px upper hero scene.
*/
[data-theme="graphite"]
.graphite-v6-hero.has-photo
.graphite-v6-hero-main::before {
  content: "";

  position: absolute;
  inset: 0;

  z-index: -2;

  pointer-events: none;

  background-image:
    url("/static/graphite/hero-landscape.webp");

  background-repeat:
    no-repeat;

  background-size:
    cover;

  /*
    Our asset has lots of sky.
    66% moves the valley/horizon upwards into the visible composition.
  */
  background-position:
    center 66%;

  filter:
    brightness(.76)
    saturate(.88)
    contrast(1.07);

  transform:
    scale(1.015);
}


/*
  Controlled cinematic shading over the IMAGE ONLY.
*/
[data-theme="graphite"]
.graphite-v6-hero-main::after {
  content: "";

  position: absolute;
  inset: 0;

  z-index: -1;

  pointer-events: none;

  background:
    radial-gradient(
      76% 58% at 50% 60%,
      rgba(163,210,240,.10),
      transparent 55%
    ),
    linear-gradient(
      180deg,
      rgba(2,7,12,.12) 0%,
      rgba(4,8,13,.06) 25%,
      rgba(5,9,14,.08) 48%,
      rgba(5,9,14,.25) 72%,
      rgba(5,9,14,.62) 100%
    );
}


/* ---------------------------------------------------------
   3. Correct content placement
   --------------------------------------------------------- */

[data-theme="graphite"]
.graphite-v6-period-pill {
  position: relative !important;
  z-index: 5;

  align-self: flex-start;

  background:
    rgba(7,13,20,.47) !important;

  border-color:
    rgba(170,207,234,.18) !important;

  backdrop-filter:
    blur(10px);

  -webkit-backdrop-filter:
    blur(10px);
}


/*
  FIX THE BLUE SIGNAL.
  Last patch accidentally changed this to position:relative.
*/
[data-theme="graphite"]
.graphite-v6-signal {
  position: absolute !important;

  top: 24px !important;
  right: 22px !important;
  left: auto !important;
  bottom: auto !important;

  z-index: 6 !important;

  display: flex;
  align-items: flex-end;
  gap: 5px;

  width: auto !important;
  height: 24px !important;

  margin: 0 !important;

  transform: none !important;
}


/*
  Keep individual bar animation,
  but never move the whole signal group.
*/
[data-theme="graphite"]
.graphite-v6-signal i {
  position: relative;
  flex: 0 0 5px;
  width: 5px !important;

  transform-origin:
    center bottom;
}


/* ---------------------------------------------------------
   4. Balance composition
   --------------------------------------------------------- */

[data-theme="graphite"]
.graphite-v6-balance {
  position: relative;
  z-index: 4;

  margin:
    auto 0 16px !important;

  transform:
    translateY(4px);
}

[data-theme="graphite"]
.graphite-v6-balance-label {
  color:
    rgba(220,229,238,.72) !important;

  text-shadow:
    0 2px 8px rgba(0,0,0,.28);
}

[data-theme="graphite"]
.graphite-v6-balance-value {
  font-size:
    clamp(43px, 11vw, 54px) !important;

  text-shadow:
    0 9px 30px rgba(0,0,0,.50),
    0 0 24px rgba(132,194,238,.08) !important;
}

[data-theme="graphite"]
.graphite-v6-flow {
  position: relative;
  z-index: 4;
}


/* ---------------------------------------------------------
   5. Insights are a SEPARATE dark metal panel.
   Image does not continue underneath them.
   --------------------------------------------------------- */

[data-theme="graphite"]
.graphite-v6-insights {
  position: relative !important;
  z-index: 5 !important;

  background:
    radial-gradient(
      100% 120% at 50% 0%,
      rgba(41,62,78,.08),
      transparent 55%
    ),
    linear-gradient(
      180deg,
      #0d141b 0%,
      #0a1016 100%
    ) !important;

  backdrop-filter:
    none !important;

  -webkit-backdrop-filter:
    none !important;

  border-top:
    1px solid rgba(137,171,199,.11) !important;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.015);
}


/* ---------------------------------------------------------
   6. Slight separator glow at landscape horizon
   --------------------------------------------------------- */

[data-theme="graphite"]
.graphite-v6-hero-main {
  border-bottom:
    1px solid rgba(128,168,199,.10);
}


/* ---------------------------------------------------------
   7. Phone widths
   --------------------------------------------------------- */

@media (max-width: 430px) {

  [data-theme="graphite"]
  .graphite-v6-hero-main {
    min-height:
      260px !important;
  }

  [data-theme="graphite"]
  .graphite-v6-hero.has-photo
  .graphite-v6-hero-main::before {
    background-position:
      center 67%;
  }

  [data-theme="graphite"]
  .graphite-v6-signal {
    top:
      23px !important;

    right:
      20px !important;
  }

}


@media (max-width: 360px) {

  [data-theme="graphite"]
  .graphite-v6-hero-main {
    min-height:
      248px !important;
  }

  [data-theme="graphite"]
  .graphite-v6-hero.has-photo
  .graphite-v6-hero-main::before {
    background-position:
      center 68%;
  }

  [data-theme="graphite"]
  .graphite-v6-signal {
    right:
      17px !important;
  }

}



/* =========================================================
   GRAPHITE HERO MICRO POLISH
   Final visual tuning for photo hero
   ========================================================= */


/* ---------------------------------------------------------
   1. Чуть точнее сажаем картинку
   --------------------------------------------------------- */

[data-theme="graphite"]
.graphite-v6-hero.has-photo
.graphite-v6-hero-main::before {
  background-position: center 63% !important;
  filter:
    brightness(.74)
    saturate(.90)
    contrast(1.08) !important;
}


/* ---------------------------------------------------------
   2. Делаем сцену чуть выразительнее:
      мягкий свет в центре + немного больше глубины
   --------------------------------------------------------- */

[data-theme="graphite"]
.graphite-v6-hero-main::after {
  background:
    radial-gradient(
      62% 36% at 50% 58%,
      rgba(175,218,245,.10) 0%,
      rgba(102,158,203,.05) 32%,
      transparent 68%
    ),
    radial-gradient(
      50% 26% at 50% 60%,
      rgba(4,8,13,.14) 0%,
      rgba(4,8,13,.08) 42%,
      transparent 78%
    ),
    linear-gradient(
      180deg,
      rgba(2,7,12,.12) 0%,
      rgba(4,8,13,.05) 24%,
      rgba(5,9,14,.07) 46%,
      rgba(5,9,14,.22) 70%,
      rgba(5,9,14,.60) 100%
    ) !important;
}


/* ---------------------------------------------------------
   3. Баланс — чуть мощнее по контрасту
   --------------------------------------------------------- */

[data-theme="graphite"]
.graphite-v6-balance-label {
  color: rgba(228,236,243,.76) !important;
}

[data-theme="graphite"]
.graphite-v6-balance-value {
  text-shadow:
    0 10px 34px rgba(0,0,0,.56),
    0 0 28px rgba(132,194,238,.09) !important;
}


/* ---------------------------------------------------------
   4. Переход от фото к нижней панели — мягче
   --------------------------------------------------------- */

[data-theme="graphite"]
.graphite-v6-insights {
  position: relative !important;
  background:
    radial-gradient(
      100% 34px at 50% 0,
      rgba(98,138,168,.10),
      transparent 72%
    ),
    linear-gradient(
      180deg,
      #0f1821 0%,
      #0b1218 24%,
      #0a1016 100%
    ) !important;

  border-top:
    1px solid rgba(150,184,210,.12) !important;
}

[data-theme="graphite"]
.graphite-v6-insights::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 20px;
  pointer-events: none;

  background:
    linear-gradient(
      180deg,
      rgba(171,207,233,.08),
      transparent
    );

  opacity: .75;
}

[data-theme="graphite"]
.graphite-v6-insight-label {
  color: #8f9aa6 !important;
}


/* ---------------------------------------------------------
   5. Немного приятнее pill и signal
   --------------------------------------------------------- */

[data-theme="graphite"]
.graphite-v6-period-pill {
  background: rgba(8,14,20,.50) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    0 8px 22px rgba(2,5,8,.18) !important;
}

[data-theme="graphite"]
.graphite-v6-signal i {
  box-shadow:
    0 0 14px rgba(104,189,255,.28),
    inset 0 1px 0 rgba(255,255,255,.24) !important;
}


/* ---------------------------------------------------------
   6. На мобильных — ещё чуть аккуратнее
   --------------------------------------------------------- */

@media (max-width: 430px) {
  [data-theme="graphite"]
  .graphite-v6-hero.has-photo
  .graphite-v6-hero-main::before {
    background-position: center 64% !important;
  }
}

@media (max-width: 360px) {
  [data-theme="graphite"]
  .graphite-v6-hero.has-photo
  .graphite-v6-hero-main::before {
    background-position: center 65% !important;
  }
}



/* =========================================================
   GRAPHITE FINAL POLISH
   Micro-polish only. No layout rewrite.
   ========================================================= */


/* ---------------------------------------------------------
   1) HERO PHOTO / LIGHT CORRIDOR
   --------------------------------------------------------- */

[data-theme="graphite"]
.graphite-v6-hero.has-photo
.graphite-v6-hero-main::before {
  background-position: center 64% !important;
  filter:
    brightness(.78)
    saturate(.90)
    contrast(1.06) !important;
  transform: scale(1.01) !important;
}

[data-theme="graphite"]
.graphite-v6-hero-main::after {
  background:
    radial-gradient(
      78% 56% at 50% 59%,
      rgba(182,224,247,.14) 0%,
      rgba(122,182,225,.08) 22%,
      transparent 54%
    ),
    linear-gradient(
      180deg,
      rgba(2,7,12,.15) 0%,
      rgba(4,8,13,.05) 22%,
      rgba(5,9,14,.05) 43%,
      rgba(5,9,14,.20) 63%,
      rgba(5,9,14,.56) 100%
    ) !important;
}

[data-theme="graphite"]
.graphite-v6-balance {
  transform: translateY(1px) !important;
}

[data-theme="graphite"]
.graphite-v6-balance-label {
  margin-bottom: 6px;
  letter-spacing: .06em;
}

[data-theme="graphite"]
.graphite-v6-balance-value {
  text-shadow:
    0 9px 26px rgba(0,0,0,.52),
    0 0 26px rgba(128,192,236,.09) !important;
}

[data-theme="graphite"]
.graphite-v6-flow {
  margin-top: 12px;
  gap: 10px;
  font-size: 15px;
}


/* ---------------------------------------------------------
   2) INSIGHTS PANEL TRANSITION / DENSITY
   --------------------------------------------------------- */

[data-theme="graphite"]
.graphite-v6-insights {
  background:
    linear-gradient(
      180deg,
      rgba(19,31,42,.92) 0%,
      rgba(11,17,23,.96) 8%,
      #0a1016 100%
    ) !important;

  border-top:
    1px solid rgba(156,190,218,.13) !important;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    inset 0 14px 24px rgba(66,105,134,.05);
}

[data-theme="graphite"]
.graphite-v6-insight {
  padding: 15px 16px 16px !important;
}

[data-theme="graphite"]
.graphite-v6-insight-label {
  color: #8c98a5;
  font-size: 12px;
  margin-bottom: 10px;
}

[data-theme="graphite"]
.graphite-v6-insight-main {
  gap: 10px;
}

[data-theme="graphite"]
.graphite-v6-insight-icon {
  font-size: 21px;
}

[data-theme="graphite"]
.graphite-v6-insight-title {
  font-size: 15px;
  line-height: 1.15;
}

[data-theme="graphite"]
.graphite-v6-insight-value {
  margin-top: 5px;
  font-size: 17px;
  line-height: 1.08;
}

[data-theme="graphite"]
.graphite-v6-insight-note {
  margin-top: 6px;
  line-height: 1.22;
}


/* ---------------------------------------------------------
   3) FORECAST BLOCK — LESS EMPTY, MORE PREMIUM
   --------------------------------------------------------- */

[data-theme="graphite"]
.graphite-v6-insight:nth-child(3) {
  grid-template-columns: 1fr auto !important;
  gap: 10px;
  align-items: center;
  min-height: 78px !important;
  padding: 14px 18px !important;
}

[data-theme="graphite"]
.graphite-v6-insight:nth-child(3)
.graphite-v6-insight-label {
  margin: 0 !important;
  align-self: center;
}

[data-theme="graphite"]
.graphite-v6-insight:nth-child(3)
.graphite-v6-insight-main {
  justify-self: end;
  gap: 12px;
  text-align: left;
}

[data-theme="graphite"]
.graphite-v6-insight:nth-child(3)
.graphite-v6-insight-icon {
  font-size: 24px;
  opacity: .95;
}

[data-theme="graphite"]
.graphite-v6-insight:nth-child(3)
.graphite-v6-insight-title {
  font-size: 17px;
  font-weight: 760;
  white-space: nowrap;
}

[data-theme="graphite"]
.graphite-v6-insight:nth-child(3)
.graphite-v6-insight-note {
  font-size: 12px;
  margin-top: 4px;
}


/* ---------------------------------------------------------
   4) HERO EDGE / BORDER TUNING
   --------------------------------------------------------- */

[data-theme="graphite"]
.graphite-v6-hero {
  border:
    1px solid rgba(132,171,201,.18) !important;

  box-shadow:
    0 20px 42px rgba(2,5,8,.40),
    0 0 0 1px rgba(255,255,255,.012),
    inset 0 1px 0 rgba(255,255,255,.022) !important;
}

[data-theme="graphite"]
.graphite-v6-hero-main {
  border-bottom:
    1px solid rgba(138,177,208,.12) !important;
}


/* ---------------------------------------------------------
   5) OVERVIEW RHYTHM BELOW HERO
   --------------------------------------------------------- */

[data-theme="graphite"]
.graphite-v6-section {
  margin-top: 24px !important;
}

[data-theme="graphite"]
.graphite-v6-section-head {
  margin-bottom: 11px !important;
}

[data-theme="graphite"]
.graphite-v6-section-title {
  font-size: 19px !important;
  line-height: 1.08;
}

[data-theme="graphite"]
.graphite-v6-section-link {
  font-size: 13px;
  opacity: .97;
}


/* ---------------------------------------------------------
   6) CHART / CATEGORY / OPERATIONS SLIGHT TIGHTENING
   --------------------------------------------------------- */

[data-theme="graphite"]
.graphite-v6-chart-card {
  min-height: 178px !important;
  padding: 14px !important;
}

[data-theme="graphite"]
.graphite-v6-chart-stats {
  border-color: rgba(145,177,203,.10) !important;
}

[data-theme="graphite"]
.graphite-v6-chart-stat strong {
  font-size: 16px !important;
}

[data-theme="graphite"]
.graphite-v6-category {
  padding: 13px !important;
  border-radius: 17px !important;
}

[data-theme="graphite"]
.graphite-v6-category-name {
  margin-top: 9px !important;
}

[data-theme="graphite"]
.graphite-v6-category-value {
  margin-top: 4px !important;
}

[data-theme="graphite"]
.graphite-v6-operation {
  min-height: 62px !important;
  padding: 11px 13px !important;
  border-radius: 18px !important;
}

[data-theme="graphite"]
.graphite-v6-operation-name {
  font-size: 14px !important;
}

[data-theme="graphite"]
.graphite-v6-operation-value {
  font-size: 15px !important;
}


/* ---------------------------------------------------------
   7) SMALL PHONE TUNE
   --------------------------------------------------------- */

@media (max-width: 430px) {
  [data-theme="graphite"]
  .graphite-v6-hero.has-photo
  .graphite-v6-hero-main::before {
    background-position: center 65% !important;
  }
}

@media (max-width: 360px) {
  [data-theme="graphite"]
  .graphite-v6-hero.has-photo
  .graphite-v6-hero-main::before {
    background-position: center 66% !important;
  }

  [data-theme="graphite"]
  .graphite-v6-insight:nth-child(3) {
    padding: 13px 14px !important;
  }

  [data-theme="graphite"]
  .graphite-v6-insight:nth-child(3)
  .graphite-v6-insight-title {
    font-size: 16px !important;
  }
}



/* =========================================================
   GRAPHITE OVERVIEW — FINAL LOWER SCREEN POLISH
   ========================================================= */


/* ---------------------------------------------------------
   GENERAL RHYTHM
   --------------------------------------------------------- */

[data-theme="graphite"] .graphite-v6-section {
  margin-top: 25px;
}

[data-theme="graphite"] .graphite-v6-section-head {
  margin-bottom: 11px;
}

[data-theme="graphite"] .graphite-v6-section-title {
  font-size: clamp(19px, 5.4vw, 22px);
  font-weight: 760;
  letter-spacing: -.035em;
}

[data-theme="graphite"] .graphite-v6-section-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;

  padding: 6px 2px;

  color: #69bfff;
  font-size: 13px;
  font-weight: 540;

  -webkit-tap-highlight-color: transparent;
}


/* ---------------------------------------------------------
   CHART CARD
   --------------------------------------------------------- */

[data-theme="graphite"] .graphite-v6-chart-card {
  position: relative;

  grid-template-columns:
    minmax(0,1fr) 124px;

  gap: 12px;

  min-height: 198px;

  padding: 15px;

  overflow: hidden;

  border-radius: 22px;

  border:
    1px solid rgba(145,178,204,.12);

  background:
    radial-gradient(
      100% 115% at 0% 0%,
      rgba(83,139,180,.065),
      transparent 52%
    ),
    linear-gradient(
      145deg,
      #171d23 0%,
      #11171d 56%,
      #0e1318 100%
    );

  box-shadow:
    0 14px 32px rgba(3,5,8,.28),
    inset 0 1px 0 rgba(255,255,255,.027),
    inset 0 -1px 0 rgba(0,0,0,.22);
}


/* Subtle grid */
[data-theme="graphite"] .graphite-v6-chart-card::before {
  content: "";

  position: absolute;
  left: 15px;
  right: 151px;
  top: 28px;
  bottom: 34px;

  pointer-events: none;

  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      rgba(140,170,194,.055) 32px,
      transparent 33px
    );

  opacity: .9;
}


/* ---------------------------------------------------------
   CHART AREA
   --------------------------------------------------------- */

[data-theme="graphite"] .graphite-v6-chart {
  position: relative;
  z-index: 2;

  height: 156px;

  padding:
    18px 2px 25px;

  gap: 5px;

  border-bottom:
    1px solid
    rgba(139,168,191,.095);
}


[data-theme="graphite"] .graphite-v6-chart-bar {
  min-width: 4px;
  max-width: 15px;

  border-radius:
    5px 5px 2px 2px;

  background:
    linear-gradient(
      180deg,
      #b96860 0%,
      #81453f 100%
    );

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.11),
    0 5px 9px rgba(0,0,0,.12);
}


[data-theme="graphite"] .graphite-v6-chart-bar.selected {
  background:
    linear-gradient(
      180deg,
      #e48877,
      #b4544d
    );

  box-shadow:
    0 0 20px rgba(222,109,96,.18),
    inset 0 1px 0 rgba(255,255,255,.16);
}


/* ---------------------------------------------------------
   LOW DATA MODE
   --------------------------------------------------------- */

[data-theme="graphite"] .graphite-v6-chart.low-data {
  justify-content: center;
  align-items: flex-end;

  gap: 26px;

  padding-left: 22px;
  padding-right: 22px;
}

[data-theme="graphite"]
.graphite-v6-chart.low-data
.graphite-v6-chart-bar {
  flex:
    0 0 34px;

  width:
    34px;

  max-width:
    34px;

  min-height:
    38px;

  border-radius:
    7px 7px 2px 2px;
}


/* ---------------------------------------------------------
   CHART AXIS
   --------------------------------------------------------- */

[data-theme="graphite"] .graphite-v6-axis {
  position: absolute;

  left: 0;
  right: 0;
  bottom: 1px;

  z-index: 4;

  display: flex;
  justify-content: space-between;

  pointer-events: none;

  color: #75818d;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}


/* ---------------------------------------------------------
   CHART TOOLTIP
   --------------------------------------------------------- */

[data-theme="graphite"] .graphite-v6-tooltip {
  position: absolute;

  z-index: 8;

  min-width: 104px;

  padding:
    9px 11px;

  border-radius:
    13px;

  border:
    1px solid
    rgba(111,178,226,.19);

  background:
    linear-gradient(
      145deg,
      rgba(28,35,42,.97),
      rgba(17,22,28,.98)
    );

  box-shadow:
    0 12px 25px rgba(2,5,8,.36),
    inset 0 1px 0 rgba(255,255,255,.035);

  pointer-events: none;

  transform:
    translate(-50%, -100%);

  backdrop-filter:
    blur(12px);

  -webkit-backdrop-filter:
    blur(12px);
}

[data-theme="graphite"] .graphite-v6-tooltip::after {
  content: "";

  position: absolute;

  left: 50%;
  bottom: -5px;

  width: 9px;
  height: 9px;

  transform:
    translateX(-50%)
    rotate(45deg);

  background:
    #151b21;

  border-right:
    1px solid
    rgba(111,178,226,.14);

  border-bottom:
    1px solid
    rgba(111,178,226,.14);
}

[data-theme="graphite"] .graphite-v6-tooltip-date {
  color:
    #87929e;

  font-size:
    10px;
}

[data-theme="graphite"] .graphite-v6-tooltip-value {
  display:
    block;

  margin-top:
    3px;

  color:
    #f0f4f8;

  font-size:
    17px;

  line-height:
    1;

  font-weight:
    720;

  font-variant-numeric:
    tabular-nums;
}


/* ---------------------------------------------------------
   CHART STATS — HARDWARE SIDE PANEL
   --------------------------------------------------------- */

[data-theme="graphite"] .graphite-v6-chart-stats {
  position: relative;
  z-index: 3;

  overflow: hidden;

  border-radius:
    17px;

  border:
    1px solid
    rgba(139,174,201,.10);

  background:
    radial-gradient(
      110% 90% at 0 0,
      rgba(83,135,176,.055),
      transparent 54%
    ),
    linear-gradient(
      150deg,
      #171d23,
      #10151a
    );

  box-shadow:
    4px 6px 14px rgba(3,5,8,.18),
    inset 0 1px 0 rgba(255,255,255,.022);
}

[data-theme="graphite"] .graphite-v6-chart-stat {
  display:
    flex;

  flex-direction:
    column;

  justify-content:
    center;

  padding:
    13px;
}

[data-theme="graphite"] .graphite-v6-chart-stat span {
  color:
    #7e8995;

  font-size:
    11px;

  line-height:
    1.25;
}

[data-theme="graphite"] .graphite-v6-chart-stat strong {
  margin-top:
    7px;

  color:
    #edf1f5;

  font-size:
    18px;

  line-height:
    1;

  font-weight:
    720;

  letter-spacing:
    -.025em;
}


/* tiny status light */
[data-theme="graphite"]
.graphite-v6-chart-stat:first-child::before {
  content: "";

  position: absolute;

  top: 14px;
  right: 12px;

  width: 5px;
  height: 5px;

  border-radius: 50%;

  background:
    #64bfff;

  box-shadow:
    0 0 9px
    rgba(100,191,255,.42);
}


/* ---------------------------------------------------------
   CATEGORY CAROUSEL
   --------------------------------------------------------- */

[data-theme="graphite"]
.graphite-v6-section.categories-section {
  overflow:
    visible;
}


/*
  Important:
  show 2 cards + part of third
*/
[data-theme="graphite"] .graphite-v6-categories {
  gap:
    10px;

  margin-right:
    -30px;

  padding:
    2px 58px 10px 2px;

  scroll-snap-type:
    x mandatory;

  -webkit-overflow-scrolling:
    touch;
}

[data-theme="graphite"] .graphite-v6-category {
  flex:
    0 0 145px;

  min-height:
    150px;

  scroll-snap-align:
    start;

  padding:
    13px;

  border-radius:
    19px;

  border:
    1px solid
    rgba(141,179,208,.13);

  background:
    radial-gradient(
      100% 90% at 0 0,
      rgba(81,139,183,.075),
      transparent 55%
    ),
    linear-gradient(
      145deg,
      #1a2128,
      #12171d
    );

  box-shadow:
    0 11px 23px rgba(3,5,8,.21),
    inset 0 1px 0 rgba(255,255,255,.028);
}


/* stronger physical feel */
[data-theme="graphite"]
.graphite-v6-category.graphite-pressed {
  transform:
    scale(.978)
    translateY(2px) !important;

  box-shadow:
    inset 4px 4px 10px rgba(3,5,8,.34),
    inset -2px -2px 7px rgba(53,65,76,.16) !important;
}


[data-theme="graphite"] .graphite-v6-category-icon {
  width:
    44px;

  height:
    44px;

  font-size:
    23px;

  border:
    1px solid
    rgba(145,180,207,.08);

  background:
    radial-gradient(
      circle at 35% 25%,
      rgba(104,190,255,.09),
      transparent 46%
    ),
    linear-gradient(
      145deg,
      #222c35,
      #151c23
    );

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    0 6px 14px rgba(2,5,8,.14);
}


[data-theme="graphite"] .graphite-v6-category-name {
  margin-top:
    11px;

  color:
    #cbd3dc;

  font-size:
    13px;
}


[data-theme="graphite"] .graphite-v6-category-value {
  margin-top:
    5px;

  color:
    #f0f3f7;

  font-size:
    18px;

  font-weight:
    720;

  letter-spacing:
    -.025em;

  font-variant-numeric:
    tabular-nums;
}


[data-theme="graphite"] .graphite-v6-category-track {
  height:
    5px;

  background:
    #252c33;
}


[data-theme="graphite"] .graphite-v6-category-track i {
  background:
    linear-gradient(
      90deg,
      #d06f66,
      #d79b7d
    );

  box-shadow:
    0 0 7px
    rgba(208,111,102,.08);
}


/* edge hint that carousel continues */
[data-theme="graphite"]
.graphite-v6-section.categories-section::after {
  top:
    44px;

  right:
    -1px;

  bottom:
    6px;

  width:
    42px;

  background:
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(16,20,24,.24) 45%,
      rgba(16,20,24,.68) 100%
    );

  opacity:
    .8;
}


/* ---------------------------------------------------------
   LAST OPERATIONS
   --------------------------------------------------------- */

[data-theme="graphite"] .graphite-v6-operations {
  display:
    grid;

  gap:
    8px;
}


[data-theme="graphite"] .graphite-v6-operation {
  min-height:
    66px;

  padding:
    11px 13px;

  gap:
    11px;

  border-radius:
    19px;

  border:
    1px solid
    rgba(141,177,205,.10);

  background:
    radial-gradient(
      90% 100% at 0% 0%,
      rgba(73,126,168,.045),
      transparent 52%
    ),
    linear-gradient(
      145deg,
      #181e24,
      #11161b
    );

  box-shadow:
    0 8px 20px rgba(3,5,8,.16),
    inset 0 1px 0 rgba(255,255,255,.022);
}


[data-theme="graphite"]
.graphite-v6-operation.graphite-pressed {
  transform:
    scale(.985)
    translateY(1px) !important;

  box-shadow:
    inset 4px 4px 9px rgba(3,5,8,.30),
    inset -2px -2px 6px rgba(51,62,72,.13) !important;
}


[data-theme="graphite"] .graphite-v6-operation-icon {
  width:
    42px;

  height:
    42px;

  display:
    flex;

  align-items:
    center;

  justify-content:
    center;

  border-radius:
    13px;

  font-size:
    24px;

  background:
    linear-gradient(
      145deg,
      #222a31,
      #141a20
    );

  border:
    1px solid
    rgba(146,178,202,.07);
}


[data-theme="graphite"] .graphite-v6-operation-name {
  font-size:
    15px;

  font-weight:
    690;

  letter-spacing:
    -.015em;
}


[data-theme="graphite"] .graphite-v6-operation-category {
  margin-top:
    3px;

  color:
    #7c8793;
}


[data-theme="graphite"] .graphite-v6-operation-value {
  font-size:
    16px;

  color:
    #d57d76;
}


[data-theme="graphite"] .graphite-v6-operation-chevron {
  color:
    #77838f;

  font-size:
    25px;
}


/* ---------------------------------------------------------
   OVERVIEW CASCADE
   --------------------------------------------------------- */

[data-theme="graphite"]
.graphite-overview-v6
.graphite-v6-animate-in {
  opacity:
    0;

  transform:
    translateY(14px)
    scale(.988);

  animation:
    graphiteV6SectionIn
    .58s
    var(--graphite-ease)
    forwards;
}


@keyframes graphiteV6SectionIn {

  0% {
    opacity:0;

    transform:
      translateY(14px)
      scale(.988);
  }

  72% {
    opacity:1;

    transform:
      translateY(-1px)
      scale(1.002);
  }

  100% {
    opacity:1;

    transform:
      translateY(0)
      scale(1);
  }

}


/* ---------------------------------------------------------
   PHONE WIDTHS
   --------------------------------------------------------- */

@media (max-width: 390px) {

  [data-theme="graphite"]
  .graphite-v6-chart-card {
    grid-template-columns:
      minmax(0,1fr) 116px;
  }

  [data-theme="graphite"]
  .graphite-v6-chart-card::before {
    right:
      143px;
  }

  [data-theme="graphite"]
  .graphite-v6-category {
    flex-basis:
      142px;
  }

}


@media (max-width: 350px) {

  [data-theme="graphite"]
  .graphite-v6-chart-card {
    grid-template-columns:
      minmax(0,1fr) 104px;

    gap:
      8px;

    padding:
      12px;
  }

  [data-theme="graphite"]
  .graphite-v6-chart-card::before {
    right:
      124px;
  }

  [data-theme="graphite"]
  .graphite-v6-chart-stat {
    padding:
      10px;
  }

  [data-theme="graphite"]
  .graphite-v6-chart-stat strong {
    font-size:
      16px;
  }

  [data-theme="graphite"]
  .graphite-v6-category {
    flex-basis:
      136px;
  }

}


/* ---------------------------------------------------------
   REDUCED MOTION
   --------------------------------------------------------- */

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

  [data-theme="graphite"]
  .graphite-overview-v6
  .graphite-v6-animate-in {
    opacity:
      1 !important;

    transform:
      none !important;

    animation:
      none !important;
  }

}

