:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f5f7fa;
  --surface-muted: #eef2f6;
  --text: #181512;
  --muted: #7a6f64;
  --line: rgba(24, 21, 18, 0.08);
  --accent: #ee6c00;
  --accent-deep: #b74f00;
  --accent-soft: #ffe3cf;
  --income: #2477d5;
  --expense: #d94a36;
  --dark: #22201d;
  --shadow: 0 28px 80px rgba(72, 47, 24, 0.09);
  --shadow-soft: 0 14px 30px rgba(72, 47, 24, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(238, 108, 0, 0.05), transparent 20%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.eyebrow,
.mini-label {
  margin: 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
}

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

.mini-label {
  color: var(--accent);
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: stretch;
  padding: 0;
  background: #ffffff;
}

.auth-card,
.panel,
.balance-panel,
.side-activity-panel,
.ai-highlight-panel,
.user-chip,
.storage-panel,
.month-chip {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.auth-card {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
  align-items: stretch;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.auth-showcase {
  order: 1;
  grid-column: 1;
  min-height: 100vh;
  padding: 64px 72px 48px;
  color: white;
  background:
    linear-gradient(180deg, rgba(11, 28, 41, 0.68), rgba(11, 22, 31, 0.84)),
    linear-gradient(140deg, rgba(198, 125, 47, 0.18), rgba(0, 0, 0, 0) 36%),
    linear-gradient(140deg, #27435b 0%, #1e3447 34%, #765338 72%, #101922 100%);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-showcase::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(145deg, transparent 0%, transparent 42%, rgba(227, 136, 47, 0.16) 42%, rgba(227, 136, 47, 0.08) 68%, transparent 68%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.24));
}

.auth-showcase-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  max-width: 560px;
  width: 100%;
}

.auth-brand-row {
  display: flex;
  align-items: center;
}

.auth-brand-logo {
  width: auto;
  height: 54px;
  object-fit: contain;
}

.auth-hero-copy {
  max-width: 440px;
}

.auth-accent-line {
  display: inline-block;
  width: 38px;
  height: 4px;
  margin-bottom: 28px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff8b2c, #ff6500);
}

.auth-hero-copy h1,
.panel-header h3,
.page-topbar h2,
.balance-panel .panel-header strong,
.agent-window-header h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-family: "Space Grotesk", sans-serif;
}

.auth-hero-copy h1 {
  font-size: clamp(3.4rem, 5vw, 5.6rem);
  line-height: 0.94;
  letter-spacing: -0.045em;
}

.auth-hero-copy h1 span {
  color: #ff7b00;
}

.auth-hero-copy p {
  margin: 0;
  margin-top: 24px;
  max-width: 360px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
  line-height: 1.7;
}

.auth-showcase-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.insights-list,
.report-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.auth-panel {
  order: 2;
  grid-column: 2;
  min-height: 100vh;
  padding: 64px 72px 48px;
  background: linear-gradient(180deg, rgba(255, 251, 247, 1), rgba(250, 245, 239, 1));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.auth-panel-top {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: min(100%, 460px);
  margin: 0 auto;
}

.auth-mobile-brand {
  display: none;
}

.auth-mobile-badge {
  width: 88px;
  height: 88px;
  margin: 0;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), #ff8c26);
  box-shadow: 0 18px 40px rgba(238, 108, 0, 0.18);
}

.auth-mobile-badge-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.auth-panel-copy h2,
.auth-panel-copy p {
  margin: 0;
}

.auth-panel-copy h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
}

.auth-panel-copy p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.auth-field > span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: #8a7567;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(100%, 460px);
  margin: 0 auto;
}

.auth-form input {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  background: #f4efea;
  box-shadow: inset 0 0 0 1px rgba(24, 21, 18, 0.03);
}

.auth-inline-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.auth-link,
.auth-text-button {
  color: var(--accent-deep);
  font-weight: 700;
}

.auth-text-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.auth-submit-button {
  min-height: 56px;
  border-radius: 10px;
  box-shadow: 0 16px 34px rgba(238, 108, 0, 0.18);
}

.auth-divider {
  position: relative;
  text-align: center;
  margin-top: 4px;
  width: min(100%, 460px);
  margin-left: auto;
  margin-right: auto;
}

.auth-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid rgba(24, 21, 18, 0.09);
}

.auth-divider span {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 0 14px;
  background: rgba(255, 250, 246, 0.98);
  font-size: 0.77rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #8a7567;
}

.auth-social-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: min(100%, 460px);
  margin: 0 auto;
}

