/* KitaBudget Stitch-dominant application layer. */
:root {
  --kb-stitch-bg: #140b14;
  --kb-stitch-bg-deep: #0d0710;
  --kb-stitch-ink: #f5eaf3;
  --kb-stitch-muted: #c9b5c7;
  --kb-stitch-soft: rgba(255, 255, 255, .055);
  --kb-stitch-glass: rgba(255, 255, 255, .072);
  --kb-stitch-line: rgba(255, 255, 255, .12);
  --kb-stitch-line-strong: rgba(255, 255, 255, .18);
  --kb-stitch-primary: #f4aeff;
  --kb-stitch-secondary: #7bd0ff;
  --kb-stitch-mint: #2dd4bf;
  --kb-stitch-rose: #fb7185;
  --kb-stitch-yellow: #f7d06f;
  --kb-stitch-shadow: 0 26px 80px rgba(0, 0, 0, .34);
  --kb-stitch-radius: 8px;
  --kb-stitch-radius-lg: 16px;
  --kb-stitch-sidebar: 260px;
  --kb-stitch-topbar: 78px;
  --kb-stitch-bottom-nav: 78px;
  --kb-bg: var(--kb-stitch-bg);
  --kb-bg-deep: var(--kb-stitch-bg-deep);
  --kb-panel: var(--kb-stitch-glass);
  --kb-panel-solid: #201421;
  --kb-card: var(--kb-stitch-glass);
  --kb-text: var(--kb-stitch-ink);
  --kb-muted: var(--kb-stitch-muted);
  --kb-line: var(--kb-stitch-line);
  --kb-primary: var(--kb-stitch-primary);
  --kb-accent: var(--kb-stitch-secondary);
  --kb-primary-rgb: 244, 174, 255;
  --kb-accent-rgb: 123, 208, 255;
  --kb-income: var(--kb-stitch-mint);
  --kb-expense: var(--kb-stitch-rose);
}

html[data-theme="mint"] {
  --kb-primary: #2dd4bf;
  --kb-accent: #7bd0ff;
  --kb-primary-rgb: 45, 212, 191;
  --kb-accent-rgb: 123, 208, 255;
}

html[data-theme="rose"] {
  --kb-primary: #fb7185;
  --kb-accent: #f4aeff;
  --kb-primary-rgb: 251, 113, 133;
  --kb-accent-rgb: 244, 174, 255;
}

html.light {
  --kb-stitch-bg: #f7f1f7;
  --kb-stitch-bg-deep: #efe5ef;
  --kb-stitch-ink: #251a25;
  --kb-stitch-muted: #725f72;
  --kb-stitch-soft: rgba(38, 21, 38, .045);
  --kb-stitch-glass: rgba(255, 255, 255, .76);
  --kb-stitch-line: rgba(38, 21, 38, .12);
  --kb-stitch-line-strong: rgba(38, 21, 38, .2);
  --kb-stitch-shadow: 0 22px 60px rgba(72, 40, 76, .12);
  --kb-panel-solid: #fff9ff;
}

html.light body.kb-stitch-app {
  background:
    radial-gradient(circle at 78% 0%, rgba(var(--kb-primary-rgb), .11), transparent 34rem),
    radial-gradient(circle at 8% 18%, rgba(var(--kb-accent-rgb), .08), transparent 30rem),
    linear-gradient(135deg, #fffaff, #fbf4fb 54%, #ffffff) !important;
}

html.light body.kb-stitch-app::before {
  opacity: .18;
  background-image:
    linear-gradient(rgba(42, 22, 44, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 22, 44, .014) 1px, transparent 1px);
}

html,
body.kb-stitch-app {
  min-height: 100%;
  background: var(--kb-bg);
}

body.kb-stitch-app {
  color: var(--kb-text);
  font-family: "Manrope", "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 18% -8%, rgba(var(--kb-primary-rgb), .2), transparent 30rem),
    radial-gradient(circle at 95% 8%, rgba(var(--kb-accent-rgb), .15), transparent 28rem),
    linear-gradient(135deg, var(--kb-bg-deep), var(--kb-bg) 52%, #19111f);
  overflow: hidden;
}

body.kb-stitch-app::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.78), transparent 76%);
  z-index: -1;
}

body.kb-stitch-app * {
  letter-spacing: 0;
}

body.kb-stitch-app a,
body.kb-stitch-app button,
body.kb-stitch-app input,
body.kb-stitch-app select,
body.kb-stitch-app textarea {
  font-family: inherit;
}

body.kb-stitch-app button {
  touch-action: manipulation;
}

body.kb-stitch-app button:focus-visible,
body.kb-stitch-app a:focus-visible,
body.kb-stitch-app input:focus-visible,
body.kb-stitch-app select:focus-visible,
body.kb-stitch-app textarea:focus-visible {
  outline: 2px solid rgba(var(--kb-primary-rgb), .72);
  outline-offset: 2px;
}

body.kb-stitch-app #app.kb-app-shell {
  display: flex;
  min-height: 100dvh;
  width: 100%;
  background: transparent;
  color: var(--kb-text);
}

body.kb-stitch-app #sidebar-overlay {
  display: none;
}

body.kb-stitch-app .kb-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--kb-stitch-sidebar) !important;
  z-index: 42;
  background: rgba(22, 13, 23, .76) !important;
  border-right: 1px solid var(--kb-line) !important;
  box-shadow: 24px 0 80px rgba(0,0,0,.26) !important;
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
}

html.light body.kb-stitch-app .kb-sidebar {
  background: rgba(255, 249, 255, .78) !important;
}

body.kb-stitch-app .kb-sidebar-brand {
  padding: 22px 18px !important;
  border-bottom: 1px solid var(--kb-line) !important;
}

body.kb-stitch-app .kb-logo-tile {
  border-radius: 10px !important;
  background: #2a1830 !important;
  border: 1px solid rgba(244, 174, 255, .18) !important;
  box-shadow: none !important;
}

body.kb-stitch-app .kb-logo-tile img,
body.kb-stitch-app .kb-logo-tile .kb-logo-symbol {
  filter: none !important;
}

/* Logo K Daun: the brand mark keeps its own pink-blue colours in every theme. */
body.kb-stitch-app .kb-logo-symbol {
  width: 72% !important;
  height: 72% !important;
}

body.kb-stitch-app .kb-sidebar nav {
  padding: 14px 12px !important;
  gap: 4px;
}

body.kb-stitch-app .nav-item {
  min-height: 44px;
  border-radius: 8px !important;
  color: var(--kb-muted) !important;
  border: 1px solid transparent;
  background: transparent !important;
  font-weight: 800;
  transform: translateZ(0);
}

body.kb-stitch-app .nav-item:hover {
  color: var(--kb-text) !important;
  background: rgba(255,255,255,.055) !important;
  border-color: rgba(255,255,255,.08);
}

body.kb-stitch-app .nav-item.active {
  color: var(--kb-text) !important;
  background:
    linear-gradient(135deg, rgba(var(--kb-primary-rgb), .18), rgba(var(--kb-accent-rgb), .1)),
    rgba(255,255,255,.07) !important;
  border-color: rgba(var(--kb-primary-rgb), .28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 16px 34px rgba(0,0,0,.18);
}

body.kb-stitch-app .kb-nav-svg,
body.kb-stitch-app .nav-icon,
body.kb-stitch-app .mobile-nav-icon,
body.kb-stitch-app .kb-inline-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  color: currentColor;
  flex: 0 0 auto;
}

body.kb-stitch-app .kb-nav-svg svg,
body.kb-stitch-app .mobile-nav-icon svg,
body.kb-stitch-app .kb-inline-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.kb-stitch-app .kb-sidebar .border-t {
  border-color: var(--kb-line) !important;
}

body.kb-stitch-app #main-content {
  margin-left: var(--kb-stitch-sidebar) !important;
  min-height: 100dvh;
  height: 100dvh;
  width: calc(100% - var(--kb-stitch-sidebar));
  overflow-y: auto;
  background: transparent;
}

body.kb-stitch-app .kb-topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  min-height: var(--kb-stitch-topbar);
  padding: 16px 28px !important;
  margin: 0;
  border-bottom: 1px solid var(--kb-line) !important;
  background: rgba(20, 11, 20, .7) !important;
  color: var(--kb-text);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

html.light body.kb-stitch-app .kb-topbar {
  background: rgba(255, 249, 255, .75) !important;
}

body.kb-stitch-app .menu-button {
  display: none !important;
}

body.kb-stitch-app #page-title {
  color: var(--kb-text) !important;
  font-size: 18px !important;
  line-height: 1.15;
  font-weight: 900;
}

body.kb-stitch-app #page-subtitle {
  color: var(--kb-muted) !important;
  margin-top: 3px;
  font-size: 12px !important;
  font-weight: 700;
}

body.kb-stitch-app .kb-content-canvas {
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
  padding: 28px clamp(24px, 2.4vw, 40px) 42px !important;
}

body.kb-stitch-app[data-page="dashboard"] #main-content {
  overflow: hidden;
}

body.kb-stitch-app[data-page="dashboard"] .kb-content-canvas {
  height: calc(100dvh - var(--kb-stitch-topbar));
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  margin: 0 !important;
  overflow: hidden;
  padding: 18px clamp(24px, 2vw, 34px) 22px !important;
}

body.kb-stitch-app #page-content > * + * {
  margin-top: 20px;
}

body.kb-stitch-app .kb-screen-head,
body.kb-stitch-app .dashboard-hero,
body.kb-stitch-app .metric-card,
body.kb-stitch-app .kb-section-card,
body.kb-stitch-app .kb-list-shell,
body.kb-stitch-app .dashboard-recent-card,
body.kb-stitch-app .planning-card,
body.kb-stitch-app .progress-brief-card,
body.kb-stitch-app .automation-panel,
body.kb-stitch-app .automation-card,
body.kb-stitch-app .desktop-settings-shell > div > div,
body.kb-stitch-app .desktop-settings-shell > div:last-child,
body.kb-stitch-app .profile-quick-card,
body.kb-stitch-app .mobile-profile-card,
body.kb-stitch-app .theme-page-card,
body.kb-stitch-app .upgrade-card,
body.kb-stitch-app .meeny-chat-shell {
  position: relative;
  overflow: hidden;
  border-radius: var(--kb-stitch-radius-lg) !important;
  border: 1px solid var(--kb-line) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.082), rgba(255,255,255,.045)),
    var(--kb-panel) !important;
  color: var(--kb-text) !important;
  box-shadow: var(--kb-stitch-shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

body.kb-stitch-app .kb-screen-head::after,
body.kb-stitch-app .dashboard-hero::after,
body.kb-stitch-app .automation-panel::after,
body.kb-stitch-app .upgrade-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(var(--kb-primary-rgb), .14), transparent 40%, rgba(var(--kb-accent-rgb), .1));
  opacity: .86;
}

body.kb-stitch-app .kb-screen-head > *,
body.kb-stitch-app .dashboard-hero > *,
body.kb-stitch-app .automation-panel > *,
body.kb-stitch-app .upgrade-card > * {
  position: relative;
  z-index: 1;
}

body.kb-stitch-app .kb-screen-head {
  padding: clamp(20px, 3vw, 30px) !important;
  min-height: 150px;
  display: grid;
  align-items: end;
}

body.kb-stitch-app .kb-page-kicker {
  color: var(--kb-primary) !important;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em !important;
}

body.kb-stitch-app .kb-page-title {
  color: var(--kb-text) !important;
  font-size: clamp(28px, 4vw, 54px);
  line-height: .95;
  font-weight: 950;
  margin-top: 8px;
}

body.kb-stitch-app .kb-page-copy {
  color: var(--kb-muted) !important;
  max-width: 720px;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.65;
  font-weight: 700;
}

body.kb-stitch-app .kb-primary-action,
body.kb-stitch-app .kb-secondary-action,
body.kb-stitch-app .kb-topbar-action,
body.kb-stitch-app .kb-action,
body.kb-stitch-app .profile-action-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px !important;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
  border: 1px solid rgba(var(--kb-primary-rgb), .26) !important;
  color: var(--kb-text) !important;
  background: rgba(255,255,255,.07) !important;
  box-shadow: none !important;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

body.kb-stitch-app .kb-primary-action {
  color: #180e18 !important;
  border-color: transparent !important;
  background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent)) !important;
}

body.kb-stitch-app .kb-secondary-action {
  color: var(--kb-muted) !important;
}

body.kb-stitch-app .kb-primary-action:hover,
body.kb-stitch-app .kb-secondary-action:hover,
body.kb-stitch-app .kb-topbar-action:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--kb-primary-rgb), .48) !important;
}

body.kb-stitch-app .kb-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

body.kb-stitch-app .kb-action-row .push {
  margin-left: auto;
}

body.kb-stitch-app .dashboard-hero {
  min-height: 366px;
  padding: clamp(20px, 3vw, 30px) !important;
}

body.kb-stitch-app .dashboard-period-pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--kb-line);
  color: var(--kb-text);
  background: rgba(255,255,255,.065);
}

body.kb-stitch-app .dashboard-period-pill button {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: var(--kb-text);
  background: rgba(255,255,255,.07);
}

body.kb-stitch-app .dashboard-balance {
  letter-spacing: 0 !important;
  text-wrap: balance;
}

body.kb-stitch-app .dashboard-hero-main {
  min-width: 0;
}

body.kb-stitch-app .soft-panel,
body.kb-stitch-app .dashboard-flow-panel,
body.kb-stitch-app .dashboard-mini-stat {
  border: 1px solid var(--kb-line) !important;
  border-radius: 12px !important;
  background: rgba(255,255,255,.055) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055);
}

body.kb-stitch-app .metric-card {
  min-height: 150px;
  padding: 20px !important;
}

body.kb-stitch-app .metric-card .rounded-xl,
body.kb-stitch-app .progress-card-icon,
body.kb-stitch-app .transaction-icon {
  border-radius: 8px !important;
  border: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(135deg, color-mix(in srgb, var(--trx-color, var(--kb-primary)) 32%, transparent), rgba(255,255,255,.06)) !important;
}

body.kb-stitch-app .home-progress-grid,
body.kb-stitch-app .analytics-planning-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

body.kb-stitch-app .progress-brief-card {
  min-height: 156px;
  padding: 18px !important;
}

body.kb-stitch-app .progress-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  overflow: hidden;
}

body.kb-stitch-app .progress-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--kb-primary), var(--kb-accent));
}

body.kb-stitch-app .dashboard-recent-card {
  margin-top: 18px;
}

body.kb-stitch-app .dashboard-recent-card > .border-b,
body.kb-stitch-app .kb-list-header {
  border-color: var(--kb-line) !important;
}

body.kb-stitch-app .dashboard-stitch-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 1.08fr);
  height: 100%;
  width: 100%;
  max-width: none;
  gap: 20px;
  overflow: hidden;
}

body.kb-stitch-app .dashboard-mobile-brand,
body.kb-stitch-app .dashboard-mobile-greeting {
  display: none;
}

body.kb-stitch-app .dashboard-stitch-header {
  padding: 0;
}

body.kb-stitch-app .dashboard-stitch-header .dashboard-greeting {
  color: var(--kb-muted);
  font-size: 14px;
  font-weight: 850;
}

body.kb-stitch-app .dashboard-stitch-header h1 {
  margin-top: 4px;
  color: var(--kb-text);
  font-size: clamp(32px, 3.2vw, 46px);
  line-height: 1.05;
  font-weight: 950;
}

body.kb-stitch-app .dashboard-stitch-header p:last-child {
  margin-top: 8px;
  color: var(--kb-muted);
  font-size: 15px;
  font-weight: 750;
}

body.kb-stitch-app .dashboard-overview-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(0, 1.7fr);
  gap: 20px;
  min-height: 0;
  width: 100%;
}

body.kb-stitch-app .dashboard-lower-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(0, 1.7fr);
  gap: 20px;
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

body.kb-stitch-app .dashboard-balance-card,
body.kb-stitch-app .dashboard-cashflow-card,
body.kb-stitch-app .dashboard-recent-card,
body.kb-stitch-app .progress-brief-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px !important;
  border: 1px solid var(--kb-line-strong) !important;
  background:
    linear-gradient(135deg, rgba(var(--kb-primary-rgb), .09), rgba(var(--kb-accent-rgb), .035)),
    rgba(255,255,255,.035) !important;
  color: var(--kb-text) !important;
  box-shadow: none !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

html.light body.kb-stitch-app .dashboard-balance-card,
html.light body.kb-stitch-app .dashboard-cashflow-card,
html.light body.kb-stitch-app .dashboard-recent-card,
html.light body.kb-stitch-app .progress-brief-card {
  background:
    linear-gradient(135deg, rgba(var(--kb-primary-rgb), .08), rgba(var(--kb-accent-rgb), .035)),
    rgba(255,255,255,.82) !important;
}

body.kb-stitch-app .dashboard-balance-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(24px, 1.7vw, 30px) !important;
}

body.kb-stitch-app .dashboard-balance-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

body.kb-stitch-app .dashboard-card-label {
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em !important;
}

body.kb-stitch-app .dashboard-balance-card .dashboard-balance {
  margin-top: 14px;
  color: var(--kb-text) !important;
  font-size: clamp(38px, 2.8vw, 54px) !important;
  line-height: .95;
  font-weight: 950;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

body.kb-stitch-app .balance-toggle {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin-top: 12px;
  border-radius: 999px;
  border: 1px solid var(--kb-line-strong);
  color: var(--kb-text);
  background:
    linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.035)),
    rgba(0,0,0,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
  opacity: .98;
}

body.kb-stitch-app .balance-toggle svg {
  width: 21px;
  height: 21px;
  stroke-width: 2.4;
}

html.light body.kb-stitch-app .balance-toggle {
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.62)),
    rgba(var(--kb-primary-rgb), .08);
}

body.kb-stitch-app .dashboard-balance-divider {
  height: 1px;
  margin: 22px 0;
  background: var(--kb-line-strong);
}

body.kb-stitch-app .dashboard-money-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

body.kb-stitch-app .dashboard-money-pair > div:last-child {
  text-align: right;
}

body.kb-stitch-app .dashboard-flow-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 850;
}

body.kb-stitch-app .dashboard-flow-label.income {
  color: var(--kb-income);
}

body.kb-stitch-app .dashboard-flow-label.expense {
  color: var(--kb-expense);
}

body.kb-stitch-app .dashboard-flow-value {
  margin-top: 7px;
  font-family: "Manrope", "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(15px, 1vw, 18px);
  font-weight: 950;
  white-space: nowrap;
}

body.kb-stitch-app .dashboard-cashflow-card {
  min-height: 0;
  padding: 24px !important;
  display: flex;
  flex-direction: column;
}

body.kb-stitch-app .dashboard-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

body.kb-stitch-app .dashboard-section-head h3 {
  color: var(--kb-text);
  font-size: 18px;
  font-weight: 900;
}

body.kb-stitch-app .dashboard-section-head > span,
body.kb-stitch-app .dashboard-section-head button {
  color: var(--kb-primary);
  font-size: 13px;
  font-weight: 900;
}

body.kb-stitch-app .dashboard-chart-stage {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  border-radius: 16px;
  border: 1px solid var(--kb-line-strong);
  background:
    linear-gradient(180deg, rgba(var(--kb-accent-rgb), .14), rgba(var(--kb-primary-rgb), .055)),
    rgba(255,255,255,.04);
  padding: 18px;
}

body.kb-stitch-app .dashboard-chart-stage canvas {
  width: 100% !important;
  height: 100% !important;
}

