/* 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"] .kb-content-canvas {
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  margin: 0 !important;
  padding: 18px clamp(24px, 2vw, 34px) 32px !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 .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 {
  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;
  /* minmax(0, …): a long greeting or chip can never widen Home past the screen. */
  grid-template-columns: minmax(0, 1fr);
  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 :is(h2, 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 canvas {
  min-height: 0;
}

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

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 {
    padding-bottom: 0;
  }

  body.kb-stitch-app body[data-page="dashboard"] .kb-content-canvas,
  body.kb-stitch-app[data-page="dashboard"] .kb-content-canvas {
    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 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-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 .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 :is(h2, 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 :is(h2, 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-automation-sheet-open .mobile-bottom-nav,
  body.kb-stitch-app.kb-notif-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;
  }

  /* A question asked from inside a sheet ("blurry photo, read anyway?") stays above that sheet. */
  body.kb-stitch-app #modal-dialog {
    z-index: 97;
  }

  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 {
    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: 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="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: 46px 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;
}

/* No browser pull-to-refresh or rubber-band on the app: Chrome reads it from the root element. */
html:has(> body.kb-stitch-app),
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;
  /* Pressing scales; changing state (active tab, selected option, hover) eases between colours. */
  transition: scale .18s cubic-bezier(.2, .8, .2, 1), color .24s ease, background-color .24s ease,
    border-color .24s ease, box-shadow .24s ease, opacity .24s ease;
}

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;
}

/* The calendar and confirmations open from inside other sheets (AI Catat, the filter, Meeny cards,
   goals), which share one layer and come later in the page, so these two sit above all of them. */
body.kb-stitch-app #modal-date-picker,
body.kb-stitch-app #modal-dialog {
  z-index: 120 !important;
}

/* The month grid sits on the sheet's own surface, not a navy box. */
body.kb-stitch-app #modal-date-picker .kb-date-box {
  border-color: var(--kb-line);
  background: rgba(255, 255, 255, .035);
}

html.light body.kb-stitch-app #modal-date-picker .kb-date-box {
  background: rgba(var(--kb-primary-rgb), .05);
}

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: kbBubbleUp .5s cubic-bezier(.22, 1, .36, 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, and on sign-in and onboarding (no bottom nav, the main
     button sits at the bottom), toasts move to the top so they do not cover it. */
  body.kb-stitch-app:is(.kb-modal-open, .kb-mobile-ai-open, .kb-mobile-panel-open, :not([data-app-ready="true"])) #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%); }
}

/* A sheet rising like a bubble: up from below, a touch past its place, then settling. */
@keyframes kbBubbleUp {
  0% { transform: translateY(100%); }
  70% { transform: translateY(-1.2%); }
  100% { transform: none; }
}

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

/* ── Motion: sliding nav highlight, sheets that rise, options that follow ── */
body.kb-stitch-app .kb-glider {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  will-change: transform;
  transition: transform .46s cubic-bezier(.34, 1.36, .64, 1), width .46s cubic-bezier(.34, 1.36, .64, 1),
    height .46s cubic-bezier(.34, 1.36, .64, 1), opacity .2s ease;
}

body.kb-stitch-app .kb-glider.is-on { opacity: 1; }

/* A selection that moved: the new item's background rides a ghost from the old one (KBUI). */
body.kb-stitch-app .kb-flip-ghost {
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

:where(body.kb-stitch-app .kb-flipping) > :where(:not(.kb-flip-ghost, .kb-sheet-grab, .kb-glider)) {
  position: relative;
  z-index: 1;
}

body.kb-stitch-app .kb-flipping > .kb-flip-target {
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
}
body.kb-stitch-app .kb-glider.kb-glider-instant { transition: none; }

body.kb-stitch-app .kb-has-glider > :not(.kb-glider) {
  position: relative;
  z-index: 1;
}

body.kb-stitch-app .mobile-bottom-nav .kb-glider {
  border-radius: 14px;
  background: rgba(255,255,255,.07);
}

body.kb-stitch-app .mobile-bottom-nav.kb-has-glider .mobile-nav-btn.active { background: transparent; }

html.light body.kb-stitch-app .mobile-bottom-nav .kb-glider { background: rgba(var(--kb-primary-rgb), .14); }

body.kb-stitch-app #sidebar nav .kb-glider {
  border: 1px solid rgba(var(--kb-primary-rgb), .28);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(var(--kb-primary-rgb), .18), rgba(var(--kb-accent-rgb), .1)),
    rgba(255,255,255,.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 16px 34px rgba(0,0,0,.18);
}

body.kb-stitch-app #sidebar nav.kb-has-glider .nav-item.active {
  background: transparent !important;
  border-color: transparent;
  box-shadow: none;
}

body.kb-stitch-app #mobile-panel-overlay:not([data-closing]) { animation: kbFadeIn .2s ease-out; }
body.kb-stitch-app #mobile-panel-overlay:not([data-closing]) > div { animation: kbPopIn .3s cubic-bezier(.22, 1.18, .36, 1); }

body.kb-stitch-app .mobile-ai-sheet.open { animation: kbFadeIn .2s ease-out; }
body.kb-stitch-app .mobile-ai-sheet.open .mobile-ai-panel { animation: kbBubbleUp .5s cubic-bezier(.22, 1, .36, 1); }
body.kb-stitch-app .mobile-ai-sheet.open .mobile-ai-option { animation: kbRiseIn .44s cubic-bezier(.22, 1.18, .36, 1) .08s backwards; }
body.kb-stitch-app .mobile-ai-sheet.open .mobile-ai-option:nth-child(2) { animation-delay: .13s; }
body.kb-stitch-app .mobile-ai-sheet.open .mobile-ai-option:nth-child(3) { animation-delay: .18s; }
body.kb-stitch-app .mobile-ai-sheet.open .mobile-ai-option:nth-child(4) { animation-delay: .23s; }

@media (max-width: 768px) {
  body.kb-stitch-app #mobile-panel-overlay:not([data-closing]) > div { animation: kbBubbleUp .5s cubic-bezier(.22, 1, .36, 1); }
}

@media (prefers-reduced-motion: reduce) {
  body.kb-stitch-app .kb-glider { transition: opacity .15s ease; }
  body.kb-stitch-app #mobile-panel-overlay > div,
  body.kb-stitch-app .mobile-ai-sheet.open .mobile-ai-panel,
  body.kb-stitch-app .mobile-ai-sheet.open .mobile-ai-option {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
  }
}

@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: clamp(13.5px, 4vw, 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;
  /* A real button for keyboards and screen readers, drawn like the text it was. */
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

body.kb-stitch-app .trx-item-main:focus-visible {
  outline: 2px solid rgba(var(--kb-primary-rgb), .7);
  outline-offset: 3px;
  border-radius: 8px;
}

body.kb-stitch-app #page-content:focus { outline: none; }
body.kb-stitch-app #page-content:focus-visible { outline: 2px solid rgba(var(--kb-primary-rgb), .45); outline-offset: -2px; border-radius: 16px; }
body.kb-stitch-app #meeny-messages:focus-visible { outline: 2px solid rgba(var(--kb-primary-rgb), .45); outline-offset: -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: #140b14;
  --ob-overlay-paint:
    radial-gradient(circle at 85% -5%, rgba(244, 174, 255, .18), transparent 420px),
    radial-gradient(circle at 0% 105%, rgba(123, 208, 255, .12), transparent 420px),
    #140b14;
  background: var(--ob-overlay-paint);
  color: var(--kb-text);
}

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-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-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-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));
  isolation: isolate;
}

/* Behind the button: the overlay's own paint pinned to the screen and faded in at the top, so the
   bar never shows as a darker box against the glow behind it. */
body.kb-stitch-app .ob-actions::before {
  content: "";
  position: absolute;
  inset: -12px -24px 0;
  z-index: -1;
  background: var(--ob-overlay-paint, var(--ob-overlay-bg));
  background-attachment: fixed;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 45%);
  mask-image: linear-gradient(180deg, transparent, #000 45%);
  pointer-events: none;
}

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-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-actions {
    position: static;
    padding: 0;
    background: none;
  }

  body.kb-stitch-app .ob-actions::before { display: none; }

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

@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;
}

/* ── 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: 50px clamp(226px, 29dvh, 254px) 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: 46px clamp(208px, 28dvh, 230px) 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 > .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;
}

/* Tablets and small laptops: one column, so "Rumah" or "Makanan & Minuman" is not cut beside
   the amounts, the percentage and the menu. */
@media (min-width: 769px) and (max-width: 1180px) {
  body.kb-stitch-app .kb-budget-list { grid-template-columns: minmax(0, 1fr); }
}

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 :is(h1, 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;
  }

  /* The page already stops above the bottom nav, so the composer only needs a small gap. */
  body.kb-stitch-app .mn-composer-wrap {
    padding: 10px 12px 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;
}

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: inherit;
  font-variant-numeric: tabular-nums;
  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;
}

/* ── Onboarding: Meeny guides four short steps; desktop adds a side panel with the step list ── */
body.kb-stitch-app .ob2 {
  display: flex;
  justify-content: center;
  min-height: 100dvh;
}

body.kb-stitch-app .ob2-main {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  padding: max(18px, env(safe-area-inset-top)) 20px 0;
  box-sizing: border-box;
}

body.kb-stitch-app .ob2.is-solo .ob2-main {
  justify-content: center;
  max-width: 520px;
  padding-top: max(28px, env(safe-area-inset-top));
}

body.kb-stitch-app .ob2 .ob-title {
  margin-bottom: 14px;
  font-size: clamp(24px, 5.4vw, 34px);
}

body.kb-stitch-app .ob2 .ob-sub {
  margin-bottom: 18px;
}

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

body.kb-stitch-app .ob2-aside {
  display: none;
}

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

body.kb-stitch-app .ob2-progress .ob-back {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

body.kb-stitch-app .ob2-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
}

body.kb-stitch-app .ob2-track-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--kb-primary), var(--kb-accent));
  transition: width .55s cubic-bezier(.2, .8, .2, 1);
}

body.kb-stitch-app .ob2-track-meeny {
  position: absolute;
  top: -11px;
  width: 30px;
  height: 30px;
  margin-left: -15px;
  transition: left .55s cubic-bezier(.2, .8, .2, 1);
}

body.kb-stitch-app .ob2-speaker {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
}

body.kb-stitch-app .ob2-speaker-art {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
}

body.kb-stitch-app .ob2-bubble {
  flex-grow: 1;
  min-height: 48px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 4px 16px 16px 16px;
  background: rgba(255, 255, 255, .07);
  color: var(--kb-text);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.45;
}

body.kb-stitch-app .ob2-label {
  margin: 0 0 8px;
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

body.kb-stitch-app .ob2-hint,
body.kb-stitch-app .ob2-foot {
  margin: 14px 0 0;
  color: #9d8a9c;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
}

body.kb-stitch-app .ob2-foot {
  margin: 4px 0 24px;
  text-align: center;
}

body.kb-stitch-app .ob2-skip {
  display: block;
  width: 100%;
  height: 40px;
  margin-top: 6px;
  border: 0;
  background: transparent;
  color: var(--kb-muted);
  font-size: 14px;
  font-weight: 800;
}

body.kb-stitch-app .ob2-fade {
  animation: obFadeUp .35s cubic-bezier(.2, .8, .2, 1) both;
}

/* Welcome */
body.kb-stitch-app .ob2-welcome {
  display: flex;
  flex-direction: column;
  text-align: center;
}

body.kb-stitch-app .ob2-hero {
  position: relative;
  align-self: center;
  width: 156px;
  height: 156px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
}

body.kb-stitch-app .ob2-twinkle {
  position: absolute;
  color: #f7d06f;
  animation: obTwinkle 2.4s ease-in-out infinite;
}

body.kb-stitch-app .ob2-twinkle.is-a { left: -10px; top: 32px; }
body.kb-stitch-app .ob2-twinkle.is-b { right: -6px; top: 6px; color: #7bd0ff; animation-delay: .8s; }
body.kb-stitch-app .ob2-twinkle.is-c { right: -16px; bottom: 30px; color: #f4aeff; animation-delay: 1.5s; }

body.kb-stitch-app .ob2-slides {
  position: relative;
  min-height: 92px;
  margin-top: 4px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 18px;
  background: rgba(255, 255, 255, .06);
  text-align: left;
}

body.kb-stitch-app .ob2-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .4s ease, transform .4s cubic-bezier(.2, .8, .2, 1);
  pointer-events: none;
}

body.kb-stitch-app .ob2-slide.is-active {
  opacity: 1;
  transform: none;
}

body.kb-stitch-app .ob2-slide strong,
body.kb-stitch-app .ob2-persona strong,
body.kb-stitch-app .ob2-steps strong {
  display: block;
  color: var(--kb-text);
  font-size: 16px;
  font-weight: 800;
}

body.kb-stitch-app .ob2-slide small {
  display: block;
  margin-top: 3px;
  color: var(--kb-muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

body.kb-stitch-app .ob2-slide-icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #f4aeff;
  background: rgba(244, 174, 255, .16);
}

body.kb-stitch-app .ob2-slide-icon.is-1 { color: #2dd4bf; background: rgba(45, 212, 191, .16); }
body.kb-stitch-app .ob2-slide-icon.is-2 { color: #7bd0ff; background: rgba(123, 208, 255, .16); }
body.kb-stitch-app .ob2-slide-icon svg { width: 24px; height: 24px; }

body.kb-stitch-app .ob2-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 12px 0 22px;
}

body.kb-stitch-app .ob2-dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .25);
  transition: width .3s ease, background .3s ease;
}

body.kb-stitch-app .ob2-dots i.is-active {
  width: 22px;
  background: var(--kb-primary);
}

body.kb-stitch-app .ob2-welcome .ob-check {
  text-align: left;
}

/* Persona */
body.kb-stitch-app .ob2-persona-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body.kb-stitch-app .ob2-persona {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 150px;
  padding: 14px;
  border: 2px solid rgba(255, 255, 255, .12);
  border-radius: 20px;
  background: rgba(255, 255, 255, .04);
  color: var(--kb-text);
  text-align: left;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), border-color .3s ease, background .3s ease, opacity .3s ease;
}

body.kb-stitch-app .ob2-persona:hover {
  border-color: rgba(244, 174, 255, .45);
}

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

body.kb-stitch-app .ob2-persona-grid.has-choice .ob2-persona:not(.is-active) {
  opacity: .8;
  transform: scale(.97);
}

body.kb-stitch-app .ob2-persona strong {
  font-size: 15.5px;
  line-height: 1.2;
}

body.kb-stitch-app .ob2-persona small {
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
}

/* Persona icons: a tinted tile with a two-tone icon, like the Untukmu shortcuts on Home. */
body.kb-stitch-app .ob2-persona-art {
  --tone: var(--kb-h-pink);
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: color-mix(in srgb, var(--tone) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone) 26%, transparent);
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
}
body.kb-stitch-app .ob2-persona-art.is-blue { --tone: var(--kb-h-blue); }
body.kb-stitch-app .ob2-persona-art.is-teal { --tone: var(--kb-h-teal); }
body.kb-stitch-app .ob2-persona-art.is-amber { --tone: var(--kb-h-amber); }
body.kb-stitch-app .ob2 .ob2-persona-art svg {
  width: 34px !important;
  height: 34px !important;
  stroke: none;
  fill: none;
}
body.kb-stitch-app .ob2-persona.is-active .ob2-persona-art {
  background: color-mix(in srgb, var(--tone) 22%, transparent);
  border-color: color-mix(in srgb, var(--tone) 55%, transparent);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--tone) 22%, transparent);
}

body.kb-stitch-app .ob2-persona-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  color: transparent;
  transition: all .25s ease;
}

body.kb-stitch-app .ob2-persona-check svg {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

body.kb-stitch-app .ob2-persona.is-active .ob2-persona-check {
  border-color: var(--kb-primary);
  background: var(--kb-primary);
  color: #1a0f1d;
  animation: obPopIn .35s cubic-bezier(.2, .8, .2, 1);
}

body.kb-stitch-app .ob2-cats {
  margin-top: 18px;
}

body.kb-stitch-app .ob2-cats .ob-cat-tools {
  margin: 0 0 10px;
}

body.kb-stitch-app .ob2-cats .ob-cat-tools > span:last-child {
  display: flex;
  gap: 12px;
}

body.kb-stitch-app .ob2-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body.kb-stitch-app .ob2-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px 0 5px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: var(--kb-text);
  font-size: 13px;
  font-weight: 700;
}

body.kb-stitch-app .ob2-chip .ob-chip-icon {
  width: 22px;
  height: 22px;
}

/* Name */
body.kb-stitch-app #onboarding-overlay .ob2-name-input {
  height: 60px;
  border-color: rgba(244, 174, 255, .55);
  font-family: Manrope, "Hanken Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 800;
}

body.kb-stitch-app .ob2-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px dashed rgba(255, 255, 255, .18);
  border-radius: 18px;
  background: rgba(255, 255, 255, .04);
}

body.kb-stitch-app .ob2-preview .ob2-label {
  margin: 0 0 4px;
  font-size: 11.5px;
}

body.kb-stitch-app .ob2-preview strong {
  color: var(--kb-text);
  font-family: Manrope, "Hanken Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 800;
}

body.kb-stitch-app .ob2-preview small {
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 700;
}

/* Money in */
body.kb-stitch-app .ob2-income {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

body.kb-stitch-app .ob2-income button {
  height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1.5px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  background: rgba(255, 255, 255, .05);
  color: var(--kb-text);
  font-size: 13.5px;
  font-weight: 800;
  transition: all .25s ease;
}

body.kb-stitch-app .ob2-income button.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent));
  color: #1a0f1d;
}

body.kb-stitch-app .ob2-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 16px;
}

body.kb-stitch-app .ob2-days button {
  height: 40px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  color: var(--kb-text);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 700;
  transition: all .2s ease;
}

body.kb-stitch-app .ob2-days button.is-active {
  border-color: var(--kb-primary);
  background: var(--kb-primary);
  color: #1a0f1d;
}

body.kb-stitch-app .ob2-note-card {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 18px;
  background: rgba(255, 255, 255, .05);
}

body.kb-stitch-app .ob2-note-card > span {
  flex: 0 0 auto;
  color: #7bd0ff;
}

body.kb-stitch-app .ob2-note-card p {
  margin: 0;
  color: #e9dbe7;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

body.kb-stitch-app .ob2-period {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 18px;
  background: rgba(255, 255, 255, .05);
}

body.kb-stitch-app .ob2-period-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

body.kb-stitch-app .ob2-period-head .ob2-label {
  margin: 0;
  font-size: 11.5px;
}

body.kb-stitch-app .ob2-period-head strong {
  color: var(--kb-text);
  font-size: 15px;
  font-weight: 800;
}

body.kb-stitch-app .ob2-period-bar {
  position: relative;
  height: 8px;
  margin: 14px 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

body.kb-stitch-app .ob2-period-bar span {
  display: block;
  height: 8px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--kb-primary), var(--kb-accent));
}

body.kb-stitch-app .ob2-period-bar i {
  position: absolute;
  top: -6px;
  width: 3px;
  height: 20px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: #ffffff;
}

body.kb-stitch-app .ob2-period-ends {
  display: flex;
  justify-content: space-between;
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 700;
}

body.kb-stitch-app .ob2-period-ends strong {
  color: var(--kb-text);
}

body.kb-stitch-app .ob2-period p {
  margin: 10px 0 0;
  color: var(--kb-text);
  font-size: 14px;
  font-weight: 700;
}

/* Balance and spending limit */
body.kb-stitch-app .ob2-money {
  display: grid;
  gap: 18px;
}

body.kb-stitch-app .ob2-money-fields {
  display: grid;
  gap: 12px;
}

body.kb-stitch-app .ob2-balance-row {
  grid-template-columns: minmax(0, 1fr) 120px;
}

body.kb-stitch-app .ob2-amount-chip {
  height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  color: var(--kb-text);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
}

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

body.kb-stitch-app .ob2-budget-head label {
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 800;
}

body.kb-stitch-app .ob2-budget-input {
  max-width: 190px;
}

body.kb-stitch-app #onboarding-overlay .ob2-budget-input .ob-input {
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

/* A drawn slider: the native one sat in a dark box and its fill did not match the app. --fill is
   kept in step by onboardingRangeFill. */
body.kb-stitch-app #onboarding-budget-range {
  --fill: 0%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 30px;
  margin: 6px 0 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
}
body.kb-stitch-app #onboarding-budget-range:focus-visible { outline: none; }
body.kb-stitch-app #onboarding-budget-range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--kb-primary), var(--kb-accent)) 0 0 / var(--fill) 100% no-repeat, rgba(255, 255, 255, .12);
}
body.kb-stitch-app #onboarding-budget-range::-moz-range-track { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .12); }
body.kb-stitch-app #onboarding-budget-range::-moz-range-progress { height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--kb-primary), var(--kb-accent)); }
body.kb-stitch-app #onboarding-budget-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -9px;
  border: 4px solid #140b14;
  border-radius: 50%;
  background: #f4aeff;
  box-shadow: 0 0 0 1px rgba(244, 174, 255, .55), 0 6px 16px rgba(0, 0, 0, .45);
  transition: transform .15s ease;
}
body.kb-stitch-app #onboarding-budget-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 4px solid #140b14;
  border-radius: 50%;
  background: #f4aeff;
  box-shadow: 0 0 0 1px rgba(244, 174, 255, .55), 0 6px 16px rgba(0, 0, 0, .45);
}
body.kb-stitch-app #onboarding-budget-range:active::-webkit-slider-thumb { transform: scale(1.12); }
body.kb-stitch-app #onboarding-budget-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(244, 174, 255, .6), 0 6px 16px rgba(0, 0, 0, .45); }

body.kb-stitch-app .ob2-range-ends {
  display: flex;
  justify-content: space-between;
  color: #8e7c8d;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 600;
}

body.kb-stitch-app .ob2-safe {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border: 1px solid rgba(45, 212, 191, .4);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(244, 174, 255, .16), rgba(123, 208, 255, .08)), #1f1322;
  animation: obGlow 2.6s ease-in-out infinite;
}

body.kb-stitch-app .ob2-safe-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fde6ff;
  font-size: 13.5px;
  font-weight: 800;
}

body.kb-stitch-app .ob2-safe-label svg {
  width: 16px;
  height: 16px;
}

body.kb-stitch-app .ob2-safe strong {
  margin-top: 4px;
  color: #2dd4bf;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

body.kb-stitch-app .ob2-safe small {
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 600;
}

body.kb-stitch-app .ob2-safe-ticks {
  display: flex;
  gap: 3px;
  margin-top: 10px;
}

body.kb-stitch-app .ob2-safe-ticks i {
  flex-grow: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .16);
}

body.kb-stitch-app .ob2-safe-ticks i.is-today {
  background: #2dd4bf;
}

body.kb-stitch-app .ob2-safe p {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

/* Finish */
body.kb-stitch-app .ob2-finish {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: center;
}

body.kb-stitch-app .ob2-finish .ob-sub {
  margin-inline: auto;
}

body.kb-stitch-app .ob2-finish-art {
  align-self: center;
  width: 104px;
  height: 104px;
  margin-bottom: 12px;
  animation: obPopIn .55s cubic-bezier(.2, .8, .2, 1) both;
}

body.kb-stitch-app .ob2-confetti {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

body.kb-stitch-app .ob2-confetti i {
  position: absolute;
  top: -24px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  animation: obConfetti 2.4s cubic-bezier(.25, .7, .4, 1) both;
}

body.kb-stitch-app .ob2-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  text-align: left;
}

body.kb-stitch-app .ob2-tile {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  background: rgba(255, 255, 255, .06);
}

body.kb-stitch-app .ob2-tile span {
  display: block;
  color: #9d8a9c;
  font-size: 12px;
  font-weight: 800;
}

body.kb-stitch-app .ob2-tile strong {
  display: block;
  margin-top: 3px;
  color: var(--kb-text);
  font-size: 15px;
  font-weight: 800;
}

body.kb-stitch-app .ob2-tile strong.is-accent {
  color: #2dd4bf;
}

body.kb-stitch-app .ob2-finish .ob-check {
  text-align: left;
}

/* Desktop: a side panel carries Meeny and the step list. */
@media (min-width: 1024px) {
  body.kb-stitch-app .ob2:not(.is-solo) {
    display: grid;
    grid-template-columns: clamp(300px, 32vw, 440px) minmax(0, 1fr);
  }

  body.kb-stitch-app .ob2-aside {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 28px;
    height: 100dvh;
    padding: 40px 44px 32px;
    box-sizing: border-box;
    border-right: 1px solid rgba(255, 255, 255, .08);
    background: radial-gradient(circle at 30% 20%, rgba(244, 174, 255, .22), transparent 360px), linear-gradient(180deg, #24142a, #160c18);
  }

  body.kb-stitch-app .ob2-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--kb-text);
    font-family: Manrope, "Hanken Grotesk", sans-serif;
    font-size: 20px;
    font-weight: 800;
  }

  body.kb-stitch-app .ob2-brand-tile {
    width: 40px;
    height: 40px;
  }

  body.kb-stitch-app .ob2-aside-meeny {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  body.kb-stitch-app .ob2-aside-meeny > :is(svg, img) {
    flex: 0 0 auto;
  }

  body.kb-stitch-app .ob2-aside-meeny .ob2-bubble {
    font-size: 16px;
  }

  body.kb-stitch-app .ob2-steps {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  body.kb-stitch-app .ob2-steps li {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #9d8a9c;
  }

  body.kb-stitch-app .ob2-steps strong {
    font-size: 15px;
    color: inherit;
  }

  body.kb-stitch-app .ob2-steps small {
    display: block;
    color: #9d8a9c;
    font-size: 13px;
    font-weight: 600;
  }

  body.kb-stitch-app .ob2-steps li.is-done,
  body.kb-stitch-app .ob2-steps li.is-now {
    color: var(--kb-text);
  }

  body.kb-stitch-app .ob2-steps-dot {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1.5px solid rgba(255, 255, 255, .25);
    border-radius: 50%;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    font-weight: 700;
  }

  body.kb-stitch-app .ob2-steps li.is-done .ob2-steps-dot {
    border-color: #2dd4bf;
    background: #2dd4bf;
    color: #0b2b27;
  }

  body.kb-stitch-app .ob2-steps-dot svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.8;
  }

  body.kb-stitch-app .ob2-steps li.is-now .ob2-steps-dot {
    border-color: var(--kb-primary);
    background: var(--kb-primary);
    color: #1a0f1d;
  }

  body.kb-stitch-app .ob2-aside-note {
    margin: auto 0 0;
    color: #9d8a9c;
    font-size: 13px;
    font-weight: 600;
  }

  body.kb-stitch-app .ob2:not(.is-solo) .ob2-main {
    max-width: 640px;
    margin: 0 auto;
    padding: 48px 48px 40px;
    justify-content: center;
  }

  body.kb-stitch-app .ob2[data-step="4"] .ob2-main {
    max-width: 900px;
  }

  body.kb-stitch-app .ob2-speaker {
    display: none;
  }
}

/* The fields and the "safe to spend" preview side by side only where both fit (at 1024 px the
   fields were squeezed to 150 px: "Rp" alone in the balance box, labels on top of each other). */
@media (min-width: 1280px) {
  body.kb-stitch-app .ob2[data-step="4"] .ob2-money {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: center;
  }
}

@keyframes obFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes obPopIn {
  0% { opacity: 0; transform: scale(.4); }
  60% { opacity: 1; transform: scale(1.12); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes obTwinkle {
  0%, 100% { opacity: .25; transform: scale(.6); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes obGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0); }
  50% { box-shadow: 0 0 0 7px rgba(45, 212, 191, .14); }
}

@keyframes obConfetti {
  0% { opacity: 1; transform: translateY(-30px) rotate(0deg); }
  100% { opacity: 0; transform: translateY(100vh) rotate(560deg); }
}

@media (prefers-reduced-motion: reduce) {
  body.kb-stitch-app :is(.ob2-fade, .ob2-twinkle, .ob2-safe, .ob2-finish-art, .ob2-confetti i, .ob2-persona-check) {
    animation: none !important;
  }

  body.kb-stitch-app :is(.ob2-slide, .ob2-track-fill, .ob2-track-meeny, .ob2-persona) {
    transition: none !important;
  }
}

/* The onboarding overlay stays dark in light mode, so its logo tile and dropdown stay dark too. */
html.light body.kb-stitch-app #onboarding-overlay .kb-logo-tile {
  background: #2a1830 !important;
  box-shadow: none !important;
}

html.light body.kb-stitch-app #onboarding-overlay .kb-select {
  background: rgba(255, 255, 255, .06);
}

/* Onboarding finish: Meeny's invitation to the tour */
body.kb-stitch-app .ob2-install { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--kb-line); border-radius: 18px; background: rgba(255, 255, 255, .04); text-align: left; }
body.kb-stitch-app .ob2-install.is-steps { display: block; }
body.kb-stitch-app .ob2-install summary { display: flex; align-items: center; gap: 12px; list-style: none; cursor: pointer; }
body.kb-stitch-app .ob2-install summary::-webkit-details-marker { display: none; }
body.kb-stitch-app .ob2-install > .kb-ui-glyph, body.kb-stitch-app .ob2-install summary > .kb-ui-glyph { flex: 0 0 auto; width: 26px; height: 26px; color: var(--kb-primary); }
body.kb-stitch-app .ob2-install strong { display: block; font-size: 14px; font-weight: 900; color: var(--kb-text); }
body.kb-stitch-app .ob2-install small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 650; line-height: 1.4; color: var(--kb-muted); }
body.kb-stitch-app .ob2-install-btn { flex: 0 0 auto; margin-left: auto; padding: 8px 14px; border: 0; border-radius: 999px; font-size: 13px; font-weight: 900; white-space: nowrap; color: #1b0f1d; background: linear-gradient(135deg, #f4aeff, #7bd0ff); }
body.kb-stitch-app .ob2-install .kb-rem-steps { margin: 12px 0 0; }
html.light body.kb-stitch-app .ob2-install { background: rgba(38, 21, 38, .03); }

body.kb-stitch-app .ob2-invite {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid rgba(244, 174, 255, .45);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(244, 174, 255, .16), rgba(123, 208, 255, .08)), #1f1322;
  text-align: left;
  animation: obGlow 2.6s ease-in-out infinite;
}

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

body.kb-stitch-app .ob2-invite-head > svg {
  flex: 0 0 auto;
}

body.kb-stitch-app .ob2-invite strong {
  display: block;
  color: var(--kb-text);
  font-family: Manrope, "Hanken Grotesk", sans-serif;
  font-size: 17px;
  font-weight: 800;
}

body.kb-stitch-app .ob2-invite small {
  display: block;
  margin-top: 3px;
  color: #d8c8d6;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
}

body.kb-stitch-app .ob2-invite .ob-primary {
  width: 100%;
}

body.kb-stitch-app .ob2-ghost,
body.kb-stitch-app .kb-tour-ghost {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
  background: transparent;
  color: var(--kb-text);
  font-size: 14.5px;
  font-weight: 800;
}

/* ── Meeny's tour: a spotlight on the real button, a speech bubble, and sample data ── */
.kb-tour {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  --kb-text: #f5eaf3;
  --kb-muted: #c9b5c7;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
}

.kb-tour-block {
  position: fixed;
  pointer-events: auto;
  background: transparent;
}

.kb-tour.no-target .kb-tour-block[data-side="top"] {
  background: rgba(10, 5, 12, .76);
}

.kb-tour-hole {
  position: fixed;
  box-shadow: 0 0 0 2px rgba(244, 174, 255, .95), 0 0 0 4000px rgba(10, 5, 12, .76);
  transition: left .55s cubic-bezier(.65, 0, .35, 1), top .55s cubic-bezier(.65, 0, .35, 1), width .55s cubic-bezier(.65, 0, .35, 1), height .55s cubic-bezier(.65, 0, .35, 1), border-radius .55s ease;
}

.kb-tour.no-target .kb-tour-hole {
  opacity: 0;
}

.kb-tour-ring {
  position: absolute;
  inset: -7px;
  border: 2px solid rgba(244, 174, 255, .55);
  border-radius: inherit;
  animation: kbTourRing 1.6s ease-out infinite;
}

.kb-tour-hand {
  position: fixed;
  display: none;
  width: 30px;
  height: 30px;
  color: #ffffff;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .5));
  animation: kbTourTap 1s ease-in-out infinite;
}

.kb-tour-hand svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kb-tour.is-tap:not(.is-moving) .kb-tour-hand {
  display: block;
}

.kb-tour-bar {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.kb-tour-badge,
.kb-tour-skip {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
}

.kb-tour-badge {
  border: 1px solid rgba(244, 174, 255, .45);
  background: #2b1a30;
  color: #fde6ff;
}

.kb-tour-badge .kb-ui-glyph {
  width: 14px;
  height: 14px;
}

.kb-tour-skip {
  border: 1px solid rgba(255, 255, 255, .2);
  background: #1e1220;
  color: var(--kb-text);
  pointer-events: auto;
}

.kb-tour-bubble {
  position: fixed;
  box-sizing: border-box;
  padding: 16px 18px;
  border: 1px solid rgba(244, 174, 255, .4);
  border-radius: 22px;
  background: #241626;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  color: var(--kb-text);
  pointer-events: auto;
  transition: left .55s cubic-bezier(.34, 1.3, .64, 1), top .55s cubic-bezier(.34, 1.3, .64, 1), opacity .25s ease;
}

.kb-tour.is-moving .kb-tour-bubble,
.kb-tour.is-moving .kb-tour-meeny,
.kb-tour.is-finished .kb-tour-bubble,
.kb-tour.is-finished .kb-tour-meeny,
.kb-tour.is-finished .kb-tour-hole {
  opacity: 0;
  pointer-events: none;
}

.kb-tour-arrow {
  position: absolute;
  width: 16px;
  height: 16px;
  transform: rotate(45deg);
  background: #241626;
}

.kb-tour-bubble[data-side="below"] .kb-tour-arrow { border-left: 1px solid rgba(244, 174, 255, .4); border-top: 1px solid rgba(244, 174, 255, .4); }
.kb-tour-bubble[data-side="above"] .kb-tour-arrow { border-right: 1px solid rgba(244, 174, 255, .4); border-bottom: 1px solid rgba(244, 174, 255, .4); }
.kb-tour-bubble[data-side="right"] .kb-tour-arrow { border-left: 1px solid rgba(244, 174, 255, .4); border-bottom: 1px solid rgba(244, 174, 255, .4); }

.kb-tour-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 18px;
  padding-left: 64px;
}

