:root {
  color-scheme: light;
  --navy-950: #004b71;
  --navy-900: #00567f;
  --navy-800: #08658f;
  --blue-700: #0a5c91;
  --blue-600: #146fa4;
  --blue-100: #e8f4fb;
  --blue-50: #f2f8fc;
  --green-600: #32b96b;
  --green-700: #229b56;
  --green-100: #e3f7eb;
  --amber-600: #b56608;
  --amber-100: #fff0c7;
  --red-600: #a52739;
  --red-100: #ffe8eb;
  --ink-900: #263746;
  --ink-700: #465d70;
  --ink-500: #63798a;
  --line: #d8dfe5;
  --line-strong: #bdc9d2;
  --surface: #ffffff;
  --canvas: #f3f5f6;
  --shadow: 0 5px 14px rgba(0, 75, 113, 0.07);
  --radius: 7px;
  font-family: Arial, Helvetica, ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
}

* {
  box-sizing: border-box;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink-900);
  line-height: 1.5;
}

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

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

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

button {
  color: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--navy-950);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 52, 78, 0.2);
}

.header-shell {
  width: min(940px, calc(100% - 2rem));
  min-height: 62px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.3rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: max-content;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.015em;
}

.brand-mark {
  width: 27px;
  height: 31px;
  color: #6dd39a;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.main-nav {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  align-self: stretch;
}

.main-nav a {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0 0.58rem;
  color: #d9e8ec;
  font-size: 0.82rem;
  font-weight: 650;
}

.main-nav a::after {
  position: absolute;
  right: 0.72rem;
  bottom: 0;
  left: 0.72rem;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #54d6a0;
  content: "";
  opacity: 0;
  transform: scaleX(0.5);
  transition: 160ms ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: white;
}

.main-nav a.active::after {
  opacity: 1;
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-left: auto;
}

.role-switch {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.38rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  cursor: pointer;
}

.role-switch:hover {
  background: rgba(255, 255, 255, 0.14);
}

.role-label {
  color: #a9c2ca;
  font-size: 0.68rem;
  line-height: 1.1;
}

.workflow-label {
  display: inline-flex;
  margin-bottom: 0.75rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: #ffedb1;
  color: #6b4700;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.role-switch strong {
  font-size: 0.74rem;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.text-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  padding: 0.72rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.primary-button {
  background: var(--green-600);
  color: white;
  box-shadow: 0 2px 5px rgba(25, 122, 68, 0.16);
}

.primary-button:hover {
  background: var(--green-700);
  transform: translateY(-1px);
}

.primary-button.compact {
  min-height: 42px;
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
}

.secondary-button {
  border-color: var(--blue-600);
  background: white;
  color: var(--blue-700);
}

.secondary-button:hover {
  background: var(--blue-50);
}

.danger-button {
  background: var(--red-100);
  color: var(--red-600);
}

.ghost-button {
  border-color: var(--line);
  background: white;
  color: var(--ink-700);
}

.ghost-button:hover {
  border-color: var(--line-strong);
  background: #f9fbfb;
}

.text-button {
  min-height: auto;
  padding: 0.35rem 0;
  border: 0;
  background: transparent;
  color: var(--blue-700);
}

.profile-button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: #176b87;
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.mobile-menu,
.mobile-nav {
  display: none;
}

.mobile-role-button {
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(84, 214, 160, 0.12);
  color: white;
  text-align: left;
  font-weight: 750;
  cursor: pointer;
}

.app-main {
  width: min(920px, calc(100% - 2rem));
  min-height: calc(100vh - 220px);
  margin: 0 auto;
  padding: 1.15rem 0 3.5rem;
  outline: none;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--blue-700);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 1rem;
  font-size: 1.17rem;
  line-height: 1.25;
}

h3 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.page-subtitle {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--ink-500);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card,
.panel,
.transaction-card,
.info-card,
.wizard-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 52, 78, 0.035);
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 1.15rem 1.2rem;
}

.stat-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--blue-600);
  content: "";
}

.stat-card.alert::before {
  background: #e5a223;
}

.stat-card.success::before {
  background: var(--green-600);
}

.stat-label {
  display: block;
  margin-bottom: 0.38rem;
  color: var(--ink-500);
  font-size: 0.82rem;
  font-weight: 700;
}

