/* =========================================================
   Kirley’s Tree Services — cookiePolicy.css (Policy Page)
   Dark + Gold (matches cookieConsent UI colorway)
   - Sidebar-aware (open/closed)
   - Sticky footer-safe (variable heights via CSS vars)
   - Fully scoped to #policy-page / .policy-page
   ========================================================= */

/* ------------------------------
   THEME TOKENS (safe fallbacks)
   ------------------------------ */
:root{
  /* ✅ Match Cookie Consent palette (NO BLUE) */
  --kts-dark: #333333;         /* same as consent panel */
  --kts-dark-deeper: #111111;  /* deeper backdrop */
  --kts-gold: #DAA520;

  /* Panels / cards */
  --kts-panel: #333333;        /* ✅ match consent panel */
  --kts-card: rgba(255,255,255,0.06);
  --kts-card-2: rgba(255,255,255,0.04);

  /* Text */
  --kts-text: rgba(255,255,255,0.92);
  --kts-muted: rgba(255,255,255,0.78);
  --kts-soft: rgba(255,255,255,0.70);

  /* Borders */
  --kts-border: rgba(255,255,255,0.18);
  --kts-border-strong: rgba(255,255,255,0.22);

  --kts-radius: 10px;
  --kts-shadow: 0 12px 32px rgba(0,0,0,0.35);

  /* ✅ Sticky footer protection */
  --kts-footer-h: 200px;

  /* ✅ Sidebar “open” padding (optional) */
  --kts-sidebar-pad: 0px;
}

/* Approximate sticky-footer height ranges (adjust if needed) */
@media (min-width: 1600px){
  :root{ --kts-footer-h: 520px; }
}
@media (min-width: 1200px){ :root{ --kts-footer-h: 180px; } }
@media (max-width: 1199px){ :root{ --kts-footer-h: 200px; } }
@media (max-width: 900px){  :root{ --kts-footer-h: 230px; } }
@media (max-width: 650px){  :root{ --kts-footer-h: 260px; } }
@media (max-width: 520px){  :root{ --kts-footer-h: 290px; } }
@media (max-width: 420px){  :root{ --kts-footer-h: 320px; } }

@media (min-width: 900px){
  body.sidebar-open{ --kts-sidebar-pad: 12px; }
}

/* ✅ BOX-SIZING SAFETY NET (prevents width:100% + padding overflow) */
#policy-page,
#policy-page *,
#policy-page *::before,
#policy-page *::after{
  box-sizing: border-box;
}

/* ------------------------------
   PAGE WRAPPER
   ------------------------------ */
#policy-page.policy-page{
  /* ✅ Dark + gold (no blues) */
  background: transparent !important;
  padding: clamp(1.25rem, 2vw, 2.25rem) 0;

  /* ✅ keep content from hiding behind sticky footer */
  padding-bottom: calc(
    var(--kts-footer-h) +
    clamp(24px, 3vw, 44px) +
    env(safe-area-inset-bottom)
  );

  color: var(--kts-text);
  overflow-x: hidden;
}

#policy-page [id]{ scroll-margin-top: 92px; }

body.sidebar-open #policy-page.policy-page{
  padding-left: var(--kts-sidebar-pad);
  padding-right: var(--kts-sidebar-pad);
}

/* ------------------------------
   CONTAINER
   ------------------------------ */
#policy-page .policy-container{
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding-inline: clamp(14px, 3vw, 24px);

  box-sizing: border-box;
  min-width: 0;
}

#policy-page .policy-card,
#policy-page .policy-card *{
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;   /* breaks long urls cleanly */
  word-break: break-word;    /* fallback */
}

/* ------------------------------
   TITLE + SUBTITLE
   ------------------------------ */
#policy-page .policy-title{
  font-family: 'Libre Baskerville', serif;
  color: var(--kts-gold);
  font-size: clamp(1.7rem, 2.4vw, 2.45rem);
  text-align: center;
  margin: 0.75rem 0 0.55rem;
  letter-spacing: 0.2px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

#policy-page .policy-subtitle{
  text-align: center;
  font-size: clamp(1rem, 1.2vw, 1.22rem);
  color: var(--kts-text);
  margin: 0 auto 1.25rem;
  max-width: 920px;
  line-height: 1.7;
}

/* ------------------------------
   CONTACT & HOURS
   ------------------------------ */
