:root {
  --hp-navy: #102A43;
  --hp-deep-blue: #0B1F33;
  --hp-blue: #1F5F8B;
  --hp-teal: #2A9D8F;
  --hp-gold: #C9A24D;
  --hp-ivory: #F8F5EF;
  --hp-white: #FFFFFF;
  --hp-soft-gray: #F3F5F7;
  --hp-border: #E2E8F0;
  --hp-text: #1E293B;
  --hp-muted: #64748B;
  --hp-danger: #B42318;
  --hp-success: #157347;
  --hp-radius: 24px;
  --hp-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --hp-shadow-strong: 0 26px 70px rgba(15, 23, 42, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--hp-ivory);
  color: var(--hp-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}
a { color: var(--hp-blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--hp-deep-blue); }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
.screen-reader-text, .hp-skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.hp-skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  clip: auto;
  padding: 10px 14px;
  background: var(--hp-gold);
  color: var(--hp-deep-blue);
  z-index: 99999;
  border-radius: 10px;
}
.hp-container { max-width: 1240px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.hp-narrow { max-width: 880px; }
.hp-section { padding-top: 70px; padding-bottom: 70px; }
.hp-center { text-align: center; }

h1, h2, h3, h4, h5, h6 {
  color: var(--hp-deep-blue);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.16;
  margin: 0 0 16px;
}
h1 { font-size: clamp(38px, 6vw, 68px); letter-spacing: -0.04em; }
h2 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.03em; }
h3 { font-size: 24px; }
p { margin-top: 0; }

.hp-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--hp-gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 14px;
}
.hp-kicker::before {
  content: "";
  display: inline-block;
  width: 26px;
  height: 1px;
  background: currentColor;
}
.hp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  border: 1px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.hp-btn:hover { transform: translateY(-1px); text-decoration: none; }
.hp-btn-primary { background: var(--hp-deep-blue); color: var(--hp-white); box-shadow: var(--hp-shadow); }
.hp-btn-primary:hover { color: var(--hp-white); background: var(--hp-navy); }
.hp-btn-light { background: rgba(255,255,255,.95); color: var(--hp-deep-blue); border-color: rgba(255,255,255,.5); }
.hp-btn-gold { background: var(--hp-gold); color: var(--hp-deep-blue); }
.hp-btn-gold:hover { color: var(--hp-deep-blue); box-shadow: var(--hp-shadow); }
.hp-btn-small { min-height: 40px; padding: 8px 16px; font-size: 14px; }

.hp-card, .hp-page-card {
  background: var(--hp-white);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius);
  padding: 30px;
  box-shadow: var(--hp-shadow);
}
.hp-card h3 { margin-bottom: 12px; }
.hp-card p { color: var(--hp-muted); }
.hp-page-header { margin-bottom: 28px; }
.hp-page-header p { max-width: 760px; color: var(--hp-muted); margin-left: auto; margin-right: auto; }

/* Header */
.hp-site-header { background: var(--hp-deep-blue); color: var(--hp-white); position: relative; z-index: 1000; }
.hp-top-strip { border-bottom: 1px solid rgba(255,255,255,.08); color: rgba(255,255,255,.76); font-size: 13px; }
.hp-top-strip-inner { display: flex; justify-content: space-between; gap: 18px; padding-top: 8px; padding-bottom: 8px; }
.hp-header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.hp-brand { flex: 0 0 auto; }
.hp-logo-text, .hp-footer-logo {
  color: var(--hp-white);
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.custom-logo-link img { max-height: 58px; width: auto; display: block; }
.hp-primary-nav { flex: 1 1 auto; display: flex; justify-content: center; }
.hp-menu, .hp-mobile-menu { list-style: none; padding: 0; margin: 0; }
.hp-menu { display: flex; align-items: center; gap: 4px; }
.hp-menu a {
  color: rgba(255,255,255,.86);
  text-decoration: none;
  padding: 10px 13px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 15px;
}
.hp-menu a:hover { color: var(--hp-white); background: rgba(255,255,255,.08); }
.hp-header-actions { display: flex; align-items: center; gap: 12px; }
.hp-header-link { color: rgba(255,255,255,.86); text-decoration: none; font-weight: 700; }
.hp-menu-toggle { display: none; background: rgba(255,255,255,.08); color: var(--hp-white); border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: 9px 14px; }
.hp-mobile-panel { background: var(--hp-navy); border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0 24px; }
.hp-mobile-menu { margin-top: 18px; display: grid; gap: 8px; }
.hp-mobile-menu a { color: var(--hp-white); display: block; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.06); text-decoration: none; }
.hp-mobile-bottom-nav { display: none; }

/* Footer */
.hp-site-footer { background: var(--hp-deep-blue); color: rgba(255,255,255,.78); padding: 70px 0 24px; }
.hp-footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 36px; }
.hp-site-footer h3 { color: var(--hp-white); font-family: inherit; font-size: 16px; margin-bottom: 14px; }
.hp-site-footer a { display: block; color: rgba(255,255,255,.76); text-decoration: none; margin: 8px 0; }
.hp-site-footer a:hover { color: var(--hp-white); }
.hp-footer-brand p { max-width: 380px; }
.hp-footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 42px; padding-top: 18px; font-size: 14px; }

/* Search */
.hp-search-form { display: flex; gap: 8px; width: 100%; }
.hp-search-form input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 50px;
  border: 1px solid var(--hp-border);
  border-radius: 999px;
  padding: 0 18px;
  background: var(--hp-white);
  color: var(--hp-text);
}
.hp-search-form button {
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  background: var(--hp-deep-blue);
  color: var(--hp-white);
  font-weight: 800;
  cursor: pointer;
}