.stat-value {
  display: block;
  font-size: 1.65rem;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.stat-note {
  color: var(--ink-500);
  font-size: 0.78rem;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  margin-bottom: 1rem;
}

.tabs {
  display: inline-flex;
  gap: 0.3rem;
  padding: 0.25rem;
  border-radius: 5px;
  background: #eef3f4;
}

.tab-button {
  min-height: 38px;
  padding: 0.45rem 0.8rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-500);
  font-size: 0.86rem;
  font-weight: 750;
  cursor: pointer;
}

.tab-button.active {
  background: white;
  color: var(--ink-900);
  box-shadow: 0 2px 9px rgba(6, 43, 59, 0.08);
}

.search-field {
  position: relative;
  flex: 1;
  margin-left: auto;
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 0.9rem;
  width: 18px;
  color: var(--ink-500);
  transform: translateY(-50%);
}

.search-field input {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.8rem 0.65rem 2.6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fbfcfc;
  color: var(--ink-900);
}

.transaction-list {
  display: grid;
  gap: 0.85rem;
}

.transaction-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(170px, 0.8fr) minmax(155px, 0.6fr) 130px;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 1.2rem;
  cursor: pointer;
  transition: transform 140ms ease, border 140ms ease, box-shadow 140ms ease;
}

.transaction-card:hover {
  border-color: #9fc5d0;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.transaction-title {
  margin-bottom: 0.2rem;
  font-weight: 800;
}

.transaction-meta,
.muted {
  color: var(--ink-500);
  font-size: 0.84rem;
}

.role-chip,
.status-chip,
.type-chip {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 28px;
  padding: 0.25rem 0.62rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 750;
}

.role-chip {
  margin-bottom: 0.35rem;
  background: var(--blue-100);
  color: var(--blue-700);
}

.status-chip {
  background: var(--amber-100);
  color: #755000;
}

.status-chip.action {
  background: var(--red-100);
  color: var(--red-600);
}

.status-chip.complete {
  background: var(--green-100);
  color: var(--green-700);
}

.status-chip.canceled {
  background: #eef1f2;
  color: var(--ink-500);
}

.type-chip {
  background: #eef3f4;
  color: var(--ink-700);
}

.amount {
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 2rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: white;
  color: var(--ink-500);
  text-align: center;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 0.9fr);
  gap: 0.9rem;
  align-items: start;
}

.detail-main,
.detail-aside {
  display: grid;
  gap: 0.9rem;
}

.detail-aside .panel {
  background: #eef8fc;
}

.notice {
  display: flex;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid #77b4c5;
  border-radius: 6px;
  background: #fbfdff;
}

.notice-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--blue-100);
  color: var(--blue-700);
  font-weight: 900;
}

.notice strong {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--blue-700);
}

.notice p {
  margin-bottom: 0;
  color: var(--ink-700);
  font-size: 0.88rem;
}

.panel {
  padding: 1.2rem 1.35rem;
}

.transaction-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.transaction-heading h1 {
  margin-bottom: 0.2rem;
  font-size: 1.65rem;
}

.copy-button {
  min-height: 34px;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink-700);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.parties-line {
  margin: 0.9rem 0;
  color: var(--ink-700);
  font-size: 0.88rem;
}

.parties-line strong {
  color: var(--blue-700);
}

.stepper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 1.5rem 0;
}

.step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.42rem;
  text-align: center;
}

.step::before {
  position: absolute;
  top: 14px;
  right: 50%;
  left: -50%;
  height: 1px;
  background: var(--line);
  content: "";
  z-index: 0;
}

.step:first-child::before {
  display: none;
}

.step.complete::before,
.step.active::before {
  background: var(--blue-600);
}

.step-number {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: white;
  color: var(--ink-500);
  font-size: 0.82rem;
  font-weight: 800;
}

.step.active .step-number,
.step.complete .step-number {
  border-color: var(--blue-600);
  background: var(--blue-600);
  color: white;
}

.step.complete .step-number {
  background: var(--green-600);
  border-color: var(--green-600);
}

.step-label {
  color: var(--ink-500);
  font-size: 0.75rem;
  font-weight: 700;
}

