:root {
  color-scheme: light;
  --page: #ffffff;
  --shell: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f5f0e4;
  --surface-muted: #eee9dc;
  --line: rgba(62, 55, 42, 0.12);
  --line-strong: rgba(62, 55, 42, 0.2);
  --text: #34434a;
  --muted: #68767b;
  --soft: #8b989c;
  --accent: #b7c9cf;
  --accent-soft: #dce6e6;
  --blue: #b7c9cf;
  --blue-soft: #e2edef;
  --ai: #b7c9cf;
  --ai-deep: #4b6873;
  --ai-soft: #dce6e6;
  --green: #62C989;
  --green-soft: rgba(98, 201, 137, 0.12);
  --amber: #6f7f86;
  --amber-soft: #e5eaeb;
  --red: #E87979;
  --red-soft: rgba(232, 121, 121, 0.12);
  --radius: 18px;
  --control-radius: 11px;
  --shadow: 0 22px 70px rgba(49, 70, 78, 0.12);
  --card-shadow: 0 8px 24px rgba(49, 70, 78, 0.055);
  --font: "Fustat", "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  display: none;
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

p {
  font-size: 16px;
}

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

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(114, 91, 55, 0.2);
}

.phone-shell {
  width: min(98vw, 624px);
  height: 100vh;
  max-height: 100vh;
  min-height: 0;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--shell);
  box-shadow: none;
  overflow: hidden;
}

@supports (height: 100dvh) {
  .phone-shell {
    height: 100dvh;
    max-height: 100dvh;
  }
}

.app-header {
  min-height: 82px;
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.app-header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -18px;
  left: 0;
  height: 18px;
  background: transparent;
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.app-header.is-scrolling::after {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0));
  opacity: 1;
}

.app-header.is-scrolling {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
}

.brand {
  width: 96px;
  height: 31px;
  display: block;
}

.brand img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.icon-button {
  width: 42px;
  height: 42px;
  position: relative;
  border: 0;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  box-shadow: 0 5px 14px rgba(49, 70, 78, 0.08);
}

.year-switcher {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.header-period {
  display: none;
  align-items: center;
  color: #4b6873;
  font-size: 13px;
  font-weight: 600;
}

.app-header.is-chat-mode .header-period {
  display: inline-flex;
}

.app-header.is-chat-mode .year-switcher {
  display: none;
}

.user-avatar {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #4b6873;
  color: #ffffff;
  box-shadow: 0 5px 14px rgba(49, 70, 78, 0.14);
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.user-menu-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 230px;
  gap: 6px;
  padding: 20px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(49, 70, 78, 0.16);
}

.user-menu[hidden] {
  display: none;
}

.user-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.user-menu-icon {
  width: 16px;
  flex: 0 0 16px;
  color: var(--ai-deep);
  font-size: 19px;
  line-height: 1;
  text-align: center;
}

.user-menu .user-menu-reset {
  margin-top: 4px;
}

.user-menu button:hover {
  background: #e8f0f1;
  color: #164463;
  transform: translateX(2px);
}

body.dark-mode {
  --page: #172126;
  --shell: #1b272c;
  --text: #f5f1e8;
  --muted: #b9c9ce;
  background: var(--page);
}

body.dark-mode .phone-shell,
body.dark-mode .app-header {
  background: #1b272c;
}

body.dark-mode .brand img {
  filter: brightness(0) invert(1);
}

body.dark-mode .period-option {
  color: #c6d4d8;
  opacity: 1;
}

body.dark-mode .period-option:hover,
body.dark-mode .period-option.is-active {
  color: #ffffff;
}

body.dark-mode .period-option--all {
  background: #40565e;
  color: #f5f1e8;
}

body.dark-mode .period-option--all.is-active {
  background: #b7c9cf;
  color: #1b272c;
}

body.dark-mode .financial-result {
  background: #2b3a40;
  color: #b7c9cf;
}

body.dark-mode .financial-result strong {
  color: #dce6e6;
}

body.dark-mode .user-menu {
  background: #243238;
  box-shadow: 0 10px 30px rgba(5, 12, 15, 0.38);
}

body.dark-mode .user-menu button:hover {
  background: #2f454d;
  color: #f5f1e8;
}

body.dark-mode .bottom-nav {
  background: rgba(28, 42, 48, 0.97);
  box-shadow: 0 16px 42px rgba(5, 12, 15, 0.42);
}

body.dark-mode .bottom-nav button {
  color: #c6d4d8;
}

body.dark-mode .bottom-nav button:hover {
  background: #2f454d;
  color: #ffffff;
}

body.dark-mode .bottom-nav button.is-active {
  color: #ffffff;
}

body.dark-mode .document-type-line,
body.dark-mode .document-type-icon {
  color: #c6d4d8;
}

body.dark-mode .document-card-primary h3 {
  color: #ffffff;
}

body.dark-mode .document-supplier {
  color: #c6d4d8;
}

body.dark-mode .document-id-kicker {
  color: #b9c9ce;
}

body.dark-mode .document-card-financial span {
  color: #c6d4d8;
}

body.dark-mode .document-card-financial .document-vat {
  color: #b9c9ce;
}

body.dark-mode .app-header.is-scrolling::after {
  background: linear-gradient(to bottom, rgba(27, 39, 44, 0.9), rgba(27, 39, 44, 0));
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 80;
  align-self: start;
}

.year-option {
  display: none;
  min-width: 0;
  height: 38px;
  padding: 0 13px;
  border: 0;
  border-radius: 11px;
  background: #4b6873;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
}

.year-option.is-active {
  display: block;
  color: #ffffff;
}

.year-option.is-active:hover {
  background: #34434a;
}

.year-modal[hidden] {
  display: none;
}

.year-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
}

