:root {
  --ink: #1d1d1f;
  --muted: #766a70;
  --line: rgba(92, 52, 60, 0.11);
  --paper: #ffffff;
  --soft: #fff7fa;
  --blue: #5b8def;
  --green: #34c759;
  --red: #ff5f7e;
  --amber: #f5a23b;
  --cyan: #63c7df;
  --pink: #f7a8bc;
  --blush: #fff1f5;
  --cream: #fffaf3;
  --shadow: 0 18px 48px rgba(87, 54, 62, 0.09);
}

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 221, 230, 0.58), transparent 28%),
    linear-gradient(180deg, #fff8fb 0%, #f7f7fa 48%, #fffaf3 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
}

.app-navbar {
  background: rgba(255, 250, 252, 0.82);
  border-bottom: 1px solid rgba(92, 52, 60, 0.09);
  box-shadow: 0 8px 28px rgba(92, 52, 60, 0.06);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
  background: #fff3f6;
  box-shadow: inset 0 0 0 1px #ffd8e2;
}

.brand-mark img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.navbar-nav {
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 10px !important;
  border-radius: 8px;
  border: 1px solid transparent;
  color: #554b50;
  font-size: 14px;
  font-weight: 650;
  transition: transform .16s ease, background-color .16s ease, box-shadow .16s ease, color .16s ease;
}

