:root {
  --ink: #15201c;
  --ink-soft: #53615b;
  --ink-faint: #7d8984;
  --canvas: #f3f4f0;
  --surface: #ffffff;
  --surface-soft: #f7f8f5;
  --line: #e4e8e2;
  --brand-950: #101c18;
  --brand-900: #16231f;
  --brand-800: #20352d;
  --brand-700: #365b4e;
  --brand-600: #4f7d6c;
  --brand-500: #649581;
  --brand-300: #a9d2bf;
  --brand-100: #e4f2eb;
  --warm-100: #f7ead8;
  --warm-600: #9c6232;
  --blue-100: #e2edf6;
  --blue-600: #4c7392;
  --purple-100: #eee8f6;
  --purple-600: #725990;
  --danger-100: #fbe7e5;
  --danger-600: #a84c46;
  --success-100: #e2f2e9;
  --success-700: #357254;
  --shadow-sm: 0 1px 2px rgb(20 34 28 / 4%), 0 6px 20px rgb(20 34 28 / 4%);
  --shadow-lg: 0 20px 60px rgb(12 28 21 / 18%);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --sidebar-width: 244px;
  --page-width: 1280px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  max-width: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: 78px;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 95% 0%, rgb(169 210 191 / 16%), transparent 31rem),
    var(--canvas);
  color: var(--ink);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}
body.sidebar-active { overflow: hidden; }

button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
a { color: inherit; }
img, svg { display: block; }
svg { fill: currentColor; }
h1, h2, h3, p { margin-top: 0; }

.sr-only {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 999;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand-900);
  box-shadow: var(--shadow-lg);
  font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid rgb(100 149 129 / 45%);
  outline-offset: 3px;
}

.app-shell { min-height: 100vh; }
.app-column { min-width: 0; }

.sidebar {
  position: fixed;
  z-index: 80;
  inset: 0 auto 0 0;
  width: min(86vw, var(--sidebar-width));
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  transform: translateX(-102%);
  transition: transform .28s var(--ease);
  background: var(--brand-900);
  color: #f3f7f5;
  box-shadow: 10px 0 40px rgb(8 18 14 / 20%);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / 18%) transparent;
}

.sidebar.is-open { transform: translateX(0); }

.sidebar__brand,
.mobile-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar__brand { padding: 2px 7px 26px; }
.sidebar__brand img { border-radius: 14px; box-shadow: 0 8px 24px rgb(0 0 0 / 16%); }
.sidebar__brand div,
.sidebar__profile div,
.assistant-health div { min-width: 0; display: flex; flex-direction: column; }
.sidebar__brand strong { font-size: 1.12rem; letter-spacing: .01em; }
.sidebar__brand span { color: rgb(236 246 241 / 55%); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }

.sidebar__nav { display: grid; gap: 5px; }
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 46px;
  padding: 10px 13px;
  border-radius: 12px;
  color: rgb(237 245 241 / 67%);
  font-size: .9rem;
  font-weight: 570;
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease;
}
.nav-link svg { width: 20px; height: 20px; opacity: .82; }
.nav-link:hover { color: #fff; background: rgb(255 255 255 / 7%); }
.nav-link.is-active { color: #fff; background: rgb(164 211 190 / 14%); }
.nav-link.is-active::before {
  position: absolute;
  left: -16px;
  width: 3px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: #9ed6ba;
  content: "";
}

.sidebar__footer { display: grid; gap: 12px; margin-top: auto; }
.assistant-health,
.sidebar__profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 14px;
  background: rgb(255 255 255 / 4%);
}
.assistant-health strong,
.sidebar__profile strong { overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.assistant-health span:not(.status-dot),
.sidebar__profile span { color: rgb(236 246 241 / 55%); font-size: .7rem; }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #87918d; }
.status-dot.is-online { background: #79c99e; box-shadow: 0 0 0 4px rgb(121 201 158 / 12%); }
.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-700);
  color: #fff !important;
  font-size: .72rem !important;
  font-weight: 700;
}
.logout-form button {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 12px;
  background: transparent;
  color: rgb(236 246 241 / 58%);
  font-size: .72rem;
  font-weight: 650;
}
.logout-form button:hover { background: rgb(255 255 255 / 6%); color: #fff; }
.logout-form svg { width: 17px; height: 17px; }

.mobile-header {
  position: sticky;
  z-index: 45;
  top: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid rgb(222 228 220 / 80%);
  background: rgb(244 245 241 / 88%);
  backdrop-filter: blur(16px);
}
.mobile-header__brand { gap: 9px; }
.mobile-header__brand img { border-radius: 11px; }
.mobile-header__brand strong { font-size: 1rem; }

.icon-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
}
.icon-button svg { width: 22px; height: 22px; }
.icon-button--surface { border: 1px solid var(--line); background: var(--surface); }
.icon-button:hover { background-color: rgb(25 47 39 / 6%); }

.sidebar-scrim {
  position: fixed;
  z-index: 70;
  inset: 0;
  background: rgb(8 17 14 / 52%);
  backdrop-filter: blur(2px);
}

.main-content {
  width: min(100%, calc(var(--page-width) + 40px));
  margin-inline: auto;
  padding: 20px 16px 108px;
}

.content-section { scroll-margin-top: 80px; }
.page-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 1px 22px;
}
.eyebrow {
  margin-bottom: 5px;
  color: var(--brand-600);
  font-size: .72rem;
  font-weight: 760;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.page-hero h1 { margin-bottom: 4px; font-size: clamp(1.75rem, 5.2vw, 2.55rem); line-height: 1.14; letter-spacing: -.035em; }
.page-hero__summary { margin: 0; color: var(--ink-soft); font-size: .91rem; }
.page-hero__actions { display: flex; gap: 8px; padding-top: 2px; }

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: .84rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform .18s var(--ease), box-shadow .18s ease, background-color .18s ease;
}
.button svg { width: 18px; height: 18px; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button--primary { background: var(--brand-900); color: #fff; box-shadow: 0 8px 20px rgb(22 35 31 / 14%); }
.button--primary:hover { background: var(--brand-800); box-shadow: 0 10px 24px rgb(22 35 31 / 19%); }
.button--quiet { border-color: var(--line); background: var(--surface); color: var(--ink); }
.button--quiet:hover { border-color: #d1dad3; background: #fbfcfa; }
.button--ghost { background: transparent; color: var(--ink-soft); }
.button[disabled], button[disabled] { cursor: wait; opacity: .55; }

.tony-card {
  position: relative;
  max-width: 100%;
  overflow: hidden;
  padding: 19px;
  border: 1px solid rgb(154 196 177 / 22%);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0%, rgb(140 202 174 / 18%), transparent 45%),
    linear-gradient(135deg, var(--brand-950), #1b3129);
  color: #f5faf7;
  box-shadow: 0 14px 36px rgb(15 31 24 / 12%);
}
.tony-card::after {
  position: absolute;
  width: 240px;
  height: 240px;
  right: -110px;
  bottom: -150px;
  border: 1px solid rgb(158 214 186 / 15%);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 28px rgb(158 214 186 / 4%), 0 0 0 62px rgb(158 214 186 / 3%);
  pointer-events: none;
}
.tony-card__header { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.tony-card__mark { flex: 0 0 auto; padding: 3px; border-radius: 14px; background: rgb(255 255 255 / 8%); }
.tony-card__mark img { border-radius: 11px; }
.tony-card h2 { margin-bottom: 1px; font-size: 1rem; }
.tony-card__header p { margin: 0; color: rgb(238 248 243 / 63%); font-size: .77rem; }
.tony-composer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  margin-top: 16px;
  padding: 5px;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 15px;
  background: rgb(255 255 255 / 9%);
}
.tony-composer textarea {
  min-width: 0;
  min-height: 40px;
  max-height: 130px;
  flex: 1;
  resize: none;
  padding: 10px 8px 7px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: .86rem;
  line-height: 1.4;
}
.tony-composer textarea::placeholder { color: rgb(236 246 241 / 47%); }
.tony-composer textarea:focus-visible {
  border-radius: 9px;
  outline: 2px solid rgb(169 210 191 / 72%);
  outline-offset: -2px;
}
.composer-button {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: rgb(239 248 243 / 65%);
}
.composer-button:hover { background: rgb(255 255 255 / 8%); color: #fff; }
.composer-button svg { width: 19px; height: 19px; }
.composer-button--send { background: #9fd3bb; color: var(--brand-950); }
.composer-button--send:hover { background: #b4e2cc; color: var(--brand-950); }
.composer-button.is-listening { background: var(--danger-100); color: var(--danger-600); animation: pulse 1.5s infinite; }
.prompt-chips { position: relative; z-index: 1; max-width: 100%; display: flex; gap: 7px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.prompt-chips::-webkit-scrollbar { display: none; }
.prompt-chips button {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 999px;
  background: rgb(255 255 255 / 4%);
  color: rgb(239 248 243 / 66%);
  font-size: .7rem;
}
.prompt-chips button:hover { background: rgb(255 255 255 / 9%); color: #fff; }
.tony-response {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgb(169 210 191 / 18%);
  border-radius: 12px;
  background: rgb(255 255 255 / 6%);
}
.tony-response[hidden] { display: none; }
.tony-response > span { color: #a9d2bf; font-size: .7rem; font-weight: 780; }
.tony-response p { margin: 0; color: rgb(245 250 247 / 86%); font-size: .78rem; white-space: pre-wrap; }

.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.metric-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.metric-card--balance { grid-column: 1 / -1; color: #fff; border-color: transparent; background: linear-gradient(140deg, var(--brand-700), #567e6f); }
.metric-card__top { min-height: 31px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.metric-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-100); color: var(--brand-700); }
.metric-icon svg { width: 16px; height: 16px; }
.metric-icon--warm { color: var(--warm-600); background: var(--warm-100); }
.metric-icon--blue { color: var(--blue-600); background: var(--blue-100); }
.metric-icon--purple { color: var(--purple-600); background: var(--purple-100); }
.metric-card--balance .metric-icon { background: rgb(255 255 255 / 14%); color: #fff; }
.trend { padding: 4px 7px; border-radius: 999px; background: var(--surface-soft); color: var(--ink-soft); font-size: .62rem; font-weight: 700; }
.metric-card--balance .trend { background: rgb(255 255 255 / 12%); color: rgb(255 255 255 / 76%); }
.trend--positive { color: var(--success-700); background: var(--success-100); }
.metric-card p { margin: 13px 0 2px; color: var(--ink-soft); font-size: .72rem; }
.metric-card > strong { display: block; overflow: hidden; font-size: clamp(1.25rem, 5vw, 1.75rem); letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.metric-card > span { display: block; margin-top: 3px; overflow: hidden; color: var(--ink-faint); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.metric-card--balance p, .metric-card--balance > span { color: rgb(255 255 255 / 66%); }
.metric-card .metric-card__compact { font-size: clamp(1rem, 3.9vw, 1.42rem); }

.fx-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgb(255 255 255 / 72%);
  box-shadow: 0 1px 2px rgb(20 34 28 / 3%);
}
.fx-strip__heading { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.fx-strip__heading > div { display: grid; }
.fx-strip__heading strong { font-size: .71rem; }
.fx-strip__heading span { color: var(--ink-faint); font-size: .59rem; }
.fx-strip__icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; background: var(--brand-100); color: var(--brand-700) !important; font-size: .8rem !important; font-weight: 800; }
.fx-strip__rates { min-width: 0; display: flex; flex: 1 1 330px; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.fx-strip__rates::-webkit-scrollbar { display: none; }
.fx-rate { min-width: max-content; display: flex; align-items: baseline; gap: 5px; padding: 5px 8px; border-radius: 9px; background: var(--surface-soft); color: var(--ink-soft); font-size: .63rem; }
.fx-rate strong { color: var(--ink); font-size: .65rem; }
.fx-rate time { color: var(--ink-faint); font-size: .54rem; }
.fx-rate--pending { color: var(--ink-faint); }
.fx-strip__source { flex: 1 0 100%; color: var(--ink-faint); font-size: .56rem; }
.fx-strip__warning { color: var(--warm-600); font-weight: 680; }
.fx-converter { position: relative; margin-left: auto; }
.fx-converter summary { padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--brand-700); font-size: .62rem; font-weight: 720; list-style: none; cursor: pointer; }
.fx-converter summary::-webkit-details-marker { display: none; }
.fx-converter[open] { flex: 1 0 100%; margin-left: 0; }
.fx-converter[open] summary { width: max-content; margin-left: auto; }
.fx-converter form { display: grid; grid-template-columns: minmax(84px, .7fr) auto 30px auto minmax(130px, 1fr); align-items: center; gap: 6px; margin-top: 8px; padding: 9px; border-radius: 11px; background: var(--surface-soft); }
.fx-converter input, .fx-converter select { width: 100%; min-height: 36px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: .72rem; }
.fx-converter output { color: var(--brand-700); font-size: .74rem; font-weight: 760; text-align: right; }

.dashboard-section { padding-top: 48px; }
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-heading h2 { margin-bottom: 0; font-size: clamp(1.3rem, 4vw, 1.65rem); letter-spacing: -.025em; }
.section-intro { max-width: 650px; margin: 5px 0 0; color: var(--ink-soft); font-size: .75rem; }
.section-heading__actions { display: flex; align-items: center; gap: 8px; }
.select-control {
  max-width: 160px;
  min-height: 42px;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: .82rem;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.panel__header { min-height: 51px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 16px 10px; }
.panel__header h3 { margin: 0; font-size: .93rem; }
.panel__subtitle { display: block; color: var(--ink-faint); font-size: .68rem; }
.soft-label { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: var(--surface-soft); color: var(--ink-soft); font-size: .67rem; font-weight: 650; }
.text-link { color: var(--brand-600); font-size: .73rem; font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.budget-layout, .split-layout { display: grid; gap: 12px; }
.budget-summary { padding: 0 16px 16px; }
.budget-summary .panel__header { padding-inline: 0; }
.cashflow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 20px; }
.cashflow div { min-width: 0; }
.cashflow span { display: block; margin-bottom: 3px; color: var(--ink-faint); font-size: .67rem; }
.cashflow strong { display: block; overflow: hidden; font-size: clamp(.85rem, 3.3vw, 1.15rem); letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.money-positive { color: var(--success-700); }
.budget-bar, .project-progress {
  width: 100%;
  height: 7px;
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 99px;
  background: #edf0ec;
  appearance: none;
}
.budget-bar::-webkit-progress-bar, .project-progress::-webkit-progress-bar { border-radius: 99px; background: #edf0ec; }
.budget-bar::-webkit-progress-value, .project-progress::-webkit-progress-value { border-radius: 99px; background: linear-gradient(90deg, var(--brand-500), #8cbaa5); }
.budget-bar::-moz-progress-bar, .project-progress::-moz-progress-bar { border-radius: 99px; background: var(--brand-500); }
.budget-bar__legend { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; color: var(--ink-faint); font-size: .65rem; }
.category-list { margin: 0; padding: 2px 16px 12px; list-style: none; }
.category-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.category-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--brand-500); }
.category-dot--1 { background: #cf9c68; }
.category-dot--2 { background: #718eae; }
.category-dot--3 { background: #9277ae; }
.category-dot--4 { background: #bd7172; }
.category-dot--5 { background: #8b9270; }
.category-list div { min-width: 0; }
.category-list strong, .category-list span { display: block; }
.category-list strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.category-list div span { color: var(--ink-faint); font-size: .66rem; }
.category-percent { font-size: .72rem; font-weight: 720; }
.category-percent.is-danger { color: var(--danger-600); }

.subscription-total { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 16px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.subscription-total div { min-width: 0; }
.subscription-total span { display: block; color: var(--ink-faint); font-size: .66rem; }
.subscription-total strong { display: block; overflow: hidden; margin-top: 2px; font-size: clamp(.87rem, 3.4vw, 1.12rem); text-overflow: ellipsis; white-space: nowrap; }
.subscription-total small { display: block; margin-top: 2px; color: var(--brand-600); font-size: .58rem; }
.subscription-total__warning { grid-column: 1 / -1; margin: 2px 0 0; color: var(--warm-600); font-size: .64rem; font-weight: 680; }
.subscription-panel { min-width: 0; max-width: 100%; overflow: hidden; }
.table-wrap { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.data-table { width: 100%; border-collapse: collapse; font-size: .75rem; }
.data-table th { padding: 10px 14px; background: #fbfcfa; color: var(--ink-faint); font-size: .65rem; font-weight: 650; text-align: left; white-space: nowrap; }
.data-table td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.data-table td:first-child { display: flex; align-items: center; gap: 9px; }
.data-table td strong, .data-table td small { display: block; }
.data-table td small { margin-top: 1px; color: var(--ink-faint); font-size: .65rem; }
.service-mark { width: 31px; height: 31px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--brand-100); color: var(--brand-700); font-size: .75rem; font-weight: 800; }
.service-mark--1 { color: #92633a; background: var(--warm-100); }
.service-mark--2 { color: var(--blue-600); background: var(--blue-100); }
.service-mark--3 { color: var(--purple-600); background: var(--purple-100); }
.service-mark--4 { color: var(--danger-600); background: var(--danger-100); }
.service-mark--5 { color: #687146; background: #eef0df; }
.cell-primary { min-width: 90px; }
.status-badge { display: inline-flex; padding: 4px 7px; border-radius: 99px; background: var(--surface-soft); color: var(--ink-soft); font-size: .62rem; font-weight: 750; }
.status-badge--active, .status-badge--planned { color: var(--success-700); background: var(--success-100); }
.status-badge--paused, .status-badge--cancelled { color: var(--ink-soft); background: #edf0ed; }
.status-badge--done { color: var(--blue-600); background: var(--blue-100); }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.row-actions form { margin: 0; }
.row-action { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--brand-600); font-size: .65rem; font-weight: 700; }

.list-panel { min-width: 0; }
.check-list { margin: 0; padding: 0 16px 10px; list-style: none; }
.check-list li { display: flex; min-height: 55px; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.check-list li.is-overdue .check-list__body > span { color: var(--danger-600); }
.check-button { width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; }
.check-button span { width: 18px; height: 18px; border: 1.5px solid #b8c1bc; border-radius: 6px; transition: background-color .15s ease, border-color .15s ease; }
.check-button:hover span { border-color: var(--brand-500); background: var(--brand-100); }
.check-list__body { min-width: 0; flex: 1; }
.check-list__body strong, .check-list__body span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-list__body strong { font-size: .78rem; }
.check-list__body span { margin-top: 1px; color: var(--ink-faint); font-size: .65rem; }
.priority { flex: 0 0 auto; padding: 4px 7px; border-radius: 99px; color: var(--ink-faint); background: var(--surface-soft); font-size: .59rem; font-weight: 730; }
.priority--urgent { color: var(--danger-600); background: var(--danger-100); }
.priority--high { color: var(--warm-600); background: var(--warm-100); }
.quantity { color: var(--ink-faint); font-size: .7rem; font-weight: 700; }
.inline-add { display: flex; gap: 7px; padding: 4px 16px 9px; }
.inline-add input { min-width: 0; height: 38px; flex: 1; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); color: var(--ink); font-size: .75rem; }
.inline-add button { width: 38px; height: 38px; flex: 0 0 auto; border: 0; border-radius: 10px; background: var(--brand-900); color: white; font-size: 1.25rem; }

.anchor-target { position: relative; top: -80px; visibility: hidden; }
.task-center-heading { align-items: flex-start; }
.task-center-heading .button { flex: 0 0 auto; }
.task-center { min-width: 0; display: grid; overflow: visible; }
.task-scope { min-width: 0; padding: 13px 12px 11px; border-bottom: 1px solid var(--line); background: var(--surface-soft); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.task-scope__label { padding: 2px 7px 8px; color: var(--ink-faint); font-size: .61rem; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.task-scope__tabs { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.task-scope__tabs::-webkit-scrollbar { display: none; }
.task-scope__tabs button { min-width: max-content; min-height: 40px; display: grid; grid-template-columns: 22px auto auto; align-items: center; gap: 6px; padding: 7px 9px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-soft); font-size: .7rem; text-align: left; }
.task-scope__tabs button:hover { background: rgb(32 53 45 / 5%); color: var(--ink); }
.task-scope__tabs button.is-active { background: var(--surface); color: var(--brand-800); box-shadow: var(--shadow-sm); }
.task-scope__tabs button > strong { min-width: 19px; padding: 2px 5px; border-radius: 99px; background: #e8ece8; color: var(--ink-faint); font-size: .56rem; text-align: center; }
.task-scope__tabs button.is-active > strong { background: var(--brand-100); color: var(--brand-700); }
.task-scope__icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; color: var(--brand-700); font-size: .72rem; font-weight: 800; }
.task-scope__note { display: none; color: var(--ink-faint); font-size: .58rem; }
.task-scope__note span { margin-right: 5px; color: var(--brand-500); font-size: .45rem; }

.task-workspace { min-width: 0; padding: 12px; }
.task-quick-add { display: grid; grid-template-columns: 24px minmax(150px, 1fr) minmax(160px, auto) 108px auto; align-items: center; gap: 7px; padding: 7px; border: 1px solid #dce3dd; border-radius: 13px; background: var(--surface); box-shadow: 0 5px 18px rgb(22 35 31 / 5%); }
.task-quick-add__plus { display: grid; place-items: center; color: var(--brand-600); font-size: 1.2rem; font-weight: 450; }
.task-quick-add__title { min-width: 0; height: 36px; padding: 5px 2px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .8rem; }
.task-quick-add__title::placeholder { color: #929c97; }
.task-quick-add__date { position: relative; min-width: 0; display: flex; align-items: center; gap: 5px; }
.task-quick-add__date svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--ink-faint); }
.task-quick-add__date input, .task-quick-add__priority select { width: 100%; min-width: 0; height: 36px; padding: 6px 7px; border: 0; border-radius: 8px; outline: 0; background: var(--surface-soft); color: var(--ink-soft); font-size: .66rem; }
.task-quick-add > button { min-height: 36px; padding: 7px 12px; border: 0; border-radius: 9px; background: var(--brand-900); color: #fff; font-size: .68rem; font-weight: 730; }
.task-quick-options { grid-column: 2 / -1; }
.task-quick-options summary { width: max-content; padding: 3px 0; color: var(--ink-faint); font-size: .59rem; font-weight: 660; list-style: none; cursor: pointer; }
.task-quick-options summary::-webkit-details-marker { display: none; }
.task-quick-options summary::before { margin-right: 5px; content: "＋"; }
.task-quick-options[open] summary::before { content: "−"; }
.task-quick-options__fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 7px 0 2px; }
.task-quick-options__fields label { min-width: 0; display: grid; gap: 3px; }
.task-quick-options__fields label > span { color: var(--ink-faint); font-size: .57rem; }
.task-quick-options__fields input, .task-quick-options__fields select { width: 100%; min-width: 0; height: 35px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--ink); font-size: .65rem; }

.task-toolbar { position: relative; display: flex; align-items: center; gap: 7px; margin: 11px 0 7px; }
.task-search { min-width: 140px; height: 37px; display: flex; flex: 1; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.task-search svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--ink-faint); }
.task-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .7rem; }
.task-filter-menu { position: relative; flex: 0 0 auto; }
.task-filter-menu > summary { min-height: 37px; display: flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-soft); font-size: .67rem; font-weight: 680; list-style: none; cursor: pointer; }
.task-filter-menu > summary::-webkit-details-marker { display: none; }
.task-filter-menu > summary::after { color: var(--ink-faint); content: "▾"; font-size: .56rem; }
.task-filter-menu > summary strong { min-width: 17px; padding: 1px 4px; border-radius: 99px; background: var(--brand-100); color: var(--brand-700); font-size: .54rem; text-align: center; }
.task-filter-menu__panel { position: absolute; z-index: 20; top: calc(100% + 7px); right: 0; width: min(260px, calc(100vw - 48px)); display: grid; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-lg); }
.task-filter-menu__panel label { display: grid; gap: 4px; color: var(--ink-faint); font-size: .59rem; }
.task-filter-menu__panel select { width: 100%; min-height: 36px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); color: var(--ink); font-size: .67rem; }
.task-filter-menu__panel button { justify-self: end; padding: 5px 2px; border: 0; background: transparent; color: var(--brand-600); font-size: .62rem; font-weight: 720; }
.task-view-tabs { flex: 0 0 auto; display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--surface-soft); }
.task-view-tabs button { width: 31px; height: 31px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink-faint); }
.task-view-tabs button.is-active { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-sm); }
.task-view-tabs svg { width: 16px; height: 16px; }

.task-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.task-list > li[hidden] { display: none; }
.task-card { position: relative; min-width: 0; display: grid; grid-template-columns: 31px minmax(0, 1fr); gap: 9px; padding: 11px 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color .16s ease, box-shadow .16s ease, transform .16s var(--ease); }
.task-card::before { position: absolute; inset: 8px auto 8px 0; width: 3px; border-radius: 0 4px 4px 0; background: transparent; content: ""; }
.task-card:hover { border-color: #d6ddd7; box-shadow: 0 7px 20px rgb(22 35 31 / 6%); transform: translateY(-1px); }
.task-card--urgent::before { background: var(--danger-600); }
.task-card--high::before { background: var(--warm-600); }
.task-card--low::before { background: var(--blue-600); }
.task-card.is-pinned { background: linear-gradient(90deg, rgb(228 242 235 / 42%), var(--surface) 35%); }
.task-card__complete { padding-top: 1px; }
.task-complete-button { width: 29px; height: 29px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: transparent; }
.task-complete-button span { width: 19px; height: 19px; border: 1.5px solid #b4beb8; border-radius: 7px; transition: border-color .15s ease, background-color .15s ease, transform .15s ease; }
.task-complete-button:hover span { border-color: var(--brand-500); background: var(--brand-100); transform: scale(1.05); }
.task-card--urgent .task-complete-button span { border-color: #d79b96; }
.task-card__body { min-width: 0; }
.task-card__title-row { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.task-card__title-row h3 { min-width: 0; margin: 1px 0 0; overflow: hidden; font-size: .78rem; font-weight: 690; text-overflow: ellipsis; white-space: nowrap; }
.task-pin { margin-right: 6px; color: var(--brand-500); font-size: .52rem; }
.task-card__body > p { margin: 5px 0 0; overflow: hidden; color: var(--ink-soft); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.task-priority { flex: 0 0 auto; padding: 3px 6px; border-radius: 99px; background: var(--surface-soft); color: var(--ink-faint); font-size: .54rem; font-weight: 740; }
.task-priority--urgent { background: var(--danger-100); color: var(--danger-600); }
.task-priority--high { background: var(--warm-100); color: var(--warm-600); }
.task-priority--low { background: var(--blue-100); color: var(--blue-600); }
.task-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; margin-top: 6px; color: var(--ink-faint); font-size: .59rem; }
.task-card__meta > span { display: inline-flex; align-items: center; gap: 4px; }
.task-card__meta svg { width: 12px; height: 12px; }
.task-list-chip i { width: 6px; height: 6px; border-radius: 2px; background: var(--brand-500); }
.task-due.is-overdue { color: var(--danger-600); }
.task-assignee::before { width: 14px; height: 14px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-100); color: var(--brand-700); content: "•"; }
.task-repeat { color: var(--brand-600); }
.task-quadrant { padding: 2px 5px; border-radius: 6px; background: var(--purple-100); color: var(--purple-600); }
.task-card__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.task-card__tags span { padding: 2px 5px; border-radius: 6px; background: #eef1ee; color: var(--ink-soft); font-size: .55rem; }
.task-list[data-view="cards"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.task-list[data-view="cards"] .task-card { height: 100%; min-height: 132px; }
.task-list[data-view="cards"] .task-card__title-row h3, .task-list[data-view="cards"] .task-card__body > p { white-space: normal; }
.task-list[data-view="matrix"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.task-list[data-view="matrix"] > li { padding: 8px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.task-list[data-view="matrix"] > li::before { display: block; margin: 0 3px 6px; color: var(--ink-soft); font-size: .64rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.task-list[data-view="matrix"] > li[data-task-quadrant="do"]::before { content: "Сделать сейчас · срочно и важно"; color: var(--danger-600); }
.task-list[data-view="matrix"] > li[data-task-quadrant="plan"]::before { content: "Запланировать · важно"; color: var(--brand-700); }
.task-list[data-view="matrix"] > li[data-task-quadrant="delegate"]::before { content: "Делегировать · срочно"; color: #92633a; }
.task-list[data-view="matrix"] > li[data-task-quadrant="later"]::before { content: "Можно позже"; }
.task-list[data-view="matrix"] .task-card { height: calc(100% - 22px); min-height: 122px; }
.task-list[data-view="matrix"] .task-card__title-row h3, .task-list[data-view="matrix"] .task-card__body > p { white-space: normal; }
.task-empty { min-height: 190px; display: grid; place-items: center; align-content: center; padding: 25px; text-align: center; }
.task-empty__mark { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 13px; background: var(--brand-100); color: var(--brand-700); font-size: 1rem; }
.task-empty h3 { margin: 0 0 4px; font-size: .82rem; }
.task-empty p { max-width: 360px; margin: 0; color: var(--ink-faint); font-size: .67rem; }
.task-empty button { margin-top: 9px; padding: 5px; border: 0; background: transparent; color: var(--brand-600); font-size: .65rem; font-weight: 730; }
.task-empty--filter[hidden] { display: none; }
.task-tools-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(240px, .65fr); gap: 10px; margin-top: 10px; }
.task-tools-grid .panel { min-width: 0; }
.habit-list { display: grid; gap: 0; margin: 0; padding: 0 16px 12px; list-style: none; }
.habit-list li { display: flex; min-height: 58px; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.habit-list li:first-child { border-top: 0; }
.habit-list li.is-done { opacity: .72; }
.habit-emoji { width: 32px; height: 32px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 10px; background: var(--brand-100); font-size: 1rem; }
.habit-body { min-width: 0; display: grid; flex: 1; grid-template-columns: 1fr auto; gap: 2px 10px; }
.habit-body strong { overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.habit-body span { color: var(--ink-faint); font-size: .64rem; }
.habit-body progress { width: 100%; height: 5px; grid-column: 1 / -1; overflow: hidden; border: 0; border-radius: 99px; accent-color: var(--brand-600); }
.habit-check { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--brand-700); font-weight: 800; }
.compact-empty { display: grid; gap: 4px; padding: 12px 18px 20px; text-align: center; }
.compact-empty strong { font-size: .78rem; }
.compact-empty span { color: var(--ink-faint); font-size: .68rem; }
.focus-panel { display: flex; flex-direction: column; }
.focus-clock { display: grid; flex: 1; place-content: center; padding: 8px 18px 12px; text-align: center; }
.focus-clock strong { color: var(--brand-900); font-size: clamp(1.7rem, 4vw, 2.5rem); font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.focus-clock span, .focus-history { color: var(--ink-faint); font-size: .68rem; }
.focus-actions { display: flex; justify-content: center; padding: 0 18px 14px; }
.focus-history { display: block; padding: 0 18px 12px; text-align: center; }
.task-shopping { margin-top: 10px; }
.task-shopping .panel__header { align-items: flex-start; }
.task-shopping .eyebrow { margin-bottom: 2px; }
.task-shopping .check-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.task-shopping .check-list li:nth-child(2) { border-top-color: transparent; }

.subscription-price { min-width: 180px; }
.subscription-price__conversion { margin-top: 3px !important; color: var(--brand-700) !important; font-weight: 650; }
.subscription-price__warning { margin-top: 3px !important; color: var(--warm-600) !important; }
.subscription-price__cycle { margin-top: 3px !important; }

.project-grid { display: grid; gap: 10px; }
.project-card { position: relative; min-height: 190px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s ease; }
.project-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgb(18 35 28 / 8%); }
.project-card__top { display: flex; align-items: center; justify-content: space-between; }
.project-dot { width: 10px; height: 10px; border-radius: 4px; background: var(--brand-500); box-shadow: 0 0 0 5px var(--brand-100); }
.project-dot--1 { background: #c08754; box-shadow: 0 0 0 5px var(--warm-100); }
.project-dot--2 { background: #6383a2; box-shadow: 0 0 0 5px var(--blue-100); }
.project-dot--3 { background: #8468a0; box-shadow: 0 0 0 5px var(--purple-100); }
.project-dot--4 { background: #af5f5d; box-shadow: 0 0 0 5px var(--danger-100); }
.project-dot--5 { background: #7e875c; box-shadow: 0 0 0 5px #eef0df; }
.project-card h3 { margin: 19px 0 5px; font-size: .97rem; }
.project-card p { min-height: 36px; margin-bottom: 18px; color: var(--ink-soft); font-size: .72rem; }
.project-card__meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; color: var(--ink-faint); font-size: .64rem; }
.stretched-link::after { position: absolute; inset: 0; content: ""; }

.timeline-panel { padding: 5px 16px 11px; }
.timeline-list { margin: 0; padding: 0; list-style: none; }
.timeline-list li { display: grid; grid-template-columns: 38px 14px minmax(0, 1fr); gap: 8px; min-height: 75px; padding: 12px 0; }
.timeline-list time { width: 38px; height: 43px; display: grid; align-content: center; border: 1px solid var(--line); border-radius: 10px; text-align: center; }
.timeline-list time strong { font-size: .9rem; line-height: 1; }
.timeline-list time span { margin-top: 3px; color: var(--ink-faint); font-size: .56rem; font-weight: 700; text-transform: uppercase; }
.timeline-line { position: relative; }
.timeline-line::before { position: absolute; z-index: 1; top: 16px; left: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-500); box-shadow: 0 0 0 4px var(--brand-100); content: ""; }
.timeline-line::after { position: absolute; top: 27px; bottom: -20px; left: 7px; width: 1px; background: var(--line); content: ""; }
.timeline-list li:last-child .timeline-line::after { display: none; }
.timeline-title { display: flex; align-items: center; gap: 7px; }
.timeline-title strong { overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.timeline-list li > div p { margin: 2px 0 0; color: var(--ink-soft); font-size: .68rem; }
.timeline-list li > div > span { display: block; margin-top: 4px; color: var(--ink-faint); font-size: .64rem; }
.event-kind { flex: 0 0 auto; padding: 3px 6px; border-radius: 99px; background: var(--brand-100); color: var(--brand-700); font-size: .55rem; font-weight: 700; }
.event-kind--work { color: var(--purple-600); background: var(--purple-100); }

.empty-state { display: grid; place-items: center; min-height: 190px; padding: 28px; text-align: center; }
.empty-state--compact { min-height: 120px; }
.empty-state h3 { margin-bottom: 5px; font-size: .93rem; }
.empty-state p { max-width: 380px; margin: 0; color: var(--ink-faint); font-size: .73rem; }
.empty-state a, .empty-state button { margin-top: 12px; border: 0; background: transparent; color: var(--brand-600); font-size: .73rem; font-weight: 740; }

.page-footer { display: flex; justify-content: space-between; gap: 12px; padding: 40px 2px 0; color: var(--ink-faint); font-size: .65rem; }

.bottom-nav {
  position: fixed;
  z-index: 55;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 10px;
  height: 67px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 5px 7px;
  border: 1px solid rgb(223 229 222 / 88%);
  border-radius: 20px;
  background: rgb(255 255 255 / 93%);
  box-shadow: 0 12px 32px rgb(22 35 31 / 13%);
  backdrop-filter: blur(16px);
}
.bottom-nav a { min-width: 0; display: grid; justify-items: center; gap: 2px; color: var(--ink-faint); font-size: .56rem; font-weight: 650; text-decoration: none; }
.bottom-nav a > svg { width: 20px; height: 20px; }
.bottom-nav a.is-active { color: var(--brand-700); }
.bottom-nav__tony { position: relative; top: -10px; }
.bottom-nav__orb { width: 46px; height: 46px; display: grid; place-items: center; border: 4px solid var(--canvas); border-radius: 16px; background: var(--brand-900); box-shadow: 0 7px 18px rgb(22 35 31 / 25%); }
.bottom-nav__orb img { border-radius: 10px; }

.app-dialog {
  width: min(calc(100% - 24px), 580px);
  max-height: min(88vh, 760px);
  max-height: min(88dvh, 760px);
  overflow: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.app-dialog::backdrop { background: rgb(11 23 18 / 56%); backdrop-filter: blur(4px); }
.app-dialog > form, .app-dialog > .quick-action-grid { padding-inline: 20px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 21px 20px 15px; }
.app-dialog form .dialog-header { margin-inline: -20px; }
.dialog-header h2 { margin: 0; font-size: 1.25rem; }
.dialog-close { width: 36px; height: 36px; display: grid; flex: 0 0 auto; place-items: center; border: 0; border-radius: 11px; background: var(--surface-soft); color: var(--ink-soft); font-size: 1.4rem; line-height: 1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 20px -20px 0; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.form-grid { display: grid; gap: 13px; }
.field { display: grid; gap: 6px; }
.field > span { color: var(--ink-soft); font-size: .72rem; font-weight: 680; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #dce2dc;
  border-radius: 11px;
  outline: 0;
  background: #fbfcfa;
  color: var(--ink);
  font-size: .8rem;
}
.field textarea { min-height: 88px; resize: vertical; }
.field-hint { color: var(--ink-faint); font-size: .6rem; font-weight: 500; }
.field-check { grid-template-columns: 20px minmax(0, 1fr); align-items: center; }
.field-check input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--brand-700); }
.field-check > span { color: var(--ink); font-size: .7rem; }
.field input:focus, .field select:focus, .field textarea:focus, .inline-add input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgb(100 149 129 / 12%); }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 15px; padding: 4px; border-radius: 12px; background: var(--surface-soft); }
.segmented-control label { position: relative; }
.segmented-control input { position: absolute; opacity: 0; }
.segmented-control span { min-height: 36px; display: grid; place-items: center; border-radius: 9px; color: var(--ink-soft); font-size: .75rem; font-weight: 700; }
.segmented-control input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.segmented-control input:focus-visible + span { outline: 3px solid rgb(100 149 129 / 35%); }
.dialog-note { margin-top: 13px; padding: 10px 12px; border-radius: 10px; background: var(--warm-100); color: #7b5432; font-size: .68rem; }
.quick-action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding-bottom: 22px; }
.quick-action-grid button { min-width: 0; display: grid; grid-template-columns: 35px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; }
.quick-action-grid button:hover { border-color: var(--brand-300); background: #fbfdfb; }
.quick-action-grid button > span { width: 35px; height: 35px; grid-row: 1 / 3; display: grid; place-items: center; border-radius: 10px; background: var(--brand-100); color: var(--brand-700); font-weight: 800; }
.quick-action-grid strong { overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.quick-action-grid small { color: var(--ink-faint); font-size: .62rem; }
.voice-privacy-content { padding: 0 20px 2px; }
.voice-privacy-content p { margin: 0 0 9px; color: var(--ink-soft); font-size: .78rem; }
.voice-privacy-dialog > .dialog-actions { margin-inline: 0; }

.toast-stack { position: fixed; z-index: 110; top: 72px; right: 14px; left: 14px; display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); font-size: .75rem; pointer-events: auto; }
.toast--success { border-color: #badcc9; }
.toast--error { border-color: #efc8c4; }
.toast button { width: 25px; height: 25px; border: 0; border-radius: 8px; background: var(--surface-soft); color: var(--ink-faint); }

.auth-page {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 22px 16px;
  background:
    radial-gradient(circle at 12% 12%, rgb(111 168 143 / 26%), transparent 24rem),
    radial-gradient(circle at 92% 88%, rgb(157 207 184 / 14%), transparent 26rem),
    var(--brand-950);
}
.auth-shell { width: min(100%, 430px); }
.auth-card { padding: 26px 22px 22px; border: 1px solid rgb(255 255 255 / 10%); border-radius: var(--radius-xl); background: var(--surface); box-shadow: 0 28px 80px rgb(0 0 0 / 28%); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.auth-brand img { border-radius: 16px; box-shadow: 0 9px 24px rgb(22 35 31 / 20%); }
.auth-brand div { display: flex; flex-direction: column; }
.auth-brand strong { font-size: 1.06rem; }
.auth-brand span { color: var(--ink-faint); font-size: .66rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.auth-heading h1 { margin-bottom: 7px; font-size: clamp(1.65rem, 7vw, 2.05rem); letter-spacing: -.04em; }
.auth-heading > p:last-child { margin-bottom: 23px; color: var(--ink-soft); font-size: .8rem; }
.auth-form { display: grid; gap: 14px; }
.auth-submit { width: 100%; min-height: 47px; margin-top: 5px; }
.form-alert { margin-bottom: 17px; padding: 11px 12px; border: 1px solid #ecc7c3; border-radius: 11px; background: var(--danger-100); color: #8d403b; font-size: .75rem; }
.auth-security { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 23px 0 0; color: var(--ink-faint); font-size: .65rem; }
.auth-footer { margin: 14px 0 0; color: rgb(237 246 241 / 47%); font-size: .65rem; text-align: center; }

@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgb(168 76 70 / 12%); } }

@media (min-width: 520px) {
  .main-content { padding-inline: 22px; }
  .metric-card--balance { grid-column: auto; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .field--wide { grid-column: 1 / -1; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 519px) {
  .field input,
  .field select,
  .field textarea,
  .inline-add input,
  .tony-composer textarea { font-size: 1rem; }
  .bottom-nav a { font-size: .63rem; }
  .metric-card p,
  .metric-card > span,
  .cashflow span,
  .check-list__body span { font-size: .7rem; }
  .app-dialog { width: min(calc(100% - 16px), 580px); }
  .subscription-total { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subscription-total div:last-child { grid-column: 1 / -1; }
  .subscription-total strong { overflow: visible; font-size: .94rem; overflow-wrap: anywhere; text-overflow: clip; white-space: normal; }
  .fx-strip { align-items: flex-start; }
  .fx-strip__heading { width: 100%; }
  .fx-converter { margin-left: 0; }
  .fx-converter[open] summary { margin-left: 0; }
  .fx-converter form { grid-template-columns: minmax(0, 1fr) minmax(78px, .65fr); }
  .fx-converter form > span { display: none; }
  .fx-converter output { grid-column: 1 / -1; min-height: 24px; padding-top: 4px; text-align: left; }
  .task-center-heading { display: grid; }
  .task-center-heading .button { justify-self: start; margin-top: 4px; }
  .task-workspace { padding: 9px; }
  .task-quick-add { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .task-quick-add__date { grid-column: 2; }
  .task-quick-add__priority { grid-column: 3; }
  .task-quick-add > button { grid-column: 3; grid-row: 1; }
  .task-quick-options { grid-column: 2 / -1; }
  .task-quick-options__fields { grid-template-columns: 1fr; }
  .task-toolbar { flex-wrap: wrap; }
  .task-search { flex-basis: calc(100% - 82px); }
  .task-filter-menu { order: 3; }
  .task-view-tabs { margin-left: auto; }
  .task-list[data-view="cards"] { grid-template-columns: 1fr; }
  .task-list[data-view="matrix"] { grid-template-columns: 1fr; }
  .task-tools-grid { grid-template-columns: 1fr; }
  .task-card__title-row h3 { font-size: .84rem; }
  .task-shopping .check-list { grid-template-columns: 1fr; }
  .task-shopping .check-list li:nth-child(2) { border-top-color: var(--line); }
}

@media (min-width: 760px) {
  .main-content { padding: 30px 30px 90px; }
  .tony-card { padding: 22px; }
  .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .budget-layout { grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr); }
  .split-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timeline-list li { grid-template-columns: 48px 18px minmax(0, 1fr); }
  .timeline-list time { width: 43px; height: 48px; }
  .toast-stack { top: 20px; right: 24px; left: auto; width: min(390px, calc(100% - 48px)); }
  .task-workspace { padding: 15px; }
}

@media (min-width: 1020px) {
  html { scroll-padding-top: 24px; }
  .app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .sidebar { transform: none; width: var(--sidebar-width); box-shadow: none; }
  .app-column { grid-column: 2; }
  .mobile-header, .bottom-nav, .sidebar-scrim { display: none !important; }
  .main-content { padding: 36px 38px 60px; }
  .content-section { scroll-margin-top: 24px; }
  .page-hero { padding-top: 2px; }
  .project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .task-center { grid-template-columns: 184px minmax(0, 1fr); }
  .task-scope { display: flex; flex-direction: column; border-right: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
  .task-scope__tabs { display: grid; overflow: visible; }
  .task-scope__tabs button { width: 100%; grid-template-columns: 25px minmax(0, 1fr) auto; min-width: 0; }
  .task-scope__note { display: block; margin-top: auto; padding: 18px 6px 2px; }
}

@media (min-width: 1320px) {
  :root { --sidebar-width: 258px; }
  .main-content { padding-inline: 48px; }
  .tony-card { display: grid; grid-template-columns: minmax(230px, .65fr) minmax(400px, 1.35fr); align-items: center; column-gap: 24px; }
  .tony-card__header { grid-row: 1 / 3; }
  .tony-composer { margin-top: 0; }
  .prompt-chips { grid-column: 2; }
  .tony-response { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Life OS */
.life-os { display: grid; gap: 22px; width: min(100%, var(--page-width)); margin-inline: auto; }
.life-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 3px 2px 2px; }
.life-hero h1 { max-width: 760px; margin-bottom: 7px; font-size: clamp(1.75rem, 4vw, 2.65rem); line-height: 1.08; letter-spacing: -.045em; }
.life-hero > div:first-child > p:last-child { max-width: 720px; margin: 0; color: var(--ink-soft); font-size: .82rem; }
.life-hero__actions, .life-section-actions { display: flex; align-items: flex-end; gap: 9px; flex: 0 0 auto; }
.life-workspace-picker { display: grid; gap: 4px; }
.life-workspace-picker span { color: var(--ink-faint); font-size: .61rem; font-weight: 720; text-transform: uppercase; letter-spacing: .06em; }
.life-workspace-picker select, .life-select select {
  min-height: 42px;
  padding: 8px 34px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font-size: .76rem;
  font-weight: 650;
}

.life-tabs {
  position: sticky;
  z-index: 35;
  top: 72px;
  display: grid;
  grid-template-columns: repeat(6, minmax(96px, 1fr));
  gap: 4px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgb(255 255 255 / 90%);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  scrollbar-width: none;
}
.life-tabs::-webkit-scrollbar { display: none; }
.life-tabs button { min-width: 96px; min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px; border: 0; border-radius: 11px; background: transparent; color: var(--ink-faint); font-size: .72rem; font-weight: 720; transition: background .18s ease, color .18s ease, transform .18s var(--ease); }
.life-tabs button:hover { color: var(--ink); background: var(--surface-soft); }
.life-tabs button.is-active { color: #fff; background: var(--brand-900); box-shadow: 0 6px 16px rgb(22 35 31 / 18%); }
.life-tabs button span { font-size: .88rem; }
.life-pane { min-width: 0; animation: life-pane-in .24s var(--ease); }
.life-pane[hidden] { display: none !important; }
@keyframes life-pane-in { from { opacity: 0; transform: translateY(5px); } }

.life-tony-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .65fr); gap: 14px; }
.life-chat { min-height: min(680px, calc(100vh - 230px)); display: grid; grid-template-rows: auto minmax(300px, 1fr) auto; overflow: hidden; }
.life-panel-heading { min-width: 0; display: flex; align-items: center; gap: 11px; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.life-panel-heading > div { min-width: 0; }
.life-panel-heading h2, .life-panel-heading h3 { margin: 0; font-size: .92rem; }
.life-panel-heading p:not(.eyebrow) { margin: 2px 0 0; color: var(--ink-faint); font-size: .65rem; }
.life-panel-heading .eyebrow { margin-bottom: 2px; }
.life-tony-avatar { width: 42px; height: 42px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 14px; background: var(--brand-900); box-shadow: 0 7px 18px rgb(22 35 31 / 17%); }
.life-tony-avatar img { border-radius: 11px; }
.life-live-status { display: flex; align-items: center; gap: 6px; margin-left: auto; color: var(--success-700); font-size: .63rem; font-weight: 700; }
.life-live-status i { width: 7px; height: 7px; border-radius: 50%; background: #63ae81; box-shadow: 0 0 0 4px var(--success-100); }
.life-chat__stream { display: flex; flex-direction: column; gap: 12px; padding: 22px; overflow-y: auto; background: linear-gradient(160deg, rgb(228 242 235 / 35%), transparent 40%), var(--surface-soft); }
.life-message { max-width: min(78%, 680px); align-self: flex-start; padding: 11px 14px; border: 1px solid var(--line); border-radius: 5px 16px 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.life-message--user { align-self: flex-end; border-color: var(--brand-800); border-radius: 16px 5px 16px 16px; background: var(--brand-900); color: #f3f8f5; }
.life-message__author { display: block; margin-bottom: 4px; color: var(--brand-600); font-size: .58rem; font-weight: 780; text-transform: uppercase; letter-spacing: .05em; }
.life-message--user .life-message__author { color: rgb(227 242 234 / 58%); }
.life-message p { margin: 0; font-size: .78rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.life-message--action { border-color: var(--brand-300); background: var(--brand-100); }
.life-action-preview__risk { display: block; margin-top: 9px; color: var(--brand-700); font-size: .59rem; font-weight: 720; }
.life-action-preview__controls { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.life-action-preview__controls .button { min-height: 34px; padding: 7px 11px; font-size: .62rem; }
.life-chat__composer { padding: 14px; border-top: 1px solid var(--line); background: var(--surface); }
.life-chat__composer textarea { width: 100%; min-height: 74px; padding: 12px 14px; resize: vertical; border: 1px solid var(--line); border-radius: 13px; outline: 0; background: var(--surface-soft); color: var(--ink); font-size: .8rem; }
.life-chat__composer textarea:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgb(100 149 129 / 12%); }
.life-chat__controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; }
.life-chat__controls > span { color: var(--ink-faint); font-size: .59rem; }
.life-context-stack { display: grid; align-content: start; gap: 14px; }
.life-context-card, .life-suggestions { overflow: hidden; }
.life-context-grid { display: grid; gap: 2px; padding: 8px 18px 5px; }
.life-context-grid > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.life-context-grid > div:last-child { border-bottom: 0; }
.life-context-grid span { color: var(--ink-soft); font-size: .68rem; }
.life-context-grid strong { max-width: 58%; overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.life-inline-state { margin: 7px 18px 16px; padding: 9px 11px; border-radius: 10px; background: var(--brand-100); color: var(--brand-700); font-size: .64rem; }
.life-inline-state.is-error { background: var(--danger-100); color: var(--danger-600); }
.life-suggestions { display: grid; padding-bottom: 8px; }
.life-suggestions button { min-height: 43px; margin-inline: 10px; padding: 10px 9px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink-soft); font-size: .69rem; text-align: left; }
.life-suggestions button:last-child { border-bottom: 0; }
.life-suggestions button:hover { color: var(--brand-700); background: var(--brand-100); border-radius: 9px; }

.life-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 14px; padding-inline: 2px; }
.life-section-heading h2 { margin-bottom: 5px; font-size: clamp(1.3rem, 3vw, 1.7rem); letter-spacing: -.03em; }
.life-section-heading > div > p:last-child { max-width: 680px; margin: 0; color: var(--ink-soft); font-size: .72rem; }
.life-filterbar { min-height: 52px; display: flex; align-items: center; gap: 7px; margin-bottom: 12px; padding: 7px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); scrollbar-width: none; }
.life-filterbar::-webkit-scrollbar { display: none; }
.life-search { min-width: min(280px, 45vw); display: flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); color: var(--ink-faint); }
.life-search input { width: 100%; min-height: 34px; padding: 6px 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .7rem; }
.life-search--small { min-width: 120px; max-width: 170px; margin-left: auto; }
.life-filter-chip { min-height: 34px; flex: 0 0 auto; padding: 6px 11px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-faint); font-size: .66rem; font-weight: 680; }
.life-filter-chip:hover, .life-filter-chip.is-active { background: var(--brand-100); color: var(--brand-700); }

.life-board-shell { min-height: 480px; overflow-x: auto; }
.life-kanban { min-width: max-content; display: grid; grid-auto-columns: minmax(270px, 300px); grid-auto-flow: column; gap: 11px; padding-bottom: 12px; }
.life-kanban-column { min-height: 470px; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: #edf0eb; }
.life-kanban-column > header { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 7px 12px; }
.life-kanban-column > header h3 { margin: 0; overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.life-kanban-column > header strong { min-width: 22px; padding: 2px 6px; border-radius: 99px; background: rgb(255 255 255 / 75%); color: var(--ink-faint); font-size: .61rem; text-align: center; }
.life-column-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--column-color); }
.life-kanban-cards { min-height: 410px; display: grid; align-content: start; gap: 7px; padding: 2px; border-radius: 12px; transition: background .18s ease; }
.life-kanban-cards.is-drop-target { background: rgb(100 149 129 / 12%); outline: 2px dashed var(--brand-300); }
.life-task-card { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 2px 8px rgb(20 34 28 / 5%); cursor: grab; }
.life-task-card:hover { border-color: var(--brand-300); box-shadow: 0 7px 18px rgb(20 34 28 / 8%); }
.life-task-card.is-dragging { opacity: .45; cursor: grabbing; }
.life-task-card > div { display: flex; flex-wrap: wrap; gap: 5px; }
.life-task-card h4 { margin: 9px 0 4px; font-size: .76rem; }
.life-task-card p { display: -webkit-box; margin-bottom: 10px; overflow: hidden; color: var(--ink-soft); font-size: .64rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.life-task-card footer { display: flex; align-items: center; justify-content: space-between; color: var(--ink-faint); font-size: .59rem; }
.life-priority, .life-overdue { padding: 3px 6px; border-radius: 6px; background: var(--surface-soft); color: var(--ink-soft); font-size: .54rem; font-weight: 720; }
.life-priority--urgent, .life-priority--high, .life-overdue { background: var(--danger-100); color: var(--danger-600); }
.life-priority--medium { background: var(--warm-100); color: var(--warm-600); }
.life-priority--low { background: var(--blue-100); color: var(--blue-600); }
.life-assignee { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-100); color: var(--brand-700); font-size: .56rem; font-weight: 800; }
.life-column-empty { margin: 14px 8px; color: var(--ink-faint); font-size: .61rem; text-align: center; }

.life-note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 11px; }
.life-note { min-height: 205px; display: grid; grid-template-rows: auto auto 1fr auto; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #f3f7f3; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s ease; }
.life-note:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgb(20 34 28 / 8%); }
.life-note--sand { background: #faf4e9; }
.life-note--sky { background: #edf5fa; }
.life-note--lilac { background: #f4eff9; }
.life-note > header { min-height: 24px; display: flex; align-items: center; justify-content: space-between; color: var(--brand-600); }
.life-note > header button { margin-left: auto; border: 0; background: transparent; color: var(--ink-faint); letter-spacing: .08em; }
.life-note h3 { margin: 8px 0 7px; font-size: .86rem; }
.life-note > p { display: -webkit-box; overflow: hidden; color: var(--ink-soft); font-size: .68rem; white-space: pre-line; -webkit-box-orient: vertical; -webkit-line-clamp: 5; }
.life-note footer { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 12px; color: var(--ink-faint); font-size: .56rem; }
.life-note footer span { padding: 2px 5px; border-radius: 5px; background: rgb(255 255 255 / 58%); }
.life-note footer time { margin-left: auto; }

.life-people-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(320px, 1.1fr); gap: 13px; }
.life-people-panel, .life-message-draft { min-height: 510px; overflow: hidden; }
.life-person-list { display: grid; padding: 6px 10px 12px; }
.life-person { min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 8px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.life-person:hover { border-radius: 10px; background: var(--surface-soft); }
.life-person__avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: var(--brand-100); color: var(--brand-700); font-size: .72rem; font-weight: 780; }
.life-person > span:nth-child(2) { min-width: 0; display: grid; }
.life-person strong { overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.life-person small, .life-person__channel { color: var(--ink-faint); font-size: .59rem; }
.life-person__channel { max-width: 125px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.life-soft-badge { margin-left: auto; padding: 4px 7px; border-radius: 99px; background: var(--warm-100); color: var(--warm-600); font-size: .55rem; font-weight: 720; }
.life-message-draft > form { display: grid; gap: 12px; padding: 17px 18px; }
.life-message-draft > form .button { justify-self: start; }
.life-draft-preview { margin: 0 18px 18px; padding: 14px; border: 1px solid var(--brand-300); border-radius: 14px; background: var(--brand-100); }
.life-draft-preview[hidden] { display: none; }
.life-draft-preview > div { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: var(--brand-700); font-size: .61rem; }
.life-draft-preview textarea { width: 100%; padding: 10px; resize: vertical; border: 1px solid rgb(100 149 129 / 28%); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: .72rem; }
.life-draft-preview p { margin: 7px 0 10px; color: var(--brand-700); font-size: .59rem; }

.life-finance-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.life-metric { min-width: 0; display: grid; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow-sm); }
.life-metric > span { color: var(--ink-soft); font-size: .64rem; }
.life-metric strong { margin: 8px 0 3px; overflow: hidden; font-size: clamp(.9rem, 2vw, 1.25rem); text-overflow: ellipsis; white-space: nowrap; }
.life-metric small { color: var(--ink-faint); font-size: .56rem; }
.life-finance-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.life-finance-layout > .panel { min-width: 0; min-height: 250px; overflow: hidden; }
.life-finance-wide { grid-column: 1 / -1; }
.life-account-list, .life-obligation-list, .life-transaction-list, .life-family-list { display: grid; padding: 5px 16px 14px; }
.life-account-list > div, .life-obligation-list > div, .life-transaction-list > div { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.life-obligation-list > div { grid-template-columns: minmax(0, 1fr) auto; }
.life-account-list > div:last-child, .life-obligation-list > div:last-child, .life-transaction-list > div:last-child { border-bottom: 0; }
.life-account-list span:nth-child(2), .life-obligation-list span:first-child, .life-transaction-list span:nth-child(2) { min-width: 0; display: grid; }
.life-account-list strong, .life-obligation-list strong, .life-transaction-list strong { overflow: hidden; font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.life-account-list small, .life-obligation-list small, .life-transaction-list small { color: var(--ink-faint); font-size: .57rem; }
.life-account-icon, .life-transaction-kind { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-100); color: var(--brand-700); font-size: .63rem; font-weight: 800; }
.life-transaction-kind--expense { background: var(--warm-100); color: var(--warm-600); }
.life-finance-note { margin: 0 16px 14px; color: var(--ink-soft); font-size: .63rem; }

.life-family-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.life-family-layout > .panel { min-width: 0; min-height: 280px; overflow: hidden; }
.life-family-list > div { min-width: 0; display: grid; grid-template-columns: 9px minmax(0, 1fr); align-items: start; gap: 9px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.life-family-list > div:last-child { border-bottom: 0; }
.life-family-list > div > span:last-child { min-width: 0; display: grid; }
.life-family-list strong { overflow: hidden; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.life-family-list small { margin-top: 2px; color: var(--ink-faint); font-size: .58rem; }
.life-family-bullet { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--brand-500); box-shadow: 0 0 0 4px var(--brand-100); }

.life-loading { min-height: 180px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--ink-faint); }
.life-loading > span { width: 24px; height: 24px; border: 2px solid var(--line); border-top-color: var(--brand-600); border-radius: 50%; animation: life-spin .8s linear infinite; }
.life-loading p { margin: 0; font-size: .64rem; }
@keyframes life-spin { to { transform: rotate(360deg); } }
.life-empty { min-height: 180px; display: grid; place-items: center; align-content: center; padding: 24px; text-align: center; }
.life-empty > span { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 10px; border-radius: 13px; background: var(--brand-100); color: var(--brand-700); font-weight: 800; }
.life-empty h3 { margin-bottom: 5px; font-size: .78rem; }
.life-empty p { max-width: 340px; margin: 0; color: var(--ink-faint); font-size: .63rem; }
.life-empty button { margin-top: 12px; padding: 7px 10px; border: 0; border-radius: 8px; background: var(--brand-100); color: var(--brand-700); font-size: .63rem; font-weight: 720; }
.life-editor .dialog-note { margin-inline: 0; }

@media (max-width: 1019px) {
  .life-tabs { top: 72px; }
  .life-tony-layout { grid-template-columns: 1fr; }
  .life-context-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .life-chat { min-height: 620px; }
}

@media (min-width: 1020px) {
  .life-tabs { top: 18px; }
}

@media (max-width: 759px) {
  .life-os { gap: 17px; }
  .life-hero, .life-section-heading { display: grid; align-items: start; }
  .life-hero__actions, .life-section-actions { width: 100%; justify-content: space-between; }
  .life-tabs { margin-inline: -2px; grid-template-columns: repeat(6, 96px); justify-content: start; }
  .life-context-stack, .life-people-layout, .life-finance-layout, .life-family-layout { grid-template-columns: 1fr; }
  .life-finance-wide { grid-column: auto; }
  .life-finance-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .life-people-panel, .life-message-draft { min-height: 420px; }
}

@media (max-width: 519px) {
  .life-hero h1 { font-size: 1.7rem; }
  .life-hero__actions { align-items: stretch; flex-direction: column; }
  .life-workspace-picker select, .life-hero__actions .button { width: 100%; }
  .life-chat { min-height: calc(100svh - 245px); }
  .life-panel-heading { padding-inline: 13px; }
  .life-live-status { font-size: 0; }
  .life-live-status i { display: block; }
  .life-chat__stream { padding: 14px; }
  .life-message { max-width: 91%; }
  .life-chat__controls > span { display: none; }
  .life-chat__controls .button { width: 100%; }
  .life-filterbar { align-items: stretch; flex-wrap: nowrap; }
  .life-search { min-width: 220px; }
  .life-note-grid { grid-template-columns: 1fr; }
  .life-finance-metrics { grid-template-columns: 1fr; }
  .life-person { grid-template-columns: 38px minmax(0, 1fr); }
  .life-person__channel { display: none; }
  .life-section-actions { align-items: stretch; flex-direction: column; }
  .life-section-actions .button, .life-section-actions .life-select select { width: 100%; }
}

/* Telegram Mini App */
.telegram-mini-app {
  --tony-mini-safe-top: env(safe-area-inset-top, 0px);
  --tony-mini-safe-right: env(safe-area-inset-right, 0px);
  --tony-mini-safe-bottom: env(safe-area-inset-bottom, 0px);
  --tony-mini-safe-left: env(safe-area-inset-left, 0px);
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

body.is-telegram-mini-app,
body.mini-bootstrap-page {
  --ink: var(--tg-theme-text-color, #15201c);
  --ink-soft: var(--tg-theme-subtitle-text-color, var(--tg-theme-hint-color, #53615b));
  --ink-faint: var(--tg-theme-hint-color, #7d8984);
  --canvas: var(--tg-theme-bg-color, #f3f4f0);
  --surface: var(--tg-theme-section-bg-color, var(--tg-theme-secondary-bg-color, #ffffff));
  --surface-soft: var(--tg-theme-secondary-bg-color, #f7f8f5);
  --brand-900: var(--tg-theme-button-color, #16231f);
  --brand-800: var(--tg-theme-button-color, #20352d);
  --brand-700: var(--tg-theme-accent-text-color, var(--tg-theme-link-color, #365b4e));
  --brand-600: var(--tg-theme-accent-text-color, var(--tg-theme-link-color, #4f7d6c));
  --line: rgb(127 127 127 / 18%);
  min-height: var(--tony-mini-viewport-height, 100svh);
  background: var(--canvas);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

body.is-telegram-mini-app {
  background:
    radial-gradient(circle at 92% 4%, color-mix(in srgb, var(--brand-700) 10%, transparent), transparent 22rem),
    var(--canvas);
}

.app-shell--mini { min-height: var(--tony-mini-viewport-height, 100svh); }
.app-shell--mini .app-column { width: 100%; }

.mini-header {
  position: sticky;
  z-index: 48;
  top: 0;
  min-height: calc(60px + var(--tony-mini-safe-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(8px + var(--tony-mini-safe-top)) calc(14px + var(--tony-mini-safe-right)) 8px calc(14px + var(--tony-mini-safe-left));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
}
.mini-header__brand { min-width: 0; display: flex; align-items: center; gap: 10px; }
.mini-header__brand > img { flex: 0 0 auto; border-radius: 12px; box-shadow: 0 5px 16px rgb(10 24 18 / 14%); }
.mini-header__brand > div { min-width: 0; display: grid; }
.mini-header__brand strong { font-size: .98rem; line-height: 1.15; }
.mini-header__brand > div > span { display: flex; align-items: center; gap: 5px; color: var(--ink-faint); font-size: .64rem; }
.mini-header__brand i { width: 6px; height: 6px; border-radius: 50%; background: #55b47b; box-shadow: 0 0 0 3px rgb(85 180 123 / 13%); }
.mini-header__profile { min-width: 0; display: flex; align-items: center; gap: 8px; }
.mini-header__profile > span { max-width: 120px; overflow: hidden; color: var(--ink-soft); font-size: .68rem; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.mini-header__close { width: 38px; height: 38px; display: grid; flex: 0 0 auto; place-items: center; border: 0; border-radius: 12px; background: var(--surface-soft); color: var(--ink-soft); font-size: 1.35rem; line-height: 1; }

.main-content--mini {
  width: 100%;
  max-width: 1120px;
  padding: 14px calc(12px + var(--tony-mini-safe-right)) calc(94px + var(--tony-mini-safe-bottom)) calc(12px + var(--tony-mini-safe-left));
}

.is-telegram-mini-app .life-os { gap: 14px; }
.is-telegram-mini-app .life-hero { align-items: center; gap: 12px; padding: 0 2px; }
.is-telegram-mini-app .life-hero .eyebrow { display: none; }
.is-telegram-mini-app .life-hero h1 { margin: 0; font-size: clamp(1.24rem, 5.5vw, 1.68rem); line-height: 1.14; letter-spacing: -.035em; }
.is-telegram-mini-app .life-hero > div:first-child > p:last-child { display: none; }
.is-telegram-mini-app .life-hero__actions { align-items: center; }
.is-telegram-mini-app .life-workspace-picker { gap: 2px; }
.is-telegram-mini-app .life-workspace-picker span { font-size: .54rem; }
.is-telegram-mini-app .life-workspace-picker select { max-width: 142px; min-height: 39px; padding-block: 7px; }
.is-telegram-mini-app [data-life-refresh] { width: 39px; min-height: 39px; padding: 0; font-size: 0; }
.is-telegram-mini-app [data-life-refresh] svg { width: 18px; height: 18px; }
.is-telegram-mini-app .life-tabs { display: none; }
.is-telegram-mini-app .life-pane { animation-duration: .17s; }
.is-telegram-mini-app .life-section-heading { align-items: start; margin-bottom: 10px; }
.is-telegram-mini-app .life-section-heading h2 { font-size: 1.18rem; }
.is-telegram-mini-app .life-section-heading > div > p:last-child { display: none; }
.is-telegram-mini-app .life-chat { min-height: calc(var(--tony-mini-viewport-height, 100svh) - 196px); border-radius: 18px; }
.is-telegram-mini-app .life-chat__stream { min-height: 280px; padding: 15px; }
.is-telegram-mini-app .life-message { max-width: 92%; padding: 10px 12px; }
.is-telegram-mini-app .life-message p { font-size: .84rem; }
.is-telegram-mini-app .life-chat__composer { padding: 11px; }
.is-telegram-mini-app .life-chat__composer textarea { min-height: 62px; font-size: 1rem; }
.is-telegram-mini-app .life-context-grid span,
.is-telegram-mini-app .life-suggestions button,
.is-telegram-mini-app .life-account-list strong,
.is-telegram-mini-app .life-obligation-list strong,
.is-telegram-mini-app .life-transaction-list strong,
.is-telegram-mini-app .life-family-list strong { font-size: .76rem; }
.is-telegram-mini-app .life-kanban { grid-auto-columns: minmax(280px, calc(100vw - 36px)); }
.is-telegram-mini-app .life-kanban-column { background: var(--surface-soft); }
.is-telegram-mini-app .life-task-card,
.is-telegram-mini-app .life-note,
.is-telegram-mini-app .life-filterbar,
.is-telegram-mini-app .panel { border-color: var(--line); background-color: var(--surface); }
.is-telegram-mini-app .life-note { min-height: 170px; }
.is-telegram-mini-app .life-people-panel,
.is-telegram-mini-app .life-message-draft { min-height: 390px; }

.mini-bottom-nav {
  position: fixed;
  z-index: 58;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: calc(66px + var(--tony-mini-safe-bottom));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  padding: 6px calc(6px + var(--tony-mini-safe-right)) calc(6px + var(--tony-mini-safe-bottom)) calc(6px + var(--tony-mini-safe-left));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 93%, transparent);
  box-shadow: 0 -10px 30px rgb(17 31 25 / 8%);
  backdrop-filter: blur(20px) saturate(1.2);
}
.mini-bottom-nav button {
  min-width: 0;
  min-height: 52px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 4px 2px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-faint);
  font-size: .6rem;
  font-weight: 690;
}
.mini-bottom-nav button svg { width: 21px; height: 21px; }
.mini-bottom-nav button.is-active { background: color-mix(in srgb, var(--brand-900) 10%, transparent); color: var(--brand-700); }

.mini-more-menu {
  position: fixed;
  inset: auto 0 0;
  width: 100%;
  max-width: none;
  max-height: min(76vh, 520px);
  margin: 0;
  padding: 8px calc(16px + var(--tony-mini-safe-right)) calc(16px + var(--tony-mini-safe-bottom)) calc(16px + var(--tony-mini-safe-left));
  border: 0;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 -24px 70px rgb(10 20 16 / 22%);
}
.mini-more-menu::backdrop { background: rgb(8 15 12 / 46%); backdrop-filter: blur(3px); }
.mini-more-menu__handle { width: 38px; height: 4px; margin: 0 auto 12px; border-radius: 99px; background: var(--line); }
.mini-more-menu > header { display: flex; align-items: start; justify-content: space-between; padding: 2px 0 13px; }
.mini-more-menu > header p { margin-bottom: 2px; font-size: .6rem; }
.mini-more-menu > header h2 { margin: 0; font-size: 1.12rem; }
.mini-more-menu > header > button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 12px; background: var(--surface-soft); color: var(--ink-soft); font-size: 1.35rem; }
.mini-more-menu__items { display: grid; gap: 8px; }
.mini-more-menu__items > button { min-height: 66px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); color: var(--ink); text-align: left; }
.mini-more-menu__items > button > span:first-child { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--brand-900) 10%, transparent); color: var(--brand-700); font-weight: 800; }
.mini-more-menu__items > button > span:nth-child(2) { min-width: 0; display: grid; }
.mini-more-menu__items strong { font-size: .83rem; }
.mini-more-menu__items small { color: var(--ink-faint); font-size: .65rem; }
.mini-more-menu__items b { color: var(--ink-faint); font-size: 1.4rem; font-weight: 400; }
.mini-more-menu__dismiss { width: 100%; margin-top: 12px; }

.mini-bootstrap-page {
  display: grid;
  min-height: var(--tony-mini-viewport-height, 100svh);
  overflow: hidden;
  place-items: center;
  padding: calc(18px + var(--tony-mini-safe-top)) calc(16px + var(--tony-mini-safe-right)) calc(18px + var(--tony-mini-safe-bottom)) calc(16px + var(--tony-mini-safe-left));
  background:
    radial-gradient(circle at 12% 10%, rgb(119 188 157 / 22%), transparent 18rem),
    radial-gradient(circle at 88% 90%, rgb(92 134 116 / 18%), transparent 20rem),
    var(--tg-theme-bg-color, var(--brand-950));
}
.mini-bootstrap { width: min(100%, 430px); }
.mini-bootstrap__card {
  position: relative;
  min-height: min(580px, calc(var(--tony-mini-viewport-height, 100svh) - 36px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  padding: 24px 20px 18px;
  border: 1px solid rgb(127 127 127 / 18%);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgb(4 16 11 / 22%);
}
.mini-bootstrap__glow { position: absolute; top: -150px; right: -130px; width: 330px; height: 330px; border-radius: 50%; background: color-mix(in srgb, var(--brand-700) 18%, transparent); filter: blur(8px); pointer-events: none; }
.mini-bootstrap__brand { position: relative; display: flex; align-items: center; gap: 13px; }
.mini-bootstrap__brand > span { width: 58px; height: 58px; display: grid; place-items: center; overflow: hidden; border-radius: 18px; background: var(--brand-900); box-shadow: 0 10px 28px rgb(11 30 21 / 20%); }
.mini-bootstrap__brand img { width: 52px; height: 52px; border-radius: 14px; }
.mini-bootstrap__brand p { margin: 0; font-size: .76rem; font-weight: 790; letter-spacing: .12em; text-transform: uppercase; }
.mini-bootstrap__state { position: relative; display: grid; place-items: center; align-content: center; padding: 28px 4px; text-align: center; }
.mini-bootstrap__state[hidden] { display: none; }
.mini-bootstrap__state h1 { margin: 22px 0 8px; font-size: clamp(1.55rem, 7vw, 2rem); line-height: 1.1; letter-spacing: -.045em; }
.mini-bootstrap__state p { max-width: 330px; margin: 0 0 20px; color: var(--ink-soft); font-size: .82rem; }
.mini-bootstrap__state .button { width: min(100%, 270px); margin-top: 8px; }
.mini-bootstrap__state .button[hidden] { display: none; }
.mini-bootstrap__loader { width: 76px; height: 76px; display: flex; align-items: center; justify-content: center; gap: 5px; border-radius: 24px; background: color-mix(in srgb, var(--brand-900) 10%, var(--surface)); }
.mini-bootstrap__loader i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-700); animation: mini-loader 1.15s ease-in-out infinite; }
.mini-bootstrap__loader i:nth-child(2) { animation-delay: .14s; }
.mini-bootstrap__loader i:nth-child(3) { animation-delay: .28s; }
.mini-bootstrap__state-icon { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 23px; background: color-mix(in srgb, var(--brand-900) 10%, var(--surface)); color: var(--brand-700); font-size: 1.8rem; font-weight: 760; }
.mini-bootstrap__state-icon--error { background: var(--danger-100); color: var(--danger-600); }
.mini-bootstrap__card footer { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--ink-faint); font-size: .62rem; text-align: center; }
.mini-bootstrap__card footer span { width: 7px; height: 7px; border-radius: 50%; background: #55b47b; }
@keyframes mini-loader { 0%, 70%, 100% { opacity: .3; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-6px); } }

[data-telegram-theme="dark"] body.is-telegram-mini-app .life-chat__stream,
[data-telegram-theme="dark"] body.is-telegram-mini-app .life-note,
[data-telegram-theme="dark"] body.is-telegram-mini-app .life-kanban-column { background-image: none; }
[data-telegram-theme="dark"] body.is-telegram-mini-app .button--primary,
[data-telegram-theme="dark"] body.mini-bootstrap-page .button--primary { color: var(--tg-theme-button-text-color, #fff); }

@media (max-width: 759px) {
  .is-telegram-mini-app .life-hero { display: flex; }
  .is-telegram-mini-app .life-hero__actions { width: auto; flex-direction: row; }
  .is-telegram-mini-app .life-context-stack { grid-template-columns: 1fr; }
  .is-telegram-mini-app .life-context-stack .life-suggestions { display: none; }
  .is-telegram-mini-app .life-finance-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .is-telegram-mini-app .life-section-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .is-telegram-mini-app .life-section-actions > :first-child:last-child { grid-column: 1 / -1; }
  .is-telegram-mini-app .life-section-actions .button,
  .is-telegram-mini-app .life-section-actions .life-select select { width: 100%; }
}

@media (max-width: 399px) {
  .mini-header__profile > span { display: none; }
  .main-content--mini { padding-inline: calc(9px + var(--tony-mini-safe-left)) calc(9px + var(--tony-mini-safe-right)); }
  .is-telegram-mini-app .life-hero h1 { max-width: 180px; font-size: 1.08rem; }
  .is-telegram-mini-app .life-workspace-picker select { max-width: 116px; }
  .mini-bottom-nav button { font-size: .55rem; }
  .mini-bootstrap__card { min-height: calc(var(--tony-mini-viewport-height, 100svh) - 24px); padding-inline: 17px; }
}

@media (min-width: 760px) {
  .main-content--mini { padding: 20px calc(22px + var(--tony-mini-safe-right)) calc(98px + var(--tony-mini-safe-bottom)) calc(22px + var(--tony-mini-safe-left)); }
  .mini-bottom-nav { right: 50%; left: auto; width: min(620px, 100%); transform: translateX(50%); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; }
}