#policy-page .policy-contactHours{
  margin: 0 auto 1.25rem;
  background: var(--kts-panel);
  border: 1px solid var(--kts-border);
  border-radius: var(--kts-radius);
  box-shadow: var(--kts-shadow);
  padding: 1.05rem 1.15rem 1rem;
}

#policy-page .policy-contactHours h3{
  margin: 0 0 0.85rem;
  font-family: 'Libre Baskerville', serif;
  color: var(--kts-gold);

  font-size: 1.90rem;   /* try 2.50rem or 3.00rem */
  font-weight: 500;     /* thinner (Libre Baskerville supports 400/700 typically) */

  text-align: left;     /* ✅ left align */
  line-height: 1.15;
}

#policy-page .policy-hoursGrid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1rem;
}

#policy-page .policy-hoursCol{
  border: 1px solid var(--kts-border);
  border-radius: var(--kts-radius);
  background: var(--kts-card);
  padding: 0.95rem 1rem;
}

#policy-page .policy-hoursCol h4{
  margin: 0 0 0.65rem;
  color: var(--kts-text);
  font-size: clamp(0.95rem, 1.05vw, 1.10rem); /* ✅ smaller */
  font-weight: 725;
  text-align: left; /* force left */
}

#policy-page .policy-hoursCol{
  text-align: left; /* ✅ left-align everything in the card */
}

#policy-page .policy-hoursCol p{
  margin: 0;
  font-size: clamp(1rem, 1.2vw, 1.20rem);
  line-height: 1.7;
  color: var(--kts-soft);
  text-align: left; /* extra safety */
}

#policy-page .policy-hoursCol a{
  color: var(--kts-gold);
  font-weight: 775;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#policy-page .policy-hoursCol a:hover{ color: #CDA117; }

#policy-page .policy-hoursList{
  margin: 0;
  padding-left: 1.1rem;        /* ✅ give bullets normal indent */
  list-style-position: outside; /* ✅ classic left-aligned list */
  text-align: left;
}

#policy-page .policy-hoursList li{
  margin: 0.25rem 0;
  font-size: clamp(1rem, 1.2vw, 1.20rem);
  line-height: 1.7;
  color: var(--kts-text);
}

#policy-page .policy-contactHours .policy-note{
  margin: 0.95rem 0 0;
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--kts-gold);
  background: rgba(218,165,32,0.10);
  border-radius: 8px;

  font-size: 1.05rem;        /* UPDATED */
  color: rgba(255,255,255,0.88);
  line-height: 1.65;

  text-align: left;          /* UPDATED */
}

@media (max-width: 980px){
  #policy-page .policy-hoursGrid{ grid-template-columns: 1fr; }
}

/* ✅ Force policy-note links to use KTS gold (override global blue links) */
#policy-page .policy-note a,
#policy-page .policy-note a:visited{
  color: var(--kts-gold) !important;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Hover: slightly darker gold */
#policy-page .policy-note a:hover,
#policy-page .policy-note a:focus{
  color: #CDA117 !important;
}

/* Optional: nicer focus ring for keyboard */
#policy-page .policy-note a:focus-visible{
  outline: 2px solid var(--kts-gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ------------------------------
   TABS
   ------------------------------ */
#policy-page .policy-tabs{
  background: var(--kts-border);
  border: 1px solid var(--kts-border);
  border-radius: var(--kts-radius);
  box-shadow: var(--kts-shadow);
  overflow: hidden;

  display: grid;
  grid-template-columns: 1fr 1fr;

  column-gap: 1px;
  row-gap: 1px;

  justify-content: stretch !important;
  align-content: stretch !important;
  justify-items: stretch !important;
  align-items: stretch !important;

  padding: 0;

  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;   /* ✅ extra safety */
  background: var(--kts-panel);
}

#policy-page .policy-tabInput{
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* each tab fills its grid cell */
#policy-page .policy-tab{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0.9rem 1rem;
  cursor: pointer;
  user-select: none;

  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-size: 0.95rem;

  color: rgba(255,255,255,0.88);
  background: rgba(255,255,255,0.06);         /* tab fill */
  border: none !important;                    /* ✅ kill the double borders */

  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

/* remove right divider on the right-column tabs */
#policy-page label.policy-tab:nth-of-type(2n){
  border-right: none;
}

/* ✅ Panels must span BOTH columns */
#policy-page .policy-panel{
  grid-column: 1 / -1;
  width: auto;                 /* ✅ grid already sizes this */
  justify-self: stretch;       /* ✅ fill the grid area */
  min-width: 0;                /* ✅ allow shrink */
  display: none;
  padding: clamp(1rem, 1.6vw, 1.75rem);
  background: #474747;
}
#policy-page .policy-panel{
  min-width: 0;
}

