/* ============================================================
   PAID LIKE MEDICAID — Dollar Bill Currency Theme
   ============================================================ */

/* --- Google Fonts: dollar-bill engraving feel --- */
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Old+Standard+TT:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  /* Dollar bill greens */
  --bill-dark: #1a3c34;
  --bill-ink: #2a4a3f;
  --bill-mid: #3d6b56;
  --bill-accent: #4a7c5f;
  --bill-light: #6b9b7a;

  /* Paper tones */
  --paper-cream: #f0ede4;
  --paper-aged: #e8e3d5;
  --paper-warm: #ddd6c3;
  --paper-edge: #c9bfa8;

  /* Functional */
  --bill-border: rgba(42, 74, 63, 0.3);
  --bill-shadow: rgba(26, 60, 52, 0.2);
  --bill-glow: rgba(106, 155, 122, 0.15);
  --text-primary: #1a3c34;
  --text-secondary: #3d6b56;
  --text-muted: #6b8a7a;
}

/* --- Base --- */
body {
  font-family: 'Libre Baskerville', 'Georgia', serif !important;
  font-size: 0.95rem;
  font-weight: 400;
  background: var(--paper-aged);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* Subtle linen/paper texture overlay on the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(26, 60, 52, 0.015) 2px,
      rgba(26, 60, 52, 0.015) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(26, 60, 52, 0.01) 2px,
      rgba(26, 60, 52, 0.01) 4px
    );
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: 'Old Standard TT', 'Libre Baskerville', serif !important;
  color: var(--bill-dark);
  letter-spacing: 0.5px;
}

h2, .h2 {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
}

h3, .h3 {
  letter-spacing: 1px;
}

h6, .h6 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