.year-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(51, 47, 39, 0.22);
}

.year-modal-card {
  width: min(86vw, 300px);
  position: relative;
  padding: 22px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.year-modal-card h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.calendar-icon {
  width: 23px;
  height: 23px;
  display: block;
  color: #4b6873;
}

.year-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
}

.year-modal-options {
  display: grid;
  gap: 8px;
  max-width: 100%;
  max-height: 220px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 4px;
}

.year-modal-options button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: var(--blue-soft);
  color: #4b6873;
  font-size: 15px;
  font-weight: 600;
}

.year-modal-options button:hover {
  background: #b7c9cf;
  color: var(--text);
}

.year-modal-options button.is-selected {
  background: #4b6873;
  color: #ffffff;
}

.icon-button::before {
  content: none;
  display: none;
}

.header-avatar {
  width: 20px;
  height: 20px;
  display: block;
  margin: 0 auto;
}

.todo-bell {
  position: relative;
  display: inline-flex;
}

.todo-bell > span {
  min-width: 14px;
  height: 14px;
  position: absolute;
  top: -7px;
  right: -8px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #E87979;
  color: #ffffff;
  font-size: 8px;
  font-weight: 700;
}

.icon-button span {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #E87979;
  color: #f9f4ea;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 3px 9px rgba(86, 48, 45, 0.2);
}

.app-main {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 20px 128px;
}

.view-title {
  display: grid;
  gap: 7px;
  margin-bottom: 22px;
}

.view-back-button {
  width: fit-content;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
  padding: 0 8px 0 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ai-deep);
  font-size: 12px;
  font-weight: 600;
}

.view-back-button svg {
  width: 18px;
  height: 18px;
}

.view-back-button:hover {
  background: var(--blue-soft);
}

.view-title.is-hidden {
  display: none;
}

.view-title p,
.view-title h1 {
  margin: 0;
}

.chat-view-title h1 {
  text-align: center;
}

.chat-view-title .view-back-button {
  justify-self: start;
}

.chat-title-rita {
  display: flex;
  justify-content: center;
  min-height: 44px;
}

.ai-title-rita {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.view-title p {
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.view-title .ai-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ai-deep);
}

.view-title h1 {
  color: var(--text);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.content-stack {
  display: grid;
  gap: 18px;
}

.card,
.status-card,
.notification-card,
.document-card,
.chat-message {
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(49, 70, 78, 0.075);
}

.document-card--income {
  background: rgba(98, 201, 137, 0.1);
}

.document-card--expense {
  background: rgba(232, 121, 121, 0.1);
}

.document-card {
  width: calc(100% - 32px);
  margin-inline: auto;
  box-shadow: none;
}

.card {
  padding: 19px;
}

.recent-documents-section {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.document-feed {
  min-width: 0;
}

.documents-section-heading {
  width: calc(100% - 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -8px auto 12px;
}

.documents-section-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 300;
  letter-spacing: -0.02em;
}

.documents-section-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.document-sort-button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--ai-deep);
  font-size: 10.5px;
  font-weight: 600;
}

.document-sort-button svg {
  width: 16px;
  height: 16px;
}

.document-add-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: #123b59;
  color: #fff;
  box-shadow: none;
  font-size: 25px;
  font-weight: 500;
  line-height: 1;
}

.document-add-button span {
  display: block;
  transform: translateY(3px);
}

.document-add-button:hover,
.document-add-button:focus-visible {
  background: #0d2f49;
  color: #fff;
}

.sort-modal-card h2 {
  margin: 0 0 16px;
}

.sort-modal-title-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  color: #4b6873;
}

.feed-loader {
  margin-top: 18px;
  padding: 20px 0 24px;
  color: var(--soft);
  font-size: 12px;
  text-align: center;
  animation: feed-loader-pulse 1.8s ease-in-out infinite !important;
}

@keyframes feed-loader-pulse {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 0.9; transform: translateY(3px); }
}

.card-header,
.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.card h2,
.card h3,
.status-card h2,
.notification-card h3,
.document-card h3 {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.card h2,
.status-card h2 {
  font-size: 17px;
}

.card h3,
.notification-card h3,
.document-card h3 {
  font-size: 14px;
}

.card p,
.status-card p,
.notification-card p,
.document-card p,
.chat-message p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.58;
  white-space: pre-wrap;
}

