/* Baseline app surfaces — extends ../styles.css with dashboard chrome. */

.app-body {
  background: var(--color-background-alt);
  min-height: 100vh;
}

/* Auth pages */
.auth-shell {
  min-height: calc(100vh - 84px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  max-width: 460px;
  width: 100%;
}

.auth-card h1 {
  font-family: var(--font-heading);
  font-size: 28px;
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--color-text-light);
  margin-bottom: 28px;
  font-size: 15px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.auth-form label {
  font-weight: 600;
  font-size: 14px;
}

.auth-form input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(13, 139, 139, 0.2);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font-body);
  transition: border-color 0.2s ease;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 139, 139, 0.1);
}

.auth-form button {
  margin-top: 8px;
}

.auth-status {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  border-left: 4px solid;
}

.auth-status.success {
  background: rgba(13, 139, 139, 0.08);
  border-color: var(--color-primary);
  color: var(--color-text);
}

.auth-status.error {
  background: rgba(190, 60, 60, 0.08);
  border-color: #be3c3c;
  color: #7a2222;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--color-text-light);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(13, 139, 139, 0.15);
}

.auth-demo-btn {
  width: 100%;
  color: #ffffff;
  background: #b8894f;
}

.auth-demo-btn:hover {
  background: #a17742;
  color: #ffffff;
}

.auth-fineprint {
  font-size: 13px;
  color: var(--color-text-light);
  margin-top: 12px;
  text-align: center;
}

.auth-legal {
  font-size: 12px;
  color: var(--color-text-light);
  margin-top: 28px;
  text-align: center;
  line-height: 1.6;
}

.auth-legal a {
  color: var(--color-primary);
  text-decoration: none;
}

.auth-legal a:hover {
  text-decoration: underline;
}

/* ============================================================
   Onboarding — receipt drop + manual form combo
   ============================================================ */

.onboarding-shell {
  min-height: calc(100vh - 84px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px 80px;
}

.onboarding-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 44px 44px 36px;
  max-width: 600px;
  width: 100%;
}

.onboarding-intro {
  text-align: center;
  margin-bottom: 28px;
}

.onboarding-intro h1 {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--color-text);
  margin: 0 0 8px;
}

.onboarding-subtitle {
  font-size: 14px;
  color: var(--color-text-light);
  line-height: 1.55;
  margin: 0 auto;
  max-width: 440px;
}

.onboarding-state-county {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 480px) {
  .onboarding-state-county {
    grid-template-columns: 1fr 1fr;
  }
}

.onboarding-receipt-zone {
  background: linear-gradient(135deg, rgba(13, 139, 139, 0.06) 0%, rgba(212, 165, 116, 0.10) 100%);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  border: 1px solid rgba(13, 139, 139, 0.15);
  margin-bottom: 26px;
}

.onboarding-receipt-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.onboarding-receipt-sparkle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #ffffff;
  flex-shrink: 0;
}

.onboarding-receipt-label strong {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.2px;
}

.onboarding-receipt-label > span {
  font-size: 13px;
  color: var(--color-text-light);
  width: 100%;
  margin-left: 38px;
  margin-top: -8px;
}

.onboarding-drop {
  background: #ffffff;
  border: 2px dashed rgba(13, 139, 139, 0.3);
  border-radius: var(--radius-sm);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.onboarding-drop:hover,
.onboarding-drop.dragover {
  border-color: var(--color-primary);
  background: rgba(13, 139, 139, 0.04);
}

.onboarding-drop span {
  font-size: 13px;
  color: var(--color-text-light);
}

.onboarding-receipt-preview {
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  border: 1px solid rgba(47, 158, 68, 0.3);
}

.onboarding-receipt-preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.onboarding-receipt-preview-header strong {
  color: #2f7a3e;
  font-family: var(--font-heading);
  font-size: 14px;
}

.onboarding-receipt-preview-header .btn-text {
  margin-left: auto;
  font-size: 12px;
}

.onboarding-receipt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  font-size: 13px;
  margin-bottom: 10px;
}

.onboarding-receipt-grid > div {
  display: flex;
  flex-direction: column;
}

.onboarding-receipt-grid label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--color-text-light);
  margin-bottom: 2px;
}

.onboarding-receipt-grid span {
  color: var(--color-text);
  font-weight: 500;
}

.onboarding-receipt-note {
  font-size: 12px;
  color: var(--color-text-light);
  font-style: italic;
  margin: 8px 0 0;
}

.onboarding-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 22px;
  color: var(--color-text-light);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.onboarding-divider::before,
.onboarding-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(13, 139, 139, 0.15);
}

@media (max-width: 600px) {
  .onboarding-card { padding: 32px 22px 28px; }
  .onboarding-intro h1 { font-size: 24px; }
  .onboarding-receipt-grid { grid-template-columns: 1fr; }
}

/* App header */
.app-header {
  background: #fff;
  border-bottom: 1px solid rgba(13, 139, 139, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.app-header .nav {
  padding: 14px 0;
}

.app-header .nav-links a,
.app-header .nav-links button {
  font-size: 14px;
}

.app-meta {
  font-size: 13px;
  color: var(--color-text-light);
  margin-right: 16px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 12px;
}

.btn-text:hover {
  text-decoration: underline;
}

/* ============================================================
   Settings page
   ============================================================ */

.settings-shell {
  background: var(--color-background-alt);
  min-height: 100vh;
}

.settings-header {
  background: #ffffff;
  border-bottom: 1px solid rgba(13, 139, 139, 0.1);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.settings-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.settings-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.15s ease;
}

.settings-back-link:hover { color: #0a6e6e; }

.settings-main {
  max-width: 760px;
  margin: 32px auto;
  padding: 0 20px 80px;
}

.settings-title {
  margin-bottom: 28px;
}

.settings-title h1 {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--color-text);
  margin: 0 0 6px;
}

.settings-user-email {
  font-size: 14px;
  color: var(--color-text-light);
  margin: 0;
}

.settings-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid rgba(13, 139, 139, 0.1);
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.settings-card.danger {
  border-color: rgba(201, 42, 42, 0.25);
}

.settings-card-header {
  padding: 22px 26px 16px;
  border-bottom: 1px solid rgba(13, 139, 139, 0.08);
}

.settings-card.danger .settings-card-header {
  background: rgba(201, 42, 42, 0.04);
  border-bottom-color: rgba(201, 42, 42, 0.12);
}

.settings-card-header h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--color-text);
  margin: 0 0 6px;
}