.step.active .step-label,
.step.complete .step-label {
  color: var(--ink-900);
}

.action-box {
  padding: 1.15rem;
  border: 1px solid #8dbdca;
  border-radius: 6px;
  background: #fbfdff;
}

.action-box h2 {
  margin-bottom: 0.4rem;
  color: var(--blue-700);
}

.action-box p {
  margin-bottom: 0.9rem;
  color: var(--ink-700);
  font-size: 0.9rem;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
  color: var(--blue-700);
}

.section-title .icon-tile {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  background: var(--blue-100);
  font-size: 0.82rem;
}

.detail-row,
.money-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
}

.detail-row dt,
.money-row span:first-child {
  color: var(--ink-500);
}

.detail-row dd {
  margin: 0;
  text-align: right;
}

.item-summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.item-summary p {
  margin-bottom: 0;
  color: var(--ink-700);
  white-space: pre-line;
}

.money-list {
  display: grid;
  gap: 0.2rem;
}

.money-row.total {
  margin-top: 0.5rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  font-weight: 850;
}

.timeline {
  position: relative;
  display: grid;
  gap: 1.05rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline::before {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 6px;
  width: 2px;
  background: var(--line);
  content: "";
}

.timeline li {
  position: relative;
  padding-left: 1.5rem;
}

.timeline li::before {
  position: absolute;
  top: 6px;
  left: 1px;
  width: 12px;
  height: 12px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--blue-600);
  box-shadow: 0 0 0 1px var(--blue-600);
  content: "";
}

.timeline strong {
  display: block;
  font-size: 0.86rem;
}

.timeline time {
  color: var(--ink-500);
  font-size: 0.75rem;
}

.faq-list {
  display: grid;
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item:last-child {
  border-bottom: 0;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0.8rem 0;
  border: 0;
  background: transparent;
  color: var(--ink-700);
  text-align: left;
  cursor: pointer;
}

.faq-question span:last-child {
  transition: transform 160ms ease;
}

.faq-item.open .faq-question span:last-child {
  transform: rotate(45deg);
}

.faq-answer {
  display: none;
  padding: 0 0 0.85rem;
  color: var(--ink-500);
  font-size: 0.84rem;
}

.faq-item.open .faq-answer {
  display: block;
}

.cancel-row {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0;
}

.cancel-link {
  border: 0;
  background: transparent;
  color: var(--red-600);
  font-weight: 750;
  cursor: pointer;
}

.wizard-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.wizard-nav {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 0.45rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.wizard-nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem;
  border-radius: 10px;
  color: var(--ink-500);
  font-size: 0.84rem;
  font-weight: 700;
}

.wizard-nav-item.active {
  background: var(--blue-100);
  color: var(--blue-700);
}

.wizard-nav-number {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.72rem;
}

.wizard-card {
  padding: clamp(1.2rem, 4vw, 2rem);
}

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

.form-field {
  display: grid;
  gap: 0.42rem;
}

.plain-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label,
.fieldset-label {
  color: var(--ink-700);
  font-size: 0.84rem;
  font-weight: 750;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.72rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: white;
  color: var(--ink-900);
  outline: none;
}

.form-field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-500) 50%), linear-gradient(135deg, var(--ink-500) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 2.4rem;
}

.form-field textarea {
  min-height: 100px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.search-field input:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(25, 131, 165, 0.13);
}

.helper {
  color: var(--ink-500);
  font-size: 0.76rem;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.option-card {
  position: relative;
  display: flex;
  gap: 0.75rem;
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  cursor: pointer;
}

.option-card:has(input:checked) {
  border-color: var(--blue-600);
  background: var(--blue-50);
  box-shadow: inset 0 0 0 1px var(--blue-600);
}

.option-card input {
  margin-top: 0.2rem;
  accent-color: var(--blue-600);
}

.option-card strong,
.option-card small {
  display: block;
}

.option-card small {
  margin-top: 0.15rem;
  color: var(--ink-500);
}

.check-row {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.85rem 0;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 0.18rem;
  accent-color: var(--green-600);
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.review-box {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfcfc;
}

.review-section {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.review-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.review-section dt {
  color: var(--ink-500);
  font-size: 0.82rem;
}

.review-section dd {
  margin: 0;
  font-weight: 700;
  white-space: pre-line;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.info-card {
  padding: 1.2rem;
}

.info-card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 0.9rem;
  border-radius: 12px;
  background: var(--blue-100);
  color: var(--blue-700);
  font-weight: 850;
}

.info-card p {
  color: var(--ink-500);
  font-size: 0.88rem;
}

.progress-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef0;
}

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

.checklist {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.check-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-700);
  font-weight: 900;
}

.check-icon.pending {
  background: var(--amber-100);
  color: var(--amber-600);
}

.checklist-item button {
  margin-left: auto;
}

.integration-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.security-note {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: #f2f6f7;
  color: var(--ink-700);
  font-size: 0.84rem;
}

.help-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr);
  gap: 1rem;
  align-items: start;
}