body.kb-stitch-app .dashboard-lower-grid .home-progress-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 20px;
  min-height: 0;
  overflow: hidden;
}

body.kb-stitch-app .dashboard-lower-grid .progress-brief-card {
  min-height: 0;
  padding: 24px !important;
}

body.kb-stitch-app .progress-card-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

body.kb-stitch-app .progress-card-copy {
  min-width: 0;
}

body.kb-stitch-app .dashboard-lower-grid .progress-card-value {
  font-family: "Manrope", "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(20px, 1.5vw, 24px) !important;
  line-height: 1.14;
  font-weight: 950;
  max-width: calc(100% - 64px);
}

body.kb-stitch-app .dashboard-recent-card {
  min-height: 0;
  margin-top: 0;
  padding: 24px !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.kb-stitch-app .dashboard-recent-card .dashboard-recent-list {
  display: grid;
  gap: 4px;
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}

body.kb-stitch-app .dashboard-recent-card .transaction-row {
  min-height: 92px;
  padding: 16px 0;
  border-bottom: 0;
  background: transparent;
}

body.kb-stitch-app .dashboard-recent-card .transaction-icon {
  width: 56px;
  height: 56px;
  border-radius: 999px !important;
}

body.kb-stitch-app .dashboard-recent-card .transaction-title {
  font-size: 18px;
}

body.kb-stitch-app .kb-date-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body.kb-stitch-app .kb-field-label,
body.kb-stitch-app label {
  color: var(--kb-muted) !important;
  font-size: 12px;
  font-weight: 900;
}

body.kb-stitch-app input,
body.kb-stitch-app select,
body.kb-stitch-app textarea {
  color: var(--kb-text) !important;
  border: 1px solid var(--kb-line) !important;
  border-radius: 8px !important;
  background: rgba(255,255,255,.068) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055);
}

body.kb-stitch-app input::placeholder,
body.kb-stitch-app textarea::placeholder {
  color: color-mix(in srgb, var(--kb-muted), transparent 24%) !important;
}

body.kb-stitch-app select option {
  color: #17111a;
  background: #fff7ff;
}

html.dark body.kb-stitch-app select option {
  color: #f5eaf3;
  background: #211522;
}

body.kb-stitch-app .kb-list-shell {
  padding: 0 !important;
}

body.kb-stitch-app .kb-list-header {
  min-height: 62px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--kb-line);
}

body.kb-stitch-app .kb-list-title {
  color: var(--kb-text);
  font-size: 16px;
  font-weight: 950;
}

body.kb-stitch-app .kb-list-meta {
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 800;
}

body.kb-stitch-app .transaction-list,
body.kb-stitch-app .dashboard-recent-list {
  display: grid;
  gap: 0;
}

body.kb-stitch-app .transaction-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: transparent;
}

body.kb-stitch-app .transaction-row:hover {
  background: rgba(255,255,255,.04);
}

body.kb-stitch-app .transaction-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--kb-text);
}

body.kb-stitch-app .transaction-title {
  color: var(--kb-text) !important;
  font-size: 14px;
  font-weight: 950;
}

body.kb-stitch-app .transaction-meta {
  color: var(--kb-muted) !important;
  font-size: 12px;
  font-weight: 750;
}

body.kb-stitch-app .transaction-amount {
  font-size: 14px;
  font-weight: 950;
  white-space: nowrap;
}

body.kb-stitch-app .transaction-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

body.kb-stitch-app .transaction-actions button {
  color: var(--kb-muted);
  font-size: 11px;
  font-weight: 900;
}

body.kb-stitch-app .transaction-actions button:hover {
  color: var(--kb-primary);
}

body.kb-stitch-app .chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--kb-muted);
  background: rgba(255,255,255,.06);
  font-size: 11px;
  font-weight: 850;
}

body.kb-stitch-app .analytics-chart-frame,
body.kb-stitch-app canvas {
  min-height: 0;
}

body.kb-stitch-app .planning-card,
body.kb-stitch-app .kb-section-card {
  padding: 20px !important;
}

body.kb-stitch-app .planning-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

body.kb-stitch-app .meeny-layout {
  min-height: calc(100dvh - var(--kb-stitch-topbar) - 56px);
}

body.kb-stitch-app .meeny-chat-shell {
  min-height: min(760px, calc(100dvh - var(--kb-stitch-topbar) - 56px));
  background:
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.035)),
    rgba(18, 10, 20, .68) !important;
}

body.kb-stitch-app .meeny-chat-header {
  padding: 16px 20px !important;
  background: rgba(255,255,255,.04);
  border-color: var(--kb-line) !important;
}

body.kb-stitch-app .meeny-avatar-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #190e19;
  font-weight: 950;
  background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent));
}

body.kb-stitch-app .meeny-messages {
  padding: 24px min(5vw, 58px) 18px !important;
}

body.kb-stitch-app .meeny-input-shell {
  position: sticky;
  bottom: 0;
  padding: 12px 16px 16px;
  background: linear-gradient(to top, rgba(16,8,18,.96), rgba(16,8,18,.64), transparent);
}

body.kb-stitch-app .meeny-input-bar-v2,
body.kb-stitch-app .meeny-model-menu {
  border: 1px solid var(--kb-line) !important;
  background: rgba(255,255,255,.085) !important;
  box-shadow: 0 24px 70px rgba(0,0,0,.28) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

body.kb-stitch-app .meeny-model-button,
body.kb-stitch-app .meeny-attach-button,
body.kb-stitch-app .meeny-send-round {
  border-radius: 8px !important;
  color: var(--kb-text);
  background: rgba(255,255,255,.07) !important;
}

body.kb-stitch-app .meeny-send-round {
  color: #190e19;
  background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent)) !important;
}

body.kb-stitch-app .meeny-model-option {
  color: var(--kb-text);
  border-radius: 8px !important;
}

body.kb-stitch-app .meeny-model-option.active {
  background: rgba(var(--kb-primary-rgb), .16);
}

body.kb-stitch-app .meeny-input-field {
  min-height: 38px;
  max-height: 180px;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

body.kb-stitch-app .automation-grid {
  display: grid;
  grid-template-columns: minmax(280px, .85fr) minmax(0, 1.35fr);
  gap: 16px;
}

body.kb-stitch-app .automation-panel,
body.kb-stitch-app .automation-card {
  padding: 20px !important;
}

body.kb-stitch-app .automation-list {
  display: grid;
  gap: 12px;
}

body.kb-stitch-app .locked-upgrade {
  border-color: rgba(var(--kb-primary-rgb), .38) !important;
  background:
    linear-gradient(135deg, rgba(var(--kb-primary-rgb), .16), rgba(var(--kb-accent-rgb), .09)),
    rgba(255,255,255,.06) !important;
}

body.kb-stitch-app .desktop-settings-shell {
  align-items: start;
}

body.kb-stitch-app .desktop-settings-shell > div > div,
body.kb-stitch-app .desktop-settings-shell > div:last-child {
  padding: 20px !important;
}

body.kb-stitch-app .profile-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body.kb-stitch-app .profile-quick-card {
  min-height: 118px;
  padding: 18px !important;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  color: var(--kb-text) !important;
  font-size: 15px;
  font-weight: 950;
}

body.kb-stitch-app .kb-panel-title,
body.kb-stitch-app .profile-quick-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--kb-text) !important;
}

body.kb-stitch-app .profile-quick-card span {
  color: var(--kb-muted);
  display: block;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 750;
}

body.kb-stitch-app .profile-quick-card .profile-quick-title {
  display: inline-flex;
  margin-top: 0;
  color: var(--kb-text);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 950;
}

body.kb-stitch-app .theme-option,
body.kb-stitch-app .theme-card,
body.kb-stitch-app [data-theme-option] {
  border-radius: 8px !important;
  border-color: var(--kb-line) !important;
  background: rgba(255,255,255,.06) !important;
}

body.kb-stitch-app .theme-library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

body.kb-stitch-app .theme-library-card,
body.kb-stitch-app .theme-option {
  min-height: 210px;
  padding: 18px !important;
  color: var(--kb-text) !important;
  box-shadow: var(--kb-stitch-shadow);
}

body.kb-stitch-app .theme-option-preview {
  height: 54px;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  grid-template-columns: .7fr 1fr .55fr;
  background: rgba(0,0,0,.18);
}

body.kb-stitch-app .theme-option-preview span:nth-child(1) { background: var(--kb-primary); }
body.kb-stitch-app .theme-option-preview span:nth-child(2) { background: var(--kb-accent); }
body.kb-stitch-app .theme-option-preview span:nth-child(3) { background: var(--kb-income); }

body.kb-stitch-app .mobile-profile-shell {
  max-width: 620px;
  margin: 0 auto;
}

body.kb-stitch-app .mobile-profile-card {
  padding: 20px !important;
}

body.kb-stitch-app .profile-action-grid {
  display: grid;
  gap: 10px;
}

body.kb-stitch-app .profile-action-row {
  width: 100%;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 14px;
  text-align: left;
}

body.kb-stitch-app .profile-action-label {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
}

body.kb-stitch-app .compact-toggle {
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--kb-line);
  background: rgba(255,255,255,.06);
}

body.kb-stitch-app .compact-toggle button {
  min-width: 40px;
  min-height: 34px;
  border-radius: 999px;
  color: var(--kb-text);
  font-weight: 950;
}

body.kb-stitch-app .compact-toggle button.active {
  color: #160e16;
  background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent));
}

body.kb-stitch-app .upgrade-page,
body.kb-stitch-app .upgrade-shell,
body.kb-stitch-app .theme-page,
body.kb-stitch-app .automations-page {
  color: var(--kb-text);
}

body.kb-stitch-app .upgrade-hero {
  min-height: 260px;
  text-align: center;
  place-items: center;
}

body.kb-stitch-app .upgrade-hero .kb-page-copy {
  margin-left: auto;
  margin-right: auto;
}

body.kb-stitch-app .upgrade-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

body.kb-stitch-app .upgrade-plan-card,
body.kb-stitch-app .upgrade-card {
  min-height: 390px;
  padding: 22px !important;
}

body.kb-stitch-app .upgrade-card > .plan-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  left: auto;
  width: auto;
}

body.kb-stitch-app .upgrade-card ul li {
  color: var(--kb-muted);
  font-weight: 800;
}

body.kb-stitch-app .upgrade-card button {
  border-radius: 8px !important;
}

body.kb-stitch-app .kb-empty-state {
  min-height: 190px;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--kb-muted);
  text-align: center;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(var(--kb-primary-rgb), .08), rgba(var(--kb-accent-rgb), .05)),
    rgba(255,255,255,.035);
}

body.kb-stitch-app .kb-empty-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 8px;
  color: var(--kb-primary);
  background: rgba(var(--kb-primary-rgb), .12);
  font-size: 24px;
}

body.kb-stitch-app .kb-empty-title {
  color: var(--kb-text);
  font-size: 15px;
  font-weight: 950;
}

body.kb-stitch-app .kb-empty-copy {
  color: var(--kb-muted);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 750;
}

body.kb-stitch-app .modal-backdrop {
  background: rgba(7, 4, 9, .72) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body.kb-stitch-app .modal-backdrop > div,
body.kb-stitch-app #mobile-panel-overlay > div,
body.kb-stitch-app .category-preference-dialog {
  border: 1px solid var(--kb-line) !important;
  border-radius: 16px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.05)),
    rgba(28, 17, 30, .94) !important;
  color: var(--kb-text) !important;
  box-shadow: 0 30px 110px rgba(0,0,0,.52) !important;
}

/* Light mode: the dialog surface follows the theme too (it used to stay dark with dark text). */
html.light body.kb-stitch-app .modal-backdrop > div,
html.light body.kb-stitch-app .category-preference-dialog {
  background:
    linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,.5)),
    color-mix(in srgb, var(--kb-panel-solid) 96%, transparent) !important;
  box-shadow: 0 30px 90px rgba(38, 21, 38, .22) !important;
}

body.kb-stitch-app .pill-btn.active {
  color: #160e16 !important;
  background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent)) !important;
}

body.kb-stitch-app #toast,
body.kb-stitch-app .toast {
  border-radius: 12px !important;
  border: 1px solid var(--kb-line) !important;
  color: var(--kb-text) !important;
  background: rgba(28, 18, 30, .92) !important;
  box-shadow: 0 22px 70px rgba(0,0,0,.38) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

body.kb-stitch-app #app .bg-white,
body.kb-stitch-app #app .dark\:bg-gray-800,
body.kb-stitch-app #app .dark\:bg-gray-900,
body.kb-stitch-app .modal-backdrop .bg-white,
body.kb-stitch-app .modal-backdrop .dark\:bg-gray-800,
body.kb-stitch-app .modal-backdrop .dark\:bg-gray-900,
body.kb-stitch-app #mobile-panel-overlay .bg-white,
body.kb-stitch-app #mobile-panel-overlay .dark\:bg-gray-800,
body.kb-stitch-app #mobile-panel-overlay .dark\:bg-gray-900 {
  background-color: transparent;
}

body.kb-stitch-app #app .text-gray-900,
body.kb-stitch-app #app .dark\:text-white,
body.kb-stitch-app #app .text-gray-800,
body.kb-stitch-app .modal-backdrop .text-gray-900,
body.kb-stitch-app .modal-backdrop .dark\:text-white,
body.kb-stitch-app .modal-backdrop .text-gray-800,
body.kb-stitch-app #mobile-panel-overlay .text-gray-900,
body.kb-stitch-app #mobile-panel-overlay .dark\:text-white,
body.kb-stitch-app #mobile-panel-overlay .text-gray-800 {
  color: var(--kb-text);
}

body.kb-stitch-app #app .text-gray-500,
body.kb-stitch-app #app .text-gray-400,
body.kb-stitch-app #app .dark\:text-gray-400,
body.kb-stitch-app .modal-backdrop .text-gray-500,
body.kb-stitch-app .modal-backdrop .text-gray-400,
body.kb-stitch-app .modal-backdrop .dark\:text-gray-400,
body.kb-stitch-app #mobile-panel-overlay .text-gray-500,
body.kb-stitch-app #mobile-panel-overlay .text-gray-400,
body.kb-stitch-app #mobile-panel-overlay .dark\:text-gray-400 {
  color: var(--kb-muted);
}

body.kb-stitch-app #app .border-gray-100,
body.kb-stitch-app #app .border-gray-200,
body.kb-stitch-app #app .dark\:border-gray-700,
body.kb-stitch-app #app .dark\:border-gray-800,
body.kb-stitch-app .modal-backdrop .border-gray-100,
body.kb-stitch-app .modal-backdrop .border-gray-200,
body.kb-stitch-app .modal-backdrop .dark\:border-gray-700,
body.kb-stitch-app .modal-backdrop .dark\:border-gray-800,
body.kb-stitch-app #mobile-panel-overlay .border-gray-100,
body.kb-stitch-app #mobile-panel-overlay .border-gray-200,
body.kb-stitch-app #mobile-panel-overlay .dark\:border-gray-700,
body.kb-stitch-app #mobile-panel-overlay .dark\:border-gray-800 {
  border-color: var(--kb-line);
}

body.kb-stitch-app .mobile-bottom-nav {
  display: none;
}

body.kb-stitch-app #fab {
  display: none !important;
}