.nav-link i {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  background: color-mix(in srgb, var(--nav-accent) 14%, #fff);
  color: var(--nav-accent);
  font-size: 14px;
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

.nav-link:hover {
  color: var(--nav-accent);
  background: color-mix(in srgb, var(--nav-accent) 9%, #fff);
  border-color: color-mix(in srgb, var(--nav-accent) 15%, transparent);
  transform: translateY(-1px);
}

.nav-link.active {
  color: #fff;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--nav-accent) 90%, #fff), color-mix(in srgb, var(--nav-accent-2) 84%, #1d1d1f));
  border-color: color-mix(in srgb, var(--nav-accent) 36%, #fff);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--nav-accent) 22%, transparent);
}

.nav-link.active i {
  color: var(--nav-accent);
  background: rgba(255, 255, 255, 0.92);
}

.nav-home { --nav-accent: #5b8def; --nav-accent-2: #d99ab0; }
.nav-ledger { --nav-accent: #ef8f6b; --nav-accent-2: #f0a2b8; }
.nav-transfer { --nav-accent: #4eb6a6; --nav-accent-2: #8d94e8; }
.nav-assets { --nav-accent: #62b8c8; --nav-accent-2: #8fcfbc; }
.nav-budget { --nav-accent: #c78fe8; --nav-accent-2: #f0a2b8; }
.nav-watch { --nav-accent: #f47b9a; --nav-accent-2: #f5a23b; }
.nav-bills { --nav-accent: #8d94e8; --nav-accent-2: #63c7df; }
.nav-goals { --nav-accent: #77c88d; --nav-accent-2: #63c7df; }
.nav-reports { --nav-accent: #8d94e8; --nav-accent-2: #d99ab0; }
.nav-calculators { --nav-accent: #f5a23b; --nav-accent-2: #f47b9a; }
.nav-settings { --nav-accent: #9b8990; --nav-accent-2: #5e4b52; }

.navbar-toggler {
  border: 1px solid rgba(29, 29, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #475467;
  font-size: 14px;
  font-weight: 600;
}

.app-main {
  padding-bottom: 56px;
}

.app-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 0 16px 24px;
  color: var(--muted);
  font-size: 12px;
}

.app-footer a {
  color: var(--muted);
  text-decoration: none;
}

.app-footer a:hover {
  color: var(--blue);
}

.mobile-tabbar {
  display: none;
}

.release-modal .modal-header,
.release-modal .modal-footer {
  border-color: var(--line);
}

.release-modal h3 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 850;
}

.release-list,
.release-history ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.release-history {
  display: grid;
  gap: 12px;
}

.release-history > div {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 245, 247, 0.74);
}

.release-history strong {
  display: block;
  margin-bottom: 6px;
}

.release-history-more {
  margin-top: 14px;
}

.release-history-full {
  padding-top: 2px;
  border-top: 1px dashed var(--line);
}

.guide-tip {
  display: inline-grid;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(247, 168, 188, 0.18);
  color: #d94f74;
  font-size: 13px;
  line-height: 1;
  vertical-align: 1px;
}

.guide-tip:hover,
.guide-tip:focus {
  background: rgba(247, 168, 188, 0.28);
  outline: none;
}

.login-shell {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
}

.login-preview {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(280px, 420px);
  align-items: stretch;
  gap: 18px;
  width: min(100%, 880px);
}

.login-panel,
.panel,
.metric {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 226, 232, 0.84);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.login-panel {
  padding: 32px;
}

.companion-login-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(255, 226, 232, 0.84);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fff5f8);
  box-shadow: var(--shadow);
}

.login-sticker-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 8px;
}

.login-sticker-row img {
  width: 100%;
  max-height: 210px;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(83, 58, 56, 0.16));
}

.companion-login-card strong,
.companion-talk strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.companion-login-card span,
.companion-talk span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.7;
}

.panel {
  padding: 20px;
}

.comfortable-form {
  align-items: end;
}

.comfortable-form .form-action {
  min-width: 128px;
}

.comfortable-form .form-label {
  min-height: 20px;
}

.page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding: 28px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #4d3038 0%, #8b6670 48%, #f0a2b8 100%);
  box-shadow: var(--shadow);
}

.page-hero h1 {
  margin: 4px 0 6px;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 800;
  letter-spacing: 0;
}

.page-hero p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-hero .eyebrow {
  color: #ffe6ee;
}

.metric {
  position: relative;
  min-height: 138px;
  overflow: hidden;
  padding: 20px;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric span {
  font-size: 14px;
  margin-bottom: 8px;
}

.metric strong {
  display: block;
  margin-bottom: 12px;
  font-size: 26px;
  line-height: 1.1;
}

.metric small {
  font-size: 13px;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.section-title a {
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.panel-guide {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-pill {
  white-space: nowrap;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.status-good {
  color: #067647;
  background: #dcfae6;
}

.status-danger {
  color: #b42318;
  background: #fee4e2;
}

.status-info {
  color: #075985;
  background: #e0f2fe;
}

.plan-grid,
.goal-numbers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.plan-grid div,
.goal-numbers div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 245, 247, 0.82);
}

.plan-grid span,
.goal-numbers span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.plan-grid strong,
.goal-numbers strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.plan-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 16px;
  border-radius: 8px;
  background: #1d1d1f;
  color: #fff;
}

.plan-result strong {
  font-size: 24px;
}

.chart-card {
  min-height: 340px;
}

.chart-box {
  position: relative;
  height: 260px;
  max-height: 260px;
}

.chart-box-tall {
  height: 300px;
  max-height: 300px;
}

.chart-box canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
}

.chart-panel {
  min-height: 380px;
}

.companion-panel {
  display: grid;
  min-height: 340px;
  overflow: hidden;
  padding: 0;
  background: linear-gradient(180deg, #ffffff, #f5f5f7);
}

.companion-stage {
  display: grid;
  min-height: 210px;
  place-items: center;
  padding: 18px 18px 0;
}

.companion-stage img {
  width: min(100%, 300px);
  max-height: 230px;
  object-fit: contain;
  filter: drop-shadow(0 14px 18px rgba(83, 58, 56, 0.16));
}

.companion-talk {
  margin: 0 20px 20px;
  padding: 18px;
  border: 1px solid rgba(255, 45, 85, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.08);
}

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

.advice-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 245, 247, 0.72);
}

.advice-item img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 7px 8px rgba(83, 58, 56, 0.14));
}

.advice-item strong {
  display: block;
  font-weight: 900;
}

.advice-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.companion-empty {
  position: relative;
  overflow: hidden;
  padding-right: 84px;
  text-align: left;
}

.companion-empty::after {
  position: absolute;
  right: 10px;
  bottom: -12px;
  width: 82px;
  height: 74px;
  background: var(--companion-empty-img, url("/static/img/companions/empty.png")) center / contain no-repeat;
  content: "";
  opacity: .95;
}

.companion-empty-budget {
  --companion-empty-img: url("/static/img/companions/budget.png");
}

.companion-empty-bill {
  --companion-empty-img: url("/static/img/companions/bill.png");
}

.companion-empty-goal {
  --companion-empty-img: url("/static/img/companions/goal.png");
}

.companion-empty-alert {
  --companion-empty-img: url("/static/img/companions/alert.png");
}

.companion-empty-sheet {
  --companion-empty-img: url("/static/img/companions/success.png");
}

.companion-empty-success {
  --companion-empty-img: url("/static/img/companions/success.png");
}

.companion-empty-bookkeeping {
  --companion-empty-img: url("/static/img/companions/bookkeeping.png");
}

.page-companion-tip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
  padding: 7px 12px 7px 7px;
  border: 1px solid rgba(247, 168, 188, 0.32);
  border-radius: 999px;
  background: rgba(255, 246, 249, 0.9);
  color: #9f415c;
  font-size: 13px;
  font-weight: 800;
}

.page-companion-tip img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  margin-block: -10px;
  filter: drop-shadow(0 5px 6px rgba(83, 58, 56, 0.14));
}

.progress {
  height: 8px;
  background-color: rgba(29, 29, 31, 0.08);
}

.progress-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.progress-row:last-child {
  border-bottom: 0;
}

.progress-row small,
.list-card small,
.list-card em,
.insight-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.list-card,
.insight-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.list-card:last-child,
.insight-row:last-child {
  border-bottom: 0;
}

.insight-row {
  align-items: flex-start;
}

.insight-row strong {
  color: var(--amber);
}

.empty-state {
  color: var(--muted);
  padding: 24px;
  border: 1px dashed rgba(29, 29, 31, 0.18);
  border-radius: 8px;
  background: rgba(245, 245, 247, 0.74);
  text-align: center;
}

.table-modern {
  margin-bottom: 0;
}

.table-modern thead th,
.table thead th {
  color: #667085;
  border-bottom-color: var(--line);
  font-size: 13px;
  font-weight: 800;
}

.table tbody tr:hover {
  background: rgba(0, 113, 227, 0.045);
}

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

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

.tag-chip {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.1);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.goal-card {
  height: 100%;
}

.settings-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.settings-switch:last-child {
  border-bottom: 0;
}

.settings-switch strong,
.settings-switch span {
  display: block;
}

.settings-switch span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.settings-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.settings-stats div {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 245, 247, 0.74);
}

.settings-stats span,
.settings-savebar span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.settings-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.settings-savebar {
  position: sticky;
  bottom: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.bill-auto-note,
.report-scope-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(91, 141, 239, 0.18);
  border-radius: 8px;
  background: rgba(91, 141, 239, 0.07);
  color: #40506f;
  font-size: 13px;
  line-height: 1.6;
}

.bill-auto-note i,
.report-scope-note i {
  color: var(--blue);
  font-size: 16px;
  margin-top: 2px;
}

.asset-detail-box {
  padding: 12px 14px;
  border: 1px solid rgba(255, 153, 188, 0.24);
  border-radius: 8px;
  background: rgba(255, 247, 250, 0.7);
}

.asset-detail-box summary {
  cursor: pointer;
  color: #7a5361;
  font-weight: 700;
  list-style-position: inside;
}

.security-block-list {
  display: grid;
  gap: 10px;
}

.security-block-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(255, 59, 48, 0.14);
  border-radius: 8px;
  background: rgba(255, 59, 48, 0.045);
}

.security-block-item strong,
.security-block-item span {
  display: block;
}

.security-block-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.security-log-table {
  max-height: 420px;
}

.security-status {
  display: inline-flex;
  align-items: center;
  min-width: 68px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.security-success,
.security-unlocked {
  color: #067647;
  background: #dcfae6;
}

.security-failure {
  color: #b54708;
  background: #fef0c7;
}

.security-locked,
.security-blocked {
  color: #b42318;
  background: #fee4e2;
}

.calculator-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #4d3038 0%, #6d607b 46%, #f5a23b 100%);
}

.hero-companion {
  display: grid;
  min-width: 110px;
  place-items: center;
}

.hero-companion img {
  width: 118px;
  max-height: 118px;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(83, 58, 56, 0.18));
}