.settings-card.danger .settings-card-header h2 {
  color: #921e1e;
}

.settings-card-header p {
  font-size: 13px;
  color: var(--color-text-light);
  line-height: 1.55;
  margin: 0;
}

.settings-card-body {
  padding: 20px 26px 24px;
}

.settings-muted {
  color: var(--color-text-light);
  font-size: 13px;
  font-style: italic;
}

.settings-empty {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  color: var(--color-text-light);
  border: 1px solid rgba(13, 139, 139, 0.1);
}

.settings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.settings-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--color-text-light);
  padding: 8px 10px;
  border-bottom: 1px solid rgba(13, 139, 139, 0.12);
}

.settings-table th.num,
.settings-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.settings-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(13, 139, 139, 0.06);
  color: var(--color-text);
}

.settings-table tr:last-child td { border-bottom: none; }

.settings-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 14px;
}

.settings-label strong { color: #921e1e; }

.settings-input {
  display: block;
  width: 200px;
  margin-top: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(13, 139, 139, 0.2);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
  letter-spacing: 1px;
}

.settings-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 139, 139, 0.1);
}

.btn-danger {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  background: #c92a2a;
  color: #ffffff;
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-danger:hover:not(:disabled) {
  background: #a02020;
  transform: translateY(-1px);
}

.btn-danger:disabled {
  background: #d9a3a3;
  cursor: not-allowed;
}

.btn-text.danger {
  color: #c92a2a;
}

.btn-text.danger:hover {
  color: #921e1e;
  text-decoration: underline;
}

/* Demo entry splash */
.demo-entry {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background:
    radial-gradient(circle at 0% 0%, rgba(13, 139, 139, 0.08), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(212, 165, 116, 0.10), transparent 60%),
    var(--color-background-alt);
}

.demo-entry-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  max-width: 460px;
  width: 100%;
  text-align: center;
}

.demo-entry-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.demo-entry-card h1 {
  font-family: var(--font-heading);
  font-size: 26px;
  letter-spacing: -0.3px;
  margin-bottom: 10px;
  color: var(--color-text);
}

.demo-step {
  font-size: 15px;
  color: var(--color-text-light);
  margin-bottom: 24px;
  min-height: 22px;
  transition: opacity 0.2s ease;
}

.demo-fineprint {
  font-size: 13px;
  color: var(--color-text-light);
  margin-top: 8px;
  line-height: 1.6;
  opacity: 0.85;
}

.demo-slogan {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(13, 139, 139, 0.12);
  font-family: var(--font-heading);
  font-size: 14px;
  font-style: italic;
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1.5;
  letter-spacing: -0.1px;
}

.demo-spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 6px auto 22px;
  background:
    conic-gradient(
      from 0deg,
      rgba(13, 139, 139, 0) 0deg,
      rgba(13, 139, 139, 0.15) 90deg,
      var(--color-primary) 360deg
    );
  -webkit-mask: radial-gradient(circle 18px at center, transparent 17px, #000 18px);
          mask: radial-gradient(circle 18px at center, transparent 17px, #000 18px);
  animation: demo-spin 1.1s linear infinite;
}

@keyframes demo-spin {
  to { transform: rotate(360deg); }
}

.demo-error-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 6px auto 22px;
  background: rgba(201, 42, 42, 0.12);
  color: #c92a2a;
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Guided tour — bottom-right docked card + target glow */

/* The card itself */
.tour-card {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 360px;
  max-height: 80vh;
  background: linear-gradient(160deg, #fffaf0 0%, #f5ede0 100%);
  color: var(--color-text);
  border-radius: var(--radius-md);
  box-shadow:
    0 24px 48px -12px rgba(15, 23, 42, 0.22),
    0 0 0 1px rgba(13, 139, 139, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 5000;
  animation: tour-slide-up 0.28s ease-out;
}

@keyframes tour-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.tour-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px 0;
  flex-shrink: 0;
}

.tour-step-pill {
  background: #ffffff;
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(13, 139, 139, 0.08);
}

.tour-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-light);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.tour-close:hover {
  background: rgba(13, 139, 139, 0.08);
  color: var(--color-text);
}

.tour-card-body {
  padding: 14px 20px 6px;
  overflow-y: auto;
  flex: 1;
}

.tour-card-body h3 {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--color-text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.tour-card-body p {
  font-size: 14px;
  color: var(--color-text-light);
  line-height: 1.6;
  margin: 0;
}

.tour-progress {
  display: flex;
  gap: 6px;
  padding: 8px 20px 12px;
  justify-content: center;
  flex-shrink: 0;
}

.tour-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(13, 139, 139, 0.2);
  transition: background 0.2s ease, transform 0.2s ease;
}

.tour-dot.active {
  background: var(--color-primary);
  transform: scale(1.25);
}

.tour-dot.done {
  background: rgba(13, 139, 139, 0.5);
}

.tour-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(13, 139, 139, 0.12);
  flex-shrink: 0;
}

.tour-nav {
  display: flex;
  gap: 8px;
}

.tour-skip {
  background: none;
  border: none;
  color: var(--color-text-light);
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  padding: 6px 4px;
}

.tour-skip:hover { color: var(--color-text); }

.tour-back,
.tour-next {
  border: none;
  cursor: pointer;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  font-family: var(--font-body);
  transition: background 0.15s ease, transform 0.1s ease;
}

.tour-back {
  background: rgba(255, 255, 255, 0.6);
  color: var(--color-text);
  border: 1px solid rgba(13, 139, 139, 0.15);
}

.tour-back:hover:not(:disabled) {
  background: #ffffff;
  border-color: rgba(13, 139, 139, 0.3);
}

.tour-back:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tour-next {
  background: var(--color-primary);
  color: #ffffff;
}

