
@import url('https://fonts.googleapis.com/css2?family=Bowlby+One+SC&display=swap');

/* ========================================================================== 
   Karmail Scoped Styles – Structured Cleanup Phase
   ========================================================================== 

   1. Reset & Base Styles 
   2. Grid & Container Layouts 
   3. Card Front Styles 
   4. Card Back Styles 
   5. TAGS & META LABELS
   6. Comments (Back Side) 
   7. Vote Icons & Karmic Stamps 
   8. Flip Container & Transitions 
   9. Modal (Desktop Overlay) 
  10. HOMEPAGE / LANDING PAGE
  11. Media Queries (Mobile/Desktop) 
  12. Legacy or Temp Rules (To Review) 

========================================================================== */

/* ========================================
   GLOBAL: Remove top spacing on hero
   (Applies to ALL screen sizes)
   ======================================== */

body {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

body > *:first-child,
main,
.site-content,
#content {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

.karmail-hero-wrapper {
  margin-top: 0 !important;
}

.karmail-hero {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

.karmail-hero-inner {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

.karmail-hero-text {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

.karmail-logo {
  padding-top: 1rem !important;
}


/* 🟩 RESET & BASE CARD STYLES
   -------------------------------------------------------------------------- */
/* -------------------------------------
   Shared Global Variables (Single Root)
------------------------------------- */
:root {
  /* Layout */
  --card-max-w: 980px;
  --card-radius: 20px;
  --card-border: 3px;
  --card-border-color: #E6E7EB;
  --shadow-edge: rgba(230,231,235,1);
  --pad-x: 28px;
  --pad-top: 28px;
  --pad-bottom-front: 168px;
  --pad-bottom-back: 96px;

  /* Typography & Colors */
  --text: #0F172A;
  --muted: #6B7280;
  --link: #2563EB;

  /* Title Defaults */
  --title-size: 26px;
  --title-line-front: 1.5;
  --title-line-back: 1.5;
  --title-weight-front: 500;
  --title-weight-back: 500;

  /* Front Card Specifics */
  --comments-size: 26px;
  --stamp-size: 130px;
  --stamp-right: 40px;
  --stamp-bottom: 150px;
  --btn-font: 18px;
  --btn-left-right-inset: 28px;
  --btn-bottom: 76px;
  --btn-radius: 22px;
  --btn-max-width: 500px;

  /* Back Card Specifics */
  --vote-icon: 240px;
  --vote-gap: 40px;
  --reply-max-w: 760px;

  /* Footer */
  --foot-left: 28px;
  --foot-bottom: 16px;
  --foot-size: 16px;

/* ===========================
   Karmail Category Colors - VIBRANT
   =========================== */
--color-clear: #ed3d96;
--color-featured: #8B5CF6;
--color-annoyances: #DC2626;
--color-character-flaws: #92400E;
--color-confessions: #7C3AED;
--color-dating: #E11D48;
--color-etiquette: #D97706;
--color-exes: #BE123C;
--color-family: #059669;
--color-friendship: #4F46E5;
--color-health: #16A34A;
--color-infidelity: #991B1B;
--color-love: #DB2777;
--color-money: #047857;
--color-neighbors: #0891B2;
--color-parenting: #4338CA;
--color-pets: #D97706;
--color-pop-culture: #C026D3;
--color-roommates: #475569;
--color-social-media: #7C3AED;
--color-travel: #1E40AF;
--color-workplace: #374151;
}

/* ================================
   Karmail Category Pill Mapping
   ================================ */
.category-clear { background-color: var(--color-clear); color: #fff; }
.category-featured { background-color: var(--color-featured); color: #fff; }
.category-annoyances { background-color: var(--color-annoyances); color: #fff; }
.category-celebrity { background-color: var(--color-celebrity); color: #fff; }
.category-character-flaws { background-color: var(--color-character-flaws); color: #fff; }
.category-confessions { background-color: var(--color-confessions); color: #fff; }
.category-dating { background-color: var(--color-dating); color: #fff; }
.category-entertainment { background-color: var(--color-entertainment); color: #fff; }
.category-etiquette { background-color: var(--color-etiquette); color: #fff; }
.category-exes { background-color: var(--color-exes); color: #fff; }
.category-family { background-color: var(--color-family); color: #fff; }
.category-friendship { background-color: var(--color-friendship); color: #fff; }
.category-hall-of-fame { background-color: var(--color-hall-of-fame); color: #000; } /* black text */
.category-health { background-color: var(--color-health); color: #fff; }
.category-infidelity { background-color: var(--color-infidelity); color: #fff; }
.category-love { background-color: var(--color-love); color: #fff; }
.category-money { background-color: var(--color-money); color: #fff; }
.category-neighbors { background-color: var(--color-neighbors); color: #fff; }
.category-parenting { background-color: var(--color-parenting); color: #fff; }
.category-pets { background-color: var(--color-pets); color: #fff; }
.category-pop-culture { background-color: var(--color-pop-culture); color: #fff; }
.category-roommates { background-color: var(--color-roommates); color: #fff; }
.category-social-media { background-color: var(--color-social-media); color: #fff; }
.category-travel { background-color: var(--color-travel); color: #fff; }
.category-workplace { background-color: var(--color-workplace); color: #fff; }

/* Hover effect */
[class^="category-"]:hover {
  filter: brightness(85%);
  cursor: pointer;
}

/* Active/selected state for category pills */
.category-pill.active {
  filter: brightness(110%);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6);
  transform: scale(1.05);
  transition: all 0.2s ease;
}

/* Optional: smooth transition for all pills */
.category-pill {
  transition: all 0.2s ease;
}

/* Clear pill inactive state - needs higher specificity */
.category-pill.category-clear:not(.active) {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* Clear pill active state */
.category-pill.category-clear.active {
  opacity: 1;
  cursor: pointer;
  pointer-events: auto;
}
/* Option 2: Border style */
.category-pill.active {
  box-shadow: 0 0 0 4px #fff, 0 4px 12px rgba(0,0,0,0.5);
  transform: scale(1.08);
}

.karmail-filter-section {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: #fff;
  padding: 4rem 0 1rem; /* Remove duplicate "padding:" */
  box-shadow: 0 2px 4px rgba(0,0,0,0);
}

.karmail-category-menu {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 1rem; /* Side padding for mobile */
}

/* Add space below fixed header so content isn't hidden */
.karmail-rating-banner {
  margin-top: 0px; /* Adjust this to match your filter section height */
}


/* Remove box-shadow if you don't want it */

/* -------------------------------------
   Common Shell Styles (Both Sides)
------------------------------------- */

/* -- Shared Element Styles -------------------------------------------------- */
/* These styles apply across both front and back cards and define core 
   layout/typography for common components. 
   Only include here once confirmed stable and not overridden elsewhere.
*/

.km-title {
  font-size: var(--title-size);
  font-weight: var(--title-weight-front);
  line-height: var(--title-line-front);
  margin-bottom: 18px;
  color: var(--text);
}

.km-recipient-replied {
  font-size: 16px;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 12px;
}

/* Visual base with drop-shadow layering (golden) */
.km-card {
  position: relative;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  border: var(--card-border) solid var(--card-border-color);
  border-radius: var(--card-radius);
  padding: var(--pad-top) var(--pad-x);
  max-width: var(--card-max-w);
  margin: 24px auto;
  background-clip: padding-box;
  filter:
    drop-shadow(4px 0 0 var(--shadow-edge))
    drop-shadow(4px 10px 0 var(--shadow-edge));
}

/* Final .km-card base style – override for visual shadow depth */
.km-card {
  background: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
  overflow: visible; /* let shadow round out */
  padding: var(--pad-top) var(--pad-x) var(--pad-bottom-front);
  box-sizing: border-box;
}

.category-pill {
  display: inline-block;
  padding: 4px 12px;
  margin: 2px 6px 2px 0;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
  line-height: 1.4;
  white-space: nowrap;
}

/* ── Common Title & Reply Shell Styles ── */

.km-title {
  font-size: var(--title-size);
  font-weight: var(--title-weight-front);
  line-height: var(--title-line-front);
  margin-bottom: 18px;
  color: var(--text);
}

.km-recipient-replied {
  font-size: 16px;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 12px;
}

.km-card .km-foot {
  display: flex;
  justify-content: space-between;   /* push date left, ID right */
  align-items: center;
  font-size: 0.75rem;
  font-family: 'Inter', monospace;
  color: var(--muted);
  margin-top: 12px;

  /* ✅ keep inside same gutters as card text */
  padding: 0 var(--pad-x);
  width: calc(100% - (var(--pad-x) * 2));
  box-sizing: border-box;
}

/* 🟫 GRID & CONTAINER LAYOUTS
   -------------------------------------------------------------------------- */

.km-grid-page {
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
 
}

.km-card-grid {
  display: block; /* Mobile default: stacked layout */
  width: 100%;
}



@media (min-width: 640px) {
  .km-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .km-card-grid > .km-flip-container {
    margin-bottom: 0; /* Grid handles spacing */
  }
}

@media (min-width: 960px) {
  .km-card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
/* 📱 RESPONSIVE GRID: Force 2 columns ONLY on iPad portrait (1024px wide) */
@media (width: 1024px) {
  .km-card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}



/* 🟨 CARD FRONT STYLES
   -------------------------------------------------------------------------- */

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

.card-front .km-card {
  padding-bottom: var(--pad-bottom-front);
  position: relative;
}

.card-front .km-title {
  font-size: var(--title-size);
  line-height: var(--title-line-front);
  font-weight: var(--title-weight-front);
  margin: 40px 0 12px;
}

.card-front .km-recipient-replied {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 30px 0 0 20px;
  font-size: var(--comments-size);
}

.card-front .km-recipient-replied .km-flower-front img {
  width: 65px !important;
  height: auto !important;
  margin-top: 12px !important;
}

.card-front .km-comments img {
  width: 40px;
  height: 40px;
}

.card-front .km-comments a {
  color: var(--link);
  font-weight: 700;
  text-decoration: none;
}

.card-front .km-stamp {
  position: absolute;
  margin-top: 0.25rem; /* or try 0.25rem for tighter spacing */
  right: var(--stamp-right);
  bottom: var(--stamp-bottom);
  width: var(--stamp-size);
  height: auto;
  opacity: .95;
  z-index: 2;
}

.card-front .km-btn {
  position: absolute;
  left: var(--btn-left-right-inset);
  right: var(--btn-left-right-inset);
  bottom: var(--btn-bottom);
  display: block;
  text-align: center;
  text-decoration: none;
  background: linear-gradient(180deg,#2563FF 0%,#1D4ED8 100%);
  color: #fff;
  font-weight: 700;
  font-size: var(--btn-font);
  line-height: 1;
  padding: 15px 8px;
  border-radius: var(--btn-radius);
  box-shadow: 0 6px 14px rgba(29,78,216,.2);
  width: min(70%, var(--btn-max-width));
  margin: 0 auto;
}

/* ── Flip Trigger Button (Front Side) ── */

.card-front .flip-trigger {
  position: absolute;
  left: var(--btn-left-right-inset);
  right: var(--btn-left-right-inset);
  bottom: var(--btn-bottom);
  font-size: var(--btn-font);
  background: linear-gradient(180deg,#2563FF 0%,#1D4ED8 100%);
  color: white;
  padding: 16px;
  border: none;
  border-radius: var(--btn-radius);
  text-align: center;
  cursor: pointer;
  z-index: 3;
  max-width: var(--btn-max-width);
  margin: 0 auto;
}
/* FINAL TITLE OVERRIDE — prevents variable conflicts */
.card-front .km-title {
  font-size: 22px !important;
}
/* Flower icon override */
.km-flower-front {
  width: 40px !important;
  height: auto !important;
}

/* Stamp icon override */
.km-stamp {
  width: 100px !important;
  height: auto !important;
  margin-top: 0px;  /* adjust if you want less space from title */
}


/* 🟦 CARD BACK STYLES
   -------------------------------------------------------------------------- */

.card-back .km-card {
  padding-bottom: var(--pad-bottom-back);
}

.card-back .km-title {
  font-size: 22px !important;
  line-height: var(--title-line-back);
  font-weight: var(--title-weight-back);
  margin: 40px 0 18px;
}

/* 📌 Pinned Recipient Reply (Back Side) */
.card-back .km-pinned-reply {
  max-width: var(--reply-max-w);
  background: #f8f9fb;
  border: 1px solid #d0d5dd;
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.05);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 24px auto 12px auto;
  font-size: 16px;
}

/* 🧠 Pinned Reply Header */
.card-back .km-pr-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
}

  .card-back .km-pr-time {
    margin-top: 0 !important;
    line-height: 1.2 !important;
}

  .card-back .km-count {
    margin-top: 0px;
    line-height: 1.15 !important;
}






.card-back .km-flower-back img {
  width: 26px;
  height: auto;
  display: block;
  margin-top: 6px;
}

/* 📌 Pinned Reply Meta — RESTORED */
.card-back .km-pr-meta {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}

.card-back .km-pr-label,
.card-back .km-pr-time {
  display: block;
  width: 100%;
  margin-top: -2px;
  white-space: normal;
}

.card-back .km-pr-label {
  font-weight: 600;
  font-size: 1.2rem !important;
  color: #0F172A;
  line-height: 1.3;

  white-space: nowrap;          /* force one line */
  overflow: visible;            /* allow full label */
  text-overflow: unset;         /* remove ellipsis */
}

.card-back .km-pr-time {
  font-size: 0.85rem !important;
  color: var(--muted);
  line-height: 1.4;
}

.card-back .km-pr-meta {
  flex-grow: 1;
  min-width: 0;
}

/* 📝 Pinned Reply Body */
.card-back .km-pr-body {
  font-size: 16px;
  line-height: 1.4;
  color: #111827;
  margin: 4px 0;
}

@media (max-width: 768px) {
  .km-pr-label {
    font-size: 0.85rem !important; /* or try 0.875rem for exact balance */
  }

  .km-pr-time {
    font-size: 0.65rem !important; /* smaller than label to reduce visual dominance */
  }
}

/* ⚪ FOOTER META (Back Side) */

.km-foot {
  position: absolute;
  left: var(--foot-left);
  bottom: var(--foot-bottom);
  font-size: var(--foot-size);
  color: var(--muted);
  white-space: nowrap;
}
/* FINAL TITLE OVERRIDE — prevents variable conflicts */
.km-foot .sep {
  margin: 0 12px;
}

/* ⚪ TAGS & META LABELS
   -------------------------------------------------------------------------- */

.km-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.km-pill {
  background: var(--pill-bg);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 14px;
  white-space: nowrap;
}

/* ⚫ COMMENTS SECTION (Back Side Only)
   -------------------------------------------------------------------------- */

.card-back .km-comments {
  margin-top: 6px;
  margin-bottom: 18px;
}

.card-back .km-comments-preview {
  display: block;
}

.card-back .km-comments-link {
  display: inline-block;
  color: var(--link);
  font-weight: 700;
  text-decoration: none;
  margin: 6px 0 10px;
}

.card-back .km-comment-list {
  display: block;
  width: 100%;
  margin: 4px 0 0 0;
  margin-right: 24px;
  padding: 0;
  max-width: 640px;
}

.card-back .km-comment {
  display: block;
  width: 100%;
  max-width: 100%;
}

.card-back .km-comment-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 2px;
  font-size: 13px;
  color: var(--muted);
}

.card-back .km-comment-author {
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.card-back .km-comment-body {
  font-size: 16px;
  line-height: 1.4;
}

.card-back .km-add-comment {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  margin: 24px auto 10px;
  width: 100%;
  max-width: 680px;
}

.card-back .km-add-btn {
  background: #1D4ED8;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 14px;
  align-self: center;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0.75rem auto 0;
}

.card-back .km-add-btn:hover {
  background: #1846C7;
}
.km-add-comment .km-input {
  flex: 1 1 auto;
  min-width: 0;
}
.card-back .km-input {
  background: #F5F6F8;
  border: 1px solid #E0E3E7;
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  resize: vertical;
  min-height: 48px;
  width: 80%;
  flex: 0 1 80%;
}
.card-back .km-input::placeholder {
  color: #9AA3AE;
}




/* 🟪 VOTE ICONS & STAMPS
   -------------------------------------------------------------------------- */

.card-back .km-vote {
  max-width: var(--reply-max-w);
  margin: 24px auto 0;
}

.card-back .km-vote-title {
  font-size: 2.5rem;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--text);
  text-align: center;
}

.card-back .km-vote-options {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: var(--vote-gap);
  padding: 0 12px;
  margin: 16px auto 0px auto;
  flex-wrap: nowrap;
}

.card-back .km-vote-option {
  width: 200px;
  max-width: 240px;
  padding: 6px;
  border: none;
  border-radius: 12px;
  display: flex;
  gap: 0rem; /* tighten vertical spacing between icon and count */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-align: center;
  background: transparent !important;
}

.card-back .km-vote-option img {
  width: var(--vote-icon);
  max-width: 130px;
  height: auto;
  display: block;
  margin-bottom: -20px; /* remove any image spacing */
  will-change: transform, filter;
}

.card-back .km-count {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  margin: 0px 0 8px;
}

.card-back .km-stamp {
  display: none;
}
/* Vote Icon Image Swaps (Hover + Click Effects) */
.km-vote-option.km-yks img {
  content: url('/wp-content/themes/pro-child/karmail-assets/icon-vote-yks.png');
  transition: filter 0.2s ease, transform 0.2s ease;
}

.km-vote-option.km-yks:hover img,
.km-vote-option.km-yks.active img {
  content: url('/wp-content/themes/pro-child/karmail-assets/icon-vote-yks-active.png');
}

.km-vote-option.km-yks.off img {
  content: url('/wp-content/themes/pro-child/karmail-assets/icon-vote-yks-off.png');
}

.km-vote-option.km-ykds img {
  content: url('/wp-content/themes/pro-child/karmail-assets/icon-vote-ykds.png');
  transition: filter 0.5s ease, transform 0.5s ease;
}

.km-vote-option.km-ykds:hover img,
.km-vote-option.km-ykds.active img {
  content: url('/wp-content/themes/pro-child/karmail-assets/icon-vote-ykds-active.png');
}

.km-vote-option.km-ykds.off img {
  content: url('/wp-content/themes/pro-child/karmail-assets/icon-vote-ykds-off.png');
}

.km-vote-option:hover img {
  transform: scale(1.05);
}

/* 🟧 FLIP CONTAINER & TRANSITIONS (Mobile Only)
   -------------------------------------------------------------------------- */



.km-flip-container .card-front {
  transform: rotateY(0deg);
  z-index: 2;
}

.km-flip-container .card-back {
  transform: rotateY(180deg);
  z-index: 1;
}

.km-flip-container.flipped .card-front {
  transform: rotateY(180deg);
  z-index: 1;
}

.km-flip-container.flipped .card-back {
  transform: rotateY(0deg);
  z-index: 2;
}



/* 🟥 DESKTOP MODAL OVERRIDES
   -------------------------------------------------------------------------- */

.km-modal .km-pill {
  background: var(--pill-bg);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 14px;
}
.card-back .km-vote-option img {
  width: 240px !important;
  height: auto !important;
  display: block;
  margin-bottom: 0px;
}
.card-back .km-vote-option img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 0px; /* tighter gap than default */
  }
  .card-back .km-btn {
  position: absolute;
  left: var(--btn-left-right-inset);
  right: var(--btn-left-right-inset);
  bottom: var(--btn-bottom);
  display: block;
  text-align: center;
  text-decoration: none;
  background: linear-gradient(180deg, #2563FF 0%, #1D4ED8 100%);
  color: #fff;
  font-weight: 700;
  font-size: var(--btn-font);
  line-height: 1;
  padding: 16px 0;
  border-radius: var(--btn-radius);
  box-shadow: 0 6px 14px rgba(29, 78, 216, 0.2);
  width: min(80%, var(--btn-max-width));
  margin: 0px auto;
}

.km-btn.flip-close {
  display: block;
  text-align: center;
  text-decoration: none;
  background: linear-gradient(180deg, #2563FF 0%, #1D4ED8 100%);
  color: #fff;
  font-weight: 700;
  font-size: var(--btn-font);
  line-height: 1;
  padding: 15px 8px;
  border-radius: var(--btn-radius);
  box-shadow: 0 6px 14px rgba(29, 78, 216, 0.2);
  width: min(80%, var(--btn-max-width));
  margin: 2rem auto 0;
  cursor: pointer;
  position: static;
}
/* === Smooth Modal Transition === */
/* Applies global fade + slide-up effect to modal */
#km-modal {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.7s ease;
}

#km-modal.km-show {
  visibility: visible;
  opacity: 1;
}

.km-modal-content {
  opacity: 0;
  transform: translateY(-30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

#km-modal.km-show .km-modal-content {
  opacity: 1;
  transform: translateY(0);
}

body.modal-open {
  overflow: hidden;
  position: relative;
}

body.modal-open .km-card-grid {
  transform: none !important;
  top: 0 !important;
  position: static !important;
}

/* 🟦 HOMEPAGE / LANDING PAGE
   -------------------------------------------------------------- */
.karmail-hero {
  padding: 60px 20px;
  background: white;
}

.karmail-hero-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end; /* 🔥 Changed from center to bottom-align */
  gap: 3rem;
  padding: 3rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.karmail-hero-text {
  flex: 1 1 500px;
  max-width: 600px; /* 💥 NEW: Keeps left column from pushing guru off */
  padding-right: 2rem;
}

.karmail-hero-illustration {
  flex: 0 0 300px;
  max-width: 300px;
}

.karmail-logo {
  width: 360px; /* or any size you like */
  height: auto; /* maintains aspect ratio */
  display: block;
}


.karmail-hero-text {
  padding-right: 2rem;
}

.karmail-hero-guru img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.karmail-hero-text h1 {
  font-size: 56px;
  font-weight: 700;
  color: #0c2340;
  margin-bottom: 20px;
  line-height: 1.0;
}
.karmail-heading {
  font-size: 56px;
  font-weight: 700;
  margin-top: 12px;
}

.karmail-subheading {
  font-size: 24px;
  color: #4a5a6a;
  line-height: 1.2;
  margin-bottom: 20px;
}

.karmail-subtext {
  font-size: 20px;
  color: #4a5a6a;
  line-height: 1.5;
  margin-bottom: 24px;
  white-space: normal;         /* ✅ allow wrapping */
  overflow: visible;           /* ✅ allow full content */
  text-overflow: unset;        /* ✅ disable truncation */
}

.karmail-btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 999px;
  background-color: #1073ba;
  color: white;
  text-decoration: none;
  white-space: nowrap;
}

.karmail-how {
  font-size: 14px;
  margin-top: 12px;
  color: #0c2340;
}

.karmail-how a {
  color: #0056cc;
  font-weight: bold;
  margin-left: 4px;
  text-decoration: none;
}

.karmail-hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.karmail-cta-note {
  font-size: 0.9rem;
  max-width: 400px;
  color: #001c3d;
  line-height: 1.4;
}

.karmail-hero-illustration {
  flex: 0 0 500px;    /* 💥 Wider than before for large image */
  max-width: 500px;
}

.karmail-hero-illustration img {
  width: 100%;        /* scales with parent */
  height: auto;
  display: block;
}

.karmail-rating-banner {
  text-align: center;
  margin: 50px auto 50px;
  padding: 20px 0px;
  width: 100%;
  max-width: 100%;
}

/* ⭐ Stars with hover pulse */
.karmail-stars {
  display: inline-block;
  background-color: #8cc63f;
  padding: 8px 10px;
  margin-bottom: 0px;
  padding-left: 14px; /* 🎯 Nudge stars right */
  border-radius: 2px;
  font-size: 16px;
  color: white;
  letter-spacing: 8px;
  font-family: Arial, sans-serif;
  transition: background-color 0.3s ease;
}

.karmail-stars span {
  display: inline-block;
  transition: transform 0.2s ease;
}

.karmail-stars span:hover {
  transform: scale(1.2);
}


/* 🔒 KEEP aligns everything left for mobile and desktop */
.km-grid-page {
  text-align: left;
}



/* 🩶 FORM STYLES (Send A Karmail)
-------------------------------------------------------------------------- */


.karmail-form-wrapper,
.karmail-form-wrapper label,
.karmail-form-wrapper .karmail-form-terms,
.karmail-form-wrapper .karmail-form-terms label {
  font-family: Georgia, serif;
  font-size: 22px;
  color: #fff;
}

.karmail-form-wrapper a.terms {
  font-family: Arial, sans-serif !important;
}

.karmail-form-wrapper {
    width: 98%;
    max-width:800px;
    padding-left: 20px;
    height: auto;
    margin: 0px auto;
    border-radius: 50px;
    -moz-border-radius: 50px;
    -webkit-border-radius: 50px;
    -khtml-border-radius: 50px;
	  position: relative;
  	border: 10px solid #8cc63f;
    background-color: #1073ba;
}

.karma-form-title {
  font-family: 'Bowlby One SC', sans-serif;
  font-size: 5rem;
  text-align: center;
  color: #8cc63f;
  margin: 40px 0 0px;
  line-height: 4.5rem;
  letter-spacing: 2px; /* Adjust this value as needed */
  white-space: nowrap;
  
}


.karmail-form-wrapper sup {
  font-family: Arial;
  font-size: 0.2em;
  vertical-align: top;
  position: relative;
  top: 1.2em;
  margin-left: .5rem;
}

.karmail-form-body {
  padding: 0 20px 20px 20px;
}

.karmail-form-wrapper .row {
  margin-bottom: 0px;
}

.karmail-form-wrapper .col {
  display: inline-block;
  margin: 0 0px 0 0px;
}

.karmail-form-wrapper label {
  display: inline-block;
  font-weight: bold;
  margin-right: 10px;
  margin-top: 10px;
  font-size: 1.5rem;
  
}

.karmail-form-wrapper input[type="text"] {
  font-size: 1rem;
  padding: 5px;
  border: 3px solid #8cc63f;
  border-radius: 5px;
  color: #000;
  margin: 0 0 0 0px;
  

}

.karmail-form-wrapper input[type="email"] {
  font-size: 1rem;
  padding: 5px;
  border: 3px solid #8cc63f;
  border-radius: 5px;
  color: #000;
  width: 45%;
  
}

.karmail-form-wrapper textarea {
  font-size: 1rem;
  padding: 5px;
  border: 3px solid #8cc63f;
  border-radius: 5px;
  color: #000;
  width: 95%;
  height: 100px;
  resize: vertical;
  margin: 0 0 20px 0px;
  }

.karmail-form-wrapper .karmail-form-comma {
  font-weight: bold;
  padding: 0 5px;
  font-size: 1.5rem;
}

.karmail-form-wrapper .karmail-form-terms {
  margin-top: 10px;
  font-size: 14px;
  font-family: Arial, sans-serif;
}

.karmail-form-wrapper .karmail-form-terms label {
  font-size: 1rem; /* or whatever size you had before */
  display: inline-block;
}

.karmail-form-wrapper .karmail-form-terms input[type="checkbox"] {
  vertical-align: middle;
  margin-right: 8px;
}



.karmail-form-wrapper .karmail-form-button {
  float: right;
  margin-top: -3rem;
  margin-right: 2rem;
  background: #006fbd;
  border: 4px solid #8cc63f;
  border-radius: 24px;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 600;
  padding: .8rem 1.6rem;
  cursor: pointer;
  text-shadow: none;
  box-shadow: none;
  

}
.karmail-form-wrapper .karmail-form-button:hover {
  background: #8cc63f;
  border: 4px solid #8cc63f;
  opacity: 0.9;
  box-shadow: none;
  text-shadow: none;
  color: #fff;
}
.karmail-form-wrapper a.terms {
  color: #fff;
  text-decoration: underline;
}

.karmail-form-wrapper .karmail-message {
    white-space: pre-line;
}

.karmail-form-wrapper .karmail-message.success {
    background-color: #ffffff;
    border: 3px solid #8cc63f;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 16px;
    color: #000000;
    margin-top: 50px;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
}

.karmail-form-wrapper .karmail-message.success p {
    margin: 5px 0;
}

.karmail-form-wrapper .karmail-message.error {
    color: red;
    font-weight: bold;
    text-align: center;
    margin-top: 15px;
}

@media screen and (max-width: 480px) {
  .karmail-form-wrapper .karmail-form-button {
    width: calc(100% - 40px);
    margin: 20px auto 0;
  }
} 

@media screen and (max-width: 768px) {
  .karmail-form-wrapper .karmail-form-terms {
    flex-wrap: wrap;
    display: flex;
    align-items: flex-start;
    font-size: 0.9rem;
    font-family: Arial, sans-serif;
    color: #fff;
    line-height: 1.4;
    gap: 0.4rem;
  }

  .karmail-form-wrapper .karmail-form-button {
    display: block !important;
    float: none !important;
    clear: both !important;
    margin: 1.5rem auto 0 auto !important;
    position: static;
    width: 100%;
    max-width: 300px;
  }

  .karmail-form-wrapper .karmail-form-terms input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
  }

  .karmail-form-wrapper .karmail-form-terms a.terms {
    text-decoration: underline;
    color: #fff;
    white-space: normal;
  }

  .karmail-form-wrapper .karma-form-title {
    font-size: 4rem !important;
    line-height: 1.0 !important;
    word-break: break-word;
    white-space: normal;
  }
}

/* ======================================================
   🟦 CATEGORY FILTER STYLES (READ KARMAIL PAGE)
   ====================================================== */
/* Read Karmail Page Background - Grid Area Only */
.km-grid-page {
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  background-color: #eff3f7;
  box-shadow: inset 0 0 100px 40px rgba(255, 255, 255, 0.8);
}


  @media (max-width: 768px) {
  .km-grid-page {
    background-color: transparent;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    box-shadow: inset 0 0 100px 40px rgba(255, 255, 255, 0.8);
    padding: 30px 20px 20px 20px;
  }
}
  
  /* Add padding back to the card grid itself, not the page wrapper */
  .km-card-grid {
    padding: 30px 20px 20px 20px;
  }
}

/* Add space above pills */
.karmail-filter-section {
  padding: 3rem 0 1rem; /* Increased top padding from 4rem to 5rem */
}

/* Desktop Pills Row */

.karmail-rating-banner--read {
  text-align: center !important;
  margin-top: -10px !important;
}

.karmail-logo {
  text-align: center;
  width: 100%;
}

.page-logo {
  display: block;
  margin: 0 auto 1.5rem auto;
  max-width: 260px;
}
.page-logo { float: none !important; }


.karmail-category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem auto 2rem;
  justify-content: center;
}
.karmail-category-menu {
  max-width: 1100px;
  margin: 0 auto !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 8px 8px; /* row-gap column-gap */
  padding: 15px 60px;
}

.karmail-category-filter .category-pill {
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: white;
  text-transform: capitalize;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

.karmail-category-filter .category-pill:hover {
  transform: scale(1.05);
}

/* Active state for filtering (optional) */
.karmail-category-filter .category-pill.active {
  box-shadow: 0 0 0 3px #00000022;
}

/* Mobile Dropdown */
.karmail-category-dropdown {
  margin: 1rem auto 2rem;
  text-align: center;
}

.karmail-category-dropdown button {
  padding: 0.6rem 1rem;
  border-radius: 20px;
  font-size: 1rem;
  background: #444;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}

.karmail-category-dropdown button:hover {
  background: #666;
}

#karmailDropdownMenu {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  padding: 0.5rem;
  background: #f9f9f9;
  border-radius: 10px;
  border: 1px solid #ccc;
}

#karmailDropdownMenu label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
}

#karmailDropdownMenu input[type="checkbox"] {
  transform: scale(1.2);
}

/* Category Color Pills in Dropdown */
.pill-color {
  padding: 0.3rem 0.7rem;
  border-radius: 15px;
  color: white;
  font-weight: 500;
  font-size: 0.85rem;
}

/* Sample Color Definitions (already present in your variables or elsewhere) */
.pill-annoyances    { background-color: #B22222; }
.pill-celebrity     { background-color: #1E90FF; }
.pill-character     { background-color: #8B4513; }
/* ... add all other category pills using your official golden palette ... */

/* Responsive visibility */
.desktop-only {
  display: block;
}
.mobile-only {
  display: none;
}

/* Mobile-only pills dropdown visible below 768px */
@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }
  .mobile-only {
    display: block;
  }
}





/* ⚪ MEDIA QUERIES & FINAL ADJUSTMENTS
   -------------------------------------------------------------------------- */

/* 🖥️ DESKTOP: Disable Flip, Enable Modal */
@media (min-width: 769px) {
  .km-flip-container .card-front {
    display: block !important;
    position: static !important;
    transform: none !important;
  }

  .km-flip-container .card-back {
    display: none !important;
    position: static !important;
    transform: none !important;
  }

  .card-back .km-input {
    flex: 1;
    margin: 0;
  }

  .card-back .km-add-btn {
    margin: 0;
    padding: 10px 16px;
    font-size: 14px;
    white-space: nowrap;
    height: 42px;
    align-self: flex-start;
  }

  #km-modal {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
  }

  body.km-modal-open #km-modal {
    display: flex !important;
  }

  .km-modal-content {
    max-width: 780px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    padding: 2rem;
    position: relative;
  }

  .km-modal-body.card-back {
    display: block;
    padding: 0;
  }

  body.km-modal-open .km-modal-body.card-back .km-card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
  }

  body.km-modal-open .card-back .km-comments,
  body.km-modal-open .card-back .km-recipient-replied,
  body.km-modal-open .card-back .km-vote {
    display: block;
    margin-top: 2rem;
  }

  #km-modal .flip-close {
    display: block;
    margin: 2rem auto 0;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(180deg, #2563FF 0%, #1D4ED8 100%);
    color: white;
    border-radius: 22px;
    padding: 16px 24px;
    width: min(80%, 360px);
    box-shadow: 0 6px 14px rgba(29, 78, 216, 0.2);
    cursor: pointer;
    text-decoration: none;
  }
}

/*  Maintains consistent height on desktop card fronts for modal layout */
@media (min-width: 769px) {
  .card-front .km-card {
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
}

@media (min-width: 769px) {
  .km-vote-option {
    display: flex !important;
    flex-direction: column !important;  /* 🔑 force vertical stacking */
    align-items: center !important;
    justify-content: center !important;
  }

  .km-vote-option img {
    display: block !important;
    margin-bottom: 24px !important; /* space between icon and number */
  }

  .km-vote-option .km-count {
    margin-top: 14px !important; 
    display: block !important;
  }
}

/* Flip & Stacking Core Fixes */

@media (max-width: 768px) {
  .km-card-grid > .km-flip-container {
    position: relative;
    width: 100%;
    margin-bottom: 5.5rem;
    min-height: 530px; /* Unified min-height for consistency */
  }

  .km-flip-container .card-front,
  .km-flip-container .card-back {
    margin-bottom: 0;
  }

  .km-card {
    padding-bottom: 2.5rem;
  }

  .card-back .km-card {
    padding-bottom: 4rem;
  }

  .km-vote-section,
  .km-card-footer {
    margin-bottom: 1.5rem;
  }

  .km-flip-container.flipped {
    display: block;
  }

  .km-flip-container.flipped .card-back {
    display: block;
    position: relative;
  }

  .km-flip-container.flipped .card-front {
    display: none;
  }
  .km-flip-container {
  margin-bottom: 5.5rem;
}
}

/* Title Clamp Fix */
@media (max-width: 768px) {
  .card-front .km-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
    overflow: hidden;
  }
}

/* Spacing Between Front Content and Stamps */
@media (max-width: 768px) {
  .card-front .km-card {
    min-height: 530px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .card-front .km-card::after {
    content: '';
    display: block;
    height: 2rem;
  }
}

/* Flip Animation & Height Handling */
@media (max-width: 768px) {
  .km-flip-container {
    transition: min-height 0.4s ease;
  }

  .km-flip-container:not(.flipped) {
    min-height: 530px;
  }

  .km-flip-container.flipped {
    min-height: auto;
  }

  .km-card-grid > .km-flip-container:not(.flipped) {
    margin-bottom: 3rem;
  }

  .km-card-grid > .km-flip-container.flipped {
    margin-bottom: 1.5rem;
  }

  .km-flip-container.flipping .card-back {
    opacity: 0;
    pointer-events: none;
    transform: rotateY(180deg);
  }
}

/* Force Stack Behavior / Positioning Fixes */
@media (max-width: 768px) {
  .km-flip-container {
    display: block !important;
    position: relative !important;
    overflow: visible !important;
  }

  .km-flip-container:not(.flipped) {
    min-height: auto !important;
  }

  .km-flip-container.flipped {
    min-height: 100vh !important;
  }

  .card-front,
  .card-back {
    position: relative !important;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    min-height: 100% !important;
  }
}

/* Flip Open/Close Animation (Card Back Expansion)  */
@media (max-width: 768px) {
	  .km-flip-container .card-back {
	    max-height: 0;
	    overflow: hidden;
	    transition: max-height 0.3s ease;
	  }

	  .km-flip-container.flipped .card-back {
	    max-height: 200vh; /* Big enough to allow full height */
	    overflow: visible;
	  }
	}
	
/* Final Spacing Tightening (Cards Stacked)*/
@media (max-width: 768px) {
  .km-flip-container {
    margin-bottom: 1rem !important; /* reduce spacing between stacked cards */
  }
}
/* 📵 FORCE SINGLE COLUMN ON ALL MOBILE DEVICES (up to iPad width) */
@media (max-width: 1023px) {
  .km-card-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .card-front .km-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    overflow: hidden;
  }
}
@media (min-width: 1025px) {
  .card-front .km-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
  }
}
/* Tighter button sizing on front */
.card-front .km-btn {
  font-size: 15px !important;
  padding: 10px 8px !important;
}

/* Tighter button sizing on back */
.card-back .km-btn {
  font-size: 15px !important;
  padding: 10px 12px !important;
}

/* ✅ Mobile-only adjustments */
@media (max-width: 480px) {
  .km-card .km-foot {
    font-size: 0.7rem;        /* smaller so it all fits */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;          /* breathing room on both sides */
  }

  .km-card .km-foot span {
    flex: 1;
  }

  .km-card .km-foot .km-date {
    text-align: left;
  }

  .km-card .km-foot .km-id {
    text-align: right;
  }
  .km-pr-label {
  font-size: 0.95rem;
}
.km-pr-time {
  font-size: 0.8rem;
}
}

/* 🟦 Mobile spacing fix for card-back footer */
@media (max-width: 480px) {
  /* Ensures the add-comment wrapper, textarea, and post button 
     don't contribute any extra space below */
  .card-back .km-add-comment,
  .card-back .km-add-comment textarea,
  .card-back .km-add-comment button {
    margin-bottom: 0 !important;
  }

  /* Styles for the Close button */
  .card-back .flip-close {
    margin: 18px auto 0 auto !important; /* controlled top spacing, auto left/right centers it */
    display: block;                      /* makes auto margins work */
    width: fit-content;                  /* hugs text width */
    text-align: center;                  /* centers text inside */
  }
}

/* 🦊 FIREFOX-SPECIFIC ADJUSTMENTS */
@-moz-document url-prefix() {
  .card-back .km-pr-label {
    margin-bottom: 2px !important;
  }

  .card-back .km-count {
    margin-top: 0px;
    line-height: 1.15 !important;
  }
}

/* 📵 FORCE SINGLE COLUMN ON ALL MOBILE DEVICES (up to iPad width) */
@media (max-width: 1023px) {
  .km-card-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }
}
/* ──────────────────────────────────────────────────────────────────────────
   🛠️ RESERVED: Future Mobile/Desktop Fixes
   -------------------------------------------------------------------------- */
/* ──────────────────────────────────────────────────────────────────────────
   🔒 DO NOT TOUCH UNTIL FINAL CLEANUP — CRITICAL LAYOUT PATCH ZONE
   This block includes:
   • Flip + modal fixes
   • Mobile/desktop overrides
   • Vote/comment layout patches
   • Critical hotfixes (from legacy + testing)
   • Intentionally unclosed @media braces

   ⚠️ Do not re-order, relocate, or delete blocks below until:
   — Layout is 100% stable across mobile/desktop
   — Flip + modal behaviors are final
   — All test pages render without regressions

   Consider moving these into clean sections after full validation.
   -------------------------------------------------------------------------- */
   
   
/* tested, needed, otherwise stamps are thrown out of position */
@media (min-width: 769px) {
  .card-front .km-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
  }

  /* Title anchor zone */
  .card-front .km-title {
    margin-top: 40px; /* consistent offset */
    min-height: 80px; /* reserve space so titles start aligned */
  }

  /* Stamps float in reserved space */
  .card-front .km-stamp {
    position: absolute;
    right: var(--stamp-right);
    bottom: var(--stamp-bottom);
  }
}

@media (min-width: 769px) {
  .card-front .km-card {
    padding-bottom: 120px !important; /* reduce from 168px */
  }

  .card-front .km-stamp {
    bottom: 190px !important; /* fine-tune after padding change */
  }
}

/* ⚠️ DO NOT REMOVE OR ADD CLOSING BRACE — MOBILE LAYOUT DEPENDS ON THIS */
/* Needed to prevent desktop styles from leaking into mobile. 
   Intentionally left open to act as a cutoff for desktop-only styles. */
@media (min-width: 769px) {
  .card-front .km-stamp {
    bottom: 190px !important;
  }

/* Keep - tested, needed for desktop stamp alignment */
@media (min-width: 769px) {
  .card-front .km-btn {
    bottom: 50px !important;  /* instead of 76px (your default) */
  }
  .card-front .km-stamp {
    bottom: 100px !important; /* keep this higher than button */
    width: 90px;
    height: auto;
  }
}

/* keep important for desktop - tightens up row gap - tried moving up but broke layout*/
.km-card {
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  padding: 1.5rem 1.5rem 1.5rem 1.75rem !important;
  height: auto !important;
  min-height: unset !important;
  box-sizing: border-box !important;
}

/* move this block to grid section */
/* ✅ FINAL FLEX LAYOUT — Clean Spacing & Gutters */
.km-card-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  gap: 2rem !important;
  padding: 1rem !important; /* Adds gutter around the whole grid */
  box-sizing: border-box !important;
}

.km-flip-container {
  width: calc(33.333% - 1.34rem) !important; /* Compensates for the 2rem gap */
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* ✅ FINAL FClean Ipad rule   */
@media screen and (min-width: 768px) and (max-width: 1024px) {
  .km-card-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
    padding: 1.5rem !important;
  }

  .km-flip-container {
    width: 100% !important;
  }
}

/* 🔒 DO NOT MOVE UNTIL CLEANUP COMPLETE */
/* 🔥 HOTFIX — OVERFLOW FIX (Mobile Recipient Label) */
/* Keep at bottom until final pass */

/* 🔥 BLOCK A — Enable Label Flex Expansion */
@media (max-width: 768px) {
  .card-back .km-pr-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow: visible;
  }

  .card-back .km-pr-label {
    font-size: 0.85rem !important;
    line-height: 1.2;
    display: block;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
  }

  .card-back .km-pr-head {
    display: flex;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 0.5rem;
    max-width: 100%;
    overflow: visible;
  }
}

} /* 🔥 Leave this stray brace alone for now */

/* 🔥 BLOCK B — Failsafe Ellipsis Truncation */
@media (max-width: 768px) {
  .card-back .km-pinned-reply {
    overflow: hidden;
  }

  .card-back .km-pr-label {
    font-size: 0.75rem !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

.card-back .km-flower-back img {
    width: 18px !important;
  }
}

/* 🔥 TEST BLOCK — Flower Vertical Align Tweak */
.card-back .km-pr-head .km-flower-back {
  position: relative;
  top: -10px;
}

/* 🧩 CRITICAL FIXES FROM LEGACY STYLESHEET */
/* -------------------------------------------------- */

/* ⚠️ TODO: Move to 🟧 FLIP SECTION once other flip blocks are removed */
/* 🔥 FIX: FLIP CONTAINER LAYOUT (Mobile Flip Only) */
/* Tested – Required for 3D perspective and backface flipping */
.km-flip-container {
  position: relative;
  width: 100%;
  perspective: 1000px;
  transform-style: preserve-3d;
  transform: translateZ(0); /* Safari fix to enforce 3D context */
}

.km-flip-container .card-front,
.km-flip-container .card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  transform-origin: center;
  transition: transform 0.6s ease-in-out;
}


/* 🔥 FIX: COMMENT INPUT LAYOUT */
/* tested — do not move or spacing breaks */
.km-add-comment {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  margin-bottom: 80px !important;
  position: relative;
  z-index: 0;
}

.km-add-comment .km-input {
  flex: 1 1 auto;
  min-width: 0;
}

.card-back .km-input::placeholder {
  color: #9AA3AE;
}

/* 🔥 FIX: ADD BUTTON VISUALS — ALT VERSION */
/* Conflicts with other .km-add-btn — used for pill-style add? */
.card-back .km-add-btn {
  background: #9CA3AF;
  color: white;
  border: none;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  align-self: center;
  white-space: nowrap;
}

/* 🔥 FIX: TAG PILL STYLES & CLOSE BUTTON SPACING */
.km-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.km-pill {
  background: var(--pill-bg);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 14px;
  white-space: nowrap;
}

.km-btn.flip-close {
  display: block;
  text-align: center;
  text-decoration: none;
  background: linear-gradient(180deg, #2563FF 0%, #1D4ED8 100%);
  color: #fff;
  font-weight: 700;
  font-size: var(--btn-font);
  line-height: 1;
  padding: 15px 8px;
  border-radius: var(--btn-radius);
  box-shadow: 0 6px 14px rgba(29, 78, 216, 0.2);
  width: min(80%, var(--btn-max-width));
  margin: 2rem auto 0;
  cursor: pointer;
  position: static;
}

/* 🔥 FIX: MOBILE FLIP TRANSFORM & VOTE BLOCK */
/* Scoped flip + mobile layout only */
@media (max-width: 768px) {
  .card-front,
  .card-back {
    backface-visibility: hidden;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
    width: 100%;
  }

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

  .card-back {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotateY(180deg);
    z-index: 1;
  }

  .km-flip-container.flipped .card-front {
    transform: rotateY(180deg);
  }

  .km-flip-container.flipped .card-back {
    transform: rotateY(0deg);
    z-index: 3;
  }

  /* 🔥 FIX: MOBILE VOTE BLOCK LAYOUT — Default Responsive */
  .card-back .km-vote-options {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 0 12px;
    flex-wrap: nowrap;
  }

  .card-back .km-vote-option {
    width: 48vw;
    max-width: 180px;
    padding: 6px;
    border: none;
    background: #f3f3f3;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .card-back .km-vote-option img {
    width: 100%;
    max-width: 130px;
    height: auto;
    display: block;
    margin-bottom: 0px !important;
  }

  .card-back .km-count {
    font-size: 2.2rem !important;
    font-weight: 700;
    margin-top: 0px;
    line-height: 1.1;
    text-align: center;
  }

  .card-back .km-add-comment {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .card-back .km-input {
    width: min(100%, var(--btn-max-width)) !important;
    margin: 0 auto !important;
  }

  .card-back .km-add-btn {
    margin: 0.75rem auto 0 !important;
  }

  .km-count {
    font-size: 2.2rem !important;
    font-weight: 700;
    line-height: 1.1;
    margin-top: 0 !important;
    text-align: center;
  }
}

/* 🔥 FIX: MOBILE VOTE ICON LOCKED LAYOUT (🧱 LOCKED 0909) */
/* DO NOT MOVE — necessary to prevent broken icons */
@media (max-width: 768px) {
  .card-back .km-vote-options {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 16px auto 10px auto;
    padding: 0;
  }

  .card-back .km-vote-option {
    width: 180px;
    padding: 0;
    text-align: center;
  }

  .card-back .km-vote-option img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 0px;
  }

  .card-back .km-count {
    display: block;
    margin-top: 0px;
    font-size: 14px;
    color: var(--muted);
  }
}

/* 🔥 FIX: MODAL WIDTH OVERRIDE (TEMP LOCKED) */
/* Prevents modal from becoming too wide */
#km-modal {
  display: none !important;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.km-modal-content {
  background: white;
  max-width: 600px;
  padding: 1rem;
  border-radius: 8px;
}




/* mobile card width */

@media (max-width: 768px) {
  .km-grid-page,
  .km-card-grid,
  .km-flip-container,
  .card-front,
  .card-back,
  .km-card {
    margin: 0 auto;
    padding: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .km-card-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .km-card {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .km-card {
    padding: 20px;
    box-sizing: border-box;
  }
}

@media (max-width: 768px) {
  .km-card-grid,
  .km-grid-page {
    padding-left: 0px;
    padding-right: 0px;
  }
}


/* 🔧 Vkarmail-heading and subheading homepage */
@media (max-width: 768px) {
    .karmail-heading {
  font-size: 42px;
  font-weight: 700;
  margin-top: 15px;
}

.karmail-subheading {
  font-size: 18px;
  }
}
    

/* 🟥 LOCKED-IN DESKTOP VOTE ICON + COUNT */
/* 🔧 VOTE SECTION TIGHTENING (DESKTOP) */
/* 🔧 DESKTOP VOTE ICON + COUNT FIX */
@media (min-width: 769px) {
  .km-vote-option {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.25rem !important; /* Tighten vertical space */
    padding: 0 !important;
    margin: 0 !important;
  }

  .km-vote-option img {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
  }

  .km-vote-option .km-count {
    font-size: 2.5rem !important;
    margin: 0 0 0.5rem 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
  }
  /* 🔧 Reduce space between last comment and vote section title */
  .card-back .km-comment-list {
  margin-bottom: -40px; /* was probably 2.5rem or more */
}
.card-back .km-comments {
  margin-top: -40px; /* tighten gap slightly */
}
}

/* ✅ SPACING TUNED: Back Text → Pinned Reply */
@media (min-width: 769px) {
  .card-back .km-back-text {
    margin-bottom: 0rem; /* Pull text closer to pinned reply */
  }

  .card-back .km-comments {
    margin-top: 0; /* Remove any default top spacing */
    padding-top: 0;
  }

  .card-back .km-pinned-reply {
    margin-top: 0; /* Ensure reply hugs the top */
  }
}




@media (max-width: 768px) {
  /* Tighten wrapper padding */
  .karmail-form-wrapper {
    padding: 0.5rem !important;
  }

  /* Compress form title */
  .karma-form-title {
    font-size: clamp(1.75rem, 6vw, 2.5rem) !important;
    margin-bottom: 10rem !important;
  }

  /* Expand inputs/textareas to full width */
  .karmail-input-wrapper input,
  .karmail-input-wrapper textarea,
  .karmail-form-wrapper input[type="email"] {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 1rem !important;
    padding: 0.5rem !important;
    box-sizing: border-box;
  }

  /* Keep comma inline */
  .karmail-form-comma {
    font-size: 1.25rem !important;
    margin-left: 0.25rem;
    display: inline-block;
    vertical-align: middle;
  }

  /* Prevent form from shrinking too narrow */
  .karmail-form {
    width: 100% !important;
  }
}


/* 🖥️ DESKTOP ONLY — Hero CTA: Button and text inline */
.karmail-hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.5rem;
  margin-top: 1.5rem;
}

/* Make the text behave */
.karmail-cta-note {
  font-size: 1rem;
  font-weight: bold;
  color: #444;
  margin: 0;
  flex: 1; /* allow it to grow and flow beside the button */
  min-width: 250px;
  max-width: 600px;
}

/* Style the button */
.karmail-btn {
  background-color: #1073ba;
  color: #fff;
  padding: 10px 22px;
  border-radius: 30px;
  font-weight: bold;
  font-size: 1rem;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

.karmail-btn:hover {
  background-color: #8cc63f !important;
  color: #fff !important;
}

/* Anchor inside note */
.karmail-cta-note a {
  color: #007bff;
  text-decoration: underline;
  font-weight: bold;
  white-space: nowrap;
}



/* 🟦 Karmail Hero Section — MOBILE ONLY FIXES */
@media (max-width: 768px) {
  .karmail-hero-wrapper {
    padding: 0 !important;
  }
  .karmail-hero {
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
  }
  .karmail-hero-inner {
    flex-direction: column;
    align-items: center;        /* ← CHANGED from flex-start */
    text-align: center;         /* ← CHANGED from left */
    padding: 0 20px !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .karmail-logo {
    max-width: 260px;
    width: 100%;
    height: auto;
    margin: 0 auto;            /* ← ADDED for centering */
  }
  .karmail-hero-text {
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center;        /* ← ADDED */
  }
  .karmail-hero-text h1 {
    font-size: 3.5rem;
    line-height: 0.95;
    text-align: center;        /* ← ADDED */
  }
  .karmail-hero-text h1 br {
    display: none;
  }
  .karmail-subtext {
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.6;
    margin: 0 0 1.5rem;
    padding: 0;
    width: 100%;
    max-width: 100%;
    text-align: center;        /* ← ADDED */
  }
  .karmail-hero-cta {
    flex-direction: column;
    align-items: center;       /* ← CHANGED from flex-start */
    gap: 1rem;
    margin-bottom: 2rem;
    text-align: center;        /* ← ADDED */
    width: 100%;               /* ← ADDED */
  }
  .karmail-btn {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
  }
  .karmail-cta-note {
    font-size: 0.9rem;
    max-width: 100%;
    margin-bottom: -1rem;
    text-align: center;        /* ← ADDED */
  }
  .karmail-hero-illustration {
    margin: 0 auto -11rem !important;
    padding: 0 !important;
    text-align: center;
    border-radius: 12px;
  }
  .karmail-hero-illustration img {
    display: block;
    height: auto;
    width: 100%;
    max-width: 400px;
    margin: -1rem auto 0rem;
    border-radius: 1rem;
  }
}

@media (max-width: 768px) {
  /* Layout Containers */
  .karmail-form-section,
  .karmail-form-wrapper,
  .karmail-form {
    padding: 0 !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
  }

  .karmail-form-wrapper {
    width: 88vw !important;
    max-width: 88vw !important;
    margin-left: calc(-44vw + 50%) !important;
    border-radius: 50px !important;
    overflow: hidden;
  }

  .karmail-form-body {
    padding: 2rem !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  /* Global mobile reset */
  body,
  html {
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: hidden;
  }
}



/* ✅ FINAL: Fix for inline Dear [name], on mobile */
@media (max-width: 768px) {
  .karmail-form .row:first-of-type {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.4rem;
  }

  .karmail-form .row:first-of-type .col {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: nowrap;
  }

  .karmail-form .row:first-of-type label {
    white-space: nowrap;
    margin: 0;
  }

  .karmail-form .row:first-of-type .karmail-input-wrapper {
    display: inline-flex;
    min-width: 6ch;
    max-width: 12ch;
  }

  .karmail-form .row:first-of-type input[type="text"] {
    width: 100%;
    font-size: 1rem;
    padding: 0.25rem;
    box-sizing: border-box;
  }

  .karmail-form .row:first-of-type .karmail-form-comma {
    white-space: nowrap;
    font-size: 1.75rem;
    line-height: 1;
    margin-left: 0.2rem;
  }
}
/* ✅ FINAL FIX: Inline "Dear [name]," row on mobile */
@media (max-width: 768px) {
  .karmail-form label:contains("Dear") {
    white-space: nowrap;
    margin: 0;
  }

  .karmail-form input[name="karmail_name"] {
    width: 100%;
    font-size: 1rem;
    padding: 0.25rem;
    box-sizing: border-box;
    min-width: 6ch;
    max-width: 12ch;
    display: inline-flex;
  }

  .karmail-form .karmail-form-comma {
    white-space: nowrap;
    font-size: 1.75rem;
    line-height: 1;
    margin-left: 0.2rem;
  }

  .karmail-form input[name="karmail_name"] ~ .karmail-form-comma,
  .karmail-form input[name="karmail_name"] {
    display: inline-block;
    vertical-align: middle;
  }
}

@media (max-width: 768px) {

  .karmail-form-body .row:first-of-type .col {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.25rem !important;
    white-space: nowrap !important;
  }

  .karmail-input-wrapper {
    max-width: 10ch !important;
    flex: 0 1 auto !important;
  }

  .karmail-input-wrapper input {
    width: 100% !important;
  }

  .karmail-form-comma {
    display: inline !important;
    font-size: 2rem !important;
    line-height: 1 !important;
    margin-left: 0.15rem !important;
    white-space: nowrap !important;
  }
}
@media (max-width: 768px) {
  .karmail-form-body .row:nth-of-type(1) .col:nth-of-type(2) {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    white-space: nowrap !important;
    gap: 0.25rem !important;
  }

  .karmail-form-body .karmail-input-wrapper {
    max-width: 12ch !important;
    display: inline-flex !important;
  }

  .karmail-form-body .karmail-form-comma {
    font-size: 2rem !important;
    margin-left: 0.25rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }
}
@media (max-width: 768px) {
  #karmail_content_field {
    height: 6.5rem;
  }
}

/* replaces <br> in markup and adds space between YKS!important and textarea */
.karmail-input-wrapper.textarea {
  display: block;
  margin-top: 1.5rem; /* or adjust as needed (e.g. 16px) */
}

/* ========================================
   KARMAIL FORM - MOBILE STYLES (UNIVERSAL)
   ======================================== */

@media (max-width: 768px) {
  
  /* ===== LAYOUT CONTAINERS ===== */
  .karmail-form-section,
  .karmail-form-wrapper,
  .karmail-form {
    padding: 0 !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .karmail-form-wrapper {
    width: 92vw !important;
    max-width: 92vw !important;
    margin-left: calc(-46vw + 50%) !important;
    border-radius: 50px !important;
    overflow: hidden;
  }

  .karmail-form-body {
    padding: 2rem !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  /* Global mobile reset */
  body,
  html {
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: hidden;
  }

  
  /* ===== TITLE STYLING ===== */
  .karmail-form-section .karma-form-title {
    font-size: 3.6rem !important;
    line-height: 1.1 !important;
    margin-bottom: 0.5rem !important;
  }

  .title-line-2 {
    display: inline-block;
    padding-left: 1.4rem;
  }

  
  /* ===== FIX #1: "Dear [input] ," ON ONE LINE ===== */
  
  /* Override default label display */
  .karmail-form-body label {
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 0 !important;
    margin-right: 0.5rem !important;
  }
  
  /* Make row 2 display as flex column so cols stack */
  .karmail-form-body .row:nth-of-type(2) {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
  }

  /* Input wrapper for inline inputs */
  .karmail-form-body .karmail-input-wrapper {
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 0 !important;
  }

  .karmail-form-body .karmail-input-wrapper.input {
    min-width: 120px !important;
    max-width: 200px !important;
    width: auto !important;
  }

  .karmail-form-body input[name="karmail_name"] {
    width: 100% !important;
    font-size: 1rem !important;
    padding: 0.5rem !important;
    box-sizing: border-box !important;
  }

  /* Comma styling */
  .karmail-form-body .karmail-form-comma {
    display: inline-block !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    font-size: 1.75rem !important;
    line-height: 1 !important;
    margin: 0 !important;
    margin-left: 0.25rem !important;
  }

  
  /* ===== FIX #2: TEXTAREA WIDTH MATCHING EMAIL INPUT ===== */
  
  /* Make the row containing textarea full width */
  .karmail-form-body .row:nth-of-type(3) {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .karmail-input-wrapper.textarea {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  .karmail-input-wrapper.textarea textarea,
  textarea#karmail_content_field {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1rem !important;
    font-size: 1rem !important;
    box-sizing: border-box !important;
    resize: vertical !important;
    min-height: 6.5rem !important;
    display: block !important;
    margin: 0 !important;
  }

  
  /* ===== "Send this to:" INPUT FIELD ===== */
  
  /* Make the row containing email input full width */
  .karmail-form-body .row:nth-of-type(4) {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  input[name="karmail_email"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 1rem !important;
    font-size: 1rem !important;
    display: block !important;
    margin-top: 0.5rem !important;
  }

  
  /* ===== GENERAL ROW STYLING ===== */
  .karmail-form .row {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 0 !important;
  }
  
  .karmail-form-body .row .col {
    width: 100% !important;
  }
  
  /* Add space between email input and checkbox */
.karmail-form-terms {
  margin-top: 1.5rem !important;
}

/* Add space after button by padding the wrapper */
.karmail-form-wrapper {
  width: 92vw !important;
  max-width: 92vw !important;
  margin-left: calc(-46vw + 50%) !important;
  border-radius: 50px !important;
  overflow: hidden;
  padding-bottom: 1.25rem !important; /* <-- Add this line */
}
}

/* 🔵 NAVIGATION MENU STYLES
   -------------------------------------------------------------------------- */

/* Hamburger wrapper - ALWAYS on top, overlapping the menu */
.karmail-hamburger-wrapper {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  pointer-events: auto;
}

/* Hamburger button */
.karmail-hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10001; /* Even higher than wrapper */
}

.karmail-hamburger svg {
  transition: transform 0.4s ease;
  transform-origin: center;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1)); /* Optional: adds subtle shadow so it stands out on white */
}

body.menu-open .karmail-hamburger svg {
  transform: rotate(-90deg);
}

/* Slideout menu - goes full width to edge */
.karmail-slideout-menu {
  position: fixed;
  top: 0;
  right: -260px; /* Off-screen initially */
  width: 240px;
  height: 100vh;
  background: #fff;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
  padding: 5rem 1.5rem 2rem;
  z-index: 9000; /* Below hamburger */
  transition: right 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

/* Menu slides all the way to the edge */
body.menu-open .karmail-slideout-menu {
  right: 0;
}

/* Menu list styles */
.karmail-slideout-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.karmail-slideout-menu li {
  margin-bottom: 1.25rem;
}

.karmail-slideout-menu a {
  font-size: 1.2rem;
  font-weight: bold;
  color: #333;
  text-decoration: none;
  transition: color 0.2s ease;
}

.karmail-slideout-menu a:hover {
  color: #FF0066;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .karmail-hamburger-wrapper {
    top: 12px;
    right: 12px;
  }
}

@media (min-width: 1024px) {
  .karmail-hamburger-wrapper {
    top: 10rem;
    right: 6rem;
  }
  
  .karmail-hamburger svg {
    width: 48px;
    height: 48px;
  }
}


/* ========================================
   KARMAIL - iPad Air 11" Portrait Only
   Resolution: 820x1180
   Stack hero, keep form desktop-style
   ======================================== */

/* Target iPad Air portrait specifically */
@media (min-width: 820px) and (max-width: 834px) and (orientation: portrait) {
  
  /* Remove any body/page top spacing */
  body {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
  
  /* If there's a main/wrapper before hero */
  body > *:first-child,
  main,
  .site-content,
  #content {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
  
  /* ===== HERO SECTION: STACKED LAYOUT (LEFT-ALIGNED) ===== */
  
  .karmail-hero-wrapper {
    padding: 0rem 1rem 2rem 1rem !important;
    margin-top: 0 !important;
    overflow: hidden !important;
  }
  
  .karmail-hero {
    overflow: hidden !important;
    padding-left: 1rem !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
  
  /* Stack vertically - text on top, guru on bottom */
  .karmail-hero-inner {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2rem !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
  
  /* Text section - left aligned, keep desktop sizes */
  .karmail-hero-text {
    width: 100% !important;
    text-align: left !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
  
  /* Logo - keep desktop size and left position, remove top spacing */
  .karmail-logo {
    display: block !important;
    margin: 0 0 1rem 0 !important;
    padding-top: 0 !important;
    /* Keep original desktop size - don't override */
  }
  
  /* Heading - keep desktop size */
  .karmail-hero-text h1 {
    /* Keep original desktop size - don't override */
  }
  
  /* Subtext - keep desktop size */
  .karmail-subtext {
    /* Keep original desktop size - don't override */
  }
  
  /* CTA section - left aligned */
  .karmail-hero-cta {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }
  
  .karmail-cta-note {
    text-align: left !important;
  }
  
  /* Guru illustration - CENTERED, below text, larger */
  .karmail-hero-illustration {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto -8rem auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    overflow: visible !important;
  }
  
  .karmail-hero-illustration img {
    width: 100% !important;
    max-width: 600px !important;
    height: auto !important;
    display: block !important;
  }
  
  
  
  
  /* ===== FORM SECTION: DESKTOP LAYOUT ===== */
  
  .karmail-form-section {
    padding: 0 2rem !important;
  }
  
  .karmail-form-wrapper {
    width: 100% !important;
    max-width: 750px !important;
    margin: 0 auto !important;
    padding: 2.5rem !important;
  }
  
  /* Form title */
  .karma-form-title {
    font-size: 4.5rem !important;
    line-height: 1.2 !important;
    text-align: center !important;
    margin-bottom: 2rem !important;
  }
  
  /* Row 2: "Dear [name], Your karma stinks!" inline */
  .karmail-form-body .row:nth-of-type(2) {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-bottom: 1.5rem !important;
  }
  
  .karmail-form-body .row:nth-of-type(2) .col {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex-wrap: nowrap !important;
  }
  
  .karmail-form-body .row:nth-of-type(2) label {
    font-size: 1.5rem !important;
    font-weight: bold !important;
    color: white !important;
    margin: 0 !important;
    white-space: nowrap !important;
  }
  
  .karmail-form-body .row:nth-of-type(2) .karmail-input-wrapper {
    display: inline-flex !important;
    min-width: 150px !important;
    max-width: 200px !important;
  }
  
  .karmail-form-body .row:nth-of-type(2) input[type="text"] {
    width: 100% !important;
    padding: 0.5rem !important;
  }
  
  .karmail-form-comma {
    font-size: 1.5rem !important;
    font-weight: bold !important;
    color: white !important;
    margin: 0 !important;
  }
  
  /* Row 3: Textarea full width */
  .karmail-form-body .row:nth-of-type(3) {
    margin-bottom: 1.5rem !important;
  }
  
  .karmail-input-wrapper.textarea {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
  }
  
  textarea#karmail_content_field {
    width: 100% !important;
    min-height: 140px !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
  }
  
  /* Row 4: "Send this to:" with full width input */
  .karmail-form-body .row:nth-of-type(4) {
    margin-bottom: 1.5rem !important;
  }
  
  .karmail-form-body .row:nth-of-type(4) label {
    font-size: 1.5rem !important;
    font-weight: bold !important;
    color: white !important;
    display: block !important;
    margin-bottom: 0.5rem !important;
  }
  
  input[name="karmail_email"] {
    width: 100% !important;
    max-width: 480px !important;
    padding: 0.75rem !important;
    box-sizing: border-box !important;
  }
  
  /* Terms checkbox */
  .karmail-form-terms {
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    text-align: left !important;
  }
  
  .karmail-form-terms label {
    color: white !important;
    font-size: 0.95rem !important;
  }
  
  /* Submit button - CENTERED like desktop */
  .karmail-form-button {
    display: block !important;
    float: none !important;
    margin: 1.5rem auto 0 !important;
    padding: 0.7rem 2rem !important;
    font-size: 1.3rem !important;
    min-width: 200px !important;
    width: auto !important;
    text-align: center !important;
  }
  
  /* Clear floats */
  .karmail-form-body::after {
    content: "" !important;
    display: table !important;
    clear: both !important;
  }
}

/* ========================================
   KARMAIL SEARCH BAR - DESKTOP
   ======================================== */

#karmail-search-unique {
  max-width: 600px !important;
  margin: 0.5rem auto 0.5rem auto !important;
  position: relative !important;
  height: 32px !important;
}

#karmail-search-input-unique {
  width: 100% !important;
  height: 32px !important;
  padding: 0 3.5rem 0 1.25rem !important;
  font-size: 11.2px !important;
  border: none !important;
  border-radius: 20px !important;
  background: #2563EB !important;
  color: white !important;
  font-weight: 600 !important;
  box-sizing: border-box !important;
  line-height: 32px !important;
}

#karmail-search-input-unique::placeholder {
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 11.2px !important;
  line-height: 32px !important;
}

#karmail-search-btn-unique {
  position: absolute !important;
  right: 3px !important;
  top: 3px !important;
  width: 26px !important;
  height: 26px !important;
  background: rgba(255, 255, 255, 0.3) !important;
  border: none !important;
  border-radius: 50% !important;
  color: white !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

#karmail-search-btn-unique svg {
  width: 12px !important;
  height: 12px !important;
}

/* ========================================
   DESKTOP FILTER TOGGLE & PANEL
   ======================================== */

/* Desktop Filter Toggle Button - UPDATED */
.km-desktop-filter-toggle {
  position: fixed;
  top: 80px; /* Changed from 20px to match hamburger */
  left: 60px; /* Changed from 20px to match hamburger */
  z-index: 9999;
}

.km-filter-btn {
  width: 48px;
  height: 48px;
  background: #8cc63f;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(140, 198, 63, 0.4);
  transition: all 0.3s ease;
}

.km-filter-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(140, 198, 63, 0.5);
}

/* Hide open button when panel opens */
.km-desktop-filter-toggle.panel-open {
  opacity: 0;
  pointer-events: none;
}

/* Desktop Filter Panel (Hidden by default) */
.km-desktop-filter-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: white;
  z-index: 9998;
  padding: 38px 40px 18px 40px;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  
}

.km-desktop-filter-panel.active {
  transform: translateY(0);
  display: block;
}

.km-desktop-filter-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

/* White magnifying glass */
.km-filter-btn .km-search-icon {
  stroke: white;
  stroke-width: 2.5;
}



/* Desktop Close Button - absolute positioning relative to panel */
.km-desktop-filter-close {
  position: fixed; /* Changed from fixed */
  top: 80px; /* YOUR position */
  left: 60px; /* YOUR position */
  background: #8cc63f;
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
}

.km-desktop-filter-close:hover {
  background: #7ab52f;
}





/* ========================================
   MOBILE SEARCH & FILTER
   ======================================== */

/* Mobile/Desktop visibility */
.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block;
  }
  
  .desktop-only {
    display: none !important;
  }

  /* Mobile banner - just container for circle */
  .km-mobile-filter-banner {
    position: fixed;
    top: 12px;
    left: 16px;
    z-index: 9999;
  }

  /* Circle button with magnifying glass */
  .km-filter-toggle {
    width: 36px;
    height: 36px;
    background: #8cc63f;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(140, 198, 63, 0.3);
    transition: all 0.3s ease;
  }

  .km-search-icon {
    width: 20px;
    height: 20px;
    stroke: white;
    stroke-width: 2.5;
  }

  /* Filter Panel */
  .km-filter-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    max-height: 70vh;
    background: white;
    z-index: 10000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
  }

  .km-filter-panel.active {
    transform: translateY(0);
  }

  .km-filter-panel-inner {
    padding: 60px 16px 24px 16px;
    max-height: 70vh;
    overflow-y: auto;
  }

  /* Close Button */
  .km-filter-close {
    position: absolute;
    top: 12px;
    left: 16px;
    background: #8cc63f;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 10001;
  }

  /* Mobile Search Bar */
  #karmail-search-mobile {
    position: relative;
    margin-bottom: 20px;
    max-width: 100%;
  }

  #karmail-search-mobile .karmail-search-input {
    width: 100%;
    height: 32px;
    padding: 0 3rem 0 1.25rem;
    font-size: 11.2px;
    border: none;
    border-radius: 20px;
    background: #2563EB;
    color: white;
    font-weight: 600;
    box-sizing: border-box;
    line-height: 32px;
  }

  #karmail-search-mobile .karmail-search-input::placeholder {
    color: rgba(255, 255, 255, 0.85);
  }

  #karmail-search-mobile .karmail-search-btn {
    position: absolute;
    right: 3px;
    top: 3px;
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #karmail-search-mobile .karmail-search-btn svg {
    width: 12px;
    height: 12px;
  }

  /* Category Pills */
  .karmail-category-menu-mobile {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 4px 0;
  }
  
  .karmail-category-menu-mobile .category-pill,
  .km-filter-panel .karmail-category-menu .category-pill {
    padding: 6px 14px;
    transition: all 0.2s ease;
  }
  
  /* Active state for selected pills */
  .km-filter-panel .category-pill.active {
    border: 3px solid white !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    transform: scale(1.05) !important;
    position: relative !important;
    z-index: 1 !important;
    padding: 3px 11px !important;
  }

  /* Tap feedback */
  .km-filter-panel .category-pill:active {
    transform: scale(0.95);
  }
}


  /* Logo centering */
  .karmail-logo {
    text-align: center;
    margin: 0 auto;
  }

  .page-logo {
    display: block;
    margin: 0 auto;
  }

}

/* 🦶 KARMAIL FOOTER STYLES */
.karmail-footer {
    padding: 2rem 1rem;
    text-align: center !important;
    margin-top: 4rem;
    border-top: 1px solid #e0e0e0 !important;
}

.karmail-footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.karmail-copyright {
    font-size: 0.9rem;
    color: #666;
    margin: 1rem;
    font-weight: 400;
    text-align: center !important;  /* ← Add here too */
}

@media (max-width: 768px) {
    .karmail-footer {
        padding: 1.5rem 1rem;
        margin-top: 3rem;
    }
    .karmail-copyright {
        font-size: 0.85rem;
    }
}

/* Card front footer - larger, more readable text */
.card-front .km-foot {
  padding: 0 5px !important; /* Minimal side padding */
  font-size: 0.85rem !important; /* Larger than 0.75rem */
  justify-content: space-between !important;
}

/* Add a bit of breathing room between date and ID */
.card-front .km-foot .km-date {
  margin-right: 15px;
}

/* Only modal footer (not regular card backs) */
.km-modal-content .km-foot {
  font-size: 0.9rem !important;
  font-weight: 500;
}

.km-modal-content .km-foot .km-date {
  margin-right: 20px;
}

/* Mobile card back footer - match card front size */
@media (max-width: 768px) {
  .card-back .km-foot {
    font-size: 0.9rem !important;
    font-weight: 500;
  }
  
  .card-back .km-foot .km-date {
    margin-right: 20px;
  }
}

/* AJAX Container Grid Fix */
#karmail-cards-container {
  display: contents;
}

/* ========================================
   MOBILE CARD-BACK OVERLAP FIX
   Issue #2 - Ensures flipped card stacks
   on top of cards below it
   ======================================== */
@media (max-width: 768px) {
  /* Flipped container gets high z-index to sit on top of cards below */
  .km-flip-container.flipped {
    position: relative !important;
    z-index: 100 !important;
  }

  /* Card-back needs z-index and must take full height in flow */
  .km-flip-container.flipped .card-back {
    position: relative !important;
    z-index: 100 !important;
    display: block !important;
    height: auto !important;
    max-height: none !important;
  }

  /* The km-card inside needs background to cover cards below */
  .km-flip-container.flipped .card-back .km-card {
    position: relative !important;
    z-index: 100 !important;
    background: #fff !important;
  }

  /* Non-flipped cards stay below */
  .km-flip-container:not(.flipped) {
    z-index: 1 !important;
  }
}

/* ========================================
   UNIFORM CARD HEIGHT FIX
   Ensures cards are same height with or without flower
   ======================================== */
@media (min-width: 769px) {
  /* Set fixed height for the flower/spacer area */
  .card-front .km-recipient-replied {
    min-height: 80px;
    margin: 10px 0 0 20px;
  }
  
  .card-front .km-recipient-replied .km-flower-front {
    min-height: 65px;
  }
  
  .card-front .km-recipient-replied .km-flower-front img {
    margin-top: 0 !important;
  }
}

@media (max-width: 768px) {
  .km-card {
    background-color: #f8f9fb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
}

/* Subtle checkmark for voted cards */
.km-voted-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 18px;
    height: 18px;
    background: #d1d5db;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    opacity: 0.7;
    z-index: 5;
}

/* Load More Button */
#karmail-load-more {
    display: block;
    margin: 2rem auto;
    padding: 6px 24px;
    background: #8cc63f;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    border: none;
    border-radius: 22px;
    box-shadow: 0 6px 14px rgba(140, 198, 63, 0.3);
    cursor: pointer;
    text-align: center;
    float: none !important;
    position: static !important;
    left: auto !important;
    transform: none !important;
}

#karmail-load-more:hover {
    background: #7ab52f;
}

/* Load More Featured Button */
#karmail-load-more-featured {
    display: block;
    margin: 0;  /* Remove margin - wrapper handles spacing */
    padding: 6px 24px;
    background: #8B5CF6;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    border: none;
    border-radius: 22px;
    box-shadow: 0 6px 14px rgba(140, 198, 63, 0.3);
    cursor: pointer;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    float: none !important;
    position: static !important;
    left: auto !important;
    transform: none !important;
}

#karmail-load-more-featured:hover {
    background: #7C4FE0;
}

/* Featured Section Buttons Container */
.karmail-featured-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem auto;
}

/* Read All Karmail Button */
.karmail-read-all-btn {
    display: inline-block;
    padding: 6px 24px;
    background: #8cc63f;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    border: none;
    border-radius: 22px;
    box-shadow: 0 6px 14px rgba(140, 198, 63, 0.3);
    cursor: pointer;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
}

.karmail-read-all-btn:hover {
    background: #7ab52f;
    color: #fff;
    text-decoration: none;
}

/* Mobile: Stack buttons */
@media (max-width: 768px) {
    .karmail-featured-buttons {
        flex-direction: column;
    }
}

/* ========================================
   KARMAIL RESPOND PAGE STYLES
   Add this to karmail-scoped-styles-new.css
   ======================================== */

/* Main Container */
.karmail-respond-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ed 100%);
    padding: 2rem 1rem;
}

.karmail-respond-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem;
}

/* Logo */
.karmail-respond-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.karmail-respond-logo img {
    max-width: 200px;
    height: auto;
}

/* Title */
.karmail-respond-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #0c2340;
    margin-bottom: 2rem;
}

/* Original Karmail Card */
.karmail-respond-original {
    margin-bottom: 2rem;
}

.karmail-respond-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 3px solid #E6E7EB;
}