#policy-page .policy-tab:hover{
  background: rgba(218,165,32,0.24);
  color: #fff;
  transform: none; /* ✅ keep borders perfectly aligned */
}

#policy-page .policy-tab:focus-visible{
  outline: 2px solid var(--kts-gold);
  outline-offset: -2px;
}

/* ✅ Active tab uses dark (no blue) */
#tab-cookie:checked + .policy-tab,
#tab-privacy:checked + .policy-tab,
#tab-tos:checked + .policy-tab,
#tab-ada:checked + .policy-tab{
  background: var(--kts-dark-deeper);
  color: var(--kts-gold);
  border-bottom-color: rgba(218,165,32,0.55);
}

#tab-cookie:checked ~ #panel-cookie{ display: block; }
#tab-privacy:checked ~ #panel-privacy{ display: block; }
#tab-tos:checked ~ #panel-tos{ display: block; }
#tab-ada:checked ~ #panel-ada{ display: block; }

/* ------------------------------
   CARD CONTENT
   ------------------------------ */
#policy-page .policy-card{ background: transparent; }

#policy-page .policy-meta{
  display: flex;
  flex-wrap: wrap;
  column-gap: 1rem;
  row-gap: 0.25rem;

  font-size: 1.15rem;          /* ✅ increase size */
  text-align: left;            /* ✅ left align text */
  justify-content: flex-start; /* ✅ keep flex items left */

  color: rgba(255,255,255,0.80);

  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--kts-border);
  margin-bottom: 1rem;
}

/* ✅ CRITICAL: flex children must be allowed to shrink */
#policy-page .policy-meta > *{
  min-width: 0;
}

/* ✅ Keep applies row full width AND allow wrapping */
#policy-page .policy-meta .policy-applies{
  flex: 1 1 100%;
  min-width: 0;

  text-align: left;            /* ✅ left align applies line */
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ✅ Make "Effective:", "Last Updated:", "Applies to:" use KTS gold */
#policy-page .policy-meta strong{
  color: var(--kts-gold);
  font-weight: 700; /* adjust if you want thinner */
}

/* Optional: make the values stay normal white/soft */
#policy-page .policy-meta span{
  color: rgba(255,255,255,0.88);
  font-weight: 400;
}

#policy-page .policy-meta p{ margin: 0; line-height: 1.35; }

/* If you keep the span, make sure it can wrap too */
#policy-page .policy-meta .policy-applies span{
  overflow-wrap: anywhere;
  word-break: break-word;
}

#policy-page .policy-card h3{
  margin-top: 1.25rem;
  margin-bottom: 0.55rem;
  font-size: clamp(1.12rem, 1.4vw, 3.36rem);
  color: var(--kts-gold);
  font-family: 'Libre Baskerville', serif;
  letter-spacing: 0.15px;
}

#policy-page .policy-card h4{
  color: rgba(255,255,255,0.94);
  margin-bottom: 0.45rem;
  font-size: 1.05rem;
}

#policy-page .policy-card p,
#policy-page .policy-card li{
  font-size: clamp(1rem, 1.2vw, 1.25rem);
  line-height: 1.75;
  color: var(--kts-text);
}

#policy-page .policy-card ul{
  margin-left: 1.25rem;
  margin-top: 0.4rem;
  margin-bottom: 0.9rem;
}

/* ✅ Force bullet lists to be left-aligned inside policy cards/boxes */
#policy-page .policy-card ul,
#policy-page .policy-card ol,
#policy-page .policy-box ul,
#policy-page .policy-box ol{
  text-align: left !important;
  margin-left: 0 !important;
  padding-left: 1.25rem !important;  /* controls bullet indent */
  list-style-position: outside;       /* keeps bullets on the left edge */
}

/* ✅ Bulletpoint "headline" text (the <strong> inside each <li>) */
#policy-page .policy-card li strong,
#policy-page .policy-box  li strong{
  color: var(--kts-gold) !important;  /* your gold */
  font-weight: 700;                  /* adjust: 600/650/700/800 */
}

#policy-page .policy-card code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;

  background: rgba(218,165,32,0.14);
  border: 1px solid rgba(218,165,32,0.35);
  color: #fff;

  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}