/* Hero */
.hp-hero { background: radial-gradient(circle at top right, rgba(201,162,77,.32), transparent 34%), linear-gradient(135deg, var(--hp-deep-blue), var(--hp-navy)); color: var(--hp-white); padding: 90px 0; overflow: hidden; }
.hp-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); gap: 56px; align-items: center; }
.hp-hero h1 { color: var(--hp-white); }
.hp-hero p { color: rgba(255,255,255,.78); font-size: 19px; max-width: 720px; }
.hp-hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0; }
.hp-hero-search { background: rgba(255,255,255,.98); border-radius: 22px; padding: 12px; box-shadow: var(--hp-shadow-strong); max-width: 760px; }
.hp-hero-panel { min-height: 440px; border-radius: 34px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); padding: 28px; box-shadow: var(--hp-shadow-strong); backdrop-filter: blur(10px); }
.hp-preview-card { background: rgba(255,255,255,.92); color: var(--hp-text); border-radius: 24px; padding: 24px; box-shadow: var(--hp-shadow); }
.hp-preview-main { min-height: 260px; display: flex; flex-direction: column; justify-content: flex-end; margin-bottom: 18px; }
.hp-preview-card h2 { color: var(--hp-deep-blue); margin: 8px 0; }
.hp-preview-card span { color: var(--hp-muted); display: block; }
.hp-preview-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* Grids */
.hp-trust-grid, .hp-feature-grid, .hp-plan-grid { display: grid; gap: 24px; }
.hp-trust-grid { grid-template-columns: repeat(4, 1fr); }
.hp-feature-grid { grid-template-columns: repeat(3, 1fr); }
.hp-trust-card { background: var(--hp-white); border: 1px solid var(--hp-border); border-radius: 20px; padding: 22px; box-shadow: var(--hp-shadow); }
.hp-trust-card strong { display: block; color: var(--hp-deep-blue); }
.hp-trust-card span { color: var(--hp-muted); font-size: 14px; }
.hp-section-heading { margin-bottom: 28px; max-width: 780px; }
.hp-section-heading p { color: var(--hp-muted); }