p, span, div, label, a, li, td, th, input, select, textarea, button {
  font-family: 'Libre Baskerville', 'Georgia', serif !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

/* --- Navbar: dark engraving band --- */
.navbar {
  background: linear-gradient(
    180deg,
    var(--bill-dark) 0%,
    #0f2b24 50%,
    var(--bill-dark) 100%
  ) !important;
  border-bottom: 2px solid var(--bill-mid);
  box-shadow:
    0 2px 8px var(--bill-shadow),
    inset 0 -1px 0 rgba(106, 155, 122, 0.2);
  font-family: 'Old Standard TT', serif !important;
  letter-spacing: 1.5px;
  padding: 0.6rem 1rem;
}

.navbar-brand {
  font-family: 'Old Standard TT', serif !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 3px !important;
  font-size: 1.15rem !important;
  color: var(--paper-cream) !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  display: flex !important;
  align-items: center !important;
}

.brand-flag {
  height: 20px;
  width: auto;
  margin-right: 6px;
  margin-top: -2px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 2px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
  transition: filter 0.2s ease;
}

.navbar-brand:hover .brand-flag {
  filter: drop-shadow(0 1px 5px rgba(255,255,255,0.2));
}

.brand-dollar {
  height: 24px;
  width: auto;
  margin-right: 3px;
  margin-top: -2px;
  filter:
    drop-shadow(0 1px 0 rgba(255,255,255,0.3))
    drop-shadow(0 2px 2px rgba(0,0,0,0.6))
    drop-shadow(0 0 1px rgba(0,0,0,0.3));
  transition: filter 0.2s ease;
}

.navbar-brand:hover .brand-dollar {
  filter:
    drop-shadow(0 1px 0 rgba(255,255,255,0.4))
    drop-shadow(0 2px 3px rgba(0,0,0,0.5))
    drop-shadow(0 0 4px rgba(200,200,200,0.3));
}

.navbar .nav-link {
  font-family: 'Old Standard TT', serif !important;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.88rem !important;
  font-weight: 700;
  color: rgba(240, 237, 228, 0.85) !important;
  transition: color 0.2s ease;
}

.navbar .nav-link:hover {
  color: var(--paper-cream) !important;
  text-shadow: 0 0 8px var(--bill-glow);
}

/* --- Cards: paper currency panels --- */
.card {
  background: linear-gradient(
    175deg,
    var(--paper-cream) 0%,
    var(--paper-aged) 40%,
    var(--paper-warm) 100%
  );
  border: 1px solid var(--bill-border);
  border-radius: 4px;
  box-shadow:
    0 1px 3px var(--bill-shadow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  position: relative;
  overflow: visible;
}

/* Fine engraving-style border inside cards */
.card::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(42, 74, 63, 0.12);
  border-radius: 2px;
  pointer-events: none;
  z-index: 1;
}

.card-header {
  background: linear-gradient(
    180deg,
    rgba(42, 74, 63, 0.08) 0%,
    rgba(42, 74, 63, 0.04) 100%
  ) !important;
  border-bottom: 1px solid var(--bill-border) !important;
  color: var(--bill-dark) !important;
  font-family: 'Old Standard TT', serif !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.92rem;
  padding: 0.65rem 1rem;
  position: relative;
  z-index: 2;
}

.card-body {
  position: relative;
  z-index: 2;
}

/* --- Stat cards on home page --- */
.card-subtitle {
  font-family: 'Old Standard TT', serif !important;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.88rem !important;
  font-weight: 700;
  color: var(--text-muted) !important;
}

.card-title {
  font-family: 'Old Standard TT', serif !important;
  color: var(--bill-dark) !important;
  font-weight: 700 !important;
}

/* --- Buttons --- */
.btn-primary,
.btn-primary:active {
  background: linear-gradient(180deg, var(--bill-mid) 0%, var(--bill-dark) 100%) !important;
  border: 1px solid var(--bill-dark) !important;
  color: var(--paper-cream) !important;
  font-family: 'Old Standard TT', serif !important;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 2px 4px var(--bill-shadow);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: linear-gradient(180deg, var(--bill-accent) 0%, var(--bill-mid) 100%) !important;
  box-shadow: 0 3px 8px var(--bill-shadow);
}

.btn-success {
  background: linear-gradient(180deg, #4a7c5f 0%, #2a5a3f 100%) !important;
  border: 1px solid #2a5a3f !important;
  color: var(--paper-cream) !important;
  font-family: 'Old Standard TT', serif !important;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.88rem;
  font-weight: 700;
}

.btn-secondary,
.btn-outline-secondary {
  font-family: 'Old Standard TT', serif !important;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.88rem;
  font-weight: 700;
}

.btn-danger,
.btn-outline-danger {
  font-family: 'Old Standard TT', serif !important;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.88rem;
  font-weight: 700;
}

.btn-light {
  background: var(--paper-cream) !important;
  border: 1px solid var(--bill-border) !important;
  font-family: 'Old Standard TT', serif !important;
}

/* --- Dropdowns (Dash dcc.Dropdown) — always on top --- */

/* Nothing clips dropdown menus */
.card,
.card-body,
.container-fluid,
.row,
.col,
[class*="col-"] {
  overflow: visible !important;
}

.Select-control,
.dash-dropdown .Select-control {
  border: 1px solid var(--bill-border) !important;
  background: var(--paper-cream) !important;
  border-radius: 3px !important;
  font-family: 'Libre Baskerville', serif !important;
  font-size: 0.92rem !important;
}

/* The dropdown menu — rendered absolutely, forced to top layer */
.Select-menu-outer {
  border: 1px solid var(--bill-border) !important;
  background: var(--paper-cream) !important;
  font-family: 'Libre Baskerville', serif !important;
  font-size: 0.92rem !important;
  z-index: 9999 !important;
  max-height: 450px !important;
}

.Select-menu {
  max-height: 450px !important;
}

.Select-option.is-focused {
  background: rgba(42, 74, 63, 0.08) !important;
}

.Select-option.is-selected {
  background: rgba(42, 74, 63, 0.15) !important;
  color: var(--bill-dark) !important;
}

/* Filter panel sits above all chart content */
.filter-panel {
  position: relative;
  z-index: 500 !important;
}

/* Charts and everything below filters stay low */
.js-plotly-plot,
.dash-graph {
  position: relative;
  z-index: 0;
}

/* --- Date picker --- */
.DateRangePickerInput {
  background: var(--paper-cream) !important;
  border: 1px solid var(--bill-border) !important;
  border-radius: 3px !important;
}

.DateInput_input {
  font-family: 'Libre Baskerville', serif !important;
  font-size: 0.9rem !important;
  color: var(--text-primary) !important;
  background: transparent !important;
  padding: 4px 6px !important;
  width: 80px !important;
}

.DateInput {
  width: 86px !important;
}

.DateRangePickerInput_arrow_svg {
  fill: var(--text-muted) !important;
}

.CalendarDay__selected,
.CalendarDay__selected:hover {
  background: var(--bill-mid) !important;
  border-color: var(--bill-dark) !important;
}

.CalendarDay__selected_span {
  background: var(--bill-glow) !important;
  border-color: rgba(42, 74, 63, 0.2) !important;
  color: var(--bill-dark) !important;
}

.CalendarDay__hovered_span {
  background: var(--bill-glow) !important;
  color: var(--bill-dark) !important;
}

.DayPickerNavigation_button__default {
  border-color: var(--bill-border) !important;
}

/* --- Inputs (Bootstrap) --- */
.form-control,
input.form-control {
  border: 1px solid var(--bill-border);
  background: var(--paper-cream);
  font-family: 'Libre Baskerville', serif !important;
  border-radius: 3px;
  color: var(--text-primary);
}

.form-control:focus {
  border-color: var(--bill-mid);
  box-shadow: 0 0 0 0.2rem var(--bill-glow);
  background: #fff;
}

/* --- Labels --- */
label, .form-label {
  font-family: 'Old Standard TT', serif !important;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.88rem !important;
  color: var(--text-secondary) !important;
  font-weight: 700;
}

/* --- Alerts --- */
.alert {
  font-family: 'Libre Baskerville', serif !important;
  border-radius: 3px;
}

/* --- Content area padding --- */
.content {
  padding: 1.5rem !important;
  position: relative;
  z-index: 1;
}

/* --- Login page --- */
.border.rounded.shadow-sm.bg-white {
  background: linear-gradient(
    175deg,
    var(--paper-cream) 0%,
    var(--paper-aged) 100%
  ) !important;
  border: 1px solid var(--bill-border) !important;
  border-radius: 4px !important;
  box-shadow:
    0 4px 16px var(--bill-shadow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.4) !important;
}

/* --- Plotly charts: transparent bg to show card paper --- */
.js-plotly-plot .plotly .main-svg {
  background: transparent !important;
}

.js-plotly-plot .plotly .bg {
  fill: transparent !important;
}

/* --- Summary stat cards row --- */
#summary-cards .card,
#explore-summary-row .card {
  border-left: 3px solid var(--bill-mid);
}

/* --- Provider detail card --- */
#explore-provider-detail .card {
  border-left: 3px solid var(--bill-accent);
  background: linear-gradient(
    175deg,
    rgba(240, 237, 228, 0.98) 0%,
    rgba(232, 227, 213, 0.95) 100%
  );
}