.karmail-respond-card .km-categories {
    margin-bottom: 1rem;
}

.karmail-respond-message {
    margin-bottom: 1.5rem;
}

.karmail-respond-message .karmail-dear {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0F172A;
    margin-bottom: 0.5rem;
}

.karmail-respond-message .karmail-reason {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #374151;
}

.karmail-respond-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #E6E7EB;
    font-size: 0.85rem;
    color: #6B7280;
    font-family: 'Inter', monospace;
}

/* Response Form */
.karmail-respond-form-wrapper {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 3px solid #8cc63f;
}

.karmail-respond-form-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0c2340;
    margin-bottom: 0.5rem;
    text-align: center;
}

.karmail-respond-form-subtitle {
    text-align: center;
    color: #6B7280;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.karmail-respond-form .form-group {
    margin-bottom: 1.25rem;
}

.karmail-respond-textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid #E6E7EB;
    border-radius: 12px;
    resize: vertical;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.karmail-respond-textarea:focus {
    outline: none;
    border-color: #8cc63f;
}

.karmail-respond-textarea::placeholder {
    color: #9CA3AF;
}

.char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: #6B7280;
    margin-top: 0.5rem;
}

.form-terms {
    font-size: 0.9rem;
    color: #374151;
}

.form-terms label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
}