/* Plans */
.hp-plan-grid { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
.hp-plan-card { background: var(--hp-white); border: 1px solid var(--hp-border); border-radius: 28px; padding: 32px; box-shadow: var(--hp-shadow); display: flex; flex-direction: column; }
.hp-plan-card.featured { border-color: var(--hp-gold); transform: translateY(-8px); box-shadow: var(--hp-shadow-strong); }
.hp-plan-card h3 { font-size: 32px; }
.hp-plan-card p { color: var(--hp-muted); }
.hp-plan-card ul { list-style: none; padding: 0; margin: 12px 0 28px; }
.hp-plan-card li { padding: 8px 0 8px 28px; position: relative; }
.hp-plan-card li::before { content: "✓"; position: absolute; left: 0; color: var(--hp-success); font-weight: 900; }
.hp-plan-card .hp-btn { margin-top: auto; }
.hp-plan-badge { display: inline-flex; width: max-content; border-radius: 999px; padding: 6px 12px; background: rgba(201,162,77,.15); color: #7A5A12; font-size: 13px; font-weight: 800; margin-bottom: 16px; }

/* Breadcrumb */
.hp-breadcrumb { font-size: 14px; color: var(--hp-muted); margin-bottom: 18px; }
.hp-breadcrumb a { color: var(--hp-blue); text-decoration: none; }
.hp-breadcrumb span { margin: 0 3px; }
.hp-breadcrumb-sep { color: var(--hp-muted); }

/* Reading */
.hp-reading-content { font-size: 18px; line-height: 1.85; color: var(--hp-text); }
.hp-reading-content h1, .hp-reading-content h2, .hp-reading-content h3 { margin-top: 36px; color: var(--hp-deep-blue); }
.hp-reading-content h1:first-child, .hp-reading-content h2:first-child, .hp-reading-content h3:first-child { margin-top: 0; }
.hp-reading-content p { margin-bottom: 18px; }
.hp-reading-content table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 16px; }
.hp-reading-content th, .hp-reading-content td { border: 1px solid var(--hp-border); padding: 12px; vertical-align: top; }
.hp-reading-content th { background: var(--hp-soft-gray); color: var(--hp-deep-blue); }
.hp-disclaimer { background: #FFF8E6; border: 1px solid #F2D58A; border-radius: 18px; padding: 20px 22px; color: #5F4700; font-size: 15px; line-height: 1.6; margin: 32px 0; }

/* Materia Medica wrappers and common plugin styling */
.hp-mm-hero, .hp-repertory-hero { background: linear-gradient(135deg, var(--hp-deep-blue), var(--hp-blue)); color: var(--hp-white); padding: 44px; border-radius: 30px; margin-bottom: 32px; box-shadow: var(--hp-shadow); }
.hp-mm-hero h1, .hp-repertory-hero h1 { color: var(--hp-white); }
.hp-mm-hero p, .hp-repertory-hero p { color: rgba(255,255,255,.82); max-width: 820px; }
.hp-mm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.hp-mm-main, .hp-mm-sidebar { background: var(--hp-white); border: 1px solid var(--hp-border); border-radius: 24px; padding: 28px; box-shadow: var(--hp-shadow); }
.hp-mm-sidebar { position: sticky; top: 20px; }
.hp-sidebar-box { margin-top: 22px; padding: 18px; border-radius: 18px; background: var(--hp-ivory); border: 1px solid var(--hp-border); }

/* Style common plugin outputs without knowing exact class names */
.hpf-materia-context .entry-content,
.hpf-materia-context .hp-entry-content,
.hpf-materia-context .homeopilot-materia-medica,
.hpf-materia-context .materia-medica-content { max-width: 100%; }
.hpf-materia-context .hp-entry-content a,
.hpf-materia-context .homeopilot-materia-medica a,
.hpf-materia-context .materia-medica-content a { font-weight: 700; }
.hpf-materia-context .az-filter,
.hpf-materia-context .hp-az-filter,
.hpf-materia-context .letter-filter,
.hpf-materia-context .alphabet-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.hpf-materia-context .az-filter a,
.hpf-materia-context .hp-az-filter a,
.hpf-materia-context .letter-filter a,
.hpf-materia-context .alphabet-filter a { min-width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--hp-border); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 800; padding: 0 10px; background: var(--hp-white); }
.hpf-materia-context .az-filter a:hover,
.hpf-materia-context .hp-az-filter a:hover,
.hpf-materia-context .letter-filter a:hover,
.hpf-materia-context .alphabet-filter a:hover,
.hpf-materia-context .az-filter a.active,
.hpf-materia-context .hp-az-filter a.active { background: var(--hp-deep-blue); color: var(--hp-white); }
.hpf-materia-context .remedy-card,
.hpf-materia-context .author-card,
.hpf-materia-context .hp-remedy-card,
.hpf-materia-context .hp-author-card { border: 1px solid var(--hp-border); border-radius: 18px; padding: 18px; background: var(--hp-white); box-shadow: 0 10px 28px rgba(15,23,42,.06); margin-bottom: 14px; }
.hpf-materia-context .hp-remedy-title,
.hpf-materia-context .remedy-title { font-size: clamp(34px, 5vw, 58px); line-height: 1.1; color: var(--hp-deep-blue); margin-bottom: 10px; }
.hpf-materia-context .hp-remedy-author,
.hpf-materia-context .remedy-author { color: var(--hp-muted); font-size: 16px; margin-bottom: 28px; }

/* Repertory */
.hp-chapter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.hp-chapter-card { background: var(--hp-white); border: 1px solid var(--hp-border); border-radius: 18px; padding: 20px; box-shadow: var(--hp-shadow); font-weight: 800; color: var(--hp-deep-blue); }
.hp-upgrade-note { border-color: var(--hp-gold); }

/* Posts */
.hp-post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.hp-post-card h2 { font-size: 25px; }
.hp-post-card h2 a { text-decoration: none; color: var(--hp-deep-blue); }
.nav-links { display: flex; gap: 10px; justify-content: center; margin-top: 32px; }
.nav-links a, .nav-links span { padding: 10px 14px; background: var(--hp-white); border: 1px solid var(--hp-border); border-radius: 12px; text-decoration: none; }

@media (max-width: 1100px) {
  .hp-primary-nav, .hp-header-link, .hp-top-plans { display: none; }
  .hp-menu-toggle { display: inline-flex; }
  .hp-hero-grid { grid-template-columns: 1fr; }
  .hp-hero-panel { min-height: auto; }
  .hp-trust-grid { grid-template-columns: repeat(2, 1fr); }
  .hp-feature-grid, .hp-plan-grid, .hp-post-grid { grid-template-columns: 1fr; }
  .hp-plan-card.featured { transform: none; }
  .hp-footer-grid { grid-template-columns: 1fr 1fr; }
  .hp-mm-layout { grid-template-columns: 1fr; }
  .hp-mm-sidebar { position: static; }
}

@media (max-width: 768px) {
  body { font-size: 16px; padding-bottom: 64px; }
  .hp-container { padding-left: 18px; padding-right: 18px; }
  .hp-section { padding-top: 48px; padding-bottom: 48px; }
  .hp-top-strip { display: none; }
  .hp-header-inner { min-height: 68px; }
  .hp-logo-text { font-size: 26px; }
  .hp-header-actions .hp-btn { display: none; }
  .hp-hero { padding: 60px 0; }
  .hp-hero p { font-size: 17px; }
  .hp-hero-actions, .hp-search-form { flex-direction: column; }
  .hp-btn, .hp-search-form button { width: 100%; }
  .hp-preview-row, .hp-trust-grid, .hp-footer-grid, .hp-chapter-grid { grid-template-columns: 1fr; }
  .hp-card, .hp-page-card, .hp-mm-main, .hp-mm-sidebar, .hp-plan-card { padding: 22px; border-radius: 18px; }
  .hp-mm-hero, .hp-repertory-hero { padding: 28px; border-radius: 22px; }
  .hp-reading-content { font-size: 17px; line-height: 1.75; }
  .hp-mobile-bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: var(--hp-white); border-top: 1px solid var(--hp-border); z-index: 9999; box-shadow: 0 -10px 28px rgba(15,23,42,.08); }
  .hp-mobile-bottom-nav a { text-align: center; padding: 10px 4px; font-size: 12px; color: var(--hp-deep-blue); text-decoration: none; font-weight: 750; }
}

/* HomeoPilot v3.0 Membership Ready UI
--------------------------------------------- */
.hpf-membership-context .hp-main,
.hp-member-dashboard-page,
.hp-account-page,
.hp-pricing-page {
  background:
    radial-gradient(circle at top left, rgba(201, 162, 77, 0.10), transparent 32rem),
    radial-gradient(circle at top right, rgba(42, 157, 143, 0.10), transparent 30rem);
}

.hp-member-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 32px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  background: rgba(31, 95, 139, .12);
  color: var(--hp-deep-blue);
  border: 1px solid rgba(31, 95, 139, .18);
}

.hp-member-badge-premium,
.hp-member-badge-platinum {
  background: rgba(201, 162, 77, .16);
  color: #71510c;
  border-color: rgba(201, 162, 77, .35);
}

.hp-dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: center;
  gap: 28px;
  margin-bottom: 32px;
  background: linear-gradient(135deg, var(--hp-deep-blue), var(--hp-blue));
  color: var(--hp-white);
  overflow: hidden;
}

.hp-dashboard-hero h1,
.hp-dashboard-hero p,
.hp-dashboard-hero .hp-kicker {
  color: var(--hp-white);
}

.hp-dashboard-plan-card {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 24px;
  padding: 22px;
  display: grid;
  gap: 14px;
  backdrop-filter: blur(10px);
}