.kb-tour-dots {
  display: flex;
  gap: 4px;
}

.kb-tour-dots i {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .2);
  transition: width .3s ease, background .3s ease;
}

.kb-tour-dots i.is-done { background: #f4aeff; }
.kb-tour-dots i.is-now { width: 16px; background: #f4aeff; }

.kb-tour-count {
  color: var(--kb-muted);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 700;
}

.kb-tour-bubble h3 {
  margin: 10px 0 0;
  font-family: Manrope, "Hanken Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 800;
}

.kb-tour-bubble p {
  margin: 5px 0 0;
  color: #e9dbe7;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.5;
}

.kb-tour-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 14px;
}

.kb-tour-hint {
  color: #f4aeff;
  font-size: 13.5px;
  font-weight: 800;
}

.kb-tour-next {
  height: 42px;
  padding: 0 22px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #f4aeff, #7bd0ff);
  color: #1a0f1d;
  font-family: Manrope, "Hanken Grotesk", sans-serif;
  font-size: 14.5px;
  font-weight: 800;
}

.kb-tour-meeny {
  position: fixed;
  width: 58px;
  height: 58px;
  transition: left .55s cubic-bezier(.34, 1.3, .64, 1), top .55s cubic-bezier(.34, 1.3, .64, 1), opacity .25s ease;
}

.kb-tour-meeny.is-hop {
  animation: kbTourHop .6s cubic-bezier(.2, .8, .2, 1);
}

.kb-tour-finish {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 5, 12, .8);
  pointer-events: auto;
  animation: obFadeUp .3s ease both;
}

.kb-tour-finish-card {
  position: relative;
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 22px 22px;
  border: 1px solid rgba(244, 174, 255, .4);
  border-radius: 26px;
  background: #241626;
  color: var(--kb-text);
  text-align: center;
}

.kb-tour-finish-card .ob2-finish-art {
  margin-bottom: 0;
}

.kb-tour-finish-card h3 {
  margin: 0;
  font-family: Manrope, "Hanken Grotesk", sans-serif;
  font-size: 25px;
  font-weight: 800;
}

.kb-tour-finish-card p {
  margin: 0 0 8px;
  color: #d8c8d6;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.5;
}

.kb-tour-finish-card .ob-primary {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #f4aeff, #7bd0ff);
  color: #180e18;
  font-size: 16px;
  font-weight: 900;
}

.kb-tour-finish .ob2-confetti i {
  position: absolute;
  top: -24px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  animation: obConfetti 2.4s cubic-bezier(.25, .7, .4, 1) both;
}

/* Desktop: the sample-data badge sits at the bottom so it never covers the top bar. */
@media (min-width: 769px) {
  .kb-tour-bar {
    top: auto;
    bottom: 22px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

@keyframes kbTourRing {
  0% { opacity: .9; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.12); }
}

@keyframes kbTourHop {
  0% { transform: translateY(0); }
  35% { transform: translateY(-16px) rotate(-6deg); }
  70% { transform: translateY(2px); }
  100% { transform: none; }
}

@keyframes kbTourTap {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

@media (prefers-reduced-motion: reduce) {
  .kb-tour-ring,
  .kb-tour-hand,
  .kb-tour-meeny.is-hop,
  .kb-tour-finish .ob2-confetti i {
    animation: none !important;
  }

  .kb-tour-hole,
  .kb-tour-bubble,
  .kb-tour-meeny {
    transition: none !important;
  }
}

.kb-tour-bar {
  transition: opacity .25s ease;
}

.kb-tour.bar-hidden .kb-tour-bar {
  opacity: 0;
}

.kb-tour.bar-hidden .kb-tour-skip {
  pointer-events: none;
}

.kb-tour-actions .kb-tour-skip-inline {
  display: none;
  margin-right: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--kb-muted);
  font-size: 13.5px;
  font-weight: 800;
}

.kb-tour.bar-hidden .kb-tour-skip-inline {
  display: inline-flex;
}

/* Meeny's reply fades in word by word. */
body.kb-stitch-app .mn-msg-body .mn-word {
  display: inline-block;
  animation: mnWordIn .5s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes mnWordIn {
  from { opacity: 0; filter: blur(3px); transform: translateY(3px); }
  to { opacity: 1; filter: none; transform: none; }
}

/* ── Notifications: a panel under the bell on desktop, a bottom sheet on phones ── */
body.kb-stitch-app .kb-notif-bell {
  position: relative;
  width: 42px;
  height: 42px;
  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 .kb-notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  box-sizing: border-box;
  border: 2px solid var(--kb-bg);
  border-radius: 999px;
  background: #fb7185;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1;
}

body.kb-stitch-app .kb-notif-badge[hidden] {
  display: none;
}

body.kb-stitch-app .dashboard-bell {
  position: relative;
}

.kb-notif-layer {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: transparent;
  transition: background .2s ease;
}

.kb-notif-panel {
  position: fixed;
  width: min(400px, calc(100vw - 32px));
  max-height: min(70vh, 620px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--kb-line);
  border-radius: 20px;
  background: var(--kb-panel-solid, #1f1322);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
  color: var(--kb-text);
  opacity: 0;
  transform: translateY(-6px) scale(.98);
  transform-origin: top right;
  transition: opacity .2s ease, transform .22s cubic-bezier(.2, .8, .2, 1);
  outline: none;
}

.kb-notif-layer.is-open .kb-notif-panel {
  opacity: 1;
  transform: none;
}

html.light .kb-notif-panel {
  box-shadow: 0 24px 60px rgba(38, 21, 38, .16);
}

.kb-notif-grip {
  display: none;
}

.kb-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 16px 10px 20px;
  border-bottom: 1px solid var(--kb-line);
}

.kb-notif-head h3 {
  margin: 0;
  font-family: Manrope, "Hanken Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 800;
}

.kb-notif-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kb-notif-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--kb-primary-ink, var(--kb-primary));
  font-size: 13px;
  font-weight: 800;
}

.kb-notif-link .kb-ui-glyph,
.kb-notif-close .kb-ui-glyph {
  width: 16px;
  height: 16px;
}

.kb-notif-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--kb-line);
  border-radius: 10px;
  background: transparent;
  color: var(--kb-muted);
}

.kb-notif-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
}

.kb-notif-item {
  position: relative;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--kb-text);
  text-align: left;
  --notif-tone: var(--kb-primary);
}

button.kb-notif-item:hover {
  background: rgba(var(--kb-primary-rgb), .07);
}

.kb-notif-item.is-unread {
  background: rgba(var(--kb-primary-rgb), .06);
}

.kb-notif-item.is-warm { --notif-tone: #fb923c; }
.kb-notif-item.is-danger { --notif-tone: #fb7185; }
.kb-notif-item.is-good { --notif-tone: #2dd4bf; }
.kb-notif-item.is-muted { --notif-tone: #9d8a9c; }

.kb-notif-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--notif-tone);
  background: color-mix(in srgb, var(--notif-tone) 16%, transparent);
}

.kb-notif-icon .kb-ui-glyph {
  width: 19px;
  height: 19px;
}

.kb-notif-icon.is-art > :is(img, svg) {
  width: 32px;
  height: 32px;
}

.kb-notif-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding-right: 14px;
}

.kb-notif-text strong {
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.35;
}

.kb-notif-text span {
  color: var(--kb-muted);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
}

.kb-notif-text small {
  margin-top: 2px;
  color: #9d8a9c;
  font-size: 12px;
  font-weight: 700;
}

.kb-notif-dot {
  position: absolute;
  top: 16px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--kb-primary);
}

.kb-notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 30px 24px 34px;
  text-align: center;
}

.kb-notif-empty strong {
  font-size: 15.5px;
  font-weight: 800;
}

.kb-notif-empty p,
.kb-notif-empty-text {
  margin: 0;
  color: var(--kb-muted);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
}

.kb-notif-empty-text {
  padding: 24px;
  text-align: center;
}

.kb-notif-skeleton {
  display: flex;
  gap: 12px;
  padding: 12px;
}

.kb-notif-skeleton i,
.kb-notif-skeleton b {
  display: block;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .1), rgba(255, 255, 255, .05));
  background-size: 200% 100%;
  animation: kbNotifShimmer 1.2s linear infinite;
}

html.light .kb-notif-skeleton i,
html.light .kb-notif-skeleton b {
  background-image: linear-gradient(90deg, rgba(38, 21, 38, .05), rgba(38, 21, 38, .1), rgba(38, 21, 38, .05));
}

.kb-notif-skeleton i { width: 38px; height: 38px; flex: 0 0 auto; }
.kb-notif-skeleton span { flex: 1; display: grid; gap: 8px; }
.kb-notif-skeleton b { height: 12px; }
.kb-notif-skeleton b + b { width: 70%; }

@keyframes kbNotifShimmer {
  to { background-position: -200% 0; }
}

@media (max-width: 768px) {
  .kb-notif-layer.is-open {
    background: rgba(8, 4, 10, .5);
  }

  .kb-notif-panel {
    top: auto !important;
    right: 0 !important;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 82dvh;
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transform-origin: bottom center;
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .2s ease;
  }

  .kb-notif-grip {
    display: block;
    width: 44px;
    height: 5px;
    margin: 10px auto 0;
    border-radius: 3px;
    background: rgba(255, 255, 255, .2);
  }

  html.light .kb-notif-grip {
    background: rgba(38, 21, 38, .18);
  }
}

/* Owner announcement composer */
body.kb-stitch-app .kb-announce h3 {
  margin: 0;
  color: var(--kb-text);
  font-family: Manrope, "Hanken Grotesk", sans-serif;
  font-size: 20px;
  font-weight: 800;
}

body.kb-stitch-app .kb-announce-note {
  margin: 4px 0 14px;
  color: var(--kb-muted);
  font-size: 13.5px;
  font-weight: 600;
}

body.kb-stitch-app .kb-announce-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 800;
}

body.kb-stitch-app .kb-announce-field input,
body.kb-stitch-app .kb-announce-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--kb-line);
  border-radius: 12px;
  background: var(--kb-panel);
  color: var(--kb-text);
  font-size: 15px;
  font-weight: 600;
  resize: vertical;
}

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

body.kb-stitch-app .kb-announce-level {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--kb-line);
  border-radius: 12px;
}

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

body.kb-stitch-app .kb-announce-level button.is-active {
  background: rgba(var(--kb-primary-rgb), .16);
  color: var(--kb-text);
}

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

body.kb-stitch-app .kb-announce-preview {
  margin-bottom: 14px;
  padding: 4px;
  border: 1px dashed var(--kb-line);
  border-radius: 16px;
}

body.kb-stitch-app .kb-announce-history {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--kb-line);
}

body.kb-stitch-app .kb-announce-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--kb-line);
}

body.kb-stitch-app .kb-announce-item strong {
  display: block;
  color: var(--kb-text);
  font-size: 14px;
  font-weight: 800;
}

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

@media (max-width: 640px) {
  body.kb-stitch-app .kb-announce-row {
    grid-template-columns: 1fr;
  }
}

body.kb-stitch-app .dashboard-bell .kb-notif-badge {
  top: -4px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 9.5px;
}

/* ── Phone layouts from the prototype: profile groups, back buttons, automation sheet ── */
body.kb-stitch-app .kb-page-back {
  display: none;
}

@media (max-width: 768px) {
  body.kb-stitch-app .kb-page-head.has-back {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "back title actions"
      "tools tools tools";
  }

  body.kb-stitch-app .kb-page-head.has-back.is-title-only {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "back title";
  }

  body.kb-stitch-app .kb-page-back {
    grid-area: back;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--kb-line);
    border-radius: 50%;
    background: var(--kb-panel);
    color: var(--kb-text);
  }

  body.kb-stitch-app .kb-page-back svg {
    width: 20px;
    height: 20px;
  }

  /* Profile */
  body.kb-stitch-app .kb-profile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 20px;
  }

  body.kb-stitch-app .kb-profile-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--kb-line);
    border-radius: 22px;
    background: linear-gradient(160deg, rgba(var(--kb-primary-rgb), .16), rgba(123, 208, 255, .06)), var(--kb-panel);
  }

  body.kb-stitch-app .kb-profile-avatar {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #f4aeff, #7bd0ff);
    color: #1a0f1d;
    font-family: Manrope, "Hanken Grotesk", sans-serif;
    font-size: 22px;
    font-weight: 800;
  }

  body.kb-stitch-app .kb-profile-id {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
  }

  body.kb-stitch-app .kb-profile-id strong {
    overflow: hidden;
    color: var(--kb-text);
    font-family: Manrope, "Hanken Grotesk", sans-serif;
    font-size: 19px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.kb-stitch-app .kb-profile-id small {
    color: var(--kb-muted);
    font-size: 13px;
    font-weight: 700;
  }

  body.kb-stitch-app .kb-profile-id .kb-profile-streak {
    margin-top: 6px;
  }

  body.kb-stitch-app .kb-profile-group-label {
    margin: 10px 6px 0;
    color: var(--kb-muted);
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  body.kb-stitch-app .kb-profile-group {
    overflow: hidden;
    border: 1px solid var(--kb-line);
    border-radius: 18px;
    background: var(--kb-panel);
  }

  body.kb-stitch-app .kb-prow {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    border: 0;
    border-bottom: 1px solid var(--kb-line);
    background: transparent;
    color: var(--kb-text);
    text-align: left;
  }

  body.kb-stitch-app .kb-prow:last-child {
    border-bottom: 0;
  }

  body.kb-stitch-app .kb-prow:active {
    background: rgba(var(--kb-primary-rgb), .08);
  }

  body.kb-stitch-app .kb-prow-icon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--kb-primary-ink, var(--kb-primary));
    background: rgba(var(--kb-primary-rgb), .12);
  }

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

  body.kb-stitch-app .kb-prow-label {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 800;
  }

  body.kb-stitch-app .kb-prow-value {
    color: var(--kb-muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
  }

  body.kb-stitch-app .kb-prow-badge {
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(var(--kb-primary-rgb), .16);
    color: var(--kb-primary-ink, var(--kb-primary));
    font-size: 12px;
    font-weight: 800;
  }

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

  body.kb-stitch-app .kb-prow-chevron svg {
    width: 16px;
    height: 16px;
  }

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

  body.kb-stitch-app .kb-prow.is-danger .kb-prow-icon {
    color: var(--kb-expense);
    background: rgba(251, 113, 133, .12);
  }

  /* Automation: list first, the form opens as a bottom sheet */
  body.kb-stitch-app .automation-grid {
    display: flex !important;
    flex-direction: column;
  }

  body.kb-stitch-app .automation-form-panel {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 82;
    max-height: 88dvh;
    overflow-y: auto;
    padding: 0 18px calc(18px + env(safe-area-inset-bottom)) !important;
    border-radius: 24px 24px 0 0 !important;
    transform: translateY(105%);
    transition: transform .32s cubic-bezier(.2, .8, .2, 1);
    visibility: hidden;
  }

  body.kb-automation-sheet-open .automation-form-panel {
    transform: none;
    visibility: visible;
  }

  body.kb-stitch-app .automation-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 81;
    background: rgba(8, 4, 10, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }

  body.kb-automation-sheet-open .automation-sheet-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.kb-stitch-app .automation-sheet-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin: 0 -18px 12px;
    padding: 10px 18px 12px;
    background: inherit;
  }

  body.kb-stitch-app .automation-sheet-grip {
    grid-column: 1 / -1;
    justify-self: center;
    width: 44px;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .2);
  }

  html.light body.kb-stitch-app .automation-sheet-grip {
    background: rgba(38, 21, 38, .18);
  }

  body.kb-stitch-app .automation-sheet-head h3 {
    margin: 0;
    color: var(--kb-text);
    font-family: Manrope, "Hanken Grotesk", sans-serif;
    font-size: 19px;
    font-weight: 800;
  }

  body.kb-stitch-app .automation-sheet-close {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--kb-line);
    border-radius: 10px;
    background: transparent;
    color: var(--kb-muted);
  }

  body.kb-stitch-app .automation-sheet-delete {
    margin-top: 6px;
    padding: 10px;
    border: 0;
    background: transparent;
    color: var(--kb-expense);
    font-size: 14px;
    font-weight: 800;
  }

  body.kb-stitch-app .automation-card.is-mobile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px 0 0 !important;
  }

  body.kb-stitch-app .automation-card.is-off {
    opacity: .6;
  }

  body.kb-stitch-app .automation-card-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0 14px 14px;
    border: 0;
    background: transparent;
    color: var(--kb-text);
    text-align: left;
  }

  body.kb-stitch-app .automation-card-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: var(--chip-color);
    background: color-mix(in srgb, var(--chip-color) 16%, transparent);
  }

  body.kb-stitch-app .automation-card-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  /* Up to two lines each: "Sewa kontrakan" and "Tiap tanggal 5 · Tagihan & Utilitas" stay readable
     next to the amount and the switch. */
  body.kb-stitch-app .automation-card-text strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  body.kb-stitch-app .automation-card-text small {
    display: -webkit-box;
    overflow: hidden;
    color: var(--kb-muted);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  body.kb-stitch-app .automation-card-amount {
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
  }

  body.kb-stitch-app .automation-card-amount.is-income {
    color: var(--kb-income);
  }

  body.kb-stitch-app .automation-new-mobile {
    width: 100%;
    height: 52px;
    margin-top: 12px;
    border: 1.5px dashed rgba(var(--kb-primary-rgb), .5);
    border-radius: 16px;
    background: transparent;
    color: var(--kb-primary-ink, var(--kb-primary));
    font-size: 14.5px;
    font-weight: 800;
  }

  /* Home: a warmer "safe to spend" card and the recent list in one card */
  body.kb-stitch-app[data-page="dashboard"] .dashboard-balance-card {
    border-color: rgba(45, 212, 191, .35) !important;
    background: linear-gradient(160deg, rgba(var(--kb-primary-rgb), .18), rgba(123, 208, 255, .07)), var(--kb-panel) !important;
  }

  body.kb-stitch-app .dashboard-recent-card .dashboard-recent-list {
    gap: 0;
    padding: 2px 14px;
    border: 1px solid var(--kb-line);
    border-radius: 18px;
    background: var(--kb-panel);
  }

  body.kb-stitch-app .dashboard-recent-card .transaction-row,
  html.light body.kb-stitch-app .dashboard-recent-card .transaction-row {
    min-height: 62px;
    padding: 10px 0;
    border: 0;
    border-bottom: 1px solid var(--kb-line);
    border-radius: 0;
    background: transparent;
  }

  body.kb-stitch-app .dashboard-recent-card .transaction-row:last-child {
    border-bottom: 0;
  }
}

/* An on/off switch (automation cards). */
body.kb-stitch-app .kb-switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--kb-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  transition: background .2s ease, border-color .2s ease;
}

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

body.kb-stitch-app .kb-switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}

body.kb-stitch-app .kb-switch.is-on {
  border-color: transparent;
  background: var(--kb-income);
}

body.kb-stitch-app .kb-switch.is-on i {
  transform: translateX(18px);
}

@media (max-width: 768px) {
  body.kb-stitch-app .automation-list-panel {
    padding: 14px !important;
  }

  body.kb-stitch-app .automation-card-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }
}

/* The automation sheet parts exist only on phones; on desktop the form stays an inline panel. */
@media (min-width: 769px) {
  body.kb-stitch-app .automation-sheet-backdrop,
  body.kb-stitch-app .automation-sheet-head,
  body.kb-stitch-app .automation-new-mobile,
  body.kb-stitch-app .automation-sheet-delete {
    display: none !important;
  }
}

/* Upgrade page: the back button (phones only) sits beside the Plus chip. */
body.kb-stitch-app .upgrade-hero-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

/* Phone fixes for the redesigned pages. */
@media (max-width: 768px) {
  /* The shared icons carry no stroke of their own. */
  body.kb-stitch-app .kb-page-back svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body.kb-stitch-app .trx-head-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "back title actions"
      "period period period";
  }

  body.kb-stitch-app .trx-head-row .kb-page-back {
    grid-area: back;
  }

  /* Home: the recent list hugs its rows instead of stretching down to the nav. */
  body.kb-stitch-app[data-page="dashboard"] .dashboard-recent-card {
    margin-bottom: 10px;
  }

  body.kb-stitch-app[data-page="dashboard"] .dashboard-recent-card .dashboard-recent-list {
    flex: 0 1 auto;
    align-content: start;
  }

  /* Planning cards: no glow blob, and no empty bar before a budget or goal exists. */
  body.kb-stitch-app .progress-brief-card::after {
    display: none;
  }

  body.kb-stitch-app .progress-brief-card.is-empty .progress-meter {
    display: none;
  }

  /* Analytics: the heading sits on the card edge, so the first letter must not be clipped. */
}

/* ===== Phone mockups (canvas section 4): sheets and forms ===== */
/* Phone-only parts of shared forms stay out of the desktop dialogs. */
body.kb-stitch-app .trx-cat-picker,
body.kb-stitch-app .trx-date-chips,
body.kb-stitch-app .trx-tags-field {
  display: none;
}

@media (max-width: 768px) {
  /* Every dialog is a sheet stuck to the bottom edge, with a grip, over a dimmed (not hidden) page. */
  body.kb-stitch-app .modal-backdrop,
  body.kb-stitch-app #mobile-panel-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
    background: rgba(8, 4, 10, .62) !important;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }

  body.kb-stitch-app .modal-backdrop > div,
  body.kb-stitch-app #mobile-panel-overlay > div {
    position: relative;
    margin: 0 !important;
    border-radius: 26px 26px 0 0 !important;
    border-top: 1px solid rgba(var(--kb-primary-rgb), .25) !important;
  }

  body.kb-stitch-app .modal-backdrop > div:not(.trx-sheet),
  body.kb-stitch-app #mobile-panel-overlay > div {
    padding-top: 30px !important;
  }

  body.kb-stitch-app .modal-backdrop > div:not(.trx-sheet)::before,
  body.kb-stitch-app #mobile-panel-overlay > div::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 50%;
    width: 44px;
    height: 5px;
    margin-left: -22px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .2);
  }

  html.light body.kb-stitch-app .modal-backdrop > div:not(.trx-sheet)::before,
  html.light body.kb-stitch-app #mobile-panel-overlay > div::before {
    background: rgba(38, 21, 38, .18);
  }

  /* The grab strip over the grip line: drag it down and the sheet follows (KBUI.enableSheetDrag).
     touch-action: none keeps the browser from turning the drag into a scroll. It covers the middle
     only, so close buttons in the top corners stay tappable. */
  body.kb-stitch-app .kb-sheet-grab[hidden] {
    display: block !important;
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    z-index: 3;
    height: var(--kb-sheet-grab, 28px);
    margin: 0 !important;
    touch-action: none;
    cursor: grab;
  }

  body.kb-stitch-app .kb-sheet-grab:active { cursor: grabbing; }
  body.kb-stitch-app .mobile-ai-panel { position: relative; }
  body.kb-stitch-app .kb-notif-panel { --kb-sheet-grab: 22px; }

  /* Manual entry: type, a large amount, category tiles, note, date chips, tags, one save button. */
  body.kb-stitch-app #modal-transaction .flex.bg-gray-100 #type-expense-btn {
    order: -1;
  }

  body.kb-stitch-app #modal-transaction .space-y-4 > div:first-child { order: 1; }
  body.kb-stitch-app #modal-transaction .trx-cat-field { order: 2; }
  body.kb-stitch-app #modal-transaction .trx-desc-field { order: 3; }
  body.kb-stitch-app #modal-transaction .trx-date-field { order: 4; }
  body.kb-stitch-app #modal-transaction .trx-tags-field { order: 5; display: block; }

  body.kb-stitch-app #modal-transaction .space-y-4 > div:first-child > label {
    text-align: center;
  }

  body.kb-stitch-app #modal-transaction .space-y-4 > div:first-child .relative {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    width: min(240px, 100%);
    margin: 0 auto;
    border-bottom: 2px solid var(--kb-primary);
  }

  body.kb-stitch-app #modal-transaction #trx-currency-prefix {
    position: static;
    transform: none;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    font-size: 16px;
    font-weight: 700;
  }

  body.kb-stitch-app #modal-transaction #trx-amount {
    width: 100%;
    min-width: 0;
    padding: 2px 0 6px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 34px !important;
    line-height: 1.1;
    text-align: center;
  }

  body.kb-stitch-app #modal-transaction .trx-cat-field .kb-select,
  body.kb-stitch-app #modal-transaction .trx-date-field .kb-select {
    display: none !important;
  }

  body.kb-stitch-app .trx-cat-picker {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    max-height: 256px;
    overflow-y: auto;
    padding: 2px;
  }

  body.kb-stitch-app .trx-cat-tile {
    min-width: 0;
    min-height: 82px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 4px;
    border: 1px solid var(--kb-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .04);
    color: var(--kb-text);
  }

  body.kb-stitch-app .trx-cat-tile.is-active {
    border: 2px solid var(--kb-primary);
    background: rgba(var(--kb-primary-rgb), .1);
  }

  body.kb-stitch-app .trx-cat-tile .kb-tile {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: 17px;
  }

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

  /* Two lines, so "Makanan & Minuman" and "Lainnya (Pengeluaran)" are read in full. */
  body.kb-stitch-app .trx-cat-tile-name {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

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

  body.kb-stitch-app #modal-transaction .trx-cancel-btn {
    display: none;
  }
}

/* Pill choices: the date chips on the phone form and the quick amounts in Tambah dana. */
body.kb-stitch-app .trx-date-chip {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid var(--kb-line-strong, var(--kb-line));
  border-radius: 999px;
  background: transparent;
  color: var(--kb-text);
  font-size: 13px;
  font-weight: 800;
}

body.kb-stitch-app .trx-date-chip svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.kb-stitch-app .trx-date-chip.is-active {
  border-color: var(--kb-primary);
  background: var(--kb-primary);
  color: #1a0f1d;
}

/* Goals: phone summary and compact card foot; desktop keeps amounts above a full-width button. */
body.kb-stitch-app .kb-goal-summary,
body.kb-stitch-app .kb-goal-amounts-short {
  display: none;
}

body.kb-stitch-app .kb-goal-foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.kb-stitch-app .kb-goal-pace-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(var(--kb-primary-rgb), .22);
  border-radius: 16px;
  background: rgba(var(--kb-primary-rgb), .08);
  color: var(--kb-text);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.4;
}

body.kb-stitch-app .kb-goal-pace-hint[hidden] {
  display: none;
}

body.kb-stitch-app .kb-goal-pace-hint b {
  color: var(--kb-primary-ink, var(--kb-primary));
}

body.kb-stitch-app .kb-goal-pace-art {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
}

/* Tambah dana sheet (a centred dialog on desktop). */
body.kb-stitch-app .kb-fund-goal {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--kb-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .04);
}

body.kb-stitch-app .kb-fund-goal b {
  display: block;
  color: var(--kb-text);
  font-size: 15px;
}

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

body.kb-stitch-app .kb-fund-amount {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  width: min(260px, 100%);
  margin: 18px auto 0;
  border-bottom: 2px solid var(--kb-primary);
}

body.kb-stitch-app .kb-fund-prefix {
  color: var(--kb-muted);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  font-weight: 700;
}

body.kb-stitch-app .kb-fund-amount input {
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 2px 0 8px !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--kb-text);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-size: 34px;
  font-weight: 700;
  text-align: center;
}

body.kb-stitch-app .kb-fund-quick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

body.kb-stitch-app .kb-fund-preview {
  display: grid;
  gap: 9px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--kb-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .04);
}

body.kb-stitch-app .kb-fund-preview-top {
  display: flex;
  justify-content: space-between;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 800;
}

body.kb-stitch-app .kb-fund-preview-top b {
  color: var(--kb-income);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

body.kb-stitch-app .kb-fund-bar {
  display: flex;
}

body.kb-stitch-app .kb-fund-bar > i.is-added {
  border-radius: 0 999px 999px 0;
  background: var(--kb-income);
}

body.kb-stitch-app .kb-fund-preview-amount {
  color: var(--kb-text);
  font-size: 13.5px;
  font-weight: 700;
}

body.kb-stitch-app .kb-fund-preview-amount i,
body.kb-stitch-app .kb-goal-amounts-short i {
  color: var(--kb-muted);
  font-style: normal;
}

body.kb-stitch-app #modal-goal-fund .trx-sheet-actions {
  margin-top: 18px;
}

@media (max-width: 768px) {
  body.kb-stitch-app .kb-goal-summary {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
    padding: 14px 18px;
    border: 1px solid rgba(var(--kb-primary-rgb), .3);
    border-radius: 22px;
    background: linear-gradient(160deg, rgba(var(--kb-primary-rgb), .16), rgba(var(--kb-accent-rgb), .07)), var(--kb-panel);
  }

  body.kb-stitch-app .kb-goal-summary-label {
    color: var(--kb-text);
    font-size: 13px;
    font-weight: 800;
  }

  body.kb-stitch-app .kb-goal-summary-value {
    color: var(--kb-text);
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    font-size: 26px;
    line-height: 1.1;
  }

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

  body.kb-stitch-app .kb-goal-card {
    gap: 10px;
    padding: 14px 16px;
    border-radius: 20px;
  }

  body.kb-stitch-app .kb-goal-foot {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  body.kb-stitch-app .kb-goal-foot .kb-goal-amounts {
    flex: 1;
    min-width: 0;
    justify-content: flex-start;
    gap: 6px;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
  }

  body.kb-stitch-app .kb-goal-amounts-full {
    display: none;
  }

  body.kb-stitch-app .kb-goal-amounts-short {
    display: inline;
    color: var(--kb-text);
    white-space: nowrap;
  }

  /* Two tidy lines beside "Tambah dana": the amounts, then the percentage (it used to wrap mid-way,
     "Rp9,2jt /" over "Rp15jt"). */
  body.kb-stitch-app .kb-goal-foot .kb-goal-amounts {
    display: grid;
    gap: 1px;
    justify-content: start;
  }

  body.kb-stitch-app .kb-goal-foot .kb-goal-amounts b {
    color: var(--kb-muted);
    font-size: 11.5px;
  }

  body.kb-stitch-app .kb-goal-foot .kb-goal-add {
    width: auto;
    min-height: 34px;
    flex: 0 0 auto;
    padding: 0 12px !important;
    border-radius: 999px !important;
    border-color: rgba(var(--kb-primary-rgb), .4) !important;
    background: rgba(var(--kb-primary-rgb), .08) !important;
    color: var(--kb-primary-ink, var(--kb-primary)) !important;
    font-size: 13px;
  }

  body.kb-stitch-app .kb-goal-card.is-reached > .kb-bar,
  body.kb-stitch-app .kb-goal-card.is-reached > .kb-goal-foot {
    display: none;
  }

  body.kb-stitch-app .kb-goal-card.is-reached {
    background: linear-gradient(160deg, color-mix(in srgb, var(--kb-income) 10%, transparent), rgba(255, 255, 255, .03)), var(--kb-panel);
  }

  /* Goal form: one scrolling row of icons and colours, the two amounts side by side. */
  body.kb-stitch-app #modal-goal .kb-icon-picker,
  body.kb-stitch-app #modal-goal .kb-swatches {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    margin: 0 -4px;
    padding: 4px;
    scrollbar-width: none;
  }

  body.kb-stitch-app #modal-goal .kb-icon-choice {
    flex: 0 0 44px;
  }

  body.kb-stitch-app #modal-goal .kb-icon-custom {
    flex: 0 0 104px;
  }

  body.kb-stitch-app #modal-goal .kb-swatch {
    flex: 0 0 36px;
  }

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

  body.kb-stitch-app .kb-goal-amount-pair > * {
    margin: 0 !important;
  }

  body.kb-stitch-app #modal-goal .goal-cancel-btn {
    display: none;
  }
}

/* Atur anggaran: tiles and a "/ bulan" suffix on phones, and what the new limit leaves. */
body.kb-stitch-app .sb-amount-suffix {
  display: none;
}

body.kb-stitch-app .sb-info {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--kb-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .04);
}

body.kb-stitch-app .sb-info[hidden] {
  display: none;
}

body.kb-stitch-app .sb-info-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 800;
}

body.kb-stitch-app .sb-info-top b {
  color: var(--kb-text);
}

body.kb-stitch-app .sb-info-note {
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 600;
}

body.kb-stitch-app .kb-bar.is-warn > i {
  background: #fb923c;
}

@media (max-width: 768px) {
  body.kb-stitch-app #modal-set-budget .sb-cat-field .kb-select {
    display: none !important;
  }

  body.kb-stitch-app .sb-amount-wrap {
    position: relative;
  }

  body.kb-stitch-app .sb-amount-wrap input {
    padding-right: 84px !important;
  }

  body.kb-stitch-app .sb-amount-suffix {
    display: block;
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    color: var(--kb-muted);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    pointer-events: none;
  }

  body.kb-stitch-app #modal-set-budget .sb-cancel-btn {
    display: none;
  }
}