.card p:last-child,
.status-card p:last-child,
.notification-card p:last-child,
.document-card p:last-child,
.chat-message p:last-child {
  margin-bottom: 0;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.status-card {
  min-height: 120px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  gap: 14px;
}

.status-card span,
.field-label {
  color: var(--soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.status-card strong {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
}

.period-lane {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: -13px -4px 8px;
  padding: 3px 4px 4px;
  overflow: hidden;
}

.financial-summary {
  min-width: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.period-scroll {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 4px;
  padding-bottom: 2px;
  overflow-x: hidden;
  overflow-y: hidden;
}

.period-scroll::after {
  content: "";
  width: 6px;
  height: 6px;
  position: absolute;
  left: var(--indicator-position);
  bottom: 0;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
  transition: left 260ms ease-out;
}

.period-scroll.performance-positive::after {
  background: #62C989;
}

.period-scroll.performance-negative::after {
  background: #E87979;
}

.summary-footer-note {
  width: calc(100% - 32px);
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin: 10px auto 0;
  padding-top: 0;
  text-transform: none;
  letter-spacing: 0;
}

.plan-deviation {
  border-radius: 12px;
}

.inline-margin {
  position: absolute;
  top: 16px;
  right: 15px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: #4b6873;
}

.inline-margin span {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.inline-margin b {
  font-size: 13px;
  font-weight: 700;
}

.gpm-value.is-positive {
  color: #62C989;
}

.gpm-value.is-negative {
  color: #E87979;
}

.plan-deviation {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  background: transparent;
}

.deviation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.deviation-heading {
  color: #4b6873;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.deviation-heading span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.deviation-heading strong {
  color: #4b6873 !important;
  font-size: 14px;
}

.compliance-percent.is-below {
  color: #E87979;
}

.compliance-percent.is-above {
  color: #62C989;
}

.deviation-icon {
  width: 14px;
  height: 14px;
}

.deviation-track {
  height: 18px;
  position: relative;
  margin: 14px 0 4px;
  border-radius: 6px;
  background: rgba(183, 201, 207, 0.1);
}

.deviation-center {
  width: 1px;
  height: 24px;
  position: absolute;
  top: -3px;
  left: 50%;
  background: var(--ai-deep);
  opacity: 0.55;
}

.deviation-fill {
  height: 100%;
  position: absolute;
  top: 0;
  width: var(--deviation-width);
  border-radius: 6px;
  animation: compliance-fill 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.deviation-fill.is-below {
  left: calc(50% - var(--deviation-width));
  background: #E87979;
  border-radius: 6px 0 0 6px;
  transform-origin: right center;
}

.deviation-fill.is-above {
  left: 50%;
  background: #62C989;
  border-radius: 0 6px 6px 0;
  transform-origin: left center;
}

.audit-ai-button {
  min-height: 40px;
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  margin: 18px auto 0;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--ai-soft);
  color: var(--ai-deep);
  font-size: 12px;
  font-weight: 700;
}

.audit-ai-button:hover {
  background: var(--ai);
  color: #fff;
}

.audit-ai-icon {
  width: 24px;
  height: 24px;
}

@keyframes compliance-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.period-option {
  min-width: 0;
  min-height: 40px;
  padding: 0 2px 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #4b6873;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  position: relative;
  opacity: 0.8;
}

.period-option:hover {
  color: #34434a;
}

.period-option.is-active {
  background: transparent;
  color: #34434a;
  opacity: 1;
}

.period-option--all {
  height: 24px;
  min-height: 24px;
  line-height: 24px;
  align-self: center;
  margin-left: 4px;
  padding: 0;
  border-radius: 8px;
  background: var(--ai-soft);
  color: var(--ai-deep);
  opacity: 1;
  transform: translateY(-2px);
}

.period-option--all.is-active {
  background: var(--ai-deep);
  color: #ffffff;
}

.financial-flow {
  width: calc(100% - 32px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 1.2fr);
  align-items: center;
  gap: 10px;
}

.financial-metric,
.financial-result {
  min-width: 0;
  padding: 15px;
  border-radius: 13px;
}

.financial-metric:first-child {
  background: rgba(98, 201, 137, 0.1);
  color: #62C989;
}

.financial-metric:nth-child(2) {
  background: rgba(232, 121, 121, 0.1);
  color: #E87979;
}

.financial-metric:first-child strong {
  color: #62C989;
}

.financial-metric:nth-child(2) strong {
  color: #E87979;
}

.financial-metric strong,
.financial-result strong {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
}

.money-ticker {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.money-ticker > span {
  display: inline-block;
  max-width: none;
  white-space: nowrap;
}

.money-ticker.is-overflowing > span {
  animation: money-marquee 12s ease-in-out infinite alternate !important;
}

@keyframes money-marquee {
  0%, 16% { transform: translateX(0); }
  84%, 100% { transform: translateX(var(--money-shift)); }
}

.financial-icon {
  width: 15px;
  height: 15px;
  display: block;
  margin-bottom: 8px;
}

.financial-result {
  position: relative;
  background: var(--blue-soft);
  color: #4b6873;
}

.financial-result strong {
  color: #4b6873;
}

.summary-footer-note strong {
  color: var(--ai-deep);
  font-size: 16px;
  font-weight: 700;
}

.trend {
  width: fit-content;
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 9px;
  padding: 0 9px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 10.5px;
  font-weight: 600;
  box-shadow: 0 4px 11px rgba(49, 70, 78, 0.055);
}

.trend-good,
.badge-good {
  color: #62C989;
  background: var(--green-soft);
}

.trend-watch,
.badge-watch {
  color: #5f737a;
  background: var(--amber-soft);
}

.trend-bad,
.badge-risk {
  color: #784c48;
  background: var(--red-soft);
}

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

.progress-line {
  height: 7px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface-muted);
}

.progress-line span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--blue);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quick-action {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
}

.quick-action.is-ai {
  background: var(--ai-soft);
  color: var(--ai-deep);
}

.quick-action.is-ai:hover {
  background: #cfdee6;
}

.quick-action-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.action-button,
.secondary-button,
.chip,
.chat-form button {
  min-height: 43px;
  border: 0;
  border-radius: var(--control-radius);
  padding: 0 14px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 5px 14px rgba(49, 70, 78, 0.075);
  transition: background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.action-button,
.chat-form button {
  background: var(--accent);
  color: #ffffff;
}

.action-button:hover,
.chat-form button:hover {
  background: var(--blue);
}

.secondary-button:hover,
.chip:hover {
  background: var(--surface-muted);
  box-shadow: 0 7px 18px rgba(49, 70, 78, 0.1);
}

.action-button:active,
.secondary-button:active,
.chip:active,
.chat-form button:active,
.bottom-nav button:active {
  transform: translateY(1px);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.chat-suggestions .chip-row {
  justify-content: center;
}

.chip {
  min-height: 35px;
  padding: 0 12px;
  font-size: 11.5px;
}

.ai-query-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ai-deep);
  background: var(--ai-soft);
  box-shadow: 0 4px 12px rgba(63, 98, 118, 0.08);
}

.ai-query-chip:hover {
  background: #cfdee6;
}

.notification-list,
.document-list,
.chat-list {
  display: grid;
  gap: 13px;
}

.notification-card,
.document-card {
  padding: 12px;
}

.document-card-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 18px;
  min-height: 70px;
  align-items: start;
}

.document-card-primary {
  min-width: 0;
}

.document-type-line {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ai-deep);
  font-size: 11px;
  font-weight: 600;
}

.document-type-line strong {
  font-size: 11px;
  font-weight: 600;
}

.document-card-primary h3 {
  display: block;
  margin: 7px 0 0;
  overflow: hidden;
  color: #34434a;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-supplier {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #4b6873;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-card-financial {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0;
  padding-top: 0;
}

.document-card-financial strong {
  margin-top: 7px;
  color: #4b6873;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.document-amount-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 7px;
}

.document-amount-row strong {
  margin-top: 0;
}

.document-flow-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.document-card--income .document-flow-icon,
.document-card--income .document-card-financial strong {
  color: #62C989;
}

.document-card--expense .document-flow-icon,
.document-card--expense .document-card-financial strong {
  color: #E87979;
}

.document-card-financial span {
  color: #4b6873;
  font-size: 10.5px;
  line-height: 16px;
}

.document-card-financial .document-vat {
  margin-top: 2px;
  color: #6f858d;
  font-size: 10.5px;
  line-height: 12px;
}

.document-id-kicker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 5px;
  color: var(--soft);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.document-type-icon {
  width: 13px;
  height: 13px;
  color: var(--ai-deep);
}

.document-card-status {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  margin-left: auto;
}

.document-card-status .badge-good,
.document-card-status .badge-watch {
  min-height: 32px;
  padding-inline: 0;
  background: transparent;
  box-shadow: none;
}

.document-card-status .badge-good {
  color: #62C989;
}

.document-card-status .badge-watch {
  color: #c27600;
}

.document-confirm-button {
  min-height: 32px;
  margin-left: auto;
  color: #ffffff;
  background: #4b6873;
  box-shadow: none;
}

.document-confirm-button:hover {
  color: #ffffff;
  background: #34434a;
}

.document-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 7px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0;
}

.badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0 9px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(49, 70, 78, 0.05);
}