.tour-next:hover { background: #0a6e6e; }
.tour-next:active { transform: translateY(1px); }

/* Glow applied to the currently-highlighted target element */
.tour-highlight {
  position: relative;
  z-index: 100;
  box-shadow:
    0 0 0 3px rgba(212, 165, 116, 0.9),
    0 0 0 8px rgba(212, 165, 116, 0.25),
    0 0 25px rgba(212, 165, 116, 0.3) !important;
  border-radius: var(--radius-md);
  animation: tour-pulse 1.8s ease-in-out infinite;
  transition: box-shadow 0.3s ease;
}

@keyframes tour-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 3px rgba(212, 165, 116, 0.9),
      0 0 0 8px rgba(212, 165, 116, 0.2),
      0 0 25px rgba(212, 165, 116, 0.25);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(212, 165, 116, 1),
      0 0 0 12px rgba(212, 165, 116, 0.35),
      0 0 40px rgba(212, 165, 116, 0.45);
  }
}

@media (max-width: 640px) {
  .tour-card {
    bottom: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }
}

/* Markdown-lite (streaming AI output) */
.md-lite {
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.6;
}

.md-lite .md-h {
  font-family: var(--font-heading);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-light);
  margin: 14px 0 6px;
  font-weight: 700;
}

.md-lite .md-h:first-child { margin-top: 0; }

.md-lite .md-p {
  margin: 0 0 10px;
}

.md-lite .md-ul {
  margin: 4px 0 14px;
  padding: 0;
  list-style: none;
}

.md-lite .md-ul li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.55;
}

.md-lite .md-ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}