/* Kategori: preview and type buttons (phones), Meeny beside the default-category link. */
body.kb-stitch-app .kb-cat-preview,
body.kb-stitch-app .kb-cat-type-seg,
body.kb-stitch-app .kb-cat-footer-art,
body.kb-stitch-app .automation-free-note {
  display: none;
}

body.kb-stitch-app .automation-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 10px 0 4px;
  text-align: center;
}

body.kb-stitch-app .automation-empty-art {
  width: 84px;
  height: 84px;
}

body.kb-stitch-app .automation-empty h4 {
  margin: 0;
  color: var(--kb-text);
  font-family: Manrope, "Hanken Grotesk", sans-serif;
  font-size: 19px;
  font-weight: 800;
}

body.kb-stitch-app .automation-empty p {
  max-width: 310px;
  margin: 0;
  color: var(--kb-muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

body.kb-stitch-app .automation-examples {
  width: 100%;
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

body.kb-stitch-app .automation-examples li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 14px;
  border: 1.5px dashed var(--kb-line-strong, var(--kb-line));
  border-radius: 18px;
  opacity: .78;
}

body.kb-stitch-app .automation-examples .kb-tile {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: color-mix(in srgb, var(--trx-color) 72%, #fff);
}

body.kb-stitch-app .automation-examples .kb-tile svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.kb-stitch-app .automation-examples li > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}

body.kb-stitch-app .automation-examples b {
  display: block;
  color: var(--kb-text);
  font-size: 14px;
}

body.kb-stitch-app .automation-examples small {
  display: block;
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 600;
}

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

body.kb-stitch-app .automation-examples .num.is-income {
  color: var(--kb-income);
}

@media (max-width: 768px) {
  /* Category form: preview on top, then name, type, icon, colour. */
  body.kb-stitch-app .kb-cat-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--kb-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .04);
  }

  body.kb-stitch-app .kb-cat-preview b {
    display: block;
    color: var(--kb-text);
    font-size: 15.5px;
  }

  body.kb-stitch-app .kb-cat-preview small {
    display: block;
    color: var(--kb-muted);
    font-size: 12.5px;
    font-weight: 700;
  }

  body.kb-stitch-app #modal-category .space-y-4 {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  body.kb-stitch-app #modal-category .space-y-4 > * {
    margin: 0 !important;
  }

  body.kb-stitch-app #modal-category .cat-name-field { order: 1; }
  body.kb-stitch-app #modal-category .cat-type-field { order: 2; }
  body.kb-stitch-app #modal-category .cat-icon-field { order: 3; }
  body.kb-stitch-app #modal-category .cat-color-field { order: 4; }

  body.kb-stitch-app #modal-category .cat-type-field .kb-select {
    display: none !important;
  }

  body.kb-stitch-app .kb-cat-type-seg {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--kb-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .05);
  }

  body.kb-stitch-app .kb-cat-type-seg button {
    flex: 1 1 0;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--kb-muted);
    font-size: 13.5px;
    font-weight: 800;
  }

  body.kb-stitch-app .kb-cat-type-seg button.is-active {
    background: var(--kb-primary);
    color: #1a0f1d;
  }

  body.kb-stitch-app #modal-category .kb-icon-picker {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  body.kb-stitch-app #modal-category .kb-swatches {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -4px;
    padding: 4px;
    scrollbar-width: none;
  }

  body.kb-stitch-app #modal-category .kb-swatch {
    flex: 0 0 36px;
  }

  /* Category page footer: one card with Meeny. */
  body.kb-stitch-app .kb-cat-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--kb-line);
    border-radius: 20px;
    background: var(--kb-panel);
    text-align: left;
  }

  body.kb-stitch-app .kb-cat-footer-art {
    display: block;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
  }

  body.kb-stitch-app .kb-cat-footer p {
    order: 2;
    flex: 1;
    line-height: 1.4;
  }

  body.kb-stitch-app .kb-cat-footer .kb-text-link {
    order: 3;
    flex: 0 0 auto;
    min-height: 34px;
    max-width: 120px;
    padding: 6px 12px;
    border: 1px solid rgba(var(--kb-primary-rgb), .4);
    border-radius: 999px;
    font-size: 12.5px;
    line-height: 1.2;
  }

  /* Empty automation list: no panel around it, one primary button, the Free limit under it. */
  body.kb-stitch-app .automation-list-panel.is-empty {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.kb-stitch-app .automation-list-panel.is-empty::after {
    display: none;
  }

  body.kb-stitch-app .automation-list-panel.is-empty > .flex:first-child {
    display: none !important;
  }

  body.kb-stitch-app .automation-list-panel.is-empty .automation-new-mobile {
    height: 54px;
    margin-top: 16px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent));
    color: #1a0f1d;
    font-family: Manrope, "Hanken Grotesk", sans-serif;
    font-size: 15.5px;
  }

  body.kb-stitch-app .automation-list-panel.is-empty .automation-free-note {
    display: block;
    margin: 10px 0 0;
    color: var(--kb-muted);
    font-size: 12.5px;
    font-weight: 700;
    text-align: center;
  }

  body.kb-stitch-app .kb-content-canvas:has(.automation-list-panel.is-empty) .kb-page-note {
    display: none;
  }
}

/* Profile sheets (Akun, Tampilan, Tanggal gajian, Privasi, Ekspor). */
body.kb-stitch-app .kb-sheet-stack {
  display: grid;
  gap: 16px;
}

body.kb-stitch-app .kb-sheet-sub {
  margin: -8px 0 14px;
  color: var(--kb-muted);
  font-size: 13.5px;
  font-weight: 600;
}

body.kb-stitch-app .kb-sheet-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

body.kb-stitch-app .kb-sheet-group > legend,
body.kb-stitch-app .kb-sheet-field > span:first-child {
  margin-bottom: 8px;
  padding: 0;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 800;
}

body.kb-stitch-app .kb-sheet-field {
  display: grid;
}

body.kb-stitch-app .kb-sheet-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--kb-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .05);
}

body.kb-stitch-app .kb-sheet-seg button {
  flex: 1 1 0;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--kb-muted);
  font-size: 14px;
  font-weight: 800;
}

body.kb-stitch-app .kb-sheet-seg button.is-active {
  background: var(--kb-primary);
  color: #1a0f1d;
}

body.kb-stitch-app :is(.kb-sheet-seg, .kb-account-card, .kb-sheet-card-title, .kb-sheet-rows, .kb-sheet-link, .kb-sheet-plus, .kb-export-option, .kb-theme-pick-check) .kb-inline-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

body.kb-stitch-app .kb-theme-pick {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--kb-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .03);
  color: var(--kb-text);
  text-align: left;
}

body.kb-stitch-app .kb-theme-pick.is-active {
  border: 2px solid var(--pick);
  background: rgba(255, 255, 255, .06);
}

body.kb-stitch-app .kb-theme-pick-preview {
  display: flex;
  flex-direction: column;
  gap: 5px;
  height: 62px;
  margin-bottom: 6px;
  padding: 8px;
  box-sizing: border-box;
  border-radius: 12px;
  background: #140b14;
}

body.kb-stitch-app .kb-theme-pick-preview i {
  display: block;
  height: 8px;
  width: 70%;
  border-radius: 4px;
  background: var(--pick);
}

body.kb-stitch-app .kb-theme-pick-preview i:nth-child(2) {
  width: 45%;
  height: 6px;
  background: rgba(255, 255, 255, .2);
}

body.kb-stitch-app .kb-theme-pick-preview i:nth-child(3) {
  width: 100%;
  height: 12px;
  margin-top: auto;
  background: linear-gradient(90deg, var(--pick), var(--pick-2));
}

body.kb-stitch-app .kb-theme-pick b {
  font-size: 14px;
}

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

body.kb-stitch-app .kb-theme-pick-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--pick, var(--kb-primary));
  color: #1a0f1d;
}

body.kb-stitch-app .kb-theme-pick-check .kb-inline-icon svg {
  width: 13px;
  height: 13px;
  stroke-width: 3;
}

body.kb-stitch-app .kb-sheet-note {
  margin: 0;
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
}

body.kb-stitch-app .kb-sheet-note.is-left {
  text-align: left;
}

body.kb-stitch-app .kb-account-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--kb-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .04);
}

body.kb-stitch-app .kb-account-card .kb-profile-avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent));
  color: #1a0f1d;
  font-family: Manrope, "Hanken Grotesk", sans-serif;
  font-size: 20px;
  font-weight: 800;
}

body.kb-stitch-app .kb-account-card b {
  display: block;
  color: var(--kb-text);
  font-size: 15.5px;
}

body.kb-stitch-app .kb-account-card small {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

body.kb-stitch-app .kb-inline-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 8px 0 16px;
  border: 1px solid var(--kb-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .04);
}

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

body.kb-stitch-app .kb-inline-field button {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: rgba(var(--kb-primary-rgb), .16);
  color: var(--kb-primary-ink, var(--kb-primary));
  font-size: 13px;
  font-weight: 800;
}

body.kb-stitch-app .kb-sheet-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--kb-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .04);
}

body.kb-stitch-app .kb-sheet-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--kb-text);
  font-size: 15px;
  font-weight: 800;
}

body.kb-stitch-app .kb-sheet-card-title .kb-inline-icon {
  color: var(--kb-primary);
}

body.kb-stitch-app .kb-sheet-card input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--kb-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  color: var(--kb-text);
  font-size: 15px;
}

body.kb-stitch-app .kb-sheet-card .kb-secondary-action {
  min-height: 46px;
  justify-content: center;
}

body.kb-stitch-app .kb-sheet-rows {
  overflow: hidden;
  border: 1px solid var(--kb-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .04);
}

body.kb-stitch-app .kb-sheet-rows button {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--kb-text);
  font-size: 14.5px;
  font-weight: 800;
  text-align: left;
}

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

body.kb-stitch-app .kb-sheet-rows button .kb-inline-icon {
  color: var(--kb-primary);
}

body.kb-stitch-app .kb-sheet-rows button.is-danger,
body.kb-stitch-app .kb-sheet-rows button.is-danger .kb-inline-icon {
  color: var(--kb-expense);
}

body.kb-stitch-app .kb-consent-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--kb-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .04);
  cursor: pointer;
}

body.kb-stitch-app .kb-consent-card > span {
  flex: 1;
}

body.kb-stitch-app .kb-consent-card b {
  display: block;
  color: var(--kb-text);
  font-size: 15px;
}

body.kb-stitch-app .kb-consent-card small {
  display: block;
  margin-top: 4px;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

/* A checkbox drawn as an on/off switch. */
body.kb-stitch-app .kb-switch-input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 28px;
  margin: 0;
  border: 1px solid var(--kb-line) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .14) !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: background .2s ease;
}

body.kb-stitch-app .kb-switch-input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--kb-muted);
  transition: transform .2s ease, background .2s ease;
}

body.kb-stitch-app .kb-switch-input:checked {
  border-color: transparent !important;
  background: var(--kb-income) !important;
}

body.kb-stitch-app .kb-switch-input:checked::after {
  transform: translateX(18px);
  background: #0b2b27;
}

body.kb-stitch-app .kb-switch-input:focus-visible {
  outline: 2px solid var(--kb-primary);
  outline-offset: 2px;
}

html.light body.kb-stitch-app .kb-switch-input:not(:checked) {
  background: rgba(38, 21, 38, .12) !important;
}

body.kb-stitch-app .kb-sheet-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--kb-primary-ink, var(--kb-primary));
  font-size: 13.5px;
  font-weight: 800;
  text-decoration: none;
}

body.kb-stitch-app .kb-sheet-submit {
  width: 100%;
  min-height: 54px;
  justify-content: center;
}

body.kb-stitch-app .kb-export-options {
  display: grid;
  gap: 10px;
}

body.kb-stitch-app .kb-export-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--kb-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .03);
  color: var(--kb-text);
  text-align: left;
}

body.kb-stitch-app .kb-export-option.is-active {
  border: 2px solid var(--kb-primary);
  background: rgba(var(--kb-primary-rgb), .07);
}

body.kb-stitch-app .kb-export-option .kb-tile {
  width: 42px;
  height: 42px;
  color: var(--kb-income);
  --trx-color: var(--kb-income);
}

body.kb-stitch-app .kb-export-option > span:nth-child(2) {
  flex: 1;
}

body.kb-stitch-app .kb-export-option b {
  display: block;
  font-size: 15px;
}

body.kb-stitch-app .kb-export-option small {
  display: block;
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 600;
}

body.kb-stitch-app .kb-export-option .kb-theme-pick-check {
  position: static;
  --pick: var(--kb-primary);
}

body.kb-stitch-app .kb-sheet-plus {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid rgba(var(--kb-primary-rgb), .2);
  border-radius: 16px;
  background: rgba(var(--kb-primary-rgb), .08);
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
}

body.kb-stitch-app .kb-sheet-plus .kb-inline-icon {
  flex: 0 0 auto;
  color: var(--kb-primary);
}

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

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

body.kb-stitch-app .kb-day-grid button {
  height: 40px;
  padding: 0;
  border: 1px solid var(--kb-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  color: var(--kb-text);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 700;
}

body.kb-stitch-app .kb-day-grid button.is-active {
  border-color: var(--kb-primary);
  background: var(--kb-primary);
  color: #1a0f1d;
}

body.kb-stitch-app .kb-day-grid .kb-day-any {
  grid-column: span 4;
  border-style: dashed;
  background: transparent;
  color: var(--kb-muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
}

body.kb-stitch-app .kb-sheet-submit svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Notification groups: unread first under "Baru", the rest under "Sebelumnya". */
body.kb-stitch-app .kb-notif-group {
  margin: 8px 4px 2px;
  color: var(--kb-muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

body.kb-stitch-app .kb-notif-group:first-child {
  margin-top: 0;
}

/* Upgrade on phones: a plain heading, the plan picker instead of three tall cards. */
body.kb-stitch-app .upgrade-picker {
  display: none;
}

@media (max-width: 768px) {
  body.kb-stitch-app .upgrade-hero {
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.kb-stitch-app .upgrade-hero::after {
    display: none;
  }

  body.kb-stitch-app .upgrade-hero .kb-page-title {
    margin: 0;
    font-size: 26px;
  }

  body.kb-stitch-app .upgrade-hero .kb-page-copy {
    margin: 4px 0 0;
    font-size: 13.5px;
  }

  body.kb-stitch-app .upgrade-hero-top .kb-ink {
    display: none !important;
  }

  body.kb-stitch-app .upgrade-picker {
    display: grid;
    gap: 14px;
    margin: 14px 0;
  }

  body.kb-stitch-app #upgrade-plans {
    display: none;
  }

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

  body.kb-stitch-app .upgrade-pick {
    position: relative;
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--kb-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .03);
    color: var(--kb-text);
    text-align: left;
  }

  body.kb-stitch-app .upgrade-pick.is-active {
    border: 2px solid var(--kb-primary);
    background: rgba(var(--kb-primary-rgb), .08);
  }

  body.kb-stitch-app .upgrade-pick-badge {
    position: absolute;
    top: -11px;
    right: 10px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    padding: 0 9px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent));
    color: #1a0f1d;
    font-size: 11.5px;
    font-weight: 800;
  }

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

  body.kb-stitch-app .upgrade-pick strong {
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    font-size: 19px;
  }

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

  body.kb-stitch-app .upgrade-pick small.is-saving {
    color: var(--kb-income);
  }

  body.kb-stitch-app .upgrade-feature-list {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0 4px;
    list-style: none;
  }

  body.kb-stitch-app .upgrade-feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--kb-text);
    font-size: 13.5px;
    font-weight: 700;
  }

  body.kb-stitch-app .upgrade-feature-list .kb-ui-glyph {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    padding: 4px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--kb-income) 16%, transparent);
    color: var(--kb-income);
  }

  body.kb-stitch-app .upgrade-soon {
    border: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, .08);
    color: var(--kb-muted);
    font-family: Manrope, "Hanken Grotesk", sans-serif;
    font-size: 15.5px;
    font-weight: 800;
  }
}

body.kb-stitch-app .kb-export-option.is-locked .kb-tile {
  color: var(--kb-muted);
  --trx-color: var(--kb-muted);
}

body.kb-stitch-app .kb-export-plus {
  flex: 0 0 auto;
  height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent));
  color: #1a0f1d;
  font-size: 12px;
  font-weight: 800;
}

/* Export sheet: report preview, range chips, page switches, Plus extras and format choice. */
body.kb-stitch-app .kb-range-chips {
  display: flex;
  margin-bottom: 10px;
}

body.kb-stitch-app .kb-report-preview {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 16px;
  background: #F8FAFC;
  color: #0F172A;
}

body.kb-stitch-app .kb-report-preview.is-loading {
  display: grid;
  gap: 8px;
  height: 150px;
  padding: 12px;
  box-sizing: border-box;
}

body.kb-stitch-app .kb-report-preview.is-loading i {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, #E2E8F0, #F1F5F9, #E2E8F0);
  background-size: 200% 100%;
  animation: kbReportShimmer 1.2s linear infinite;
}

@keyframes kbReportShimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  body.kb-stitch-app .kb-report-preview.is-loading i { animation: none; }
}

body.kb-stitch-app .kb-report-preview-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: #0F172A;
  color: #FFFFFF;
  font-size: 12px;
}

body.kb-stitch-app .kb-report-preview-band span {
  color: #94A3B8;
  font-weight: 700;
  font-size: 11px;
}

body.kb-stitch-app .kb-report-preview-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  padding: 8px;
}

body.kb-stitch-app .kb-report-preview-kpis span {
  min-width: 0;
  padding: 6px 7px;
  border-radius: 8px;
  background: #EEF2F7;
}

body.kb-stitch-app .kb-report-preview-kpis .is-in { background: #E8FAF4; color: #0F766E; }
body.kb-stitch-app .kb-report-preview-kpis .is-out { background: #FFF1F2; color: #BE123C; }
body.kb-stitch-app .kb-report-preview-kpis .is-balance { background: #EEF2FF; color: #3730A3; }

body.kb-stitch-app .kb-report-preview-kpis small {
  display: block;
  color: #64748B;
  font-size: 9.5px;
  font-weight: 800;
}

body.kb-stitch-app .kb-report-preview-kpis b {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.kb-stitch-app .kb-report-preview-charts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 8px;
}

body.kb-stitch-app .kb-report-parts {
  overflow: hidden;
  border: 1px solid var(--kb-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .04);
}

body.kb-stitch-app .kb-report-part {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 6px 14px;
  cursor: pointer;
}

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

body.kb-stitch-app .kb-report-part-icon {
  flex: 0 0 auto;
  color: var(--kb-primary);
}

body.kb-stitch-app .kb-report-part-icon svg,
body.kb-stitch-app .kb-report-plus-row svg,
body.kb-stitch-app .kb-format-option svg,
body.kb-stitch-app .kb-pdf-file svg,
body.kb-stitch-app .kb-pdf-privacy svg,
body.kb-stitch-app .kb-pdf-actions svg,
body.kb-stitch-app .kb-recap-close svg,
body.kb-stitch-app .kb-recap-actions svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.kb-stitch-app .kb-report-part-text {
  flex: 1;
  min-width: 0;
}

body.kb-stitch-app .kb-report-part-text b {
  display: block;
  color: var(--kb-text);
  font-size: 14px;
}

body.kb-stitch-app .kb-report-part-text em {
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(var(--kb-primary-rgb), .16);
  color: var(--kb-primary-ink, var(--kb-primary));
  font-size: 10.5px;
  font-style: normal;
  font-weight: 800;
}

body.kb-stitch-app .kb-report-part-text small {
  display: block;
  color: var(--kb-muted);
  font-size: 11.5px;
  font-weight: 600;
}

body.kb-stitch-app .kb-report-part-fixed {
  color: var(--kb-muted);
  font-size: 11.5px;
  font-weight: 800;
}

body.kb-stitch-app .kb-report-plus {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid rgba(var(--kb-primary-rgb), .22);
  border-radius: 18px;
  background: rgba(var(--kb-primary-rgb), .07);
}

body.kb-stitch-app .kb-report-plus-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--kb-primary-ink, var(--kb-primary));
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .08em;
}

body.kb-stitch-app .kb-report-plus-head button {
  min-height: 32px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--kb-primary-ink, var(--kb-primary));
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0;
}

body.kb-stitch-app .kb-report-plus-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  color: var(--kb-muted);
}

body.kb-stitch-app .kb-report-plus-row > span:first-child {
  flex: 1;
}

body.kb-stitch-app .kb-report-plus-row b {
  display: block;
  color: var(--kb-text);
  font-size: 13.5px;
}

body.kb-stitch-app .kb-report-plus-row small {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
}

body.kb-stitch-app .kb-format-options {
  display: flex;
  gap: 8px;
}

body.kb-stitch-app .kb-format-option {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  min-height: 78px;
  padding: 9px 10px;
  border: 1px solid var(--kb-line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .03);
  color: var(--kb-text);
  font-size: 13.5px;
  line-height: 1.1;
  text-align: left;
}

body.kb-stitch-app .kb-format-option b,
body.kb-stitch-app .kb-format-option small {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.kb-stitch-app .kb-format-option small {
  color: var(--kb-muted);
  font-size: 11px;
  font-weight: 700;
}

body.kb-stitch-app .kb-format-option .kb-export-plus {
  position: absolute;
  top: 7px;
  right: 7px;
  height: 18px;
  padding: 0 6px;
  font-size: 10px;
}

body.kb-stitch-app .kb-format-option.is-active {
  border: 2px solid var(--kb-primary);
  background: rgba(var(--kb-primary-rgb), .07);
}

body.kb-stitch-app .kb-format-option .kb-tile {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--kb-income);
  --trx-color: var(--kb-income);
}

body.kb-stitch-app .kb-format-option[data-format="pdf"] .kb-tile {
  color: var(--kb-primary);
  --trx-color: var(--kb-primary);
}

body.kb-stitch-app .kb-format-option[data-format="sheets"] .kb-tile {
  color: var(--kb-accent);
  --trx-color: var(--kb-accent);
}

/* PDF report: miniature A4 pages in the export sheet, and the "ready" view with Save and Share. */
body.kb-stitch-app .kb-pdf-pages {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 14px 12px 10px;
  border: 1px solid var(--kb-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .04);
}

body.kb-stitch-app .kb-pdf-thumb {
  flex: 0 1 76px;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
}

body.kb-stitch-app .kb-pdf-thumb small {
  max-width: 100%;
  overflow: hidden;
  color: var(--kb-muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.kb-stitch-app .kb-pdf-paper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.414;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  padding: 9px 7px 6px;
  border-radius: 3px;
  background: #FFFFFF;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
}

body.kb-stitch-app .kb-pdf-paper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #F4AEFF, #7BD0FF);
}

body.kb-stitch-app .kb-pdf-paper > b {
  flex: 0 0 auto;
  display: block;
  width: 58%;
  height: 5px;
  margin-bottom: 2px;
  border-radius: 2px;
  background: #0F172A;
}

body.kb-stitch-app .kb-pdf-paper > i {
  flex: 0 0 auto;
  display: block;
  height: 2.5px;
  border-radius: 2px;
  background: #E2E8F0;
}

body.kb-stitch-app .kb-pdf-paper > i.is-sum { height: 4px; background: #CBD5E1; }
body.kb-stitch-app .kb-pdf-paper > i.is-net { height: 6px; background: #A7F3D0; }

body.kb-stitch-app .kb-pdf-paper-kpis,
body.kb-stitch-app .kb-pdf-paper-boxes {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
}

body.kb-stitch-app .kb-pdf-paper-boxes { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 2px; }

body.kb-stitch-app .kb-pdf-paper-kpis i {
  display: block;
  height: 9px;
  border-top: 2px solid #14B8A6;
  background: #F1F5F9;
}

body.kb-stitch-app .kb-pdf-paper-kpis i:nth-child(2) { border-top-color: #EC4899; }
body.kb-stitch-app .kb-pdf-paper-kpis i:nth-child(3) { border-top-color: #3B82F6; }
body.kb-stitch-app .kb-pdf-paper-kpis i:nth-child(4) { border-top-color: #0F172A; }

body.kb-stitch-app .kb-pdf-paper-boxes i {
  display: block;
  height: 8px;
  border: 1px solid #E2E8F0;
  border-radius: 2px;
}

body.kb-stitch-app .kb-pdf-paper-charts {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  margin: 1px 0;
}

body.kb-stitch-app .kb-pdf-paper-charts svg:first-child { width: 34%; height: auto; }
body.kb-stitch-app .kb-pdf-paper-charts svg:last-child { width: 58%; height: auto; }

body.kb-stitch-app .kb-pdf-paper-cards {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-bottom: 2px;
}

body.kb-stitch-app .kb-pdf-paper-cards i { display: block; height: 14px; border-radius: 2px; background: #CCFBF1; }
body.kb-stitch-app .kb-pdf-paper-cards i.is-pink { background: #FAE8FF; }

body.kb-stitch-app .kb-pdf-paper-bars {
  flex: 0 0 auto;
  display: grid;
  gap: 3px;
  margin: 2px 0;
}

body.kb-stitch-app .kb-pdf-paper-bars i { display: block; height: 3px; border-radius: 2px; background: #10B981; }
body.kb-stitch-app .kb-pdf-paper-bars i.is-warn { background: #F59E0B; }

body.kb-stitch-app .kb-pdf-paper.is-large {
  width: 196px;
  margin: 0 auto;
  padding: 20px 16px 12px;
  gap: 7px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}

body.kb-stitch-app .kb-pdf-paper.is-large::before { height: 5px; }
body.kb-stitch-app .kb-pdf-paper.is-large > b { height: 11px; margin-bottom: 3px; }
body.kb-stitch-app .kb-pdf-paper.is-large > i { height: 5px; }
body.kb-stitch-app .kb-pdf-paper.is-large .kb-pdf-paper-kpis { gap: 4px; }
body.kb-stitch-app .kb-pdf-paper.is-large .kb-pdf-paper-kpis i { height: 20px; border-top-width: 3px; }

body.kb-stitch-app .kb-pdf-ready {
  position: relative;
  padding: 6px 0 8px;
}

body.kb-stitch-app .kb-pdf-ready::before,
body.kb-stitch-app .kb-pdf-ready::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  width: 196px;
  aspect-ratio: 1 / 1.414;
  margin-left: -92px;
  border-radius: 3px;
  background: #E8E2EA;
  transform: rotate(5deg);
}

body.kb-stitch-app .kb-pdf-ready::after {
  top: 9px;
  margin-left: -96px;
  background: #F3EFF4;
  transform: rotate(2.5deg);
}

body.kb-stitch-app .kb-pdf-ready .kb-pdf-paper { z-index: 1; }

body.kb-stitch-app .kb-pdf-file {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--kb-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .04);
}

body.kb-stitch-app .kb-pdf-file .kb-tile {
  width: 40px;
  height: 40px;
  color: var(--kb-primary);
  --trx-color: var(--kb-primary);
}

body.kb-stitch-app .kb-pdf-file > span:last-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

body.kb-stitch-app .kb-pdf-file b {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.kb-stitch-app .kb-pdf-file small {
  display: block;
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 700;
}

body.kb-stitch-app .kb-pdf-privacy {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
}

body.kb-stitch-app .kb-pdf-privacy .kb-inline-icon {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--kb-income);
}

body.kb-stitch-app .kb-pdf-actions {
  display: flex;
  gap: 10px;
}

body.kb-stitch-app .kb-pdf-actions > button {
  flex: 1 1 0;
  min-height: 54px;
  justify-content: center;
}

/* Home (phones): the finished period's recap, in the planning cards' row. */
body.kb-stitch-app .kb-recap-card {
  grid-column: 1 / -1;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
  padding: 10px 12px;
  border: 1px solid rgba(var(--kb-primary-rgb), .35);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(var(--kb-primary-rgb), .18), rgba(var(--kb-accent-rgb), .08)), var(--kb-panel);
  color: var(--kb-text);
}

body.kb-stitch-app .kb-recap-art {
  width: 44px;
  height: 44px;
}

body.kb-stitch-app .kb-recap-text > b {
  display: block;
  font-family: Manrope, "Hanken Grotesk", sans-serif;
  font-size: 15px;
}

body.kb-stitch-app .kb-recap-text span {
  display: block;
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
}

body.kb-stitch-app .kb-recap-text .is-good { color: var(--kb-income); }
body.kb-stitch-app .kb-recap-text .is-bad { color: var(--kb-expense); }

body.kb-stitch-app .kb-recap-close {
  align-self: start;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--kb-muted);
}

body.kb-stitch-app .kb-recap-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}

body.kb-stitch-app .kb-recap-actions button {
  flex: 1 1 0;
  min-height: 38px;
  justify-content: center;
  font-size: 13.5px;
}

/* Upgrade (phones): small pictures of the Plus report pages. */
body.kb-stitch-app .upgrade-report-showcase {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--kb-line);
  border-radius: 20px;
  background: var(--kb-panel);
}

body.kb-stitch-app .upgrade-report-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body.kb-stitch-app .upgrade-report-head b {
  font-size: 15px;
}

body.kb-stitch-app .upgrade-report-head span {
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 800;
}

body.kb-stitch-app .upgrade-report-thumbs {
  display: flex;
  gap: 8px;
}

body.kb-stitch-app .upgrade-report-thumb {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  gap: 6px;
  text-align: center;
}

body.kb-stitch-app .upgrade-report-page {
  display: block;
  height: 74px;
  padding: 7px;
  box-sizing: border-box;
  border-radius: 10px;
  background: #F8FAFC;
}

body.kb-stitch-app .upgrade-report-page i {
  display: block;
  height: 5px;
  margin-top: 4px;
  border-radius: 3px;
}

body.kb-stitch-app .upgrade-report-page i:first-child {
  height: 9px;
  margin-top: 0;
  background: #0F172A;
}

body.kb-stitch-app .upgrade-report-thumb small {
  color: var(--kb-muted);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.25;
}

/* While the recap card shows, its row takes the height it needs; the recent list gives way. */
@media (max-width: 768px) {
  body.kb-stitch-app .dashboard-lower-grid:has(.kb-recap-card) {
    grid-template-rows: auto minmax(0, 1fr) !important;
  }

  body.kb-stitch-app .dashboard-lower-grid .home-progress-grid:has(.kb-recap-card) {
    grid-template-rows: auto;
    height: auto;
    overflow: visible;
  }
}

/* ===== Analytics (canvas section 7): pace, ranked categories, spending calendar, honest trend ===== */
body.kb-stitch-app {
  --kb-an-good: #2dd4bf;
  --kb-an-warn: #f7d06f;
  --kb-an-bad: #fb7185;
  --kb-an-soft: rgba(255, 255, 255, .06);
  --kb-an-hatch: repeating-linear-gradient(135deg, color-mix(in srgb, var(--kb-text) 34%, transparent) 0 3px, transparent 3px 7px);
}

html.light body.kb-stitch-app {
  --kb-an-good: #0f766e;
  --kb-an-warn: #b45309;
  --kb-an-bad: #be123c;
  --kb-an-soft: rgba(38, 21, 38, .06);
}

body.kb-stitch-app .kb-an {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

body.kb-stitch-app .kb-an-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  margin: 0 !important;
}

body.kb-stitch-app .kb-an-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

body.kb-stitch-app .kb-an-head .kb-page-kicker {
  margin-bottom: 2px;
}

body.kb-stitch-app .kb-an-head :is(h2, h3),
body.kb-stitch-app .kb-an-quality h3 {
  margin: 0;
  color: var(--kb-text);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
}

body.kb-stitch-app .kb-an-seg {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--kb-line);
  border-radius: 12px;
  background: var(--kb-an-soft);
}

body.kb-stitch-app .kb-an-seg button {
  height: 28px;
  padding: 0 11px;
  border-radius: 9px;
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 850;
  white-space: nowrap;
}

body.kb-stitch-app .kb-an-seg button.is-active {
  background: var(--kb-primary);
  color: #1a0f1d;
}

body.kb-stitch-app .kb-an-note,
body.kb-stitch-app .kb-an-text,
body.kb-stitch-app .kb-an-empty {
  margin: 0;
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.45;
}

body.kb-stitch-app .kb-an-text {
  color: var(--kb-text);
  font-size: 13.5px;
}

body.kb-stitch-app .kb-an-text b {
  font-weight: 850;
}

body.kb-stitch-app .kb-an-sub {
  margin: 4px 0 0;
  color: var(--kb-muted);
  font-size: 11.5px;
  font-weight: 850;
  letter-spacing: .08em;
}

body.kb-stitch-app .kb-an-link {
  padding: 0;
  color: var(--kb-primary-ink, var(--kb-primary));
  font-size: inherit;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Hero: what is left, pace against the limit, where the period will end */
body.kb-stitch-app .kb-an-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

body.kb-stitch-app .kb-an-label {
  margin: 0;
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 850;
}

body.kb-stitch-app .kb-an-big {
  margin: 3px 0 0;
  color: var(--kb-text);
  font-size: clamp(26px, 7.6vw, 32px);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.1;
}

body.kb-stitch-app .kb-an-big.is-bad {
  color: var(--kb-an-bad);
}

body.kb-stitch-app .kb-an-chip {
  flex: 0 0 auto;
  height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--kb-an-soft);
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

body.kb-stitch-app .kb-an-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 13px;
  font-weight: 850;
}

body.kb-stitch-app .kb-an-flow .is-in { color: var(--kb-an-good); }
body.kb-stitch-app .kb-an-flow .is-out { color: var(--kb-an-bad); }

body.kb-stitch-app .kb-an-compare {
  margin: -4px 0 0;
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 650;
}

body.kb-stitch-app .kb-an-pace {
  padding-top: 10px;
  border-top: 1px solid var(--kb-line);
}

body.kb-stitch-app .kb-an-pace-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--kb-text);
  font-size: 13px;
  font-weight: 850;
}