.hp-dashboard-plan-card span:first-child {
  color: rgba(255,255,255,.78);
  font-size: 13px;
}

.hp-dashboard-plan-card a {
  color: var(--hp-white);
  font-weight: 800;
}

.hp-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 34px;
}

.hp-dashboard-stat {
  background: var(--hp-white);
  border: 1px solid var(--hp-border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.07);
}

.hp-dashboard-stat span {
  display: block;
  color: var(--hp-gold);
  font-size: 40px;
  line-height: 1;
  font-weight: 900;
  margin-bottom: 12px;
}

.hp-dashboard-stat strong {
  display: block;
  color: var(--hp-deep-blue);
  margin-bottom: 8px;
}

.hp-dashboard-stat p {
  margin: 0;
  color: var(--hp-muted);
  font-size: 14px;
}

.hp-upgrade-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-color: rgba(201, 162, 77, .42);
  background: linear-gradient(135deg, #fff, rgba(201, 162, 77, .10));
  margin: 32px 0;
}

.hp-upgrade-prompt h2 {
  margin-top: 0;
}

.hp-member-section {
  margin: 44px 0;
}

.hp-section-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 22px;
}

.hp-small-link {
  color: var(--hp-blue);
  font-weight: 800;
  text-decoration: none;
}

.hp-saved-grid,
.hp-locked-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.hp-saved-card,
.hp-locked-card,
.hp-note-panel,
.hp-highlight-panel,
.hp-account-card {
  background: var(--hp-white);
  border: 1px solid var(--hp-border);
  border-radius: 24px;
  padding: 26px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .07);
}

.hp-saved-card > span,
.hp-rubric-row > span {
  color: var(--hp-gold);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.hp-saved-card h3,
.hp-locked-card h3 {
  color: var(--hp-deep-blue);
  margin-bottom: 10px;
}

.hp-card-actions,
.hp-note-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.hp-card-actions button,
.hp-note-actions button,
.hp-rubric-row button {
  border: 1px solid var(--hp-border);
  background: var(--hp-soft-gray);
  color: var(--hp-muted);
  border-radius: 999px;
  padding: 9px 13px;
  cursor: not-allowed;
}

.hp-rubric-list {
  display: grid;
  gap: 12px;
}

.hp-rubric-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1.1fr) auto;
  gap: 16px;
  align-items: center;
  background: var(--hp-white);
  border: 1px solid var(--hp-border);
  border-radius: 18px;
  padding: 17px 18px;
}

.hp-rubric-row strong {
  color: var(--hp-deep-blue);
}

.hp-rubric-row em {
  color: var(--hp-muted);
  font-style: normal;
  font-size: 14px;
}

.hp-notes-layout {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 24px;
  margin: 44px 0;
}

.hp-note-panel textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  border: 1px solid var(--hp-border);
  border-radius: 18px;
  padding: 16px;
  background: var(--hp-soft-gray);
  color: var(--hp-muted);
  font: inherit;
}

.hp-highlight-line {
  border-radius: 18px;
  background: #fff8e6;
  border: 1px solid #f2d58a;
  padding: 18px;
  margin: 18px 0;
  line-height: 1.7;
}

.hp-highlight-line mark {
  background: rgba(201, 162, 77, .28);
  color: var(--hp-text);
  padding: 2px 5px;
  border-radius: 4px;
}

.hp-lock-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(201, 162, 77, .14);
  margin-bottom: 14px;
}

.hp-locked-card {
  position: relative;
  overflow: hidden;
}

.hp-locked-card::after {
  content: '';
  position: absolute;
  inset: auto -40px -40px auto;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(201, 162, 77, .10);
  pointer-events: none;
}

.hp-ad-placeholder {
  border: 1px dashed rgba(31, 95, 139, .35);
  background: rgba(31, 95, 139, .05);
  border-radius: 18px;
  padding: 18px;
  margin: 22px 0;
  text-align: center;
  color: var(--hp-muted);
}

.hp-ad-placeholder span {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--hp-white);
  border: 1px solid var(--hp-border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}

.hp-ad-placeholder strong {
  display: block;
  color: var(--hp-deep-blue);
  margin-bottom: 6px;
}

.hp-ad-placeholder p {
  margin: 0;
  font-size: 14px;
}

.hp-plan-grid-v30 .hp-plan-card {
  position: relative;
}

.hp-plan-price {
  display: block;
  color: var(--hp-deep-blue);
  font-size: 28px;
  margin: 18px 0;
}

.hp-account-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.hp-account-sidebar {
  position: sticky;
  top: 96px;
  background: var(--hp-deep-blue);
  color: var(--hp-white);
  border-radius: 28px;
  padding: 28px;
}

.hp-account-sidebar h1,
.hp-account-sidebar p,
.hp-account-sidebar .hp-kicker {
  color: var(--hp-white);
}

.hp-account-nav {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.hp-account-nav a {
  color: var(--hp-white);
  text-decoration: none;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(255,255,255,.10);
}

.hp-account-main {
  display: grid;
  gap: 20px;
}

.hp-plan-status-row,
.hp-mini-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 16px 0;
}

.hp-mini-grid span {
  background: var(--hp-soft-gray);
  border: 1px solid var(--hp-border);
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--hp-deep-blue);
  font-weight: 700;
}

.hp-muted-card {
  background: var(--hp-soft-gray);
}

.hp-plan-comparison {
  margin-top: 48px;
}

.hp-comparison-table {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--hp-border);
  border-radius: 18px;
  background: var(--hp-white);
}

.hp-comparison-table > div {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(90px, 1fr));
  border-bottom: 1px solid var(--hp-border);
}

.hp-comparison-table > div:last-child {
  border-bottom: 0;
}

.hp-comparison-table span {
  padding: 15px;
  border-right: 1px solid var(--hp-border);
}

.hp-comparison-table span:last-child {
  border-right: 0;
}