.form-terms input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-terms a {
    color: #2563EB;
    text-decoration: underline;
}

.karmail-respond-submit {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(180deg, #2563FF 0%, #1D4ED8 100%);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}

.karmail-respond-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(29, 78, 216, 0.4);
}

.karmail-respond-submit:active {
    transform: translateY(0);
}

/* Success State */
.karmail-respond-success {
    text-align: center;
    background: white;
    border-radius: 20px;
    padding: 3rem 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 3px solid #8cc63f;
}

.karmail-respond-success .success-icon {
    width: 80px;
    height: 80px;
    background: #8cc63f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: white;
}

.karmail-respond-success h2 {
    font-size: 1.75rem;
    color: #0c2340;
    margin-bottom: 1rem;
}

.karmail-respond-success p {
    color: #374151;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.karmail-respond-success .success-note {
    color: #6B7280;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* Error State */
.karmail-respond-error {
    text-align: center;
    background: white;
    border-radius: 20px;
    padding: 3rem 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 3px solid #dc3545;
}

.karmail-respond-error .error-icon {
    width: 80px;
    height: 80px;
    background: #dc3545;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: white;
    font-weight: bold;
}

.karmail-respond-error h2 {
    font-size: 1.75rem;
    color: #0c2340;
    margin-bottom: 1rem;
}

.karmail-respond-error p {
    color: #374151;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Form Error Message */
.karmail-respond-form-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Already Responded State */
.karmail-respond-already {
    text-align: center;
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 3px solid #E6E7EB;
}

.karmail-respond-already h2 {
    font-size: 1.5rem;
    color: #0c2340;
    margin-bottom: 1rem;
}

.karmail-respond-already .previous-response {
    background: #f8f9fb;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: left;
    font-size: 1rem;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 1rem;
}

.karmail-respond-already .already-note {
    color: #6B7280;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Shared Button Style */
.karmail-respond-btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(180deg, #2563FF 0%, #1D4ED8 100%);
    border-radius: 30px;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}

.karmail-respond-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(29, 78, 216, 0.4);
    color: white;
    text-decoration: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .karmail-respond-wrapper {
        padding: 1rem 0.75rem;
    }
    
    .karmail-respond-container {
        padding: 1rem;
    }
    
    .karmail-respond-title {
        font-size: 1.5rem;
    }
    
    .karmail-respond-card {
        padding: 1.25rem;
    }
    
    .karmail-respond-message .karmail-dear {
        font-size: 1.1rem;
    }
    
    .karmail-respond-message .karmail-reason {
        font-size: 1rem;
    }
    
    .karmail-respond-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .karmail-respond-form-wrapper {
        padding: 1.5rem;
    }
    
    .karmail-respond-form-title {
        font-size: 1.25rem;
    }
    
    .karmail-respond-textarea {
        min-height: 120px;
    }
    
    .karmail-respond-success,
    .karmail-respond-error {
        padding: 2rem 1.5rem;
    }
    
    .karmail-respond-success .success-icon,
    .karmail-respond-error .error-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
}

/* ========================================
   KARMAIL SHARE BUTTON & POPUP STYLES
   UPDATED: Top-right corner placement
   Add this to karmail-scoped-styles-new.css
   (Replace the previous share styles)
   ======================================== */

/* Share Wrapper - Positioned top-right of card-back */
.card-back .km-card {
    position: relative; /* Ensure positioning context */
}

.km-share-wrapper {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 50;
}

/* Share Button - Small circle with icon only */
.km-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.km-share-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
    transform: scale(1.05);
}

.km-share-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: #2563EB;  /* Karmail blue */
}
/* Hide the "SHARE" text - icon only */
.km-share-btn-text {
    display: none;
}

/* Share Popup - Drops DOWN from button (top-right placement) */
.km-share-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 8px;
    min-width: 160px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

/* Popup arrow - points UP toward button */
.km-share-popup::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 12px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

/* Popup visible state */
.km-share-wrapper.active .km-share-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Share Options */
.km-share-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
}