@media (max-width: 900px) {
  body.kb-stitch-app .automation-grid,
  body.kb-stitch-app .upgrade-plan-grid {
    grid-template-columns: 1fr;
  }

  body.kb-stitch-app .theme-library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  body.kb-stitch-app {
    overflow: hidden;
    background:
      radial-gradient(circle at 18% -6%, rgba(var(--kb-primary-rgb), .24), transparent 20rem),
      linear-gradient(180deg, var(--kb-bg-deep), var(--kb-bg));
  }

  body.kb-stitch-app #app.kb-app-shell {
    min-height: 100dvh;
    display: block;
  }

  body.kb-stitch-app .kb-sidebar,
  body.kb-stitch-app #sidebar-overlay {
    display: none !important;
  }

  body.kb-stitch-app #main-content {
    margin-left: 0 !important;
    width: 100%;
    height: 100dvh;
    overflow-y: auto;
    padding-bottom: calc(var(--kb-stitch-bottom-nav) + env(safe-area-inset-bottom) + 14px);
  }

  body.kb-stitch-app .kb-topbar {
    min-height: 62px;
    padding: calc(env(safe-area-inset-top) + 10px) 16px 10px !important;
    border-bottom: 0 !important;
    background: linear-gradient(180deg, rgba(20,11,20,.94), rgba(20,11,20,.72)) !important;
  }

  body.kb-stitch-app .kb-topbar .menu-button,
  body.kb-stitch-app .kb-topbar .md\:flex {
    display: none !important;
  }

  body.kb-stitch-app #page-title {
    font-size: 15px !important;
  }

  body.kb-stitch-app #page-subtitle {
    max-width: 58vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.kb-stitch-app .kb-content-canvas {
    width: 100%;
    padding: 14px 14px 0 !important;
  }

  body.kb-stitch-app[data-page="dashboard"] .kb-topbar {
    display: none !important;
  }

  body.kb-stitch-app[data-page="dashboard"] #main-content {
    overflow: hidden;
    padding-bottom: 0;
  }

  body.kb-stitch-app body[data-page="dashboard"] .kb-content-canvas,
  body.kb-stitch-app[data-page="dashboard"] .kb-content-canvas {
    height: 100dvh;
    overflow: hidden;
    padding: calc(env(safe-area-inset-top) + 9px) 15px calc(var(--kb-stitch-bottom-nav) + env(safe-area-inset-bottom) + 8px) !important;
  }

  body.kb-stitch-app .dashboard-stitch-header {
    display: none;
  }

  body.kb-stitch-app .dashboard-stitch-shell {
    grid-template-rows: auto auto auto minmax(0, 1fr);
    height: 100%;
    gap: clamp(10px, 1.25vh, 14px);
    padding-bottom: 0;
    overflow: hidden;
  }

  body.kb-stitch-app .dashboard-mobile-brand {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  body.kb-stitch-app .dashboard-mobile-logo {
    width: 25px;
    height: 25px;
    border-radius: 999px !important;
  }

  body.kb-stitch-app .dashboard-mobile-brand h1 {
    color: var(--kb-text);
    font-size: clamp(21px, 5.9vw, 26px);
    line-height: 1.05;
    font-weight: 950;
  }

  body.kb-stitch-app .dashboard-bell {
    position: relative;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: var(--kb-primary);
    border: 0;
    background: transparent;
  }

  body.kb-stitch-app .dashboard-bell .kb-inline-icon {
    width: 20px;
    height: 20px;
  }

  body.kb-stitch-app .dashboard-bell > span:not(.kb-inline-icon) {
    position: absolute;
    top: 8px;
    right: 7px;
    min-width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: var(--kb-expense);
    font-size: 10px;
    font-weight: 950;
  }

  body.kb-stitch-app .dashboard-mobile-greeting {
    display: block;
  }

  body.kb-stitch-app .dashboard-mobile-greeting h2 {
    color: var(--kb-text);
    font-size: clamp(18px, 4.9vw, 22px);
    line-height: 1.08;
    font-weight: 850;
  }

  body.kb-stitch-app .dashboard-mobile-greeting p {
    color: var(--kb-muted);
    margin-top: 4px;
    font-size: clamp(12px, 3.45vw, 14px);
    font-weight: 850;
  }

  body.kb-stitch-app .mobile-home-head {
    display: none !important;
  }

  body.kb-stitch-app .mobile-home-action {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    color: var(--kb-text);
    border: 1px solid var(--kb-line);
    background: rgba(255,255,255,.07);
  }

  body.kb-stitch-app .dashboard-overview-grid,
  body.kb-stitch-app .dashboard-lower-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(9px, 1.35vh, 14px);
    min-height: 0;
    overflow: hidden;
  }

  body.kb-stitch-app .dashboard-lower-grid {
    grid-template-rows: clamp(150px, 18.5vh, 176px) minmax(0, 1fr);
  }

  body.kb-stitch-app .dashboard-balance-card {
    min-height: 0;
    height: clamp(170px, 23.5vh, 202px);
    padding: clamp(15px, 4vw, 19px) !important;
    border-radius: 18px !important;
  }

  body.kb-stitch-app .dashboard-period-pill {
    display: none;
  }

  body.kb-stitch-app .dashboard-balance-card .dashboard-balance {
    font-size: clamp(29px, 7.8vw, 36px) !important;
    line-height: 1;
    margin-top: clamp(8px, 1.35vh, 12px);
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
  }

  body.kb-stitch-app .dashboard-balance-head {
    gap: 12px;
  }

  body.kb-stitch-app .balance-toggle {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
    margin-top: 2px;
    border-radius: 14px;
  }

  body.kb-stitch-app .balance-toggle svg {
    width: 18px;
    height: 18px;
  }

  body.kb-stitch-app .dashboard-card-label {
    text-transform: none;
    letter-spacing: 0 !important;
    font-size: clamp(14px, 3.75vw, 16px);
    font-weight: 760;
  }

  body.kb-stitch-app .dashboard-money-pair {
    align-items: end;
  }

  body.kb-stitch-app .dashboard-balance-divider {
    margin: clamp(12px, 1.8vh, 16px) 0;
  }

  body.kb-stitch-app .dashboard-flow-label {
    font-size: clamp(11px, 3.2vw, 14px);
    gap: 6px;
  }

  body.kb-stitch-app .dashboard-flow-label .kb-inline-icon {
    width: 17px;
    height: 17px;
  }

  body.kb-stitch-app .dashboard-flow-value {
    color: var(--kb-text) !important;
    margin-top: 5px;
    font-size: clamp(13px, 3.65vw, 16px);
    white-space: nowrap;
  }

  body.kb-stitch-app .dashboard-cashflow-card {
    display: none;
  }

  body.kb-stitch-app .metric-card {
    min-height: 118px;
    padding: 16px !important;
  }

  body.kb-stitch-app .metric-card .text-xl {
    font-size: 17px !important;
    word-break: break-word;
  }

  body.kb-stitch-app .home-progress-grid,
  body.kb-stitch-app .analytics-planning-overview,
  body.kb-stitch-app .profile-quick-grid {
    grid-template-columns: 1fr;
  }

  body.kb-stitch-app .dashboard-lower-grid .home-progress-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-height: 0;
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-brief-card {
    min-height: 0;
    height: 100%;
    padding: 14px !important;
    border-radius: 16px !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-card-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "icon title"
      "value value";
    align-items: center;
    gap: 8px 10px;
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-card-copy {
    display: contents;
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-card-title {
    grid-area: title;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: clamp(13px, 3.45vw, 15px) !important;
    line-height: 1.15;
    color: var(--kb-primary) !important;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-card-value {
    grid-area: value;
    font-size: clamp(17px, 4.75vw, 22px) !important;
    line-height: 1.05;
    margin-top: 8px !important;
    max-width: none;
    overflow-wrap: anywhere;
    word-break: normal;
    white-space: normal;
    letter-spacing: 0 !important;
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-card-icon {
    grid-area: icon;
    width: 31px !important;
    height: 31px !important;
    border-radius: 12px !important;
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-meter {
    flex: 0 0 6px;
    width: 100%;
    height: 6px;
    margin-top: 12px !important;
    display: block !important;
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-card-detail {
    display: none;
  }

  body.kb-stitch-app .dashboard-recent-card {
    min-height: 0;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.kb-stitch-app .dashboard-recent-card .dashboard-section-head {
    margin-bottom: 8px;
    flex: 0 0 auto;
  }

  body.kb-stitch-app .dashboard-recent-card .dashboard-section-head h3 {
    font-size: clamp(18px, 4.8vw, 22px);
    line-height: 1.1;
    font-weight: 760;
  }

  body.kb-stitch-app .dashboard-recent-card .dashboard-section-head button {
    color: var(--kb-primary);
    font-size: 13px;
  }

  body.kb-stitch-app .dashboard-recent-card .dashboard-recent-list {
    gap: 10px;
    min-height: 0;
    overflow: auto;
    padding-right: 2px;
  }

  body.kb-stitch-app .dashboard-recent-card .transaction-row {
    min-height: 70px;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--kb-line-strong);
    border-radius: 14px;
    background: rgba(255,255,255,.035);
  }

  html.light body.kb-stitch-app .dashboard-recent-card .transaction-row {
    background: rgba(255,255,255,.75);
  }

  body.kb-stitch-app .dashboard-recent-card .transaction-icon {
    width: 38px;
    height: 38px;
  }

  body.kb-stitch-app .dashboard-recent-card .transaction-side {
    grid-column: auto;
    display: block;
    text-align: right;
  }

  body.kb-stitch-app .dashboard-recent-card .transaction-title {
    font-size: 15px;
    line-height: 1.15;
  }

  body.kb-stitch-app .dashboard-recent-card .transaction-meta {
    font-size: 12px;
    line-height: 1.25;
  }

  body.kb-stitch-app .dashboard-recent-card .transaction-amount {
    font-size: 13px;
  }

  body.kb-stitch-app .dashboard-recent-card .transaction-actions {
    display: none;
  }

  body.kb-stitch-app .kb-screen-head {
    min-height: auto;
    padding: 18px !important;
  }

  body.kb-stitch-app .kb-page-title {
    font-size: 30px;
    line-height: 1;
  }

  body.kb-stitch-app .kb-page-copy {
    font-size: 13px;
  }

  body.kb-stitch-app .kb-action-row .push {
    margin-left: 0;
  }

  body.kb-stitch-app .kb-action-row > * {
    flex: 1 1 auto;
  }

  body.kb-stitch-app .transaction-row {
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
    padding: 14px;
  }

  body.kb-stitch-app .transaction-side {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  body.kb-stitch-app .transaction-actions {
    margin-top: 0;
  }

  body.kb-stitch-app .theme-library-grid {
    grid-template-columns: 1fr;
  }

  body.kb-stitch-app .theme-library-card,
  body.kb-stitch-app .theme-option,
  body.kb-stitch-app .upgrade-card {
    min-height: auto;
  }

  body.kb-stitch-app .upgrade-hero {
    min-height: auto;
    text-align: left;
    place-items: stretch;
  }

  body.kb-stitch-app[data-page="meeny"] .kb-topbar {
    display: none !important;
  }

  body.kb-stitch-app[data-page="meeny"] .kb-content-canvas {
    padding: 0 !important;
  }

  body.kb-stitch-app .meeny-layout,
  body.kb-stitch-app .meeny-chat-shell {
    min-height: 100dvh;
    height: 100dvh;
    border-radius: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body.kb-stitch-app .meeny-messages {
    padding: calc(env(safe-area-inset-top) + 18px) 16px calc(var(--kb-stitch-bottom-nav) + 118px) !important;
  }

  body.kb-stitch-app .meeny-input-shell {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--kb-stitch-bottom-nav) + env(safe-area-inset-bottom));
    z-index: 36;
    padding: 8px 12px 10px;
  }

  body.kb-stitch-app .meeny-input-bar-v2 {
    border-radius: 16px !important;
  }

  body.kb-stitch-app .modal-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  body.kb-stitch-app .modal-backdrop > div,
  body.kb-stitch-app #mobile-panel-overlay > div {
    width: 100% !important;
    max-width: none !important;
    max-height: min(88dvh, 760px) !important;
    overflow-y: auto;
    border-radius: 20px 20px 0 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    padding-bottom: max(18px, env(safe-area-inset-bottom)) !important;
  }

  body.kb-stitch-app .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 54;
    height: var(--kb-stitch-bottom-nav);
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    gap: 2px;
    padding: 7px 12px max(7px, env(safe-area-inset-bottom));
    border: 1px solid var(--kb-line);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    background: rgba(28, 18, 30, .86);
    box-shadow: 0 -10px 34px rgba(0,0,0,.28);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
  }

  body.kb-stitch-app:not([data-app-ready="true"]) .mobile-bottom-nav {
    display: none !important;
  }

  body.kb-stitch-app .mobile-nav-btn {
    min-width: 0;
    height: 56px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    border-radius: 14px;
    color: var(--kb-muted);
    font-size: 10px;
    font-weight: 900;
  }

  body.kb-stitch-app .mobile-nav-btn.active {
    color: var(--kb-text);
    background: rgba(255,255,255,.07);
  }

  body.kb-stitch-app .mobile-nav-btn.mobile-ai-main {
    color: #170e17;
    transform: none;
  }

  body.kb-stitch-app .mobile-nav-btn.mobile-ai-main .mobile-nav-icon {
    width: 44px;
    height: 44px;
    margin-bottom: -2px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent));
    box-shadow: 0 16px 40px rgba(var(--kb-primary-rgb), .32);
  }

  body.kb-stitch-app .mobile-nav-btn.mobile-ai-main span:last-child {
    color: var(--kb-text);
  }

  body.kb-stitch-app .mobile-ai-sheet {
    background: rgba(7,4,9,.66) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  body.kb-stitch-app .mobile-ai-panel {
    border: 1px solid var(--kb-line) !important;
    border-radius: 22px 22px 0 0 !important;
    color: var(--kb-text);
    background:
      linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.055)),
      rgba(28, 18, 30, .96) !important;
  }

  body.kb-stitch-app .mobile-ai-option {
    min-height: 70px;
    border-radius: 14px !important;
    border: 1px solid var(--kb-line) !important;
    color: var(--kb-text);
    background: rgba(255,255,255,.06) !important;
  }
}

@media (max-width: 430px) {
  body.kb-stitch-app .kb-content-canvas {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  body.kb-stitch-app[data-page="dashboard"] .kb-content-canvas {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  body.kb-stitch-app .mobile-bottom-nav {
    left: 0;
    right: 0;
  }

  body.kb-stitch-app .mobile-nav-btn {
    font-size: 9px;
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-card-icon {
    width: 28px !important;
    height: 28px !important;
  }
}

@media (max-width: 380px), (max-width: 768px) and (max-height: 760px) {
  body.kb-stitch-app[data-page="dashboard"] .kb-content-canvas {
    padding-top: calc(env(safe-area-inset-top) + 8px) !important;
  }

  body.kb-stitch-app .dashboard-stitch-shell {
    gap: 8px;
  }

  body.kb-stitch-app .dashboard-mobile-logo {
    width: 24px;
    height: 24px;
  }

  body.kb-stitch-app .dashboard-mobile-brand h1 {
    font-size: 22px;
  }

  body.kb-stitch-app .dashboard-bell {
    width: 30px;
    height: 30px;
  }

  body.kb-stitch-app .dashboard-bell .kb-inline-icon {
    width: 18px;
    height: 18px;
  }

  body.kb-stitch-app .dashboard-mobile-greeting h2 {
    font-size: 18px;
  }

  body.kb-stitch-app .dashboard-mobile-greeting p {
    font-size: 12px;
  }

  body.kb-stitch-app .dashboard-balance-card {
    height: 164px;
    padding: 14px !important;
  }

  body.kb-stitch-app .dashboard-balance-card .dashboard-balance {
    font-size: 29px !important;
  }

  body.kb-stitch-app .dashboard-balance-divider {
    margin: 14px 0;
  }

  body.kb-stitch-app .dashboard-flow-value {
    font-size: 14px;
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-brief-card {
    padding: 12px !important;
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-card-value {
    font-size: 16px !important;
  }

  body.kb-stitch-app .dashboard-recent-card .dashboard-section-head h3 {
    font-size: 18px;
  }
}

/* Final mobile interaction and layout hardening. */
body.kb-stitch-app .transaction-mobile-toolbar {
  display: none;
}

@media (max-width: 768px) {
  body.kb-stitch-app.kb-mobile-ai-open .mobile-bottom-nav,
  body.kb-stitch-app.kb-mobile-panel-open .mobile-bottom-nav,
  body.kb-stitch-app.kb-modal-open .mobile-bottom-nav {
    opacity: 0;
    pointer-events: none;
    transform: translateY(110%);
  }

  body.kb-stitch-app .mobile-bottom-nav {
    transition: transform .22s ease, opacity .18s ease;
  }

  body.kb-stitch-app .mobile-ai-sheet {
    z-index: 80;
  }

  body.kb-stitch-app #mobile-panel-overlay {
    z-index: 82;
  }

  body.kb-stitch-app .modal-backdrop {
    z-index: 84;
  }

  body.kb-stitch-app .mobile-ai-panel {
    padding-bottom: max(18px, env(safe-area-inset-bottom)) !important;
  }

  body.kb-stitch-app .modal-backdrop > div,
  body.kb-stitch-app #mobile-panel-overlay > div {
    max-height: min(92dvh, 780px) !important;
  }

  body.kb-stitch-app #modal-transaction > div {
    display: flex;
    flex-direction: column;
    padding: 18px !important;
  }

  body.kb-stitch-app #modal-transaction .space-y-4 {
    display: grid;
    gap: 12px;
  }

  body.kb-stitch-app #modal-transaction .flex.gap-3.mt-6 {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 14px -18px -18px !important;
    padding: 12px 18px max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--kb-line);
    background:
      linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04)),
      var(--kb-panel-solid);
  }

  body.kb-stitch-app[data-page="dashboard"] .kb-content-canvas {
    height: 100dvh;
    padding: calc(env(safe-area-inset-top) + 10px) 14px calc(var(--kb-stitch-bottom-nav) + env(safe-area-inset-bottom) + 8px) !important;
  }

  body.kb-stitch-app .dashboard-stitch-shell {
    grid-template-rows: 32px 50px clamp(176px, 23.5dvh, 204px) minmax(0, 1fr);
    gap: clamp(9px, 1.15dvh, 12px);
  }

  body.kb-stitch-app .dashboard-mobile-logo {
    width: 24px;
    height: 24px;
  }

  body.kb-stitch-app .dashboard-mobile-brand h1 {
    font-size: clamp(22px, 5.4vw, 24px);
  }

  body.kb-stitch-app .dashboard-bell {
    width: 28px;
    height: 28px;
  }

  body.kb-stitch-app .dashboard-bell .kb-inline-icon {
    width: 19px;
    height: 19px;
  }

  body.kb-stitch-app .dashboard-mobile-greeting h2 {
    font-size: clamp(19px, 4.8vw, 21px);
  }

  body.kb-stitch-app .dashboard-mobile-greeting p {
    font-size: 13px;
  }

  body.kb-stitch-app .dashboard-overview-grid {
    height: 100%;
  }

  body.kb-stitch-app .dashboard-balance-card {
    height: 100% !important;
    min-height: 0;
    padding: clamp(15px, 3.8vw, 18px) !important;
  }

  body.kb-stitch-app .dashboard-balance-card .dashboard-balance {
    font-size: clamp(30px, 7.7vw, 35px) !important;
    letter-spacing: 0 !important;
  }

  body.kb-stitch-app .dashboard-flow-value,
  body.kb-stitch-app .dashboard-lower-grid .progress-card-value,
  body.kb-stitch-app .dashboard-recent-card .transaction-amount {
    font-family: "Manrope", "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    letter-spacing: 0 !important;
  }

  body.kb-stitch-app .dashboard-flow-value {
    font-size: clamp(14px, 3.5vw, 16px);
  }

  body.kb-stitch-app .dashboard-lower-grid {
    grid-template-rows: clamp(112px, 15.8dvh, 128px) minmax(0, 1fr);
    gap: clamp(10px, 1.25dvh, 14px);
  }

  body.kb-stitch-app .dashboard-lower-grid .home-progress-grid {
    height: 100%;
    gap: 12px;
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-brief-card {
    min-height: 112px !important;
    height: 100% !important;
    display: grid !important;
    grid-template-rows: minmax(0, 1fr) 6px;
    align-content: stretch;
    gap: 10px;
    padding: 13px !important;
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-card-main {
    min-height: 0;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    grid-template-areas:
      "icon title"
      "value value";
    align-items: center;
    align-content: start;
    gap: 7px 9px;
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-card-title {
    font-size: 14px !important;
    line-height: 1.1;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-card-value {
    align-self: end;
    margin-top: 2px !important;
    font-size: clamp(14px, 3.9vw, 16px) !important;
    line-height: 1.08;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-card-icon {
    width: 30px !important;
    height: 30px !important;
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-meter {
    position: static !important;
    align-self: end;
    height: 6px !important;
    margin: 0 !important;
    overflow: hidden;
  }

  body.kb-stitch-app .dashboard-recent-card .dashboard-recent-list {
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  body.kb-stitch-app[data-page="transactions"] .kb-content-canvas {
    padding-bottom: calc(var(--kb-stitch-bottom-nav) + env(safe-area-inset-bottom) + 18px) !important;
  }

  body.kb-stitch-app[data-page="transactions"] .kb-screen-head .kb-primary-action {
    display: none;
  }

  body.kb-stitch-app .transaction-mobile-toolbar {
    display: grid;
    grid-template-columns: 1.15fr .9fr .9fr;
    gap: 8px;
    margin-bottom: 10px;
  }

  body.kb-stitch-app .transaction-mobile-toolbar > button {
    min-height: 42px;
    padding: 0 10px !important;
    border-radius: 14px !important;
    font-size: 12px;
  }

  body.kb-stitch-app .transaction-filter-panel {
    margin-bottom: 10px;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.kb-stitch-app .transaction-filter-panel:not(.open) {
    display: none;
  }

  body.kb-stitch-app .transaction-filter-panel.open {
    padding: 12px !important;
    border: 1px solid var(--kb-line) !important;
    background: rgba(255,255,255,.055) !important;
    border-radius: 18px !important;
  }

  body.kb-stitch-app .transaction-filter-panel .kb-action-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.kb-stitch-app .transaction-filter-panel .kb-action-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.kb-stitch-app .kb-list-header {
    min-height: 54px;
    padding: 13px 14px;
  }

  body.kb-stitch-app .transaction-list .transaction-row {
    min-height: 74px;
    padding: 12px 14px;
  }

  body.kb-stitch-app[data-page="analytics"] .kb-content-canvas,
  body.kb-stitch-app[data-page="automations"] .kb-content-canvas,
  body.kb-stitch-app[data-page="themes"] .kb-content-canvas,
  body.kb-stitch-app[data-page="settings"] .kb-content-canvas {
    padding-bottom: calc(var(--kb-stitch-bottom-nav) + env(safe-area-inset-bottom) + 18px) !important;
  }

  body.kb-stitch-app[data-page="analytics"] .kb-screen-head,
  body.kb-stitch-app[data-page="automations"] .kb-screen-head,
  body.kb-stitch-app[data-page="themes"] .kb-screen-head {
    padding: 15px !important;
    margin-bottom: 12px;
  }

  body.kb-stitch-app[data-page="analytics"] .kb-page-title,
  body.kb-stitch-app[data-page="automations"] .kb-page-title,
  body.kb-stitch-app[data-page="themes"] .kb-page-title {
    font-size: 25px;
  }

  body.kb-stitch-app[data-page="analytics"] .analytics-planning-overview {
    gap: 10px;
    margin-bottom: 12px;
  }

  body.kb-stitch-app[data-page="analytics"] .planning-card,
  body.kb-stitch-app[data-page="analytics"] .kb-section-card {
    padding: 14px !important;
    margin-bottom: 12px !important;
  }

  body.kb-stitch-app[data-page="analytics"] #daily-chart-frame,
  body.kb-stitch-app[data-page="analytics"] .analytics-chart-frame {
    height: 220px !important;
  }

  body.kb-stitch-app[data-page="analytics"] .kb-section-card .relative.h-64,
  body.kb-stitch-app[data-page="analytics"] .kb-section-card .relative.h-56 {
    height: 210px !important;
  }

  body.kb-stitch-app[data-page="automations"] .automation-grid {
    gap: 12px;
  }

  body.kb-stitch-app[data-page="automations"] .automation-panel,
  body.kb-stitch-app[data-page="automations"] .automation-card {
    padding: 15px !important;
    border-radius: 18px !important;
  }

  body.kb-stitch-app[data-page="automations"] .automation-panel input,
  body.kb-stitch-app[data-page="automations"] .automation-panel select {
    min-height: 44px;
    padding: 10px 12px !important;
    border-radius: 14px !important;
  }

  body.kb-stitch-app[data-page="automations"] .automation-panel label {
    letter-spacing: .08em !important;
  }

  body.kb-stitch-app[data-page="automations"] .automation-card > div {
    gap: 12px;
  }

  body.kb-stitch-app[data-page="automations"] .automation-card .flex.gap-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 380px), (max-width: 768px) and (max-height: 760px) {
  body.kb-stitch-app .dashboard-stitch-shell {
    grid-template-rows: 30px 44px clamp(162px, 23dvh, 184px) minmax(0, 1fr);
  }

  body.kb-stitch-app .dashboard-lower-grid {
    grid-template-rows: clamp(104px, 15.5dvh, 118px) minmax(0, 1fr);
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-brief-card {
    min-height: 104px !important;
    gap: 8px;
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-card-title {
    font-size: 13px !important;
  }

  body.kb-stitch-app .dashboard-lower-grid .progress-card-value {
    font-size: 13px !important;
  }
}

/* ── App feel layer: touch feedback, busy states, and motion ─────────── */
html {
  -webkit-tap-highlight-color: transparent;
}

body.kb-stitch-app {
  overscroll-behavior-y: none;
}

body.kb-stitch-app :where(button, [role="button"], .mobile-nav-btn, .nav-item, .kb-pressable) {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  transition: scale .18s cubic-bezier(.2, .8, .2, 1);
}

body.kb-stitch-app :is(button, [role="button"], .mobile-nav-btn, .nav-item, .kb-pressable):active:not(:disabled):not(.kb-pending):not(.kb-no-press) {
  scale: .97;
  transition-duration: .06s;
}

body.kb-stitch-app .mobile-nav-btn.mobile-ai-main:active {
  scale: .9;
}

body.kb-stitch-app .kb-pending {
  pointer-events: none;
}

body.kb-stitch-app .kb-busy-anchor {
  position: relative;
}

body.kb-stitch-app .kb-busy {
  color: transparent !important;
}

body.kb-stitch-app .kb-busy > * {
  visibility: hidden;
}

body.kb-stitch-app .kb-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  margin: auto;
  border-radius: 999px;
  border: 2px solid var(--kb-busy-color, currentColor);
  border-right-color: transparent;
  animation: kbSpin .7s linear infinite;
}

body.kb-stitch-app .modal-backdrop:not(.hidden) {
  animation: kbFadeIn .18s ease-out;
}

body.kb-stitch-app .modal-backdrop:not(.hidden) > div {
  animation: kbPopIn .24s cubic-bezier(.2, .8, .2, 1);
}

body.kb-stitch-app #toast-container .toast.kb-toast-leave {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease;
}

@media (max-width: 768px) {
  body.kb-stitch-app .modal-backdrop:not(.hidden) > div {
    animation: kbSheetUp .32s cubic-bezier(.2, .8, .2, 1);
  }

  /* Snackbar-style toasts above the bottom nav instead of over the header. */
  body.kb-stitch-app #toast-container {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: calc(var(--kb-stitch-bottom-nav) + env(safe-area-inset-bottom) + 12px);
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  body.kb-stitch-app #toast-container .toast {
    max-width: 100%;
    animation: kbToastUp .32s cubic-bezier(.2, .8, .2, 1);
  }

  body.kb-stitch-app #toast-container .toast.kb-toast-leave {
    transform: translateY(8px);
  }

  /* While a bottom sheet or modal is open, toasts move to the top so they do not cover it. */
  body.kb-stitch-app:is(.kb-modal-open, .kb-mobile-ai-open) #toast-container {
    top: calc(env(safe-area-inset-top) + 12px);
    bottom: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.kb-stitch-app .modal-backdrop:not(.hidden),
  body.kb-stitch-app .modal-backdrop:not(.hidden) > div,
  body.kb-stitch-app #toast-container .toast {
    animation-duration: .01ms !important;
  }

  body.kb-stitch-app :is(button, [role="button"], .mobile-nav-btn, .nav-item, .kb-pressable):active {
    scale: 1;
  }
}

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

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

@keyframes kbPopIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
}

@keyframes kbSheetUp {
  from { transform: translateY(100%); }
}

@keyframes kbToastUp {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
}

/* ── Transactions: day-grouped feed ───────────────────────────────────── */
body.kb-stitch-app .trx-page {
  --trx-sticky-top: 0px;
  --trx-sticky-bg: rgba(20, 11, 20, .9);
  --trx-row-bg: var(--kb-panel-solid);
  --trx-hover: rgba(255, 255, 255, .05);
  --trx-shimmer: rgba(255, 255, 255, .05);
  --trx-shimmer-hi: rgba(255, 255, 255, .11);
  max-width: 820px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
  padding-bottom: 20px;
}

html.light body.kb-stitch-app .trx-page {
  --trx-sticky-bg: rgba(247, 241, 247, .92);
  --trx-hover: rgba(38, 21, 38, .045);
  --trx-shimmer: rgba(38, 21, 38, .05);
  --trx-shimmer-hi: rgba(38, 21, 38, .1);
}

body.kb-stitch-app :is(.trx-page, .trx-sheet, .kb-swipe-actions, .kb-action-toast) svg:not(.meeny) {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.kb-stitch-app .trx-head {
  display: grid;
  gap: 10px;
}

body.kb-stitch-app .trx-head-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title actions" "period period";
  align-items: center;
  gap: 12px;
}

body.kb-stitch-app .trx-head-title {
  grid-area: title;
  margin: 0;
  color: var(--kb-text);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -.02em;
}

body.kb-stitch-app .trx-head-actions {
  grid-area: actions;
  display: flex;
  gap: 8px;
}

body.kb-stitch-app .trx-period {
  grid-area: period;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--kb-line);
  border-radius: 14px;
  background: var(--kb-panel);
}

body.kb-stitch-app .trx-period-label {
  color: var(--kb-text);
  font-size: 14px;
  font-weight: 850;
}

body.kb-stitch-app .trx-period-btn,
body.kb-stitch-app .trx-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  color: var(--kb-text);
  background: transparent;
}

body.kb-stitch-app .trx-period-btn:disabled {
  opacity: .28;
}

body.kb-stitch-app .trx-icon-btn {
  border: 1px solid var(--kb-line);
  background: var(--kb-panel);
}

body.kb-stitch-app .trx-icon-btn.is-active {
  color: var(--kb-primary);
  border-color: rgba(var(--kb-primary-rgb), .45);
  background: rgba(var(--kb-primary-rgb), .12);
}

body.kb-stitch-app .trx-filter-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--kb-primary);
  box-shadow: 0 0 0 2px var(--kb-bg);
}