.help-search {
  padding: 1.4rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--navy-900), var(--blue-700));
  color: white;
}

.help-search input {
  width: 100%;
  min-height: 50px;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: 4px;
  outline: none;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--ink-500);
  font-size: 0.78rem;
}

.app-footer div {
  display: grid;
}

.app-footer strong {
  color: var(--ink-900);
}

.app-footer p {
  max-width: 540px;
  margin-bottom: 0;
  text-align: right;
}

.footer-disclosure {
  display: grid;
  justify-items: end;
  max-width: 640px;
}

.footer-disclosure .text-button {
  font-size: 0.78rem;
}

.toast-region {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 80;
  display: grid;
  gap: 0.6rem;
  width: min(360px, calc(100% - 2rem));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  border: 1px solid #8ab9c6;
  border-radius: 12px;
  background: var(--navy-950);
  color: white;
  box-shadow: 0 16px 40px rgba(6, 43, 59, 0.24);
  animation: toast-in 180ms ease both;
}

.toast::before {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: var(--green-600);
  content: "✓";
  font-size: 0.75rem;
  font-weight: 900;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .main-nav,
  .role-switch,
  .header-actions > .primary-button {
    display: none;
  }

  .mobile-menu {
    display: grid;
    place-content: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
  }

  .mobile-menu span {
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: white;
  }

  .mobile-nav.open {
    display: grid;
    gap: 0.35rem;
    padding: 0.8rem 1rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .mobile-nav a {
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
  }

  .transaction-card {
    grid-template-columns: minmax(0, 1.3fr) minmax(160px, 0.7fr) 120px;
  }

  .transaction-card .transaction-type {
    display: none;
  }

  .detail-grid,
  .help-layout {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 720px) {
  .header-shell,
  .app-main,
  .app-footer {
    width: min(100% - 1.2rem, 1120px);
  }

  .header-shell {
    min-height: 64px;
  }

  .profile-button {
    width: 38px;
    height: 38px;
  }

  .app-main {
    padding-top: 1.2rem;
  }

  .page-header,
  .toolbar,
  .app-footer {
    flex-direction: column;
  }

  .page-header .primary-button {
    width: 100%;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: stretch;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .search-field {
    width: 100%;
    margin-left: 0;
  }

  .transaction-card {
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
  }

  .transaction-card .transaction-role {
    display: none;
  }

  .transaction-card .amount {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .detail-aside,
  .feature-grid,
  .form-grid,
  .option-grid {
    grid-template-columns: 1fr;
  }

  .stepper {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .step {
    grid-template-columns: 36px 1fr;
    justify-items: start;
    align-items: center;
    text-align: left;
  }

  .step::before {
    top: -50%;
    right: auto;
    bottom: 50%;
    left: 17px;
    width: 2px;
    height: auto;
  }

  .wizard-shell {
    grid-template-columns: 1fr;
  }

  .wizard-nav {
    position: static;
    grid-template-columns: repeat(4, 1fr);
    overflow-x: auto;
  }

  .wizard-nav-item {
    justify-content: center;
    padding: 0.55rem;
  }

  .wizard-nav-item span:last-child {
    display: none;
  }

  .review-section {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .item-summary {
    flex-direction: column;
  }

  .item-summary .amount {
    text-align: left;
  }

  .app-footer p {
    text-align: left;
  }

  .footer-disclosure {
    justify-items: start;
  }
}

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