body.kb-stitch-app .kb-an-pace.is-good .kb-an-pace-head b { color: var(--kb-an-good); }
body.kb-stitch-app .kb-an-pace.is-warn .kb-an-pace-head b { color: var(--kb-an-warn); }
body.kb-stitch-app .kb-an-pace.is-bad .kb-an-pace-head b { color: var(--kb-an-bad); }

body.kb-stitch-app .kb-an-pace-bar {
  position: relative;
  height: 12px;
  margin-top: 8px;
  border-radius: 6px;
  background: var(--kb-an-soft);
}

body.kb-stitch-app .kb-an-pace-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--kb-income), var(--kb-an-good));
}

body.kb-stitch-app .kb-an-pace.is-warn .kb-an-pace-fill { background: linear-gradient(90deg, var(--kb-income), var(--kb-an-warn)); }
body.kb-stitch-app .kb-an-pace.is-bad .kb-an-pace-fill { background: var(--kb-an-bad); }

body.kb-stitch-app .kb-an-pace-proj {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 0 6px 6px 0;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, #fb923c 60%, transparent) 0 4px, transparent 4px 8px);
}

body.kb-stitch-app .kb-an-pace-today {
  position: absolute;
  top: -5px;
  bottom: -5px;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--kb-text);
}

body.kb-stitch-app .kb-an-pace-scale {
  position: relative;
  height: 16px;
  margin-top: 7px;
}

body.kb-stitch-app .kb-an-pace-scale span {
  position: absolute;
  transform: translateX(-50%);
  color: var(--kb-muted);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

body.kb-stitch-app .kb-an-projection {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 12px;
  border: 1px dashed color-mix(in srgb, var(--kb-an-good) 60%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--kb-an-good) 7%, transparent);
}

body.kb-stitch-app .kb-an-projection.is-warn {
  border-color: color-mix(in srgb, #fb923c 60%, transparent);
  background: color-mix(in srgb, #fb923c 7%, transparent);
}

body.kb-stitch-app .kb-an-projection svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  fill: none;
  stroke: var(--kb-an-good);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.kb-stitch-app .kb-an-projection.is-warn svg { stroke: #fb923c; }

body.kb-stitch-app .kb-an-projection p {
  margin: 0;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

body.kb-stitch-app .kb-an-projection b {
  color: var(--kb-text);
  font-weight: 850;
}

body.kb-stitch-app .kb-an-soon {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--kb-an-soft);
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
}

body.kb-stitch-app .kb-an-dots {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
}

body.kb-stitch-app .kb-an-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--kb-line);
}

body.kb-stitch-app .kb-an-dots i.is-on {
  background: var(--kb-primary);
}

/* Meeny's notes: a swipeable row on phones, a column on desktop */
body.kb-stitch-app .kb-an-insights {
  display: flex;
  gap: 10px;
  min-width: 0;
  margin-right: -16px;
  padding-right: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

body.kb-stitch-app .kb-an-insights::-webkit-scrollbar {
  display: none;
}

body.kb-stitch-app .kb-an-insight {
  flex: 0 0 min(250px, 78%);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(var(--kb-primary-rgb), .24);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(var(--kb-primary-rgb), .12), rgba(var(--kb-accent-rgb), .05)), var(--kb-panel);
  scroll-snap-align: start;
}

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

body.kb-stitch-app .kb-an-insight svg {
  flex: 0 0 auto;
}

body.kb-stitch-app .kb-an-insight p {
  margin: 0;
  color: var(--kb-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

/* Records with gaps: one card that says so and offers to fill them */
body.kb-stitch-app .kb-an-quality {
  border-color: color-mix(in srgb, var(--kb-an-warn) 40%, transparent) !important;
  background: linear-gradient(160deg, color-mix(in srgb, var(--kb-an-warn) 10%, transparent), transparent), var(--kb-panel) !important;
}

body.kb-stitch-app .kb-an-quality-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

body.kb-stitch-app .kb-an-quality-top svg {
  flex: 0 0 auto;
}

body.kb-stitch-app .kb-an-quality-top p {
  margin: 4px 0 0;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

body.kb-stitch-app .kb-an-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 6px;
}

body.kb-stitch-app .kb-an-tile {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 12px;
  background: var(--kb-an-soft);
  text-align: center;
}

body.kb-stitch-app .kb-an-tile small {
  color: var(--kb-muted);
  font-size: 10.5px;
  font-weight: 800;
}

body.kb-stitch-app .kb-an-tile b {
  font-size: 15px;
  font-weight: 900;
}

body.kb-stitch-app .kb-an-tile.is-good b { color: var(--kb-an-good); }
body.kb-stitch-app .kb-an-tile.is-warn b { color: var(--kb-an-warn); }
body.kb-stitch-app .kb-an-tile.is-bad b { color: var(--kb-an-bad); }

/* Categories as ranked bars */
body.kb-stitch-app .kb-an-stack {
  display: flex;
  gap: 2px;
  height: 12px;
  overflow: hidden;
  border-radius: 6px;
}

body.kb-stitch-app .kb-an-stack i {
  display: block;
  min-width: 3px;
  height: 100%;
}

body.kb-stitch-app .kb-an-cat-list {
  display: grid;
  gap: 4px;
}

body.kb-stitch-app .kb-an-cat {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-width: 0;
  padding: 6px 4px;
  border-radius: 14px;
  color: var(--kb-text);
  text-align: left;
}

body.kb-stitch-app .kb-an-cat:hover,
body.kb-stitch-app .kb-an-trx:hover {
  background: var(--kb-an-soft);
}

body.kb-stitch-app .kb-an-cat .kb-tile,
body.kb-stitch-app .kb-an-repeat .kb-tile,
body.kb-stitch-app .kb-an-trx .kb-tile {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 17px;
}

body.kb-stitch-app .kb-an-cat-body {
  flex: 1 1 auto;
  min-width: 0;
}

body.kb-stitch-app .kb-an-cat-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}

body.kb-stitch-app .kb-an-cat-top b {
  min-width: 0;
  overflow: hidden;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.kb-stitch-app .kb-an-cat-top .num {
  flex: 0 0 auto;
  font-weight: 850;
}

body.kb-stitch-app .kb-an-meter {
  position: relative;
  display: block;
  height: 6px;
  margin: 6px 0 5px;
  border-radius: 3px;
  background: var(--kb-an-soft);
}

body.kb-stitch-app .kb-an-meter i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 3px;
}

body.kb-stitch-app .kb-an-cat-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--kb-muted);
  font-size: 11.5px;
  font-weight: 700;
}

body.kb-stitch-app .kb-an-cat-meta em {
  font-style: normal;
}

body.kb-stitch-app .kb-an-cat-meta em.is-warn { color: var(--kb-an-warn); font-weight: 850; }
body.kb-stitch-app .kb-an-cat-meta em.is-bad { color: var(--kb-an-bad); font-weight: 850; }

body.kb-stitch-app .kb-an-change {
  flex: 0 0 auto;
  font-weight: 850;
}

body.kb-stitch-app .kb-an-change.is-good { color: var(--kb-an-good); }
body.kb-stitch-app .kb-an-change.is-bad { color: var(--kb-an-bad); }
body.kb-stitch-app .kb-an-change.is-new { color: var(--kb-accent); }

body.kb-stitch-app .kb-an-more {
  justify-self: start;
  padding: 2px 0;
  color: var(--kb-primary-ink, var(--kb-primary));
  font-size: 13px;
  font-weight: 850;
}

/* Spending calendar: colour per day, "?" for days nobody recorded */
body.kb-stitch-app .kb-an-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

body.kb-stitch-app .kb-an-wd {
  color: var(--kb-muted);
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

body.kb-stitch-app .kb-an-day {
  position: relative;
  min-width: 0;
  height: 40px;
  padding: 4px 0 0 6px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  background: var(--kb-an-soft);
  color: var(--kb-text);
  font-size: 11.5px;
  font-weight: 850;
  line-height: 1.1;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
}

body.kb-stitch-app .kb-an-day.is-future {
  opacity: .38;
}

body.kb-stitch-app .kb-an-day.is-spend {
  background: rgba(var(--kb-primary-rgb), var(--a, .4));
}

body.kb-stitch-app .kb-an-day.is-strong {
  color: #1a0f1d;
}

body.kb-stitch-app .kb-an-day.is-missing {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--kb-an-warn) 75%, transparent);
  background: color-mix(in srgb, var(--kb-an-warn) 7%, transparent);
  color: var(--kb-an-warn);
}

body.kb-stitch-app .kb-an-day.is-missing b {
  position: absolute;
  right: 6px;
  bottom: 3px;
  font-size: 13px;
}

body.kb-stitch-app .kb-an-day.is-nospend {
  background: color-mix(in srgb, var(--kb-an-good) 14%, transparent);
  color: var(--kb-an-good);
}

body.kb-stitch-app .kb-an-day .kb-ui-glyph {
  position: absolute;
  right: 5px;
  bottom: 4px;
  width: 13px;
  height: 13px;
}

body.kb-stitch-app .kb-an-day.is-today {
  box-shadow: inset 0 0 0 2px var(--kb-text);
}

body.kb-stitch-app .kb-an-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--kb-muted);
  font-size: 11.5px;
  font-weight: 700;
}

body.kb-stitch-app .kb-an-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

body.kb-stitch-app .kb-an-legend .is-good {
  color: var(--kb-an-good);
}

body.kb-stitch-app .kb-an-legend .kb-ui-glyph {
  width: 12px;
  height: 12px;
}

body.kb-stitch-app .kb-an-ramp {
  width: 34px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(var(--kb-primary-rgb), .2), rgba(var(--kb-primary-rgb), .9));
}

body.kb-stitch-app .kb-an-key {
  flex: 0 0 auto;
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 4px;
}

body.kb-stitch-app .kb-an-key.is-missing { border: 1.5px dashed var(--kb-an-warn); }
body.kb-stitch-app .kb-an-key.is-partial { border: 1px solid color-mix(in srgb, var(--kb-text) 35%, transparent); background: var(--kb-an-hatch); }
body.kb-stitch-app .kb-an-key.is-current { border: 1.5px dashed var(--kb-an-good); }
body.kb-stitch-app .kb-an-key.is-avg { height: 0; border-top: 2px dashed var(--kb-accent); border-radius: 0; }
body.kb-stitch-app .kb-an-key.is-goal { height: 0; border-top: 2px dashed var(--kb-an-good); border-radius: 0; }
body.kb-stitch-app .kb-an-key.is-in { background: var(--kb-income); }
body.kb-stitch-app .kb-an-key.is-out { background: var(--kb-expense); }
body.kb-stitch-app .kb-an-key.is-plus { background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent)); }

body.kb-stitch-app .kb-an-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--kb-an-warn) 30%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--kb-an-warn) 8%, transparent);
}

body.kb-stitch-app .kb-an-status.is-good {
  border-color: color-mix(in srgb, var(--kb-an-good) 30%, transparent);
  background: color-mix(in srgb, var(--kb-an-good) 8%, transparent);
}

body.kb-stitch-app .kb-an-status p {
  flex: 1 1 auto;
  margin: 0;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

body.kb-stitch-app .kb-an-status b {
  color: var(--kb-text);
  font-weight: 850;
}

body.kb-stitch-app .kb-an-status button {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 12px;
  border-radius: 11px;
  background: var(--kb-an-warn);
  color: #2a1d05;
  font-size: 13px;
  font-weight: 850;
}

html.light body.kb-stitch-app .kb-an-status button {
  color: #ffffff;
}

/* Trend columns: one per period, partial periods hatched, the running one dashed */
body.kb-stitch-app .kb-an-chart {
  position: relative;
  display: flex;
  height: 176px;
  padding-top: 20px;
}

body.kb-stitch-app .kb-an-chart-lines {
  position: absolute;
  inset: 20px 0 26px;
  pointer-events: none;
}

body.kb-stitch-app .kb-an-avg,
body.kb-stitch-app .kb-an-zero,
body.kb-stitch-app .kb-an-goal {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
}

body.kb-stitch-app .kb-an-avg { border-top: 2px dashed color-mix(in srgb, var(--kb-accent) 85%, transparent); }
body.kb-stitch-app .kb-an-zero { border-top: 1px solid var(--kb-line); }
body.kb-stitch-app .kb-an-goal { border-top: 2px dashed var(--kb-an-good); }

body.kb-stitch-app .kb-an-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
}

body.kb-stitch-app .kb-an-col-plot {
  position: relative;
  flex: 1 1 auto;
  border-bottom: 1px solid var(--kb-line);
}

body.kb-stitch-app .kb-an-col-plot.is-pair {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

body.kb-stitch-app .kb-an-col-label {
  height: 26px;
  padding-top: 7px;
  color: var(--kb-muted);
  font-size: 11.5px;
  font-weight: 850;
  text-align: center;
  white-space: nowrap;
}

body.kb-stitch-app .kb-an-col.is-current .kb-an-col-label {
  color: var(--kb-an-good);
}

body.kb-stitch-app .kb-an-bar {
  position: absolute;
  left: 50%;
  width: min(34px, 56%);
  transform: translateX(-50%);
  border-radius: 7px;
  background: var(--kb-income);
}

body.kb-stitch-app .kb-an-bar.is-neg { background: var(--kb-an-bad); }

body.kb-stitch-app .kb-an-bar.is-partial {
  border: 1px solid color-mix(in srgb, var(--kb-text) 35%, transparent);
  background: var(--kb-an-hatch);
}

body.kb-stitch-app .kb-an-bar.is-current {
  border: 1.5px dashed var(--kb-an-good);
  background: color-mix(in srgb, var(--kb-an-good) 12%, transparent);
}

body.kb-stitch-app .kb-an-bar.is-pending {
  height: 14px;
  border: 1.5px dashed var(--kb-line);
  background: transparent;
}

body.kb-stitch-app .kb-an-bar.is-clipped::after {
  content: '';
  position: absolute;
  left: -4px;
  right: -4px;
  top: 12px;
  height: 5px;
  background: var(--kb-panel-solid);
  transform: skewY(-14deg);
}

body.kb-stitch-app .kb-an-bar em {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  color: var(--kb-text);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

body.kb-stitch-app .kb-an-bar.is-neg em {
  top: calc(100% + 4px);
  bottom: auto;
}

body.kb-stitch-app .kb-an-bar.is-partial em { color: var(--kb-muted); }
body.kb-stitch-app .kb-an-bar.is-current em { color: var(--kb-an-good); }

body.kb-stitch-app .is-pair .kb-an-bar {
  position: relative;
  left: auto;
  width: min(14px, 34%);
  transform: none;
  border-radius: 4px 4px 2px 2px;
}

body.kb-stitch-app .is-pair .kb-an-bar.is-in { background: var(--kb-income); }
body.kb-stitch-app .is-pair .kb-an-bar.is-out { background: var(--kb-expense); }
body.kb-stitch-app .is-pair .kb-an-bar.is-out.is-partial { background: var(--kb-an-hatch); }
body.kb-stitch-app .is-pair .kb-an-bar.is-running { opacity: .55; }

body.kb-stitch-app .kb-an-bar.is-coverage { background: var(--kb-an-good); }
body.kb-stitch-app .kb-an-bar.is-coverage.is-warn { background: var(--kb-an-warn); }
body.kb-stitch-app .kb-an-bar.is-coverage.is-bad { background: var(--kb-an-bad); }

body.kb-stitch-app .kb-an-key-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.45;
}

body.kb-stitch-app .kb-an-key-note .kb-an-key {
  margin-top: 3px;
}

body.kb-stitch-app .kb-an-key-note b {
  color: var(--kb-text);
  font-weight: 850;
}

/* Habits: weekday averages and small spending that repeats */
body.kb-stitch-app .kb-an-week {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 118px;
}

body.kb-stitch-app .kb-an-week span {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
}

body.kb-stitch-app .kb-an-week small {
  color: var(--kb-muted);
  font-size: 10.5px;
  font-weight: 850;
  white-space: nowrap;
}

body.kb-stitch-app .kb-an-week i {
  display: block;
  width: min(26px, 80%);
  max-height: 74px;
  border-radius: 7px 7px 3px 3px;
  background: rgba(var(--kb-primary-rgb), .3);
}

body.kb-stitch-app .kb-an-week b {
  color: var(--kb-muted);
  font-size: 11.5px;
  font-weight: 850;
}

body.kb-stitch-app .kb-an-week .is-top i { background: var(--kb-primary); }
body.kb-stitch-app .kb-an-week .is-top small,
body.kb-stitch-app .kb-an-week .is-top b { color: var(--kb-text); }

body.kb-stitch-app .kb-an-repeat {
  display: flex;
  align-items: center;
  gap: 11px;
}

body.kb-stitch-app .kb-an-repeat > span:nth-child(2) {
  flex: 1 1 auto;
  min-width: 0;
}

body.kb-stitch-app .kb-an-repeat b,
body.kb-stitch-app .kb-an-trx b {
  display: block;
  overflow: hidden;
  color: var(--kb-text);
  font-size: 14px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.kb-stitch-app .kb-an-repeat small,
body.kb-stitch-app .kb-an-trx small {
  display: block;
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 700;
}

body.kb-stitch-app .kb-an-repeat .num,
body.kb-stitch-app .kb-an-trx .num {
  flex: 0 0 auto;
  color: var(--kb-text);
  font-size: 13.5px;
  font-weight: 850;
}

/* Sheets opened from Analytics */
body.kb-stitch-app .kb-an-wide {
  width: 100%;
  min-height: 50px;
  justify-content: center;
}

body.kb-stitch-app .kb-an-actions {
  display: flex;
  gap: 10px;
}

body.kb-stitch-app .kb-an-actions > button {
  flex: 1 1 0;
  min-height: 50px;
  justify-content: center;
}

body.kb-stitch-app .kb-secondary-action.is-good {
  color: var(--kb-an-good) !important;
  border-color: color-mix(in srgb, var(--kb-an-good) 45%, transparent) !important;
}

body.kb-stitch-app .kb-an-callout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(var(--kb-primary-rgb), .25);
  border-radius: 14px;
  background: rgba(var(--kb-primary-rgb), .08);
  color: var(--kb-text);
  font-size: 13px;
  font-weight: 700;
}

body.kb-stitch-app .kb-an-callout .kb-inline-icon {
  color: var(--kb-primary);
}

body.kb-stitch-app .kb-an-trx-list,
body.kb-stitch-app .kb-an-fill,
body.kb-stitch-app .kb-an-items {
  padding: 2px 12px;
  border: 1px solid var(--kb-line);
  border-radius: 18px;
  background: var(--kb-an-soft);
}

body.kb-stitch-app .kb-an-trx {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 6px 2px;
  border-radius: 12px;
  text-align: left;
}

body.kb-stitch-app .kb-an-trx > span:nth-child(2) {
  flex: 1 1 auto;
  min-width: 0;
}

body.kb-stitch-app .kb-an-trx .num.is-in { color: var(--kb-an-good); }

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

body.kb-stitch-app .kb-an-fill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
}

body.kb-stitch-app .kb-an-fill-q {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1.5px dashed color-mix(in srgb, var(--kb-an-warn) 75%, transparent);
  border-radius: 12px;
  color: var(--kb-an-warn);
  font-weight: 900;
}

body.kb-stitch-app .kb-an-fill-row.is-done .kb-an-fill-q {
  border-style: solid;
  border-color: color-mix(in srgb, var(--kb-an-good) 60%, transparent);
  color: var(--kb-an-good);
}

body.kb-stitch-app .kb-an-fill-text {
  flex: 1 1 auto;
  min-width: 0;
}

body.kb-stitch-app .kb-an-fill-text b {
  display: block;
  color: var(--kb-text);
  font-size: 14.5px;
  font-weight: 850;
}

body.kb-stitch-app .kb-an-fill-text small {
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 700;
}

body.kb-stitch-app .kb-an-nospend {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--kb-an-good) 45%, transparent);
  border-radius: 11px;
  color: var(--kb-an-good);
  font-size: 12.5px;
  font-weight: 850;
}

body.kb-stitch-app .kb-an-done {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--kb-an-good);
  font-size: 12.5px;
  font-weight: 850;
}

body.kb-stitch-app .kb-an-done .kb-ui-glyph {
  width: 14px;
  height: 14px;
}

body.kb-stitch-app .kb-an-ai {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--kb-line);
  border-radius: 18px;
  background: var(--kb-an-soft);
}

body.kb-stitch-app .kb-an-ai label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--kb-text);
  font-size: 13px;
  font-weight: 850;
}

body.kb-stitch-app .kb-an-ai label .kb-inline-icon {
  color: var(--kb-primary);
}

body.kb-stitch-app .kb-an-ai textarea {
  width: 100%;
  min-height: 74px;
  padding: 10px 12px;
  border: 1px solid var(--kb-line);
  border-radius: 14px;
  background: var(--kb-panel-solid);
  color: var(--kb-text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  resize: vertical;
}

body.kb-stitch-app .kb-an-ai small {
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 650;
}

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

body.kb-stitch-app .kb-an-stats span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--kb-an-soft);
}

body.kb-stitch-app .kb-an-stats small {
  color: var(--kb-muted);
  font-size: 11.5px;
  font-weight: 850;
}

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

body.kb-stitch-app .kb-an-hist {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 128px;
  margin-top: 8px;
}

body.kb-stitch-app .kb-an-hist span {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
}

body.kb-stitch-app .kb-an-hist small {
  color: var(--kb-muted);
  font-size: 10.5px;
  font-weight: 850;
  white-space: nowrap;
}

body.kb-stitch-app .kb-an-hist i {
  display: block;
  width: min(28px, 80%);
  max-height: 86px;
  border-radius: 7px 7px 3px 3px;
  background: var(--c, var(--kb-primary));
}

body.kb-stitch-app .kb-an-hist .is-partial i {
  border: 1px solid color-mix(in srgb, var(--kb-text) 35%, transparent);
  background: var(--kb-an-hatch);
}

body.kb-stitch-app .kb-an-hist .is-current i {
  opacity: .55;
}

body.kb-stitch-app .kb-an-hist b {
  color: var(--kb-muted);
  font-size: 11.5px;
  font-weight: 850;
}

body.kb-stitch-app .kb-an-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  color: var(--kb-text);
  font-size: 14px;
  font-weight: 700;
}

body.kb-stitch-app .kb-an-item small {
  color: var(--kb-muted);
}

body.kb-stitch-app .kb-an-item .num {
  flex: 0 0 auto;
  font-weight: 850;
}

/* Desktop: the same cards in two columns */
@media (min-width: 1024px) {
  body.kb-stitch-app .kb-an {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  body.kb-stitch-app .kb-an-quality {
    grid-column: 1 / -1;
  }

  body.kb-stitch-app .kb-an-insights {
    flex-direction: column;
    margin-right: 0;
    padding-right: 0;
    overflow: visible;
  }

  body.kb-stitch-app .kb-an-insight {
    flex: 0 0 auto;
  }

  body.kb-stitch-app .kb-an-day {
    height: 48px;
  }

  body.kb-stitch-app .kb-an-chart {
    height: 200px;
  }
}

@media (max-width: 1023px) {
  body.kb-stitch-app[data-page="analytics"] .kb-an-card {
    padding: 14px 16px !important;
  }
}

body.kb-stitch-app .kb-an-wide,
body.kb-stitch-app .kb-an-actions > button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body.kb-stitch-app .kb-an-wide svg,
body.kb-stitch-app .kb-an-actions svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===== Logging reminder (canvas section 8): invitation, settings, "Today" sheet, after-logging card ===== */
body.kb-stitch-app .kb-rem h4 {
  margin: 0;
  color: var(--kb-text);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.2;
}

body.kb-stitch-app .kb-rem-hero {
  display: flex;
  align-items: center;
  gap: 14px;
}

body.kb-stitch-app .kb-rem-hero > svg { flex: 0 0 auto; }

body.kb-stitch-app .kb-rem-hero p {
  margin: 4px 0 0;
  color: var(--kb-muted);
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.45;
}

body.kb-stitch-app .kb-rem-preview {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--kb-line);
  border-radius: 18px;
  background: var(--kb-panel-solid);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

body.kb-stitch-app .kb-rem-preview-app {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 750;
}

body.kb-stitch-app .kb-rem-preview-app img { border-radius: 5px; }

body.kb-stitch-app .kb-rem-preview b {
  margin-top: 3px;
  color: var(--kb-text);
  font-size: 14.5px;
  font-weight: 850;
}

body.kb-stitch-app .kb-rem-promises {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.kb-stitch-app .kb-rem-promises li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--kb-text);
  font-size: 13.5px;
  font-weight: 750;
}

body.kb-stitch-app .kb-rem-promises .kb-ui-glyph {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  padding: 6px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--kb-an-good) 15%, transparent);
  color: var(--kb-an-good);
}

body.kb-stitch-app .kb-rem-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 750;
}

body.kb-stitch-app .kb-rem-time input {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--kb-line);
  border-radius: 12px;
  background: var(--kb-panel-solid);
  color: var(--kb-text);
  font-size: 15px;
  font-weight: 800;
}

body.kb-stitch-app .kb-rem-later {
  min-height: 44px;
  border-radius: 14px;
  color: var(--kb-muted);
  font-size: 14.5px;
  font-weight: 850;
}

body.kb-stitch-app .kb-rem-later:hover { color: var(--kb-text); }

body.kb-stitch-app .kb-rem-promise,
body.kb-stitch-app .kb-rem-fallback {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

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

body.kb-stitch-app .kb-rem-promise .kb-inline-icon,
body.kb-stitch-app .kb-rem-fallback .kb-inline-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(var(--kb-primary-rgb), .12);
  color: var(--kb-primary);
}

body.kb-stitch-app .kb-rem-fallback {
  align-items: center;
  padding: 12px 14px;
  border: 1px dashed var(--kb-line);
  border-radius: 18px;
}

body.kb-stitch-app .kb-rem-devices {
  padding: 0 12px;
  border: 1px solid var(--kb-line);
  border-radius: 18px;
  background: var(--kb-an-soft);
}

body.kb-stitch-app .kb-rem-device {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
}

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

body.kb-stitch-app .kb-rem-device-icon { color: var(--kb-primary); }

body.kb-stitch-app .kb-rem-device-text {
  flex: 1 1 auto;
  min-width: 0;
}

body.kb-stitch-app .kb-rem-device-text b {
  display: block;
  color: var(--kb-text);
  font-size: 14.5px;
  font-weight: 850;
}

body.kb-stitch-app .kb-rem-device-text small {
  display: block;
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

body.kb-stitch-app .kb-rem-device.is-missing .kb-rem-device-icon { color: var(--kb-muted); }

body.kb-stitch-app .kb-rem-chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(var(--kb-primary-rgb), .45);
  border-radius: 11px;
  color: var(--kb-primary);
  font-size: 13px;
  font-weight: 850;
}

body.kb-stitch-app .kb-rem-chip.is-danger {
  border-color: color-mix(in srgb, var(--kb-an-bad) 45%, transparent);
  color: var(--kb-an-bad);
}

body.kb-stitch-app .kb-rem-alert {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--kb-an-warn) 45%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--kb-an-warn) 9%, transparent);
}

body.kb-stitch-app .kb-rem-alert > .kb-inline-icon { flex: 0 0 auto; color: var(--kb-an-warn); }

body.kb-stitch-app .kb-rem-alert b {
  display: block;
  color: var(--kb-text);
  font-size: 15px;
  font-weight: 850;
}

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

body.kb-stitch-app .kb-rem-steps {
  margin: 0;
  padding: 0 14px;
  list-style: none;
  border: 1px solid var(--kb-line);
  border-radius: 18px;
  background: var(--kb-an-soft);
}

body.kb-stitch-app .kb-rem-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
}

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

body.kb-stitch-app .kb-rem-steps li > span {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(var(--kb-primary-rgb), .16);
  color: var(--kb-primary);
  font-size: 13px;
  font-weight: 900;
}

body.kb-stitch-app .kb-rem-steps p {
  flex: 1 1 auto;
  margin: 0;
  color: var(--kb-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

body.kb-stitch-app .kb-rem-steps i {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(var(--kb-primary-rgb), .1);
  color: var(--kb-primary);
  font-style: normal;
}

body.kb-stitch-app .kb-rem-steps i img { border-radius: 8px; }

body.kb-stitch-app .kb-rem-ask {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

body.kb-stitch-app .kb-rem-ask > svg { flex: 0 0 auto; }

body.kb-stitch-app .kb-rem-ask > span {
  padding: 10px 13px;
  border: 1px solid rgba(var(--kb-primary-rgb), .22);
  border-radius: 16px 16px 16px 4px;
  background: rgba(var(--kb-primary-rgb), .09);
  color: var(--kb-text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
}

body.kb-stitch-app .kb-rem-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 5px 5px 14px;
  border: 1px solid var(--kb-line);
  border-radius: 18px;
  background: var(--kb-panel-solid);
}

body.kb-stitch-app .kb-rem-input:focus-within {
  border-color: rgba(var(--kb-primary-rgb), .6);
  outline: 2px solid rgba(var(--kb-primary-rgb), .72);
  outline-offset: 2px;
}

/* The wrapper is the visible field; the input inside it stays bare. */
body.kb-stitch-app .kb-rem-input input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none;
  font-size: 15px;
  font-weight: 650;
  outline: none;
}

body.kb-stitch-app .kb-rem-input button {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent));
  color: #180e18;
}

body.kb-stitch-app .kb-rem-favs {
  display: grid;
  gap: 8px;
}

body.kb-stitch-app .kb-rem-favs .kb-an-sub { margin: 0; }

body.kb-stitch-app .kb-rem-favs > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.kb-stitch-app .kb-rem-favs > small {
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 650;
}

body.kb-stitch-app .kb-rem-fav {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 12px 0 7px;
  border: 1px solid var(--kb-line);
  border-radius: 13px;
  background: var(--kb-an-soft);
  color: var(--kb-text);
  font-size: 13.5px;
}

body.kb-stitch-app .kb-rem-fav .kb-tile {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 15px;
}

body.kb-stitch-app .kb-rem-fav b { font-weight: 850; }

body.kb-stitch-app .kb-rem-fav small {
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 750;
}

body.kb-stitch-app .kb-rem-fav.is-done {
  border-color: color-mix(in srgb, var(--kb-an-good) 55%, transparent);
  background: color-mix(in srgb, var(--kb-an-good) 10%, transparent);
}

body.kb-stitch-app .kb-rem-fav-check {
  display: grid;
  color: var(--kb-an-good);
}

body.kb-stitch-app .kb-rem-fav-check .kb-ui-glyph {
  width: 15px;
  height: 15px;
}

body.kb-stitch-app .kb-rem-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 800;
}

body.kb-stitch-app .kb-rem-or i {
  flex: 1 1 auto;
  height: 1px;
  background: var(--kb-line);
}

body.kb-stitch-app .kb-rem-cheer {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

body.kb-stitch-app .kb-rem-cheer h4 {
  margin-top: 4px;
  font-size: 22px;
}

body.kb-stitch-app .kb-rem-cheer p {
  margin: 0;
  color: var(--kb-muted);
  font-size: 13.5px;
  font-weight: 650;
}

body.kb-stitch-app .kb-rem-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  padding: 12px 10px;
  border: 1px solid var(--kb-line);
  border-radius: 18px;
  background: var(--kb-an-soft);
}

body.kb-stitch-app .kb-rem-day {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--kb-muted);
  font-size: 11.5px;
  font-weight: 850;
}

body.kb-stitch-app .kb-rem-day i,
body.kb-stitch-app .kb-rem-legend i {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  border-radius: 11px;
}

body.kb-stitch-app .kb-rem-day i {
  width: 34px;
  height: 34px;
  border: 1px dashed var(--kb-line);
}

body.kb-stitch-app .kb-rem-day .kb-ui-glyph {
  width: 16px;
  height: 16px;
}

body.kb-stitch-app .kb-rem-day.is-logged i,
body.kb-stitch-app .kb-rem-legend i.is-logged {
  border: 0;
  background: var(--kb-primary);
  color: #180e18;
}

body.kb-stitch-app .kb-rem-day.is-no_spend i,
body.kb-stitch-app .kb-rem-legend i.is-no_spend {
  border: 1.5px solid var(--kb-an-good);
  color: var(--kb-an-good);
}

body.kb-stitch-app .kb-rem-day.is-empty i {
  border: 1.5px dashed color-mix(in srgb, var(--kb-an-warn) 70%, transparent);
}

body.kb-stitch-app .kb-rem-day.is-future { opacity: .55; }

body.kb-stitch-app .kb-rem-day.is-today { color: var(--kb-text); }

body.kb-stitch-app .kb-rem-day.is-today i { box-shadow: 0 0 0 3px var(--kb-panel-solid), 0 0 0 5px var(--kb-primary); }

body.kb-stitch-app .kb-rem-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 700;
}

body.kb-stitch-app .kb-rem-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.kb-stitch-app .kb-rem-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

body.kb-stitch-app .kb-rem-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

body.kb-stitch-app .kb-rem-tiles span {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--kb-line);
  border-radius: 16px;
  background: var(--kb-an-soft);
}

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

body.kb-stitch-app .kb-rem-tiles b {
  color: var(--kb-text);
  font-size: 16px;
  font-weight: 900;
}

body.kb-stitch-app .kb-rem-tiles b.is-good { color: var(--kb-an-good); }

body.kb-stitch-app .kb-rem-desk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 28px;
  align-items: start;
}

@media (max-width: 1100px) {
  body.kb-stitch-app .kb-rem-desk { grid-template-columns: minmax(0, 1fr); }
}