/* --- Scrollbar styling (webkit) --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--paper-aged);
}

::-webkit-scrollbar-thumb {
  background: var(--bill-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bill-mid);
}

/* --- Fine guilloche-style decorative line under h2 --- */
h2::after,
.h2::after {
  content: "";
  display: block;
  width: 100%;
  max-width: 300px;
  height: 2px;
  margin-top: 8px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--bill-mid) 20%,
    var(--bill-accent) 50%,
    var(--bill-mid) 80%,
    transparent 100%
  );
  opacity: 0.5;
}

/* Card headers don't need the line */
.card-header h2::after,
.card-header .h2::after {
  display: none;
}

/* --- Table styling if present --- */
.dash-spreadsheet-container .dash-spreadsheet-inner th {
  background: rgba(42, 74, 63, 0.08) !important;
  color: var(--bill-dark) !important;
  font-family: 'Old Standard TT', serif !important;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid var(--bill-border) !important;
}

.dash-spreadsheet-container .dash-spreadsheet-inner td {
  background: var(--paper-cream) !important;
  color: var(--text-primary) !important;
  font-family: 'Libre Baskerville', serif !important;
  font-size: 0.9rem;
  border: 1px solid rgba(42, 74, 63, 0.12) !important;
}

/* --- Spinner / loading --- */
.dash-spinner {
  color: var(--bill-mid) !important;
}