body.kb-stitch-app .trx-filter-dot[hidden] {
  display: none;
}

body.kb-stitch-app .trx-period-range {
  flex: 1;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--kb-primary);
  font-size: 14px;
  font-weight: 850;
}

body.kb-stitch-app .trx-period-range span {
  font-size: 18px;
  line-height: 1;
}

body.kb-stitch-app .trx-search {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid rgba(var(--kb-primary-rgb), .35);
  border-radius: 14px;
  background: var(--kb-panel);
}

body.kb-stitch-app .trx-search[hidden] {
  display: none;
}

body.kb-stitch-app .trx-search-icon {
  display: grid;
  color: var(--kb-muted);
}

body.kb-stitch-app .trx-search-icon svg {
  width: 18px;
  height: 18px;
}

body.kb-stitch-app .trx-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 !important;
  border: 0 !important;
  outline: none;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--kb-text);
  font-size: 16px;
}

body.kb-stitch-app .trx-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--kb-line);
  border-radius: 16px;
  background: var(--kb-panel);
}

body.kb-stitch-app .trx-summary-cell {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
}

body.kb-stitch-app .trx-summary-cell + .trx-summary-cell {
  border-left: 1px solid var(--kb-line);
}

body.kb-stitch-app .trx-summary-label {
  color: var(--kb-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

body.kb-stitch-app .trx-summary-value {
  overflow: hidden;
  color: var(--kb-text);
  font-size: 16px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.kb-stitch-app .trx-summary-cell.is-income .trx-summary-value {
  color: var(--kb-income);
}

body.kb-stitch-app .trx-summary-cell:is(.is-expense, .is-negative) .trx-summary-value {
  color: var(--kb-expense);
}

body.kb-stitch-app .trx-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

body.kb-stitch-app .trx-chips::-webkit-scrollbar {
  display: none;
}

body.kb-stitch-app .trx-chip {
  flex: 0 0 auto;
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid var(--kb-line);
  border-radius: 999px;
  background: var(--kb-panel);
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

body.kb-stitch-app .trx-chip.is-active {
  border-color: rgba(var(--kb-primary-rgb), .55);
  background: rgba(var(--kb-primary-rgb), .16);
  color: var(--kb-text);
}

body.kb-stitch-app .trx-chip.is-ghost {
  border-style: dashed;
}

body.kb-stitch-app .trx-chip svg {
  width: 14px;
  height: 14px;
}

body.kb-stitch-app .trx-chip > span[aria-hidden="true"] {
  margin-left: 2px;
  font-size: 16px;
  line-height: 1;
  opacity: .75;
}

body.kb-stitch-app .trx-feed {
  display: grid;
  gap: 6px;
  transition: opacity .2s ease;
}

body.kb-stitch-app .trx-feed.is-refreshing {
  opacity: .5;
}

body.kb-stitch-app .trx-day {
  display: grid;
}

body.kb-stitch-app .trx-day-head {
  position: sticky;
  top: max(var(--trx-sticky-top), env(safe-area-inset-top));
  z-index: 5;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px 8px;
  background: var(--trx-sticky-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body.kb-stitch-app .trx-day-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--kb-text);
  font-size: 13px;
  font-weight: 900;
}

body.kb-stitch-app .trx-day-label small {
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 700;
}

body.kb-stitch-app .trx-day-total {
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

body.kb-stitch-app .trx-day-list {
  overflow: hidden;
  border: 1px solid var(--kb-line);
  border-radius: 16px;
  background: var(--trx-row-bg);
}

body.kb-stitch-app .trx-item {
  position: relative;
  overflow: hidden;
}

body.kb-stitch-app .trx-item[hidden] {
  display: none;
}

body.kb-stitch-app .trx-item + .trx-item {
  border-top: 1px solid var(--kb-line);
}

body.kb-stitch-app .trx-item-body {
  position: relative;
  z-index: 1;
  min-height: 64px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--trx-row-bg);
  cursor: pointer;
  touch-action: pan-y;
  outline: none;
}

body.kb-stitch-app .trx-item-body::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--trx-hover);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}

body.kb-stitch-app .trx-item-body:active::after,
body.kb-stitch-app .trx-item-body:focus-visible::after {
  opacity: 1;
}

body.kb-stitch-app .trx-item-body:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(var(--kb-primary-rgb), .6);
}

body.kb-stitch-app .trx-item-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  background: color-mix(in srgb, var(--trx-color) 20%, transparent);
  font-size: 19px;
  line-height: 1;
}

body.kb-stitch-app .trx-item-icon.is-large {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  font-size: 28px;
}

body.kb-stitch-app .trx-item-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body.kb-stitch-app :is(.trx-item-title, .trx-item-meta) {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.kb-stitch-app .trx-item-title {
  color: var(--kb-text);
  font-size: 14px;
  font-weight: 850;
}

body.kb-stitch-app .trx-item-meta {
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 700;
}

body.kb-stitch-app .trx-item-amount {
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

body.kb-stitch-app :is(.trx-item-amount, .trx-detail-amount).is-income {
  color: var(--kb-income);
}

body.kb-stitch-app :is(.trx-item-amount, .trx-detail-amount).is-expense {
  color: var(--kb-expense);
}

body.kb-stitch-app .kb-swipe-actions {
  position: absolute;
  inset: 0 0 0 auto;
  width: 148px;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

body.kb-stitch-app .kb-swipe-row:not(.is-swiped) .kb-swipe-actions {
  visibility: hidden;
}

body.kb-stitch-app .kb-swipe-action {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 0;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

body.kb-stitch-app .kb-swipe-action svg {
  width: 18px;
  height: 18px;
}

body.kb-stitch-app .kb-swipe-action.is-edit {
  background: #5a4a5c;
}

body.kb-stitch-app .kb-swipe-action.is-delete {
  background: #e5484d;
}

body.kb-stitch-app .trx-item-hover-actions {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  body.kb-stitch-app .kb-swipe-actions {
    display: none;
  }

  body.kb-stitch-app .trx-item-body {
    grid-template-columns: 40px minmax(0, 1fr) auto auto;
  }

  body.kb-stitch-app .trx-item-body:hover::after {
    opacity: 1;
  }

  body.kb-stitch-app .trx-item-hover-actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity .15s ease;
  }

  body.kb-stitch-app .trx-item:hover .trx-item-hover-actions,
  body.kb-stitch-app .trx-item-body:focus-within .trx-item-hover-actions {
    opacity: 1;
  }

  body.kb-stitch-app .trx-item-hover-actions button {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--kb-muted);
  }

  body.kb-stitch-app .trx-item-hover-actions svg {
    width: 17px;
    height: 17px;
  }

  body.kb-stitch-app .trx-item-hover-actions button:hover {
    background: var(--trx-hover);
    color: var(--kb-text);
  }

  body.kb-stitch-app .trx-item-hover-actions button:last-child:hover {
    color: var(--kb-expense);
  }
}

body.kb-stitch-app .trx-skeleton {
  display: grid;
  gap: 8px;
}

body.kb-stitch-app .trx-skeleton-head,
body.kb-stitch-app .trx-skeleton-row > span:first-child,
body.kb-stitch-app .trx-skeleton-row i,
body.kb-stitch-app .trx-skeleton-row > span:last-child {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--trx-shimmer) 25%, var(--trx-shimmer-hi) 50%, var(--trx-shimmer) 75%);
  background-size: 200% 100%;
  animation: kbShimmer 1.2s linear infinite;
}

body.kb-stitch-app .trx-skeleton-head {
  width: 120px;
  height: 14px;
  margin: 10px 4px 4px;
}

body.kb-stitch-app .trx-skeleton-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--kb-line);
  border-radius: 14px;
  background: var(--trx-row-bg);
}

body.kb-stitch-app .trx-skeleton-row > span:first-child {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

body.kb-stitch-app .trx-skeleton-row > span:nth-child(2) {
  display: grid;
  gap: 7px;
}

body.kb-stitch-app .trx-skeleton-row i {
  height: 10px;
}

body.kb-stitch-app .trx-skeleton-row i:first-child {
  width: 70%;
}

body.kb-stitch-app .trx-skeleton-row i:last-child {
  width: 40%;
}

body.kb-stitch-app .trx-skeleton-row > span:last-child {
  height: 12px;
}

body.kb-stitch-app .trx-feed-footer {
  min-height: 8px;
  display: flex;
  justify-content: center;
  padding: 4px 0;
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 700;
}

body.kb-stitch-app .trx-feed-sentinel {
  height: 1px;
}

body.kb-stitch-app .trx-spinner {
  width: 22px;
  height: 22px;
  display: inline-block;
  border: 2px solid var(--kb-muted);
  border-right-color: transparent;
  border-radius: 999px;
  animation: kbSpin .7s linear infinite;
}

body.kb-stitch-app .trx-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 40px 20px;
  border: 1px dashed var(--kb-line);
  border-radius: 18px;
  text-align: center;
}

body.kb-stitch-app .trx-empty-icon {
  font-size: 34px;
  line-height: 1.2;
}

body.kb-stitch-app .trx-empty-title {
  color: var(--kb-text);
  font-size: 16px;
  font-weight: 900;
}

body.kb-stitch-app .trx-empty-copy {
  max-width: 300px;
  margin-bottom: 8px;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}

/* Sheets: detail + filter (surface comes from the modal layer) */
body.kb-stitch-app .trx-sheet {
  width: min(460px, 100%);
  max-height: min(88dvh, 760px);
  overflow-y: auto;
  padding: 18px 20px 20px;
}

body.kb-stitch-app .trx-sheet-grip {
  display: none;
}

body.kb-stitch-app .trx-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.kb-stitch-app .trx-sheet-head h3 {
  color: var(--kb-text);
  font-size: 18px;
  font-weight: 900;
}

body.kb-stitch-app .trx-sheet-label {
  margin: 18px 0 8px;
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

body.kb-stitch-app .trx-sheet-label small {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  opacity: .8;
}

body.kb-stitch-app .trx-seg-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--kb-line);
  border-radius: 14px;
  background: var(--trx-hover, rgba(255, 255, 255, .05));
}

body.kb-stitch-app .trx-seg {
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 850;
}

body.kb-stitch-app .trx-seg.is-active {
  background: rgba(var(--kb-primary-rgb), .2);
  color: var(--kb-text);
}

body.kb-stitch-app .trx-cat-grid {
  max-height: 212px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow-y: auto;
}

body.kb-stitch-app .trx-cat-chip {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--kb-line);
  border-radius: 999px;
  background: transparent;
  color: var(--kb-text);
  font-size: 13px;
  font-weight: 750;
}

body.kb-stitch-app .trx-cat-chip.is-active {
  border-color: rgba(var(--kb-primary-rgb), .6);
  background: rgba(var(--kb-primary-rgb), .18);
}

body.kb-stitch-app .trx-date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

body.kb-stitch-app .trx-date-grid label {
  display: grid;
  gap: 6px;
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 800;
}

body.kb-stitch-app .trx-date-grid input {
  width: 100%;
  min-height: 44px;
  font-size: 16px;
}

body.kb-stitch-app .trx-sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

body.kb-stitch-app .trx-sheet-actions > button {
  min-height: 46px;
}

body.kb-stitch-app .trx-sheet-actions svg {
  width: 18px;
  height: 18px;
}

body.kb-stitch-app .trx-danger-action {
  color: var(--kb-expense) !important;
  border-color: rgba(229, 72, 77, .35) !important;
}

body.kb-stitch-app .trx-export-btn {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  border: 1px dashed var(--kb-line);
  border-radius: 12px;
  background: transparent;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 800;
}

body.kb-stitch-app .trx-export-btn svg {
  width: 18px;
  height: 18px;
}

body.kb-stitch-app .trx-detail-hero {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 0 0 18px;
  text-align: center;
}