/* Sheet skeletons follow the theme; the report preview's paper-white one stays for the report itself. */
body.kb-stitch-app .kb-report-preview.kb-an-loading {
  border-color: var(--kb-line);
  background: var(--kb-an-soft);
}

body.kb-stitch-app .kb-report-preview.kb-an-loading i {
  background: linear-gradient(90deg, rgba(var(--kb-primary-rgb), .07), rgba(var(--kb-primary-rgb), .16), rgba(var(--kb-primary-rgb), .07));
  background-size: 200% 100%;
}

/* "Not arriving? Check this device" */
body.kb-stitch-app .kb-rem-check-open {
  width: 100%;
  margin-top: 6px;
  font-size: 13.5px;
}

body.kb-stitch-app .kb-rem-check {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

body.kb-stitch-app .kb-rem-check ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 12px;
  list-style: none;
  border: 1px solid var(--kb-line);
  border-radius: 16px;
  background: var(--kb-an-soft);
}

body.kb-stitch-app .kb-rem-check li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
}

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

body.kb-stitch-app .kb-rem-check li .kb-ui-glyph {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 7px;
}

body.kb-stitch-app .kb-rem-check li.is-ok .kb-ui-glyph {
  background: color-mix(in srgb, var(--kb-an-good) 15%, transparent);
  color: var(--kb-an-good);
}

body.kb-stitch-app .kb-rem-check li.is-bad .kb-ui-glyph {
  background: color-mix(in srgb, var(--kb-an-bad) 15%, transparent);
  color: var(--kb-an-bad);
}

body.kb-stitch-app .kb-rem-check li b {
  display: block;
  color: var(--kb-text);
  font-size: 13.5px;
  font-weight: 850;
}

body.kb-stitch-app .kb-rem-check li small {
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 700;
}

/* ===== Quota windows: meter notes, home banner (Plus ending or promo), owner promo panel ===== */
body.kb-stitch-app .kb-plan-meter-note {
  display: block;
  margin-top: 5px;
  color: var(--kb-muted);
  font-size: 11.5px;
  font-weight: 700;
}

body.kb-stitch-app .kb-home-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid rgba(var(--kb-primary-rgb), .3);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(var(--kb-primary-rgb), .14), rgba(var(--kb-accent-rgb), .07)), var(--kb-panel-solid);
}

body.kb-stitch-app .kb-home-banner-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(var(--kb-primary-rgb), .16);
  color: var(--kb-primary);
}

body.kb-stitch-app .kb-home-banner-text {
  flex: 1 1 auto;
  min-width: 0;
}

body.kb-stitch-app .kb-home-banner-text b {
  display: block;
  color: var(--kb-text);
  font-size: 15px;
  font-weight: 900;
}

body.kb-stitch-app .kb-home-banner-text p {
  margin: 3px 0 0;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

body.kb-stitch-app .kb-home-banner-text small {
  display: block;
  margin-top: 5px;
  color: var(--kb-primary);
  font-size: 12px;
  font-weight: 800;
}

body.kb-stitch-app .kb-home-banner-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

body.kb-stitch-app .kb-home-banner-actions .kb-primary-action {
  min-height: 44px;
  padding: 0 16px;
  white-space: nowrap;
}

body.kb-stitch-app .kb-home-banner-close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--kb-muted);
}

body.kb-stitch-app .kb-home-banner-close:hover { color: var(--kb-text); }

@media (max-width: 640px) {
  body.kb-stitch-app .kb-home-banner {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  body.kb-stitch-app .kb-home-banner-text { flex-basis: calc(100% - 58px); }

  body.kb-stitch-app .kb-home-banner-actions {
    flex-basis: 100%;
    justify-content: space-between;
  }

  body.kb-stitch-app .kb-home-banner-actions .kb-primary-action { flex: 1 1 auto; }
}

body.kb-stitch-app .kb-owner-promo {
  display: grid;
  gap: 16px;
  margin-top: 20px;
  padding: 20px;
  border: 1px solid rgba(var(--kb-primary-rgb), .28);
  border-radius: 24px;
  background: rgba(var(--kb-primary-rgb), .06);
}

body.kb-stitch-app .kb-owner-promo-head h3 {
  margin: 0;
  color: var(--kb-text);
  font-size: 19px;
  font-weight: 900;
}

body.kb-stitch-app .kb-owner-promo-head p:last-child {
  margin: 4px 0 0;
  color: var(--kb-muted);
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.45;
}

body.kb-stitch-app .kb-owner-promo-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  align-items: end;
}

body.kb-stitch-app .kb-owner-promo-form label {
  display: grid;
  gap: 6px;
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 800;
}

body.kb-stitch-app .kb-owner-promo-form label[hidden],
body.kb-stitch-app .kb-owner-promo-form div[hidden] { display: none; }

body.kb-stitch-app .kb-owner-promo-form input,
body.kb-stitch-app .kb-owner-promo-form select {
  min-height: 44px;
  padding: 0 12px;
  font-size: 14.5px;
  font-weight: 650;
}

body.kb-stitch-app .kb-owner-promo-form .is-wide { grid-column: 1 / -1; }

body.kb-stitch-app .kb-owner-promo-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

body.kb-stitch-app .kb-owner-promo-form .kb-owner-promo-check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--kb-text);
  font-size: 13.5px;
  font-weight: 700;
}

body.kb-stitch-app .kb-owner-promo-form .kb-owner-promo-check input {
  min-height: 0;
  width: 20px;
  height: 20px;
  padding: 0;
}

body.kb-stitch-app .kb-owner-promo-list {
  display: grid;
  gap: 8px;
}

body.kb-stitch-app .kb-owner-promo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--kb-line);
  border-radius: 16px;
  background: var(--kb-panel-solid);
}

body.kb-stitch-app .kb-owner-promo-item.is-running { border-color: rgba(var(--kb-primary-rgb), .45); }

body.kb-stitch-app .kb-owner-promo-item b {
  display: block;
  color: var(--kb-text);
  font-size: 14.5px;
  font-weight: 850;
}

body.kb-stitch-app .kb-owner-promo-item small {
  display: block;
  margin-top: 2px;
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 700;
}

body.kb-stitch-app .kb-owner-promo-done {
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 800;
}

/* Owner tools: real-user statistics, test accounts, deletion on request. */
body.kb-stitch-app .kb-owner-tools {
  display: grid;
  gap: 16px;
}

body.kb-stitch-app .kb-owner-block {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--kb-line);
  border-radius: 24px;
  background: rgba(var(--kb-primary-rgb), .05);
}

body.kb-stitch-app .kb-owner-block.is-danger { border-color: rgba(244, 63, 94, .35); background: rgba(244, 63, 94, .05); }

body.kb-stitch-app .kb-owner-source {
  display: inline-flex;
  gap: 6px;
  justify-self: start;
  padding: 4px;
  border: 1px solid var(--kb-line);
  border-radius: 999px;
}

body.kb-stitch-app .kb-owner-source button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--kb-muted);
  font-size: 13px;
  font-weight: 800;
}

body.kb-stitch-app .kb-owner-source button[aria-checked="true"] {
  background: rgba(var(--kb-primary-rgb), .18);
  color: var(--kb-text);
}

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

body.kb-stitch-app .kb-owner-tile {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--kb-line);
  border-radius: 16px;
  background: var(--kb-panel-solid);
}

body.kb-stitch-app .kb-owner-tile b {
  color: var(--kb-text);
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

body.kb-stitch-app .kb-owner-tile span,
body.kb-stitch-app .kb-owner-foot,
body.kb-stitch-app .kb-owner-empty {
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 700;
}

body.kb-stitch-app .kb-owner-empty,
body.kb-stitch-app .kb-owner-foot { margin: 0; }

body.kb-stitch-app .kb-owner-funnel {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.kb-stitch-app .kb-owner-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
}

body.kb-stitch-app .kb-owner-step b {
  display: block;
  color: var(--kb-text);
  font-size: 14px;
  font-weight: 850;
}

body.kb-stitch-app .kb-owner-step small {
  display: block;
  color: var(--kb-muted);
  font-size: 12px;
  font-weight: 650;
}

body.kb-stitch-app .kb-owner-step-num {
  color: var(--kb-text);
  font-size: 15px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

body.kb-stitch-app .kb-owner-step-num em {
  margin-left: 4px;
  color: var(--kb-muted);
  font-style: normal;
  font-size: 12.5px;
}

body.kb-stitch-app .kb-owner-bar {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(var(--kb-primary-rgb), .12);
}

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

body.kb-stitch-app .kb-owner-inline {
  display: flex;
  gap: 10px;
}

body.kb-stitch-app .kb-owner-inline input,
body.kb-stitch-app .kb-owner-preview input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  font-size: 14.5px;
  font-weight: 650;
}

body.kb-stitch-app .kb-owner-tools > .kb-owner-block > .kb-secondary-action { justify-self: start; }

body.kb-stitch-app .kb-owner-preview {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--kb-line);
  border-radius: 16px;
  background: var(--kb-panel-solid);
}

body.kb-stitch-app .kb-owner-preview b { color: var(--kb-text); font-size: 15px; font-weight: 900; }
body.kb-stitch-app .kb-owner-preview span,
body.kb-stitch-app .kb-owner-preview small { color: var(--kb-muted); font-size: 13px; font-weight: 700; }

body.kb-stitch-app .kb-owner-preview label {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  color: var(--kb-muted);
  font-size: 12.5px;
  font-weight: 800;
}

body.kb-stitch-app .kb-owner-warn {
  margin: 0;
  color: var(--kb-expense);
  font-size: 13px;
  font-weight: 800;
}

body.kb-stitch-app .kb-owner-preview .settings-danger-btn { justify-self: start; }

@media (max-width: 768px) {
  body.kb-stitch-app .kb-owner-block { padding: 16px; }
  body.kb-stitch-app .kb-owner-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.kb-stitch-app .kb-owner-inline { flex-direction: column; }
}

/* The home banner floats above the page: the dashboard is a one-screen grid with no room for it. */
body.kb-stitch-app .kb-home-banner-slot:empty { display: none; }

body.kb-stitch-app .kb-home-banner-slot {
  position: fixed;
  z-index: 53;
  right: 24px;
  bottom: 24px;
  width: min(460px, calc(100vw - 48px));
}

body.kb-stitch-app .kb-home-banner-slot .kb-home-banner {
  margin: 0;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .34);
}

@media (max-width: 768px) {
  body.kb-stitch-app .kb-home-banner-slot {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: calc(var(--kb-stitch-bottom-nav, 84px) + 10px);
  }
}

/* ── AI Catat: type or scan → cards to check → saved on the right day ─────────────── */
body.kb-stitch-app #modal-ai > .aic-card {
  width: 100%;
  max-width: 560px;
  max-height: min(92vh, 880px);
  padding: 18px 18px 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  border-radius: 24px !important;
}

body.kb-stitch-app .aic-card[data-stage="review"] { overflow: hidden; }

body.kb-stitch-app .aic-card .sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

body.kb-stitch-app .aic-svg {
  width: 18px; height: 18px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

body.kb-stitch-app .aic-card :is(.aic-chip, .aic-seg, .aic-icon-btn, .aic-add, .aic-source, .aic-flag-note, .aic-desc, .aic-drop-btn, .aic-tips) svg {
  width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2;
}

body.kb-stitch-app .aic-head { display: flex; align-items: center; gap: 12px; }
body.kb-stitch-app .aic-head-text { flex: 1 1 auto; min-width: 0; }
body.kb-stitch-app .aic-head-text h2 { margin: 0; font-size: 20px; font-weight: 900; line-height: 1.2; }
body.kb-stitch-app .aic-head-text p { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: var(--kb-muted); }
body.kb-stitch-app .aic-head-text p:empty { display: none; }

body.kb-stitch-app .aic-icon-btn {
  flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--kb-line); border-radius: 50%; background: rgba(255, 255, 255, .05); color: var(--kb-text);
}
body.kb-stitch-app .aic-icon-btn.is-plain { width: 34px; height: 34px; border-color: transparent; background: transparent; color: var(--kb-muted); }
body.kb-stitch-app .aic-icon-btn svg { width: 18px; height: 18px; }
body.kb-stitch-app :is(.aic-card, .kb-scanner) :is(.kb-primary-action, .kb-secondary-action) svg {
  width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

body.kb-stitch-app .aic-segs {
  display: flex; gap: 4px; padding: 4px; border-radius: 15px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--kb-line);
}
body.kb-stitch-app .aic-seg {
  flex: 1 1 0; min-width: 0; height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; border-radius: 12px; background: transparent; color: var(--kb-muted); font-size: 14px; font-weight: 800; white-space: nowrap;
}
body.kb-stitch-app .aic-seg.is-active { background: rgba(var(--kb-primary-rgb), .16); color: var(--kb-text); }
body.kb-stitch-app .aic-segs.is-small .aic-seg { height: 34px; font-size: 13px; }

body.kb-stitch-app .aic-bubble { display: flex; align-items: flex-end; gap: 10px; }
body.kb-stitch-app .aic-bubble p {
  margin: 0; padding: 10px 13px; border-radius: 16px 16px 16px 4px; font-size: 14px; font-weight: 600; line-height: 1.4;
  background: rgba(var(--kb-primary-rgb), .1); border: 1px solid rgba(var(--kb-primary-rgb), .2);
}

body.kb-stitch-app .aic-compose {
  padding: 12px 14px; border-radius: 18px; background: rgba(0, 0, 0, .14);
  border: 1.5px solid rgba(var(--kb-primary-rgb), .45);
  box-shadow: 0 0 0 4px rgba(var(--kb-primary-rgb), .07);
}
html.light body.kb-stitch-app .aic-compose { background: rgba(255, 255, 255, .6); }
body.kb-stitch-app .aic-compose textarea {
  width: 100%; min-height: 72px; box-sizing: border-box; padding: 0; border: 0 !important; border-radius: 0; resize: none; outline: none;
  background: transparent !important; color: var(--kb-text); font-size: 16px; font-weight: 600; line-height: 1.5; box-shadow: none !important;
}
body.kb-stitch-app .aic-compose-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
body.kb-stitch-app .aic-count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--kb-muted); }

body.kb-stitch-app .aic-chip {
  height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; min-width: 0;
  border: 1px solid var(--kb-line); border-radius: 12px; background: rgba(255, 255, 255, .05);
  color: var(--kb-text); font-size: 13px; font-weight: 800; white-space: nowrap;
}
body.kb-stitch-app .aic-chip span { overflow: hidden; text-overflow: ellipsis; }
body.kb-stitch-app .aic-chip.is-active { border-color: rgba(var(--kb-primary-rgb), .55); background: rgba(var(--kb-primary-rgb), .14); }
body.kb-stitch-app .aic-chip.is-flag { border: 1.5px solid #fbbf24; background: rgba(251, 191, 36, .1); }

body.kb-stitch-app .aic-hint { margin: -4px 0 0; font-size: 12.5px; font-weight: 600; line-height: 1.45; color: var(--kb-muted); }
body.kb-stitch-app .aic-hint b { color: var(--kb-text); }
body.kb-stitch-app .aic-examples { display: flex; flex-direction: column; gap: 8px; }
body.kb-stitch-app .aic-examples > span { font-size: 13px; font-weight: 800; color: var(--kb-muted); }
body.kb-stitch-app .aic-examples > div { display: flex; flex-wrap: wrap; gap: 8px; }
body.kb-stitch-app .aic-go { width: 100%; min-height: 52px; }

/* Voice: the mic sits in the compose row; while listening the box turns red and a stop button replaces "Baca dengan AI". */
body.kb-stitch-app .aic-mic-wrap { position: relative; display: inline-flex; }
body.kb-stitch-app .aic-mic {
  width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
  background: linear-gradient(135deg, #f4aeff, #7bd0ff); color: #1a0f1d; box-shadow: 0 6px 16px rgba(244, 174, 255, .3);
}
body.kb-stitch-app .aic-mic .aic-svg { width: 20px; height: 20px; stroke-width: 2.1; }
body.kb-stitch-app .aic-mic.is-again { background: rgba(255, 255, 255, .06); color: var(--kb-text); border: 1px solid var(--kb-line); box-shadow: none; }
body.kb-stitch-app .aic-mic-tip {
  position: absolute; right: 0; bottom: calc(100% + 8px); padding: 6px 10px; border-radius: 10px; white-space: nowrap;
  background: #f4aeff; color: #1a0f1d; font-size: 12px; font-weight: 800; pointer-events: none;
}
body.kb-stitch-app .aic-mic-tip::after { content: ''; position: absolute; right: 15px; bottom: -5px; width: 10px; height: 10px; background: #f4aeff; transform: rotate(45deg); }
body.kb-stitch-app .aic-compose.is-listening { border-color: rgba(251, 113, 133, .7); box-shadow: 0 0 0 4px rgba(251, 113, 133, .1); }
body.kb-stitch-app .aic-listen { display: grid; justify-items: center; gap: 8px; padding: 6px 0 4px; }
body.kb-stitch-app .aic-wave { display: flex; align-items: center; gap: 3px; height: 40px; }
body.kb-stitch-app .aic-wave i { width: 4px; height: 8px; border-radius: 2px; background: #f4aeff; animation: aicWave 900ms ease-in-out var(--d) infinite; }
body.kb-stitch-app .aic-wave i:nth-child(3n) { background: #7bd0ff; }
@keyframes aicWave { 0%, 100% { height: 6px; } 50% { height: 30px; } }
body.kb-stitch-app .aic-listen-state { margin: 0; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
body.kb-stitch-app .aic-rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #fb7185; animation: aicBlink 1s steps(2) infinite; }
@keyframes aicBlink { 50% { opacity: .25; } }
body.kb-stitch-app .aic-stop {
  width: 76px; height: 76px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #fb7185;
  box-shadow: 0 0 0 10px rgba(251, 113, 133, .18), 0 0 0 22px rgba(251, 113, 133, .07); margin: 10px 0 6px;
}
body.kb-stitch-app .aic-stop i { width: 26px; height: 26px; border-radius: 6px; background: #fff; }
body.kb-stitch-app .aic-listen-hint { margin: 0; font-size: 13px; font-weight: 700; color: var(--kb-muted); }
body.kb-stitch-app .aic-voice-note { margin: -4px 0 0; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #2dd4bf; }
body.kb-stitch-app .aic-voice-note svg { width: 16px; height: 16px; flex: 0 0 auto; }
body.kb-stitch-app .aic-voice-error {
  display: grid; gap: 4px; padding: 12px 14px; border-radius: 16px; background: rgba(251, 113, 133, .08); border: 1px solid rgba(251, 113, 133, .35);
}
body.kb-stitch-app .aic-voice-error b { font-size: 15px; }
body.kb-stitch-app .aic-voice-error span { font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--kb-muted); }
body.kb-stitch-app .aic-voice-error div { display: flex; gap: 16px; margin-top: 2px; }
body.kb-stitch-app .aic-link { padding: 6px 0; border: 0; background: transparent; color: #f4aeff; font-size: 13.5px; font-weight: 800; }
body.kb-stitch-app .aic-link.is-muted { color: var(--kb-muted); }
html.light body.kb-stitch-app .aic-link { color: var(--kb-primary); }
body.kb-stitch-app .aic-voice-intro { display: grid; justify-items: center; gap: 14px; padding-top: 6px; text-align: center; }
body.kb-stitch-app .aic-voice-intro p { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.5; color: var(--kb-muted); }
body.kb-stitch-app .aic-voice-intro p b, body.kb-stitch-app .aic-voice-privacy b { color: var(--kb-text); }
body.kb-stitch-app .aic-voice-badge { width: 66px; height: 66px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #f4aeff, #7bd0ff); color: #1a0f1d; }
body.kb-stitch-app .aic-voice-badge .aic-svg { width: 30px; height: 30px; stroke-width: 2; }
body.kb-stitch-app .aic-voice-privacy {
  display: flex; gap: 10px; text-align: left; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--kb-line);
  font-size: 13px; font-weight: 600; line-height: 1.45; color: var(--kb-muted);
}
body.kb-stitch-app .aic-voice-privacy .aic-svg { width: 18px; height: 18px; flex: 0 0 auto; color: #2dd4bf; }
body.kb-stitch-app .aic-voice-intro small { font-size: 12px; font-weight: 600; color: var(--kb-muted); }
@media (prefers-reduced-motion: reduce) {
  body.kb-stitch-app .aic-wave i, body.kb-stitch-app .aic-rec-dot { animation: none; }
  body.kb-stitch-app .aic-wave i { height: 14px; }
}

/* Reading: the typed text lights up while the cards are on their way. */
body.kb-stitch-app .aic-readtext {
  padding: 14px; border-radius: 18px; background: rgba(0, 0, 0, .14); border: 1px solid var(--kb-line);
  font-size: 16px; font-weight: 600; line-height: 1.8; overflow-wrap: anywhere;
}
html.light body.kb-stitch-app .aic-readtext { background: rgba(255, 255, 255, .6); }
body.kb-stitch-app .aic-readtext mark {
  padding: 1px 5px; border-radius: 6px; color: inherit; background: rgba(var(--kb-primary-rgb), .18);
  box-shadow: inset 0 -2px 0 var(--kb-primary); animation: aicMark .5s ease both;
}
body.kb-stitch-app .aic-readtext mark.is-date { background: rgba(var(--kb-accent-rgb), .18); box-shadow: inset 0 -2px 0 var(--kb-accent); }
body.kb-stitch-app .aic-readtext mark.is-doubt { background: rgba(251, 191, 36, .2); box-shadow: inset 0 -2px 0 #fbbf24; }
body.kb-stitch-app .aic-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; font-weight: 700; color: var(--kb-muted); }
body.kb-stitch-app .aic-legend span { display: inline-flex; align-items: center; gap: 5px; }
body.kb-stitch-app .aic-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--kb-primary); }
body.kb-stitch-app .aic-legend i.is-date { background: var(--kb-accent); }
body.kb-stitch-app .aic-legend i.is-doubt { background: #fbbf24; }
body.kb-stitch-app .aic-thinking { display: flex; align-items: center; gap: 10px; }
body.kb-stitch-app .aic-thinking b { display: block; font-size: 14.5px; }
body.kb-stitch-app .aic-thinking small { display: block; font-size: 12.5px; font-weight: 600; color: var(--kb-muted); }
body.kb-stitch-app .aic-skel {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; border: 1px solid var(--kb-line);
  background: rgba(255, 255, 255, .04); opacity: calc(1 - var(--i) * .28);
}
body.kb-stitch-app .aic-skel > span:first-child { width: 40px; height: 40px; border-radius: 13px; background: rgba(255, 255, 255, .08); }
body.kb-stitch-app .aic-skel > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 7px; }
body.kb-stitch-app .aic-skel > span:nth-child(2) i { display: block; height: 11px; border-radius: 6px; background: rgba(255, 255, 255, .07); }
body.kb-stitch-app .aic-skel > span:nth-child(2) i:first-child {
  width: 62%; background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(var(--kb-primary-rgb), .26), rgba(255,255,255,.06));
  background-size: 200% 100%; animation: aicShimmer 1.3s linear infinite;
}
body.kb-stitch-app .aic-skel > span:nth-child(2) i:last-child { width: 40%; }
body.kb-stitch-app .aic-skel > i { width: 64px; height: 14px; border-radius: 7px; background: rgba(255, 255, 255, .08); }

body.kb-stitch-app .aic-photo-read {
  position: relative; height: 240px; overflow: hidden; border-radius: 18px; background: #1d1612;
}
body.kb-stitch-app .aic-photo-read img { width: 100%; height: 100%; object-fit: contain; }
body.kb-stitch-app .aic-sweep,
body.kb-stitch-app .kb-scanner-line {
  position: absolute; left: 8px; right: 8px; top: 12%; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--kb-stitch-primary, #f4aeff), var(--kb-stitch-secondary, #7bd0ff));
  box-shadow: 0 0 18px 4px rgba(244, 174, 255, .55);
  animation: aicSweep 2.2s ease-in-out infinite alternate;
}

/* Review: one card per transaction, every part editable in place. */
body.kb-stitch-app .aic-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px; display: flex; flex-direction: column; gap: 12px; }
body.kb-stitch-app .aic-source {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px;
  border: 1px dashed var(--kb-line); background: transparent; color: var(--kb-muted); font-size: 13px; font-weight: 600; text-align: left;
}
body.kb-stitch-app .aic-source span { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.kb-stitch-app .aic-source b { flex: 0 0 auto; color: var(--kb-primary); }
body.kb-stitch-app .aic-rows { display: flex; flex-direction: column; gap: 10px; }
body.kb-stitch-app .aic-row {
  display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 18px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--kb-line);
  animation: kbRiseIn .46s cubic-bezier(.22, 1.18, .36, 1) both; animation-delay: calc(var(--i, 0) * 70ms);
}
body.kb-stitch-app .aic-row.has-flag { border-color: rgba(251, 191, 36, .45); }
body.kb-stitch-app .aic-row.is-open { border-color: rgba(var(--kb-primary-rgb), .45); }
body.kb-stitch-app .aic-row-top { display: flex; align-items: center; gap: 10px; }
body.kb-stitch-app .aic-row .kb-tile { width: 38px; height: 38px; border-radius: 12px; font-size: 18px; }
body.kb-stitch-app .aic-row .kb-tile .kb-glyph { width: 19px; height: 19px; }
body.kb-stitch-app .aic-desc {
  flex: 1 1 auto; min-width: 0; height: 38px; display: flex; align-items: center; gap: 6px; padding: 0 10px;
  border: 1px solid var(--kb-line); border-radius: 11px; color: var(--kb-muted);
}
body.kb-stitch-app .aic-desc:focus-within { border-color: rgba(var(--kb-primary-rgb), .6); }
body.kb-stitch-app .aic-desc input {
  flex: 1 1 auto; min-width: 0; height: 100%; padding: 0; border: 0 !important; outline: none; box-shadow: none !important;
  background: transparent !important; color: var(--kb-text); font-size: 15px; font-weight: 800;
}
body.kb-stitch-app .aic-row-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
body.kb-stitch-app .aic-row-chips .aic-chip { height: 38px; max-width: 100%; }
body.kb-stitch-app .aic-cat { color: var(--trx-color, var(--kb-text)); }
body.kb-stitch-app .aic-amount {
  height: 38px; display: inline-flex; align-items: center; gap: 2px; padding: 0 10px; border-radius: 11px;
  border: 1px solid var(--kb-line); background: rgba(255, 255, 255, .04); font-weight: 900; font-variant-numeric: tabular-nums;
}
body.kb-stitch-app .aic-amount:focus-within { border-color: rgba(var(--kb-primary-rgb), .6); }
body.kb-stitch-app .aic-amount.is-flag { border: 1.5px solid #fbbf24; background: rgba(251, 191, 36, .08); }
body.kb-stitch-app .aic-amount.is-expense { color: var(--kb-expense); }
body.kb-stitch-app .aic-amount.is-income { color: var(--kb-income); }
body.kb-stitch-app .aic-amount input {
  width: 9ch; field-sizing: content; min-width: 4ch; max-width: 14ch; padding: 0; border: 0 !important; outline: none; box-shadow: none !important; background: transparent !important;
  color: inherit; font: inherit; font-size: 16px;
}
body.kb-stitch-app .aic-flag-note {
  display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: 12.5px; font-weight: 700; line-height: 1.4; color: #fbbf24;
}
html.light body.kb-stitch-app .aic-flag-note { color: #a16207; }
body.kb-stitch-app .aic-panel { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; border-top: 1px solid var(--kb-line); }
body.kb-stitch-app .aic-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
body.kb-stitch-app .aic-cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-height: 236px; overflow-y: auto; padding: 2px; }
body.kb-stitch-app .aic-cat-tile {
  min-width: 0; height: 74px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 6px 4px;
  border: 1px solid var(--kb-line); border-radius: 15px; background: rgba(255, 255, 255, .03); color: var(--kb-text);
}
body.kb-stitch-app .aic-cat-tile.is-active { border: 2px solid var(--kb-primary); background: rgba(var(--kb-primary-rgb), .1); }
body.kb-stitch-app .aic-cat-tile .kb-tile { width: 32px; height: 32px; border-radius: 10px; font-size: 16px; }
body.kb-stitch-app .aic-cat-tile .kb-tile .kb-glyph { width: 17px; height: 17px; }
body.kb-stitch-app .aic-cat-name { max-width: 100%; overflow: hidden; font-size: 11.5px; font-weight: 800; white-space: nowrap; text-overflow: ellipsis; }
body.kb-stitch-app .aic-add {
  height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent;
  color: var(--kb-primary); font-size: 14px; font-weight: 800;
}
body.kb-stitch-app .aic-foot { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--kb-line); }
body.kb-stitch-app .aic-foot p { display: flex; justify-content: space-between; gap: 12px; margin: 0; font-size: 13.5px; font-weight: 800; color: var(--kb-muted); }
body.kb-stitch-app .aic-foot .kb-primary-action { width: 100%; min-height: 52px; }
body.kb-stitch-app .aic-card .is-expense { color: var(--kb-expense); }
body.kb-stitch-app .aic-card .is-income { color: var(--kb-income); }

body.kb-stitch-app .aic-receipt { display: flex; align-items: center; gap: 12px; }
body.kb-stitch-app .aic-receipt-photo {
  flex: 0 0 auto; width: 64px; height: 84px; padding: 0; overflow: hidden; border-radius: 12px; border: 1px solid var(--kb-line); background: #1d1612;
}
body.kb-stitch-app .aic-receipt-photo img { width: 100%; height: 100%; object-fit: cover; }
body.kb-stitch-app .aic-receipt-text { flex: 1 1 auto; min-width: 0; }
body.kb-stitch-app .aic-receipt-text b { display: block; font-size: 17px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.kb-stitch-app .aic-receipt-text small { font-size: 12.5px; font-weight: 600; color: var(--kb-muted); }
body.kb-stitch-app .aic-switch {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--kb-line); color: var(--kb-primary); cursor: pointer;
}
body.kb-stitch-app .aic-switch > span { flex: 1 1 auto; color: var(--kb-text); }
body.kb-stitch-app .aic-switch b { display: block; font-size: 14.5px; }
body.kb-stitch-app .aic-switch small { display: block; font-size: 12.5px; font-weight: 600; color: var(--kb-muted); }
body.kb-stitch-app .aic-switch input { position: absolute; opacity: 0; width: 46px; height: 28px; right: 14px; margin: 0; cursor: pointer; }
body.kb-stitch-app .aic-switch > i {
  flex: 0 0 auto; position: relative; width: 46px; height: 28px; border-radius: 14px; background: rgba(255, 255, 255, .14); transition: background .2s ease;
}
body.kb-stitch-app .aic-switch > i::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--kb-muted); transition: transform .2s ease, background .2s ease;
}
body.kb-stitch-app .aic-switch input:checked + i { background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent)); }
body.kb-stitch-app .aic-switch input:checked + i::after { transform: translateX(18px); background: #fff; }
body.kb-stitch-app .aic-switch input:focus-visible + i { outline: 2px solid var(--kb-primary); outline-offset: 2px; }
body.kb-stitch-app .aic-lines { border-radius: 14px; border: 1px solid var(--kb-line); padding: 4px 12px; }
body.kb-stitch-app .aic-lines summary { padding: 8px 0; font-size: 13.5px; font-weight: 800; cursor: pointer; }
body.kb-stitch-app .aic-lines ul { margin: 0; padding: 0 0 8px; list-style: none; }
body.kb-stitch-app .aic-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 13px; font-weight: 600; color: var(--kb-muted); }

/* Opens from the AI sheet, so it sits above every sheet (on phones they are z-index 84). */
body.kb-stitch-app .aic-lightbox {
  position: fixed; inset: 0; z-index: 96; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .86);
}
body.kb-stitch-app .aic-lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }
body.kb-stitch-app .aic-lightbox button { position: absolute; top: 16px; right: 16px; background: rgba(0, 0, 0, .5); color: #fff; }

/* Saved: where it went, with undo and a jump to that day. */
body.kb-stitch-app .aic-saved { display: flex; flex-direction: column; align-items: stretch; gap: 12px; text-align: center; }
body.kb-stitch-app .aic-saved h2 { margin: 0; font-size: 22px; font-weight: 900; }
body.kb-stitch-app .aic-saved > p { margin: -6px 0 0; font-size: 13.5px; font-weight: 600; color: var(--kb-muted); }
body.kb-stitch-app .aic-burst { position: relative; height: 92px; display: flex; justify-content: center; align-items: flex-end; }
body.kb-stitch-app .aic-burst > svg { animation: kbRiseIn .5s cubic-bezier(.22, 1.18, .36, 1) both; }
body.kb-stitch-app .aic-burst i { position: absolute; top: 40px; left: 50%; width: 8px; height: 13px; border-radius: 2px; animation: aicBurst .9s ease-out both; }
body.kb-stitch-app .aic-burst i:nth-child(1) { background: #f7d06f; --x: -70px; --y: -34px; --r: -30deg; }
body.kb-stitch-app .aic-burst i:nth-child(2) { background: var(--kb-accent); --x: -48px; --y: 8px; --r: 40deg; border-radius: 50%; width: 8px; height: 8px; }
body.kb-stitch-app .aic-burst i:nth-child(3) { background: var(--kb-income); --x: 62px; --y: -36px; --r: 30deg; }
body.kb-stitch-app .aic-burst i:nth-child(4) { background: var(--kb-primary); --x: 52px; --y: 6px; --r: -20deg; border-radius: 50%; width: 9px; height: 9px; }
body.kb-stitch-app .aic-burst i:nth-child(5) { background: var(--kb-expense); --x: -6px; --y: -44px; --r: 10deg; border-radius: 50%; width: 6px; height: 6px; }
body.kb-stitch-app .aic-saved-list { margin: 0; padding: 2px 14px; list-style: none; border-radius: 18px; background: rgba(255, 255, 255, .05); border: 1px solid var(--kb-line); text-align: left; }
body.kb-stitch-app .aic-saved-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
body.kb-stitch-app .aic-saved-list li + li { border-top: 1px solid var(--kb-line); }
body.kb-stitch-app .aic-saved-list .kb-tile { width: 36px; height: 36px; border-radius: 12px; font-size: 17px; }
body.kb-stitch-app .aic-saved-text { flex: 1 1 auto; min-width: 0; }
body.kb-stitch-app .aic-saved-text b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.kb-stitch-app .aic-saved-text small { font-size: 12px; font-weight: 600; color: var(--kb-muted); }
body.kb-stitch-app .aic-saved-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; }
body.kb-stitch-app .aic-saved-actions > * { min-height: 50px; }

/* Desktop scan: a drop zone with tips. */
body.kb-stitch-app .aic-scan-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: center; }
body.kb-stitch-app .aic-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 280px; padding: 18px;
  border-radius: 22px; border: 2px dashed rgba(var(--kb-primary-rgb), .5); text-align: center; cursor: pointer;
  background: radial-gradient(400px 220px at 50% 40%, rgba(var(--kb-primary-rgb), .1), transparent 70%);
  transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}