#policy-page .policy-note{
  font-size: 0.95rem;
  color: rgba(255,255,255,0.82);
  margin-top: 0.6rem;
}

#policy-page .policy-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.9rem;
}

#policy-page .policy-box{
  border: 1px solid var(--kts-border);
  border-radius: var(--kts-radius);
  padding: 1rem;
  background: var(--kts-panel);
}

#policy-page .policy-box h4{
  color: var(--kts-gold);
  margin-bottom: 0.4rem;
  font-size: 1.20rem;
  margin: 0 0 0.85rem;   /* increase/decrease until it matches */
  line-height: 1.2;
}

#policy-page .policy-bottomHint{
  margin-top: 1.25rem;
  padding: 0.25rem 0.65rem;
  border-left: 4px solid var(--kts-gold);
  background: rgba(218,165,32,0.10);
  border-radius: 8px;
}

#policy-page .policy-card a{
  color: var(--kts-gold);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#policy-page .policy-card a:hover{ color: #CDA117; }

/* ✅ Prevent long URLs in policy bodies from breaking layout */
#policy-page .policy-card a,
#policy-page .policy-card p,
#policy-page .policy-card li{
  overflow-wrap: anywhere;
  word-break: break-word;
}

#policy-page .policy-bottomHint .policy-jump{
  color: inherit !important;
  font-weight: inherit !important;
  text-decoration: none !important;
}
#policy-page .policy-bottomHint .policy-jumpText{
  color: #fff;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#policy-page .policy-bottomHint .policy-jump:hover .policy-jumpText{
  color: var(--kts-gold);
}

/* ADA inline link */
#policy-page #panel-ada .ada-kbGuideLink{
  margin-left: 0.6rem;
  font-weight: 700;
  color: var(--kts-gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
#policy-page #panel-ada .ada-kbGuideLink:hover{
  color: #CDA117;
  background: rgba(218,165,32,0.16);
  border-radius: 4px;
  padding: 0 0.25rem;
}
#policy-page #panel-ada .ada-kbGuideLink:focus-visible{
  outline: 2px solid var(--kts-gold);
  outline-offset: 3px;
  border-radius: 6px;
}

/* =========================================
   FORCE LEFT ALIGN: policy sections
   ========================================= */
#policy-page .policy-panel,
#policy-page .policy-card,
#policy-page .policy-box{
  text-align: left !important;
}

#policy-page .policy-card h3,
#policy-page .policy-card h4,
#policy-page .policy-card p,
#policy-page .policy-card ul,
#policy-page .policy-card ol,
#policy-page .policy-card li{
  text-align: left !important;
}

/* =========================================================
   KB GUIDE MODAL (STRICTLY SCOPED — NO BLEED)
   Works ONLY for: #kbGuideModal + children
   ========================================================= */

#kbGuideModal.kbGuide-modal{
  /* hidden by default so it never shows in footer flow */
  display: none;

  /* true modal overlay */
  position: fixed;
  inset: 0;
  z-index: 999999;

  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 28px);

  background: rgba(0,0,0,0.72);
}

#kbGuideModal.kbGuide-modal[aria-hidden="false"]{
  display: flex;
}

/* only affects modal elements */
#kbGuideModal.kbGuide-modal,
#kbGuideModal.kbGuide-modal *{
  box-sizing: border-box;
}

/* modal card */
#kbGuideModal.kbGuide-modal .kbGuide-content{
  position: relative;

  width: min(960px, 100%);
  max-height: calc(100vh - 2 * clamp(12px, 3vw, 28px));

  display: flex;
  flex-direction: column;
  overflow: hidden;                /* scrollbar stays inside */

  background: #333333;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);

  color: rgba(255,255,255,0.92);
  text-align: left;

  padding: 18px 18px 14px;
}

/* close button */
#kbGuideModal.kbGuide-modal .kbGuide-close{
  position: absolute;
  top: 10px;
  right: 12px;

  width: 40px;
  height: 40px;

  display: grid;
  place-items: center;

  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);

  color: #fff;
  font-size: 26px;
  line-height: 1;

  cursor: pointer;
}
#kbGuideModal.kbGuide-modal .kbGuide-close:hover{
  background: rgba(218,165,32,0.18);
  border-color: rgba(218,165,32,0.45);
}
#kbGuideModal.kbGuide-modal .kbGuide-close:focus-visible{
  outline: 2px solid #DAA520;
  outline-offset: 2px;
}