.km-share-option:hover {
    background: #f3f4f6;
}

/* Share Icons */
.km-share-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 5px;
    flex-shrink: 0;
}

/* Platform-specific icon styling */
.km-share-option[data-action="copy"] .km-share-icon {
    background: #e0e7ff;
    font-size: 12px;
}

.km-share-option[data-action="x"] .km-share-icon {
    background: #000;
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.km-share-option[data-action="facebook"] .km-share-icon {
    background: #1877f2;
    color: white;
    font-weight: 700;
    font-size: 13px;
}

.km-share-option[data-action="email"] .km-share-icon {
    background: #f59e0b;
    color: white;
    font-size: 11px;
}

/* Copy success state */
.km-share-option[data-action="copy"].copied .km-share-label {
    color: #059669;
}

.km-share-option[data-action="copy"].copied .km-share-icon {
    background: #d1fae5;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .km-share-wrapper {
        top: 12px;
        right: 12px;
    }
    
    .km-share-btn {
        width: 32px;
        height: 32px;
    }
    
    .km-share-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .km-share-popup {
        min-width: 150px;
        right: 0;
    }
    
    .km-share-option {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .km-share-icon {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
}

/* Very small screens - centered modal popup 
@media (max-width: 400px) {
    .km-share-popup {
        position: fixed;
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%);
        min-width: 200px;
    }
    
    .km-share-popup::before {
        display: none;
    }
    
    .km-share-wrapper.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 99;
    }
    
    .km-share-wrapper.active .km-share-popup {
        transform: translate(-50%, -50%);
    }
}

/* Modal-specific adjustments */
.km-modal-body .km-share-wrapper {
    top: 16px;
    right: 16px;
}
*/

/* ========================================
   KARMAIL PRODUCT TOUR STYLES
   ======================================== */

/* Prevent scrolling when tour is active */
body.km-tour-active {
    overflow: hidden;
}

/* Dark overlay behind everything */
.km-tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 99998;
    pointer-events: auto;
}

/* Spotlight cutout - highlights the current element */
.km-tour-spotlight {
    position: fixed;
    background: transparent;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 99999;
}

/* Tooltip container */
.km-tour-tooltip {
    position: absolute;
    width: 320px;
    max-width: calc(100vw - 32px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 100000;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.km-tour-tooltip-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Tooltip arrow */
.km-tour-tooltip::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 10px solid transparent;
}

.km-tour-tooltip-top::before {
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: white;
}

.km-tour-tooltip-bottom::before {
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: white;
}

.km-tour-tooltip-left::before {
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: white;
}

.km-tour-tooltip-right::before {
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: white;
}

/* Tooltip header */
.km-tour-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.km-tour-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.km-tour-close {
    width: 28px;
    height: 28px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.km-tour-close:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Tooltip body */
.km-tour-tooltip-body {
    padding: 16px 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
}

/* Tooltip footer */
.km-tour-tooltip-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px 16px;
    border-top: 1px solid #e5e7eb;
}

.km-tour-progress {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 500;
}

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

.km-tour-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.km-tour-prev {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #374151;
}

.km-tour-prev:hover {
    background: #e5e7eb;
}

.km-tour-btn-primary {
    background: #2563EB;
    border: 1px solid #2563EB;
    color: white;
}

.km-tour-btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .km-tour-tooltip {
        width: calc(100vw - 32px);
        left: 16px !important;
        right: 16px;
    }
    
    .km-tour-tooltip-header {
        padding: 14px 16px 10px;
    }
    
    .km-tour-tooltip-body {
        padding: 14px 16px;
        font-size: 13px;
    }
    
    .km-tour-tooltip-footer {
        padding: 10px 16px 14px;
        flex-direction: column;
        gap: 12px;
    }
    
    .km-tour-progress {
        order: 2;
    }
    
    .km-tour-buttons {
        order: 1;
        width: 100%;
    }
    
    .km-tour-btn {
        flex: 1;
        text-align: center;
    }
}

/* ========================================
   TOUR TRIGGER BUTTONS
   (For "How to Use" page or anywhere)
   ======================================== */

.km-tour-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(180deg, #2563FF 0%, #1D4ED8 100%);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.km-tour-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.km-tour-trigger svg {
    width: 20px;
    height: 20px;
}

/* Green variant for secondary tour */
.km-tour-trigger-green {
    background: linear-gradient(180deg, #8cc63f 0%, #7ab52f 100%);
    box-shadow: 0 4px 12px rgba(140, 198, 63, 0.3);
}

.km-tour-trigger-green:hover {
    box-shadow: 0 6px 16px rgba(140, 198, 63, 0.4);
}

/* ========================================
   REFERENCE STEP STYLES
   (For steps showing images instead of page elements)
   ======================================== */

.km-tour-reference {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 0;
    gap: 24px;
}

.km-tour-reference-multi {
    flex-wrap: wrap;
}

.km-tour-reference-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.km-tour-reference-img {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
}

.km-tour-reference-label {
    font-size: 11px;
    color: #6b7280;
    text-align: center;
    font-weight: 500;
}

.km-tour-reference-text {
    margin: 12px 0 0 0;
    text-align: center;
    color: #4b5563;
    line-height: 1.5;
}

/* Wider tooltip for reference steps */
.km-tour-tooltip:has(.km-tour-reference) {
    width: 380px;
}

@media (max-width: 480px) {
    .km-tour-reference-img {
        max-width: 80px;
        max-height: 80px;
    }
    
    .km-tour-reference {
        gap: 16px;
    }
}

/* Add to your tour CSS */
.km-tour-waiting-indicator {
    text-align: center;
    margin-top: 1rem;
}

.km-tour-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #2563EB;
    border-radius: 50%;
    animation: km-spin 1s linear infinite;
}

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

/* ========================================
   KARMAIL SEARCH BAR IMPROVEMENTS
   - Taller search bar (both desktop & mobile)
   - Clear button styling
   - Mobile swipe-to-close
   
   Add this to the END of karmail-scoped-styles-new.css
   ======================================== */

/* ========================================
   DESKTOP SEARCH BAR - Increased Height + Clear Button
   ======================================== */

#karmail-search-unique {
    max-width: 600px !important;
    margin: 0.5rem auto 0.5rem auto !important;
    position: relative !important;
    height: 44px !important; /* Increased from 32px */
}