.badge-info {
  color: var(--muted);
  background: var(--surface-muted);
}

.ai-hint {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 9px;
  padding: 0 14px;
  color: var(--ai-deep);
  background: var(--ai-soft);
  box-shadow: 0 4px 12px rgba(63, 98, 118, 0.1);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.ai-hint-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.ai-hint > span {
  transform: translateY(2px);
}

.upload-zone {
  min-height: 190px;
  display: grid;
  gap: 14px;
  place-items: center;
  border: 0;
  border-radius: var(--radius);
  background: rgba(220, 230, 230, 0.48);
  padding: 24px;
  text-align: center;
  box-shadow: inset 0 0 28px rgba(98, 124, 132, 0.06), 0 6px 18px rgba(49, 70, 78, 0.045);
}

.upload-symbol {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 17px;
  font-weight: 600;
  box-shadow: 0 5px 14px rgba(63, 98, 118, 0.1);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

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

.field {
  min-width: 0;
  border: 0;
  border-radius: var(--control-radius);
  background: rgba(183, 201, 207, 0.32);
  padding: 12px;
  box-shadow: 0 4px 13px rgba(49, 70, 78, 0.055);
}

.document-card .field {
  background: transparent;
  box-shadow: none;
  padding: 8px;
}

.document-card .ai-hint {
  min-height: 32px;
  padding-inline: 0;
  background: transparent;
  box-shadow: none;
}

.document-card .secondary-button {
  min-height: 36px;
  margin-left: auto;
}

.field strong {
  display: block;
  margin-top: 5px;
  font-size: 12.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.chat-list {
  min-height: 300px;
  align-content: start;
}

.chat-message {
  width: fit-content;
  max-width: 90%;
  padding: 13px 14px;
}

.chat-message.user {
  justify-self: end;
  background: var(--blue-soft);
}

.chat-message.ai {
  justify-self: start;
  background: #f1f4f3;
  box-shadow: 0 7px 22px rgba(63, 98, 118, 0.09);
}

.chat-message strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 600;
}

.chat-message.ai strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ai-deep);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 14px;
}

.chat-form input,
.metadata-form input,
.metadata-form select {
  width: 100%;
  min-height: 43px;
  border: 0;
  border-radius: var(--control-radius);
  background: var(--surface-soft);
  color: var(--text);
  padding: 0 13px;
  font-size: 12.5px;
  box-shadow: 0 4px 14px rgba(49, 70, 78, 0.06);
}