/* title + subtitle */
#kbGuideModal.kbGuide-modal #kbGuideTitle{
  margin: 6px 44px 0 0;          /* room for close button */
  color: #DAA520;
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  letter-spacing: 0.15px;
}
#kbGuideModal.kbGuide-modal .kbGuide-sub{
  margin: 6px 0 10px;
  color: rgba(255,255,255,0.82);
}

/* scrollable body */
#kbGuideModal.kbGuide-modal .kbGuide-body{
  flex: 1 1 auto;
  min-height: 0;                 /* critical for flex scroll */
  overflow-y: auto;
  padding-right: 10px;
  -webkit-overflow-scrolling: touch;
}

/* headings inside modal only */
#kbGuideModal.kbGuide-modal .kbGuide-body h3{
  margin: 16px 0 8px;
  color: #DAA520;
  font-family: 'Libre Baskerville', serif;
  font-size: 1.15rem;
}
#kbGuideModal.kbGuide-modal .kbGuide-body h4{
  margin: 14px 0 6px;
  color: rgba(255,255,255,0.92);
  font-size: 1.05rem;
}

/* text + lists inside modal only */
#kbGuideModal.kbGuide-modal .kbGuide-body p,
#kbGuideModal.kbGuide-modal .kbGuide-body li{
  color: rgba(255,255,255,0.92);
  font-size: 1.05rem;
  line-height: 1.65;
}
#kbGuideModal.kbGuide-modal .kbGuide-body ul{
  margin: 0 0 10px;
  padding-left: 1.25rem;
  list-style-position: outside;
}
#kbGuideModal.kbGuide-modal .kbGuide-note{
  color: rgba(255,255,255,0.82);
}
#kbGuideModal.kbGuide-modal .kbGuide-works{
  color: rgba(255,255,255,0.78);
  font-weight: 700;
}

/* code chips (modal only) */
#kbGuideModal.kbGuide-modal .kbGuide-body code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  font-size: 0.95em;
  background: rgba(218,165,32,0.14);
  border: 1px solid rgba(218,165,32,0.35);
  color: #fff;
  padding: 0.08rem 0.35rem;
  border-radius: 6px;
}

/* action row (sticky inside modal) */
#kbGuideModal.kbGuide-modal .kbGuide-actions{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.18);

  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* button inside modal only */
#kbGuideModal.kbGuide-modal .kbGuide-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 10px 14px;
  border-radius: 10px;

  text-decoration: none;
  font-weight: 800;
}

#kbGuideModal.kbGuide-modal .kbGuide-btn--gold{
  background: #DAA520;
  color: #111;
  border: 1px solid rgba(0,0,0,0.25);
}
#kbGuideModal.kbGuide-modal .kbGuide-btn--gold:hover{
  background: #CDA117;
}
#kbGuideModal.kbGuide-modal .kbGuide-btn:focus-visible{
  outline: 2px solid #DAA520;
  outline-offset: 3px;
}

/* Responsive */
@media (max-width: 980px){
  #policy-page .policy-grid{ grid-template-columns: 1fr; }
  #policy-page .policy-tab{
    font-size: 0.9rem;
    padding: 0.82rem 0.6rem;
  }
}
@media (max-width: 420px){
  #policy-page .policy-tab{
    font-size: 0.82rem;
    letter-spacing: 0.2px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  #policy-page .policy-tab{ transition: none; }
}

/* =========================================================
   Policy pages: hide ALL policy content when sidebar is open
   (300px → 665px)
   ========================================================= */

/* default state (visible) */
#policy-page.policy-page{
  opacity: 1;
  transition: opacity 0.8s ease-in-out 0.1s;
}

/* small screens: hide everything under the sidebar */
@media (min-width: 300px) and (max-width: 665px){
  body.sidebar-open #policy-page.policy-page{
    opacity: 0;
    pointer-events: none; /* ✅ prevents clicking/focusing hidden content */
  }
}

/* =========================================================
   ✅ KTS POLICY — Micro breakpoints (container scales for sidebar)
   Keeps layout identical; just shrinks container + type + spacing.
   Paste at VERY END of cookiePolicy.css
   ========================================================= */

/* =========================================================
   501px → 600px: “small desktop" tightening (light shrink)
   ========================================================= */