body.kb-stitch-app .aic-drop:hover, body.kb-stitch-app .aic-drop.is-over { border-color: var(--kb-primary); background-color: rgba(var(--kb-primary-rgb), .08); }
body.kb-stitch-app .aic-drop.is-over { transform: scale(1.01); }
body.kb-stitch-app .aic-drop:focus-visible { outline: 3px solid var(--kb-primary); outline-offset: 3px; }
body.kb-stitch-app .aic-drop strong { font-size: 18px; font-weight: 900; }
body.kb-stitch-app .aic-drop-or { font-size: 13px; color: var(--kb-muted); }
body.kb-stitch-app .aic-drop small { font-size: 12.5px; font-weight: 600; color: var(--kb-muted); }
body.kb-stitch-app .aic-drop-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 14px;
  border: 1px solid var(--kb-line); background: rgba(255, 255, 255, .05); color: var(--kb-primary); font-size: 14.5px; font-weight: 800;
}
body.kb-stitch-app .aic-drop-art { position: relative; width: 72px; height: 92px; border-radius: 9px; background: #fdfcf8; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); overflow: hidden; }
body.kb-stitch-app .aic-drop-art i { position: absolute; left: 11px; height: 4px; border-radius: 2px; background: #cdc6b6; }
body.kb-stitch-app .aic-drop-art i:nth-child(1) { top: 14px; right: 22px; }
body.kb-stitch-app .aic-drop-art i:nth-child(2) { top: 26px; right: 12px; }
body.kb-stitch-app .aic-drop-art i:nth-child(3) { top: 38px; right: 30px; }
body.kb-stitch-app .aic-drop-art i:nth-child(4) { top: 50px; right: 12px; }
body.kb-stitch-app .aic-drop-art i:nth-child(5) { top: 66px; right: 18px; }
body.kb-stitch-app .aic-drop-art b {
  position: absolute; left: 0; right: 0; top: 12px; height: 3px;
  background: linear-gradient(90deg, #f4aeff, #7bd0ff); box-shadow: 0 0 14px 3px rgba(244, 174, 255, .6);
  animation: aicSweep 2s ease-in-out infinite alternate;
}
body.kb-stitch-app .aic-tips { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 16px; text-align: left; }
body.kb-stitch-app .aic-tips li { display: flex; gap: 12px; align-items: flex-start; }
body.kb-stitch-app .aic-tips li > span:first-child { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: rgba(var(--kb-primary-rgb), .12); color: var(--kb-primary); }
body.kb-stitch-app .aic-tips b { display: block; font-size: 14.5px; }
body.kb-stitch-app .aic-tips small { font-size: 13px; font-weight: 600; color: var(--kb-muted); }

@media (min-width: 769px) {
  body.kb-stitch-app #modal-ai > .aic-card[data-mode="scan"][data-stage="input"] { max-width: 820px; }
}

@media (max-width: 768px) {
  body.kb-stitch-app #modal-ai > .aic-card {
    max-width: none; max-height: 92dvh; border-radius: 26px 26px 0 0 !important;
    padding: 30px 16px calc(18px + env(safe-area-inset-bottom)) !important;
  }
  body.kb-stitch-app .aic-scan-grid { grid-template-columns: 1fr; }
  body.kb-stitch-app .aic-drop { min-height: 220px; }
}

/* ── Receipt camera (phones): the QRIS-style scanner ─────────────────────────────── */
.kb-scanner {
  position: fixed; inset: 0; z-index: 65; overflow: hidden; color: #f5eaf3; background: #000;
  font-family: inherit;
}
.kb-scanner[hidden] { display: none; }
body.kb-scanner-open { overflow: hidden; }
.kb-scanner svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.kb-scanner-stage { position: absolute; inset: 0; background: radial-gradient(600px 500px at 50% 45%, #2a211d, #0d0a09 70%); }
.kb-scanner-video, .kb-scanner-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kb-scanner-still { display: none; object-fit: contain; background: #0d0a09; }
.kb-scanner[data-state="reading"] .kb-scanner-still, .kb-scanner[data-state="error"] .kb-scanner-still { display: block; }
.kb-scanner[data-state="reading"] .kb-scanner-video, .kb-scanner[data-state="error"] .kb-scanner-video { visibility: hidden; }
.kb-scanner-frame {
  position: absolute; left: 50%; top: calc(50% - 50px); width: min(78vw, 320px, 38vh); aspect-ratio: 2 / 3;
  transform: translate(-50%, -50%); border-radius: 18px; box-shadow: 0 0 0 200vmax rgba(10, 6, 12, .58);
}
.kb-scanner[data-state="reading"] .kb-scanner-frame, .kb-scanner[data-state="error"] .kb-scanner-frame { box-shadow: 0 0 0 200vmax rgba(10, 6, 12, .35); }
.kb-scanner-frame > i:is(.tl, .tr, .bl, .br) { position: absolute; width: 44px; height: 44px; box-sizing: border-box; border-style: solid; border-width: 0; border-color: #f4aeff; }
.kb-scanner-frame > i.tl { top: -3px; left: -3px; border-width: 4px 0 0 4px; border-radius: 18px 0 0 0; }
.kb-scanner-frame > i.tr { top: -3px; right: -3px; border-width: 4px 4px 0 0; border-radius: 0 18px 0 0; }
.kb-scanner-frame > i.bl { bottom: -3px; left: -3px; border-width: 0 0 4px 4px; border-radius: 0 0 0 18px; border-color: #7bd0ff; }
.kb-scanner-frame > i.br { bottom: -3px; right: -3px; border-width: 0 4px 4px 0; border-radius: 0 0 18px 0; border-color: #7bd0ff; }
.kb-scanner[data-state="live"] .kb-scanner-frame > i:is(.tl, .tr, .bl, .br) { animation: aicCorner 2.4s ease-in-out infinite; }
.kb-scanner[data-state="starting"] .kb-scanner-line, .kb-scanner[data-state="nocam"] .kb-scanner-line, .kb-scanner[data-state="error"] .kb-scanner-line { display: none; }
.kb-scanner-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.kb-scanner.is-flashing .kb-scanner-flash { animation: aicFlash .35s ease-out; }
.kb-scanner-top {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 16px; right: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.kb-scanner-top h2 { margin: 0; font-size: 17px; font-weight: 900; }
.kb-scanner-btn {
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .22); background: rgba(0, 0, 0, .42); color: #fff;
}
.kb-scanner-btn[aria-pressed="true"] { background: #fde68a; color: #1a0f1d; }
.kb-scanner-btn[hidden] { visibility: hidden; display: grid; }
.kb-scanner-hint {
  position: absolute; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 9px 14px; border-radius: 20px;
  background: rgba(0, 0, 0, .52); font-size: 13.5px; font-weight: 700; white-space: nowrap;
}
.kb-scanner:not([data-state="live"]) .kb-scanner-hint { display: none; }
.kb-scanner-controls {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 0 34px calc(34px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .7));
  padding-top: 40px;
}
.kb-scanner:is([data-state="reading"], [data-state="error"], [data-state="nocam"]) .kb-scanner-controls { visibility: hidden; }
.kb-scanner-side {
  width: 52px; height: 52px; display: grid; place-items: center; padding: 0; border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, .7); background: rgba(58, 47, 42, .8); color: #fff;
}
.kb-scanner-side.is-round { border-radius: 50%; border-width: 1px; border-color: rgba(255, 255, 255, .3); background: rgba(0, 0, 0, .4); }
.kb-scanner-shutter { width: 80px; height: 80px; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 4px solid #fff; background: transparent; }
.kb-scanner-shutter span { width: 62px; height: 62px; border-radius: 50%; background: linear-gradient(135deg, #f4aeff, #7bd0ff); transition: transform .15s ease; }
.kb-scanner-shutter:active span { transform: scale(.88); }
.kb-scanner[data-state="starting"] .kb-scanner-shutter { opacity: .45; }
.kb-scanner-quota { position: absolute; left: 0; right: 0; bottom: calc(10px + env(safe-area-inset-bottom)); margin: 0; text-align: center; font-size: 12px; font-weight: 700; color: #c9b5c7; }
.kb-scanner:not([data-state="live"]):not([data-state="starting"]) .kb-scanner-quota { display: none; }
.kb-scanner-panel {
  position: absolute; left: 16px; right: 16px; bottom: calc(22px + env(safe-area-inset-bottom)); padding: 16px; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 12px; border-radius: 22px; background: rgba(29, 18, 32, .95); border: 1px solid rgba(244, 174, 255, .25);
  animation: kbRiseIn .4s cubic-bezier(.22, 1.18, .36, 1) both;
}
.kb-scanner-panel[hidden] { display: none; }
.kb-scanner-panel-head { display: flex; align-items: center; gap: 10px; }
.kb-scanner-panel-head b { flex: 1 1 auto; font-size: 15.5px; line-height: 1.35; }
.kb-scanner-panel-head button { border: 0; background: transparent; color: #f4aeff; font-size: 14px; font-weight: 800; }
.kb-scanner-panel p { margin: 0; font-size: 13.5px; font-weight: 600; line-height: 1.45; color: #c9b5c7; }
.kb-scanner-panel-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }
.kb-scanner-panel-actions > * { min-height: 48px; }
.kb-scanner-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.kb-scanner-steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: #9d8a9c; }
.kb-scanner-steps li.is-done, .kb-scanner-steps li.is-now { color: #f5eaf3; }
.kb-scanner-steps i { flex: 0 0 auto; width: 22px; height: 22px; box-sizing: border-box; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .25); }
.kb-scanner-steps li.is-done i { border: 0; background: #2dd4bf; color: #1a0f1d; }
.kb-scanner-steps li.is-done i svg { width: 13px; height: 13px; stroke-width: 3; }
.kb-scanner-steps li.is-now i { border: 3px solid rgba(244, 174, 255, .25); border-top-color: #f4aeff; animation: aicSpin .8s linear infinite; }

/* New rows on Transaksi glow for a moment after "Lihat hari itu". */
body.kb-stitch-app .trx-item.is-new .kb-swipe-content {
  background: rgba(var(--kb-primary-rgb), .1);
  box-shadow: inset 3px 0 0 var(--kb-primary);
  animation: aicGlow 2.4s ease-out 1;
}
body.kb-stitch-app .trx-new-badge {
  margin-left: 6px; padding: 2px 7px; border-radius: 8px; vertical-align: 2px;
  background: rgba(var(--kb-primary-rgb), .16); color: var(--kb-primary); font-size: 11px; font-weight: 800;
}

@keyframes aicShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes aicSweep { from { top: 10%; } to { top: 86%; } }
@keyframes aicMark { from { background-color: transparent; box-shadow: inset 0 0 0 transparent; } }
@keyframes aicBurst { from { transform: translate(-50%, 0) rotate(0); opacity: 0; } 30% { opacity: 1; } to { transform: translate(calc(-50% + var(--x)), var(--y)) rotate(var(--r)); opacity: 1; } }
@keyframes aicFlash { from { opacity: .85; } to { opacity: 0; } }
@keyframes aicCorner { 50% { opacity: .55; } }
@keyframes aicSpin { to { transform: rotate(360deg); } }
@keyframes aicGlow { from { box-shadow: inset 3px 0 0 var(--kb-primary), 0 0 0 4px rgba(var(--kb-primary-rgb), .25); } }

@media (prefers-reduced-motion: reduce) {
  body.kb-stitch-app :is(.aic-row, .aic-burst > svg, .aic-readtext mark),
  .kb-scanner-panel { animation: none !important; }
  body.kb-stitch-app .aic-burst i { animation: none; opacity: 0; }
  body.kb-stitch-app :is(.aic-sweep, .aic-drop-art b), .kb-scanner-line { animation: none; top: 50%; }
  body.kb-stitch-app .aic-skel > span:nth-child(2) i:first-child { animation: none; }
  .kb-scanner-frame > i:is(.tl, .tr, .bl, .br) { animation: none !important; }
  .kb-scanner.is-flashing .kb-scanner-flash { animation: none; }
  .kb-scanner-steps li.is-now i { animation-duration: 2.4s; }
}

/* The install pill floats above everything; it would cover the main button of an open sheet. */
body:is(.kb-modal-open, .kb-mobile-ai-open, .kb-mobile-panel-open, .kb-scanner-open, .kb-notif-open, .kb-automation-sheet-open) #pwa-install-btn { display: none !important; }

/* ── Meeny: charts and cards under an answer ─────────────────────────────────────── */
body.kb-stitch-app .mn-extras { grid-column: 2; display: flex; flex-direction: column; gap: 10px; margin-top: 10px; max-width: 560px; }
body.kb-stitch-app .mn-extras.is-new > * { animation: kbRiseIn .46s cubic-bezier(.22, 1.18, .36, 1) both; }
body.kb-stitch-app .mn-extras.is-new > *:nth-child(2) { animation-delay: 80ms; }
body.kb-stitch-app .mn-extras.is-new > *:nth-child(3) { animation-delay: 160ms; }
body.kb-stitch-app .mn-extras.is-new > *:nth-child(n+4) { animation-delay: 240ms; }
body.kb-stitch-app .mn-extras svg:not(.mn-report-chart) { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.kb-stitch-app .mn-looked {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin: 0; padding: 5px 10px; border-radius: 10px;
  background: rgba(255, 255, 255, .05); font-size: 12px; font-weight: 700; color: var(--kb-muted);
}
body.kb-stitch-app .mn-looked svg { width: 13px !important; height: 13px !important; }
body.kb-stitch-app .mn-visual {
  display: flex; flex-direction: column; gap: 11px; padding: 14px; border-radius: 18px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--kb-line);
}
body.kb-stitch-app .mn-visual header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
body.kb-stitch-app .mn-visual header b { font-size: 15px; font-weight: 900; }
body.kb-stitch-app .mn-visual header small { font-size: 12px; font-weight: 700; color: var(--kb-muted); }
body.kb-stitch-app .mn-visual footer { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; font-weight: 700; color: var(--kb-muted); }
body.kb-stitch-app .mn-visual footer span { display: inline-flex; align-items: center; gap: 6px; }
body.kb-stitch-app .mn-visual footer i { width: 14px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .3); }
body.kb-stitch-app .mn-visual footer i.is-now { height: 6px; background: var(--kb-primary); }
body.kb-stitch-app .mn-visual footer i.is-projection { height: 0; border-top: 2px dashed var(--kb-primary); background: transparent; }
body.kb-stitch-app .mn-compare-row { display: flex; flex-direction: column; gap: 5px; }
body.kb-stitch-app .mn-compare-row > span:first-child { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
body.kb-stitch-app .mn-compare-row > span:first-child b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.kb-stitch-app .mn-compare-row > span:first-child .num { font-weight: 800; white-space: nowrap; }
body.kb-stitch-app .mn-compare-row small { color: var(--kb-muted); font-weight: 700; }
body.kb-stitch-app .mn-compare-row.is-warn > span:first-child small { color: #fb923c; }
body.kb-stitch-app .mn-bar { display: block; height: 9px; border-radius: 5px; background: rgba(255, 255, 255, .06); overflow: hidden; }
body.kb-stitch-app .mn-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--kb-primary), var(--kb-accent)); transform-origin: left; animation: mnGrow .7s cubic-bezier(.22, 1, .36, 1) both; }
body.kb-stitch-app .mn-bar.is-thin { height: 5px; }
body.kb-stitch-app .mn-bar.is-thin i { background: rgba(255, 255, 255, .28); }
body.kb-stitch-app .mn-mini-list { margin: 0; padding: 0; list-style: none; }
body.kb-stitch-app .mn-mini-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
body.kb-stitch-app .mn-mini-list li + li { border-top: 1px solid var(--kb-line); }
body.kb-stitch-app .mn-mini-list span { min-width: 0; }
body.kb-stitch-app .mn-mini-list span b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.kb-stitch-app .mn-mini-list small { font-size: 12px; font-weight: 600; color: var(--kb-muted); }
body.kb-stitch-app .mn-extras .is-expense { color: var(--kb-expense); }
body.kb-stitch-app .mn-extras .is-income { color: var(--kb-income); }

body.kb-stitch-app .mn-report { background: linear-gradient(160deg, rgba(var(--kb-primary-rgb), .14), rgba(255, 255, 255, .03)); border-color: rgba(var(--kb-primary-rgb), .35); }
body.kb-stitch-app :is(.mn-plus-badge, .mn-free-badge) {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 8px; font-size: 11px; font-weight: 800; white-space: nowrap;
  background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent)); color: #1a0f1d;
}
body.kb-stitch-app .mn-free-badge { background: rgba(255, 255, 255, .1); color: var(--kb-muted); }
body.kb-stitch-app .mn-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
body.kb-stitch-app .mn-kpis > span { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid var(--kb-line); min-width: 0; }
body.kb-stitch-app .mn-kpis small { font-size: 11.5px; font-weight: 800; color: var(--kb-muted); }
body.kb-stitch-app .mn-kpis b { font-size: 15px; font-weight: 900; overflow-wrap: anywhere; line-height: 1.25; }
body.kb-stitch-app .mn-kpis em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--kb-muted); line-height: 1.3; }
body.kb-stitch-app .mn-extras .mn-report-chart { display: block; width: 100% !important; height: 110px !important; overflow: visible; }
body.kb-stitch-app .mn-report-chart polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
body.kb-stitch-app .mn-report-chart .is-before { stroke: rgba(255, 255, 255, .3); stroke-width: 2; stroke-dasharray: 4 4; }
body.kb-stitch-app .mn-report-chart .is-now { stroke: var(--kb-primary); stroke-width: 3; stroke-dasharray: 1; animation: mnDraw 1.1s ease-out both; }
body.kb-stitch-app .mn-report-chart .is-projection { stroke: var(--kb-primary); stroke-width: 2; stroke-dasharray: 2 5; opacity: .7; }
body.kb-stitch-app .mn-report-plot { position: relative; }
body.kb-stitch-app .mn-report-today {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: var(--kb-primary); box-shadow: 0 0 0 4px rgba(var(--kb-primary-rgb), .25);
}
html.light body.kb-stitch-app .mn-report-chart .is-before { stroke: rgba(38, 21, 38, .3); }

body.kb-stitch-app .mn-card {
  display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 18px;
  background: linear-gradient(160deg, rgba(var(--kb-primary-rgb), .12), rgba(255, 255, 255, .03)); border: 1px solid rgba(var(--kb-primary-rgb), .38);
}
body.kb-stitch-app .mn-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
body.kb-stitch-app .mn-card header b { font-size: 15px; font-weight: 900; }
body.kb-stitch-app .mn-card-state { padding: 3px 8px; border-radius: 8px; background: rgba(251, 191, 36, .14); color: #fbbf24; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
html.light body.kb-stitch-app .mn-card-state { color: #a16207; }
body.kb-stitch-app .mn-card-rows { margin: 0; padding: 0; list-style: none; }
body.kb-stitch-app .mn-card-rows li { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
body.kb-stitch-app .mn-card-rows li + li { border-top: 1px solid var(--kb-line); }
body.kb-stitch-app .mn-card-rows .kb-tile { width: 36px; height: 36px; border-radius: 12px; font-size: 17px; }
body.kb-stitch-app .mn-card-row-text { flex: 1 1 auto; min-width: 0; }
body.kb-stitch-app .mn-card-row-text b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.kb-stitch-app .mn-card-row-text small { font-size: 12px; font-weight: 600; color: var(--kb-muted); }
body.kb-stitch-app .mn-card-amount {
  display: inline-flex; align-items: center; gap: 3px; height: 38px; padding: 0 10px; border-radius: 11px;
  border: 1px solid var(--kb-line); background: rgba(255, 255, 255, .04); font-weight: 900; font-variant-numeric: tabular-nums;
}
body.kb-stitch-app .mn-card-amount:focus-within { border-color: rgba(var(--kb-primary-rgb), .6); }
body.kb-stitch-app .mn-card-amount input {
  width: 9ch; field-sizing: content; min-width: 4ch; max-width: 13ch; padding: 0; border: 0 !important; outline: none; box-shadow: none !important;
  background: transparent !important; color: var(--kb-text); font: inherit; font-size: 15px;
}
body.kb-stitch-app .mn-card-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 800; color: var(--kb-muted); min-width: 0; }
body.kb-stitch-app .mn-card-field > input {
  height: 40px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--kb-line) !important; background: rgba(255, 255, 255, .04) !important;
  color: var(--kb-text); font-size: 15px; font-weight: 800; box-sizing: border-box; width: 100%;
}
body.kb-stitch-app .mn-card-field .mn-card-amount { height: 40px; }
body.kb-stitch-app .mn-card-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
body.kb-stitch-app .mn-card-note { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: 12.5px; font-weight: 700; line-height: 1.4; color: #fbbf24; }
body.kb-stitch-app .mn-card-note.is-calm { color: var(--kb-muted); }
body.kb-stitch-app .mn-card-progress { font-size: 12px; font-weight: 700; color: var(--kb-muted); margin-top: -4px; }
body.kb-stitch-app .mn-card-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 8px; }
body.kb-stitch-app .mn-card-actions > * { min-height: 44px; }
body.kb-stitch-app .mn-card.is-saved {
  flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px;
  background: rgba(45, 212, 191, .08); border-color: rgba(45, 212, 191, .35);
}
body.kb-stitch-app .mn-card-check { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--kb-income); color: #1a0f1d; }
body.kb-stitch-app .mn-card-check svg { width: 15px !important; height: 15px !important; stroke-width: 3 !important; }
body.kb-stitch-app .mn-card-saved-text { flex: 1 1 auto; min-width: 0; }
body.kb-stitch-app .mn-card-saved-text b { display: block; font-size: 13.5px; }
body.kb-stitch-app .mn-card-saved-text small { display: block; font-size: 12px; font-weight: 600; color: var(--kb-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.kb-stitch-app .mn-link { border: 0; background: transparent; color: var(--kb-primary); font-size: 13.5px; font-weight: 800; padding: 6px; }
body.kb-stitch-app .mn-card.is-dismissed { padding: 8px 12px; background: transparent; border-style: dashed; border-color: var(--kb-line); color: var(--kb-muted); font-size: 12.5px; font-weight: 700; }

/* Free vs Plus sheet and the one-tap starters. */
body.kb-stitch-app .mn-model-sheet { display: flex; flex-direction: column; gap: 12px; }
body.kb-stitch-app .mn-model-option {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 18px; text-align: left; color: var(--kb-text);
  border: 1px solid var(--kb-line); background: rgba(255, 255, 255, .03);
}
body.kb-stitch-app .mn-model-option.is-on { border-color: rgba(var(--kb-primary-rgb), .55); background: rgba(var(--kb-primary-rgb), .08); }
body.kb-stitch-app .mn-model-option > svg { width: 18px; height: 18px; fill: none; stroke: var(--kb-muted); stroke-width: 2; flex: 0 0 auto; }
body.kb-stitch-app .mn-model-option-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 7px; }
body.kb-stitch-app .mn-model-option-title { display: flex; align-items: center; gap: 8px; }
body.kb-stitch-app .mn-model-option-title b { font-size: 17px; font-weight: 900; }
body.kb-stitch-app .mn-model-option-line { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--kb-muted); }
body.kb-stitch-app .mn-model-option-line svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: var(--kb-income); stroke-width: 2.4; margin-top: 2px; }
body.kb-stitch-app .mn-model-option-on { width: 22px; height: 22px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent)); color: #1a0f1d; }
body.kb-stitch-app .mn-model-option-on svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; }
body.kb-stitch-app .mn-model-sheet .kb-primary-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
body.kb-stitch-app .mn-card-date {
  height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--kb-line);
  background: rgba(255, 255, 255, .04); color: var(--kb-text); font-size: 14px; font-weight: 800; min-width: 0;
}
body.kb-stitch-app .mn-card-date span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.kb-stitch-app[data-page="meeny"] #pwa-install-btn { display: none !important; }
body.kb-stitch-app .mn-model-note { margin: 0; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--kb-muted); }
body.kb-stitch-app .mn-starter { display: inline-flex; align-items: center; gap: 8px; }
body.kb-stitch-app .mn-starter svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: var(--kb-primary); stroke-width: 2; }
body.kb-stitch-app .mn-starter.is-deep { border-color: rgba(var(--kb-primary-rgb), .45); background: rgba(var(--kb-primary-rgb), .1); }
body.kb-stitch-app .mn-deep-chip .mn-plus-badge { padding: 2px 6px; font-size: 10px; }
body.kb-stitch-app .aic-source.is-meeny { margin: 0; border-style: solid; }

@media (max-width: 768px) {
  body.kb-stitch-app .mn-extras { grid-column: 1 / -1; max-width: none; }
  body.kb-stitch-app .mn-kpis b { font-size: 13.5px; }
  body.kb-stitch-app .mn-starters { flex-direction: column; align-items: stretch; }
  body.kb-stitch-app .mn-starter { justify-content: flex-start; min-height: 46px; border-radius: 14px; }
  body.kb-stitch-app .mn-starter.is-deep .mn-plus-badge { margin-left: auto; }
}

@keyframes mnGrow { from { transform: scaleX(0); } }
@keyframes mnDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  body.kb-stitch-app .mn-extras.is-new > *, body.kb-stitch-app .mn-bar i, body.kb-stitch-app .mn-report-chart .is-now { animation: none !important; }
}

/* ── Home (v1.4.51): one-row greeting with the avatar, a calmer hero, first steps ──── */
body.kb-stitch-app .kb-avatar {
  width: var(--kb-avatar-size, 44px); height: var(--kb-avatar-size, 44px); flex: 0 0 auto;
  display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #2a1830;
}
body.kb-stitch-app .kb-avatar :is(svg, img) { width: 100%; height: 100%; display: block; object-fit: contain; }
body.kb-stitch-app .kb-avatar.is-initial {
  background: linear-gradient(135deg, #f4aeff, #7bd0ff); color: #1a0f1d;
  font-weight: 900; font-size: calc(var(--kb-avatar-size, 44px) * .42);
}
html.light body.kb-stitch-app .kb-avatar:not(.is-initial) { background: #efe2f2; }
body.kb-stitch-app :is(.kb-profile-avatar, .settings-avatar).is-avatar {
  padding: 0; border: 0; background: transparent !important; width: auto; height: auto; border-radius: 50%;
}
body.kb-stitch-app button:is(.kb-profile-avatar, .settings-avatar, .kb-home-avatar) { cursor: pointer; }
body.kb-stitch-app :is(.kb-profile-avatar, .settings-avatar, .kb-home-avatar):focus-visible { outline: 3px solid var(--kb-primary); outline-offset: 2px; }

body.kb-stitch-app .kb-hero-money { display: inline-flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
body.kb-stitch-app .kb-hero-cur { font-size: .46em; font-weight: 800; color: var(--kb-muted); letter-spacing: 0; }
body.kb-stitch-app .kb-hero-val { font-weight: 900; }
body.kb-stitch-app .dashboard-total-balance {
  display: flex; justify-content: space-between; gap: 10px; margin: 10px 0 0; font-size: 12.5px; font-weight: 700; color: var(--kb-muted);
}
body.kb-stitch-app .dashboard-total-balance .num { color: var(--kb-text); }

body.kb-stitch-app .progress-brief-card.is-start {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px;
  border: 1px dashed rgba(var(--kb-primary-rgb), .45) !important; background: rgba(var(--kb-primary-rgb), .05) !important;
}
body.kb-stitch-app .progress-start-title { display: inline-flex; align-items: center; gap: 8px; color: var(--kb-primary); font-weight: 900; font-size: 15px; }
body.kb-stitch-app .progress-start-title svg { width: 18px; height: 18px; }
body.kb-stitch-app .progress-start-detail { font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--kb-muted); }
body.kb-stitch-app .progress-start-cta { font-size: 13.5px; font-weight: 900; color: var(--kb-primary); }

body.kb-stitch-app .kb-first-steps {
  grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 8px; border-radius: 18px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--kb-line); min-height: 0;
}
body.kb-stitch-app .kb-first-steps header { display: flex; align-items: center; justify-content: space-between; }
body.kb-stitch-app .kb-first-steps h2 { margin: 0; font-size: 16px; font-weight: 900; }
body.kb-stitch-app .kb-first-steps header span { font-size: 13px; font-weight: 800; color: var(--kb-primary); }
body.kb-stitch-app .kb-first-steps-bar { display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); margin-bottom: 2px; }
body.kb-stitch-app .kb-first-steps-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--kb-primary), var(--kb-accent)); }
body.kb-stitch-app .kb-first-step {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 0; border: 0; background: transparent; color: var(--kb-text); text-align: left;
}
body.kb-stitch-app .kb-first-step + .kb-first-step { border-top: 1px solid var(--kb-line); }
body.kb-stitch-app .kb-first-step-mark {
  flex: 0 0 auto; width: 26px; height: 26px; box-sizing: border-box; display: grid; place-items: center; border-radius: 50%;
  border: 1.5px solid var(--kb-line); color: var(--kb-muted); font-size: 12.5px; font-weight: 800;
}
body.kb-stitch-app .kb-first-step.is-done .kb-first-step-mark { border: 0; background: var(--kb-income); color: #1a0f1d; }
body.kb-stitch-app .kb-first-step-mark svg { width: 14px; height: 14px; }
body.kb-stitch-app .kb-first-step-text { flex: 1 1 auto; min-width: 0; }
body.kb-stitch-app .kb-first-step-text b { display: block; font-size: 14px; font-weight: 800; }
body.kb-stitch-app .kb-first-step-text small { display: block; font-size: 12px; font-weight: 600; color: var(--kb-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.kb-stitch-app .kb-first-step.is-done .kb-first-step-text b { color: var(--kb-muted); text-decoration: line-through; }
body.kb-stitch-app .kb-first-step > .kb-inline-icon { color: var(--kb-muted); }
body.kb-stitch-app .kb-first-steps-hide { align-self: flex-end; border: 0; background: transparent; color: var(--kb-muted); font-size: 12px; font-weight: 800; padding: 2px 0; }
body.kb-stitch-app .dashboard-lower-grid:has(.kb-first-steps) { grid-template-rows: auto minmax(0, 1fr) !important; }
body.kb-stitch-app .home-progress-grid:has(.kb-first-steps) { display: block; height: auto !important; }

body.kb-stitch-app .kb-avatar-sheet { gap: 14px; }
body.kb-stitch-app .kb-avatar-preview { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, .05); border: 1px solid var(--kb-line); }
body.kb-stitch-app .kb-avatar-preview b { display: block; font-size: 17px; font-weight: 900; }
body.kb-stitch-app .kb-avatar-preview small { font-size: 13px; font-weight: 600; color: var(--kb-muted); }
body.kb-stitch-app .kb-avatar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
body.kb-stitch-app .kb-avatar-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 0; border: 0; border-radius: 16px;
  background: transparent; color: var(--kb-muted); font-size: 12px; font-weight: 800;
}
body.kb-stitch-app .kb-avatar-tile.is-on { background: rgba(var(--kb-primary-rgb), .12); color: var(--kb-text); }
body.kb-stitch-app .kb-avatar-tile.is-on .kb-avatar { box-shadow: 0 0 0 2px var(--kb-bg), 0 0 0 4px var(--kb-primary); }
body.kb-stitch-app .kb-avatar-tile.is-locked .kb-avatar { opacity: .4; filter: grayscale(.7); }
body.kb-stitch-app .kb-avatar-lock {
  position: absolute; top: 40px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 10px;
  background: #2a1830; border: 1px solid rgba(253, 186, 116, .5); color: #fdba74; font-size: 11px; font-weight: 800;
}
body.kb-stitch-app .kb-avatar-lock .kb-inline-icon, body.kb-stitch-app .kb-avatar-lock svg { width: 12px; height: 12px; }
body.kb-stitch-app .kb-avatar-note { margin: 0; text-align: center; font-size: 12.5px; font-weight: 600; line-height: 1.45; color: var(--kb-muted); }
body.kb-stitch-app .mn-msg.is-user { display: flex; align-items: flex-end; justify-content: flex-end; gap: 8px; }
body.kb-stitch-app .mn-msg-me { order: 2; }

@media (max-width: 768px) {
  body.kb-stitch-app .kb-home-head {
    display: flex !important; align-items: center; gap: 12px; min-height: 0;
  }
  body.kb-stitch-app .kb-home-avatar { flex: 0 0 auto; padding: 0; border: 0; background: transparent; border-radius: 50%; }
  body.kb-stitch-app .kb-home-head .dashboard-header-copy { flex: 1 1 0; min-width: 0; overflow: hidden; }
  body.kb-stitch-app .kb-home-head h1 {
    margin: 0; color: var(--kb-text); font-size: clamp(18px, 4.9vw, 21px); line-height: 1.1; font-weight: 900;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  body.kb-stitch-app .kb-home-head .dashboard-header-copy p { margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.kb-stitch-app .kb-home-head .dashboard-bell {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; color: var(--kb-text);
    background: rgba(255, 255, 255, .05); border: 1px solid var(--kb-line);
  }
  body.kb-stitch-app .kb-home-head .dashboard-bell .kb-notif-badge { top: -3px; right: -3px; box-shadow: 0 0 0 2px var(--kb-bg); }
  body.kb-stitch-app .kb-hero-cur { font-size: .48em; }
}

/* ── Boot: waiting for the server instead of showing sign-in ───────────── */
#boot-splash.is-retry .boot-meter { display: none; }
#boot-splash .boot-retry {
  margin-top: 18px;
  min-height: 44px;
  padding: 0 22px;
}

/* ── Kunci aplikasi: lock screen, PIN pad, settings ────────────────────── */
.kb-lock svg,
.kb-lockset svg,
.kb-lock-flow svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.kb-stitch-app .kb-lock {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: calc(env(safe-area-inset-top) + 24px) 20px calc(env(safe-area-inset-bottom) + 20px);
  overflow-y: auto;
  color: var(--kb-text);
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(var(--kb-primary-rgb), .20), transparent 60%),
    radial-gradient(90% 60% at 50% 115%, rgba(var(--kb-accent-rgb), .14), transparent 60%),
    var(--kb-bg);
  opacity: 0;
  transition: opacity .24s ease;
  outline: none;
}

body.kb-stitch-app .kb-lock.is-in { opacity: 1; }
body.kb-stitch-app .kb-lock.is-out { opacity: 0; transition-duration: .3s; }

body.kb-stitch-app .kb-lock-glow {
  position: absolute;
  top: 12%;
  left: 50%;
  width: 280px;
  height: 280px;
  margin-left: -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--kb-primary-rgb), .22), transparent 68%);
  filter: blur(10px);
  pointer-events: none;
  animation: kb-lock-breathe 6s ease-in-out infinite;
}