/* --- Shadow utilities override --- */
.shadow-sm {
  box-shadow: 0 1px 4px var(--bill-shadow) !important;
}

/* --- Custom money bag cursor on charts --- */
.js-plotly-plot .plotly .nsewdrag,
.js-plotly-plot .plotly .drag,
.js-plotly-plot .plotly .cartesianlayer,
.dash-graph:hover {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='18' viewBox='0 0 16 18'%3E%3Ctext y='14' font-size='14'%3E%F0%9F%92%B0%3C/text%3E%3C/svg%3E") 8 9, pointer !important;
}

/* --- Dollar bill collage motifs --- */

/* Guilloche rosette in top-right corner of page */
body::after {
  content: "";
  position: fixed;
  top: 70px;
  right: 20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(42, 74, 63, 0.04) 0deg 5deg,
      transparent 5deg 10deg
    );
  border: 2px solid rgba(42, 74, 63, 0.08);
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

/* Ornamental corner brackets on the filter card */
.filter-panel::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border-top: 2px solid rgba(42, 74, 63, 0.15);
  border-right: 2px solid rgba(42, 74, 63, 0.15);
  pointer-events: none;
  z-index: 3;
}

/* Treasury seal watermark behind content */
.content::before {
  content: "$";
  position: fixed;
  bottom: 30px;
  left: 30px;
  font-family: 'Old Standard TT', serif;
  font-size: 180px;
  font-weight: 700;
  color: rgba(42, 74, 63, 0.03);
  pointer-events: none;
  z-index: 0;
  line-height: 1;
}

/* Serial number style text in footer area */
.content::after {
  content: "UNITED STATES MEDICAID";
  position: fixed;
  bottom: 12px;
  right: 20px;
  font-family: 'Old Standard TT', serif;
  font-size: 0.6rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(42, 74, 63, 0.12);
  pointer-events: none;
  z-index: 0;
}

/* Fine crosshatch pattern on card headers */
.card-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 3px,
      rgba(42, 74, 63, 0.02) 3px,
      rgba(42, 74, 63, 0.02) 4px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 3px,
      rgba(42, 74, 63, 0.02) 3px,
      rgba(42, 74, 63, 0.02) 4px
    );
  pointer-events: none;
  z-index: 0;
}

/* Ornamental divider on stat cards */
#summary-cards .card::after,
#explore-summary-row .card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(42, 74, 63, 0.2) 30%,
    rgba(42, 74, 63, 0.3) 50%,
    rgba(42, 74, 63, 0.2) 70%,
    transparent
  );
}

/* --- Medical motif loading animation --- */
.med-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(240, 237, 228, 0.85);
  z-index: 10;
  border-radius: 4px;
  pointer-events: none;
}

.med-loading-emoji {
  display: inline-block;
  font-size: 2rem;
  margin: 0 6px;
  opacity: 0;
  animation: medBounce 1.4s ease-in-out infinite;
}

.med-loading-emoji:nth-child(1) { animation-delay: 0s; }
.med-loading-emoji:nth-child(2) { animation-delay: 0.15s; }
.med-loading-emoji:nth-child(3) { animation-delay: 0.3s; }

@keyframes medBounce {
  0%, 100% {
    opacity: 0.3;
    transform: translateY(0) scale(0.8);
  }
  50% {
    opacity: 1;
    transform: translateY(-12px) scale(1.1);
  }
}

.med-loading-text {
  font-family: 'Old Standard TT', serif;
  font-size: 0.7rem;
  color: var(--bill-ink);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 6px;
  opacity: 0.6;
}

/* --- Map touch guard (mobile: two-finger to pan) --- */
.map-touch-guard {
  position: relative;
  touch-action: pan-y;  /* allow vertical page scroll, block horizontal for map */
}

.map-touch-message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 60, 52, 0.65);
  color: var(--paper-cream);
  font-family: 'Old Standard TT', serif;
  font-size: 0.9rem;
  letter-spacing: 1px;
  z-index: 20;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.map-touch-message.visible {
  opacity: 1;
}