@media (min-width: 401px) and (max-width: 600px){

  /* ✅ CONTAINER: shrink overall footprint (helps sidebar-open) */
  #policy-page .policy-container{
    width: 100% !important;                 /* was 100% */
    max-width: 92% !important;             /* prevent stretching */
    margin: 0 auto !important;
    padding-inline: 12px !important;       /* keep your tighter padding */
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  /* ✅ When sidebar is open, tighten slightly more */
  body.sidebar-open #policy-page .policy-container{
    width: 88% !important;
    max-width: 88% !important;
    padding-inline: 10px !important;
  }

  /* keep long URLs safe */
  #policy-page .policy-card,
  #policy-page .policy-card *{
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  /* title/subtitle */
  #policy-page .policy-title{
    font-size: 1.55rem !important;
    margin: 0.65rem 0 0.45rem !important;
  }
  #policy-page .policy-subtitle{
    font-size: 0.98rem !important;
    line-height: 1.62 !important;
    margin-bottom: 1.05rem !important;
  }

  /* contact/hours card */
  #policy-page .policy-contactHours{
    padding: 0.90rem 0.95rem 0.90rem !important;
  }
  #policy-page .policy-contactHours h3{
    font-size: 1.55rem !important;
    margin-bottom: 0.70rem !important;
    line-height: 1.12 !important;
  }

  /* hours columns */
  #policy-page .policy-hoursCol{
    padding: 0.85rem 0.90rem !important;
  }
  #policy-page .policy-hoursCol h4{
    font-size: 0.95rem !important;
    margin-bottom: 0.55rem !important;
  }
  #policy-page .policy-hoursCol p{
    font-size: 0.98rem !important;
    line-height: 1.62 !important;
  }
  #policy-page .policy-hoursList li{
    font-size: 0.98rem !important;
    line-height: 1.62 !important;
  }

  /* policy note under contact/hours */
  #policy-page .policy-contactHours .policy-note{
    font-size: 0.95rem !important;
    padding: 0.75rem 0.85rem !important;
    line-height: 1.58 !important;
  }

  /* tabs: tighter but still 2-column */
  #policy-page .policy-tab{
    font-size: 0.82rem !important;
    padding: 0.74rem 0.60rem !important;
    letter-spacing: 0.2px !important;
  }
  #policy-page .policy-panel{
    padding: 0.95rem !important;
  }

  /* meta row */
  #policy-page .policy-meta{
    font-size: 1.02rem !important;
    column-gap: 0.70rem !important;
    padding-bottom: 0.45rem !important;
    margin-bottom: 0.85rem !important;
  }

  /* body headings + text */
  #policy-page .policy-card h3{
    font-size: 1.22rem !important;
    margin-top: 1.05rem !important;
    margin-bottom: 0.50rem !important;
  }
  #policy-page .policy-card h4{
    font-size: 1.00rem !important;
    margin-bottom: 0.40rem !important;
  }
  #policy-page .policy-card p,
  #policy-page .policy-card li{
    font-size: 0.98rem !important;
    line-height: 1.65 !important;
  }

  /* grids/boxes */
  #policy-page .policy-grid{
    gap: 0.85rem !important;
    margin-top: 0.75rem !important;
  }
  #policy-page .policy-box{
    padding: 0.90rem !important;
  }
  #policy-page .policy-box h4{
    font-size: 1.10rem !important;
    margin-bottom: 0.65rem !important;
  }

  /* code chips */
  #policy-page .policy-card code{
    font-size: 0.90em !important;
    padding: 0.08rem 0.30rem !important;
  }

  /* KB Guide modal: slightly tighter */
  #kbGuideModal.kbGuide-modal{
    padding: 12px !important;
  }
  #kbGuideModal.kbGuide-modal .kbGuide-content{
    padding: 16px 16px 12px !important;
  }
  #kbGuideModal.kbGuide-modal #kbGuideTitle{
    font-size: 1.35rem !important;
  }
  #kbGuideModal.kbGuide-modal .kbGuide-body p,
  #kbGuideModal.kbGuide-modal .kbGuide-body li{
    font-size: 0.98rem !important;
    line-height: 1.58 !important;
  }
}

/* =========================================================
   401px → 425px: “small phone” tightening (light shrink)
   ========================================================= */