@keyframes kb-lock-breathe {
  0%, 100% { transform: scale(1); opacity: .8; }
  50% { transform: scale(1.12); opacity: 1; }
}

body.kb-stitch-app .kb-lock-inner {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 22px;
  width: min(340px, 100%);
  transform: translateY(14px);
  transition: transform .32s cubic-bezier(.2, .8, .2, 1);
}

body.kb-stitch-app .kb-lock.is-in .kb-lock-inner { transform: none; }
body.kb-stitch-app .kb-lock.is-out .kb-lock-inner { transform: scale(1.04); }

body.kb-stitch-app .kb-lock-head {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

body.kb-stitch-app .kb-lock-avatar {
  position: relative;
  display: inline-grid;
  margin-bottom: 8px;
  padding: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(var(--kb-primary-rgb), .55), rgba(var(--kb-accent-rgb), .45));
}

body.kb-stitch-app .kb-lock-avatar > :first-child {
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--kb-bg);
}

body.kb-stitch-app .kb-lock-badge {
  position: absolute;
  right: -4px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 6px;
  border-radius: 50%;
  color: #1a0f1d;
  background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent));
  box-shadow: 0 0 0 3px var(--kb-bg);
}

body.kb-stitch-app .kb-lock-badge svg { stroke-width: 2.2; }

body.kb-stitch-app .kb-lock-head h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -.01em;
}

body.kb-stitch-app .kb-lock-head p {
  margin: 0;
  color: var(--kb-muted);
  font-size: 14.5px;
  font-weight: 600;
}

/* PIN pad (lock screen and the set-up sheet) */
body.kb-stitch-app .kb-pin {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
}

body.kb-stitch-app .kb-pin-dots {
  display: flex;
  gap: 16px;
  padding: 6px 0;
}

body.kb-stitch-app .kb-pin-dots i {
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in srgb, var(--kb-text) 34%, transparent);
  border-radius: 50%;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

body.kb-stitch-app .kb-pin-dots i.is-on {
  border-color: transparent;
  background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent));
  animation: kb-pin-pop .18s ease-out;
}

@keyframes kb-pin-pop {
  50% { transform: scale(1.35); }
}

body.kb-stitch-app .kb-pin.is-busy .kb-pin-dots i.is-on { animation: kb-pin-wait .9s ease-in-out infinite; }
body.kb-stitch-app .kb-pin.is-busy .kb-pin-dots i:nth-child(2) { animation-delay: .1s; }
body.kb-stitch-app .kb-pin.is-busy .kb-pin-dots i:nth-child(3) { animation-delay: .2s; }
body.kb-stitch-app .kb-pin.is-busy .kb-pin-dots i:nth-child(4) { animation-delay: .3s; }
body.kb-stitch-app .kb-pin.is-busy .kb-pin-dots i:nth-child(5) { animation-delay: .4s; }
body.kb-stitch-app .kb-pin.is-busy .kb-pin-dots i:nth-child(6) { animation-delay: .5s; }

@keyframes kb-pin-wait {
  50% { opacity: .35; transform: scale(.8); }
}

body.kb-stitch-app .kb-pin.is-error .kb-pin-dots { animation: kb-pin-shake .38s ease; }
body.kb-stitch-app .kb-pin.is-error .kb-pin-dots i.is-on { background: var(--kb-expense); }
body.kb-stitch-app .kb-pin.is-ok .kb-pin-dots i { border-color: transparent; background: var(--kb-income); }

@keyframes kb-pin-shake {
  20%, 60% { transform: translateX(-9px); }
  40%, 80% { transform: translateX(9px); }
}

body.kb-stitch-app .kb-pin-msg {
  min-height: 20px;
  margin: 0;
  color: var(--kb-muted);
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
}

body.kb-stitch-app .kb-pin-msg.is-error { color: var(--kb-expense); }

body.kb-stitch-app .kb-pin-keys {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 14px 26px;
  margin-top: 4px;
}

body.kb-stitch-app .kb-pin-key {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px solid color-mix(in srgb, var(--kb-text) 10%, transparent);
  border-radius: 50%;
  color: var(--kb-text);
  background: color-mix(in srgb, var(--kb-text) 6%, transparent);
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, background .12s ease;
}

body.kb-stitch-app .kb-pin-key:active {
  transform: scale(.92);
  background: rgba(var(--kb-primary-rgb), .22);
}

body.kb-stitch-app .kb-pin-key:focus-visible {
  outline: 2px solid var(--kb-primary);
  outline-offset: 3px;
}

body.kb-stitch-app .kb-pin-key.is-tool {
  border-color: transparent;
  background: transparent;
  color: var(--kb-muted);
}

body.kb-stitch-app .kb-pin-key.is-tool svg { width: 28px; height: 28px; }
body.kb-stitch-app .kb-pin-key[data-key="bio"] { color: var(--kb-primary-ink); }
body.kb-stitch-app .kb-pin-key[data-key="bio"] svg { width: 34px; height: 34px; }
body.kb-stitch-app .kb-pin-key.is-empty,
body.kb-stitch-app .kb-pin-key.is-hidden { visibility: hidden; }

body.kb-stitch-app .kb-lock-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--kb-muted);
  font-size: 13.5px;
}

body.kb-stitch-app .kb-lock-link {
  min-height: 40px;
  padding: 0 6px;
  border: 0;
  color: var(--kb-muted);
  background: none;
  font-weight: 800;
}

body.kb-stitch-app .kb-lock-link:hover { color: var(--kb-text); text-decoration: underline; }

body.kb-stitch-app .kb-lock-forgot {
  position: absolute;
  left: -6px;
  right: -6px;
  bottom: -6px;
  display: grid;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--kb-line);
  border-radius: 22px;
  background: var(--kb-panel-solid, #201421);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  animation: kb-lock-sheet .26s cubic-bezier(.2, .8, .2, 1);
}

html.light body.kb-stitch-app .kb-lock-forgot { background: #fff; box-shadow: 0 24px 60px rgba(38, 21, 38, .16); }

@keyframes kb-lock-sheet {
  from { opacity: 0; transform: translateY(16px); }
}

body.kb-stitch-app .kb-lock-forgot p { margin: 0; color: var(--kb-muted); font-size: 14px; line-height: 1.5; }
body.kb-stitch-app .kb-lock-forgot .kb-lock-forgot-title { color: var(--kb-text); font-size: 17px; font-weight: 900; }
body.kb-stitch-app .kb-lock-forgot-actions { display: grid; gap: 8px; margin-top: 6px; }
body.kb-stitch-app .kb-lock-forgot-actions button,
body.kb-stitch-app .kb-lock-step-actions button { min-height: 48px; justify-content: center; font-size: 14.5px; }

/* Settings › Kunci aplikasi */
body.kb-stitch-app .kb-lockset {
  display: grid;
  gap: 4px;
  max-width: 640px;
}

body.kb-stitch-app .kb-lockset-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 14px;
}

body.kb-stitch-app .kb-lockset-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 11px;
  border-radius: 15px;
  color: var(--kb-primary-ink);
  background: rgba(var(--kb-primary-rgb), .14);
}

body.kb-stitch-app .kb-lockset-icon.is-small { width: 52px; height: 52px; padding: 13px; border-radius: 18px; }

body.kb-stitch-app .kb-lockset-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 4px;
  color: var(--kb-text);
  font-size: 16px;
  font-weight: 900;
}

body.kb-stitch-app .kb-lockset-chip {
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--kb-income);
  background: color-mix(in srgb, var(--kb-income) 16%, transparent);
  font-size: 11.5px;
  font-weight: 900;
}

body.kb-stitch-app .kb-lockset-copy,
body.kb-stitch-app .kb-lockset-sub {
  margin: 0;
  color: var(--kb-muted);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
}

body.kb-stitch-app .kb-lockset-cta { justify-self: start; min-height: 46px; padding: 0 22px; }

body.kb-stitch-app .kb-lockset-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 14px 0;
  border-top: 1px solid var(--kb-line);
}

body.kb-stitch-app .kb-lockset-row > .kb-lockset-label { flex: 1 1 120px; }
body.kb-stitch-app .kb-lockset-rowtext { flex: 1 1 180px; min-width: 0; }
body.kb-stitch-app .kb-lockset-label { margin: 0; color: var(--kb-text); font-size: 14.5px; font-weight: 800; }
body.kb-stitch-app .kb-lockset-bio { flex: none; width: 26px; height: 26px; color: var(--kb-primary-ink); }
body.kb-stitch-app .kb-lockset-note { color: var(--kb-muted); font-size: 12.5px; font-weight: 700; }
body.kb-stitch-app .kb-lockset-seg button { padding: 0 14px; }
body.kb-stitch-app .kb-lockset-row .kb-secondary-action { min-height: 40px; }

body.kb-stitch-app .kb-lockset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--kb-line);
}

body.kb-stitch-app .kb-lockset-actions .kb-secondary-action { min-height: 44px; padding: 0 18px; }
body.kb-stitch-app .kb-secondary-action.is-danger { color: var(--kb-expense) !important; }

/* Creating or changing the PIN */
body.kb-stitch-app .kb-lock-flow-panel .mobile-profile-card { max-width: 420px; }

body.kb-stitch-app .kb-lock-step {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 4px 0 8px;
  text-align: center;
  animation: kb-lock-step .24s ease-out;
}

@keyframes kb-lock-step {
  from { opacity: 0; transform: translateX(14px); }
}

body.kb-stitch-app .kb-lock-step-title { margin: 6px 0 0; color: var(--kb-text); font-size: 20px; font-weight: 900; outline: none; }
body.kb-stitch-app .kb-lock-step-copy { max-width: 300px; margin: 0; color: var(--kb-muted); font-size: 14px; font-weight: 600; line-height: 1.5; }

body.kb-stitch-app .kb-lock-steps { display: flex; gap: 6px; margin: 6px 0 4px; }
body.kb-stitch-app .kb-lock-steps i { width: 18px; height: 4px; border-radius: 4px; background: var(--kb-line); }
body.kb-stitch-app .kb-lock-steps i.is-on { width: 28px; background: var(--kb-primary); }

body.kb-stitch-app .kb-lock-step .kb-pin-keys { grid-template-columns: repeat(3, 66px); gap: 12px 22px; }
body.kb-stitch-app .kb-lock-step .kb-pin-key { width: 66px; height: 66px; font-size: 26px; }

body.kb-stitch-app .kb-lock-step-actions { display: grid; gap: 8px; width: 100%; margin-top: 14px; }

body.kb-stitch-app .kb-lock-bio-art,
body.kb-stitch-app .kb-lock-done-art {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin: 8px 0 4px;
  padding: 24px;
  border-radius: 50%;
  color: var(--kb-primary-ink);
  background: radial-gradient(circle, rgba(var(--kb-primary-rgb), .22), rgba(var(--kb-primary-rgb), .06));
}

body.kb-stitch-app .kb-lock-bio-art svg { animation: kb-lock-scan 2.4s ease-in-out infinite; }

@keyframes kb-lock-scan {
  50% { opacity: .55; transform: scale(.94); }
}

body.kb-stitch-app .kb-lock-done-art { color: var(--kb-income); background: radial-gradient(circle, color-mix(in srgb, var(--kb-income) 26%, transparent), transparent 75%); }
body.kb-stitch-app .kb-lock-done-art svg { stroke-width: 2.4; stroke-dasharray: 24; stroke-dashoffset: 24; animation: kb-lock-check .5s .1s ease-out forwards; }

@keyframes kb-lock-check {
  to { stroke-dashoffset: 0; }
}

@media (max-height: 640px) {
  body.kb-stitch-app .kb-lock-inner { gap: 14px; }
  body.kb-stitch-app .kb-pin-keys { grid-template-columns: repeat(3, 64px); gap: 10px 24px; }
  body.kb-stitch-app .kb-pin-key { width: 64px; height: 64px; font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  body.kb-stitch-app .kb-lock,
  body.kb-stitch-app .kb-lock-inner { transition: none; }
  body.kb-stitch-app .kb-lock-glow,
  body.kb-stitch-app .kb-lock-bio-art svg,
  body.kb-stitch-app .kb-pin-dots i.is-on,
  body.kb-stitch-app .kb-pin.is-error .kb-pin-dots,
  body.kb-stitch-app .kb-lock-step { animation: none; }
  body.kb-stitch-app .kb-lock-done-art svg { animation: none; stroke-dashoffset: 0; }
}

/* ── Install pill: Home only, once the app is ready, never over a sheet, the tour, the lock or a
   Home banner (which floats in the same spot) ── */
body.kb-stitch-app #pwa-install-btn { display: none !important; }
body.kb-stitch-app[data-app-ready="true"][data-page="dashboard"]:not(.kb-touring):not(.kb-app-locked):not(.kb-modal-open):not(.kb-mobile-ai-open):not(.kb-mobile-panel-open):not(.kb-scanner-open):not(.kb-notif-open):not(:has(.kb-home-banner-slot:not(:empty))) #pwa-install-btn.is-offered {
  display: flex !important;
  padding: 6px 6px 6px 18px !important;
}

/* ── Sign-in: finger-sized controls, and the form within reach on phones ── */
#auth-overlay .auth-pass-toggle {
  right: 4px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}
#auth-overlay .auth-forgot { min-height: 40px; }

@media (max-width: 768px) {
  #auth-overlay .auth-visual h1 {
    margin: 18px 0 8px;
    font-size: clamp(28px, 8.4vw, 36px);
    line-height: 1.08;
  }
  #auth-overlay .auth-visual p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
  }
}

/* Narrow phones: three category tiles per row, so names like "Transportasi" fit without breaking. */
@media (max-width: 380px) {
  body.kb-stitch-app .trx-cat-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 280px; }
}

/* Short laptop windows (1366×657 and similar): the sidebar hides its scrollbar like the rest of the
   app, so every page must fit without scrolling it. */
@media (min-width: 769px) and (max-height: 760px) {
  body.kb-stitch-app #sidebar .kb-sidebar-brand { padding-top: 12px !important; padding-bottom: 12px !important; }
  body.kb-stitch-app #sidebar nav { padding-top: 8px !important; padding-bottom: 8px !important; }
  body.kb-stitch-app #sidebar nav > * + * { margin-top: 2px !important; }
  body.kb-stitch-app #sidebar .nav-item { min-height: 0 !important; padding-top: 7px !important; padding-bottom: 7px !important; }
  body.kb-stitch-app #sidebar > div:last-child { padding-top: 8px !important; padding-bottom: 8px !important; }
}

/* Narrower onboarding side panel (1024–1279 px): Meeny above its speech bubble, so the bubble keeps
   a readable line length instead of two words per line. */
@media (min-width: 1024px) and (max-width: 1279px) {
  body.kb-stitch-app .ob2-aside-meeny { flex-direction: column; align-items: flex-start; gap: 10px; }
  body.kb-stitch-app .ob2-aside-meeny .ob2-bubble { font-size: 15px; }
}

/* ── Home (v1.4.58): one main card, income and spending, Untukmu, latest transactions ──────
   Home scrolls like every other page now (it used to be squeezed into one screen). */
body.kb-stitch-app {
  --kb-h-pink: #f4aeff;
  --kb-h-blue: #7bd0ff;
  --kb-h-teal: #2dd4bf;
  --kb-h-amber: #f7d06f;
  --kb-h-orange: #fdba74;
  --kb-h-duo-a: rgba(244, 174, 255, .28);
  --kb-h-duo-b: rgba(45, 212, 191, .22);
  --kb-h-duo-c: rgba(123, 208, 255, .22);
  --kb-h-duo-d: rgba(247, 208, 111, .22);
  --kb-h-duo-e: rgba(253, 186, 116, .22);
  --kb-h-card: rgba(255, 255, 255, .045);
  --kb-h-card-line: rgba(255, 255, 255, .09);
  --kb-h-divider: rgba(255, 255, 255, .08);
}

html.light body.kb-stitch-app {
  --kb-h-pink: #b14fc7;
  --kb-h-blue: #2384c4;
  --kb-h-teal: #0f9784;
  --kb-h-amber: #b7860f;
  --kb-h-orange: #c66a1d;
  --kb-h-duo-a: rgba(177, 79, 199, .14);
  --kb-h-duo-b: rgba(15, 151, 132, .13);
  --kb-h-duo-c: rgba(35, 132, 196, .13);
  --kb-h-duo-d: rgba(183, 134, 15, .14);
  --kb-h-duo-e: rgba(198, 106, 29, .14);
  --kb-h-card: rgba(255, 255, 255, .82);
  --kb-h-card-line: rgba(38, 21, 38, .1);
  --kb-h-divider: rgba(38, 21, 38, .08);
}


body.kb-stitch-app .kb-home { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; width: 100%; }
body.kb-stitch-app .kb-h-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
body.kb-stitch-app .kb-h-main, body.kb-stitch-app .kb-h-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; min-width: 0; }
body.kb-stitch-app .kb-h-icon { flex: 0 0 auto; }

/* Main card */
body.kb-stitch-app .kb-h-hero {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 20px; border-radius: 24px;
  background: linear-gradient(160deg, rgba(87, 52, 92, .72), rgba(36, 22, 40, .92));
  border: 1px solid rgba(123, 208, 255, .28); color: var(--kb-text); box-shadow: 0 18px 44px rgba(0, 0, 0, .2);
}
html.light body.kb-stitch-app .kb-h-hero {
  background: linear-gradient(160deg, #ffffff, #f7eef9); border-color: rgba(35, 132, 196, .22); box-shadow: 0 16px 40px rgba(72, 40, 76, .1);
}
body.kb-stitch-app .kb-h-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
body.kb-stitch-app .kb-h-hero-pick {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; min-width: 0; padding: 0 4px 0 0; border: 0; background: transparent;
  color: var(--kb-muted); font-size: 14px; font-weight: 800; text-align: left;
}
body.kb-stitch-app .kb-h-hero-pick > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.kb-stitch-app .kb-h-hero-pick .kb-h-icon:first-child { color: var(--kb-h-pink); }
body.kb-stitch-app .kb-h-eye {
  flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border-radius: 50%;
  color: var(--kb-muted); background: rgba(255, 255, 255, .05); border: 1px solid var(--kb-line);
}
body.kb-stitch-app .kb-h-eye svg { width: 19px; height: 19px; stroke-width: 1.9; }
html.light body.kb-stitch-app .kb-h-eye { background: rgba(38, 21, 38, .04); }
body.kb-stitch-app .kb-h-hero-main {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; width: 100%;
}
body.kb-stitch-app .kb-h-hero-money { font-size: clamp(34px, 10.5vw, 44px); line-height: 1.05; color: var(--kb-h-teal); }
body.kb-stitch-app .kb-h-hero-money.tone-warn { color: var(--kb-h-amber); }
body.kb-stitch-app .kb-h-hero-money.tone-danger { color: var(--kb-expense); }
body.kb-stitch-app .kb-h-hero-line { font-size: 14px; font-weight: 650; line-height: 1.4; color: var(--kb-muted); }
body.kb-stitch-app .kb-h-hero-line .num, body.kb-stitch-app .kb-h-hero-line b { color: var(--kb-text); font-weight: 800; font-family: inherit; }
body.kb-stitch-app .kb-h-hero-bar { display: block; height: 7px; margin-top: 6px; border-radius: 4px; background: rgba(255, 255, 255, .09); overflow: hidden; }
html.light body.kb-stitch-app .kb-h-hero-bar { background: rgba(38, 21, 38, .08); }
body.kb-stitch-app .kb-h-hero-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #f4aeff, #7bd0ff); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
body.kb-stitch-app .kb-h-hero-setup { display: flex; align-items: center; gap: 12px; }
body.kb-stitch-app .kb-h-hero-setup p { margin: 0; font-size: 14px; font-weight: 650; line-height: 1.45; color: var(--kb-muted); }
body.kb-stitch-app .kb-h-hero-setup b { color: var(--kb-text); }
body.kb-stitch-app .kb-h-hero-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
body.kb-stitch-app .kb-h-chip {
  min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--kb-line); background: rgba(255, 255, 255, .05); color: var(--kb-text); font-size: 13px; font-weight: 800; white-space: nowrap;
}
html.light body.kb-stitch-app .kb-h-chip { background: rgba(255, 255, 255, .7); }
body.kb-stitch-app .kb-h-chip.is-primary { border: 0; background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent)); color: #1a0f1d; }