body.kb-stitch-app .trx-detail-amount {
  font-size: 30px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

body.kb-stitch-app .trx-detail-title {
  color: var(--kb-text);
  font-size: 16px;
  font-weight: 800;
}

body.kb-stitch-app .trx-detail-list {
  display: grid;
  border-top: 1px solid var(--kb-line);
}

body.kb-stitch-app .trx-detail-list > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--kb-line);
}

body.kb-stitch-app .trx-detail-list dt {
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 750;
}

body.kb-stitch-app .trx-detail-list dd {
  margin: 0;
  color: var(--kb-text);
  font-size: 13px;
  font-weight: 850;
  text-align: right;
}

body.kb-stitch-app .trx-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(var(--kb-primary-rgb), .14);
  color: var(--kb-primary);
  font-size: 12px;
}

body.kb-stitch-app .kb-action-toast {
  justify-content: space-between;
}

body.kb-stitch-app .kb-toast-action {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(var(--kb-primary-rgb), .14);
  color: var(--kb-primary);
  font-weight: 900;
}

body.kb-stitch-app .transaction-row[role="button"] {
  cursor: pointer;
}

@media (min-width: 769px) {
  body.kb-stitch-app .trx-head-row {
    grid-template-areas: "period actions";
  }

  /* The desktop top bar already shows the page title. */
  body.kb-stitch-app .trx-head-title {
    display: none;
  }

  body.kb-stitch-app .trx-period {
    justify-self: start;
    min-width: 300px;
  }
}

@media (max-width: 768px) {
  body.kb-stitch-app .trx-sheet-grip {
    display: block;
    width: 40px;
    height: 4px;
    margin: -6px auto 12px;
    border-radius: 999px;
    background: var(--kb-line);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.kb-stitch-app .trx-skeleton * {
    animation: none !important;
  }
}

@keyframes kbShimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* Dashboard latest-transaction rows are now tap targets without inline actions. */
body.kb-stitch-app .dashboard-recent-card .transaction-row[role="button"] {
  align-items: center;
  min-height: 64px;
}

body.kb-stitch-app .dashboard-recent-card .transaction-row[role="button"] .transaction-meta {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.kb-stitch-app .dashboard-recent-card .transaction-row[role="button"] .transaction-side {
  align-self: center;
}

/* ── Onboarding ─────────────────────────────────────────────────────────── */
/* The overlay is always dark (bg-gray-950), so pin the dark tokens even on light devices. */
#onboarding-overlay {
  --kb-text: #f5eaf3;
  --kb-muted: #c9b5c7;
  --kb-line: rgba(255, 255, 255, .12);
  --kb-panel: rgba(255, 255, 255, .06);
  --ob-overlay-bg: #030712;
}

body.kb-stitch-app .ob-step {
  max-width: 720px;
}

body.kb-stitch-app .ob-step svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.kb-stitch-app .ob-progress {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

body.kb-stitch-app .ob-back,
body.kb-stitch-app .ob-back-spacer {
  width: 40px;
  height: 40px;
}

body.kb-stitch-app .ob-back {
  display: grid;
  place-items: center;
  border: 1px solid var(--kb-line);
  border-radius: 12px;
  background: var(--kb-panel);
  color: var(--kb-text);
}

body.kb-stitch-app .ob-progress-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

body.kb-stitch-app .ob-progress-bar span {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  transition: background .3s ease;
}

body.kb-stitch-app .ob-progress-bar span.is-done {
  background: linear-gradient(90deg, var(--kb-primary), var(--kb-accent));
}

body.kb-stitch-app .ob-progress-label {
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

body.kb-stitch-app .ob-title {
  margin-bottom: 10px;
  color: var(--kb-text);
  font-size: clamp(28px, 6vw, 44px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -.03em;
}

body.kb-stitch-app .ob-sub {
  max-width: 560px;
  margin-bottom: 26px;
  color: var(--kb-muted);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.55;
}

body.kb-stitch-app .ob-choice-grid {
  display: grid;
  gap: 12px;
}

body.kb-stitch-app .ob-choice {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--kb-line);
  border-radius: 18px;
  background: var(--kb-panel);
  color: var(--kb-text);
  text-align: left;
}

body.kb-stitch-app .ob-choice.is-active {
  border-color: rgba(var(--kb-primary-rgb), .6);
  background: rgba(var(--kb-primary-rgb), .12);
}

body.kb-stitch-app .ob-choice-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, .07);
  font-size: 26px;
}

body.kb-stitch-app .ob-choice strong {
  display: block;
  font-size: 17px;
  font-weight: 900;
}

body.kb-stitch-app .ob-choice small {
  display: block;
  margin-top: 3px;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

body.kb-stitch-app .ob-choice-arrow {
  color: var(--kb-muted);
}

body.kb-stitch-app .ob-form {
  display: grid;
  gap: 16px;
}

body.kb-stitch-app .ob-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

body.kb-stitch-app .ob-field > span:first-child {
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 800;
}

body.kb-stitch-app .ob-field small {
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  opacity: .85;
}

body.kb-stitch-app .ob-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  align-items: start;
  gap: 12px;
}

body.kb-stitch-app #onboarding-overlay .ob-input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1px solid var(--kb-line);
  border-radius: 14px;
  outline: none;
  background: rgba(255, 255, 255, .06);
  color: var(--kb-text);
  font-size: 17px;
  font-weight: 700;
  transition: border-color .15s ease, box-shadow .15s ease;
}

body.kb-stitch-app #onboarding-overlay .ob-input::placeholder {
  color: rgba(255, 255, 255, .3);
}

body.kb-stitch-app #onboarding-overlay .ob-input:focus {
  border-color: rgba(var(--kb-primary-rgb), .7);
  box-shadow: 0 0 0 4px rgba(var(--kb-primary-rgb), .15);
}

body.kb-stitch-app #onboarding-overlay select.ob-input option {
  color: #111;
}

body.kb-stitch-app .ob-money {
  position: relative;
  display: block;
}

body.kb-stitch-app .ob-money-prefix {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  color: var(--kb-muted);
  font-size: 15px;
  font-weight: 800;
  pointer-events: none;
}

body.kb-stitch-app #onboarding-overlay .ob-money .ob-input {
  padding-left: 50px;
}

body.kb-stitch-app .ob-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 28px;
  padding: 16px 0 max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--ob-overlay-bg) 38%);
}

body.kb-stitch-app .ob-primary {
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent));
  box-shadow: 0 18px 40px rgba(var(--kb-primary-rgb), .25);
  color: #180e18;
  font-size: 16px;
  font-weight: 900;
}

body.kb-stitch-app .ob-primary:disabled {
  opacity: .45;
  box-shadow: none;
}

body.kb-stitch-app .ob-cat-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -8px 0 14px;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 800;
}

body.kb-stitch-app .ob-link {
  padding: 6px 4px;
  border: 0;
  background: none;
  color: var(--kb-primary);
  font-size: 13px;
  font-weight: 850;
}

body.kb-stitch-app .ob-cat-group + .ob-cat-group {
  margin-top: 20px;
}

body.kb-stitch-app .ob-cat-group-label {
  margin-bottom: 10px;
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

body.kb-stitch-app .ob-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.kb-stitch-app .ob-chip {
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 0 7px;
  border: 1px solid var(--kb-line);
  border-radius: 999px;
  background: var(--kb-panel);
  color: var(--kb-muted);
  font-size: 14px;
  font-weight: 800;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

body.kb-stitch-app .ob-chip-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  background: color-mix(in srgb, var(--chip-color, #fff) 22%, transparent);
  font-size: 15px;
}

body.kb-stitch-app .ob-chip-check {
  width: 0;
  overflow: hidden;
  opacity: 0;
  color: var(--kb-primary);
  font-weight: 900;
  transition: width .15s ease, opacity .15s ease;
}

body.kb-stitch-app .ob-chip.is-active {
  border-color: rgba(var(--kb-primary-rgb), .6);
  background: rgba(var(--kb-primary-rgb), .16);
  color: var(--kb-text);
}

body.kb-stitch-app .ob-chip.is-active .ob-chip-check {
  width: 14px;
  opacity: 1;
}

body.kb-stitch-app .ob-chip.is-skeleton {
  border-color: transparent;
  background: linear-gradient(90deg, rgba(255,255,255,.05) 25%, rgba(255,255,255,.11) 50%, rgba(255,255,255,.05) 75%);
  background-size: 200% 100%;
  animation: kbShimmer 1.2s linear infinite;
}

body.kb-stitch-app .ob-free-card {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--kb-line);
  border-radius: 18px;
  background: var(--kb-panel);
}

body.kb-stitch-app .ob-free-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--kb-text);
}

body.kb-stitch-app .ob-free-head span {
  font-size: 15px;
  font-weight: 900;
}

body.kb-stitch-app .ob-free-head strong {
  font-size: 22px;
  font-weight: 900;
}

body.kb-stitch-app .ob-free-card li {
  position: relative;
  padding: 5px 0 5px 24px;
  color: var(--kb-muted);
  font-size: 14px;
  font-weight: 700;
}

body.kb-stitch-app .ob-free-card li::before {
  content: "✓";
  position: absolute;
  left: 2px;
  color: var(--kb-income);
  font-weight: 900;
}

body.kb-stitch-app .ob-check {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--kb-line);
  border-radius: 14px;
  background: var(--kb-panel);
  color: var(--kb-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  cursor: pointer;
}

body.kb-stitch-app .ob-check + .ob-check {
  margin-top: 10px;
}

body.kb-stitch-app .ob-check.is-optional {
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 650;
}

body.kb-stitch-app .ob-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

body.kb-stitch-app .ob-check-box {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .3);
  border-radius: 8px;
  transition: background .15s ease, border-color .15s ease;
}

body.kb-stitch-app .ob-check input:checked + .ob-check-box {
  border-color: transparent;
  background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent));
}

body.kb-stitch-app .ob-check input:checked + .ob-check-box::after {
  content: "✓";
  color: #180e18;
  font-size: 14px;
  font-weight: 900;
}

body.kb-stitch-app .ob-check input:focus-visible + .ob-check-box {
  box-shadow: 0 0 0 3px rgba(var(--kb-primary-rgb), .4);
}

body.kb-stitch-app .ob-check a {
  color: var(--kb-primary);
  text-decoration: underline;
}

body.kb-stitch-app .ob-check.is-attention {
  border-color: var(--kb-expense);
  animation: kbShake .35s ease;
}

body.kb-stitch-app .ob-celebrate {
  display: grid;
  gap: 10px;
  text-align: center;
}

body.kb-stitch-app .ob-celebrate-emoji {
  font-size: 46px;
  line-height: 1.1;
}

body.kb-stitch-app .ob-celebrate h3 {
  color: var(--kb-text);
  font-size: 20px;
  font-weight: 900;
}

body.kb-stitch-app .ob-celebrate > p {
  color: var(--kb-muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.55;
}

body.kb-stitch-app .ob-plus-pitch {
  margin-top: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(var(--kb-primary-rgb), .35);
  border-radius: 16px;
  background: rgba(var(--kb-primary-rgb), .1);
  text-align: left;
}

body.kb-stitch-app .ob-plus-pitch strong {
  display: block;
  margin-bottom: 6px;
  color: var(--kb-text);
  font-size: 14px;
  font-weight: 900;
}

body.kb-stitch-app .ob-plus-pitch li {
  padding: 2px 0;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 700;
}

body.kb-stitch-app .ob-plus-pitch li::before {
  content: "✓ ";
  color: var(--kb-primary);
}

body.kb-stitch-app .ob-plus-pitch > span {
  display: block;
  margin-top: 8px;
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 800;
}

body.kb-stitch-app .trx-sheet-actions.is-single {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  body.kb-stitch-app .ob-choice-grid {
    grid-template-columns: 1fr 1fr;
  }

  body.kb-stitch-app .ob-actions {
    position: static;
    padding: 0;
    background: none;
  }

  body.kb-stitch-app .ob-primary {
    width: auto;
    min-width: 220px;
    padding: 0 28px;
  }
}

@media (max-width: 639px) {
  /* Top-align on phones so steps of different height do not jump around. */
  #onboarding-overlay > .min-h-screen {
    align-items: flex-start;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: 0;
  }
}

@keyframes kbShake {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ── Meeny mascot placements ───────────────────────────────────────────── */
body.kb-stitch-app .kb-empty-state.has-meeny .kb-empty-meeny,
body.kb-stitch-app .trx-empty-art .meeny {
  display: block;
  margin: 0 auto 10px;
}

body.kb-stitch-app .kb-empty-action {
  margin-top: 14px;
}

body.kb-stitch-app .kb-meeny-toast {
  max-width: 360px;
  border-left: 3px solid var(--kb-primary) !important;
  cursor: default;
}

body.kb-stitch-app button.kb-meeny-toast {
  cursor: pointer;
}

body.kb-stitch-app .kb-meeny-toast.is-warn {
  border-left-color: #f59e0b !important;
}

body.kb-stitch-app .kb-meeny-toast.is-danger {
  border-left-color: var(--kb-expense) !important;
}

body.kb-stitch-app .kb-meeny-toast.is-success {
  border-left-color: var(--kb-income) !important;
}

body.kb-stitch-app .kb-meeny-toast-art {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: -4px 0;
}

body.kb-stitch-app .kb-meeny-toast-text {
  line-height: 1.4;
}

@keyframes kbGoalCelebrate {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--kb-primary-rgb), 0); transform: none; }
  35% { box-shadow: 0 0 0 6px rgba(var(--kb-primary-rgb), .28); transform: scale(1.015); }
}