.chat-form input::placeholder,
.metadata-form input::placeholder {
  color: var(--soft);
}

.metadata-form {
  display: grid;
  gap: 13px;
}

.metadata-form label {
  display: grid;
  gap: 7px;
}

.metadata-form span {
  color: var(--soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  width: min(calc(98vw - 424px), 200px);
  min-width: 200px;
  height: 64px;
  min-height: 64px;
  max-height: 64px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  transform: translateX(-50%);
  padding: 0 8px;
  overflow: visible;
  border: 0;
  border-radius: 20px;
  background: rgba(183, 201, 207, 0.94);
  box-shadow: 0 16px 42px rgba(49, 70, 78, 0.16);
  backdrop-filter: blur(20px) saturate(0.85);
  -webkit-backdrop-filter: blur(20px) saturate(0.85);
  transition: transform 500ms ease, opacity 500ms ease;
}

.nav-default-actions {
  grid-area: 1 / 1 / 2 / -1;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: opacity 220ms ease, transform 280ms ease, visibility 0s linear 0s;
}

.nav-default-actions > button[data-view="home"] {
  grid-column: 1;
}

.nav-default-actions > button[data-view="notifications"] {
  grid-column: 3;
}

.nav-default-actions > button[data-view="chat"] {
  width: calc((100% - 14px) / 3);
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  transition: left 420ms ease, transform 420ms ease, width 420ms ease !important;
}

.nav-chat-form {
  width: 100%;
  height: 64px;
  position: relative;
  grid-area: 1 / 1 / 2 / -1;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 7px;
  padding: 0 5px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-22px);
  transition: opacity 220ms ease, transform 280ms ease, visibility 0s linear 280ms;
}

.bottom-nav.is-chat-mode .nav-default-actions {
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  transform: none;
  display: block;
  position: absolute;
  inset: 0;
  z-index: 3;
  transition: none !important;
}

.bottom-nav.is-chat-mode .nav-default-actions > button[data-view="home"],
.bottom-nav.is-chat-mode .nav-default-actions > button[data-view="notifications"] {
  display: none;
}

.bottom-nav.is-chat-mode .nav-default-actions > button[data-view="chat"] {
  width: 44px;
  left: 5px;
  transform: none;
  z-index: 3;
  background: transparent !important;
  transition: left 420ms cubic-bezier(0.22, 1, 0.36, 1), transform 420ms cubic-bezier(0.22, 1, 0.36, 1), width 420ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.nav-default-actions > button[data-view="chat"] {
  transition: left 420ms cubic-bezier(0.22, 1, 0.36, 1), transform 420ms cubic-bezier(0.22, 1, 0.36, 1), width 420ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.bottom-nav.is-chat-mode .nav-default-actions > button[data-view="chat"] .nav-rita-icon {
  width: 44px;
  height: 44px;
}

.bottom-nav.is-chat-mode .nav-chat-form {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition-delay: 40ms, 40ms, 0s;
}

.bottom-nav.is-chat-mode .nav-chat-rita {
  display: none;
}

.bottom-nav.is-chat-mode .nav-chat-form {
  grid-template-columns: 50px minmax(0, 1fr);
  padding-right: 5px;
  z-index: 1;
}

.bottom-nav.is-scrolling {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(calc(100% + 24px));
}

.bottom-nav button {
  min-height: 0;
  height: 64px;
  min-height: 64px;
  max-height: 64px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: #4b6873;
  opacity: 0.78;
  transition: background-color 150ms ease, color 150ms ease, opacity 150ms ease, transform 150ms ease;
}

.bottom-nav button:hover {
  background: var(--surface-soft);
  opacity: 1;
}

.bottom-nav button.is-active {
  background: transparent;
  color: #ffffff;
  opacity: 1;
}

.nav-icon {
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
}

.nav-plus-icon {
  width: 26px;
  height: 26px;
  color: currentColor;
}

.nav-plus-placeholder {
  display: none !important;
}

.nav-plus-placeholder svg {
  width: 20px;
  height: 20px;
}

.floating-plus {
  position: fixed;
  right: 2.5vw;
  bottom: 100px;
  z-index: 66;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #123b59;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(18, 59, 89, 0.28);
}

.floating-plus svg {
  width: 20px;
  height: 20px;
}

@media (min-width: 720px) {
  .floating-plus {
    right: calc(50% - 250px);
  }
}

.nav-rita-icon {
  width: 52px;
  height: 52px;
  position: absolute;
  top: 50%;
  left: 50%;
  object-fit: contain;
  transform: translate(-50%, -50%) translateY(-4px);
  animation: rita-bar-float 3s ease-in-out infinite;
  transition: width 180ms ease, height 180ms ease, transform 180ms ease;
  box-shadow: none;
}

.bottom-nav:not(.is-chat-mode) .nav-default-actions > button[data-view="chat"] {
  box-shadow: none !important;
}

.nav-chat-rita {
  width: 44px;
  height: 44px;
  justify-self: center;
  object-fit: contain;
}

.nav-chat-input {
  width: 100%;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  resize: none;
  overflow-y: auto;
  min-width: 0;
  border: 0;
  border-radius: 13px;
  outline: 0;
  padding: 10px 52px 10px 13px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-size: 15px;
  box-shadow: inset 0 0 0 1px rgba(75, 104, 115, 0.08);
  position: relative;
  z-index: 1;
}

.bottom-nav.is-chat-mode .nav-chat-input {
  position: absolute;
  top: 11px;
  right: 50px;
  bottom: auto;
  left: 55px;
  width: auto;
  padding: 0 13px;
}

.nav-chat-input::placeholder {
  color: #6f858d;
}

.bottom-nav .nav-chat-submit {
  width: 38px;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  position: absolute;
  top: 13px;
  right: 3px;
  z-index: 2;
  display: grid;
  place-items: center;
  justify-self: unset;
  padding: 0;
  border-radius: 12px;
  background: #4b6873;
  color: #ffffff;
  opacity: 1;
  box-shadow: none;
}

.bottom-nav.is-chat-mode .nav-chat-submit {
  display: grid;
}

.nav-chat-submit svg {
  width: 20px;
  height: 20px;
}

.bottom-nav .nav-chat-submit:hover {
  background: #34434a;
}

.bottom-nav button.is-active .nav-rita-icon {
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%);
  animation: none;
}

@keyframes rita-bar-float {
  0%, 100% { transform: translate(-50%, -50%) translateY(-4px); }
  50% { transform: translate(-50%, -50%) translateY(-9px); }
}

.bottom-nav button:hover,
.bottom-nav button.is-active:hover {
  background: transparent;
}

.nav-alert-icon {
  position: relative;
  display: inline-flex;
}

.nav-alert-icon > span {
  min-width: 15px;
  height: 15px;
  position: absolute;
  top: -7px;
  right: -8px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #E87979;
  color: #ffffff;
  font-size: 8px;
  font-weight: 700;
}

.floating-rita {
  width: 64px;
  height: 64px;
  position: fixed;
  left: auto;
  right: 2.5vw !important;
  bottom: 100px;
  z-index: 65;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 18px;
  background: #123b59;
  box-shadow: none;
  animation: none;
  transform: none;
  transition: width 260ms ease, height 260ms ease, right 420ms ease, bottom 500ms ease, border-radius 260ms ease;
}

@keyframes rita-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-14px) scale(1.04); }
}

