html {
  width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  max-width: 100%;
}

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

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

.container,
.inner,
.page,
.wrapper,
.hero-content,
.card,
.donate-card,
.result-card,
.stat-card,
.sc,
.signal-card {
  min-width: 0;
}

.stat-value,
.sval,
.mval,
.tval,
.result-value,
.price,
.price-usd,
.price-czk,
.btc-price-main,
.btc-price-czk,
.bigval,
.addr-value,
.addr-display p,
.card-title,
.card-desc,
.subtitle,
.hero-subtitle,
.page-subtitle {
  overflow-wrap: anywhere;
}

nav {
  max-width: 100%;
}

.mobile-menu-toggle {
  display: none;
}

.nav-links a,
.nav-brand,
.status-item,
.tab,
.refresh-btn,
.btn,
.download-btn {
  white-space: nowrap;
}

@media (max-width: 1180px) {
  nav {
    height: auto;
    min-height: 56px;
    padding: 0 1rem;
  }

  .nav-brand {
    display: flex;
    align-items: center;
    min-height: 56px;
    margin-right: 1rem;
  }

  .nav-links {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    padding: 0 0.85rem;
    font-size: 0.68rem;
  }
}

@media (max-width: 920px) {
  .container,
  .inner,
  .page {
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  .main,
  .signal-grid {
    grid-template-columns: 1fr !important;
  }

  .ngrid,
  .network-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .results-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)) !important;
  }

  .btc-price-card,
  .price-bar {
    align-items: stretch;
  }

  .btc-price-card > div,
  .price-bar > div {
    min-width: 0;
  }
}