@media (min-width: 401px) and (max-width: 500px){

  /* ✅ CONTAINER: shrink overall footprint (helps sidebar-open) */
  #policy-page .policy-container{
    width: 92% !important;                 /* was 100% */
    max-width: 92% !important;             /* prevent stretching */
    margin: 0 auto !important;
    padding-inline: 12px !important;       /* keep your tighter padding */
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  /* ✅ When sidebar is open, tighten slightly more */
  body.sidebar-open #policy-page .policy-container{
    width: 88% !important;
    max-width: 88% !important;
    padding-inline: 10px !important;
  }

  /* keep long URLs safe */
  #policy-page .policy-card,
  #policy-page .policy-card *{
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  /* title/subtitle */
  #policy-page .policy-title{
    font-size: 1.55rem !important;
    margin: 0.65rem 0 0.45rem !important;
  }
  #policy-page .policy-subtitle{
    font-size: 0.98rem !important;
    line-height: 1.62 !important;
    margin-bottom: 1.05rem !important;
  }

  /* contact/hours card */
  #policy-page .policy-contactHours{
    padding: 0.90rem 0.95rem 0.90rem !important;
  }
  #policy-page .policy-contactHours h3{
    font-size: 1.55rem !important;
    margin-bottom: 0.70rem !important;
    line-height: 1.12 !important;
  }

  /* hours columns */
  #policy-page .policy-hoursCol{
    padding: 0.85rem 0.90rem !important;
  }
  #policy-page .policy-hoursCol h4{
    font-size: 0.95rem !important;
    margin-bottom: 0.55rem !important;
  }
  #policy-page .policy-hoursCol p{
    font-size: 0.98rem !important;
    line-height: 1.62 !important;
  }
  #policy-page .policy-hoursList li{
    font-size: 0.98rem !important;
    line-height: 1.62 !important;
  }

  /* policy note under contact/hours */
  #policy-page .policy-contactHours .policy-note{
    font-size: 0.95rem !important;
    padding: 0.75rem 0.85rem !important;
    line-height: 1.58 !important;
  }

  /* tabs: tighter but still 2-column */
  #policy-page .policy-tab{
    font-size: 0.82rem !important;
    padding: 0.74rem 0.60rem !important;
    letter-spacing: 0.2px !important;
  }
  #policy-page .policy-panel{
    padding: 0.95rem !important;
  }

  /* meta row */
  #policy-page .policy-meta{
    font-size: 1.02rem !important;
    column-gap: 0.70rem !important;
    padding-bottom: 0.45rem !important;
    margin-bottom: 0.85rem !important;
  }

  /* body headings + text */
  #policy-page .policy-card h3{
    font-size: 1.22rem !important;
    margin-top: 1.05rem !important;
    margin-bottom: 0.50rem !important;
  }
  #policy-page .policy-card h4{
    font-size: 1.00rem !important;
    margin-bottom: 0.40rem !important;
  }
  #policy-page .policy-card p,
  #policy-page .policy-card li{
    font-size: 0.98rem !important;
    line-height: 1.65 !important;
  }

  /* grids/boxes */
  #policy-page .policy-grid{
    gap: 0.85rem !important;
    margin-top: 0.75rem !important;
  }
  #policy-page .policy-box{
    padding: 0.90rem !important;
  }
  #policy-page .policy-box h4{
    font-size: 1.10rem !important;
    margin-bottom: 0.65rem !important;
  }

  /* code chips */
  #policy-page .policy-card code{
    font-size: 0.90em !important;
    padding: 0.08rem 0.30rem !important;
  }

  /* KB Guide modal: slightly tighter */
  #kbGuideModal.kbGuide-modal{
    padding: 12px !important;
  }
  #kbGuideModal.kbGuide-modal .kbGuide-content{
    padding: 16px 16px 12px !important;
  }
  #kbGuideModal.kbGuide-modal #kbGuideTitle{
    font-size: 1.35rem !important;
  }
  #kbGuideModal.kbGuide-modal .kbGuide-body p,
  #kbGuideModal.kbGuide-modal .kbGuide-body li{
    font-size: 0.98rem !important;
    line-height: 1.58 !important;
  }
}


/* =========================================================
   300px → 400px: “very small phone” tightening (stronger shrink)
   ========================================================= */