body.kb-stitch-app .meeny-avatar-art {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

body.kb-stitch-app .meeny-empty-art {
  display: grid;
  justify-items: center;
  margin-bottom: 14px;
}

body.kb-stitch-app .meeny-thinking-art {
  display: inline-grid;
  margin-right: 8px;
  vertical-align: middle;
}

body.kb-stitch-app .ob-celebrate-art {
  display: grid;
  place-items: center;
}

body.kb-stitch-app .ob-meeny {
  margin-bottom: 14px;
}

/* ── Safe to spend today (dashboard hero number + explanation sheet) ─── */
body.kb-stitch-app .dashboard-safe-trigger {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

body.kb-stitch-app .dashboard-safe-trigger .dashboard-card-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.kb-stitch-app .dashboard-safe-trigger .dashboard-balance {
  display: block;
}

body.kb-stitch-app .dashboard-safe-info {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
  text-transform: none;
  opacity: .75;
}

body.kb-stitch-app .dashboard-safe-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

body.kb-stitch-app .dashboard-safe-status {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  color: var(--kb-muted);
}

body.kb-stitch-app .dashboard-safe-status .meeny {
  flex: 0 0 auto;
  margin: -6px 0;
}

body.kb-stitch-app .dashboard-safe-status > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.kb-stitch-app .dashboard-safe-status.is-ok .num {
  color: var(--kb-text);
}

body.kb-stitch-app .dashboard-safe-status:is(.is-low, .is-warn) {
  color: #f59e0b;
}

body.kb-stitch-app .dashboard-safe-status.is-danger {
  color: var(--kb-expense);
}

body.kb-stitch-app button.dashboard-safe-status.is-setup {
  padding: 0;
  border: 0;
  background: none;
  color: var(--kb-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

body.kb-stitch-app .dashboard-safe-balance {
  flex: 0 0 auto;
  margin: 0;
  color: var(--kb-muted);
  white-space: nowrap;
}

body.kb-stitch-app .dashboard-safe-balance .num {
  color: var(--kb-text);
}

body.kb-stitch-app .safe-sheet-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  text-align: center;
}

body.kb-stitch-app .safe-sheet-value {
  margin: 0;
  color: var(--kb-text);
  font-size: 34px;
  font-weight: 950;
  line-height: 1.05;
}

body.kb-stitch-app .safe-sheet-copy {
  max-width: 34ch;
  margin: 4px 0 0;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

body.kb-stitch-app .safe-sheet-list .is-sub :is(dt, dd) {
  color: var(--kb-muted);
}

body.kb-stitch-app .safe-sheet-list .is-total :is(dt, dd) {
  color: var(--kb-primary);
  font-size: 15px;
  font-weight: 950;
}

body.kb-stitch-app .safe-sheet-note {
  margin: 12px 2px 0;
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

@media (max-width: 768px) {
  body.kb-stitch-app .dashboard-stitch-shell.has-safe-meta {
    grid-template-rows: 32px 50px clamp(200px, 26.5dvh, 228px) minmax(0, 1fr);
  }

  body.kb-stitch-app .dashboard-safe-meta {
    margin-top: 8px;
    font-size: 12px;
  }

  body.kb-stitch-app .has-safe-meta .dashboard-balance-divider {
    margin: clamp(10px, 1.5vh, 14px) 0;
  }
}

@media (max-width: 380px), (max-width: 768px) and (max-height: 760px) {
  body.kb-stitch-app .dashboard-stitch-shell.has-safe-meta {
    grid-template-rows: 30px 44px clamp(184px, 25.5dvh, 204px) minmax(0, 1fr);
  }
}

/* Short desktop windows (e.g. 1366×768 laptops minus browser toolbars): scroll the dashboard
   instead of squeezing its fixed-height rows until cards clip. */
@media (min-width: 769px) and (max-height: 760px) {
  body.kb-stitch-app .dashboard-stitch-shell {
    height: auto;
    grid-template-rows: auto auto 420px;
    overflow: visible;
  }
}

/* ── Payday-based budget period ─────────────────────────────────────── */
body.kb-stitch-app .settings-payday-hint {
  margin: 0;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

body.kb-stitch-app .safe-sheet-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--kb-primary);
  font: inherit;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

/* ── Monthly recap ("Wrapped") ──────────────────────────────────────── */
body.kb-stitch-app .wrapped-switch {
  width: 100%;
  margin: 12px 0;
}

body.kb-stitch-app .wrapped-preview {
  display: grid;
  place-items: center;
  transition: opacity .2s ease;
}

body.kb-stitch-app .wrapped-preview.is-loading {
  opacity: .45;
}

body.kb-stitch-app .wrapped-preview canvas {
  display: block;
  width: auto;
  height: min(52dvh, 560px);
  max-width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}

body.kb-stitch-app .wrapped-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--kb-text);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

body.kb-stitch-app .wrapped-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--kb-primary);
}

body.kb-stitch-app .wrapped-note {
  margin: 6px 0 0;
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

@media (max-width: 768px) {
  body.kb-stitch-app .wrapped-preview canvas {
    height: min(46dvh, 460px);
  }
}

/* ── Logging streak ─────────────────────────────────────────────────── */
@media (min-width: 769px) {
  body.kb-stitch-app .dashboard-stitch-header.has-streak {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
  }
}

body.kb-stitch-app .dashboard-header-copy {
  min-width: 0;
}

body.kb-stitch-app .kb-streak-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 7px 14px 7px 10px;
  border: 1px solid rgba(251, 146, 60, .35);
  border-radius: 999px;
  background: rgba(251, 146, 60, .12);
  color: var(--kb-text);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

body.kb-stitch-app .kb-streak-flame {
  font-size: 16px;
  line-height: 1;
}

body.kb-stitch-app .kb-streak-chip.is-pending {
  border-style: dashed;
}

body.kb-stitch-app .kb-streak-chip.is-idle {
  border-color: var(--kb-line);
  background: var(--kb-panel);
  color: var(--kb-muted);
}

body.kb-stitch-app .kb-streak-chip.is-idle .kb-streak-flame {
  filter: grayscale(1);
  opacity: .6;
}

body.kb-stitch-app .kb-profile-streak {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

body.kb-stitch-app .kb-profile-streak[hidden] {
  display: none;
}

body.kb-stitch-app .kb-streak-best {
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 768px) {
  body.kb-stitch-app .dashboard-mobile-greeting.has-streak {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  body.kb-stitch-app .dashboard-mobile-greeting .kb-streak-chip {
    padding: 6px 12px 6px 9px;
    font-size: 13px;
  }
}

/* Meeny menus: solid surface (the translucent one let message text show through) and a Plus label instead of a lock emoji. */
body.kb-stitch-app .meeny-model-menu {
  background: #241829 !important;
}

html.light body.kb-stitch-app .meeny-model-menu {
  background: #fff9ff !important;
}

body.kb-stitch-app .meeny-model-menu {
  width: min(280px, 86vw);
}

body.kb-stitch-app .meeny-model-option span {
  white-space: nowrap;
}

body.kb-stitch-app .meeny-plus-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(var(--kb-primary-rgb), .16);
  color: var(--kb-primary);
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
}

/* ── Theme tokens (final say) ───────────────────────────────────────────
   The legacy palette inline in app.php's <head> uses :root[data-theme] and html.dark selectors,
   which outranked the stitch values above: Mint showed emerald/orange, Koral hot pink, and
   income/expense changed colour per theme. These match that specificity and win by coming later.
   Income and expense stay the same in every theme. */
:root[data-theme="indigo"],
:root:not([data-theme]) {
  --kb-primary: #f4aeff;
  --kb-accent: #7bd0ff;
  --kb-primary-rgb: 244, 174, 255;
  --kb-accent-rgb: 123, 208, 255;
}

:root[data-theme="mint"] {
  --kb-primary: #2dd4bf;
  --kb-accent: #7bd0ff;
  --kb-primary-rgb: 45, 212, 191;
  --kb-accent-rgb: 123, 208, 255;
}

:root[data-theme="rose"] {
  --kb-primary: #ffa98a;
  --kb-accent: #f4aeff;
  --kb-primary-rgb: 255, 169, 138;
  --kb-accent-rgb: 244, 174, 255;
}

:root[data-theme] {
  --kb-income: #2dd4bf;
  --kb-expense: #fb7185;
}

:root.dark,
:root.dark[data-theme] {
  --kb-panel-solid: #201421;
  /* Neutral glass surfaces on the plum background in every theme (the legacy palette tinted
     them indigo, emerald or pink, which also turned form fields purple). */
  --kb-bg: #140b14;
  --kb-panel: rgba(255, 255, 255, .072);
  --kb-panel-soft: rgba(255, 255, 255, .055);
}

:root.light,
:root.light[data-theme] {
  --kb-bg: #f7f1f7;
}

/* Accent-coloured text. Light mode needs a darker shade of the accent to stay readable. */
:root {
  --kb-primary-ink: var(--kb-primary);
}

:root.light {
  --kb-primary-ink: color-mix(in srgb, var(--kb-primary) 50%, #1a0f1d);
}

/* ── Line icons for default categories and goals (replace their emoji) ── */
body.kb-stitch-app .kb-glyph {
  display: inline-grid;
  place-items: center;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -.2em;
  color: color-mix(in srgb, var(--trx-color, var(--chip-color, currentColor)) 72%, #fff);
}

html.light body.kb-stitch-app .kb-glyph {
  color: color-mix(in srgb, var(--trx-color, var(--chip-color, currentColor)) 82%, #000);
}

body.kb-stitch-app span.kb-glyph svg:not(.meeny) {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Small UI glyphs that replaced emoji and symbols in text (toasts, checks, chips). */
body.kb-stitch-app .kb-ui-glyph {
  display: inline-grid;
  place-items: center;
  width: 1.1em;
  height: 1.1em;
  vertical-align: -.18em;
  flex: 0 0 auto;
}

body.kb-stitch-app span.kb-ui-glyph svg:not(.meeny) {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.kb-stitch-app .kb-check-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

body.kb-stitch-app .kb-check-item > .kb-ui-glyph {
  margin-top: .15em;
  color: var(--kb-income);
}

body.kb-stitch-app .kb-streak-flame {
  display: inline-grid;
  color: #fb923c;
}

body.kb-stitch-app .kb-streak-flame .kb-ui-glyph {
  width: 1em;
  height: 1em;
}

body.kb-stitch-app .trx-item-icon.is-large .kb-glyph {
  width: 30px;
  height: 30px;
}

/* ── Compact page head (Anggaran, Target, Kategori, Analitik, Otomatisasi) ── */
/* Desktop: the top bar shows the title, so the head is a toolbar. Phones: title row + toolbar. */
body.kb-stitch-app .kb-page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "tools actions";
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 20px;
}

/* The head's own margin sets the gap to the content below it. */
body.kb-stitch-app #page-content > .kb-page-head + *,
body.kb-stitch-app #page-content > .kb-page-head + input[type="hidden"] + input[type="hidden"] + * {
  margin-top: 0;
}

body.kb-stitch-app .kb-page-head-title {
  grid-area: title;
  display: none;
  margin: 0;
  color: var(--kb-text);
  font-size: 26px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -.02em;
}

body.kb-stitch-app .kb-page-head-tools {
  grid-area: tools;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

body.kb-stitch-app .kb-page-head-actions {
  grid-area: actions;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

body.kb-stitch-app .kb-head-action {
  min-height: 44px;
  padding: 0 18px;
  font-size: 14px;
  white-space: nowrap;
}

body.kb-stitch-app .kb-head-action > svg:not(.meeny) {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.kb-stitch-app .kb-head-action .meeny-art,
body.kb-stitch-app .kb-head-action > svg.meeny {
  margin: -6px 0;
}

body.kb-stitch-app .kb-page-note {
  margin: 0 0 18px;
  color: var(--kb-muted);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 650;
}

/* Period switch: ‹ label ›, with the payday rule under the label when it is not the 1st. */
body.kb-stitch-app .kb-period-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 48px;
  padding: 3px;
  border: 1px solid var(--kb-line);
  border-radius: 14px;
  background: var(--kb-panel);
}

body.kb-stitch-app .kb-period-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 11px;
  color: var(--kb-text);
  background: transparent;
}

body.kb-stitch-app .kb-period-btn:hover:not(:disabled) {
  background: rgba(var(--kb-primary-rgb), .12);
}

body.kb-stitch-app .kb-period-btn:disabled {
  opacity: .3;
  cursor: default;
}

body.kb-stitch-app .kb-period-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.kb-stitch-app .kb-period-text {
  display: grid;
  justify-items: center;
  min-width: 150px;
  padding: 0 8px;
  text-align: center;
}

body.kb-stitch-app .kb-period-label {
  color: var(--kb-text);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 850;
  white-space: nowrap;
}

body.kb-stitch-app .kb-period-note {
  color: var(--kb-muted);
  font-size: 11.5px;
  line-height: 1.3;
  font-weight: 700;
  white-space: nowrap;
}

/* Segmented control (Kategori: Pengeluaran / Pemasukan). */
body.kb-stitch-app .kb-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  min-width: 320px;
  padding: 4px;
  border: 1px solid var(--kb-line);
  border-radius: 12px;
  background: rgba(0, 0, 0, .22);
}

html.light body.kb-stitch-app .kb-segmented {
  background: rgba(38, 21, 38, .05);
}

body.kb-stitch-app .kb-segmented button {
  height: 38px;
  border: 0;
  border-radius: 9px;
  color: var(--kb-muted);
  background: transparent;
  font-size: 14px;
  font-weight: 800;
}

body.kb-stitch-app .kb-segmented button[aria-pressed="true"] {
  color: #1a0f1d;
  background: var(--kb-primary);
}

/* Shared bits: icon tile, progress bar, status chip. */
body.kb-stitch-app .kb-tile {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: color-mix(in srgb, var(--trx-color, var(--kb-primary)) 18%, transparent);
  font-size: 20px;
  line-height: 1;
}

body.kb-stitch-app .kb-tile .kb-glyph {
  width: 22px;
  height: 22px;
}

body.kb-stitch-app .kb-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

html.light body.kb-stitch-app .kb-bar {
  background: rgba(38, 21, 38, .08);
}

body.kb-stitch-app .kb-bar.is-wide {
  height: 8px;
}

body.kb-stitch-app .kb-bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--kb-primary), var(--kb-accent));
}

body.kb-stitch-app :is(.is-near) > .kb-bar > i {
  background: #f7d06f;
}

body.kb-stitch-app :is(.is-over) > .kb-bar > i,
body.kb-stitch-app .kb-bar.is-over > i {
  background: var(--kb-expense);
}

body.kb-stitch-app .kb-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

body.kb-stitch-app .kb-chip-extra {
  margin-left: .3em;
}

body.kb-stitch-app .kb-chip.is-near {
  color: #f7d06f;
  background: rgba(247, 208, 111, .15);
}

body.kb-stitch-app .kb-chip.is-over {
  color: #fb9aa9;
  background: rgba(251, 113, 133, .16);
}

html.light body.kb-stitch-app .kb-chip.is-near {
  color: #8a6100;
}

html.light body.kb-stitch-app .kb-chip.is-over {
  color: #be123c;
}

body.kb-stitch-app .kb-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--kb-muted);
  background: rgba(var(--kb-primary-rgb), .1);
  font-size: 11.5px;
  font-weight: 800;
}

/* The "⋯" row button and its menu. */
body.kb-stitch-app .kb-row-more {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  color: var(--kb-muted);
  background: transparent;
}

body.kb-stitch-app .kb-row-more:hover,
body.kb-stitch-app .kb-row-more[aria-expanded="true"] {
  color: var(--kb-text);
  background: rgba(var(--kb-primary-rgb), .12);
}

body.kb-stitch-app :is(.kb-row-more, .kb-row-menu-item, .kb-goal-add, .kb-planning-empty, .kb-cat-chevron) svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.kb-stitch-app .kb-row-menu {
  position: fixed;
  /* Above modals, sheets (up to z 80) and phone panels; below toasts. */
  z-index: 95;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--kb-line);
  border-radius: 14px;
  background: var(--kb-panel-solid);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  animation: kbRowMenuIn .14s ease-out;
}

html.light body.kb-stitch-app .kb-row-menu {
  box-shadow: 0 18px 48px rgba(38, 21, 38, .18);
}

@keyframes kbRowMenuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

body.kb-stitch-app .kb-row-menu-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: var(--kb-text);
  background: transparent;
  font-size: 14px;
  font-weight: 750;
  text-align: left;
}

body.kb-stitch-app .kb-row-menu-item:hover,
body.kb-stitch-app .kb-row-menu-item:focus-visible {
  background: rgba(var(--kb-primary-rgb), .12);
}

body.kb-stitch-app .kb-row-menu-item.is-danger {
  color: #fb9aa9;
}

html.light body.kb-stitch-app .kb-row-menu-item.is-danger {
  color: #be123c;
}

@media (prefers-reduced-motion: reduce) {
  body.kb-stitch-app .kb-row-menu {
    animation: none;
  }
}

/* ── Anggaran ── */
body.kb-stitch-app .kb-budget-summary {
  margin-bottom: 16px;
  padding: 22px 24px;
  border: 1px solid var(--kb-line);
  border-radius: 16px;
  background: var(--kb-panel);
}

body.kb-stitch-app .kb-budget-summary-desktop {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 18px 24px;
}

body.kb-stitch-app .kb-budget-summary-desktop > .kb-bar {
  grid-column: 1 / -1;
}

body.kb-stitch-app .kb-budget-summary-mobile {
  display: none;
}

body.kb-stitch-app .kb-stat-label {
  margin: 0;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 800;
}

body.kb-stitch-app .kb-stat-value {
  margin: 6px 0 0;
  color: var(--kb-text);
  font-size: 26px;
  line-height: 1.15;
  font-weight: 700;
}

body.kb-stitch-app .kb-stat-value small {
  color: var(--kb-muted);
  font-size: 15px;
  font-weight: 700;
}

body.kb-stitch-app .kb-stat-value.is-left {
  color: var(--kb-income);
}

body.kb-stitch-app .kb-budget-summary.is-over .kb-stat-value.is-left {
  color: var(--kb-expense);
}

body.kb-stitch-app .kb-stat-note {
  margin: 2px 0 0;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 650;
}

body.kb-stitch-app .kb-budget-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

body.kb-stitch-app .kb-budget-row {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 56px 44px;
  grid-template-areas:
    "tile title pct more"
    "tile meta pct more"
    "tile bar pct more";
  align-items: center;
  column-gap: 14px;
  padding: 16px 12px 16px 18px;
  border: 1px solid var(--kb-line);
  border-radius: 16px;
  background: var(--kb-panel);
}

body.kb-stitch-app .kb-budget-row > .kb-tile { grid-area: tile; }
body.kb-stitch-app .kb-budget-row > .kb-bar { grid-area: bar; margin-top: 10px; }
body.kb-stitch-app .kb-budget-row > .kb-row-more { grid-area: more; }

body.kb-stitch-app .kb-budget-row-title {
  grid-area: title;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  color: var(--kb-text);
  font-size: 15px;
}

body.kb-stitch-app .kb-budget-row-title b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.kb-stitch-app .kb-budget-row-meta {
  grid-area: meta;
  margin: 4px 0 0;
  color: var(--kb-muted);
  font-size: 13px;
}

body.kb-stitch-app .kb-budget-row-pct {
  grid-area: pct;
  justify-self: end;
  color: var(--kb-text);
  font-size: 15px;
  font-weight: 700;
}

body.kb-stitch-app .kb-budget-row.is-near .kb-budget-row-pct { color: #f7d06f; }
body.kb-stitch-app .kb-budget-row.is-over .kb-budget-row-pct { color: var(--kb-expense); }
html.light body.kb-stitch-app .kb-budget-row.is-near .kb-budget-row-pct { color: #8a6100; }

body.kb-stitch-app .kb-modal-sub {
  margin: 2px 0 0;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 700;
}

/* ── Target ── */
body.kb-stitch-app .kb-goal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

body.kb-stitch-app .kb-goal-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--kb-line);
  border-radius: 16px;
  background: var(--kb-panel);
}

body.kb-stitch-app .kb-goal-card.is-reached {
  border-color: color-mix(in srgb, var(--kb-income) 40%, transparent);
}

body.kb-stitch-app .kb-goal-card.is-reached .kb-bar > i {
  background: var(--kb-income);
}

body.kb-stitch-app .kb-goal-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