/* --- Mobile: bigger text, taller controls --- */
@media (max-width: 767.98px) {
  /* ── Single consistent text size: 1.1rem everywhere ── */
  body {
    font-size: 1.1rem !important;
  }
  #explore-content p,
  #explore-content span:not(.med-loading-emoji),
  #explore-content div:not(.med-loading-overlay),
  #explore-content li,
  #explore-content a,
  #explore-content label,
  .btn, .btn-link,
  .card-header, .card-subtitle, .card-body,
  .form-control, input,
  .Select-control, .Select-placeholder, .Select-value-label,
  .Select-input > input, .Select-option, .Select-menu-outer,
  .Select-multi-value-wrapper .Select-value,
  .DateInput_input,
  .filter-section-label,
  .navbar .nav-link,
  .modal-body, .modal-body p, .modal-body li {
    font-size: 1.1rem !important;
  }
  h5, .h5 { font-size: 1.25rem !important; font-weight: 700 !important; }
  h6, .h6 { font-size: 1.1rem !important; font-weight: 700 !important; }
  .small, small, .text-muted.small { font-size: 1rem !important; }
  .card-title { font-size: 1.25rem !important; }
  .navbar-brand {
    letter-spacing: 1.5px !important;
    font-size: 1.1rem !important;
  }

  /* ── Layout spacing ── */
  .container-fluid.px-3 {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
  .gx-2 > [class*="col"] {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  /* ── Dropdown controls: 48px tall ── */
  .Select-control,
  .dash-dropdown .Select-control {
    min-height: 48px !important;
  }
  .Select-placeholder,
  .Select-value-label,
  .Select-input > input {
    line-height: 46px !important;
  }
  .Select-multi-value-wrapper .Select-value {
    padding: 3px 6px !important;
  }

  /* ── Dropdown menu: full-width, tall scrollable list ── */
  .Select-menu-outer {
    width: 100% !important;
    min-width: 0 !important;
    max-height: 70vh !important;
    min-height: 300px !important;
  }
  .Select-menu {
    max-height: 70vh !important;
    min-height: 300px !important;
    overflow-y: auto !important;
  }
  .VirtualizedSelectOption,
  .Select-option {
    padding: 16px 14px !important;
    line-height: 1.5 !important;
    min-height: 50px !important;
  }

  /* ── Date picker: match dropdown height ── */
  .DateInput_input {
    padding: 8px 8px !important;
    min-height: 48px !important;
  }
  .DateInput {
    width: 100px !important;
  }
  .DateRangePickerInput {
    min-height: 48px !important;
  }

  /* ── Clear button: match dropdown height ── */
  #explore-clear-btn {
    min-height: 48px !important;
  }
  /* More breathing room between stacked chart sections */
  #explore-content .mb-3 {
    margin-bottom: 1.75rem !important;
  }
  #explore-content .gx-2 {
    margin-bottom: 0.75rem !important;
  }
  /* Give the map more vertical room on mobile */
  #explore-state-map {
    min-height: 480px;
  }
  /* Bar charts: taller on mobile so bars aren't paper-thin */
  #explore-provider-bar, #explore-hcpcs-bar, #explore-specialty-bar {
    min-height: 480px;
  }
  /* Line/scatter charts */
  #explore-monthly-line, #explore-scatter-chart {
    min-height: 420px;
  }
  /* Plotly modebar: hide on touch */
  .js-plotly-plot .plotly .modebar { display: none !important; }
}

/* --- Paper filter card (receipt-roll) --- */
.paper-card {
  position: relative;
  margin: 1rem 0 1.5rem;
  display: flex;
  flex-direction: column;
}