#karmail-search-input-unique {
    width: 100% !important;
    height: 44px !important; /* Increased from 32px */
    padding: 0 5.5rem 0 1.25rem !important; /* Right padding for clear + search buttons */
    font-size: 13px !important; /* Slightly larger text */
    border: none !important;
    border-radius: 22px !important; /* Adjusted for taller height */
    background: #2563EB !important;
    color: white !important;
    font-weight: 600 !important;
    box-sizing: border-box !important;
    line-height: 44px !important;
}

#karmail-search-input-unique::placeholder {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 13px !important;
    line-height: 44px !important;
}

/* Clear button - Desktop */
#karmail-search-unique .km-search-clear {
    position: absolute !important;
    right: 42px !important; /* Position to left of search button */
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 28px !important;
    height: 28px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
    border-radius: 50% !important;
    color: white !important;
    display: none !important; /* Hidden by default */
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    font-size: 18px !important;
    font-weight: bold !important;
    line-height: 1 !important;
    transition: background 0.2s ease !important;
    z-index: 5 !important;
}

#karmail-search-unique .km-search-clear:hover {
    background: rgba(255, 255, 255, 0.35) !important;
}

#karmail-search-unique .km-search-clear.visible {
    display: flex !important;
}

/* Search button - Desktop */
#karmail-search-btn-unique {
    position: absolute !important;
    right: 6px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 32px !important;
    height: 32px !important;
    background: rgba(255, 255, 255, 0.3) !important;
    border: none !important;
    border-radius: 50% !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    z-index: 5 !important;
}