body.kb-stitch-app .kb-goal-meeny {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

body.kb-stitch-app .kb-goal-title {
  display: grid;
  flex: 1;
  min-width: 0;
}

body.kb-stitch-app .kb-goal-title b {
  overflow: hidden;
  color: var(--kb-text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.kb-stitch-app .kb-goal-pace {
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 700;
}

body.kb-stitch-app .kb-goal-pace.is-warn { color: #f7d06f; }
body.kb-stitch-app .kb-goal-pace.is-done { color: var(--kb-income); }
html.light body.kb-stitch-app .kb-goal-pace.is-warn { color: #8a6100; }

body.kb-stitch-app .kb-goal-head .kb-row-more {
  margin: -6px -8px 0 0;
  align-self: flex-start;
}

body.kb-stitch-app .kb-goal-amounts {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: var(--kb-muted);
  font-size: 12.5px;
}

body.kb-stitch-app .kb-goal-amounts b {
  color: var(--kb-text);
}

body.kb-stitch-app .kb-goal-card.is-reached .kb-goal-amounts b {
  color: var(--kb-income);
}

body.kb-stitch-app .kb-goal-add {
  width: 100%;
  min-height: 44px;
  color: var(--kb-text) !important;
  font-size: 14px;
}

body.kb-stitch-app .kb-goal-card.is-celebrating {
  animation: kbGoalCelebrate 1.1s cubic-bezier(.2, .8, .2, 1) 2;
}

@media (prefers-reduced-motion: reduce) {
  body.kb-stitch-app .kb-goal-card.is-celebrating {
    animation: none;
    outline: 2px solid rgba(var(--kb-primary-rgb), .5);
  }
}

/* ── Kategori ── */
body.kb-stitch-app .kb-cat-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

body.kb-stitch-app .kb-cat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 8px 14px;
  border: 1px solid var(--kb-line);
  border-radius: 14px;
  color: var(--kb-text);
  background: var(--kb-panel);
  font-size: 15px;
  font-weight: 650;
  text-align: left;
}

body.kb-stitch-app .kb-cat-row .kb-tile {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

body.kb-stitch-app .kb-cat-row .kb-tile .kb-glyph {
  width: 20px;
  height: 20px;
}

body.kb-stitch-app button.kb-cat-row:hover {
  border-color: rgba(var(--kb-primary-rgb), .4);
}

body.kb-stitch-app .kb-cat-name {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

body.kb-stitch-app .kb-cat-name > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.kb-stitch-app .kb-cat-chevron {
  display: grid;
  color: var(--kb-muted);
}

body.kb-stitch-app .kb-cat-footer {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin-top: 18px;
  text-align: center;
}

body.kb-stitch-app .kb-cat-footer p {
  margin: 0;
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 650;
}

body.kb-stitch-app .kb-text-link {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  color: var(--kb-primary);
  background: transparent;
  font-size: 14px;
  font-weight: 800;
}

html.light body.kb-stitch-app .kb-text-link {
  color: color-mix(in srgb, var(--kb-primary) 55%, #000);
}

body.kb-stitch-app .kb-text-danger {
  min-height: 44px;
  margin-top: 8px;
  padding: 0;
  border: 0;
  color: #fb9aa9;
  background: transparent;
  font-size: 14px;
  font-weight: 800;
}

body.kb-stitch-app .kb-text-danger.hidden {
  display: none;
}

html.light body.kb-stitch-app .kb-text-danger {
  color: #be123c;
}

/* Icon and colour pickers in the goal and category forms. */
body.kb-stitch-app .kb-icon-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
}

body.kb-stitch-app :is(#modal-category, #modal-goal) .kb-icon-choice {
  height: 44px;
  min-height: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--kb-line);
  border-radius: 10px;
  background: transparent;
}

body.kb-stitch-app .kb-icon-choice .kb-glyph {
  width: 22px;
  height: 22px;
}

body.kb-stitch-app .kb-icon-choice[aria-pressed="true"] {
  border-color: var(--trx-color, var(--kb-primary));
  background: color-mix(in srgb, var(--trx-color, var(--kb-primary)) 20%, transparent);
  box-shadow: inset 0 0 0 1px var(--trx-color, var(--kb-primary));
}

body.kb-stitch-app :is(#modal-category, #modal-goal) .kb-icon-custom {
  grid-column: span 2;
  height: 44px;
  min-height: 0;
  padding: 0 10px;
  border: 1px solid var(--kb-line);
  border-radius: 10px;
  color: var(--kb-text);
  background: transparent;
  font-size: 18px;
  text-align: center;
}

body.kb-stitch-app .kb-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.kb-stitch-app :is(#modal-category, #modal-goal) .kb-swatch {
  width: 36px;
  height: 36px;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--swatch);
}

body.kb-stitch-app .kb-swatch .kb-ui-glyph {
  width: 18px;
  height: 18px;
  opacity: 0;
}

body.kb-stitch-app .kb-swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--kb-panel-solid), 0 0 0 4px var(--swatch);
}

body.kb-stitch-app .kb-swatch[aria-pressed="true"] .kb-ui-glyph {
  opacity: 1;
}

/* ── Analitik: empty planning cards offer the next step ── */
body.kb-stitch-app .kb-planning-empty {
  display: grid;
  justify-items: start;
  gap: 12px;
}

body.kb-stitch-app .kb-planning-empty p {
  margin: 0;
  color: var(--kb-muted);
  font-size: 14px;
  line-height: 1.55;
}

/* ── Phones ── */
@media (max-width: 768px) {
  body.kb-stitch-app .kb-page-head {
    grid-template-areas:
      "title actions"
      "tools tools";
    gap: 12px;
    margin-bottom: 14px;
  }

  body.kb-stitch-app .kb-page-head.is-title-only {
    grid-template-areas: "title";
    grid-template-columns: 1fr;
    margin-bottom: 6px;
  }

  body.kb-stitch-app .kb-page-head-title {
    display: block;
  }

  body.kb-stitch-app .kb-page-head-tools {
    flex-direction: column;
    align-items: stretch;
  }

  body.kb-stitch-app .kb-head-action.is-icon-mobile {
    width: 44px;
    padding: 0;
  }

  body.kb-stitch-app .kb-head-action.is-icon-mobile > span {
    display: none;
  }

  body.kb-stitch-app .kb-period-switch {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }

  body.kb-stitch-app .kb-segmented {
    min-width: 0;
  }

  body.kb-stitch-app .kb-budget-summary {
    padding: 16px;
  }

  body.kb-stitch-app .kb-budget-summary-desktop {
    display: none;
  }

  body.kb-stitch-app .kb-budget-summary-mobile {
    display: block;
  }

  body.kb-stitch-app .kb-budget-summary-top,
  body.kb-stitch-app .kb-budget-summary-foot {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
  }

  body.kb-stitch-app .kb-budget-summary-mobile .kb-stat-value {
    margin: 4px 0 10px;
    font-size: 28px;
  }

  body.kb-stitch-app .kb-budget-summary-mobile .kb-stat-note {
    margin: 0;
    font-size: 12px;
  }

  body.kb-stitch-app .kb-budget-summary-foot {
    margin-top: 8px;
    color: var(--kb-muted);
    font-size: 12px;
  }

  /* One card with divided rows; tapping a row opens its menu. */
  body.kb-stitch-app .kb-budget-list {
    display: block;
    overflow: hidden;
    border: 1px solid var(--kb-line);
    border-radius: 16px;
    background: var(--kb-panel);
  }

  body.kb-stitch-app .kb-budget-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-areas:
      "tile title pct"
      "tile meta meta"
      "tile bar bar";
    column-gap: 12px;
    padding: 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  body.kb-stitch-app .kb-budget-row + .kb-budget-row {
    border-top: 1px solid var(--kb-line);
  }

  body.kb-stitch-app .kb-budget-row > .kb-tile {
    width: 40px;
    height: 40px;
  }

  body.kb-stitch-app .kb-budget-row > .kb-bar {
    margin-top: 8px;
  }

  body.kb-stitch-app .kb-budget-row-title {
    font-size: 14.5px;
  }

  body.kb-stitch-app .kb-budget-row-meta {
    margin-top: 2px;
    font-size: 12px;
  }

  body.kb-stitch-app .kb-budget-row-pct {
    align-self: start;
    font-size: 14px;
  }

  body.kb-stitch-app .kb-budget-row .kb-chip {
    height: 20px;
    padding: 0 7px;
    font-size: 11px;
  }

  body.kb-stitch-app .kb-chip-extra {
    display: none;
  }

  body.kb-stitch-app .kb-budget-row > .kb-row-more {
    grid-area: auto;
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
  }

  body.kb-stitch-app .kb-budget-row > .kb-row-more svg {
    display: none;
  }

  body.kb-stitch-app .kb-budget-row > .kb-row-more:active,
  body.kb-stitch-app .kb-budget-row > .kb-row-more[aria-expanded="true"] {
    background: rgba(var(--kb-primary-rgb), .07);
  }

  body.kb-stitch-app .kb-goal-grid {
    grid-template-columns: 1fr;
  }

  body.kb-stitch-app .kb-goal-card {
    padding: 16px;
  }

  body.kb-stitch-app .kb-cat-list {
    display: block;
    overflow: hidden;
    border: 1px solid var(--kb-line);
    border-radius: 16px;
    background: var(--kb-panel);
  }

  body.kb-stitch-app .kb-cat-row {
    min-height: 56px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  body.kb-stitch-app .kb-cat-row + .kb-cat-row {
    border-top: 1px solid var(--kb-line);
  }

  body.kb-stitch-app .kb-cat-row .kb-tile {
    width: 36px;
    height: 36px;
  }
}

@media (min-width: 769px) {
  body.kb-stitch-app .kb-page-head.is-title-only {
    display: none;
  }
}

/* ── Settings (desktop): section list + one panel per section ── */
body.kb-stitch-app .settings-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

body.kb-stitch-app .settings-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--kb-line);
  border-radius: 16px;
  background: var(--kb-panel);
}

body.kb-stitch-app .settings-identity {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
  padding: 6px 6px 16px;
  border-bottom: 1px solid var(--kb-line);
}

body.kb-stitch-app .settings-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  color: #1a0f1d;
  background: var(--kb-primary);
  font-size: 18px;
  font-weight: 900;
}

body.kb-stitch-app .settings-identity-text {
  min-width: 0;
}

body.kb-stitch-app .settings-identity-name,
body.kb-stitch-app .settings-identity-email {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.kb-stitch-app .settings-identity-name {
  color: var(--kb-text);
  font-size: 15px;
  font-weight: 850;
}

body.kb-stitch-app .settings-identity-email {
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 600;
}

body.kb-stitch-app .settings-identity-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

body.kb-stitch-app .settings-identity-chips .kb-profile-streak {
  margin: 0;
}

body.kb-stitch-app .settings-identity-chips .kb-streak-best {
  display: none;
}

body.kb-stitch-app .settings-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: var(--kb-muted);
  background: transparent;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}

body.kb-stitch-app .settings-nav-item:hover {
  color: var(--kb-text);
  background: rgba(var(--kb-primary-rgb), .07);
}

body.kb-stitch-app .settings-nav-item[aria-current="true"] {
  color: var(--kb-text);
  background: rgba(var(--kb-primary-rgb), .12);
  box-shadow: inset 0 0 0 1px rgba(var(--kb-primary-rgb), .28);
}

body.kb-stitch-app .settings-nav-item.is-danger {
  color: #fb9aa9;
}

html.light body.kb-stitch-app .settings-nav-item.is-danger {
  color: #be123c;
}

/* A dot marks sections with unsaved changes. */
body.kb-stitch-app .settings-nav-item.has-changes::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--kb-primary);
}

body.kb-stitch-app .settings-upgrade {
  margin-top: 14px;
  min-height: 44px;
  color: var(--kb-primary) !important;
  border-color: rgba(var(--kb-primary-rgb), .35) !important;
}

html.light body.kb-stitch-app .settings-upgrade {
  color: color-mix(in srgb, var(--kb-primary) 55%, #000) !important;
}

body.kb-stitch-app .settings-panel {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
  min-height: min(620px, calc(100dvh - var(--kb-stitch-topbar) - 70px));
  padding: 32px;
  border: 1px solid var(--kb-line);
  border-radius: 16px;
  background: var(--kb-panel);
}

body.kb-stitch-app .settings-panel-head h2 {
  margin: 0;
  color: var(--kb-text);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -.01em;
  outline: none;
}

body.kb-stitch-app .settings-panel-head p {
  margin: 6px 0 0;
  color: var(--kb-muted);
  font-size: 14px;
  font-weight: 600;
}

body.kb-stitch-app .settings-field {
  display: grid;
  gap: 8px;
  max-width: 720px;
}

body.kb-stitch-app .settings-label {
  margin: 0;
  color: var(--kb-text);
  font-size: 14px;
  font-weight: 800;
}

body.kb-stitch-app .settings-sublabel {
  display: grid;
  gap: 6px;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 700;
}

body.kb-stitch-app .settings-help {
  margin: 0;
  color: var(--kb-muted);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
}

body.kb-stitch-app .settings-static {
  margin: 0;
  color: var(--kb-text);
  font-size: 15px;
  font-weight: 650;
}

body.kb-stitch-app .settings-input {
  width: 100%;
  max-width: 480px;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--kb-line);
  border-radius: 12px;
  color: var(--kb-text);
  background: rgba(0, 0, 0, .22);
  font-size: 15px;
  font-weight: 650;
}

html.light body.kb-stitch-app .settings-input {
  background: rgba(255, 255, 255, .8);
}

body.kb-stitch-app .settings-input:focus {
  border-color: rgba(var(--kb-primary-rgb), .6);
  outline: 2px solid rgba(var(--kb-primary-rgb), .25);
  outline-offset: 1px;
}

body.kb-stitch-app .settings-seg {
  display: inline-flex;
  justify-self: start;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--kb-line);
  border-radius: 12px;
  background: rgba(0, 0, 0, .22);
}

html.light body.kb-stitch-app .settings-seg {
  background: rgba(38, 21, 38, .05);
}

body.kb-stitch-app .settings-seg button {
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 9px;
  color: var(--kb-muted);
  background: transparent;
  font-size: 14px;
  font-weight: 800;
}

body.kb-stitch-app .settings-seg button[aria-pressed="true"] {
  color: #1a0f1d;
  background: var(--kb-primary);
}

body.kb-stitch-app .settings-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 720px;
}

body.kb-stitch-app .settings-row-2 .settings-input {
  max-width: none;
}

/* Theme cards with a small preview drawn in each theme's colours. */
body.kb-stitch-app .settings-theme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

body.kb-stitch-app .settings-theme-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--kb-line);
  border-radius: 14px;
  color: var(--kb-text);
  background: transparent;
  text-align: left;
}

body.kb-stitch-app .settings-theme-card:hover {
  border-color: color-mix(in srgb, var(--tc-primary) 50%, transparent);
}

body.kb-stitch-app .settings-theme-card[aria-pressed="true"] {
  border-color: var(--tc-primary);
  box-shadow: inset 0 0 0 1px var(--tc-primary);
}

body.kb-stitch-app .settings-theme-mini {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 10px;
  background: #1a1020;
}

body.kb-stitch-app .settings-theme-mini .is-title {
  display: block;
  width: 54%;
  height: 10px;
  border-radius: 4px;
  background: var(--tc-primary);
}

body.kb-stitch-app .settings-theme-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 40px;
}

body.kb-stitch-app .settings-theme-bars i {
  width: 14px;
  border-radius: 3px;
  background: var(--kb-income);
}

body.kb-stitch-app .settings-theme-bars i:nth-child(1) { height: 60%; }
body.kb-stitch-app .settings-theme-bars i:nth-child(2) { height: 35%; background: var(--kb-expense); }
body.kb-stitch-app .settings-theme-bars i:nth-child(3) { height: 85%; }
body.kb-stitch-app .settings-theme-bars i:nth-child(4) { height: 50%; background: var(--kb-expense); }

body.kb-stitch-app .settings-theme-mini .is-action {
  display: block;
  width: 46%;
  height: 16px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--tc-primary), var(--tc-accent));
}

body.kb-stitch-app .settings-theme-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

body.kb-stitch-app .settings-theme-name b {
  font-size: 15px;
}

body.kb-stitch-app .settings-theme-name span {
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 700;
}

/* Keuangan: payday and where today sits in the period. */
body.kb-stitch-app .settings-payday-line {
  display: flex;
  align-items: center;
  gap: 16px;
}

body.kb-stitch-app .settings-payday-select {
  flex: 0 0 120px;
  width: 120px;
}

body.kb-stitch-app .settings-payday-line .settings-help {
  max-width: 440px;
}

body.kb-stitch-app .settings-period {
  margin-top: 10px;
  padding: 18px 20px;
  border: 1px solid var(--kb-line);
  border-radius: 14px;
  background: rgba(0, 0, 0, .18);
}

html.light body.kb-stitch-app .settings-period {
  background: rgba(38, 21, 38, .04);
}

body.kb-stitch-app .settings-period-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

body.kb-stitch-app .settings-period-top span {
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

body.kb-stitch-app .settings-period-top b {
  color: var(--kb-text);
  font-size: 15px;
}

body.kb-stitch-app .settings-period-track {
  position: relative;
  height: 8px;
  margin: 16px 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

html.light body.kb-stitch-app .settings-period-track {
  background: rgba(38, 21, 38, .08);
}

body.kb-stitch-app .settings-period-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--kb-primary), var(--kb-accent));
}

body.kb-stitch-app .settings-period-track span {
  position: absolute;
  top: -6px;
  width: 3px;
  height: 20px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--kb-text);
}

body.kb-stitch-app .settings-period-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 650;
}

body.kb-stitch-app .settings-period-labels .is-today {
  color: var(--kb-text);
}

/* Save bar for sections with a draft. */
body.kb-stitch-app .settings-savebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--kb-line);
}

body.kb-stitch-app #settings-change-note {
  min-width: 0;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 650;
}

body.kb-stitch-app .settings-savebar-actions,
body.kb-stitch-app .settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body.kb-stitch-app .settings-savebar-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

body.kb-stitch-app .settings-savebar button {
  white-space: nowrap;
  min-height: 44px;
  padding: 0 18px;
  font-size: 14px;
}

body.kb-stitch-app .settings-savebar button:disabled {
  opacity: .45;
  cursor: default;
  transform: none;
}

body.kb-stitch-app .settings-divider {
  height: 1px;
  max-width: 720px;
  background: var(--kb-line);
}

body.kb-stitch-app .settings-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 720px;
}

body.kb-stitch-app .settings-action-row .settings-label {
  margin-bottom: 4px;
}

body.kb-stitch-app .settings-export-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 600px;
}

body.kb-stitch-app .settings-export-grid .settings-input {
  max-width: none;
}

body.kb-stitch-app .settings-export-grid .hidden {
  display: none;
}

body.kb-stitch-app .settings-actions .hidden {
  display: none;
}

body.kb-stitch-app .settings-export-jobs {
  display: grid;
  gap: 6px;
}

body.kb-stitch-app .settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  color: var(--kb-text);
  font-size: 14px;
  font-weight: 650;
}

body.kb-stitch-app .settings-toggle input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  accent-color: var(--kb-primary);
}

body.kb-stitch-app .settings-danger {
  display: grid;
  gap: 10px;
  max-width: 720px;
  padding: 20px;
  border: 1px solid rgba(239, 68, 68, .35);
  border-radius: 14px;
  background: rgba(239, 68, 68, .06);
}

body.kb-stitch-app .settings-danger-btn {
  min-height: 44px;
  margin-top: 4px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: #dc2626;
  font-size: 14px;
  font-weight: 850;
}

body.kb-stitch-app .settings-danger-btn:hover {
  background: #b91c1c;
}

body.kb-stitch-app .settings-danger-text {
  color: #fb9aa9 !important;
}

/* Medium-width desktops: stack the theme cards' text, keep two columns of fields. */
@media (max-width: 1100px) {
  body.kb-stitch-app .settings-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  body.kb-stitch-app .settings-panel {
    padding: 24px;
  }

  body.kb-stitch-app .settings-export-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Phone panels reuse the danger and privacy markup. */
@media (max-width: 768px) {
  body.kb-stitch-app .settings-danger,
  body.kb-stitch-app .settings-field {
    max-width: none;
  }

  body.kb-stitch-app .settings-input {
    max-width: none;
  }
}

html.light body.kb-stitch-app .settings-theme-mini {
  background: rgba(38, 21, 38, .06);
}

/* The phone panel already shows the section name as its title. */
body.kb-stitch-app #mobile-panel-overlay .settings-field > .settings-label:first-child {
  display: none;
}

/* ── Meeny page: conversation list, 760px chat column, composer with mode pickers ── */
body.kb-stitch-app[data-page="meeny"] #main-content {
  overflow: hidden;
}

body.kb-stitch-app[data-page="meeny"] .kb-content-canvas {
  height: calc(100dvh - var(--kb-stitch-topbar));
  padding: 0 !important;
  overflow: hidden;
}

body.kb-stitch-app .mn-page {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

body.kb-stitch-app .mn-rail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  padding: 20px 14px;
  overflow-y: auto;
  border-right: 1px solid var(--kb-line);
}

body.kb-stitch-app .mn-new {
  justify-content: flex-start;
  min-height: 44px;
  margin-bottom: 10px;
  color: var(--kb-text) !important;
  font-size: 14px;
}

body.kb-stitch-app .mn-new svg,
body.kb-stitch-app .mn-page svg:not(.meeny),
body.kb-stitch-app .mn-thread-list svg:not(.meeny) {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

body.kb-stitch-app .mn-rail-label {
  margin: 0;
  padding: 8px 12px 4px;
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body.kb-stitch-app .mn-thread-list {
  display: grid;
  gap: 2px;
}

body.kb-stitch-app .mn-thread {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 10px;
}

body.kb-stitch-app .mn-thread:hover,
body.kb-stitch-app .mn-thread.is-active {
  background: rgba(var(--kb-primary-rgb), .1);
}

body.kb-stitch-app .mn-thread-open {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
  min-height: 52px;
  padding: 8px 4px 8px 12px;
  border: 0;
  color: var(--kb-muted);
  background: transparent;
  text-align: left;
}

body.kb-stitch-app .mn-thread.is-active .mn-thread-open {
  color: var(--kb-text);
}

body.kb-stitch-app .mn-thread-title {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.kb-stitch-app .mn-thread-open small {
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 600;
  opacity: .8;
}

body.kb-stitch-app .mn-thread .kb-row-more {
  width: 36px;
  height: 36px;
  margin-right: 4px;
}

/* On desktop the "⋯" appears on hover or keyboard focus. */
@media (hover: hover) and (min-width: 769px) {
  body.kb-stitch-app .mn-rail .mn-thread .kb-row-more {
    opacity: 0;
  }

  body.kb-stitch-app .mn-rail .mn-thread:hover .kb-row-more,
  body.kb-stitch-app .mn-rail .mn-thread .kb-row-more:focus-visible,
  body.kb-stitch-app .mn-rail .mn-thread .kb-row-more[aria-expanded="true"] {
    opacity: 1;
  }
}

body.kb-stitch-app .mn-thread-empty {
  margin: 0;
  padding: 8px 12px;
  color: var(--kb-muted);
  font-size: 13px;
}

body.kb-stitch-app .mn-main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

body.kb-stitch-app .mn-head {
  display: none;
}

body.kb-stitch-app .mn-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 22px;
  min-height: 0;
  padding: 28px max(24px, calc((100% - 760px) / 2)) 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.kb-stitch-app .mn-messages > .meeny-empty-state {
  flex: 1;
}

body.kb-stitch-app .mn-msg.is-user {
  align-self: flex-end;
  max-width: min(520px, 85%);
}

body.kb-stitch-app .mn-msg.is-user .mn-msg-body {
  padding: 12px 16px;
  border-radius: 18px 18px 4px 18px;
  color: #241028;
  background: var(--kb-primary);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

body.kb-stitch-app .mn-msg.is-meeny {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-areas:
    "avatar name"
    "avatar body";
  column-gap: 12px;
  align-items: start;
}

body.kb-stitch-app .mn-msg-avatar {
  grid-area: avatar;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
}

body.kb-stitch-app .mn-msg-name {
  grid-area: name;
  margin-bottom: 4px;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 800;
}

body.kb-stitch-app .mn-msg-body {
  grid-area: body;
  min-width: 0;
  color: var(--kb-text);
  font-size: 15.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

body.kb-stitch-app .mn-msg.is-thinking .mn-msg-body {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--kb-muted);
  font-size: 14px;
}

body.kb-stitch-app .mn-thinking-dots {
  display: inline-flex;
  gap: 4px;
}

body.kb-stitch-app .mn-starters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

body.kb-stitch-app .mn-starter {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--kb-line);
  border-radius: 999px;
  color: var(--kb-text);
  background: var(--kb-panel);
  font-size: 13.5px;
  font-weight: 700;
}

body.kb-stitch-app .mn-starter:hover {
  border-color: rgba(var(--kb-primary-rgb), .45);
}

body.kb-stitch-app .mn-composer-wrap {
  padding: 12px max(24px, calc((100% - 760px) / 2)) 18px;
  background: linear-gradient(to top, var(--kb-bg) 70%, transparent);
}

body.kb-stitch-app .mn-composer {
  padding: 12px;
  border: 1px solid var(--kb-line);
  border-radius: 18px;
  background: var(--kb-panel-solid);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
}

html.light body.kb-stitch-app .mn-composer {
  box-shadow: 0 16px 40px rgba(38, 21, 38, .12);
}

body.kb-stitch-app .mn-composer:focus-within {
  border-color: rgba(var(--kb-primary-rgb), .5);
}

/* The composer is the field; the global input frame (set with !important) is removed here. */
body.kb-stitch-app #meeny-input {
  display: block;
  width: 100%;
  min-height: 44px;
  max-height: 168px;
  padding: 10px 6px;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0;
  resize: none;
  color: var(--kb-text) !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 15.5px;
  line-height: 1.5;
}

body.kb-stitch-app .mn-composer-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.kb-stitch-app .mn-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  color: var(--kb-text);
  background: rgba(255, 255, 255, .07);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

html.light body.kb-stitch-app .mn-chip {
  background: rgba(38, 21, 38, .06);
}

body.kb-stitch-app .mn-chip:hover,
body.kb-stitch-app .mn-chip[aria-expanded="true"] {
  background: rgba(var(--kb-primary-rgb), .14);
}

body.kb-stitch-app .mn-chip.is-icon {
  width: 36px;
  justify-content: center;
  padding: 0;
}

body.kb-stitch-app .mn-page .mn-chip svg:not(.meeny) {
  width: 16px;
  height: 16px;
}

body.kb-stitch-app .mn-tool-chip {
  box-shadow: inset 0 0 0 1px rgba(var(--kb-primary-rgb), .45);
}

body.kb-stitch-app .mn-tool-chip.is-active {
  color: #1a0f1d;
  background: var(--kb-primary);
}

body.kb-stitch-app .mn-tool-icon {
  display: grid;
}

body.kb-stitch-app .mn-send {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-left: auto;
  border: 0;
  border-radius: 12px;
  color: #1a0f1d;
  background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent));
}