.hp-table-head {
  background: var(--hp-deep-blue);
  color: var(--hp-white);
  font-weight: 800;
}

@media (max-width: 1000px) {
  .hp-dashboard-grid,
  .hp-saved-grid,
  .hp-locked-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hp-rubric-row {
    grid-template-columns: 1fr;
  }

  .hp-account-layout,
  .hp-dashboard-hero,
  .hp-notes-layout {
    grid-template-columns: 1fr;
  }

  .hp-account-sidebar {
    position: static;
  }
}

@media (max-width: 700px) {
  .hp-dashboard-grid,
  .hp-saved-grid,
  .hp-locked-grid {
    grid-template-columns: 1fr;
  }

  .hp-upgrade-prompt,
  .hp-section-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .hp-comparison-table {
    overflow-x: auto;
  }

  .hp-comparison-table > div {
    min-width: 620px;
  }
}

@media print {
  .hp-ad-placeholder,
  .hp-upgrade-prompt,
  .hp-locked-grid,
  .hp-mobile-bottom-nav,
  .hp-site-header,
  .hp-site-footer {
    display: none !important;
  }
}

/* Version 4.0 — Professional Software Layer */
.hpf-professional-context .hp-main,
.hp-professional-dashboard-page,
.hp-case-workspace-page,
.hp-remedy-comparison-page,
.hp-repertorisation-results-page {
  background:
    radial-gradient(circle at 15% 0%, rgba(201, 162, 77, .12), transparent 34rem),
    radial-gradient(circle at 92% 14%, rgba(42, 157, 143, .12), transparent 32rem);
}

.hp-pro-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 30px;
  align-items: center;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--hp-deep-blue), #132f4b 56%, var(--hp-blue));
  color: var(--hp-white);
  overflow: hidden;
  position: relative;
}

.hp-pro-hero::after {
  content: '';
  position: absolute;
  width: 320px;
  height: 320px;
  right: -120px;
  bottom: -160px;
  border-radius: 999px;
  background: rgba(201, 162, 77, .15);
}

.hp-pro-hero > * { position: relative; z-index: 1; }
.hp-pro-hero h1,
.hp-pro-hero h2,
.hp-pro-hero p,
.hp-pro-hero .hp-kicker { color: var(--hp-white); }
.hp-pro-hero p { max-width: 760px; color: rgba(255,255,255,.82); }
.hp-pro-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.hp-pro-hero-panel,
.hp-pro-search-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 24px;
}

.hp-pro-hero-panel strong,
.hp-pro-search-card label { color: var(--hp-white); font-size: 20px; }
.hp-pro-hero-panel span { color: rgba(255,255,255,.88); font-weight: 800; }
.hp-pro-hero-panel small { color: rgba(255,255,255,.7); }
.hp-pro-search-card input {
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.96);
  color: var(--hp-deep-blue);
  border-radius: 14px;
  padding: 13px 14px;
}
.hp-pro-search-card button,
.hp-export-actions button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  background: var(--hp-gold);
  color: var(--hp-deep-blue);
  font-weight: 900;
}
.hp-pro-search-card button:disabled,
.hp-export-actions button:disabled { opacity: .58; cursor: not-allowed; }

.hp-pro-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 30px;
  padding: 12px;
  border: 1px solid var(--hp-border);
  border-radius: 999px;
  background: var(--hp-white);
  box-shadow: 0 16px 40px rgba(15,23,42,.06);
}
.hp-pro-nav a {
  text-decoration: none;
  color: var(--hp-deep-blue);
  font-weight: 800;
  border-radius: 999px;
  padding: 10px 15px;
}
.hp-pro-nav a.is-active,
.hp-pro-nav a:hover { background: var(--hp-deep-blue); color: var(--hp-white); }

.hp-pro-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 32px 0 46px;
}
.hp-pro-metric {
  background: var(--hp-white);
  border: 1px solid var(--hp-border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 16px 42px rgba(15,23,42,.07);
}
.hp-pro-metric span {
  display: block;
  font-size: 42px;
  line-height: 1;
  font-weight: 950;
  color: var(--hp-gold);
  margin-bottom: 12px;
}
.hp-pro-metric strong { display: block; color: var(--hp-deep-blue); margin-bottom: 8px; }
.hp-pro-metric p { margin: 0; color: var(--hp-muted); font-size: 14px; }

.hp-case-layout,
.hp-author-filter-layout,
.hp-results-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.hp-case-sidebar,
.hp-author-filter-panel,
.hp-results-sidebar {
  position: sticky;
  top: 96px;
  background: var(--hp-white);
  border: 1px solid var(--hp-border);
  border-radius: 26px;
  padding: 24px;
  box-shadow: 0 16px 42px rgba(15,23,42,.07);
}
.hp-case-sidebar ul,
.hp-results-sidebar ol { margin: 0; padding-left: 20px; }
.hp-case-sidebar li,
.hp-results-sidebar li { padding: 9px 0; color: var(--hp-muted); }
.hp-case-sidebar li.is-active { color: var(--hp-deep-blue); font-weight: 900; }
.hp-author-filter-panel label { display: block; margin: 12px 0; color: var(--hp-deep-blue); font-weight: 700; }
.hp-author-filter-panel hr { border: 0; border-top: 1px solid var(--hp-border); margin: 20px 0; }

.hp-case-main,
.hp-comparison-workbench,
.hp-results-main { display: grid; gap: 24px; }
.hp-case-panel,
.hp-comparison-workbench,
.hp-results-main {
  background: var(--hp-white);
  border: 1px solid var(--hp-border);
  border-radius: 26px;
  padding: 28px;
  box-shadow: 0 16px 42px rgba(15,23,42,.07);
}

.hp-case-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.hp-case-form-grid label { display: grid; gap: 8px; color: var(--hp-deep-blue); font-weight: 800; }
.hp-case-form-grid label.wide { grid-column: 1 / -1; }
.hp-case-form-grid input,
.hp-case-form-grid textarea {
  width: 100%;
  border: 1px solid var(--hp-border);
  background: var(--hp-soft-gray);
  border-radius: 16px;
  padding: 14px 15px;
  color: var(--hp-muted);
}
.hp-case-form-grid textarea { min-height: 130px; resize: vertical; }
.hp-rubric-basket { display: grid; gap: 12px; }
.hp-rubric-basket article {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--hp-border);
  border-radius: 16px;
  padding: 15px 16px;
  background: var(--hp-soft-gray);
}
.hp-rubric-basket span { color: var(--hp-gold); font-weight: 900; }