#karmail-search-btn-unique:hover {
    background: rgba(255, 255, 255, 0.45) !important;
}

#karmail-search-btn-unique svg {
    width: 14px !important;
    height: 14px !important;
}

/* ========================================
   MOBILE SEARCH BAR - Increased Height + Clear Button
   ======================================== */

@media (max-width: 768px) {
    #karmail-search-mobile {
        position: relative !important;
        margin-bottom: 20px !important;
        max-width: 100% !important;
        height: 44px !important; /* Increased from 32px */
    }

    #karmail-search-mobile .karmail-search-input {
        width: 100% !important;
        height: 44px !important; /* Increased from 32px */
        padding: 0 5.5rem 0 1.25rem !important; /* Right padding for clear + search buttons */
        font-size: 16px !important; /* 16px prevents iOS auto-zoom */
        border: none !important;
        border-radius: 22px !important;
        background: #2563EB !important;
        color: white !important;
        font-weight: 600 !important;
        box-sizing: border-box !important;
        line-height: 44px !important;
        /* Prevent iOS zoom */
        -webkit-text-size-adjust: 100%;
    }

    #karmail-search-mobile .karmail-search-input::placeholder {
        color: rgba(255, 255, 255, 0.85) !important;
    }

    /* Clear button - Mobile */
    #karmail-search-mobile .km-search-clear {
        position: absolute !important;
        right: 42px !important; /* Position to left of search button */
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 28px !important;
        height: 28px !important;
        background: rgba(255, 255, 255, 0.2) !important;
        border: none !important;
        border-radius: 50% !important;
        color: white !important;
        display: none !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        font-size: 18px !important;
        font-weight: bold !important;
        line-height: 1 !important;
        transition: background 0.2s ease !important;
        z-index: 5 !important;
    }

    #karmail-search-mobile .km-search-clear:hover {
        background: rgba(255, 255, 255, 0.35) !important;
    }

    #karmail-search-mobile .km-search-clear.visible {
        display: flex !important;
    }

    /* Search button - Mobile */
    #karmail-search-mobile .karmail-search-btn {
        position: absolute !important;
        right: 6px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 32px !important;
        height: 32px !important;
        background: rgba(255, 255, 255, 0.3) !important;
        border: none !important;
        border-radius: 50% !important;
        color: white !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        transition: background 0.2s ease !important;
        z-index: 5 !important;
    }

    #karmail-search-mobile .karmail-search-btn:hover {
        background: rgba(255, 255, 255, 0.45) !important;
    }

    #karmail-search-mobile .karmail-search-btn svg {
        width: 14px !important;
        height: 14px !important;
    }

    /* ========================================
       MOBILE FILTER PANEL - Swipe Support
       ======================================== */

    /* Panel transition for swipe */
    .km-filter-panel {
        transition: transform 0.3s ease !important;
    }
    
    /* Swipe handle at BOTTOM of panel */
    .km-swipe-handle-bottom {
        width: 60px;
        height: 5px;
        background: #9ca3af;
        border-radius: 3px;
        margin: 20px auto 10px;
        cursor: grab;
    }
    
    /* Add subtle hint text */
    .km-swipe-hint {
        text-align: center;
        font-size: 11px;
        color: #9ca3af;
        margin-bottom: 15px;
    }
    
    /* Swipe area container */
    .km-swipe-area {
        padding-top: 10px;
        border-top: 1px solid #e5e7eb;
        margin-top: 15px;
    }
}

