@media(min-width:480px){#share-modal-overlay{align-items:center;}}

@media(min-width:480px){#share-modal{border-radius:20px;transform:scale(0.92) translateY(10px);}}

@media(min-width:480px){#share-modal-overlay.open #share-modal{transform:scale(1) translateY(0);}}

@media screen and (max-width: 768px) {
  #hero {
    width: 100vw !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    position: relative !important;
    overflow-x: hidden !important;
  }
  .hero-content {
    width: calc(100% - 40px) !important;
    max-width: calc(100% - 40px) !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }
  .hero-title {
    white-space: normal !important;
    word-break: keep-all !important;
    overflow: visible !important;
    text-align: center !important;
  }
}

@media(max-width:900px){
  main{grid-template-columns:1fr;}
  aside{border-left:none;border-top:1px solid var(--border);height:auto;}
  .content-area{height:auto;overflow-y:visible;}
  #country-grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));}
}

@media(max-width:680px){

  #hero {
    padding: 76px 0 44px;
    min-height: 100svh;
    width: 100vw !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
  }
  .hero-content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 20px !important;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
  }

  .hero-title {
    font-size: clamp(42px, 13vw, 72px) !important;
    letter-spacing: 0.01em !important;
    line-height: 0.92 !important;
    margin-bottom: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    white-space: normal !important;
    overflow: visible !important;
    word-break: keep-all !important;
  }
  .hero-sub {
    font-size: 13.5px;
    line-height: 1.65;
    margin-bottom: 18px;
    max-width: 100%;
    text-align: center;
  }
  .hero-eyebrow {
    font-size: 9px;
    padding: 4px 12px;
    margin-bottom: 16px;
    letter-spacing: 0.08em;
    white-space: nowrap;
  }
  .hero-pills {
    gap: 5px;
    margin-bottom: 18px;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
  }
  .hero-pill {
    font-size: 10px;
    padding: 5px 9px;
    gap: 4px;
  }
  .hero-cta {
    gap: 8px;
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    align-items: stretch;
    margin: 0 auto;
  }
  .btn-primary, .btn-secondary {
    padding: 12px 20px;
    font-size: 13px;
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .hero-stats {
    flex-wrap: wrap;
    margin-top: 20px;
    border-radius: 14px;
    width: 100%;
    overflow: hidden;
  }
  .hero-stat {
    padding: 14px 10px;
    flex: 1 1 calc(50% - 0.5px);
    min-width: 0;
    text-align: center;
    border-right: 1px solid var(--border);
    border-bottom: none;
  }

  .hero-stat:nth-child(1) { border-right: 1px solid var(--border); border-top: none; }
  .hero-stat:nth-child(2) { border-right: none; border-top: none; }
  .hero-stat:nth-child(3) { border-right: 1px solid var(--border); border-top: 1px solid var(--border); }
  .hero-stat:nth-child(4) { border-right: none; border-top: 1px solid var(--border); }
  .hero-stat:last-child { border-right: none; }
  .hero-stat-num { font-size: 20px; }

  .hero-nav {
    width: calc(100vw - 24px);
    left: 50%;
    transform: translateX(-50%);
    padding: 7px 12px;
    top: 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0;
  }
  .hero-nav.nav-hidden { transform: translateX(-50%) translateY(-80px); }
  .hero-logo {

    flex: 0 0 auto;
    justify-self: flex-start;
  }
  .hero-nav-links { display: none; }
  .live-pill { display: none; }
  .nav-right {
    flex: 0 0 auto;
  }

  .logo-text { display: block; }
  header { padding: 0 12px; gap: 8px; overflow: visible; }
  .search-wrap { flex: 1; min-width: 0; }
  .utc-pill { display: none; }
  .continent-dropdown-wrap { flex-shrink: 0; }
  #continent-btn-label { display: none; }
  .continent-dropdown-btn { padding: 0 8px; gap: 4px; }

  .stats-bar {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    flex-wrap: nowrap;
    padding: 0 12px;
  }
  .stat-item { flex-shrink: 0; padding: 0 10px; }
  .tabs { flex-shrink: 0; margin-left: 8px; }

  #country-grid,#city-grid { grid-template-columns: repeat(auto-fill,minmax(160px,1fr)) !important; gap:8px; }
  .diff-select-row { grid-template-columns: 1fr; gap:10px; }
  .diff-select-row > svg { display:none; }

  .clock-panel { padding: 14px 16px; }
  .clock-container { width:130px; height:130px; margin:0 auto 10px; }
  #clock-svg { width:130px; height:130px; }
  main { min-height: auto; }
  .content-area { padding: 14px 12px; }
  .planner-panel { padding: 14px 16px; }
}

@media(max-width:400px){
  .hero-title { font-size: clamp(36px, 13vw, 54px) !important; white-space: normal !important; word-break: keep-all !important; }
  .hero-stat { padding: 11px 10px; }
  .hero-stat-num { font-size: 18px; }
  .hero-stat-label { font-size: 8px; }
  .btn-primary, .btn-secondary { padding: 12px 16px; font-size: 13px; }
}

@media(hover:none){
  .country-card:hover { transform: none; box-shadow: none; }
  .fav-card:hover { transform: none; }
  .hero-pill:hover { transform: none; }
  .fav-remove { display: flex !important; opacity:1; }
}

@media(pointer:coarse){
  .icon-btn { width:32px; height:32px; }
  .tab-btn { padding:6px 16px; }
  .nav-theme-btn { width:38px; height:38px; }
}

@media(prefers-reduced-motion:reduce){
  *, *::before, *::after { animation-duration:0.01ms !important; animation-iteration-count:1 !important; transition-duration:0.01ms !important; }
  .hero-bg-dark { animation: none !important; }
}

@media(max-width:680px){
  .continent-dropdown-btn.has-filter::after{ display:block; }
  .continent-dropdown-btn { position:relative; }
}