/* --- Paper body --- */
.paper-card-body {
  background: linear-gradient(
    175deg,
    var(--paper-cream) 0%,
    var(--paper-aged) 50%,
    var(--paper-warm) 100%
  );
  border-left: 1px solid var(--bill-border);
  border-right: 1px solid var(--bill-border);
  box-shadow:
    0 2px 8px var(--bill-shadow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  padding: 1rem 1.25rem 0.5rem;
  max-height: 2000px;
  overflow: visible;
  position: relative;
  transition: max-height 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              padding 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.4s ease;
}

/* Fine inner border — engraving inset */
.paper-card-body::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(42, 74, 63, 0.1);
  border-radius: 2px;
  pointer-events: none;
}

/* Guilloche accent edge */
.paper-card-body::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    var(--bill-accent) 0px,
    var(--bill-light) 4px,
    transparent 4px,
    transparent 8px
  );
  opacity: 0.5;
}

/* --- Receipt curl shadows --- */
.paper-curl {
  height: 0;
  position: relative;
  z-index: 3;
  overflow: hidden;
  transition: height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.4s ease;
  opacity: 0;
}
.paper-curl::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  height: 18px;
  border-radius: 50%;
}
/* Top curl: shadow falls downward (paper curled over from top) */
.paper-curl-top::before {
  top: -9px;
  box-shadow: 0 6px 12px rgba(26, 60, 52, 0.25),
              0 2px 4px rgba(26, 60, 52, 0.15);
}
/* Bottom curl: shadow falls upward (paper curled under from bottom) */
.paper-curl-bottom::before {
  bottom: -9px;
  box-shadow: 0 -6px 12px rgba(26, 60, 52, 0.25),
              0 -2px 4px rgba(26, 60, 52, 0.15);
}

/* --- Tab handles (top & bottom) --- */
.paper-tab-handle {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  padding: 7px 0;
  width: 100%;
  background: linear-gradient(
    175deg,
    rgba(42, 74, 63, 0.04) 0%,
    rgba(42, 74, 63, 0.09) 100%
  );
  border: 1px solid var(--bill-border);
  transition: background 0.2s ease, box-shadow 0.2s ease, border-radius 0.3s ease;
}
.paper-tab-top {
  border-radius: 6px 6px 0 0;
  border-bottom: none;
}
.paper-tab-bottom {
  border-radius: 0 0 6px 6px;
  border-top: none;
}
.paper-tab-handle:hover {
  background: linear-gradient(
    175deg,
    rgba(42, 74, 63, 0.06) 0%,
    rgba(42, 74, 63, 0.14) 100%
  );
  box-shadow: 0 2px 8px var(--bill-shadow);
}

/* Notch pill */
.paper-tab-notch {
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--bill-border);
  opacity: 0.55;
  transition: width 0.3s ease, opacity 0.3s ease;
}
.paper-tab-handle:hover .paper-tab-notch {
  width: 60px;
  opacity: 0.9;
}

/* ===== OPEN state ===== */
.paper-card.paper-open .paper-card-body {
  max-height: 2000px;
  opacity: 1;
  padding: 1rem 1.25rem 0.5rem;
  overflow: visible;
}
.paper-card.paper-open .paper-curl {
  height: 0;
  opacity: 0;
}

/* ===== ROLLED state (shared) ===== */
.paper-card.paper-rolled .paper-card-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  overflow: hidden;
  border-left-color: transparent;
  border-right-color: transparent;
  pointer-events: none;
}

/* Roll UP (clicked bottom handle) — curl appears at bottom */
.paper-card.paper-rolled.roll-up .paper-curl-bottom {
  height: 14px;
  opacity: 1;
}
.paper-card.paper-rolled.roll-up .paper-tab-top {
  border-radius: 6px;
  border-bottom: 1px solid var(--bill-border);
}

/* Roll DOWN (clicked top handle) — curl appears at top */
.paper-card.paper-rolled.roll-down .paper-curl-top {
  height: 14px;
  opacity: 1;
}
.paper-card.paper-rolled.roll-down .paper-tab-bottom {
  border-radius: 6px;
  border-top: 1px solid var(--bill-border);
}

/* --- Chart section dividers --- */
.chart-divider {
  height: 2px;
  margin: 1.5rem 1rem;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--bill-light) 20%,
    var(--bill-accent) 50%,
    var(--bill-light) 80%,
    transparent 100%
  );
  opacity: 0.45;
  border-radius: 1px;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