.md-lite code {
  background: rgba(13, 139, 139, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.md-lite em {
  color: var(--color-text-light);
  font-style: italic;
}

.md-lite .md-rule {
  border: none;
  border-top: 1px solid rgba(13, 139, 139, 0.12);
  margin: 14px 0;
}

.md-cursor {
  display: inline-block;
  margin-left: 1px;
  color: var(--color-primary);
  font-weight: 700;
  animation: blink 0.9s steps(2, start) infinite;
}

@keyframes blink {
  to { visibility: hidden; }
}

/* Margin upside hero — positive opportunity framing */
.upside-hero {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(13, 139, 139, 0.15);
  box-shadow: var(--shadow-md);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(212, 165, 116, 0.12), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(13, 139, 139, 0.10), transparent 55%),
    linear-gradient(135deg, #fffaf0 0%, #f5f3f0 100%);
}

.upside-hero-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: center;
  padding: 28px 32px;
}

.upside-hero.tone-celebrate {
  background:
    radial-gradient(circle at 100% 0%, rgba(47, 158, 68, 0.15), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(13, 139, 139, 0.10), transparent 55%),
    linear-gradient(135deg, #f4fbf6 0%, #ffffff 100%);
}

.upside-hero-amount {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  padding: 18px 22px;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid rgba(13, 139, 139, 0.1);
  box-shadow: 0 4px 16px -8px rgba(13, 139, 139, 0.18);
  min-height: 140px;
}

.upside-hero-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-light);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.upside-hero-value {
  font-family: var(--font-heading);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -1.2px;
  line-height: 1;
  background: linear-gradient(135deg, var(--color-primary) 0%, #0a6e6e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}

.upside-hero.tone-celebrate .upside-hero-value {
  background: linear-gradient(135deg, #2f9e44 0%, #1f7a30 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.upside-hero-fineprint {
  font-size: 12px;
  color: var(--color-text-light);
  line-height: 1.4;
}

.upside-hero-body { min-width: 0; }

.upside-hero-summary {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
  letter-spacing: -0.2px;
  margin: 0 0 16px;
}

.upside-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.upside-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  background: #ffffff;
  border: 1px solid rgba(13, 139, 139, 0.15);
  box-shadow: 0 1px 2px rgba(13, 139, 139, 0.04);
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.upside-pill:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px -4px rgba(13, 139, 139, 0.2);
}

.upside-pill:disabled {
  cursor: default;
  opacity: 0.55;
}

.upside-pill.expanded {
  box-shadow: 0 4px 12px -4px rgba(13, 139, 139, 0.25);
}

.upside-pill.win.expanded {
  background: rgba(47, 158, 68, 0.10);
  border-color: rgba(47, 158, 68, 0.4);
}

.upside-pill.opp.expanded {
  background: rgba(212, 165, 116, 0.18);
  border-color: rgba(212, 165, 116, 0.7);
}

.upside-pill-caret {
  margin-left: 2px;
  opacity: 0.7;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.upside-pill-caret.open {
  transform: rotate(180deg);
  opacity: 1;
}

.upside-pill strong {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
}

.upside-pill.win {
  color: #2f9e44;
  border-color: rgba(47, 158, 68, 0.25);
}

.upside-pill.win strong { color: #2f7a3e; }

.upside-pill.opp {
  color: #b06900;
  border-color: rgba(212, 165, 116, 0.5);
  background: rgba(212, 165, 116, 0.06);
}

.upside-pill.opp strong { color: #8c5300; }

.upside-pill-icon {
  font-size: 14px;
  line-height: 1;
}

.upside-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--color-text-light);
}

.upside-hero-meta span {
  background: rgba(255, 255, 255, 0.7);
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.upside-hero-meta span[aria-hidden="true"] {
  background: transparent;
  padding: 3px 0;
}

/* Expanded wins / opportunities list */
.upside-expanded {
  border-top: 1px solid rgba(13, 139, 139, 0.12);
  background: rgba(255, 255, 255, 0.55);
  animation: upside-expand 0.22s ease-out;
}

@keyframes upside-expand {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.upside-expanded-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-text-light);
  padding: 14px 32px 8px;
}

.upside-expanded ul {
  list-style: none;
  margin: 0;
  padding: 0 22px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}

.upside-expanded li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  transition: background 0.12s ease;
}

.upside-expanded li:hover {
  background: rgba(13, 139, 139, 0.05);
}

.upside-expanded-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.upside-crop-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.upside-crop-tag.corn { background: rgba(212, 165, 116, 0.25); color: #7d5418; }
.upside-crop-tag.soybean { background: rgba(13, 139, 139, 0.18); color: #0a6e6e; }

.upside-cat {
  color: var(--color-text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upside-expanded-figures {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.upside-pct {
  font-weight: 700;
  font-size: 13px;
}

.upside-pct.win { color: #2f7a3e; }
.upside-pct.opp { color: #b06900; }

.upside-impact {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
}

.upside-impact.subtle {
  color: var(--color-text-light);
  font-weight: 500;
}

@media (max-width: 760px) {
  .upside-expanded ul {
    grid-template-columns: 1fr;
    padding: 0 16px 14px;
  }
  .upside-expanded-header { padding: 12px 20px 6px; }
}

@media (max-width: 640px) {
  .upside-hero-grid {
    grid-template-columns: 1fr;
    padding: 22px;
  }
  .upside-hero-amount {
    align-items: center;
    text-align: center;
  }
  .upside-hero-value { font-size: 34px; }
  .upside-hero-summary { font-size: 17px; }
}

/* Dashboard layout */
.app-main {
  padding: 32px 20px 80px;
  max-width: 1280px;
  margin: 0 auto;
}

.app-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 20px;
  flex-wrap: wrap;
}

.app-title h1 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
}

.app-title .subtitle {
  color: var(--color-text-light);
  font-size: 15px;
  margin-top: 4px;
}

.demo-banner {
  background: rgba(212, 165, 116, 0.18);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--color-text);
}

.demo-banner strong { color: var(--color-text); }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
}

.dashboard-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.panel {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid rgba(13, 139, 139, 0.1);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.panel h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  margin-bottom: 6px;
}

.panel .panel-sub {
  color: var(--color-text-light);
  font-size: 14px;
  margin-bottom: 20px;
}

.panel .source-attribution {
  font-size: 12px;
  color: var(--color-text-light);
  margin-top: 12px;
  font-style: italic;
}

/* "Scan a receipt" — AI-powered cost capture button */
.btn-receipt-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(13, 139, 139, 0.08) 0%, rgba(13, 139, 139, 0.14) 100%);
  color: var(--color-primary);
  border: 1px solid rgba(13, 139, 139, 0.25);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn-receipt-upload:hover {
  background: linear-gradient(135deg, rgba(13, 139, 139, 0.14) 0%, rgba(13, 139, 139, 0.22) 100%);
  border-color: rgba(13, 139, 139, 0.45);
  box-shadow: 0 4px 12px -4px rgba(13, 139, 139, 0.3);
  transform: translateY(-1px);
}

.btn-receipt-upload:active { transform: translateY(0); }

.btn-receipt-upload svg {
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.btn-receipt-upload:hover svg {
  transform: rotate(15deg) scale(1.1);
}

/* Cost entry table */
.cost-grid {
  width: 100%;
  border-collapse: collapse;
}

.cost-grid th,
.cost-grid td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(13, 139, 139, 0.08);
  font-size: 14px;
}

.cost-grid th {
  font-weight: 600;
  color: var(--color-text-light);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cost-grid input {
  width: 100px;
  padding: 6px 8px;
  border: 1px solid rgba(13, 139, 139, 0.2);
  border-radius: 6px;
  font-size: 14px;
  font-family: var(--font-body);
  text-align: right;
}

.cost-grid input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.cost-grid .crop-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.crop-tag.corn { background: rgba(212, 165, 116, 0.25); color: #7d5418; }
.crop-tag.soybean { background: rgba(13, 139, 139, 0.18); color: #0a6e6e; }

.cost-grid .save-row {
  text-align: right;
}

.cost-grid .saving {
  color: var(--color-text-light);
  font-size: 12px;
}

.cost-grid .saved {
  color: var(--color-primary);
  font-size: 12px;
}

/* Benchmark bars */
.benchmark-row {
  display: grid;
  grid-template-columns: 200px 1fr 80px;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(13, 139, 139, 0.08);
}

.benchmark-row:last-child { border-bottom: none; }

.benchmark-label {
  font-size: 14px;
  font-weight: 500;
}

.benchmark-label .crop {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.benchmark-bar-wrap {
  position: relative;
  height: 28px;
  background: rgba(13, 139, 139, 0.06);
  border-radius: 6px;
  overflow: hidden;
}

.benchmark-band {
  position: absolute;
  top: 0;
  height: 100%;
  background: rgba(13, 139, 139, 0.15);
  border-left: 1px dashed rgba(13, 139, 139, 0.4);
  border-right: 1px dashed rgba(13, 139, 139, 0.4);
}

.benchmark-you {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.benchmark-you.good { background: #2f9e44; }
.benchmark-you.mid  { background: #e08e0b; }
.benchmark-you.high { background: #c92a2a; }

.benchmark-value {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
}

.benchmark-value .delta {
  display: block;
  font-size: 12px;
  font-weight: 500;
}

.delta.good { color: #2f9e44; }
.delta.mid  { color: #c47800; }
.delta.high { color: #c92a2a; }

/* Scenario panel */
.scenario-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}

.scenario-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scenario-field input[type="number"],
.scenario-field input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(13, 139, 139, 0.2);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
}

.scenario-field .slider-wrap {
  display: flex;
  gap: 12px;
  align-items: center;
}

.scenario-field input[type="range"] {
  flex: 1;
}

.scenario-field .slider-value {
  min-width: 56px;
  text-align: right;
  font-weight: 600;
  font-size: 14px;
}

.scenario-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 20px 0;
}

.scenario-stat {
  background: var(--color-background-alt);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.scenario-stat .stat-label {
  font-size: 12px;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 6px;
}

.scenario-stat .stat-value {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
}

.scenario-stat .stat-value.positive { color: #2f9e44; }
.scenario-stat .stat-value.negative { color: #c92a2a; }

.scenario-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.scenarios-list {
  margin-top: 24px;
  border-top: 1px solid rgba(13, 139, 139, 0.1);
  padding-top: 20px;
}

.scenarios-list h3 {
  font-family: var(--font-heading);
  font-size: 15px;
  margin-bottom: 12px;
}

.scenario-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(13, 139, 139, 0.08);
  font-size: 14px;
}

.scenario-item .scenario-actions-inline {
  display: flex;
  gap: 8px;
}

.scenario-item button {
  font-size: 13px;
}

/* AI advisor sidebar */
.advisor-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid rgba(13, 139, 139, 0.1);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 90px;
}

.advisor-card h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.advisor-card .ai-badge {
  background: var(--color-primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.advisor-card .panel-sub {
  font-size: 13px;
  color: var(--color-text-light);
  margin-bottom: 18px;
}

.advisor-headline {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 14px;
  line-height: 1.4;
}

.advisor-section h4 {
  font-family: var(--font-heading);
  font-size: 13px;
  margin-top: 16px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-light);
}

.advisor-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.advisor-section li {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 10px;
  padding-left: 18px;
  position: relative;
}

.advisor-section li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}

.advisor-finding {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.advisor-finding .severity {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  margin-top: 2px;
}

.severity.high { background: rgba(201, 42, 42, 0.15); color: #c92a2a; }
.severity.medium { background: rgba(224, 142, 11, 0.18); color: #c47800; }
.severity.low { background: rgba(47, 158, 68, 0.15); color: #2f9e44; }

.advisor-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.advisor-actions button { font-size: 13px; padding: 8px 14px; }

.advisor-disclaimer {
  font-size: 11px;
  color: var(--color-text-light);
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(13, 139, 139, 0.1);
  line-height: 1.5;
}

.advisor-empty {
  background: var(--color-background-alt);
  padding: 20px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 14px;
  color: var(--color-text-light);
  margin-top: 12px;
}

/* Draft-email button inside the upside hero opportunity rows */
.upside-draft-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(13, 139, 139, 0.08) 0%, rgba(13, 139, 139, 0.14) 100%);
  color: var(--color-primary);
  border: 1px solid rgba(13, 139, 139, 0.25);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.upside-draft-email-btn:hover {
  background: linear-gradient(135deg, rgba(13, 139, 139, 0.16) 0%, rgba(13, 139, 139, 0.24) 100%);
  border-color: rgba(13, 139, 139, 0.45);
  transform: translateY(-1px);
}

.upside-draft-email-btn:active { transform: translateY(0); }

.upside-draft-email-btn svg {
  transition: transform 0.3s ease;
}

.upside-draft-email-btn:hover svg {
  transform: rotate(15deg);
}

/* Email draft modal */
.email-draft-modal {
  max-width: 640px;
}

.email-draft-modal h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.email-draft-modal .ai-sparkle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(13, 139, 139, 0.12) 0%, rgba(13, 139, 139, 0.20) 100%);
  color: var(--color-primary);
}

.email-draft-sub {
  font-size: 14px;
  color: var(--color-text-light);
  margin-bottom: 20px;
}

.email-draft-sub strong { color: var(--color-text); }

.email-draft-body {
  background: var(--color-background-alt);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin-bottom: 18px;
  min-height: 200px;
  max-height: 50vh;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid rgba(13, 139, 139, 0.08);
}

.email-draft-body .md-lite p,
.email-draft-body .md-lite .md-p {
  margin-bottom: 12px;
}

.email-draft-empty {
  color: var(--color-text-light);
  font-style: italic;
  text-align: center;
  padding: 40px 0;
}

.email-draft-error {
  background: rgba(201, 42, 42, 0.06);
  border-left: 4px solid #c92a2a;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: #7a2222;
}

.email-draft-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.email-draft-disclaimer {
  font-size: 11px;
  color: var(--color-text-light);
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(13, 139, 139, 0.1);
  line-height: 1.5;
}

@media (max-width: 600px) {
  .email-draft-modal { max-width: 100%; margin: 4% auto; }
  .email-draft-body { padding: 18px 16px; }
}

/* Toasts */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 5000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.toast.visible { opacity: 1; }

/* ============================================================
   Hero Widget — live data preview on the landing page
   ============================================================ */

.hero-widget {
  background: #ffffff;
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow:
    0 30px 60px -25px rgba(13, 139, 139, 0.25),
    0 0 0 1px rgba(13, 139, 139, 0.08);
  position: relative;
  overflow: hidden;
  animation: widget-rise 0.6s ease-out;
}

@keyframes widget-rise {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-widget::before {
  /* subtle gradient glow at top-right */
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(212, 165, 116, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.hero-widget-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  position: relative;
}

.hero-widget-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(13, 139, 139, 0.08);
  color: var(--color-primary);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.hero-widget-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}

.hero-widget-dot.live {
  background: #2f9e44;
  box-shadow: 0 0 0 0 rgba(47, 158, 68, 0.55);
  animation: widget-pulse-green 2s ease-in-out infinite;
}

@keyframes widget-pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 158, 68, 0.55); }
  50%      { box-shadow: 0 0 0 6px rgba(47, 158, 68, 0); }
}

.hero-widget-farm-meta {
  font-size: 11px;
  color: var(--color-text-light);
  text-align: right;
  line-height: 1.4;
}

/* The big number */
.hero-widget-stat {
  padding: 6px 0 14px;
}

.hero-widget-stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-text-light);
  margin-bottom: 6px;
}

.hero-widget-stat-value {
  font-family: var(--font-heading);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -1.4px;
  line-height: 1;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #0a6e6e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

.hero-widget-stat-unit {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-left: 2px;
}

.hero-widget-stat-fineprint {
  font-size: 12px;
  color: var(--color-text-light);
  line-height: 1.5;
}

/* The visualization */
.hero-widget-viz {
  background: var(--color-background-alt);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 14px;
}

.hero-widget-viz-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.hero-widget-viz-pct {
  font-size: 12px;
  color: #b06900;
  font-weight: 700;
}

.hero-widget-bar {
  position: relative;
  height: 34px;
  background: rgba(13, 139, 139, 0.05);
  border-radius: 8px;
  margin: 6px 0 10px;
}

.hero-widget-band {
  position: absolute;
  top: 4px;
  bottom: 4px;
  background: rgba(13, 139, 139, 0.13);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1.5px dashed rgba(13, 139, 139, 0.4);
  border-right: 1.5px dashed rgba(13, 139, 139, 0.4);
}

.hero-widget-band-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--color-primary);
  opacity: 0.7;
}

.hero-widget-dot-mark {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: left 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-widget-dot-mark.red {
  background: #c92a2a;
  animation: widget-pulse-red 2.2s ease-in-out infinite;
}

.hero-widget-dot-mark.mid {
  background: #c47800;
}

@keyframes widget-pulse-red {
  0%, 100% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(201, 42, 42, 0.55); }
  50%      { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 10px rgba(201, 42, 42, 0); }
}

.hero-widget-dot-label {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.hero-widget-dot-label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 3px solid transparent;
  border-top-color: #1a1a2e;
}

.hero-widget-viz-extra {
  font-size: 12px;
  color: var(--color-text-light);
  text-align: center;
}

.hero-widget-viz-extra strong {
  color: var(--color-text);
  font-weight: 700;
}

/* Foot row */
.hero-widget-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-widget-pills {
  display: flex;
  gap: 8px;
}

.hero-widget-mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.hero-widget-mini-pill.win {
  background: rgba(47, 158, 68, 0.08);
  color: #2f7a3e;
  border-color: rgba(47, 158, 68, 0.2);
}

.hero-widget-mini-pill.opp {
  background: rgba(212, 165, 116, 0.15);
  color: #8c5300;
  border-color: rgba(212, 165, 116, 0.4);
}

.hero-widget-mini-icon { font-size: 11px; }

.hero-widget-link {
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.hero-widget-link:hover {
  color: #0a6e6e;
}

@media (max-width: 980px) {
  .hero-widget { padding: 20px 18px; }
  .hero-widget-stat-value { font-size: 36px; }
  .hero-widget-farm-meta { display: none; }
}

/* ============================================================
   Sidebar (landing page collapsible left nav)
   ============================================================ */

:root {
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 64px;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: #ffffff;
  border-right: 1px solid rgba(13, 139, 139, 0.1);
  display: flex;
  flex-direction: column;
  z-index: 900;
  transition: width 0.22s ease, transform 0.22s ease;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.sidebar.collapsed { width: var(--sidebar-w-collapsed); }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(13, 139, 139, 0.08);
  min-height: 64px;
}

.sidebar.collapsed .sidebar-header {
  padding: 18px 0;
  justify-content: center;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-text);
  min-width: 0;
}

.sidebar-logo svg {
  width: 28px;
  height: 32px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.4px;
  color: var(--color-text);
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.sidebar.collapsed .sidebar-logo-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar-collapse-btn {
  background: rgba(13, 139, 139, 0.08);
  border: none;
  color: var(--color-primary);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover { background: rgba(13, 139, 139, 0.15); }

.sidebar.collapsed .sidebar-collapse-btn {
  position: absolute;
  top: 18px;
  right: -14px;
  background: #ffffff;
  border: 1px solid rgba(13, 139, 139, 0.2);
  box-shadow: var(--shadow-sm);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 10px;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text-light);
  font-weight: 500;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.sidebar-link:hover {
  background: rgba(13, 139, 139, 0.07);
  color: var(--color-primary);
}

.sidebar-link-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-link-icon svg { width: 20px; height: 20px; }

.sidebar-link-label {
  flex: 1;
  transition: opacity 0.15s ease;
}

.sidebar.collapsed .sidebar-link-label,
.sidebar.collapsed .sidebar-cta .sidebar-link-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

.sidebar.collapsed .sidebar-link,
.sidebar.collapsed .sidebar-cta {
  justify-content: center;
  padding: 10px;
  position: relative;
}

.sidebar-footer {
  padding: 14px 10px 20px;
  border-top: 1px solid rgba(13, 139, 139, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.sidebar-cta.secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid rgba(13, 139, 139, 0.18);
}

.sidebar-cta.secondary:hover {
  background: rgba(13, 139, 139, 0.06);
  color: var(--color-primary);
  border-color: rgba(13, 139, 139, 0.3);
}

.sidebar-cta.primary {
  background: var(--color-primary);
  color: #ffffff !important;
}

.sidebar-cta.primary:hover {
  background: #0a6e6e;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 10px;
  font-size: 12px;
  color: var(--color-text-light);
  word-break: break-word;
  min-width: 0;
}

.sidebar-user-email {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.sidebar.collapsed .sidebar-user { display: none; }

.sidebar-secondary-btn,
.sidebar-signout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(13, 139, 139, 0.18);
  color: var(--color-text-light);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
  width: 100%;
}

.sidebar-secondary-btn:hover {
  background: rgba(13, 139, 139, 0.06);
  color: var(--color-primary);
  border-color: rgba(13, 139, 139, 0.3);
}

.sidebar.collapsed .sidebar-secondary-btn {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .sidebar-secondary-btn .sidebar-link-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

.sidebar-signout:hover {
  background: rgba(201, 42, 42, 0.06);
  color: #c92a2a;
  border-color: rgba(201, 42, 42, 0.3);
}

.sidebar.collapsed .sidebar-signout {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .sidebar-signout .sidebar-link-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Main content shifts to make room for the sidebar */
.with-sidebar {
  padding-left: var(--sidebar-w);
  transition: padding-left 0.22s ease;
}

.with-sidebar.sidebar-collapsed { padding-left: var(--sidebar-w-collapsed); }

/* Mobile toggle (hamburger) */
.sidebar-mobile-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 850;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid rgba(13, 139, 139, 0.18);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}

.sidebar-mobile-toggle:hover { color: var(--color-primary); }

.sidebar-scrim {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 880;
  animation: fadeIn 0.18s ease;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
  }
  .sidebar.collapsed { width: 260px; }
  .sidebar.collapsed .sidebar-logo-text,
  .sidebar.collapsed .sidebar-link-label,
  .sidebar.collapsed .sidebar-cta .sidebar-link-label {
    opacity: 1;
    width: auto;
    overflow: visible;
    pointer-events: auto;
  }
  .sidebar.collapsed .sidebar-header { padding: 18px 16px; justify-content: space-between; }
  .sidebar.collapsed .sidebar-link,
  .sidebar.collapsed .sidebar-cta { justify-content: flex-start; padding: 10px 12px; }
  .sidebar.collapsed .sidebar-collapse-btn { position: static; background: rgba(13, 139, 139, 0.08); border: none; box-shadow: none; }
  .sidebar.mobile-open { transform: translateX(0); }
  .with-sidebar,
  .with-sidebar.sidebar-collapsed { padding-left: 0; }
  .sidebar-mobile-toggle { display: inline-flex; }
}

/* Contribute panel */
.contribute-panel {
  border-left: 4px solid var(--color-accent);
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.08) 0%, #ffffff 60%);
}

.contribute-slogan {
  margin-top: 4px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(212, 165, 116, 0.4);
  font-family: var(--font-heading);
  font-size: 15px;
  font-style: italic;
  font-weight: 600;
  color: var(--color-primary);
  letter-spacing: -0.2px;
  line-height: 1.45;
  max-width: 460px;
}

.contribute-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.contribute-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contribute-status.off {
  background: rgba(74, 74, 74, 0.1);
  color: var(--color-secondary);
}

.contribute-status.on {
  background: rgba(47, 158, 68, 0.15);
  color: #2f9e44;
}

.contribute-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
}

.contribute-counter {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid rgba(13, 139, 139, 0.15);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 16px 0;
}

.counter-num {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
}

.counter-meta {
  flex: 1;
  font-size: 14px;
  color: var(--color-text-light);
  line-height: 1.5;
}

.counter-meta strong {
  color: var(--color-text);
}

.counter-progress {
  height: 8px;
  background: rgba(13, 139, 139, 0.1);
  border-radius: 4px;
  margin-top: 8px;
  overflow: hidden;
}

.counter-progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.contribute-benefits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0;
}

.benefit-card {
  background: #fff;
  border: 1px solid rgba(13, 139, 139, 0.12);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.benefit-icon {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-accent);
  flex-shrink: 0;
}

.benefit-body strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.benefit-body span {
  font-size: 13px;
  color: var(--color-text-light);
  line-height: 1.5;
}

.contribute-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid rgba(13, 139, 139, 0.15);
  border-radius: var(--radius-sm);
}

.contribute-demo-cta {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #fbf6ee 0%, #f5ecd9 100%);
  border: 1px solid rgba(212, 165, 116, 0.35);
  border-radius: var(--radius-sm);
}

.contribute-demo-cta-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contribute-demo-cta-body strong {
  font-family: var(--font-heading);
  font-size: 15px;
  color: var(--color-text);
}

.contribute-demo-cta-body span {
  font-size: 13px;
  color: var(--color-text-light);
  line-height: 1.55;
}

.contribute-demo-cta .btn {
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .contribute-demo-cta {
    flex-direction: column;
    align-items: stretch;
  }
}

.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0; height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  border-radius: 28px;
  transition: 0.3s;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 22px; width: 22px;
  left: 3px; bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

.toggle-label {
  flex: 1;
  font-size: 14px;
}

.toggle-label strong { display: block; margin-bottom: 2px; }
.toggle-label span { color: var(--color-text-light); font-size: 13px; }

/* Vendor leaderboard — insight cards */

.vendor-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 8px;
}

.vendor-card {
  background: #ffffff;
  border: 1px solid rgba(13, 139, 139, 0.12);
  border-radius: var(--radius-md);
  padding: 18px 20px 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}

.vendor-card:hover {
  border-color: rgba(13, 139, 139, 0.22);
  box-shadow: 0 6px 18px -10px rgba(13, 139, 139, 0.25);
}

.vendor-card.expanded {
  border-color: rgba(13, 139, 139, 0.25);
}

.vendor-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(13, 139, 139, 0.08);
  margin-bottom: 14px;
}

.vendor-card-product {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.2px;
  line-height: 1.3;
  min-width: 0;
  word-break: break-word;
}

.vendor-card-meta {
  font-size: 11px;
  color: var(--color-text-light);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.vendor-card-hero {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 4px 0 12px;
}

.vendor-best-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f8d68d 0%, #e6a850 100%);
  color: #5e3d10;
  box-shadow:
    0 4px 12px -3px rgba(212, 165, 116, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.vendor-card-best-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #b06900;
  margin-bottom: 3px;
}

.vendor-card-hero-body { min-width: 0; }

.vendor-card-vendor {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vendor-card-hero-meta {
  font-size: 12px;
  color: var(--color-text-light);
  font-weight: 500;
}

.vendor-card-hero-meta strong {
  color: #2f7a3e;
  font-weight: 700;
}

.vendor-card-price {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.3px;
}

.vendor-card-rest {
  list-style: none;
  margin: 0 -4px;
  padding: 8px 0 4px;
  border-top: 1px dashed rgba(13, 139, 139, 0.15);
  animation: vendor-expand 0.22s ease-out;
}

@keyframes vendor-expand {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.vendor-card-row {
  display: grid;
  grid-template-columns: 1fr 70px 80px;
  gap: 10px;
  align-items: center;
  padding: 7px 4px;
  border-radius: 6px;
  font-size: 13px;
  transition: background 0.12s ease;
}

.vendor-card-row:hover {
  background: rgba(13, 139, 139, 0.04);
}

.vendor-card-row-name {
  color: var(--color-text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vendor-card-row-pct {
  text-align: right;
  font-size: 12px;
  font-weight: 600;
}

.vendor-card-row-pct.tone-low  { color: #2f7a3e; }
.vendor-card-row-pct.tone-mid  { color: var(--color-text-light); }
.vendor-card-row-pct.tone-high { color: #b06900; }

.vendor-card-row-price {
  text-align: right;
  font-weight: 600;
  color: var(--color-text);
}

.vendor-card-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 0 12px;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  transition: color 0.15s ease;
}

.vendor-card-toggle:hover { color: #0a6e6e; }

@media (max-width: 900px) {
  .vendor-cards-grid { grid-template-columns: 1fr; }
}

/* Receipt upload modal */
.upload-zone {
  border: 2px dashed rgba(13, 139, 139, 0.3);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  background: var(--color-background-alt);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--color-primary);
  background: rgba(13, 139, 139, 0.05);
}

.upload-zone strong { display: block; font-size: 16px; margin-bottom: 6px; }
.upload-zone span  { font-size: 13px; color: var(--color-text-light); }

.upload-preview {
  margin-top: 16px;
  max-width: 100%;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.extract-result {
  background: var(--color-background-alt);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 16px;
  font-size: 14px;
}

.extract-result h4 {
  font-family: var(--font-heading);
  font-size: 14px;
  margin-bottom: 10px;
}

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

.extract-field {
  display: flex;
  flex-direction: column;
}

.extract-field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-light);
  margin-bottom: 2px;
}

.extract-field span {
  font-size: 14px;
}

.confidence-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.confidence-badge.high   { background: rgba(47, 158, 68, 0.15); color: #2f9e44; }
.confidence-badge.medium { background: rgba(224, 142, 11, 0.18); color: #c47800; }
.confidence-badge.low    { background: rgba(201, 42, 42, 0.15); color: #c92a2a; }

/* Section heading helpers in panels */
.panel h2 .pill {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

.pill.ai { background: var(--color-primary); color: #fff; }
.pill.new { background: var(--color-accent); color: var(--color-text); }

@media (max-width: 600px) {
  .contribute-benefits { grid-template-columns: 1fr; }
  .extract-grid { grid-template-columns: 1fr; }
  .vendor-card-hero { grid-template-columns: 40px 1fr auto; gap: 10px; }
  .vendor-best-badge { width: 40px; height: 40px; }
  .vendor-best-badge svg { width: 20px; height: 20px; }
  .vendor-card-row { grid-template-columns: 1fr 60px 70px; gap: 6px; }
}

/* ============================================================
   Lender Packet (public read-only shared report)
   ============================================================ */

.lender-packet-shell {
  background: var(--color-background-alt);
  min-height: 100vh;
  padding: 0 0 60px;
}

.lender-packet-toolbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid rgba(13, 139, 139, 0.1);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.lender-packet-toolbar-actions {
  display: flex;
  gap: 10px;
}

.lender-packet-page {
  max-width: 880px;
  margin: 32px auto;
  padding: 0 20px;
}

.lender-packet-loading,
.lender-packet-error {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 40px;
  text-align: center;
  color: var(--color-text-light);
  box-shadow: var(--shadow-sm);
}

.lender-packet-error { color: #c92a2a; }

.lender-packet {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 48px 56px;
}

.packet-header {
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 24px;
  margin-bottom: 32px;
}

.packet-header-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.packet-header h1 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 6px;
  color: var(--color-text);
}

.packet-header-meta {
  font-size: 14px;
  color: var(--color-text-light);
  font-weight: 500;
}

.packet-header-generated {
  font-size: 12px;
  color: var(--color-text-light);
  margin-top: 8px;
  font-style: italic;
}

.packet-section {
  margin-bottom: 32px;
}

.packet-section-label {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-primary);
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(13, 139, 139, 0.15);
}

/* Margin upside hero */
.packet-upside {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.packet-upside-main {
  background: linear-gradient(135deg, rgba(13, 139, 139, 0.06) 0%, rgba(212, 165, 116, 0.08) 100%);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  border: 1px solid rgba(13, 139, 139, 0.12);
}

.packet-stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-text-light);
  margin-bottom: 6px;
}

.packet-stat-value {
  font-family: var(--font-heading);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #0a6e6e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: 6px;
}

.packet-stat-fineprint {
  font-size: 12px;
  color: var(--color-text-light);
  line-height: 1.45;
}

.packet-upside-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding-left: 8px;
}

.packet-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(13, 139, 139, 0.12);
  font-size: 13px;
}

.packet-stat-row:last-child { border-bottom: none; }

.packet-stat-row-label {
  color: var(--color-text-light);
  font-weight: 500;
}

.packet-stat-row-value {
  color: var(--color-text);
  font-weight: 700;
}

/* Tables */
.packet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.packet-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--color-text-light);
  padding: 8px 10px;
  border-bottom: 1px solid rgba(13, 139, 139, 0.12);
}

.packet-table th.num,
.packet-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.packet-table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(13, 139, 139, 0.06);
  color: var(--color-text);
}

.packet-table tr:last-child td { border-bottom: none; }

.packet-table tr.featured td {
  background: rgba(13, 139, 139, 0.05);
  font-weight: 600;
}

.packet-feature-marker {
  color: var(--color-accent);
  margin-right: 6px;
  font-weight: 700;
}

.packet-table .num.positive { color: #2f7a3e; font-weight: 600; }
.packet-table .num.negative { color: #c92a2a; font-weight: 600; }

.packet-empty-line {
  color: var(--color-text-light);
  font-style: italic;
}

.packet-footer {
  border-top: 1px solid rgba(13, 139, 139, 0.12);
  padding-top: 20px;
  margin-top: 12px;
}

.packet-footer p {
  font-size: 11px;
  color: var(--color-text-light);
  line-height: 1.55;
  margin: 0 0 8px;
}

@media (max-width: 720px) {
  .lender-packet { padding: 28px 22px; }
  .packet-upside { grid-template-columns: 1fr; }
  .packet-stat-value { font-size: 32px; }
  .packet-header h1 { font-size: 26px; }
}

/* Print styles — make the packet a clean PDF when printed */
@media print {
  body { background: #ffffff; }
  .lender-packet-shell { background: #ffffff; padding: 0; }
  .lender-packet-toolbar { display: none; }
  .lender-packet-page { margin: 0; padding: 0; max-width: none; }
  .lender-packet {
    box-shadow: none;
    border-radius: 0;
    padding: 32px 28px;
  }
  .packet-section { break-inside: avoid; }
  .packet-table { break-inside: avoid; }
  a { color: var(--color-text); text-decoration: none; }
}

/* Legacy shared report styles (still used by share/index.html) */
.report-shell {
  max-width: 760px;
  margin: 40px auto;
  padding: 0 20px;
}

.report-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px;
}

.report-card .report-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(13, 139, 139, 0.1);
}

.report-card h1 {
  font-family: var(--font-heading);
  font-size: 26px;
  margin-bottom: 6px;
}

.report-card .report-meta {
  font-size: 13px;
  color: var(--color-text-light);
}

/* Responsive */
@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .advisor-card { position: static; }
  .scenario-form { grid-template-columns: 1fr; }
  .scenario-results { grid-template-columns: 1fr; }
  .benchmark-row {
    grid-template-columns: 140px 1fr 80px;
  }
}

@media (max-width: 600px) {
  .auth-card { padding: 32px 22px; }
  .panel { padding: 22px 18px; }
  .cost-grid input { width: 80px; }
  .benchmark-row {
    grid-template-columns: 1fr;
  }
  .benchmark-value { text-align: left; }
}
