:root {
  --bg: #F8F9FC;
  --card: #FFFFFF;
  --text: #111827;
  --muted: #6B7280;
  --line: #E5E7EB;
  --primary: #4F6BFF;
  --primary-soft: #EEF1FF;
  --success: #10B981;
  --success-soft: #E8F8F2;
  --warning: #F59E0B;
  --warning-soft: #FFF5E6;
  --danger: #EF4444;
  --danger-soft: #FEECEC;
  --blue-soft: #EEF6FF;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
  --radius-card: 24px;
  --radius-button: 16px;
  --pad: 22px;
  --gap: 16px;
  --tabbar-h: 76px;
}

@font-face {
  font-family: "LG Smart";
  src: url("/static/fonts/LGSmHaL_v1.4_151215.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "LG Smart";
  src: url("/static/fonts/LGSmHaR_v1.4_151215.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "LG Smart";
  src: url("/static/fonts/LGSmHaSB_v1.4_151215.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "LG Smart";
  src: url("/static/fonts/LGSmHaB_v1.4_151215.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #EDEFF5;
  color: var(--text);
  font-family: "LG Smart", -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: break-word;
}

button,
input {
  font: inherit;
}

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

.phone {
  position: relative;
  width: min(100vw, 393px);
  height: min(100dvh, 852px);
  min-height: min(100dvh, 720px);
  aspect-ratio: 393 / 852;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 24px 80px rgba(17, 24, 39, 0.14);
}

.topbar {
  height: 56px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 20px 0;
}

.phone.chat-active .topbar,
.phone.ai-active .topbar,
.phone.calendar-active .topbar {
  grid-template-columns: 1fr auto;
  height: 76px;
  align-items: end;
  padding: 18px 22px 8px;
}

.phone.chat-active .topbar [data-action="back"],
.phone.ai-active .topbar [data-action="back"],
.phone.calendar-active .topbar [data-action="back"] {
  display: none;
}

.top-title {
  font-size: 17px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone.chat-active .top-title,
.phone.ai-active .top-title,
.phone.calendar-active .top-title {
  justify-self: start;
  font-size: 30px;
  font-weight: 800;
}

.phone.calendar-active .top-title {
  display: flex;
  gap: 6px;
  align-items: center;
}

.title-picker {
  border: 0;
  border-radius: 12px;
  padding: 0 3px;
  background: transparent;
  color: var(--text);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  box-shadow: 0 4px 18px rgba(17, 24, 39, 0.04);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.1;
}

.screen {
  height: calc(100% - 56px);
  overflow: auto;
  padding: 4px 20px calc(var(--tabbar-h) + 96px);
  scroll-behavior: smooth;
  transition: transform 360ms ease, padding-bottom 360ms ease;
}

.phone.keyboard-open .screen {
  transform: translateY(-168px);
  padding-bottom: calc(var(--tabbar-h) + 270px);
}

.phone.ai-active .screen {
  padding-bottom: calc(var(--tabbar-h) + 90px);
}

.phone.chat-active .screen,
.phone.ai-active .screen,
.phone.calendar-active .screen {
  height: calc(100% - 76px);
  padding-top: 8px;
}

.screen:focus {
  outline: 0;
}

.screen::-webkit-scrollbar {
  display: none;
}

.hero {
  padding: 8px 2px 2px;
}

.hero.ai-hero {
  padding-top: 6px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.18;
  font-weight: 760;
}

h2 {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 760;
}

h3 {
  font-size: 16px;
  line-height: 1.25;
  font-weight: 720;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 2px 10px;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
}

.card {
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: var(--pad);
  margin-top: var(--gap);
}

.card.compact {
  padding: 18px;
}

.card[data-screen],
.list-row[data-screen] {
  cursor: pointer;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.grid-2 .card {
  margin-top: 0;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.stack {
  display: grid;
  gap: 12px;
}

.label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.caption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.big-number {
  margin-top: 6px;
  font-size: 28px;
  font-weight: 780;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.mid-number {
  font-size: 22px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.positive {
  color: var(--success);
}

.negative {
  color: var(--danger);
}

.primary {
  color: var(--primary);
}

.muted {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.pill.success {
  background: var(--success-soft);
  color: var(--success);
}

.pill.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #F0F2F7;
  margin-top: 10px;
}

.segmented button {
  border: 0;
  border-radius: 999px;
  padding: 9px 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.segmented button.active {
  color: var(--text);
  background: var(--card);
  box-shadow: 0 3px 12px rgba(17, 24, 39, 0.05);
}

.segmented.segmented-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.segmented.elevated {
  gap: 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  margin-top: 12px;
}

.segmented.elevated button {
  min-height: 40px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.70);
  color: var(--muted);
  box-shadow:
    inset 0 0 0 1px rgba(107, 114, 128, 0.14),
    0 8px 20px rgba(17, 24, 39, 0.045);
  opacity: 0.46;
  transition: opacity 160ms ease, color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.segmented.elevated button.active {
  background: #fff;
  color: var(--text);
  opacity: 1;
  box-shadow:
    inset 0 0 0 1px rgba(107, 114, 128, 0.22),
    0 12px 30px rgba(17, 24, 39, 0.10),
    0 3px 10px rgba(17, 24, 39, 0.05);
}

.progress {
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: var(--value, 50%);
  border-radius: inherit;
  background: var(--primary);
}

.progress.success span {
  background: var(--success);
}

.mini-chart,
.line-chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: rgba(79, 107, 255, 0.08);
}

.chart-grid {
  stroke: #EDF0F5;
  stroke-width: 1;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: center;
}

.donut {
  width: 96px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: conic-gradient(var(--primary) 0 36%, var(--success) 36% 56%, var(--warning) 56% 72%, var(--danger) 72% 84%, #A78BFA 84% 100%);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: inherit;
  background: var(--card);
}

.invest-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 14px;
  align-items: center;
}

.summary-donut {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.summary-donut .donut {
  width: 86px;
}

.summary-donut .donut::after {
  inset: 23px;
}

.summary-donut p {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.soft-select {
  max-width: 126px;
  border: 0;
  border-radius: 14px;
  padding: 8px 28px 8px 10px;
  background: #fff;
  color: var(--text);
  box-shadow:
    inset 0 0 0 1px rgba(107, 114, 128, 0.16),
    0 8px 20px rgba(17, 24, 39, 0.055);
  font-size: 12px;
  font-weight: 800;
  outline: 0;
}

.legend {
  display: grid;
  gap: 8px;
  font-size: 12px;
}

.legend-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 8px;
  align-items: center;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
}

.dot.success {
  background: var(--success);
}

.dot.warning {
  background: var(--warning);
}

.dot.danger {
  background: var(--danger);
}

.dot.purple {
  background: #A78BFA;
}

.list {
  display: grid;
  gap: 4px;
}

.list-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.list-row + .list-row {
  border-top: 1px solid var(--line);
}

.avatar,
.symbol {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.symbol.success {
  background: var(--success-soft);
  color: var(--success);
}

.symbol.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.symbol.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.symbol svg {
  width: 18px;
  height: 18px;
}

.ai-card {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 13px;
  align-items: start;
}

.bot {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
}

.bot svg {
  width: 21px;
  height: 21px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.quick-actions button,
.primary-button,
.ghost-button {
  border: 0;
  border-radius: var(--radius-button);
  min-height: 48px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 760;
}

.quick-actions button {
  background: var(--primary-soft);
  color: var(--primary);
}

.chat-thread {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.share-thread {
  min-height: 520px;
  align-content: start;
  margin-top: 18px;
}

.ai-thread {
  min-height: 390px;
  align-content: start;
  margin: 8px -12px 0;
  padding: 24px 12px 22px;
  background: rgba(255, 255, 255, 0.32);
  box-shadow: inset 6px 0 0 rgba(255, 255, 255, 0.76);
}

.day-divider {
  justify-self: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #EEF1F6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.bubble {
  max-width: 82%;
  padding: 13px 15px 9px;
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.bubble p {
  font-size: 15px;
  line-height: 1.45;
}

.bubble span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.bubble.me {
  justify-self: end;
  border-bottom-right-radius: 8px;
  background: #F0F2F7;
  color: var(--text);
}

.bubble.me span {
  color: var(--muted);
}

.bubble.wife {
  justify-self: start;
  border-bottom-left-radius: 8px;
  background: var(--card);
}

.bubble.ai-bubble {
  justify-self: start;
  border-bottom-left-radius: 8px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px rgba(79, 107, 255, 0.10), var(--shadow);
}

.ai-thread .bubble {
  max-width: 86%;
  box-shadow: none;
}

.ai-thread .bubble.me {
  background: var(--primary);
  color: #fff;
}

.ai-thread .bubble.me span {
  color: rgba(255, 255, 255, 0.78);
}

.ai-thread .bubble.ai-bubble {
  background: #FFF0E7;
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.34);
}

.ai-thread .bubble.ai-bubble span {
  color: #F97316;
}

.composer-bar {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: calc(var(--tabbar-h) + 12px);
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  padding: 8px 0;
  background: var(--bg);
  z-index: 10;
  transition: transform 360ms ease;
}

.composer-wrap {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: calc(var(--tabbar-h) + 12px);
  z-index: 12;
}

.composer-wrap .composer-bar {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  margin-top: 0;
}

.composer-bar.ai-command {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: calc(var(--tabbar-h) + 8px);
  margin-top: 0;
  z-index: 45;
}

.phone.keyboard-open .composer-bar.ai-command {
  transform: translateY(-188px);
}

.composer-bar button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--card);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.composer-bar input {
  min-width: 0;
  height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  outline: 0;
}

.attach-popover {
  position: absolute;
  left: 0;
  bottom: 58px;
  display: grid;
  gap: 8px;
  width: 132px;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.attach-open .attach-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.attach-popover button {
  min-height: 42px;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: center;
  border: 0;
  border-radius: 16px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 700;
}

.ai-command-tools {
  display: grid;
  grid-template-columns: 46px 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}

.tool-button {
  position: relative;
  min-height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  box-shadow:
    inset 0 0 0 1px rgba(17, 24, 39, 0.045),
    0 10px 24px rgba(17, 24, 39, 0.075),
    0 2px 7px rgba(17, 24, 39, 0.035);
  font-size: 13px;
  font-weight: 760;
}

.tool-button svg {
  width: 19px;
  height: 19px;
  color: var(--primary);
}

.tool-button.has-pending::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 3px #E8F8F2;
}

.primary-button {
  width: 100%;
  background: var(--primary);
  color: #fff;
}

.ghost-button {
  background: #F2F4F8;
  color: var(--text);
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 9px;
  text-align: center;
  font-size: 12px;
}

.month-grid span {
  min-height: 28px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.month-grid strong {
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--text);
}

.month-grid .today {
  background: var(--primary);
  color: #fff;
}

.calendar-card {
  margin-left: -16px;
  margin-right: -16px;
  padding: 16px 5px 14px;
}

.calendar-switcher {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 10px;
  align-items: center;
  margin: 4px 0 10px;
}

.calendar-switcher button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  box-shadow:
    inset 0 0 0 1px rgba(107, 114, 128, 0.16),
    0 10px 26px rgba(17, 24, 39, 0.075),
    0 2px 8px rgba(17, 24, 39, 0.04);
  font-weight: 800;
}

.calendar-switcher button:first-child,
.calendar-switcher button:last-child {
  display: grid;
  place-items: center;
}

.calendar-month {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.calendar-weekday {
  min-height: 30px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(180deg, #F3F5F9 0%, #ECEFF5 100%);
  color: #5B6472;
  font-size: 13.2px;
  font-weight: 700;
}

.calendar-cell {
  min-width: 0;
  min-height: 98px;
  display: grid;
  grid-template-rows: 18px 1fr;
  align-items: start;
  gap: 3px;
  border: 0;
  border-radius: 14px;
  padding: 6px 1px 5px;
  background: rgba(248, 249, 252, 0.88);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.035);
}

.calendar-cell.sunday,
.calendar-cell.saturday {
  background: #FFF7ED;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.10);
}

.calendar-cell.empty {
  background: transparent;
  box-shadow: none;
}

.calendar-month > .calendar-weekday:not(:nth-child(7n + 1)),
.calendar-month > .calendar-cell:not(:nth-child(7n + 1)) {
  border-left: 1px dashed rgba(107, 114, 128, 0.26);
}

.calendar-date-row {
  justify-self: start;
  min-width: 0;
  max-width: 100%;
  height: 18px;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
}

.calendar-date {
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.calendar-holiday-name {
  min-width: 0;
  overflow: hidden;
  color: var(--danger);
  font-size: 7.4px;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-cell.today .calendar-date {
  background: var(--primary);
  color: #fff;
}

.calendar-cell.holiday .calendar-date {
  color: var(--danger);
}

.calendar-cell.today.holiday .calendar-date {
  color: #fff;
}

.calendar-events {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 2px;
  align-content: start;
}

.calendar-event {
  min-width: 0;
  height: 13px;
  display: block;
  overflow: hidden;
  border-radius: 6px;
  padding: 1px 0 0;
  background: #EEF1FF;
  color: var(--primary);
  font-size: 7.3px;
  font-weight: 800;
  line-height: 12px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-more {
  height: 13px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.timeline {
  display: grid;
  gap: 12px;
}

.time-row {
  display: grid;
  grid-template-columns: 48px 4px 1fr;
  gap: 12px;
  align-items: stretch;
}

.time-line {
  border-radius: 999px;
  background: var(--primary);
}

.time-line.warning {
  background: var(--warning);
}

.check-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 42px;
}

.check {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  display: grid;
  place-items: center;
}

.check.empty {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px #D6DAE4;
}

.check svg {
  width: 14px;
  height: 14px;
}

.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--tabbar-h);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: start;
  padding: 9px 12px 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 -1px 0 rgba(229, 231, 235, 0.85);
  z-index: 20;
  transition: transform 360ms ease;
}

.tabbar button {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  gap: 4px;
  justify-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 0 0;
}

.tabbar button.active {
  color: var(--primary);
}

.tabbar svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.1;
}

.tabbar button[data-tab="more"] {
  align-content: center;
  padding-top: 8px;
}

.tabbar button[data-tab="more"] svg {
  width: 24px;
  height: 24px;
  transform: translateY(4px);
}

.fab {
  position: absolute;
  right: 22px;
  bottom: calc(var(--tabbar-h) + 18px);
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 28px rgba(79, 107, 255, 0.34);
  z-index: 25;
  transition: transform 360ms ease;
}

.phone.ai-active .fab,
.phone.chat-active .fab {
  display: none !important;
}

.fab svg {
  width: 24px;
  height: 24px;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: rgba(17, 24, 39, 0.18);
  backdrop-filter: blur(10px);
  transition: opacity 160ms ease;
  z-index: 30;
}

.action-sheet {
  position: absolute;
  right: 20px;
  bottom: calc(var(--tabbar-h) + 86px);
  width: 235px;
  display: grid;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 31;
}

.action-sheet button {
  min-height: 48px;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: center;
  text-align: left;
  border: 0;
  border-radius: 18px;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 700;
}

.action-sheet svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.sheet-open .sheet-backdrop,
.sheet-open .action-sheet {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: rgba(17, 24, 39, 0.16);
  transition: opacity 420ms ease;
  z-index: 50;
}

.side-drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 82%;
  max-width: 324px;
  padding: 22px 18px calc(var(--tabbar-h) + 22px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 18px 0 46px rgba(17, 24, 39, 0.12);
  transform: translateX(-105%);
  transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 51;
}

.side-drawer::-webkit-scrollbar {
  display: none;
}

.drawer-open .drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.drawer-open .side-drawer {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.drawer-head h2 {
  font-size: 22px;
}

.drawer-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #F2F4F8;
  color: var(--text);
}

.drawer-section {
  margin-top: 18px;
}

.drawer-section h3 {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.drawer-row {
  min-height: 46px;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.drawer-row:first-of-type {
  border-top: 0;
}

.drawer-row svg {
  width: 17px;
  height: 17px;
  color: var(--primary);
}

.tree {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  font-family: "LG Smart", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 13px;
}

.tree div {
  min-height: 25px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
}

.tree .depth-1 {
  padding-left: 18px;
}

.tree .depth-2 {
  padding-left: 36px;
  color: var(--muted);
}

.calendar-backdrop {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: rgba(17, 24, 39, 0.18);
  backdrop-filter: blur(8px);
  transition: opacity 180ms ease;
  z-index: 60;
}

.calendar-modal {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 50%;
  height: 80%;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  padding: 22px 18px;
  overflow: hidden;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 80px rgba(17, 24, 39, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(-50% + 18px)) scale(0.985);
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 61;
}

.calendar-modal-open .calendar-backdrop,
.calendar-modal-open .calendar-modal {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.modal-head h2 {
  font-size: 28px;
  line-height: 1.15;
}

.modal-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #F2F4F8;
  color: var(--text);
}

.modal-event-list {
  display: grid;
  gap: 10px;
  align-content: start;
  overflow: auto;
  padding-bottom: 8px;
}

.modal-event-list::-webkit-scrollbar,
.picker-wheel::-webkit-scrollbar {
  display: none;
}

.modal-event-row {
  min-height: 64px;
  display: grid;
  grid-template-columns: 8px 1fr 18px;
  gap: 12px;
  align-items: center;
  border: 0;
  border-radius: 18px;
  padding: 12px 14px;
  background: #F8F9FC;
  color: var(--text);
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.04);
}

.modal-event-row strong {
  display: block;
  font-size: 16px;
}

.modal-event-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.event-dot {
  width: 6px;
  height: 40px;
  border-radius: 999px;
  background: var(--primary);
}

.event-dot.warning {
  background: var(--warning);
}

.modal-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: var(--muted);
  font-weight: 700;
}

.picker-wheel {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding: 8px 0 28px;
  scroll-snap-type: y mandatory;
}

.picker-wheel button {
  min-height: 54px;
  border: 0;
  border-radius: 18px;
  background: #F8F9FC;
  color: var(--muted);
  font-size: 19px;
  font-weight: 800;
  scroll-snap-align: center;
}

.picker-wheel button.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 28px rgba(79, 107, 255, 0.22);
}

.keyboard {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 206px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px 12px 18px;
  background: rgba(238, 241, 246, 0.98);
  border-top: 1px solid #D7DCE6;
  transform: translateY(105%);
  transition: transform 360ms ease;
  z-index: 44;
}

.phone.keyboard-open .keyboard {
  transform: translateY(0);
}

.phone.keyboard-open .tabbar,
.phone.keyboard-open .fab {
  transform: translateY(120%);
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.keyboard-row span {
  width: 30px;
  height: 36px;
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 1px 1px rgba(17, 24, 39, 0.16);
}

.keyboard-row.mid {
  padding-left: 16px;
}

.keyboard-row .wide {
  width: 44px;
  background: #DDE2EB;
}

.keyboard-row .space {
  width: 190px;
}

.keyboard-row .send-key {
  width: 72px;
  background: #DDE2EB;
}

.search-box {
  height: 52px;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: center;
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 0 16px;
}

.search-box input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  min-width: 0;
}

.settings-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border-top: 1px solid var(--line);
}

.settings-row:first-child {
  border-top: 0;
}

.more-list {
  display: grid;
  gap: 6px;
}

.more-item {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px 1fr 18px;
  gap: 12px;
  align-items: center;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 0;
}

.more-item:first-child {
  border-top: 0;
}

.more-item strong {
  display: block;
  font-size: 15px;
}

.more-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.more-item > svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

@media (max-width: 430px) {
  body {
    display: block;
    background: var(--bg);
  }

  .phone {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    box-shadow: none;
  }
}

/* Inline add-composer (todo / shopping): input [+ select] + button on one row. */
.composer-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}

.composer-inline input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-button);
  min-height: 44px;
  padding: 10px 14px;
  font: inherit;
  background: var(--card);
  color: var(--text);
}

.composer-inline select {
  border: 1px solid var(--line);
  border-radius: var(--radius-button);
  min-height: 44px;
  padding: 0 8px;
  font: inherit;
  background: var(--card);
  color: var(--text);
}

.composer-inline .primary-button {
  width: auto;
  min-height: 44px;
  padding: 10px 18px;
  white-space: nowrap;
}

/* Trailing controls of a check-row (priority label + delete), fits the grid's
   auto column without breaking the 24px / 1fr / auto layout. */
.row-tail {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.row-action {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.row-action svg {
  width: 16px;
  height: 16px;
}

.check[role="button"] {
  cursor: pointer;
}