.floating-rita.is-scrolling {
  bottom: 24px;
}

.floating-rita.is-hidden {
  display: none;
}

.floating-rita.is-chat-mode {
  width: 38px;
  height: 38px;
  right: max(13px, calc((100vw - 600px) / 2 + 13px));
  bottom: 42px;
  border-radius: 12px;
  background: transparent;
  color: #4b6873;
  box-shadow: none;
  transition: none;
}

/* Rita mode uses the submit arrow as its only action. */
.floating-rita.is-chat-mode {
  display: none;
}

.floating-rita.is-chat-mode.is-scrolling {
  bottom: 42px;
}

.floating-rita.is-chat-mode:hover {
  background: transparent;
}

.floating-rita.is-chat-mode > svg {
  color: #4b6873;
}

.floating-rita > svg {
  width: 24px;
  height: 24px;
  color: #ffffff;
}

.floating-rita:hover {
  background: #123b59;
}

.floating-plus {
  position: fixed;
  left: 50%;
  bottom: 100px;
  z-index: 66;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #123b59;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(18, 59, 89, 0.28);
  transform: translateX(-50%);
}

.floating-plus svg {
  width: 26px;
  height: 26px;
}

.floating-plus {
  left: auto;
  right: 2.5vw;
  bottom: 100px;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  transform: none;
  translate: 0 0;
  transition: translate 500ms ease, opacity 500ms ease;
}

.bottom-nav > .floating-plus {
  position: absolute;
  top: auto;
  right: 0;
  bottom: calc(100% + 8px);
  left: auto;
  transform: none;
  transition: none;
}

.app-header.is-scrolling {
  height: auto !important;
  min-height: 82px !important;
  padding-top: 14px !important;
  padding-bottom: 14px !important;
  overflow: visible !important;
  opacity: 1 !important;
  transform: none !important;
}

.bottom-nav.is-scrolling {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateX(-50%) translateY(calc(100% + 24px)) !important;
}

.floating-plus.is-scrolling {
  bottom: 100px;
  translate: 0 88px;
}

.floating-plus svg {
  width: 20px;
  height: 20px;
}

@media (min-width: 720px) {
  .floating-plus {
    right: calc(50% - 250px) !important;
  }
}

@keyframes rita-float-bounce {
  0%, 82%, 100% { transform: translateY(0); }
  86% { transform: translateY(-8px); }
  90% { transform: translateY(0); }
  94% { transform: translateY(-4px); }
}

.bottom-nav strong {
  display: none;
  margin: 0;
  color: currentColor;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 70;
  width: min(420px, calc(100vw - 32px));
  transform: translateX(-50%) translateY(16px);
  border: 0;
  border-radius: 12px;
  background: #34434a;
  color: #ffffff;
  padding: 13px 15px;
  box-shadow: 0 14px 38px rgba(49, 70, 78, 0.2);
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 720px) {
  body {
    padding: 24px 0;
  }

  .phone-shell {
    height: calc(100vh - 48px);
    max-height: calc(100vh - 48px);
    min-height: 0;
    overflow: hidden;
    border: 0;
    border-radius: 26px;
  }

  .bottom-nav {
    bottom: 28px;
  }
}

.bottom-nav:not(.is-chat-mode) .nav-default-actions > button[data-view="chat"] {
  position: relative;
  z-index: 3;
  width: 64px;
  height: 64px;
  min-height: 64px;
  border-radius: 18px;
  transform: translateY(-28px);
  box-shadow: 0 8px 18px rgba(18, 59, 89, 0.28);
}