@media (max-width: 920px) {
  body {
    padding-bottom: 0 !important;
  }

  nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
  }

  .nav-brand {
    min-height: 52px;
    margin: 0;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border, #1e1e1e);
    font-size: 0.88rem;
    letter-spacing: 0.14em;
  }

  .nav-links {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    overflow: visible;
  }

  .nav-links li:first-child a {
    border-left: 0;
  }

  .nav-links a {
    height: auto;
    min-height: 44px;
    line-height: 1.25;
    padding: 0.72rem 0.75rem;
    border-right: 1px solid var(--border, #1e1e1e);
    border-bottom: 1px solid var(--border, #1e1e1e);
    white-space: normal;
    overflow-wrap: anywhere;
    display: flex;
    align-items: center;
  }

  .statusbar {
    position: static !important;
    height: auto !important;
    min-height: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.65rem 1rem !important;
    overflow: visible !important;
    line-height: 1.35;
  }

  .status-item {
    white-space: normal;
  }
}

@media (max-width: 720px) {
  nav.has-mobile-menu {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    align-items: center;
  }

  nav.has-mobile-menu .nav-brand {
    border-bottom: 0;
    min-width: 0;
  }

  .mobile-menu-toggle {
    position: relative;
    display: inline-flex;
    width: 44px;
    height: 44px;
    margin-right: 0.5rem;
    align-items: center;
    justify-content: center;
    justify-self: end;
    border: 1px solid var(--border, #1e1e1e);
    border-radius: 6px;
    background: rgba(247, 147, 26, 0.08);
    color: var(--orange, var(--gold, #f7931a));
    cursor: pointer;
    z-index: 2;
  }

  .mobile-menu-toggle:hover,
  .mobile-menu-toggle:focus-visible {
    border-color: var(--orange, var(--gold, #f7931a));
    outline: none;
    box-shadow: 0 0 0 3px rgba(247, 147, 26, 0.12);
  }

  .mobile-menu-toggle span,
  .mobile-menu-toggle::before,
  .mobile-menu-toggle::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .mobile-menu-toggle::before {
    transform: translateY(-7px);
  }

  .mobile-menu-toggle::after {
    transform: translateY(7px);
  }

  nav.nav-open .mobile-menu-toggle span {
    opacity: 0;
  }

  nav.nav-open .mobile-menu-toggle::before {
    transform: rotate(45deg);
  }

  nav.nav-open .mobile-menu-toggle::after {
    transform: rotate(-45deg);
  }

  nav.has-mobile-menu .nav-links {
    grid-column: 1 / -1;
    display: none !important;
  }

  nav.has-mobile-menu.nav-open .nav-links {
    display: grid !important;
  }

  .hero {
    min-height: auto;
    padding: 2.5rem 1rem 2rem;
  }

  .hero-label,
  .hero-subtitle,
  .page-label,
  .page-subtitle,
  .subtitle,
  .hdr-sub {
    letter-spacing: 0.12em;
    line-height: 1.5;
  }

  .hero-title {
    font-size: clamp(2.25rem, 16vw, 4.25rem);
    letter-spacing: 0;
  }

  .cards {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 1rem;
  }

  .card {
    width: 100%;
    padding: 1.4rem;
  }

  .container {
    padding-top: 24px;
    padding-bottom: 32px;
  }

  header,
  .hdr,
  .page-header {
    margin-bottom: 28px;
  }

  .calc-section,
  .sc,
  .halving-card,
  .result,
  .donate-card,
  .terminal-msg {
    padding: 1.25rem;
    border-radius: 10px;
  }

  .input-grid {
    grid-template-columns: 1fr !important;
    gap: 18px;
  }

  .period-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .tab {
    width: 100%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    text-align: center;
  }

  .btc-price-card,
  .price-bar,
  .profit-row,
  .progress-label,
  .halving-row,
  .halving-info,
  .card-type,
  .prow {
    flex-direction: column;
    align-items: stretch;
  }

  .btc-price-card,
  .price-bar {
    padding: 1.25rem;
  }

  .btc-price-main,
  .price-usd,
  .price {
    font-size: clamp(2rem, 12vw, 2.6rem);
  }

  .refresh-btn {
    float: none !important;
    width: 100%;
    margin: 0.75rem 0 0 !important;
    text-align: center;
  }

  .price-meta,
  .btc-price-card > div[style*="text-align:right"] {
    text-align: left !important;
    align-items: stretch;
  }

  .row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .row label {
    min-width: 0;
  }

  .mgrid,
  .donate-grid,
  .results {
    grid-template-columns: 1fr !important;
  }

  .result-card-wide {
    max-width: 100% !important;
  }

  .mtbl {
    table-layout: fixed;
  }

  .mtbl td {
    overflow-wrap: anywhere;
    vertical-align: top;
  }

  .mtbl .tval {
    width: 45%;
  }

  .pbar-wrap,
  .pname,
  .pblk,
  .peh {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .ppct {
    margin-left: 0;
  }

  .loading-list {
    min-width: 0 !important;
    width: 100%;
  }

  .loading-item {
    align-items: flex-start;
  }

  .countdown-wrap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .cd-box {
    min-width: 0;
  }

  .main-content,
  main {
    min-height: auto !important;
    padding: 2rem 1rem;
  }

  .price-section {
    margin-bottom: 32px;
    padding: 24px 0;
  }

  .result-card {
    padding: 1.2rem;
  }

  .copy-btn {
    position: static !important;
    display: inline-flex;
    margin-top: 0.75rem;
  }

  .addr-block {
    padding: 1rem;
  }
}

@media (max-width: 440px) {
  .container,
  .inner,
  .page {
    padding-left: 12px;
    padding-right: 12px;
  }

  .nav-links {
    grid-template-columns: 1fr;
  }

  .nav-brand {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
  }

  .ngrid,
  .network-grid {
    grid-template-columns: 1fr !important;
  }

  .logo,
  .hdr-title,
  .page-title {
    letter-spacing: 0.04em;
  }

  .btc-symbol {
    font-size: 32px;
  }

  .card,
  .calc-section,
  .sc,
  .halving-card,
  .result,
  .donate-card,
  .terminal-msg {
    padding: 1rem;
  }

  .period-tabs,
  .countdown-wrap {
    grid-template-columns: 1fr;
  }

  .qr-frame {
    max-width: 100%;
  }

  #qrcode canvas,
  #qrcode img {
    width: min(220px, calc(100vw - 96px)) !important;
    height: min(220px, calc(100vw - 96px)) !important;
  }
}

@media (max-width: 920px) {
  .wrap {
    padding-left: 12px;
    padding-right: 12px;
  }

  .wrap .inner {
    padding-left: 0;
    padding-right: 0;
  }
}