.hp-comparison-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 13px;
  border-radius: 16px;
  background: var(--hp-soft-gray);
  color: var(--hp-deep-blue);
  font-weight: 800;
}
.hp-comparison-toolbar button {
  border: 1px solid var(--hp-border);
  background: var(--hp-white);
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 800;
}
.hp-remedy-compare-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.hp-remedy-compare-grid article {
  border: 1px solid var(--hp-border);
  border-radius: 20px;
  padding: 22px;
  background: #fff;
}
.hp-remedy-compare-grid article > span {
  display: inline-flex;
  margin-bottom: 14px;
  color: #7A5A12;
  background: rgba(201,162,77,.14);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 900;
  font-size: 13px;
}

.hp-results-table,
.hp-relationship-matrix {
  display: grid;
  border: 1px solid var(--hp-border);
  border-radius: 20px;
  overflow: hidden;
  background: var(--hp-white);
}
.hp-results-table > div,
.hp-relationship-matrix > div {
  display: grid;
  border-bottom: 1px solid var(--hp-border);
}
.hp-results-table > div { grid-template-columns: 70px minmax(180px, 1.5fr) 100px 130px 130px; }
.hp-relationship-matrix > div { grid-template-columns: minmax(170px, 1.2fr) repeat(4, minmax(120px, 1fr)); }
.hp-results-table > div:last-child,
.hp-relationship-matrix > div:last-child { border-bottom: 0; }
.hp-results-table span,
.hp-results-table strong,
.hp-relationship-matrix span,
.hp-relationship-matrix strong { padding: 15px; border-right: 1px solid var(--hp-border); }
.hp-results-table span:last-child,
.hp-results-table strong:last-child,
.hp-relationship-matrix span:last-child,
.hp-relationship-matrix strong:last-child { border-right: 0; }
.hp-results-head,
.hp-matrix-head { background: var(--hp-deep-blue); color: var(--hp-white); font-weight: 900; }
.hp-results-row strong,
.hp-relationship-matrix strong { color: var(--hp-deep-blue); }

.hp-remedy-grade { display: inline-flex; align-items: center; gap: 5px; padding: 15px; }
.hp-remedy-grade i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(201,162,77,.55);
  background: transparent;
}
.hp-remedy-grade i.is-filled { background: var(--hp-gold); border-color: var(--hp-gold); }

.hp-relationship-section,
.hp-platinum-tools { margin-top: 48px; }
.hp-platinum-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.hp-export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  margin: 44px 0;
  padding: 28px;
  border: 1px solid rgba(201,162,77,.42);
  border-radius: 26px;
  background: linear-gradient(135deg, #fff, rgba(201,162,77,.10));
  box-shadow: 0 16px 42px rgba(15,23,42,.07);
}
.hp-export-actions { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 1050px) {
  .hp-pro-hero,
  .hp-case-layout,
  .hp-author-filter-layout,
  .hp-results-layout { grid-template-columns: 1fr; }
  .hp-case-sidebar,
  .hp-author-filter-panel,
  .hp-results-sidebar { position: static; }
  .hp-pro-metrics-grid,
  .hp-platinum-grid { grid-template-columns: repeat(2, 1fr); }
  .hp-remedy-compare-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .hp-pro-nav { border-radius: 22px; }
  .hp-pro-nav a { width: 100%; }
  .hp-pro-metrics-grid,
  .hp-platinum-grid,
  .hp-case-form-grid { grid-template-columns: 1fr; }
  .hp-export-bar,
  .hp-rubric-basket article { flex-direction: column; align-items: flex-start; }
  .hp-results-table,
  .hp-relationship-matrix { overflow-x: auto; }
  .hp-results-table > div { min-width: 720px; }
  .hp-relationship-matrix > div { min-width: 760px; }
}

@media print {
  .hp-pro-nav,
  .hp-pro-actions,
  .hp-pro-search-card,
  .hp-case-sidebar,
  .hp-author-filter-panel,
  .hp-results-sidebar,
  .hp-export-actions,
  .hp-platinum-tools,
  .hp-upgrade-prompt,
  .hp-ad-placeholder,
  .hp-mobile-bottom-nav,
  .hp-site-header,
  .hp-site-footer { display: none !important; }
  .hp-pro-hero,
  .hp-case-panel,
  .hp-comparison-workbench,
  .hp-results-main,
  .hp-export-bar {
    box-shadow: none !important;
    border-color: #999 !important;
    background: #fff !important;
    color: #111 !important;
  }
  .hp-pro-hero h1,
  .hp-pro-hero h2,
  .hp-pro-hero p,
  .hp-pro-hero .hp-kicker { color: #111 !important; }
}

/* Version 5.0 - International Platform */
.hp-top-intl a,
.hp-header-language {
  white-space: nowrap;
}

.hp-intl-hero {
  background: radial-gradient(circle at top right, rgba(201,162,77,.18), transparent 34%), linear-gradient(135deg, var(--hp-deep-blue), var(--hp-navy));
  color: var(--hp-white);
}

.hp-intl-panel,
.hp-intl-card,
.hp-global-author-group,
.hp-source-box,
.hp-region-disclaimer {
  background: var(--hp-white);
  border: 1px solid var(--hp-border);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.hp-intl-panel {
  color: var(--hp-text);
  padding: 28px;
}

.hp-intl-panel h2,
.hp-intl-card h2,
.hp-global-author-group h2,
.hp-source-box h2 {
  color: var(--hp-deep-blue);
  margin-top: 0;
}

.hp-intl-selector {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.hp-intl-selector label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--hp-deep-blue);
}

.hp-intl-selector select {
  width: 100%;
  border: 1px solid var(--hp-border);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--hp-white);
  color: var(--hp-text);
}