.auth-social-button {
  min-height: 50px;
  border: 1px solid rgba(24, 21, 18, 0.08);
  border-radius: 10px;
  background: #fff;
  font-weight: 700;
  color: #3a342f;
  cursor: pointer;
}

.auth-mobile-switch {
  display: grid;
  gap: 14px;
  margin-top: 8px;
  width: min(100%, 460px);
  margin-left: auto;
  margin-right: auto;
}

.auth-highlights,
.insights-list,
.report-list {
  display: grid;
  gap: 10px;
}

.auth-switch-copy {
  margin: 0;
  text-align: center;
  color: var(--muted);
}

.auth-legal-links {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: auto;
  padding-top: 12px;
  width: min(100%, 460px);
  margin-left: auto;
  margin-right: auto;
}

.auth-legal-links a {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9d8f83;
}

.nav-panel,
.filter-stack,
.planning-grid {
  display: grid;
  gap: 10px;
}

.insights-list li,
.report-list li {
  padding: 14px 16px;
  background: var(--surface-alt);
  border-left: 3px solid var(--accent);
  line-height: 1.6;
}
.input-split,
.summary-strip,
.goal-cards,
.content-grid.two-columns,
.report-grid,
.whatsapp-grid,
.whatsapp-actions,
.overview-shell {
  display: grid;
  gap: 18px;
}

.mode-button,
.nav-button,
.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.cta-agent-button,
.text-button,
.hamburger-button {
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.mode-button:hover,
.nav-button:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover,
.cta-agent-button:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.mode-button,
.ghost-button,
.secondary-button,
.text-button {
  background: var(--surface-alt);
  color: var(--text);
}

.mode-button,
.primary-button,
.secondary-button,
.ghost-button,
.cta-agent-button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 16px;
  font-weight: 700;
}

.mode-button.active,
.primary-button,
.cta-agent-button {
  background: linear-gradient(135deg, var(--accent), #ff9940);
  color: #fff;
}

.secondary-button {
  background: #f1e8de;
}

.ghost-button {
  background: rgba(238, 108, 0, 0.08);
  color: var(--accent-deep);
}

.ghost-button.small {
  min-height: 40px;
  padding: 0 14px;
}

.danger-button {
  background: rgba(217, 74, 54, 0.1);
  color: #a23626;
}

.auth-form,
.transaction-form,
.goals-form,
.agent-chat-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-row,
.filter-stack {
  display: grid;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.96rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border-radius: 12px;
  padding: 14px 16px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(238, 108, 0, 0.22);
  border-color: rgba(238, 108, 0, 0.36);
}

.message-box {
  margin: 0;
  padding: 14px 16px;
  border-left: 4px solid var(--accent);
  background: rgba(238, 108, 0, 0.1);
  color: #7c3b00;
}

.billing-paywall {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px);
  gap: 24px;
  align-items: stretch;
}

.billing-paywall-copy {
  display: grid;
  gap: 14px;
  align-content: center;
}

.billing-paywall-copy h3 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3.25rem);
  line-height: 0.98;
}

.billing-paywall-copy p,
.billing-paywall-card p {
  margin: 0;
  color: var(--muted);
}

.billing-paywall-card {
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
  box-shadow: var(--shadow);
}

.billing-paywall-price {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 700;
  color: var(--text);
}

.billing-paywall-price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
}

.billing-paywall-list {
  margin: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  min-height: 100vh;
  padding: 24px;
  align-items: start;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 24px 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(24, 21, 18, 0.05);
  border-radius: 32px;
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  min-width: 0;
  overflow: auto;
}

.sidebar-top,
.sidebar-bottom {
  display: grid;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  display: block;
  width: auto;
  height: 70px;
  object-fit: contain;
}

.brand-logo-icon {
  display: none;
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.app-brand-logo {
  height: 68px;
}

.app-brand-icon {
  width: 56px;
  height: 56px;
}

.page-description,
.panel-header p,
.storage-panel p,
.goal-card-foot small,
.metric-line small,
.whatsapp-card small,
.whatsapp-code-box small,
.whatsapp-instructions small,
.description-cell span,
.report-list li span,
.agent-loading p {
  color: var(--muted);
}

.user-chip,
.storage-panel {
  padding: 18px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
  border-radius: 24px;
}

.user-chip > div:last-child {
  min-width: 0;
}

.user-avatar,
.mobile-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #222, #555);
  color: white;
  border-radius: 50%;
  font-size: 0.92rem;
  font-weight: 800;
}