.calculator-card {
  position: relative;
  overflow: hidden;
}

.calculator-card::after {
  position: absolute;
  top: -46px;
  right: -46px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--calc-accent, var(--blue)) 14%, transparent);
  content: "";
}

.calculator-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--calc-accent) 14%, #fff);
  color: var(--calc-accent);
  font-size: 21px;
}

.calc-blue { --calc-accent: #5b8def; }
.calc-green { --calc-accent: #77c88d; }
.calc-purple { --calc-accent: #c78fe8; }
.calc-pink { --calc-accent: #f47b9a; }
.calc-orange { --calc-accent: #f5a23b; }
.calc-cyan { --calc-accent: #63c7df; }
.calc-slate { --calc-accent: #9b8990; }

.calculator-result {
  scroll-margin-top: 92px;
  border-color: rgba(247, 168, 188, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 244, 248, 0.92));
}

.calculator-result:focus {
  outline: 0;
  box-shadow: 0 0 0 4px rgba(247, 168, 188, 0.2), var(--shadow);
}

.result-companion {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px 12px 8px 8px;
  border: 1px solid rgba(247, 168, 188, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #9f415c;
  font-size: 13px;
  font-weight: 800;
}

.result-companion img {
  width: 46px;
  height: 46px;
  margin-block: -12px;
  object-fit: contain;
  filter: drop-shadow(0 5px 6px rgba(83, 58, 56, 0.14));
}

.calc-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.calc-result-grid div {
  padding: 14px;
  border: 1px solid rgba(29, 29, 31, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.calc-result-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.calc-result-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.15;
}

.allocation-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.allocation-grid label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.btn {
  border-radius: 8px;
  font-weight: 700;
}

.form-control,
.form-select,
.modal-content {
  border-radius: 8px;
}

.form-control,
.form-select {
  border-color: rgba(29, 29, 31, 0.12);
  background-color: rgba(255, 255, 255, 0.92);
}

.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
}

.btn-outline-primary {
  color: var(--blue);
  border-color: rgba(0, 113, 227, 0.42);
}

.btn-outline-primary:hover {
  background: var(--blue);
  border-color: var(--blue);
}

canvas {
  max-width: 100%;
}

.legal-shell,
.offline-shell {
  max-width: 860px;
  margin: 0 auto;
}

.legal-panel section + section {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.legal-panel h2 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 850;
}

.legal-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.offline-panel {
  display: flex;
  align-items: center;
  gap: 18px;
}

.offline-panel img {
  width: 104px;
  height: 104px;
  object-fit: contain;
  flex: 0 0 auto;
}

@media (max-width: 992px) {
  .page-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-preview {
    grid-template-columns: 1fr;
  }

  .companion-login-card {
    min-height: 260px;
  }

  .comfortable-form .form-action {
    width: 100%;
  }

  .plan-grid,
  .goal-numbers,
  .calc-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 576px) {
  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .app-navbar {
    position: sticky;
    top: 0;
  }

  .navbar-brand {
    font-size: 16px;
  }

  .navbar-collapse {
    padding-top: 12px;
  }

  .nav-link {
    padding: 10px 12px;
  }

  .mobile-tabbar {
    position: fixed;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 1040;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 8px;
    border: 1px solid rgba(92, 52, 60, 0.12);
    border-radius: 18px;
    background: rgba(255, 250, 252, 0.88);
    box-shadow: 0 18px 44px rgba(87, 54, 62, 0.16);
    backdrop-filter: saturate(180%) blur(22px);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
  }

  .mobile-tabbar-link {
    display: grid;
    place-items: center;
    gap: 3px;
    min-width: 0;
    padding: 7px 2px;
    border-radius: 13px;
    color: #625960;
    font-size: 11px;
    font-weight: 750;
    text-decoration: none;
  }

  .mobile-tabbar-link i {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 10px;
    background: color-mix(in srgb, var(--nav-accent) 14%, #fff);
    color: var(--nav-accent);
    font-size: 14px;
  }

  .mobile-tabbar-link.active {
    color: var(--nav-accent);
    background: color-mix(in srgb, var(--nav-accent) 10%, #fff);
  }

  .mobile-tabbar-link.active i {
    color: #fff;
    background: linear-gradient(135deg, var(--nav-accent), var(--nav-accent-2));
    box-shadow: 0 8px 18px color-mix(in srgb, var(--nav-accent) 24%, transparent);
  }

  .login-panel,
  .panel,
  .metric,
  .page-hero {
    padding: 16px;
  }

  .comfortable-form {
    row-gap: 12px;
  }

  .metric {
    min-height: 128px;
  }

  .metric strong {
    font-size: 20px;
  }

  .page-hero h1 {
    font-size: 28px;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .plan-grid,
  .goal-numbers,
  .calc-result-grid,
  .settings-stats {
    grid-template-columns: 1fr;
  }

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

  .security-block-item {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-savebar {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions,
  .hero-actions .btn {
    width: 100%;
  }

  .companion-login-card {
    padding: 14px;
  }

  .login-sticker-row img {
    max-height: 170px;
  }

  .companion-login-card strong,
  .companion-talk strong {
    font-size: 18px;
  }

  .companion-stage {
    min-height: 170px;
    padding: 10px 10px 0;
  }

  .companion-stage img {
    max-height: 160px;
  }

  .companion-talk {
    margin: 0 14px 14px;
    padding: 14px;
  }

  .chart-box {
    height: 220px;
    max-height: 220px;
  }

  .calculator-result {
    scroll-margin-top: 82px;
  }

  .offline-panel {
    align-items: flex-start;
  }

  .offline-panel img {
    width: 72px;
    height: 72px;
  }

  .chart-box-tall {
    height: 260px;
    max-height: 260px;
  }

  .d-flex.flex-wrap.justify-content-between > .btn,
  .d-flex.flex-wrap.justify-content-between > form {
    width: 100%;
  }

  .d-flex.flex-wrap.justify-content-between > form {
    display: grid !important;
    grid-template-columns: 1fr auto;
  }

  .table-responsive {
    margin-inline: -14px;
    padding-inline: 14px;
  }

  .table {
    min-width: 720px;
    font-size: 13px;
  }

  .table td,
  .table th {
    white-space: nowrap;
  }

  .btn-sm {
    padding: 6px 9px;
  }

  .goal-card .d-flex.flex-wrap,
  .goal-card .d-flex.flex-wrap form {
    width: 100%;
  }

  .goal-card .d-flex.flex-wrap form {
    display: grid !important;
    grid-template-columns: 1fr auto;
  }
}