/* Income and spending */
body.kb-stitch-app .kb-h-flows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
body.kb-stitch-app .kb-h-flow {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 14px 16px; border-radius: 20px;
  background: var(--kb-h-card); border: 1px solid var(--kb-h-card-line);
}
body.kb-stitch-app .kb-h-flow span { font-size: 13px; font-weight: 700; color: var(--kb-muted); }
body.kb-stitch-app .kb-h-flow b { font-size: clamp(14px, 4.4vw, 17px); font-weight: 800; color: var(--kb-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.kb-stitch-app .kb-h-flow b.is-income { color: var(--kb-income); }

/* The summary under the main card (Atur Beranda): slim row by default, or one of four others */
body.kb-stitch-app .kb-h-sum[hidden] { display: none; }
body.kb-stitch-app button.kb-h-sum {
  width: 100%; margin: 0; border-radius: 16px; background: var(--kb-h-card); border: 1px solid var(--kb-h-card-line);
  color: var(--kb-text); font: inherit; text-align: left; cursor: pointer;
}
body.kb-stitch-app .kb-h-sum b { font-weight: 800; white-space: nowrap; }
body.kb-stitch-app .kb-h-sum small { font-size: 12.5px; font-weight: 700; color: var(--kb-muted); }
body.kb-stitch-app .kb-h-sum > .kb-h-icon:last-child { flex: 0 0 auto; color: var(--kb-muted); }
body.kb-stitch-app .kb-h-sum-slim { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 12px 0 14px; }
body.kb-stitch-app .kb-h-sum-slim small { flex: 0 1 auto; min-width: 0; font-size: 13px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.kb-stitch-app .kb-h-sum-slim > span { display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto; }
body.kb-stitch-app .kb-h-sum-slim b { font-size: 14.5px; }
body.kb-stitch-app .kb-h-sum-in { margin-left: auto; color: var(--kb-income); }
body.kb-stitch-app .kb-h-sum-out .kb-h-icon { color: var(--kb-expense, #fb7185); }
body.kb-stitch-app .kb-h-sum-slim > i { flex: 0 0 auto; width: 1px; height: 18px; background: var(--kb-h-divider, var(--kb-line)); }
body.kb-stitch-app .kb-h-sum-pair { display: flex; align-items: center; min-height: 62px; padding: 0 12px 0 0; }
body.kb-stitch-app .kb-h-sum-pair > span { display: grid; gap: 2px; flex: 1 1 0; min-width: 0; padding: 0 14px; }
body.kb-stitch-app .kb-h-sum-pair b { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; }
body.kb-stitch-app .kb-h-sum-pair > i { flex: 0 0 auto; width: 1px; height: 34px; background: var(--kb-h-divider, var(--kb-line)); }
body.kb-stitch-app .kb-h-sum-compare { display: grid; gap: 8px; padding: 12px 14px; }
body.kb-stitch-app .kb-h-sum-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
body.kb-stitch-app .kb-h-sum-top small { font-size: 13px; font-weight: 800; }
body.kb-stitch-app .kb-h-sum-top b { font-size: 15.5px; }
body.kb-stitch-app .kb-h-sum-bar { position: relative; display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); }
html.light body.kb-stitch-app .kb-h-sum-bar { background: rgba(38, 21, 38, .08); }
body.kb-stitch-app .kb-h-sum-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--kb-h-teal, #2dd4bf); }
body.kb-stitch-app .kb-h-sum-bar em { position: absolute; top: -4px; width: 2px; height: 14px; border-radius: 1px; background: var(--kb-muted); }
body.kb-stitch-app .kb-h-sum-note { font-size: 12.5px; font-weight: 700; color: var(--kb-h-teal, #2dd4bf); }
body.kb-stitch-app .kb-h-sum-compare.is-up .kb-h-sum-bar i { background: #fbbf24; }
body.kb-stitch-app .kb-h-sum-compare.is-up .kb-h-sum-note { color: #fbbf24; }
body.kb-stitch-app .kb-h-sheet-label { margin: 4px 0 -2px; font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--kb-muted); }
body.kb-stitch-app .kb-h-pick-tag { margin-left: 6px; padding: 2px 7px; border-radius: 8px; vertical-align: 1px; font-size: 11px; font-weight: 800; color: var(--kb-h-teal, #2dd4bf); background: rgba(45, 212, 191, .16); }

/* Untukmu */
body.kb-stitch-app .kb-h-strip { border-radius: 22px; background: var(--kb-h-card); border: 1px solid var(--kb-h-card-line); overflow: hidden; }
body.kb-stitch-app .kb-h-strip-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 2px 16px; }
body.kb-stitch-app .kb-h-strip-head h2 { margin: 0; font-size: 18px; font-weight: 900; color: var(--kb-text); }
body.kb-stitch-app .kb-h-atur {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 6px; border: 0; background: transparent; color: var(--kb-h-pink); font-size: 14px; font-weight: 800;
}
body.kb-stitch-app .kb-h-tabs {
  position: relative; display: grid; grid-template-columns: repeat(var(--kb-h-tabs, 4), minmax(0, 1fr)); padding: 2px 8px 0; border-bottom: 1px solid var(--kb-h-divider);
}
body.kb-stitch-app .kb-h-tab {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 6px 2px 12px; border: 0; background: transparent;
  color: var(--kb-muted); font-size: 12px; font-weight: 800; letter-spacing: -.1px;
}
body.kb-stitch-app .kb-h-tab > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.kb-stitch-app .kb-h-tab.is-active { color: var(--kb-text); }
body.kb-stitch-app .kb-h-tab:focus-visible { outline: 2px solid var(--kb-primary); outline-offset: -2px; border-radius: 12px; }
body.kb-stitch-app .kb-h-duo { display: block; width: 34px; height: 34px; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
body.kb-stitch-app .kb-h-duo.is-meeny { display: grid; place-items: center; }
body.kb-stitch-app .kb-h-duo.is-meeny img { width: 36px; height: 36px; margin: -1px; }
body.kb-stitch-app .kb-h-tab.is-active .kb-h-duo { transform: translateY(-1px) scale(1.06); }
body.kb-stitch-app .kb-h-tab-bar {
  position: absolute; left: 0; bottom: -1px; height: 4px; width: 0; border-radius: 3px; background: linear-gradient(90deg, #f4aeff, #7bd0ff);
  opacity: 0; transition: transform .38s cubic-bezier(.34, 1.3, .64, 1), width .38s cubic-bezier(.34, 1.3, .64, 1), opacity .2s ease;
}
body.kb-stitch-app .kb-h-tab-bar.is-on { opacity: 1; }
body.kb-stitch-app .kb-h-tab-bar.is-instant { transition: none; }
body.kb-stitch-app .kb-h-panel { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; box-sizing: border-box; }
body.kb-stitch-app .kb-h-panel-kicker { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--kb-muted); }
body.kb-stitch-app .kb-h-panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--kb-h-divider); }
body.kb-stitch-app .kb-h-panel-foot > span { font-size: 12.5px; font-weight: 700; color: var(--kb-muted); text-align: right; }
body.kb-stitch-app .kb-h-link {
  display: inline-flex; align-items: center; gap: 2px; min-height: 36px; padding: 0; border: 0; background: transparent; color: var(--kb-h-pink); font-size: 13.5px; font-weight: 800;
}
body.kb-stitch-app .kb-h-skeleton { display: grid; gap: 14px; padding-top: 4px; }
body.kb-stitch-app .kb-h-skeleton span { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: center; }
body.kb-stitch-app .kb-h-skeleton i, body.kb-stitch-app .kb-h-skeleton b {
  display: block; height: 36px; border-radius: 12px; background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.1), rgba(255,255,255,.05));
  background-size: 200% 100%; animation: kbNotifShimmer 1.2s linear infinite;
}
body.kb-stitch-app .kb-h-skeleton b { height: 14px; width: 70%; }
html.light body.kb-stitch-app .kb-h-skeleton :is(i, b) { background-image: linear-gradient(90deg, rgba(38,21,38,.05), rgba(38,21,38,.1), rgba(38,21,38,.05)); }

/* Rows inside the panels */
body.kb-stitch-app .kb-h-rows { display: grid; gap: 4px; }
body.kb-stitch-app .kb-h-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 4px 0; border: 0; background: transparent; color: var(--kb-text); text-align: left;
}
body.kb-stitch-app .kb-h-row-main { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; min-width: 0; }
body.kb-stitch-app .kb-h-row.is-goal .kb-h-row-main { gap: 2px; }
body.kb-stitch-app .kb-h-row-main > b, body.kb-stitch-app .kb-h-row-top b { font-size: 14px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.kb-stitch-app .kb-h-row-main small, body.kb-stitch-app .kb-h-row-top small { font-size: 12.5px; font-weight: 700; color: var(--kb-muted); white-space: nowrap; }
body.kb-stitch-app .kb-h-row-main > small { overflow: hidden; text-overflow: ellipsis; }
body.kb-stitch-app .kb-h-row-top small { flex: 0 0 auto; }
body.kb-stitch-app .kb-h-row-top b { min-width: 0; }
body.kb-stitch-app .kb-h-row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
body.kb-stitch-app .kb-h-row-top small.is-warn { color: var(--kb-h-amber); }
body.kb-stitch-app .kb-h-row-top small.is-over { color: var(--kb-expense); }
body.kb-stitch-app .kb-h-row-amount { flex: 0 0 auto; font-size: 14.5px; font-weight: 800; color: var(--kb-text); }
body.kb-stitch-app .kb-h-row-amount.is-income { color: var(--kb-income); }
body.kb-stitch-app .kb-h-row > .kb-h-icon { color: var(--kb-muted); }
body.kb-stitch-app .kb-h-row-duo { display: grid; place-items: center; width: 34px; }
body.kb-stitch-app .kb-h-meter { display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
html.light body.kb-stitch-app .kb-h-meter { background: rgba(38, 21, 38, .08); }
body.kb-stitch-app .kb-h-meter i { display: block; height: 100%; border-radius: 3px; background: var(--meter, var(--kb-income)); }
body.kb-stitch-app .kb-h-meter.is-warn i { background: var(--kb-h-amber); }
body.kb-stitch-app .kb-h-meter.is-over i { background: var(--kb-expense); }
body.kb-stitch-app .kb-h-tile {
  flex: 0 0 auto; width: var(--tile-size, 34px); height: var(--tile-size, 34px); display: grid; place-items: center; border-radius: 11px;
  background: color-mix(in srgb, var(--tile) 18%, transparent); color: var(--tile); font-size: calc(var(--tile-size, 34px) * .5);
}
body.kb-stitch-app .kb-h-tile .kb-glyph svg { width: calc(var(--tile-size, 34px) * .52); height: calc(var(--tile-size, 34px) * .52); }
body.kb-stitch-app .kb-h-ring { flex: 0 0 auto; }
body.kb-stitch-app .kb-h-ring circle { fill: none; stroke-width: 5; stroke-linecap: round; }
body.kb-stitch-app .kb-h-ring .kb-h-ring-track { stroke: rgba(255, 255, 255, .1); }
html.light body.kb-stitch-app .kb-h-ring .kb-h-ring-track { stroke: rgba(38, 21, 38, .1); }
body.kb-stitch-app .kb-h-ring text { fill: var(--kb-text); font-size: 11.5px; font-weight: 800; font-family: inherit; }
body.kb-stitch-app .kb-h-empty { display: flex; align-items: center; gap: 14px; flex: 1 1 auto; padding: 4px 0; }
body.kb-stitch-app .kb-h-empty > div { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
body.kb-stitch-app .kb-h-empty b { font-size: 15px; font-weight: 900; color: var(--kb-text); }
body.kb-stitch-app .kb-h-empty p { margin: 0; font-size: 13.5px; font-weight: 600; line-height: 1.45; color: var(--kb-muted); }
body.kb-stitch-app .kb-h-empty .kb-h-chip { margin-top: 4px; }

/* Insight cards: a row that swipes sideways, the next one peeking in */
body.kb-stitch-app .kb-h-ins-row {
  display: flex; gap: 10px; margin: 0 -16px; padding: 0 16px 2px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px;
  overscroll-behavior-x: contain; scrollbar-width: none;
}
body.kb-stitch-app .kb-h-ins-row::-webkit-scrollbar { display: none; }
body.kb-stitch-app .kb-h-ins-row:focus-visible { outline: 2px solid var(--kb-primary); outline-offset: 2px; border-radius: 18px; }
body.kb-stitch-app .kb-h-ins {
  flex: 0 0 calc(100% - 34px); scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; box-sizing: border-box; padding: 14px; border-radius: 18px;
  background: rgba(var(--kb-primary-rgb), .07); border: 1px solid rgba(var(--kb-primary-rgb), .2);
}
body.kb-stitch-app .kb-h-ins:only-child { flex-basis: 100%; }
body.kb-stitch-app .kb-h-ins-head { display: flex; align-items: flex-start; gap: 11px; }
body.kb-stitch-app .kb-h-ins-head > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
body.kb-stitch-app .kb-h-ins-head small { font-size: 11.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--kb-h-pink); }
body.kb-stitch-app .kb-h-ins-head b { font-size: 15.5px; font-weight: 850; line-height: 1.3; color: var(--kb-text); }
body.kb-stitch-app .kb-h-ins-art { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; }
body.kb-stitch-app .kb-h-ins p { margin: 0; font-size: 13.5px; font-weight: 600; line-height: 1.45; color: var(--kb-muted); }
body.kb-stitch-app .kb-h-ins p b { color: var(--kb-text); }
body.kb-stitch-app .kb-h-ins p .is-good { color: var(--kb-income); }
body.kb-stitch-app .kb-h-ins p .is-bad { color: var(--kb-expense); }
body.kb-stitch-app .kb-h-ins-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
body.kb-stitch-app .kb-h-mini {
  min-height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--kb-line);
  background: rgba(255, 255, 255, .05); color: var(--kb-text); font-size: 12.5px; font-weight: 800;
}
html.light body.kb-stitch-app .kb-h-mini { background: rgba(255, 255, 255, .8); }
body.kb-stitch-app .kb-h-mini.is-meeny { border-color: transparent; background: rgba(var(--kb-primary-rgb), .16); color: var(--kb-h-pink); }
body.kb-stitch-app .kb-h-ins-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
body.kb-stitch-app .kb-h-dots { display: flex; align-items: center; gap: 5px; }
body.kb-stitch-app .kb-h-dots i { display: block; width: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .2); transition: width .25s ease, background-color .25s ease; }
html.light body.kb-stitch-app .kb-h-dots i { background: rgba(38, 21, 38, .18); }
body.kb-stitch-app .kb-h-dots i.is-on { width: 16px; background: var(--kb-h-pink); }
body.kb-stitch-app .kb-h-ins-count { font-size: 12px; font-weight: 700; color: var(--kb-muted); }
body.kb-stitch-app .kb-h-ins-count b { color: var(--kb-text); }

/* First steps inside Insight, for new accounts */
body.kb-stitch-app .kb-h-steps { display: flex; flex-direction: column; gap: 2px; }
body.kb-stitch-app .kb-h-steps-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
body.kb-stitch-app .kb-h-steps-head b { flex: 1 1 auto; font-size: 14.5px; font-weight: 900; color: var(--kb-text); }
body.kb-stitch-app .kb-h-steps-head span { font-size: 12.5px; font-weight: 800; color: var(--kb-h-pink); }
body.kb-stitch-app .kb-h-step {
  display: flex; align-items: center; gap: 11px; width: 100%; min-height: 48px; padding: 6px 0; border: 0; background: transparent; color: var(--kb-text); text-align: left;
}
body.kb-stitch-app .kb-h-step-mark {
  flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center; box-sizing: border-box; border-radius: 50%;
  border: 1.5px solid var(--kb-line-strong, var(--kb-line)); color: var(--kb-muted); font-size: 12.5px; font-weight: 800;
}
body.kb-stitch-app .kb-h-step.is-done .kb-h-step-mark { border: 0; background: var(--kb-income); color: #10261f; }
body.kb-stitch-app .kb-h-step-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
body.kb-stitch-app .kb-h-step-text b { font-size: 14px; font-weight: 800; }
body.kb-stitch-app .kb-h-step.is-done .kb-h-step-text b { color: var(--kb-muted); text-decoration: line-through; }
body.kb-stitch-app .kb-h-step-text small { font-size: 12.5px; font-weight: 600; color: var(--kb-muted); }
body.kb-stitch-app .kb-h-step > .kb-h-icon { color: var(--kb-muted); }

/* Latest transactions: three in view, the fourth peeking under a fade */
body.kb-stitch-app .kb-h-recent { display: grid; gap: 10px; min-width: 0; }
body.kb-stitch-app .kb-h-recent-head { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
body.kb-stitch-app .kb-h-recent-head h2 { margin: 0; font-size: 18px; font-weight: 900; color: var(--kb-text); }
body.kb-stitch-app .kb-h-recent-box { position: relative; border-radius: 20px; background: var(--kb-h-card); border: 1px solid var(--kb-h-card-line); overflow: hidden; }
body.kb-stitch-app .kb-h-recent-list {
  display: grid; padding: 2px 0; overflow-y: hidden; overscroll-behavior-y: auto; scrollbar-width: none;
  max-height: calc(var(--kb-h-row, 66px) * 3.5 + 4px);
}
body.kb-stitch-app .kb-h-recent-list::-webkit-scrollbar { display: none; }
body.kb-stitch-app .kb-h-recent-list.is-open { overflow-y: auto; }
body.kb-stitch-app .kb-h-recent-box:not(.has-more) .kb-h-recent-list { max-height: none; }
body.kb-stitch-app .kb-h-recent .transaction-row {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 0; padding: 11px 14px; border: 0; border-bottom: 1px solid var(--kb-h-divider); border-radius: 0; background: transparent;
}
body.kb-stitch-app .kb-h-recent .transaction-icon { width: 40px; height: 40px; }
body.kb-stitch-app .kb-h-recent .transaction-main { min-width: 0; }
body.kb-stitch-app .kb-h-recent .transaction-title { font-size: 14.5px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.kb-stitch-app .kb-h-recent .transaction-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.kb-stitch-app .kb-h-recent .transaction-side { grid-column: 3; display: block; text-align: right; }
body.kb-stitch-app .kb-h-recent .transaction-amount { margin: 0; }
body.kb-stitch-app .kb-h-recent .transaction-row:last-of-type { border-bottom: 0; }
body.kb-stitch-app .kb-h-recent-all {
  display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 52px; border: 0; border-top: 1px solid var(--kb-h-divider);
  background: transparent; color: var(--kb-h-pink); font-size: 14px; font-weight: 800;
}
body.kb-stitch-app .kb-h-recent-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 56px; pointer-events: none; transition: opacity .25s ease;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--kb-panel-solid) 94%, transparent));
}
body.kb-stitch-app .kb-h-recent-box:not(.has-more) .kb-h-recent-fade,
body.kb-stitch-app .kb-h-recent-box.at-end .kb-h-recent-fade { opacity: 0; }

/* The desktop cash-flow chart sits above the latest transactions; phones skip it. */
body.kb-stitch-app .kb-h-cashflow { min-height: 300px; }
body.kb-stitch-app .kb-h-cashflow .dashboard-chart-stage { height: 220px; }

/* Loading skeleton for the first paint */
body.kb-stitch-app .kb-h-skel { display: grid; gap: 14px; }
body.kb-stitch-app .kb-h-skel .skeleton { border-radius: 20px; }
body.kb-stitch-app .kb-h-skel-head { height: 48px; }
body.kb-stitch-app .kb-h-skel-hero { height: 170px; }
body.kb-stitch-app .kb-h-skel-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
body.kb-stitch-app .kb-h-skel-pair .skeleton { height: 76px; }
body.kb-stitch-app .kb-h-skel-strip { height: 300px; }

/* Sheets: main card picker, shortcuts, insight detail */
body.kb-stitch-app .kb-h-sheet-note { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.45; color: var(--kb-muted); }
body.kb-stitch-app .kb-h-picks { display: grid; gap: 10px; }
body.kb-stitch-app .kb-h-pick {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: 18px; text-align: left; color: var(--kb-text);
  border: 1.5px solid var(--kb-line); background: rgba(255, 255, 255, .03);
}
body.kb-stitch-app .kb-h-pick.is-on { border-color: var(--kb-primary); background: rgba(var(--kb-primary-rgb), .08); }
body.kb-stitch-app .kb-h-pick-icon { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: rgba(var(--kb-primary-rgb), .14); color: var(--kb-h-pink); }
body.kb-stitch-app .kb-h-pick-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
body.kb-stitch-app .kb-h-pick-text b { font-size: 15px; font-weight: 850; }
body.kb-stitch-app .kb-h-pick-text .num { font-size: 15px; font-weight: 800; color: var(--kb-h-teal); }
body.kb-stitch-app .kb-h-pick-text small { font-size: 12.5px; font-weight: 600; color: var(--kb-muted); }
body.kb-stitch-app .kb-h-radio { flex: 0 0 auto; width: 22px; height: 22px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--kb-line-strong, var(--kb-line)); }
body.kb-stitch-app .kb-h-pick.is-on .kb-h-radio { border-color: var(--kb-primary); background: radial-gradient(circle, var(--kb-primary) 0 5px, transparent 6px); }
body.kb-stitch-app .kb-h-pick-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px; border-radius: 16px; text-align: left;
  border: 1px solid var(--kb-line); background: rgba(255, 255, 255, .03); color: var(--kb-text);
}
body.kb-stitch-app .kb-h-pick-row > span { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
body.kb-stitch-app .kb-h-pick-row b { font-size: 14.5px; font-weight: 800; }
body.kb-stitch-app .kb-h-pick-row small { font-size: 12.5px; font-weight: 650; color: var(--kb-muted); }
body.kb-stitch-app .kb-h-pick-row .kb-h-icon:first-child { color: var(--kb-h-pink); }

body.kb-stitch-app .kb-h-sc-list { padding: 0 12px; border-radius: 18px; background: var(--kb-h-card); border: 1px solid var(--kb-h-card-line); }
body.kb-stitch-app .kb-h-sc-row { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 6px 0; border-top: 1px solid var(--kb-h-divider); }
body.kb-stitch-app .kb-h-sc-row.is-fixed { border-top: 0; padding-left: 28px; background: transparent; }
body.kb-stitch-app .kb-h-sc-row.is-dragging { position: relative; z-index: 2; border-radius: 14px; background: var(--kb-panel-solid); box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
body.kb-stitch-app .kb-h-grip { flex: 0 0 auto; width: 24px; height: 40px; display: grid; place-items: center; color: var(--kb-muted); cursor: grab; touch-action: none; }
body.kb-stitch-app .kb-h-sc-row.is-dragging .kb-h-grip { cursor: grabbing; }
body.kb-stitch-app .kb-h-sc-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
body.kb-stitch-app .kb-h-sc-text b { font-size: 14.5px; font-weight: 800; color: var(--kb-text); }
body.kb-stitch-app .kb-h-sc-text small { font-size: 12px; font-weight: 600; color: var(--kb-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.kb-stitch-app .kb-h-sc-always { font-size: 12px; font-weight: 800; color: var(--kb-muted); }
body.kb-stitch-app .kb-h-sc-move { display: none; }
body.kb-stitch-app .kb-h-sc-arrow { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--kb-muted); }
body.kb-stitch-app .kb-h-sc-arrow svg { width: 16px; height: 16px; }
/* Keyboard users get up/down buttons beside the grip. */
body.kb-stitch-app .kb-h-sc-row:focus-within .kb-h-sc-move { display: flex; flex-direction: column; }
body.kb-stitch-app .kb-h-switch { position: relative; flex: 0 0 auto; width: 46px; height: 28px; }
body.kb-stitch-app .kb-h-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
body.kb-stitch-app .kb-h-switch i { position: absolute; inset: 0; border-radius: 14px; background: rgba(255, 255, 255, .14); transition: background .2s ease; pointer-events: none; }
html.light body.kb-stitch-app .kb-h-switch i { background: rgba(38, 21, 38, .16); }
body.kb-stitch-app .kb-h-switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #c9b5c7; transition: transform .25s cubic-bezier(.34, 1.3, .64, 1), background .2s ease;
}
body.kb-stitch-app .kb-h-switch input:checked + i { background: linear-gradient(135deg, var(--kb-primary), var(--kb-accent)); }
body.kb-stitch-app .kb-h-switch input:checked + i::after { transform: translateX(18px); background: #1a0f1d; }
body.kb-stitch-app .kb-h-switch input:focus-visible + i { outline: 2px solid var(--kb-primary); outline-offset: 2px; }
body.kb-stitch-app .kb-h-sc-count { margin: 0; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--kb-muted); }

body.kb-stitch-app .kb-h-detail-head { display: flex; align-items: flex-start; gap: 12px; padding-top: 4px; }
body.kb-stitch-app .kb-h-detail-head > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
body.kb-stitch-app .kb-h-detail-head small { font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--kb-h-pink); }
body.kb-stitch-app .kb-h-detail-head b { font-size: 21px; font-weight: 900; line-height: 1.25; color: var(--kb-text); }
body.kb-stitch-app .kb-h-bars {
  display: grid; grid-template-columns: repeat(var(--bars, 4), minmax(0, 1fr)); align-items: end; gap: 8px; height: 170px; margin: 14px 0 4px; padding: 12px 8px 10px;
  border-radius: 18px; background: var(--kb-h-card); border: 1px solid var(--kb-h-card-line);
}
body.kb-stitch-app .kb-h-bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
body.kb-stitch-app .kb-h-bar-col small { font-size: 11.5px; font-weight: 800; color: var(--kb-muted); white-space: nowrap; }
body.kb-stitch-app .kb-h-bar-col i { display: block; width: min(38px, 70%); max-height: calc(100% - 44px); border-radius: 8px 8px 4px 4px; background: rgba(var(--kb-primary-rgb), .32); }
body.kb-stitch-app .kb-h-bar-col.is-now i { background: linear-gradient(180deg, #f4aeff, #7bd0ff); }
body.kb-stitch-app .kb-h-bar-col > span { font-size: 12px; font-weight: 700; color: var(--kb-muted); white-space: nowrap; }
body.kb-stitch-app .kb-h-detail-copy { margin: 10px 0 4px; font-size: 14.5px; font-weight: 600; line-height: 1.55; color: var(--kb-muted); }
body.kb-stitch-app .kb-h-detail-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px 0 0; font-size: 12.5px; font-weight: 700; color: var(--kb-muted); }

@media (max-width: 1100px) {
  body.kb-stitch-app .kb-h-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 768px) {
  body.kb-stitch-app .kb-home { gap: 14px; }
  body.kb-stitch-app .kb-h-grid { gap: 14px; }
  body.kb-stitch-app .kb-h-cashflow { display: none; }
  body.kb-stitch-app[data-page="dashboard"] .kb-content-canvas { padding-bottom: calc(var(--kb-stitch-bottom-nav) + env(safe-area-inset-bottom) + 24px) !important; }
}

@media (min-width: 769px) {
  body.kb-stitch-app .kb-h-recent-list { overflow-y: auto; max-height: calc(var(--kb-h-row, 66px) * 6.5); scrollbar-width: thin; }
}

@media (prefers-reduced-motion: reduce) {
  body.kb-stitch-app :is(.kb-h-tab-bar, .kb-h-hero-bar i, .kb-h-duo, .kb-h-dots i, .kb-h-switch i::after) { transition: none !important; }
}

/* ── Phone tab bar, as in the Home mockup: a flat full-width bar with the Catat button raised over its edge ── */
@media (max-width: 768px) {
  body.kb-stitch-app {
    --kb-stitch-bottom-nav: 80px;
  }

  body.kb-stitch-app .mobile-bottom-nav {
    height: calc(var(--kb-stitch-bottom-nav) + env(safe-area-inset-bottom));
    padding: 8px 10px max(10px, env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
    border-radius: 0;
    background: rgba(24, 14, 26, .96);
    box-shadow: 0 -12px 30px rgba(0, 0, 0, .28);
    overflow: visible;
  }

  html.light body.kb-stitch-app .mobile-bottom-nav {
    border-top-color: rgba(38, 21, 38, .08);
    background: rgba(255, 250, 255, .96);
    box-shadow: 0 -10px 28px rgba(38, 21, 38, .08);
  }

  body.kb-stitch-app .mobile-nav-btn {
    height: 58px;
    gap: 4px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 800;
  }

  body.kb-stitch-app .mobile-nav-btn .mobile-nav-icon svg { width: 22px; height: 22px; }

  body.kb-stitch-app .mobile-bottom-nav .kb-glider { border-radius: 16px; background: rgba(255, 255, 255, .08); }

  body.kb-stitch-app .mobile-nav-btn.mobile-ai-main {
    align-self: end;
    height: auto;
    padding-bottom: 6px;
    background: transparent !important;
    overflow: visible;
  }

  body.kb-stitch-app .mobile-nav-btn.mobile-ai-main .mobile-nav-icon {
    width: 56px;
    height: 56px;
    margin: -30px auto 2px;
    display: grid;
    place-items: center;
    color: #1a0f1d;
    border-radius: 50%;
    background: linear-gradient(135deg, #f4aeff, #7bd0ff);
    box-shadow: 0 10px 26px rgba(244, 174, 255, .35), 0 0 0 5px var(--kb-bg);
  }

  html.light body.kb-stitch-app .mobile-nav-btn.mobile-ai-main .mobile-nav-icon {
    box-shadow: 0 10px 24px rgba(177, 79, 199, .28), 0 0 0 5px #fffaff;
  }

  body.kb-stitch-app .mobile-nav-btn.mobile-ai-main .mobile-nav-icon svg { width: 26px; height: 26px; stroke-width: 2.4; }
  body.kb-stitch-app .mobile-nav-btn.mobile-ai-main span:last-child { color: var(--kb-text); font-weight: 900; }
}

@media (max-width: 360px) {
  body.kb-stitch-app .mobile-nav-btn { font-size: 11px; }
}

/* "Pasang Aplikasi" stays on one line in the install pill. */
body.kb-stitch-app #pwa-install-btn .pwa-install-go { white-space: nowrap; }

/* The safe-to-spend sheet also says what is in the accounts (Home no longer shows it by default). */
body.kb-stitch-app .safe-sheet-balance { margin-top: 12px; }

/* Automations while amounts are hidden: in or out instead of a masked figure. */
body.kb-stitch-app .kb-h-row-tag { flex: 0 0 auto; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; color: var(--kb-muted); background: rgba(255, 255, 255, .06); }
body.kb-stitch-app .kb-h-row-tag.is-income { color: var(--kb-income); background: color-mix(in srgb, var(--kb-income) 14%, transparent); }
html.light body.kb-stitch-app .kb-h-row-tag { background: rgba(38, 21, 38, .06); }

/* The + sheet on wider screens too: every "log a transaction" button opens it as a centred dialog. */
@media (min-width: 769px) {
  body.kb-stitch-app .mobile-ai-sheet.open {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(7, 4, 9, .55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  body.kb-stitch-app .mobile-ai-panel {
    width: min(440px, 100%);
    padding: 18px;
    border: 1px solid var(--kb-line);
    border-radius: 22px;
    color: var(--kb-text);
    background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .055)), rgba(28, 18, 30, .97);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  }
  body.kb-stitch-app .mobile-ai-panel > .mx-auto:first-child { display: none; }
  body.kb-stitch-app .mobile-ai-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 66px;
    padding: 12px 14px;
    border: 1px solid var(--kb-line);
    border-radius: 14px;
    color: var(--kb-text);
    background: rgba(255, 255, 255, .06);
    text-align: left;
    transition: background .2s ease, border-color .2s ease;
  }
  body.kb-stitch-app .mobile-ai-option:hover { background: rgba(255, 255, 255, .1); border-color: rgba(var(--kb-primary-rgb), .4); }
  body.kb-stitch-app .mobile-ai-sheet .ai-action-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: var(--kb-primary);
    background: rgba(var(--kb-primary-rgb), .15);
    border: 1px solid rgba(var(--kb-primary-rgb), .28);
  }
  body.kb-stitch-app .mobile-ai-sheet .ai-action-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  body.kb-stitch-app .mobile-ai-sheet .ai-action-icon-receipt { color: var(--kb-accent); background: color-mix(in srgb, var(--kb-accent) 14%, transparent); border-color: color-mix(in srgb, var(--kb-accent) 30%, transparent); }
  body.kb-stitch-app .mobile-ai-sheet .ai-action-icon-manual { color: var(--kb-muted); background: color-mix(in srgb, var(--kb-muted) 12%, transparent); border-color: color-mix(in srgb, var(--kb-muted) 20%, transparent); }
  html.light body.kb-stitch-app .mobile-ai-panel { background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .86)), var(--kb-panel-solid); box-shadow: 0 30px 80px rgba(38, 21, 38, .2); }
  html.light body.kb-stitch-app .mobile-ai-option { background: rgba(255, 255, 255, .75); }
}

/* Keyboard up on a phone (see watchOnScreenKeyboard): the tab bar steps aside and the Meeny chat
   takes exactly the part of the screen that is still visible, composer right above the keys. */
@media (max-width: 768px) {
  body.kb-stitch-app.kb-keyboard-open .mobile-bottom-nav { transform: translateY(130%); pointer-events: none; }
  body.kb-stitch-app.kb-keyboard-open[data-page="meeny"] #page-content.kb-content-canvas {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--kb-vv-top, 0px);
    height: var(--kb-vv-h, 100dvh) !important;
    padding-bottom: 0 !important;
    z-index: 30;
  }
  body.kb-stitch-app.kb-keyboard-open[data-page="meeny"] .mn-page { height: 100%; }
}

/* No install pill over onboarding (the app behind it is hidden then) or the opening animation. */
body.kb-stitch-app:has(#app.hidden) #pwa-install-btn,
body.kb-stitch-app:has(#boot-splash:not(.hidden)) #pwa-install-btn { display: none !important; }

/* A photo going to Meeny: a thumbnail in the composer and in the message just sent. */
body.kb-stitch-app .mn-attachment img { width: 34px; height: 34px; flex: 0 0 auto; margin-left: -8px; border-radius: 10px; object-fit: cover; }
body.kb-stitch-app .mn-attachment span { font-size: 12.5px; }
body.kb-stitch-app .mn-msg-photo { display: block; width: min(220px, 100%); max-height: 260px; margin-bottom: 8px; border-radius: 14px; object-fit: cover; }

/* Meeny cards for automations and categories. */
body.kb-stitch-app .mn-card-field > .mn-card-select {
  height: 40px; padding: 0 12px; border-radius: 11px !important; border: 1px solid var(--kb-line) !important; background: rgba(255, 255, 255, .04) !important;
  color: var(--kb-text); font-size: 15px; font-weight: 800; width: 100%;
}
body.kb-stitch-app .mn-card-cat { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: end; gap: 12px; }
body.kb-stitch-app .mn-card-cat > .kb-tile { width: 44px; height: 44px; font-size: 22px; }

/* Changing the currency: convert at a rate, or change only the symbol. */
body.kb-stitch-app .kb-cur-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; margin-bottom: 14px; }
body.kb-stitch-app .kb-cur-hero h2 { margin: 4px 0 0; font-size: 20px; font-weight: 900; color: var(--kb-text); }
body.kb-stitch-app .kb-cur-hero p { margin: 0; font-size: 14px; font-weight: 600; color: var(--kb-muted); }
body.kb-stitch-app .kb-cur-option { display: flex; flex-direction: column; gap: 6px; padding: 14px; margin-top: 10px; border: 1px solid var(--kb-line); border-radius: 18px; background: rgba(255, 255, 255, .03); }
body.kb-stitch-app .kb-cur-option.is-main { border-color: rgba(var(--kb-primary-rgb), .45); background: rgba(var(--kb-primary-rgb), .07); }
body.kb-stitch-app .kb-cur-option > b { font-size: 15.5px; font-weight: 900; color: var(--kb-text); }
body.kb-stitch-app .kb-cur-option > small { font-size: 13px; font-weight: 600; line-height: 1.45; color: var(--kb-muted); }
body.kb-stitch-app .kb-cur-option > button { margin-top: 6px; min-height: 46px; }
body.kb-stitch-app .kb-cur-rate { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 15px; font-weight: 800; color: var(--kb-text); }
body.kb-stitch-app .kb-cur-rate > span:first-child { flex: 0 0 auto; }
body.kb-stitch-app .kb-cur-rate-input { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--kb-line); border-radius: 12px; background: rgba(255, 255, 255, .05); }
body.kb-stitch-app .kb-cur-rate-input > span { color: var(--kb-muted); font-weight: 800; }
body.kb-stitch-app .kb-cur-rate-input input { flex: 1 1 auto; min-width: 0; height: 40px; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; color: var(--kb-text); font: inherit; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
body.kb-stitch-app .kb-cur-source { font-size: 12px !important; }
body.kb-stitch-app .kb-cur-example { margin: 2px 0 0; font-size: 13.5px; font-weight: 650; color: var(--kb-muted); }
body.kb-stitch-app .kb-cur-example:empty { display: none; }
body.kb-stitch-app .kb-cur-example b { color: var(--kb-text); }
html.light body.kb-stitch-app .kb-cur-option { background: rgba(255, 255, 255, .7); }
html.light body.kb-stitch-app .kb-cur-rate-input { background: rgba(255, 255, 255, .85); }
body.kb-stitch-app .ob2-currency-note { margin: 8px 0 0; font-size: 12.5px; font-weight: 700; color: #7bd0ff; }

/* While the install pill floats over Home, the end of the page leaves room for it. */
@media (max-width: 768px) {
  body.kb-stitch-app[data-page="dashboard"]:has(#pwa-install-btn.is-offered) #page-content {
    padding-bottom: calc(76px + env(safe-area-inset-bottom) + 64px) !important;
  }
}

/* "mulai 11 Okt" under the limit in the analytics pace bar (the first period after sign-up). */
body.kb-stitch-app .kb-an-pace-head span small { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 700; color: var(--kb-muted); }
body.kb-stitch-app .kb-an-pace-head b { flex: 0 0 auto; }

/* Upgrade offer: what ran out, when it returns, what Plus adds (N× more). */
body.kb-stitch-app .kb-offer-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; margin: -4px 0 14px; }
body.kb-stitch-app .kb-offer-hero h2 { margin: 6px 0 0; font-size: 20px; font-weight: 900; line-height: 1.25; color: var(--kb-text); }
body.kb-stitch-app .kb-offer-hero p { margin: 0; max-width: 340px; font-size: 14px; font-weight: 600; line-height: 1.5; color: var(--kb-muted); }
body.kb-stitch-app .kb-offer-perks { display: grid; gap: 8px; margin: 0 0 12px; padding: 12px; list-style: none; border: 1px solid var(--kb-line); border-radius: 18px; background: rgba(255, 255, 255, .035); }
body.kb-stitch-app .kb-offer-perks li { display: flex; align-items: flex-start; gap: 10px; padding: 6px 4px; border-radius: 12px; }
body.kb-stitch-app .kb-offer-perks li.is-key { padding: 8px 8px; background: rgba(var(--kb-primary-rgb), .12); }
body.kb-stitch-app .kb-offer-perks li > :first-child { flex: 0 0 auto; margin-top: 2px; color: var(--kb-primary); }
body.kb-stitch-app .kb-offer-perks b { display: block; font-size: 14.5px; font-weight: 900; color: var(--kb-text); }
body.kb-stitch-app .kb-offer-perks small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 650; line-height: 1.4; color: var(--kb-muted); }
body.kb-stitch-app .kb-offer-price { margin: 0 0 12px; text-align: center; font-size: 13px; font-weight: 800; color: var(--kb-muted); font-variant-numeric: tabular-nums; }

/* Streak avatar opened: the avatar large, the next one, and a button to wear it. */
body.kb-stitch-app .kb-unlock-art { position: relative; display: grid; place-items: center; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, rgba(253, 186, 116, .35), transparent 68%); }
body.kb-stitch-app .kb-unlock-art .kb-avatar { border-radius: 50%; box-shadow: 0 0 0 3px var(--kb-panel-solid, #1f1322), 0 0 0 5px #fdba74; }
body.kb-stitch-app .kb-unlock-badge { position: absolute; bottom: 4px; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 11px; border-radius: 14px; background: var(--kb-panel-solid, #2a1830); border: 1px solid rgba(253, 186, 116, .6); color: #fdba74; font-size: 13px; font-weight: 900; }
body.kb-stitch-app .kb-unlock-badge .kb-ui-glyph { width: 14px; height: 14px; }
body.kb-stitch-app .kb-unlock-kicker { font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #fdba74; }
body.kb-stitch-app .kb-unlock-next { display: grid; gap: 8px; margin: 0 0 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--kb-line); background: rgba(255, 255, 255, .04); }
body.kb-stitch-app .kb-unlock-next-head { display: flex; align-items: center; gap: 10px; }
body.kb-stitch-app .kb-unlock-next-head > span:nth-child(2) { flex: 1 1 auto; min-width: 0; }
body.kb-stitch-app .kb-unlock-next-head b { display: block; font-size: 14px; font-weight: 850; color: var(--kb-text); }
body.kb-stitch-app .kb-unlock-next-head small { display: block; font-size: 12.5px; font-weight: 600; color: var(--kb-muted); }
body.kb-stitch-app .kb-unlock-next-art img { filter: grayscale(1) brightness(.45); }
body.kb-stitch-app .kb-unlock-count { font-size: 14px; font-weight: 900; color: #fdba74; }
body.kb-stitch-app .kb-unlock-bar { display: block; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .08); }
body.kb-stitch-app .kb-unlock-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #fdba74, var(--kb-primary)); }
html.light body.kb-stitch-app :is(.kb-unlock-bar, .kb-unlock-next) { background: rgba(38, 21, 38, .05); }

/* Plus welcome: the thank-you sheet after paying, and its Home banner. */
body.kb-stitch-app .kb-plus-welcome-hero { position: relative; padding-top: 4px; }
body.kb-stitch-app .kb-plus-welcome-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; color: #1b0f1d; background: linear-gradient(135deg, #f4aeff, #7bd0ff); }
body.kb-stitch-app .kb-plus-welcome-badge .kb-ui-glyph { width: 15px; height: 15px; }
body.kb-stitch-app .kb-plus-welcome-hero .kb-plus-welcome-until { margin-top: 4px; padding: 6px 12px; border-radius: 12px; font-size: 13px; font-weight: 850; color: var(--kb-text); background: rgba(var(--kb-primary-rgb), .12); font-variant-numeric: tabular-nums; }
body.kb-stitch-app .kb-plus-welcome-label { margin: 0 0 8px; font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--kb-muted); }
body.kb-stitch-app .kb-home-banner.is-plus { border-color: rgba(var(--kb-primary-rgb), .45); background: linear-gradient(135deg, rgba(244, 174, 255, .18), rgba(123, 208, 255, .12)), var(--kb-panel-solid); }
body.kb-stitch-app .kb-home-banner.is-plus .kb-home-banner-icon { color: #1b0f1d; background: linear-gradient(135deg, #f4aeff, #7bd0ff); }
body.kb-stitch-app .kb-offer-reward { display: block; width: 100%; margin-top: 10px; min-height: 40px; border: 0; background: transparent; color: var(--kb-primary); font-size: 13.5px; font-weight: 800; }
html.light body.kb-stitch-app .kb-offer-perks { background: rgba(255, 255, 255, .75); }

/* "Update ready" prompt: same panel and gradient action as the rest of the app, above the bottom nav on phones. */
#pwa-update-prompt.kb-update-prompt {
  position: fixed; z-index: 100; left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; border-radius: 20px;
  background: #241826; color: #f5eaf3; border: 1px solid rgba(244, 174, 255, .22); box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  font-family: 'Hanken Grotesk', system-ui, sans-serif; animation: kbUpdateIn .28s ease-out both;
}
@media (min-width: 640px) { #pwa-update-prompt.kb-update-prompt { left: auto; right: 24px; bottom: 24px; width: 380px; } }
#pwa-update-prompt .kb-update-copy { flex: 1 1 auto; min-width: 0; }
#pwa-update-prompt .kb-update-title { margin: 0; font-size: 14.5px; font-weight: 800; }
#pwa-update-prompt .kb-update-detail { margin: 3px 0 0; font-size: 12.5px; font-weight: 600; color: #b9a6b7; }
#pwa-update-prompt .kb-update-reload {
  flex: 0 0 auto; min-height: 40px; padding: 0 16px; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, #f4aeff, #7bd0ff); color: #1a0f1d; font-size: 13.5px; font-weight: 800;
}
#pwa-update-prompt .kb-update-reload:focus-visible { outline: 2px solid #f5eaf3; outline-offset: 2px; }
html.light #pwa-update-prompt.kb-update-prompt { background: #fff; color: #2b1a2e; border-color: rgba(177, 79, 199, .25); box-shadow: 0 14px 34px rgba(43, 26, 46, .18); }
html.light #pwa-update-prompt .kb-update-detail { color: #6f5d6e; }
@keyframes kbUpdateIn { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { #pwa-update-prompt.kb-update-prompt { animation: none; } }