body.kb-stitch-app .mn-send:disabled {
  cursor: wait;
}

body.kb-stitch-app .mn-note {
  margin: 10px 4px 0;
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 600;
}

body.kb-stitch-app .mn-attachment {
  display: none;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  margin-bottom: 6px;
  padding: 4px 4px 4px 12px;
  border-radius: 999px;
  color: var(--kb-text);
  background: rgba(var(--kb-primary-rgb), .14);
  font-size: 13px;
  font-weight: 700;
}

body.kb-stitch-app .mn-attachment.active {
  display: flex;
}

body.kb-stitch-app .mn-attachment span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.kb-stitch-app .mn-attachment button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: inherit;
  background: transparent;
}

body.kb-stitch-app .mn-page .mn-attachment svg:not(.meeny) {
  width: 16px;
  height: 16px;
}

/* Menu items that are choices (Meeny mode and model). */
body.kb-stitch-app .kb-row-menu-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

body.kb-stitch-app .kb-row-menu-text small {
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 650;
}

body.kb-stitch-app .kb-row-menu-item.is-checked {
  background: rgba(var(--kb-primary-rgb), .12);
}

body.kb-stitch-app .kb-row-menu-check {
  display: grid;
  color: var(--kb-primary);
}

body.kb-stitch-app .kb-row-menu-item .meeny-plus-badge {
  margin-left: 4px;
}

/* Light mode: lilac text on a light surface is too faint, so darken it. */
html.light body.kb-stitch-app .meeny-plus-badge,
html.light body.kb-stitch-app .kb-row-menu-check {
  color: color-mix(in srgb, var(--kb-primary) 50%, #000);
}

html.light body.kb-stitch-app .meeny-plus-badge {
  background: rgba(var(--kb-primary-rgb), .22);
}

body.kb-stitch-app .kb-row-menu-item:has(.kb-row-menu-text small) {
  min-height: 54px;
}

/* Phones: header with the model picker and history/new buttons; the composer sits above the nav. */
@media (max-width: 768px) {
  body.kb-stitch-app[data-page="meeny"] #main-content {
    padding-bottom: 0;
  }

  body.kb-stitch-app[data-page="meeny"] .kb-content-canvas {
    height: 100dvh;
  }

  body.kb-stitch-app .mn-page {
    grid-template-columns: minmax(0, 1fr);
  }

  body.kb-stitch-app .mn-rail {
    display: none;
  }

  body.kb-stitch-app .mn-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
    border-bottom: 1px solid var(--kb-line);
  }

  body.kb-stitch-app .mn-head-art {
    display: grid;
    flex: 0 0 auto;
  }

  body.kb-stitch-app .mn-head-text {
    flex: 1;
    min-width: 0;
  }

  body.kb-stitch-app .mn-head-text h2 {
    margin: 0;
    color: var(--kb-text);
    font-size: 20px;
    line-height: 1.2;
    font-weight: 900;
  }

  body.kb-stitch-app .mn-model-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding: 0;
    border: 0;
    color: var(--kb-muted);
    background: transparent;
    font-size: 12.5px;
    font-weight: 750;
  }

  body.kb-stitch-app .mn-page .mn-model-inline svg:not(.meeny) {
    width: 14px;
    height: 14px;
  }

  body.kb-stitch-app .mn-icon-btn {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--kb-line);
    border-radius: 12px;
    color: var(--kb-text);
    background: var(--kb-panel);
  }

  body.kb-stitch-app .mn-messages {
    gap: 18px;
    padding: 18px 16px 16px;
  }

  body.kb-stitch-app .mn-msg.is-user {
    max-width: 85%;
  }

  body.kb-stitch-app .mn-msg.is-user .mn-msg-body {
    font-size: 14.5px;
  }

  body.kb-stitch-app .mn-msg.is-meeny {
    grid-template-columns: 22px minmax(0, 1fr);
    grid-template-areas:
      "avatar name"
      "body body";
    column-gap: 8px;
    align-items: center;
  }

  body.kb-stitch-app .mn-msg-avatar {
    width: 22px;
    height: 22px;
  }

  body.kb-stitch-app .mn-msg-avatar .meeny {
    width: 22px;
    height: 22px;
  }

  body.kb-stitch-app .mn-msg-name {
    margin: 0;
    font-size: 12.5px;
  }

  body.kb-stitch-app .mn-msg-body {
    margin-top: 6px;
    font-size: 15px;
    line-height: 1.65;
  }

  body.kb-stitch-app .mn-msg.is-user .mn-msg-body {
    margin-top: 0;
  }

  body.kb-stitch-app .mn-composer-wrap {
    padding: 10px 12px calc(var(--kb-stitch-bottom-nav) + env(safe-area-inset-bottom) + 12px);
  }

  body.kb-stitch-app .mn-composer {
    padding: 10px;
    border-radius: 16px;
  }

  body.kb-stitch-app #meeny-input {
    min-height: 38px;
    padding: 8px 4px;
    font-size: 16px;
  }

  body.kb-stitch-app .mn-model-chip,
  body.kb-stitch-app .mn-note {
    display: none;
  }

  /* Toasts go to the top here so they never cover the composer. */
  body.kb-stitch-app[data-page="meeny"] #toast-container {
    top: calc(env(safe-area-inset-top) + 12px);
    bottom: auto;
  }

  body.kb-stitch-app .mn-starters {
    flex-direction: column;
    align-items: stretch;
  }

  body.kb-stitch-app #modal-meeny-threads .mn-thread-list {
    max-height: 60dvh;
    overflow-y: auto;
  }

  body.kb-stitch-app #modal-meeny-threads .mn-new {
    width: 100%;
    margin: 4px 0 10px;
  }
}

@media (min-width: 769px) {
  body.kb-stitch-app #modal-meeny-threads .mn-new {
    width: 100%;
    margin: 4px 0 10px;
  }
}

/* ── Light mode: readable accent text, light bottom nav and phone panels ── */
body.kb-stitch-app .kb-ink {
  color: var(--kb-primary-ink);
}

html.light body.kb-stitch-app :is(
  .kb-page-kicker,
  .dashboard-section-head > span,
  .dashboard-section-head button,
  .dashboard-lower-grid .progress-card-title,
  .trx-icon-btn.is-active,
  .trx-period-range,
  .trx-tag,
  .kb-toast-action,
  .safe-sheet-link,
  .safe-sheet-list .is-total :is(dt, dd),
  button.dashboard-safe-status.is-setup,
  .kb-date-cell.today:not(.selected)
) {
  color: var(--kb-primary-ink);
}

html.light body.kb-stitch-app :is(.text-violet-600, .text-indigo-600, .text-violet-500, .text-indigo-500) {
  color: var(--kb-primary-ink) !important;
}

/* Dashboard cards with nothing set yet read as a call to action. */
body.kb-stitch-app .progress-brief-card.is-empty .progress-card-value {
  color: var(--kb-primary-ink) !important;
  font-size: 17px !important;
  white-space: nowrap;
}

@media (max-width: 768px) {
  html.light body.kb-stitch-app .mobile-bottom-nav {
    background: rgba(255, 249, 255, .92);
    box-shadow: 0 -10px 34px rgba(38, 21, 38, .1);
  }

  html.light body.kb-stitch-app .mobile-nav-btn.active {
    color: var(--kb-primary-ink);
    background: rgba(var(--kb-primary-rgb), .14);
  }

  html.light body.kb-stitch-app .mobile-ai-panel {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, .5)),
      color-mix(in srgb, var(--kb-panel-solid) 96%, transparent) !important;
  }

  html.light body.kb-stitch-app .mobile-ai-option {
    background: rgba(255, 255, 255, .7) !important;
  }
}

html.light body.kb-stitch-app #mobile-panel-overlay > div {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, .5)),
    color-mix(in srgb, var(--kb-panel-solid) 96%, transparent) !important;
  box-shadow: 0 30px 90px rgba(38, 21, 38, .22) !important;
}

/* Dashboard card titles carry an inline colour and a phone rule with !important. */
html.light body.kb-stitch-app .dashboard-lower-grid .progress-card-title {
  color: var(--kb-primary-ink) !important;
}

/* Chart range buttons: labels stay on one line; the active one uses dark text like other
   accent buttons (white on lilac was hard to read). */
body.kb-stitch-app .analytics-range-btn {
  white-space: nowrap;
}

body.kb-stitch-app .analytics-range-btn.active {
  color: #1a0f1d;
}

@media (max-width: 768px) {
  body.kb-stitch-app .analytics-range-btn {
    padding: 0 4px;
  }
}

html.light body.kb-stitch-app .kb-page-kicker {
  color: var(--kb-primary-ink) !important;
}

/* Settings identity card: a compact streak chip that fits next to the plan badge. */
body.kb-stitch-app .settings-identity-chips .kb-streak-chip {
  max-width: 100%;
  padding: 3px 10px 3px 8px;
  font-size: 12.5px;
}

/* Light mode: the logo sits on a light tile instead of the dark app-icon tile. */
html.light body.kb-stitch-app .kb-logo-tile {
  background: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(38, 21, 38, .1), 0 6px 18px rgba(38, 21, 38, .08) !important;
}

/* ── The app's own dropdowns and date fields (replace the browser's) ── */
body.kb-stitch-app .kb-native-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  pointer-events: none !important;
}

body.kb-stitch-app .kb-select {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 12px 0 14px;
  box-sizing: border-box;
  border: 1px solid var(--kb-line);
  border-radius: 12px;
  color: var(--kb-text);
  background: rgba(255, 255, 255, .06);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.2;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}

html.light body.kb-stitch-app .kb-select {
  background: rgba(255, 255, 255, .85);
}

body.kb-stitch-app .kb-select:hover,
body.kb-stitch-app .kb-select[aria-expanded="true"] {
  border-color: rgba(var(--kb-primary-rgb), .55);
}

body.kb-stitch-app .kb-select:focus-visible {
  outline: 2px solid rgba(var(--kb-primary-rgb), .6);
  outline-offset: 2px;
}

body.kb-stitch-app .kb-select:disabled {
  opacity: .5;
  cursor: default;
}

body.kb-stitch-app .kb-select-icon:empty {
  display: none;
}

body.kb-stitch-app .kb-select-icon,
body.kb-stitch-app .kb-select-chevron {
  display: grid;
  flex: 0 0 auto;
}

body.kb-stitch-app .kb-select-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.kb-stitch-app .kb-select-label.is-placeholder {
  color: var(--kb-muted);
}

body.kb-stitch-app .kb-select-chevron {
  color: var(--kb-muted);
}

body.kb-stitch-app :is(.kb-select-chevron, .kb-row-menu-item) svg:not(.meeny) {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Category icons in the field and the menu: a tinted tile like elsewhere in the app. */
body.kb-stitch-app .kb-select-glyph {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: color-mix(in srgb, var(--trx-color) 18%, transparent);
  font-size: 16px;
  line-height: 1;
}

body.kb-stitch-app .kb-select-glyph .kb-glyph {
  width: 18px;
  height: 18px;
}

/* Long lists scroll inside the menu; short number lists (days 1–31) are a grid. */
body.kb-stitch-app .kb-row-menu {
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.kb-stitch-app .kb-row-menu.is-grid {
  display: grid;
  grid-template-columns: repeat(7, 44px);
  gap: 4px;
  min-width: 0 !important;
}

body.kb-stitch-app .kb-row-menu.is-grid .kb-row-menu-item {
  width: 44px;
  min-height: 40px;
  justify-content: center;
  padding: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 14px;
}

body.kb-stitch-app .kb-row-menu.is-grid .kb-row-menu-item.is-checked {
  color: #1a0f1d;
  background: var(--kb-primary);
}

/* Fields in the old automation form and modals get the same height as the new buttons. */
body.kb-stitch-app .automation-panel .kb-select {
  min-height: 46px;
}

/* ── Upgrade: the user's plan, its end date and this month's usage ── */
body.kb-stitch-app .kb-plan-status {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(0, 1.4fr);
  align-items: center;
  gap: 24px;
  margin-top: 20px;
  padding: 22px 24px;
  border: 1px solid var(--kb-line);
  border-radius: 18px;
  background: var(--kb-panel);
}

body.kb-stitch-app .kb-plan-status-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

body.kb-stitch-app .kb-plan-status-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  color: var(--kb-muted);
  background: rgba(255, 255, 255, .07);
}

body.kb-stitch-app .kb-plan-status-icon.is-plus {
  color: #1a0f1d;
  background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent));
}

body.kb-stitch-app .kb-plan-status-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.kb-stitch-app .kb-plan-status-label {
  margin: 0;
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 800;
}

body.kb-stitch-app .kb-plan-status-name {
  margin: 2px 0 0;
  color: var(--kb-text);
  font-size: 22px;
  font-weight: 900;
}

body.kb-stitch-app .kb-plan-status-note {
  margin: 2px 0 0;
  color: var(--kb-muted);
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.45;
}

body.kb-stitch-app .kb-plan-meters {
  display: grid;
  gap: 10px;
}

body.kb-stitch-app .kb-plan-meter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
}

body.kb-stitch-app .kb-plan-meter {
  display: grid;
  gap: 6px;
}

body.kb-stitch-app .kb-plan-meter-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--kb-text);
  font-size: 13px;
  font-weight: 700;
}

body.kb-stitch-app .kb-plan-meter.is-high .kb-bar > i {
  background: var(--kb-expense);
}

body.kb-stitch-app .kb-plan-active-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #0b2b27;
  background: var(--kb-income);
  font-size: 12px;
  font-weight: 800;
}

body.kb-stitch-app .kb-plan-current {
  color: var(--kb-muted) !important;
  background: rgba(255, 255, 255, .06) !important;
  border: 1px solid var(--kb-line) !important;
  cursor: default;
}

/* Shown above the plan cards while Plus is not on sale yet. */
body.kb-stitch-app .kb-plan-sales-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 0;
  padding: 12px 16px;
  border: 1px solid rgba(var(--kb-primary-rgb), .28);
  border-radius: 14px;
  color: var(--kb-muted);
  background: rgba(var(--kb-primary-rgb), .08);
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.5;
}

body.kb-stitch-app .kb-plan-sales-note strong {
  color: var(--kb-text);
  font-weight: 800;
}

body.kb-stitch-app .kb-plan-sales-note > .kb-ui-glyph {
  margin-top: 2px;
  color: var(--kb-primary-ink);
  font-size: 16px;
}

@media (max-width: 768px) {
  body.kb-stitch-app .kb-plan-status {
    grid-template-columns: 1fr;
    padding: 18px;
  }
}

/* ── Toasts: readable in light mode, icon coloured by kind, a nudge when a message repeats ── */
html.light body.kb-stitch-app .toast {
  background: rgba(255, 250, 255, .97) !important;
  border-color: rgba(38, 21, 38, .12) !important;
  box-shadow: 0 18px 50px rgba(38, 21, 38, .16) !important;
}

body.kb-stitch-app .toast.is-success > .kb-ui-glyph { color: var(--kb-income); }
body.kb-stitch-app .toast.is-error > .kb-ui-glyph { color: var(--kb-expense); }
body.kb-stitch-app .toast.is-warning > .kb-ui-glyph { color: #f59e0b; }
body.kb-stitch-app .toast.is-info > .kb-ui-glyph { color: var(--kb-primary-ink); }

@keyframes kbToastBump {
  0%, 100% { transform: none; }
  40% { transform: scale(1.03); }
}

body.kb-stitch-app .toast.kb-toast-bump {
  animation: kbToastBump .3s ease;
}

@media (prefers-reduced-motion: reduce) {
  body.kb-stitch-app .toast.kb-toast-bump {
    animation: none;
  }
}

/* Meeny's replies sit in a soft bubble (pointed towards the avatar) so they read as one turn. */
body.kb-stitch-app .mn-msg.is-meeny .mn-msg-body {
  justify-self: start;
  max-width: 680px;
  padding: 12px 16px;
  border: 1px solid var(--kb-line);
  border-radius: 4px 18px 18px 18px;
  background: var(--kb-panel);
}

html.light body.kb-stitch-app .mn-msg.is-meeny .mn-msg-body {
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 6px 18px rgba(38, 21, 38, .06);
}

@media (max-width: 768px) {
  body.kb-stitch-app .mn-msg.is-meeny .mn-msg-body {
    max-width: 100%;
    padding: 11px 14px;
  }
}

/* Wordmark: "Kita" in the brand pink, "Budget" in the text colour, in every theme. */
body.kb-stitch-app .kb-wordmark-kita {
  color: #f4aeff;
}

html.light body.kb-stitch-app :is(.kb-sidebar-brand, .dashboard-mobile-brand) .kb-wordmark-kita {
  color: #a14dbf;
}