@media (max-width: 719px) {
  .bottom-nav:not(.is-chat-mode) .nav-default-actions > button[data-view="chat"] {
    left: 50%;
    transform: translate(-50%, -28px);
  }
}

@media (max-width: 719px) {
  .bottom-nav,
  .bottom-nav.is-chat-mode {
    left: 50% !important;
    width: 95vw;
    min-width: 0;
    max-width: 95vw;
    transform: translateX(-50%);
  }
}

@media (max-width: 420px) {
  .app-header {
    grid-template-columns: 118px 1fr 42px;
    gap: 12px;
    padding-inline: 16px;
  }

  .brand {
    width: 86px;
    height: 30px;
  }

  .app-main {
    padding: 4px 16px 124px;
  }

  .status-grid {
    gap: 10px;
  }

  .status-card {
    min-height: 116px;
    padding: 14px;
  }

  .status-card strong {
    font-size: clamp(18px, 5.4vw, 21px);
  }

  .bottom-nav {
    width: 200px;
    gap: 4px;
    padding: 0 7px;
  }

  .bottom-nav button {
    min-width: 0;
    min-height: 64px;
    height: 64px;
    max-height: 64px;
    gap: 5px;
    padding-inline: 7px;
  }

  .nav-icon {
    width: 21px;
    height: 21px;
  }

  .bottom-nav strong {
    font-size: 10.5px;
  }
}

.bottom-nav.is-chat-mode {
  width: min(calc(98vw - 24px), 600px);
}

@media (max-width: 340px) {
  .header-copy span {
    display: none;
  }

  .quick-actions,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .bottom-nav strong {
    display: none;
  }
}

@media (max-width: 560px) {
  .period-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 3px;
  }

  .period-option {
    flex: 0 0 auto;
    min-width: 48px;
    padding-inline: 10px;
    font-size: 15px;
  }

  .financial-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .financial-flow .financial-metric:nth-child(1) {
    grid-column: 1;
  }

  .financial-flow .financial-metric:nth-child(3) {
    grid-column: 2;
  }

  .financial-result {
    grid-column: 1 / -1;
  }
}

/* Motion is temporarily disabled during layout tuning. */
*,
*::before,
*::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

.nav-rita-icon {
  animation: rita-bar-float 3s ease-in-out infinite !important;
}

.bottom-nav button.is-active .nav-rita-icon {
  animation: none !important;
}

.nav-default-actions {
  transition: opacity 220ms ease, transform 280ms ease, visibility 0s linear 0s !important;
}

.nav-chat-form {
  transition: opacity 220ms ease, transform 280ms ease, visibility 0s linear 280ms !important;
}

/* Final mobile override: keep the navigation centered in the viewport. */
@media (max-width: 719px) {
  .bottom-nav {
    position: fixed !important;
    left: 2.5vw !important;
    right: 2.5vw !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    transform: none !important;
  }

  .bottom-nav.is-scrolling {
    transform: translateY(calc(100% + 24px)) !important;
  }
}

/* Keep the plus attached to the menu so it follows the menu movement exactly. */
.bottom-nav > .floating-plus {
  position: absolute !important;
  top: auto !important;
  right: 0 !important;
  bottom: calc(100% + 8px) !important;
  left: auto !important;
  transform: none !important;
  transition: none !important;
  background: #123b59 !important;
  color: #ffffff !important;
  box-shadow: none !important;
  width: 52px !important;
  height: 52px !important;
  min-height: 52px !important;
  border-radius: 15px;
}

.bottom-nav > .floating-plus svg {
  stroke: currentColor;
}

.bottom-nav.is-scrolling > .floating-plus {
  position: fixed !important;
  right: 2.5vw !important;
  bottom: 12px !important;
  left: auto !important;
  transform: none !important;
}

@media (min-width: 720px) {
  .bottom-nav.is-scrolling > .floating-plus {
    right: calc(50% - 250px) !important;
  }
}

@media (max-width: 719px) {
  .bottom-nav,
  .bottom-nav.is-chat-mode,
  .bottom-nav:not(.is-chat-mode) {
    left: 50% !important;
    right: auto !important;
    width: 95vw !important;
    min-width: 0 !important;
    max-width: 95vw !important;
    transform: translateX(-50%) !important;
  }
}

.rita-thinking-dots {
  display: none;
  position: absolute;
  top: -18px;
  left: 50%;
  align-items: center;
  gap: 3px;
  transform: translateX(-50%);
}

.rita-thinking-dots i {
  width: 6px;
  height: 6px;
  display: block;
  border-radius: 50%;
  background: #4b6873;
  animation: audit-dot-pulse 850ms ease-in-out infinite !important;
}

.rita-thinking-dots i:nth-child(2) {
  animation-delay: 140ms !important;
}

.rita-thinking-dots i:nth-child(3) {
  animation-delay: 280ms !important;
}

.bottom-nav.is-auditing .rita-thinking-dots {
  display: inline-flex;
}

@keyframes audit-dot-pulse {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0) scale(0.85); }
  30% { opacity: 1; transform: translateY(-3px) scale(1); }
}

.audit-modal-card {
  width: min(92vw, 440px);
  height: 95vh;
  max-height: 95vh;
  overflow-y: auto;
}

#auditModalContent {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.audit-rita-logo {
  width: 82px;
  height: 27px;
  display: block;
  margin-bottom: 13px;
  object-fit: contain;
  object-position: left center;
}