/* Prevent body scroll when filter is open - applies to all screen sizes */
body.filter-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
}

/* ========================================
   FILTER PANEL HEIGHT FIXES
   - Desktop: Cover logo completely
   - iPad Portrait: Show heading below panel
   - iPad Landscape: Don't cover heading
   
   Add this to the END of karmail-scoped-styles-new.css
   ======================================== */

/* ========================================
   DESKTOP - Increase panel height to cover logo
   ======================================== */
@media (min-width: 1025px) {
  .km-desktop-filter-panel {
    padding: 50px 40px 25px 40px; /* Increased top from 38px to 50px, bottom from 18px to 25px */
  }
}

/* ========================================
   iPAD LANDSCAPE (1024x768 and similar)
   Reduce panel height so heading is visible
   ======================================== */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
  .km-desktop-filter-panel {
    padding: 30px 30px 15px 30px; /* Reduced padding */
  }
  
  /* Tighter pill spacing */
  .km-desktop-filter-panel .karmail-category-menu {
    gap: 6px 6px;
    padding: 10px 40px;
  }
  
  /* Slightly smaller search bar */
  .km-desktop-filter-panel #karmail-search-unique {
    margin-bottom: 10px;
  }
}

/* ========================================
   iPAD PORTRAIT (768x1024 and similar)
   Panel should not overlap heading
   ======================================== */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .km-desktop-filter-panel {
    padding: 35px 25px 30px 25px; /* Balanced padding */
  }
  
  /* Adjust category pill layout for narrower width */
  .km-desktop-filter-panel .karmail-category-menu {
    gap: 8px 8px;
    padding: 12px 80px;
  }
}