.hp-intl-selector button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--hp-deep-blue);
  color: var(--hp-white);
  font-weight: 800;
  cursor: pointer;
}

.hp-intl-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.hp-intl-card {
  padding: 26px;
}

.hp-region-disclaimer {
  padding: 22px 24px;
  background: #fff8e6;
  border-color: #f2d58a;
  color: #5f4700;
}

.hp-region-disclaimer strong {
  display: block;
  color: #453200;
  margin-bottom: 8px;
}

.hp-global-authors {
  display: grid;
  gap: 28px;
}

.hp-global-author-group {
  padding: 28px;
}

.hp-global-author-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.hp-global-author-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--hp-border);
  border-radius: 18px;
  background: var(--hp-ivory);
  color: var(--hp-deep-blue);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}

.hp-global-author-card:hover,
.hp-global-author-card:focus {
  transform: translateY(-2px);
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.10);
}

.hp-global-author-card span {
  font-weight: 800;
}

.hp-global-author-card small {
  color: var(--hp-muted);
}

.hp-source-box {
  padding: 28px;
}

@media (max-width: 980px) {
  .hp-intl-grid,
  .hp-global-author-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .hp-intl-grid,
  .hp-global-author-grid {
    grid-template-columns: 1fr;
  }
  .hp-top-intl,
  .hp-header-language {
    display: none;
  }
}

/* v5.0.2 Mega menu and admin-controlled UI polish */
.hp-mega-nav { position: relative; }
.hp-mega-menu { position: relative; gap: 6px; }
.hp-mega-item { position: relative; }
.hp-mega-panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: min(760px, 92vw);
  padding: 18px;
  border-radius: 24px;
  background: rgba(255,255,255,.98);
  color: var(--hp-text);
  border: 1px solid var(--hp-border);
  box-shadow: 0 24px 70px rgba(2, 12, 27, .24);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  z-index: 2000;
}
.hp-mega-panel::before {
  content: "";
  position: absolute;
  top: -18px;
  left: 0;
  right: 0;
  height: 20px;
}
.hp-mega-item:hover .hp-mega-panel,
.hp-mega-item:focus-within .hp-mega-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.hp-mega-panel-small { width: min(520px, 92vw); }
.hp-mega-grid { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 16px; }
.hp-mega-grid-2 { grid-template-columns: 1fr 1fr; }
.hp-mega-panel strong {
  display: block;
  margin: 0 0 10px;
  color: var(--hp-deep-blue);
  font-size: 14px;
  letter-spacing: .02em;
}
.hp-mega-panel a {
  display: block;
  color: var(--hp-text) !important;
  background: transparent !important;
  border-radius: 14px;
  padding: 9px 10px;
  margin: 2px 0;
  font-size: 14px;
}
.hp-mega-panel a:hover { background: var(--hp-soft-gray) !important; color: var(--hp-deep-blue) !important; }
.hp-mega-highlight {
  background: linear-gradient(135deg, rgba(16,42,67,.96), rgba(31,95,139,.92));
  border-radius: 18px;
  padding: 18px;
  color: #fff;
}
.hp-mega-highlight span { color: var(--hp-gold); font-weight: 800; }
.hp-mega-highlight p { color: rgba(255,255,255,.82); margin: 8px 0 0; font-size: 14px; }

.hp-theme-admin-note {
  background: #eef6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 14px;
}

@media (max-width: 1100px) {
  .hp-primary-nav { display: none; }
  .hp-menu-toggle { display: inline-flex; }
}

@media print {
  .hp-site-header,
  .hp-site-footer,
  .hp-mobile-bottom-nav,
  .hp-header-actions,
  .hp-reading-tools,
  .hp-upgrade-card,
  .hp-ad-placeholder { display: none !important; }
  .hp-main, .hp-section, .hp-container { padding: 0 !important; max-width: 100% !important; }
  .hp-card, .hp-mm-main, .hp-page-card { box-shadow: none !important; border: 0 !important; }
}

