:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-soft: #fbfbfd;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(29, 29, 31, 0.1);
  --accent: #0066cc;
  --accent-2: #30b0c7;
  --accent-soft: #eaf4ff;
  --warn-soft: #fff4df;
  --shadow: 0 24px 70px rgba(29, 29, 31, 0.08);
  --shadow-soft: 0 12px 34px rgba(29, 29, 31, 0.06);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #ffffff 0%, #f5f5f7 280px, #f5f5f7 100%);
  color: var(--ink);
  min-height: 100vh;
}

html {
  scroll-behavior: smooth;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  align-items: center;
  backdrop-filter: saturate(180%) blur(18px);
  background: rgba(245, 245, 247, 0.78);
  border-bottom: 1px solid rgba(29, 29, 31, 0.06);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin: 0;
  padding: 14px max(24px, calc((100vw - 1440px) / 2 + 24px));
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar h1,
.content h2,
.panel h2 {
  letter-spacing: 0;
  margin: 0;
}

.topbar h1 {
  font-size: clamp(1.05rem, 1.4vw, 1.26rem);
  font-weight: 760;
  line-height: 1.12;
  max-width: 780px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  margin: 0 0 7px;
  text-transform: uppercase;
}

.top-actions {
  align-items: end;
  display: grid;
  flex: 0 0 auto;
  gap: 10px;
  justify-items: end;
}

.nav-links {
  display: flex;
  gap: 22px;
  padding: 0;
}

.nav-links a {
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  padding: 8px 0;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease;
  white-space: nowrap;
}

.nav-links a.active,
.nav-links a:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.nav-links a:focus-visible {
  border-radius: 4px;
  outline: 2px solid rgba(0, 102, 204, 0.22);
  outline-offset: 5px;
}

.workspace {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  margin: 0 auto;
  max-width: 1440px;
  padding: 28px 24px 48px;
}

.library-workspace {
  grid-template-columns: 1fr;
}

.portfolio-workspace {
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
}

.sidebar {
  align-self: start;
  display: grid;
  gap: 14px;
  position: sticky;
  top: 86px;
}

.panel,
.portfolio-output,
.card,
.table-wrap,
.cta-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.panel-intro {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.42;
  margin: -6px 0 0;
}

.cta-panel p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.bottom-cta {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 22px;
}

.bottom-cta > div {
  max-width: 680px;
}

.panel h2,
.portfolio-output h2,
.section-heading h2 {
  font-size: clamp(1.15rem, 2vw, 1.72rem);
  line-height: 1.08;
}

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

.panel-heading > div,
.section-heading > div,
.bottom-cta > div,
.portfolio-hero > div,
.portfolio-title,
.portfolio-use,
.portfolio-meta div {
  min-width: 0;
}

.segmented {
  background: rgba(118, 118, 128, 0.12);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
}

.segment {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  min-height: 38px;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.segment.active {
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.filter-block span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.field input,
.field select {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  min-height: 42px;
  outline: none;
  padding: 10px 11px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
  width: 100%;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.12);
}

.filter-block {
  display: grid;
  gap: 8px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 7px 10px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.spend-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.checkbox-field {
  align-items: start;
  color: var(--muted);
  display: flex;
  gap: 9px;
  line-height: 1.35;
}

.checkbox-field input {
  margin-top: 3px;
}

.primary-button,
.secondary-button,
.ghost-button {
  border-radius: var(--radius);
  min-height: 40px;
  padding: 9px 14px;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.primary-button {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  font-weight: 760;
}

.primary-link {
  align-items: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: #fff;
  display: inline-flex;
  font-weight: 750;
  justify-content: center;
  min-height: 42px;
  padding: 10px 12px;
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.secondary-button,
.ghost-button {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  color: var(--ink);
}

.ghost-button {
  min-height: 34px;
}

.compact-action {
  flex: 0 0 auto;
  min-width: 132px;
}

.primary-button:hover,
.primary-link:hover,
.secondary-button:hover,
.ghost-button:hover,
.chip:hover,
.segment:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.content {
  display: grid;
  gap: 24px;
  min-width: 0;
}

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

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.metric b {
  display: block;
  font-size: 1.5rem;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 0.8rem;
  margin-top: 7px;
}

.portfolio-output {
  display: grid;
  gap: 24px;
  overflow: hidden;
  padding: clamp(22px, 4vw, 42px);
}

.portfolio-output p,
.portfolio-output details {
  color: var(--muted);
  margin: 0;
}

.portfolio-hero {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding-bottom: 18px;
}

.portfolio-hero h2 {
  font-size: clamp(2rem, 4.3vw, 4.1rem);
  line-height: 0.98;
}

.portfolio-hero > p {
  color: var(--muted);
  flex: 1 1 auto;
  line-height: 1.45;
  max-width: none;
  text-align: left;
  width: 100%;
}

.portfolio-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.portfolio-overview span {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 8px 11px;
}

.portfolio-overview strong {
  color: var(--ink);
}

.portfolio-grid {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portfolio-item {
  animation: fade-up 520ms ease both;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 13px;
  overflow: hidden;
  padding: 16px;
  position: relative;
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.portfolio-item.featured {
  border-color: rgba(0, 102, 204, 0.24);
  box-shadow: 0 22px 60px rgba(0, 102, 204, 0.08);
}

.portfolio-item:hover {
  border-color: rgba(0, 102, 204, 0.28);
  box-shadow: 0 26px 64px rgba(29, 29, 31, 0.11);
  transform: translateY(-2px);
}

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

.portfolio-title {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.rank-badge {
  color: #9aa8ad;
  font-size: 0.78rem;
  font-weight: 900;
}

.portfolio-item h3 {
  font-size: 1.12rem;
  line-height: 1.15;
  margin: 0;
}

.portfolio-role {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  margin-top: -7px;
}

.portfolio-use {
  background: var(--accent-soft);
  border: 1px solid rgba(0, 102, 204, 0.1);
  border-radius: var(--radius);
  display: grid;
  gap: 6px;
  padding: 12px;
}

.portfolio-use span,
.portfolio-meta span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.portfolio-use strong {
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.42;
}

.portfolio-meta {
  display: grid;
  gap: 8px;
  grid-template-columns: 0.72fr 1.28fr;
}

.portfolio-meta div {
  background: rgba(118, 118, 128, 0.08);
  border-radius: 7px;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
}

.portfolio-meta strong {
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.35;
}

.portfolio-details {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 9px;
  padding-top: 11px;
}

.portfolio-details summary {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 850;
}

.portfolio-details p {
  font-size: 0.86rem;
  line-height: 1.48;
}

.print-report {
  display: none;
}

.cards-section {
  display: grid;
  gap: 16px;
}

.table-section {
  display: grid;
  gap: 16px;
}

.table-wrap {
  overflow: clip;
}

.card-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

.card-table th,
.card-table td {
  border-bottom: 1px solid var(--line);
  font-size: 0.84rem;
  line-height: 1.35;
  padding: 14px;
  text-align: left;
  vertical-align: top;
  word-break: normal;
  overflow-wrap: break-word;
}

.card-table thead th {
  background: rgba(251, 251, 253, 0.96);
  box-shadow: 0 1px 0 var(--line);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  z-index: 20;
}

.sticky-table-header {
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow-soft);
  display: none;
  left: 0;
  overflow: hidden;
  position: fixed;
  top: 0;
  z-index: 80;
}

.sticky-table-header.visible {
  display: block;
}

.sticky-table-header .card-table {
  background: var(--surface);
  margin: 0;
}

.sticky-table-header .card-table thead th {
  position: static;
}

.card-table tbody th {
  font-weight: 850;
}

.table-card-cell {
  align-items: center;
  display: flex;
  min-width: 0;
}

.table-card-cell > div:last-child {
  min-width: 0;
}

.table-card-visual {
  border-radius: 6px;
  flex: 0 0 58px;
  padding: 5px;
  width: 58px;
}

.table-card-visual img {
  filter: drop-shadow(0 6px 10px rgba(29, 29, 31, 0.14));
}

.card-table th:nth-child(1) {
  width: 24%;
}

.card-table th:nth-child(2) {
  width: 20%;
}

.card-table th:nth-child(3) {
  width: 24%;
}

.card-table th:nth-child(4),
.card-table th:nth-child(5),
.card-table th:nth-child(6) {
  width: 16%;
}

.card-table small {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 650;
  margin-top: 3px;
}

.table-card-link {
  color: var(--ink);
  display: inline-block;
  text-decoration-color: rgba(35, 97, 90, 0.34);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.table-card-link:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.card-type-text {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 650;
  margin-top: 5px;
}

.card-table strong {
  color: var(--ink);
  font-weight: 900;
}

.card-table tr:last-child th,
.card-table tr:last-child td {
  border-bottom: 0;
}

.compact-table th,
.compact-table td {
  font-size: 0.82rem;
  padding: 10px;
}

.card-grid {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  animation: fade-up 520ms ease both;
  display: grid;
  gap: 18px;
  overflow: hidden;
  padding: 18px;
  position: relative;
  transition: border-color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
  scroll-margin-top: 18px;
}

.card:target {
  border-color: rgba(0, 102, 204, 0.42);
  box-shadow: 0 24px 70px rgba(0, 102, 204, 0.15);
}

.card:hover {
  border-color: rgba(0, 102, 204, 0.24);
  box-shadow: 0 28px 70px rgba(29, 29, 31, 0.11);
  transform: translateY(-2px);
}

.card-head {
  align-items: center;
  justify-content: start;
}

.card-visual {
  align-items: center;
  aspect-ratio: 1.58;
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  color: #fff;
  display: flex;
  flex: 0 0 134px;
  justify-content: center;
  overflow: visible;
  padding: 0;
  transition: transform 220ms ease;
  width: 134px;
}

.card-visual img {
  display: block;
  filter: drop-shadow(0 10px 18px rgba(29, 29, 31, 0.18));
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  width: 100%;
}

.card-visual .card-bank-code {
  display: none;
}

.card-visual.image-failed {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 40%),
    linear-gradient(135deg, #1d1d1f, #3a3a3c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 16px 36px rgba(29, 29, 31, 0.12);
  color: #fff;
  overflow: hidden;
  padding: 10px;
}

.card-visual.image-failed .card-bank-code {
  display: block;
}

.card:hover .card-visual {
  transform: translateY(-2px) rotate(-1deg);
}

.card[data-bank*="hsbc"] .card-visual.image-failed {
  background: linear-gradient(135deg, #1d1d1f 0%, #c6182a 100%);
}

.card-visual.image-failed[data-bank*="hsbc"] {
  background: linear-gradient(135deg, #1d1d1f 0%, #c6182a 100%);
}

.card[data-bank*="citi"] .card-visual.image-failed,
.card[data-bank*="citibank"] .card-visual.image-failed,
.card-visual.image-failed[data-bank*="citi"],
.card-visual.image-failed[data-bank*="citibank"] {
  background: linear-gradient(135deg, #003b71 0%, #e3222a 100%);
}

.card[data-bank*="dbs"] .card-visual.image-failed,
.card-visual.image-failed[data-bank*="dbs"] {
  background: linear-gradient(135deg, #1d1d1f 0%, #d71920 100%);
}

.card[data-bank*="uob"] .card-visual.image-failed,
.card-visual.image-failed[data-bank*="uob"] {
  background: linear-gradient(135deg, #005eb8 0%, #0a2f66 100%);
}

.card[data-bank*="ocbc"] .card-visual.image-failed,
.card-visual.image-failed[data-bank*="ocbc"] {
  background: linear-gradient(135deg, #2a2a2a 0%, #c70018 100%);
}

.mini-card-visual {
  flex: 0 0 104px;
  padding: 0;
  width: 104px;
}

.mini-card-visual .card-bank-code {
  font-size: 0.62rem;
}

.card-bank-code {
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.bank {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.card h3 {
  font-size: 1.18rem;
  line-height: 1.12;
  margin: 0;
}

.card-note {
  color: var(--muted);
  display: -webkit-box;
  font-size: 0.86rem;
  line-height: 1.4;
  margin: 9px 0 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.facts div {
  background: rgba(118, 118, 128, 0.07);
  border: 1px solid rgba(29, 29, 31, 0.06);
  border-radius: 7px;
  display: grid;
  gap: 6px;
  grid-template-columns: 88px minmax(0, 1fr);
  padding: 10px;
}

dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

dd {
  font-size: 0.91rem;
  line-height: 1.45;
  margin: 0;
}

.facts dd {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

summary {
  align-items: center;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  font-size: 0.9rem;
  font-weight: 800;
  gap: 10px;
  justify-content: space-between;
  line-height: 1.2;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  align-items: center;
  background: rgba(0, 102, 204, 0.08);
  border-radius: 999px;
  content: "+";
  display: inline-flex;
  flex: 0 0 22px;
  font-size: 0.9rem;
  height: 22px;
  justify-content: center;
  line-height: 1;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
  width: 22px;
}

details[open] > summary::after {
  background: var(--accent);
  color: #fff;
  content: "-";
}

.details-grid {
  animation: fade-up 240ms ease both;
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.details-grid h4,
.advanced h4 {
  font-size: 0.78rem;
  margin: 0 0 5px;
}

.details-grid p,
.advanced p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0;
}

.advanced {
  background: rgba(118, 118, 128, 0.08);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 8px;
  padding: 12px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.links a {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 9px;
  text-decoration: none;
}

.empty {
  background: var(--surface);
  border: 1px dashed #b8c5c5;
  border-radius: var(--radius);
  color: var(--muted);
  grid-column: 1 / -1;
  padding: 24px;
  text-align: center;
}

.top-button {
  align-items: center;
  background: rgba(29, 29, 31, 0.9);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  bottom: 22px;
  box-shadow: 0 18px 42px rgba(22, 33, 38, 0.2);
  color: #fff;
  display: flex;
  font-size: 1.1rem;
  height: 44px;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 22px;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease, background 160ms ease;
  width: 44px;
  z-index: 20;
}

.top-button.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.top-button:hover {
  background: var(--accent);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1060px) {
  .workspace {
    grid-template-columns: 1fr;
  }

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

  .sidebar {
    position: static;
  }

  .profile-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: start;
    flex-direction: column;
    padding: 16px;
  }

  .top-actions {
    align-items: start;
    justify-items: start;
    width: 100%;
  }

  .nav-links {
    max-width: 100%;
    overflow-x: auto;
  }

  .card-table {
    min-width: 860px;
  }

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

  .workspace {
    padding: 0 16px 28px;
  }

  .summary-strip,
  .portfolio-grid,
  .card-grid,
  .spend-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-output {
    padding: 18px;
  }

  .portfolio-hero h2 {
    font-size: clamp(2.1rem, 11vw, 3.2rem);
  }

  .portfolio-hero {
    align-items: start;
    flex-direction: column;
  }

  .portfolio-meta {
    grid-template-columns: 1fr;
  }

  .portfolio-overview-row {
    align-items: stretch;
    flex-direction: column;
  }

  .card-head,
  .panel-heading,
  .bottom-cta,
  .section-heading,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .facts div {
    grid-template-columns: 1fr;
  }

  .card-visual {
    flex: 0 0 110px;
    padding: 0;
    width: 110px;
  }

  .card-head {
    align-items: center;
    flex-direction: row;
  }

  .mini-card-visual {
    flex-basis: 88px;
    width: 88px;
  }

  .table-card-visual {
    flex-basis: 58px;
    padding: 5px;
    width: 58px;
  }

  .primary-button,
  .primary-link,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }

  .top-button {
    bottom: 16px;
    height: 42px;
    right: 16px;
    width: 42px;
  }
}

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

@media print {
  @page {
    margin: 12mm;
    size: A4;
  }

  html,
  body {
    background: #fff !important;
    color: #172126 !important;
  }

  body.print-mode > :not(.print-report) {
    display: none !important;
  }

  body.print-mode .print-report {
    display: block !important;
  }

  .print-report {
    font-size: 10.5pt;
    line-height: 1.35;
  }

  .print-cover {
    border-bottom: 1px solid #dfe5e5;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .print-cover h1 {
    font-size: 24pt;
    line-height: 1.05;
    margin: 0 0 8px;
  }

  .print-cover p {
    color: #5c6b73;
    margin: 0;
    max-width: 680px;
  }

  .print-summary,
  .print-spend-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 12px;
  }

  .print-summary div,
  .print-spend-grid div {
    background: #f1f4f5;
    border: 1px solid #dfe5e5;
    border-radius: 8px;
    padding: 8px;
  }

  .print-summary span,
  .print-spend-grid span,
  .print-card dt {
    color: #5c6b73;
    display: block;
    font-size: 8pt;
    font-weight: 800;
    text-transform: uppercase;
  }

  .print-summary strong,
  .print-spend-grid strong {
    display: block;
    font-size: 11pt;
    margin-top: 3px;
  }

  .print-section {
    margin-top: 14px;
  }

  .print-section h2 {
    font-size: 13pt;
    margin: 0 0 8px;
  }

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

  .print-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7f9f9 100%);
    border: 1px solid #dfe5e5;
    border-radius: 8px;
    break-inside: avoid;
    display: grid;
    gap: 7px;
    padding: 10px;
    page-break-inside: avoid;
  }

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

  .print-card-head span {
    color: #8a999e;
    font-weight: 900;
  }

  .print-card h3 {
    font-size: 13pt;
    margin: 0;
  }

  .print-role {
    color: #5c6b73;
    font-size: 9pt;
    font-weight: 750;
    margin: 0;
  }

  .print-card dl {
    display: grid;
    gap: 6px;
    margin: 0;
  }

  .print-card dl div {
    border-top: 1px solid #dfe5e5;
    padding-top: 6px;
  }

  .print-card dd {
    margin: 2px 0 0;
  }

  .print-footer-note {
    border-top: 1px solid #dfe5e5;
    color: #5c6b73;
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 9px;
  }

  .print-footer-note strong {
    color: #172126;
  }
}