/* ========================================
   iPAD AIR 11" SPECIFIC (820x1180)
   ======================================== */
@media (min-width: 820px) and (max-width: 834px) and (orientation: portrait) {
  .km-desktop-filter-panel {
    padding: 35px 20px 18px 20px;
  }
}

/* ========================================
   iPad Air 11" - Card Grid & Form Fixes
   Portrait: 820px | Landscape: 1180px
   ======================================== */

/* Smaller pills - prevents wrapping on narrow cards */
@media (min-width: 768px) and (max-width: 1024px) {
  .category-pill {
    font-size: 0.7rem !important;
    padding: 3px 8px !important;
  }
}

/* PORTRAIT - Grid, cards, and form */
@media (min-width: 820px) and (max-width: 834px) and (orientation: portrait) {
  .km-grid-page {
    padding: 1rem 0.5rem !important;
  }
  
  .km-card-grid {
    gap: 2rem !important;
    padding: 0.75rem !important;
  }
  
  .km-card {
    padding: 1rem 1rem 1rem 1.25rem !important;
  }

  /* Form wrapper */
  .karmail-form-wrapper {
    width: 95% !important;
    max-width: 800px !important;
    padding: 1.5rem !important;
    padding-bottom: 0.75rem !important;
  }
  
  /* Title on one line */
  h3.karma-form-title {
    font-size: 4rem !important;
    white-space: nowrap !important;
    margin-top: 20px !important;
    margin-bottom: 10px !important;
    padding: 0 !important;
    line-height: 1.1 !important;
  }

  /* Textarea row */
  .karmail-form-body .row:nth-of-type(2) {
    margin-bottom: 1.5rem !important;
    padding-bottom: 0 !important;
  }

  .karmail-input-wrapper.textarea {
    margin-top: 0.75rem !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  .karmail-input-wrapper.textarea textarea,
  textarea#karmail_content_field {
    margin-bottom: 0 !important;
  }

  /* "Send this to:" row */
  .karmail-form-body .row:nth-of-type(3) {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
  }
  
  .karmail-form-body .row:nth-of-type(4) label {
    white-space: nowrap !important;
    margin-bottom: 0 !important;
    display: inline-block !important;
    margin-top: -3px !important;
  }
  
  input[name="karmail_email"] {
    width: 45% !important;
    max-width: 320px !important;
    display: inline-block !important;
    margin-top: 0 !important;
  }

  /* Terms tight to email */
  .karmail-form-terms {
    margin-top: 0.4rem !important;
    padding-top: 0 !important;
  }
  
  /* Button centered below terms */
  .karmail-form-wrapper .karmail-form-button {
    float: none !important;
    display: block !important;
    margin: 0.75rem auto 0 !important;
    width: auto !important;
  }
  
  .karmail-form-body .row:first-of-type {
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    line-height: 0 !important;
    font-size: 0 !important;
  }
  /* Space under title */
  h3.karma-form-title {
    margin-bottom: 20px !important;
  }

  /* Space under textarea */
  .karmail-form-body .row:nth-of-type(3) {
    margin-bottom: 1.25rem !important;
  }

  /* Reduce space between Send this to and terms */
  .karmail-form-body .row:nth-of-type(4) {
    margin-bottom: -0.25rem !important;
  }
  /* Nudge title left to visually center against ® symbol */
  h3.karma-form-title {
    padding-left: 4px !important;
  }

  /* Reduce space under button */
  .karmail-form-wrapper {
    padding-bottom: 0.25rem !important;
  }
}

/* LANDSCAPE - Grid layout */
@media (min-width: 820px) and (max-width: 1199px) and (orientation: landscape) {
  .km-card-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
    padding: 1rem !important;
  }
  
  .km-flip-container {
    width: 100% !important;
  }

  /* Tighter form title spacing */
  h3.karma-form-title {
    margin: 30px 0 16px 0 !important;
    padding: 0 !important;
    line-height: 1.1 !important;
  }
  
  .karmail-form-body {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
  
  .karmail-form-body .row:first-of-type,
  .karmail-form-body .row:nth-of-type(1),
  .karmail-form-body .row:nth-of-type(2) {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  .karmail-form-body .row:first-of-type {
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    line-height: 0 !important;
    font-size: 0 !important;
  }
}

/* LANDSCAPE - Narrower grid for larger landscape screens */
@media (min-width: 1025px) and (max-width: 1199px) and (orientation: landscape) {
  .km-card-grid {
    max-width: 820px !important;
    margin: 0 auto !important;
    gap: 2.5rem !important;
  }
}

/* ========================================
   DESKTOP FORM TIGHTENING (769px+)
   ======================================== */
@media (min-width: 769px) {
  /* Collapse empty first row */
  .karmail-form-body .row:first-of-type {
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    line-height: 0 !important;
    font-size: 0 !important;
  }

  /* Title spacing */
  h3.karma-form-title {
    margin: 28px 0 14px 0 !important;
    padding: 0 !important;
    padding-left: 3px !important;
    line-height: 1.1 !important;
  }

  /* Textarea row */
  .karmail-form-body .row:nth-of-type(3) {
    margin-bottom: 0.25rem !important;
    padding-bottom: 0 !important;
  }

  /* Send this to row */
  .karmail-form-body .row:nth-of-type(4) {
    margin-top: 0.25rem !important;
    margin-bottom: 0 !important;
  }

  /* Terms tight */
  .karmail-form-terms {
    margin-top: 0.4rem !important;
  }

  /* Button */
  .karmail-form-wrapper {
    padding-bottom: 0.5rem !important;
  }
}