@media (min-width: 300px) and (max-width: 400px){

  /* ✅ CONTAINER: shrink overall footprint (helps sidebar-open) */
  #policy-page .policy-container{
    width: 90% !important;                 /* was 100% */
    max-width: 90% !important;
    margin: 0 auto !important;
    padding-inline: 10px !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  /* ✅ Sidebar open: make it even narrower so nothing clips */
  body.sidebar-open #policy-page .policy-container{
    width: 84% !important;
    max-width: 84% !important;
    padding-inline: 8px !important;
  }

  /* keep long URLs safe */
  #policy-page .policy-card,
  #policy-page .policy-card *{
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  /* title/subtitle */
  #policy-page .policy-title{
    font-size: 1.42rem !important;
    margin: 0.60rem 0 0.40rem !important;
  }
  #policy-page .policy-subtitle{
    font-size: 0.92rem !important;
    line-height: 1.58 !important;
    margin-bottom: 0.95rem !important;
  }

  /* contact/hours card */
  #policy-page .policy-contactHours{
    padding: 0.82rem 0.85rem 0.82rem !important;
  }
  #policy-page .policy-contactHours h3{
    font-size: 1.35rem !important;
    margin-bottom: 0.62rem !important;
    line-height: 1.12 !important;
  }

  /* hours columns */
  #policy-page .policy-hoursCol{
    padding: 0.78rem 0.82rem !important;
  }
  #policy-page .policy-hoursCol h4{
    font-size: 0.90rem !important;
    margin-bottom: 0.50rem !important;
  }
  #policy-page .policy-hoursCol p{
    font-size: 0.92rem !important;
    line-height: 1.56 !important;
  }
  #policy-page .policy-hoursList{
    padding-left: 1.05rem !important;
  }
  #policy-page .policy-hoursList li{
    font-size: 0.92rem !important;
    line-height: 1.56 !important;
  }

  /* policy note under contact/hours */
  #policy-page .policy-contactHours .policy-note{
    font-size: 0.90rem !important;
    padding: 0.70rem 0.78rem !important;
    line-height: 1.54 !important;
  }

  /* tabs */
  #policy-page .policy-tab{
    font-size: 0.76rem !important;
    padding: 0.66rem 0.50rem !important;
    letter-spacing: 0.15px !important;
  }
  #policy-page .policy-panel{
    padding: 0.85rem !important;
  }

  /* meta row */
  #policy-page .policy-meta{
    font-size: 0.96rem !important;
    column-gap: 0.60rem !important;
    padding-bottom: 0.42rem !important;
    margin-bottom: 0.75rem !important;
  }

  /* body headings + text */
  #policy-page .policy-card h3{
    font-size: 1.12rem !important;
    margin-top: 0.95rem !important;
    margin-bottom: 0.45rem !important;
  }
  #policy-page .policy-card h4{
    font-size: 0.98rem !important;
    margin-bottom: 0.35rem !important;
  }
  #policy-page .policy-card p,
  #policy-page .policy-card li{
    font-size: 0.92rem !important;
    line-height: 1.60 !important;
  }

  /* lists: slightly less indent */
  #policy-page .policy-card ul,
  #policy-page .policy-card ol,
  #policy-page .policy-box ul,
  #policy-page .policy-box ol{
    padding-left: 1.10rem !important;
  }

  /* grids/boxes */
  #policy-page .policy-grid{
    gap: 0.78rem !important;
    margin-top: 0.70rem !important;
  }
  #policy-page .policy-box{
    padding: 0.82rem !important;
  }
  #policy-page .policy-box h4{
    font-size: 1.05rem !important;
    margin-bottom: 0.60rem !important;
  }

  /* code chips */
  #policy-page .policy-card code{
    font-size: 0.88em !important;
    padding: 0.07rem 0.28rem !important;
  }

  /* bottom hint */
  #policy-page .policy-bottomHint{
    padding: 0.20rem 0.55rem !important;
    margin-top: 1.05rem !important;
  }

  /* KB Guide modal */
  #kbGuideModal.kbGuide-modal{
    padding: 10px !important;
  }
  #kbGuideModal.kbGuide-modal .kbGuide-content{
    padding: 14px 14px 11px !important;
  }
  #kbGuideModal.kbGuide-modal .kbGuide-close{
    width: 38px !important;
    height: 38px !important;
    font-size: 24px !important;
  }
  #kbGuideModal.kbGuide-modal #kbGuideTitle{
    font-size: 1.25rem !important;
  }
  #kbGuideModal.kbGuide-modal .kbGuide-body p,
  #kbGuideModal.kbGuide-modal .kbGuide-body li{
    font-size: 0.92rem !important;
    line-height: 1.55 !important;
  }
  #kbGuideModal.kbGuide-modal .kbGuide-body h3{
    font-size: 1.05rem !important;
  }
  #kbGuideModal.kbGuide-modal .kbGuide-body h4{
    font-size: 0.98rem !important;
  }
}