.user-chip strong {
  display: block;
  margin-top: 6px;
  font-size: 0.98rem;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.nav-panel {
  gap: 10px;
}

.nav-button {
  width: 100%;
  padding: 16px 18px;
  text-align: left;
  border-radius: 22px;
  background: transparent;
  color: var(--muted);
}

.nav-button span,
.nav-button small {
  display: block;
}

.nav-button span {
  font-weight: 700;
  color: var(--text);
}

.nav-button small {
  margin-top: 5px;
  color: var(--muted);
}

.nav-button.active {
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.cta-agent-button {
  width: 100%;
  min-height: 56px;
  border-radius: 24px;
}

.storage-panel strong {
  display: block;
  margin: 8px 0 6px;
}

.sidebar-links {
  display: grid;
  gap: 10px;
}

.sidebar-links .ghost-button {
  border-radius: 24px;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-right: 6px;
  min-width: 0;
}

.mobile-topbar,
.mobile-bottom-nav {
  display: none;
}

.page-topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
}

.page-topbar h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.page-description {
  margin: 10px 0 0;
  max-width: 540px;
}

.month-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  min-width: 182px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 34px rgba(72, 47, 24, 0.08);
}

.month-chip-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
  color: #7c6f62;
  font-size: 1.1rem;
  box-shadow: inset 0 0 0 1px rgba(24, 21, 18, 0.06);
}

.month-chip-copy {
  display: grid;
  gap: 2px;
}

.month-chip-copy span,
.month-chip-copy strong {
  display: block;
  line-height: 1.1;
}

.month-chip-copy span {
  font-size: 0.9rem;
  color: var(--muted);
}

.month-chip-copy strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.page {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.page.active {
  display: flex;
}

.overview-shell {
  grid-template-columns: minmax(0, 1.25fr) 270px;
  align-items: start;
}

.overview-main-column {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.overview-side-column {
  display: grid;
  gap: 18px;
  min-width: 0;
  align-content: start;
}

.panel,
.balance-panel,
.side-activity-panel,
.ai-highlight-panel {
  border-radius: 22px;
  padding: 18px;
}

.panel-header {
  margin-bottom: 16px;
}

.panel-header-inline {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.balance-panel .panel-header strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(2.2rem, 5.4vw, 3.4rem);
  line-height: 0.92;
}

.balance-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: rgba(238, 108, 0, 0.1);
  color: var(--accent);
  border-radius: 12px;
  font-size: 1.2rem;
}

.summary-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.summary-box,
.goal-card,
.planning-box,
.whatsapp-card,
.whatsapp-code-box,
.whatsapp-instructions,
.metric-line {
  padding: 14px 16px;
  background: var(--surface-alt);
  border-radius: 18px;
}

.summary-box span,
.summary-box small,
.goal-card-head span,
.planning-box span,
.metric-line span {
  color: var(--muted);
}

.summary-box strong,
.metric-line strong,
.planning-box strong {
  display: block;
  margin: 8px 0 4px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.22rem;
}

.income-box {
  border-bottom: 3px solid var(--income);
}

.expense-box {
  border-bottom: 3px solid var(--expense);
}

.neutral-box {
  border-bottom: 3px solid var(--accent);
}

.table-wrap {
  overflow-x: auto;
}

.activity-wrap table {
  width: 100%;
}

.side-activity-panel td:nth-child(2),
.side-activity-panel td:nth-child(3),
.side-activity-panel td:nth-child(4),
.side-activity-panel td:nth-child(6) {
  display: none;
}

.side-activity-panel td {
  padding: 12px 0;
}

.side-activity-panel .transaction-amount {
  text-align: right;
  white-space: nowrap;
}

.side-activity-panel {
  align-self: start;
}

.activity-wrap {
  max-height: 248px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
}

thead th {
  color: var(--muted);
  font-size: 0.9rem;
}

.description-cell strong,
.description-cell span {
  display: block;
}

.description-cell strong {
  margin-bottom: 4px;
}

.transaction-type-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.transaction-type-pill.income {
  background: rgba(36, 119, 213, 0.1);
  color: var(--income);
}

.transaction-type-pill.expense {
  background: rgba(217, 74, 54, 0.1);
  color: var(--expense);
}

.transaction-amount.positive {
  color: var(--income);
  font-weight: 800;
}

.transaction-amount.negative {
  color: var(--expense);
  font-weight: 800;
}

.icon-button {
  background: rgba(217, 74, 54, 0.1);
  color: var(--expense);
  padding: 10px 12px;
  border-radius: 10px;
}

.goals-overview-panel .goal-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

.goal-card-head strong {
  font-size: 0.95rem;
  font-family: "Space Grotesk", sans-serif;
}

.goal-progress-copy {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.goal-card-foot {
  margin-top: 10px;
}

.goal-card.warm {
  border-top: 3px solid var(--accent);
}

.goal-card.cool {
  border-top: 3px solid var(--income);
}

.progress-track {
  height: 8px;
  margin-top: 10px;
  background: rgba(238, 108, 0, 0.14);
  overflow: hidden;
  border-radius: 999px;
}

.progress-track.warning {
  background: rgba(36, 119, 213, 0.14);
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ffb36d);
}

.progress-track.warning .progress-bar {
  background: linear-gradient(90deg, var(--income), #7ec0ff);
}

.metrics-panel,
.report-card,
.planning-panel,
.whatsapp-panel {
  display: grid;
  gap: 12px;
}

.metrics-panel {
  align-self: start;
}

.metric-line strong,
.metric-line small {
  margin-top: 8px;
}

.ai-highlight-panel {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 18px;
  align-items: start;
  border: 2px solid rgba(238, 108, 0, 0.7);
}

.chart-panel {
  overflow: hidden;
}

.ai-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #ff9940);
  color: white;
  font-size: 1.2rem;
}

.ai-copy h3 {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
}

.insights-list li {
  background: transparent;
  padding: 0;
  border: 0;
}

.insights-list li + li {
  margin-top: 10px;
}

.content-grid.two-columns {
  grid-template-columns: minmax(0, 1fr) 360px;
}

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

.report-card.wide {
  width: 100%;
}

.chart-panel canvas {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.65), rgba(243, 238, 231, 0.8));
  border-radius: 12px;
}