.audit-rita-avatar {
  width: 42px;
  height: 42px;
  display: block;
  margin-bottom: 5px;
  object-fit: contain;
}

.audit-report-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--ai-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audit-modal-card h2 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 26px;
  font-weight: 600;
}

.audit-report-summary,
.audit-report-next {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.audit-report-actions {
  position: sticky;
  bottom: -22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: auto 0 -22px;
  padding: 16px 0 22px;
  background: var(--surface);
}

.audit-action-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding-left: 20px;
}

.audit-action-list li {
  padding-left: 4px;
  color: var(--text);
}

.audit-action-list strong,
.audit-action-list span {
  display: block;
}

.audit-action-list strong {
  margin-bottom: 3px;
  font-size: 14px;
}

.audit-action-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.audit-report-next {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.audit-download-button {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 0;
  border: 0;
  border-radius: 11px;
  background: #4b6873;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.audit-share-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #4b6873;
  border-radius: 11px;
  background: transparent;
  color: #4b6873;
  font-size: 13px;
  font-weight: 700;
}

.audit-share-button svg,
.audit-download-button svg {
  width: 19px;
  height: 19px;
}

.audit-download-button svg {
  width: 19px;
  height: 19px;
}

.app-header {
  transition: transform 500ms ease, opacity 500ms ease, height 500ms ease, min-height 500ms ease, padding 500ms ease !important;
}

.app-header.is-scrolling {
  height: 0;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.period-scroll::after {
  transition: left 260ms ease-out !important;
}

.deviation-fill {
  animation: compliance-fill 700ms cubic-bezier(0.22, 1, 0.36, 1) both !important;
}

.bottom-nav {
  transition: width 450ms ease, transform 500ms ease, opacity 500ms ease !important;
}

.bottom-nav:not(.is-chat-mode) {
  left: calc((100vw - max(12px, calc((100vw - 600px) / 2)) - 64px) / 2) !important;
}

.bottom-nav.is-chat-mode {
  left: 50% !important;
}

.floating-rita {
  transition: width 260ms ease, height 260ms ease, right 420ms ease, bottom 500ms ease, border-radius 260ms ease !important;
}

.floating-rita.is-chat-mode {
  transition: width 260ms ease, height 260ms ease, right 420ms ease, bottom 500ms ease, border-radius 260ms ease !important;
}

.floating-rita {
  left: auto;
  right: 12px !important;
}

.floating-rita.is-chat-mode {
  left: auto;
  right: 12px !important;
}

.nav-chat-rita {
  opacity: 0;
  transform: translateX(clamp(95px, 30vw, 180px));
  transition: opacity 220ms ease, transform 420ms ease !important;
}

.bottom-nav.is-chat-mode .nav-chat-rita {
  opacity: 1;
  transform: translateX(0);
}

.bottom-nav:not(.is-chat-mode) .nav-rita-icon {
  width: 64px;
  height: 64px;
}

.bottom-nav:not(.is-chat-mode) button.is-active .nav-rita-icon {
  width: 70px;
  height: 70px;
}

.bottom-nav:not(.is-chat-mode) .nav-default-actions > button[data-view="chat"] {
  opacity: 1;
}

@media (min-width: 720px) {
  .bottom-nav,
  .bottom-nav.is-chat-mode {
    left: 50% !important;
    width: 500px !important;
    min-width: 500px !important;
    max-width: 500px !important;
  }

  .bottom-nav:not(.is-chat-mode) {
    left: 50% !important;
    width: 500px;
    min-width: 500px;
  }

  .bottom-nav:not(.is-chat-mode) .nav-default-actions {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .bottom-nav:not(.is-chat-mode) .nav-default-actions > button[data-view="chat"] {
    position: relative;
    grid-column: 2;
    left: auto;
    width: 70px;
    transform: none;
  }

  .bottom-nav:not(.is-chat-mode) .nav-default-actions > button[data-view="home"] {
    justify-self: center;
  }

  .bottom-nav:not(.is-chat-mode) .nav-default-actions > button[data-view="notifications"] {
    justify-self: center;
  }

  .bottom-nav:not(.is-chat-mode) strong {
    display: none;
  }

  .floating-rita,
  .floating-rita.is-chat-mode {
    left: calc(50% + 170px) !important;
    right: auto !important;
    transform: none;
  }
}

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

/* Keep the navbar-to-Rita transition enabled while other motion stays off. */
.nav-default-actions {
  transition: opacity 220ms ease, transform 280ms ease, visibility 0s linear 0s !important;
}

.nav-chat-form {
  transition: opacity 220ms ease, transform 280ms ease, visibility 0s linear 280ms !important;
}

/* Definitive small-screen alignment. */
@media (max-width: 719px) {
  .bottom-nav:not(.is-scrolling) {
    left: 2.5vw !important;
    right: 2.5vw !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    transform: none !important;
  }
}

/* Final mobile override: keep the navigation centered in the viewport. */
@media (max-width: 719px) {
  .bottom-nav:not(.is-scrolling) {
    position: fixed !important;
    left: 2.5vw !important;
    right: 2.5vw !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    transform: none !important;
  }
}

/* Keep the plus synchronized with the navbar's vertical hide/show transition. */
.floating-plus {
  animation: none !important;
  translate: none !important;
  transform: translateY(0) !important;
  transition: transform 500ms ease !important;
}

.floating-plus.is-scrolling {
  bottom: 100px !important;
  transform: translateY(88px) !important;
}
