/*
 * hourkey mobile-safe layer
 * Desktop guard: every rule is inside max-width media queries only.
 * Remove this stylesheet link to roll back the mobile pass.
 */

@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  img,
  svg,
  canvas,
  video,
  iframe {
    max-width: 100%;
  }

	  .topbar,
	  .hk-topbar {
	    width: 100%;
	    max-width: 100%;
	    padding: 12px 14px !important;
	    gap: 10px !important;
	    display: flex !important;
	    align-items: center !important;
	    flex-wrap: wrap !important;
	  }

	  .topbar .logo,
	  .hk-topbar .hk-logo,
	  .hk-logo {
	    min-width: 0;
	    flex-shrink: 0;
	    order: 1;
	  }

	  .top-r,
	  .hk-top-r {
	    margin-left: auto;
	    flex-shrink: 0;
	    order: 2;
	  }

	  #hk-topnav,
	  .nav,
	  .hk-nav {
	    order: 3;
	    flex: 0 0 100%;
	    width: 100%;
	    max-width: 100%;
	    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  #hk-topnav::-webkit-scrollbar,
  .nav::-webkit-scrollbar,
  .hk-nav::-webkit-scrollbar {
    display: none;
  }

  #hk-topnav a,
  .nav a,
  .hk-nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  main,
  .wrap,
  .container,
  .shell,
  .stage,
  .content,
  .page {
    width: 100%;
    max-width: 100% !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .hero,
  .row2,
  .extras-body,
  .deeplinks,
  .cards,
  .feature-grid,
  .form-grid,
  .result-body,
  .stats {
    max-width: 100%;
    min-width: 0;
  }

  .hero,
  .row2,
  .extras-body,
  .deeplinks,
  .form-grid,
  .result-body {
    grid-template-columns: 1fr !important;
  }

  .card,
  .tile,
  .panel,
  .box,
  .advanced,
  .rel,
  .extras,
  .filter-bar,
  .result-card,
  .palace-wrap,
  .cal-wrap,
  .radar-wrap {
    max-width: 100%;
    min-width: 0;
  }

  .pillar-table-wrap,
  .table-wrap,
  .cal-wrap,
  .palace-wrap,
  .overflow-x-auto {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    max-width: 100%;
  }

  input,
  select,
  textarea,
  button {
    max-width: 100%;
  }

  /*
   * Mobile typography pass · keep the desktop hero feel, but cap oversized
   * headings so mobile pages do not spend the first screen on one title.
   */
  h1,
  .hero h1,
  .hero-head h1,
  .datestrip .l h1,
  .master-greeting h1 {
    font-size: clamp(28px, 9vw, 38px) !important;
    line-height: 1.12 !important;
    letter-spacing: 0 !important;
  }

  h2,
  .section-head h2,
  .sec-h .l h2,
  .chat-head h2,
  .us-content h2 {
    font-size: clamp(24px, 7vw, 32px) !important;
    line-height: 1.16 !important;
    letter-spacing: 0 !important;
  }

  h3,
  .card h3,
  .panel h3,
  .side-card h3,
  .pillar-today h3 {
    font-size: clamp(18px, 5.4vw, 24px) !important;
    line-height: 1.22 !important;
  }

  .label,
  .crumb,
  .section-head .label,
  .hero-head .label,
  .hero .label,
  .sec-h .l .nu {
    letter-spacing: .16em !important;
  }

  .hero,
  .hero-head,
  .datestrip,
  .master-section {
    margin-bottom: 22px !important;
  }

  .datestrip {
    gap: 14px !important;
  }

  .datestrip .l .sub,
  .hero .lede,
  .hero-head .lede,
  .master-greeting .name {
    font-size: clamp(12px, 3.8vw, 14px) !important;
    line-height: 1.55 !important;
  }

  .stats b,
  .hero-head .stats b,
  .stat-card .num {
    font-size: clamp(22px, 7vw, 30px) !important;
  }

  .verdict {
    padding: 22px 18px !important;
  }

  .verdict .score .n {
    font-size: clamp(72px, 24vw, 104px) !important;
    line-height: .88 !important;
  }

  .verdict h2 {
    font-size: clamp(22px, 6.6vw, 28px) !important;
    line-height: 1.25 !important;
  }

  .gz-cell {
    width: 76px !important;
    height: 76px !important;
    font-size: 46px !important;
  }

  .fc-when .tc,
  .sp-score .num,
  .gc-score .num {
    font-size: clamp(28px, 8.5vw, 36px) !important;
  }

  .orb-core .glyph {
    font-size: clamp(72px, 22vw, 92px) !important;
  }

  .hk-um-wrap {
    top: 12px !important;
    right: 12px !important;
  }

  .hk-um-panel {
    max-width: calc(100vw - 24px) !important;
  }

  .hk-set-drawer {
    width: min(440px, 94vw) !important;
    max-width: 94vw !important;
  }

  nav.top ~ .hero {
    min-height: 58vh !important;
    padding-top: 76px !important;
    padding-bottom: 28px !important;
  }

  nav.top ~ .hero-sub-strip {
    margin-top: -18px !important;
    padding-top: 10px !important;
  }

  .hk-coach-overlay.show {
    display: none !important;
  }

  .hk-coach-card {
    background: var(--bg-2, #14171c) !important;
    border-color: var(--gold, #c8a44d) !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .62) !important;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding: 20px 16px !important;
  }
}

@media (max-width: 560px) {
  main,
  .wrap,
  .container,
  .shell,
  .stage,
  .content,
  .page {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .topbar,
  .hk-topbar {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .card,
  .tile,
  .panel,
  .box,
  .advanced,
  .rel,
  .extras,
  .filter-bar,
  .result-card,
  .palace-wrap,
  .cal-wrap,
  .radar-wrap {
    border-radius: 10px;
  }

  nav.top ~ .hero {
    min-height: 50vh !important;
  }

  nav.top ~ .hero-sub-strip {
    gap: 14px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-bottom: 38px !important;
  }

  nav.top ~ .hero-sub-strip .hero-headline {
    font-size: clamp(18px, 6vw, 24px) !important;
    line-height: 1.45 !important;
  }

  h1,
  .hero h1,
  .hero-head h1,
  .datestrip .l h1,
  .master-greeting h1 {
    font-size: clamp(26px, 8vw, 34px) !important;
  }

  h2,
  .section-head h2,
  .sec-h .l h2,
  .chat-head h2,
  .us-content h2 {
    font-size: clamp(22px, 6.4vw, 28px) !important;
  }

  .verdict .score .n {
    font-size: clamp(62px, 21vw, 86px) !important;
  }

  .verdict .score {
    gap: 8px !important;
    flex-wrap: wrap;
  }

  .verdict .score .tg {
    margin-left: 0 !important;
    padding: 6px 10px !important;
    font-size: 9px !important;
  }

  .gz-cell {
    width: 64px !important;
    height: 64px !important;
    font-size: 38px !important;
  }

  .section-head,
  .sec-h {
    margin-bottom: 14px !important;
  }
}