.filter-panel,
.form-panel,
.goals-panel {
  align-self: start;
}

.import-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--surface-alt);
  border-radius: 12px;
}

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

.planning-box.full {
  grid-column: 1 / -1;
}

.planning-box {
  min-width: 0;
}

.planning-box span,
.planning-box strong,
.planning-box small {
  overflow-wrap: anywhere;
}

.text-button {
  padding: 0;
  font-weight: 700;
  color: var(--accent);
}

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

.whatsapp-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.whatsapp-card strong,
.whatsapp-code-box strong {
  display: block;
  margin: 8px 0 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
}

.whatsapp-instructions code {
  display: block;
  margin: 10px 0 6px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.agent-loading {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 14px;
  margin-bottom: 10px;
  background: rgba(238, 108, 0, 0.08);
  border-radius: 12px;
}

.loading-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  animation: pulseDots 1.2s infinite ease-in-out;
}

.loading-dot:nth-child(2) {
  animation-delay: 0.14s;
}

.loading-dot:nth-child(3) {
  animation-delay: 0.28s;
}

.agent-drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 21, 18, 0.2);
  backdrop-filter: blur(6px);
}

.agent-window {
  width: min(560px, 100%);
  height: min(86vh, 820px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.agent-window-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.agent-messages {
  padding: 20px;
  overflow: auto;
  display: grid;
  gap: 12px;
  align-content: start;
  background: linear-gradient(180deg, #ffffff, #f7fafc);
}

.agent-message {
  max-width: 84%;
  padding: 14px 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  border-radius: 14px;
}

.agent-message.user {
  margin-left: auto;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: white;
}

.agent-message.assistant {
  background: var(--surface-alt);
}

.agent-chat-form {
  padding: 18px 20px 20px;
  border-top: 1px solid var(--line);
}

.mobile-bottom-nav .nav-button.highlight {
  background: rgba(238, 108, 0, 0.12);
}

.mobile-brand-logo {
  height: 40px;
}

.hamburger-button {
  background: transparent;
  padding: 6px;
  font-size: 1.2rem;
}

@keyframes pulseDots {
  0%, 80%, 100% {
    transform: scale(0.7);
    opacity: 0.45;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 1240px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mobile-topbar,
  .mobile-bottom-nav {
    display: flex;
  }

  .workspace {
    padding-bottom: 96px;
  }

  .billing-paywall {
    grid-template-columns: 1fr;
  }

  .mobile-topbar {
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px 12px;
  }

  .app-brand-logo {
    height: 58px;
  }

  .app-brand-icon {
    display: block;
  }

  .app-brand-logo.brand-logo-full {
    display: none;
  }

  .mobile-brand-logo {
    display: block;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 25;
    justify-content: space-between;
    gap: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(24, 21, 18, 0.08);
    box-shadow: var(--shadow-soft);
    border-radius: 24px;
  }

  .mobile-bottom-nav .nav-button {
    padding: 10px 8px;
    text-align: center;
    background: transparent;
  }

  .mobile-bottom-nav .nav-button span {
    font-size: 0.75rem;
  }
}

@media (max-width: 980px) {
  .auth-card,
  .overview-shell,
  .content-grid.two-columns,
  .report-grid,
  .planning-grid,
  .summary-strip,
  .goal-cards,
  .whatsapp-grid,
  .whatsapp-actions {
    grid-template-columns: 1fr;
  }

  .overview-main-column {
    margin-top: 0;
  }

  .page-topbar,
  .panel-header-inline,
  .ai-highlight-panel {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .auth-screen {
    background:
      linear-gradient(180deg, rgba(14, 31, 45, 0.94) 0%, rgba(14, 31, 45, 0.84) 36%, rgba(255, 250, 246, 0.98) 36%, rgba(255, 250, 246, 0.98) 100%),
      linear-gradient(135deg, #244157 0%, #172938 30%, #6a4b34 68%, #101922 100%);
  }

  .auth-card {
    grid-template-columns: 1fr;
    min-height: 100vh;
    border-radius: 0;
  }

  .auth-showcase {
    order: 1;
    min-height: 420px;
    padding: 32px;
  }

  .auth-panel {
    order: 2;
    min-height: auto;
    padding: 36px 32px 30px;
  }

  .auth-hero-copy h1 {
    font-size: clamp(2.8rem, 6vw, 4rem);
  }

  .auth-showcase-footer {
    font-size: 0.72rem;
  }
}

@media (max-width: 720px) {
  .auth-screen,
  .app-shell {
    padding: 14px;
  }

  .planning-box {
    padding: 16px;
  }

  .planning-box span {
    font-size: 0.95rem;
    line-height: 1.3;
  }

  .planning-box strong {
    margin: 8px 0 4px;
    font-size: clamp(1.4rem, 7vw, 2rem);
    line-height: 1.05;
  }

  .planning-box small {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .auth-card,
  .panel,
  .balance-panel,
  .side-activity-panel,
  .ai-highlight-panel,
  .user-chip,
  .storage-panel,
  .month-chip,
  .agent-window {
    border-radius: 20px;
  }

  .auth-card {
    padding: 0;
    border-radius: 24px;
    min-height: auto;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
  }

  .auth-panel,
  .panel,
  .balance-panel,
  .side-activity-panel,
  .ai-highlight-panel {
    padding: 18px;
  }

  .input-split {
    grid-template-columns: 1fr;
  }

  .auth-showcase {
    display: none;
  }

  .auth-panel {
    grid-column: 1;
    min-height: auto;
    padding: 22px 20px 24px;
    gap: 16px;
  }

  .auth-mobile-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .auth-mobile-brand-main {
    display: flex;
    align-items: center;
  }

  .auth-mobile-logo {
    height: 34px;
    width: auto;
    object-fit: contain;
  }

  .auth-help-button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 0;
    background: rgba(24, 21, 18, 0.08);
    color: #7c7065;
    font-weight: 800;
  }

  .auth-mobile-badge {
    width: 72px;
    height: 72px;
    margin: 8px auto 0;
  }

  .auth-mobile-badge-icon {
    width: 34px;
    height: 34px;
  }

  .auth-panel-copy {
    text-align: center;
  }

  .auth-panel-copy h2 {
    font-size: 2.25rem;
  }

  .auth-panel-copy p {
    max-width: 290px;
    margin-left: auto;
    margin-right: auto;
  }

  .auth-field > span {
    font-size: 0.72rem;
  }

  .auth-inline-actions {
    justify-content: flex-end;
  }

  .auth-submit-button {
    width: 100%;
  }

  .auth-social-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-social-button {
    min-height: 46px;
    font-size: 0.94rem;
  }

  .auth-legal-links {
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 4px;
    padding-top: 4px;
  }

  .page-topbar {
    display: none;
  }

  th,
  td {
    padding: 12px 8px;
  }

  .agent-window {
    width: 100%;
    height: min(92vh, 820px);
  }

  .brand-logo {
    height: 54px;
  }

  .mobile-brand-logo {
    height: 34px;
  }

  .brand-logo-full {
    display: none;
  }

  .brand-logo-icon {
    display: block;
  }
}