/* v5.0.5 mobile alignment and usability fixes */
@media (max-width: 980px) {
  .hp-top-strip-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .hp-header-inner {
    gap: 12px;
    min-width: 0;
  }
  .hp-brand {
    min-width: 0;
  }
  .hp-logo-text {
    font-size: 24px;
    white-space: nowrap;
  }
  .hp-header-actions {
    gap: 8px;
    margin-left: auto;
  }
  .hp-header-actions .hp-header-link,
  .hp-header-actions .hp-btn-small {
    display: none;
  }
  .hp-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .hp-hero-grid,
  .hp-mm-layout,
  .hp-repertory-layout,
  .hp-professional-grid,
  .hp-dashboard-grid,
  .hp-account-grid,
  .hp-intl-layout {
    grid-template-columns: 1fr !important;
  }
  .hp-hero-panel,
  .hp-preview-card,
  .hp-card,
  .hp-page-card,
  .hp-mm-main,
  .hp-mm-sidebar,
  .hp-repertory-main,
  .hp-repertory-sidebar {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: 62px;
  }
  .hp-container {
    padding-left: 16px;
    padding-right: 16px;
  }
  .hp-section {
    padding-top: 44px;
    padding-bottom: 44px;
  }
  h1 {
    font-size: clamp(34px, 10vw, 46px);
  }
  h2 {
    font-size: clamp(26px, 8vw, 36px);
  }
  .hp-hero {
    padding: 52px 0 46px;
  }
  .hp-hero-actions,
  .hp-search-form {
    flex-direction: column;
    align-items: stretch;
  }
  .hp-hero-actions .hp-btn,
  .hp-search-form button {
    width: 100%;
  }
  .hp-hero-search {
    padding: 10px;
    border-radius: 18px;
  }
  .hp-hero-panel {
    padding: 18px;
    border-radius: 24px;
  }
  .hp-preview-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .hp-trust-grid,
  .hp-feature-grid,
  .hp-plan-grid,
  .hp-footer-grid,
  .hp-author-grid,
  .hp-rubric-grid,
  .hp-tool-grid,
  .hp-matrix-grid {
    grid-template-columns: 1fr !important;
  }
  .hp-card,
  .hp-page-card,
  .hp-plan-card,
  .hp-mm-main,
  .hp-mm-sidebar {
    padding: 20px;
    border-radius: 18px;
  }
  .hp-plan-card.featured {
    transform: none;
  }
  .hp-reading-content {
    font-size: 17px;
    line-height: 1.78;
    overflow-wrap: anywhere;
  }
  .hp-reading-content table,
  .hp-table-scroll {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .hp-mobile-bottom-nav {
    grid-template-columns: repeat(5, 1fr) !important;
  }
  .hp-mobile-bottom-nav a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 420px) {
  .hp-logo-text {
    font-size: 21px;
  }
  .hp-menu-toggle {
    padding: 8px 11px;
    font-size: 13px;
  }
  .hp-mobile-bottom-nav a {
    font-size: 11px;
    padding: 9px 2px;
  }
}

/* Remedy Search and priority remedy cards */
.hp-priority-remedies-section { position: relative; }
.hp-priority-remedy-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}
.hp-remedy-result-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.hp-priority-remedy-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid rgba(120, 83, 30, .16);
    border-radius: 14px;
    background: rgba(255,255,255,.88);
    box-shadow: 0 10px 24px rgba(37, 25, 11, .05);
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    text-align: center;
}
.hp-remedy-result-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 118px;
    padding: 20px;
    border: 1px solid rgba(120, 83, 30, .18);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(250,244,232,.92));
    box-shadow: 0 16px 38px rgba(37, 25, 11, .07);
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.hp-priority-remedy-card:hover,
.hp-remedy-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(37, 25, 11, .1);
    border-color: rgba(181, 129, 42, .42);
}
.hp-remedy-card-name {
    color: var(--hp-ink, #1f2933);
    font-size: .9rem;
    line-height: 1.22;
    font-weight: 800;
    margin: 0;
}
.hp-remedy-result-card h3 {
    color: var(--hp-ink, #1f2933);
    font-size: 1.08rem;
    line-height: 1.3;
    font-weight: 800;
    margin: 0;
}
.hp-remedy-result-author {
    display: inline-flex;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(181, 129, 42, .12);
    color: #7a531b;
    font-size: .82rem;
    font-weight: 700;
}
.hp-section-actions {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}
.hp-priority-remedies-section .hp-section-actions .hp-btn {
    min-height: 0;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: .86rem;
    line-height: 1.1;
}
.hp-remedy-search-page .hp-mm-hero { margin-bottom: 28px; }
.hp-remedy-search-form {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    max-width: 760px;
}
.hp-remedy-search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(120, 83, 30, .2);
    border-radius: 16px;
    padding: 15px 16px;
    font-size: 1rem;
    background: #fff;
}
.hp-remedy-search-form button {
    border: 0;
    border-radius: 16px;
    padding: 15px 22px;
    font-weight: 800;
    cursor: pointer;
    background: var(--hp-gold, #b5812a);
    color: #fff;
}
.hp-remedy-search-empty,
.hp-remedy-no-results { margin-top: 24px; }
.hp-remedy-results-heading { margin-bottom: 18px; }
.hp-remedy-result-card a {
    color: #7a531b;
    font-weight: 800;
    text-decoration: none;
}
@media (max-width: 1100px) {
    .hp-priority-remedy-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .hp-priority-remedy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hp-remedy-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .hp-priority-remedy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .hp-remedy-result-grid { grid-template-columns: 1fr; }
    .hp-remedy-card-name { font-size: .84rem; }
    .hp-remedy-search-form { flex-direction: column; }
    .hp-remedy-search-form button { width: 100%; }
}

/* 404 recovery page */
.hp-404-page .hp-mm-hero { margin-bottom: 30px; }
.hp-404-hero .hp-remedy-search-form { margin-left: auto; margin-right: auto; }
.hp-404-link-section { margin-top: 34px; }
.hp-404-link-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.hp-404-link-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    border-radius: 22px;
    border: 1px solid rgba(120, 83, 30, .18);
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(250,244,232,.92));
    box-shadow: 0 16px 38px rgba(37, 25, 11, .07);
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.hp-404-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(37, 25, 11, .11);
    border-color: rgba(181, 129, 42, .42);
}
.hp-404-link-card strong { color: var(--hp-ink, #1f2933); font-size: 1rem; }
.hp-404-link-card span { color: var(--hp-muted, #64748b); font-size: .92rem; line-height: 1.45; }
.hp-404-search-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.hp-404-search-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 13px;
    border-radius: 999px;
    border: 1px solid rgba(120, 83, 30, .18);
    background: rgba(255,255,255,.9);
    color: var(--hp-ink, #1f2933);
    font-weight: 800;
    font-size: .9rem;
    text-decoration: none;
}
.hp-404-search-chip:hover { border-color: rgba(181, 129, 42, .42); color: #7a531b; }
@media (max-width: 900px) {
    .hp-404-link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .hp-404-link-grid { grid-template-columns: 1fr; }
    .hp-404-search-chip-grid { gap: 8px; }
    .hp-404-search-chip { font-size: .84rem; padding: 7px 11px; }
}
