/* Keep intrinsic image proportions at every viewport, including HTML width/height attributes. */
img {
  height: auto;
}
.mobile-account,
.menu-toggle,
.cart-icon {
  display: none;
}
.cart-link .cart-label {
  display: inline;
  background: transparent;
  color: inherit;
  width: auto;
  height: auto;
  margin: 0;
  border-radius: 0;
  font: inherit;
}
.hero > *,
.product-card > *,
.detail-grid > *,
.cart-layout > *,
.split > *,
.form-grid > *,
.footer-grid > *,
.admin-layout > * {
  min-width: 0;
}
.product-info,
.page-head,
.panel,
.notice,
.order-head,
.customer-detail,
.receipt,
.footer-grid,
.stat {
  overflow-wrap: anywhere;
}
.hero-visual img,
.product-art img {
  aspect-ratio: 32 / 23;
  object-fit: contain;
}
.table-wrap {
  max-width: 100%;
  overscroll-behavior-x: contain;
}
.account-link {
  max-width: 180px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Never hide document overflow to conceal an oversized child. Tables scroll locally. */
@media screen and (max-width: 900px) {
  .site-header {
    height: 72px;
    min-height: 72px;
  }
  .nav-wrap {
    position: relative;
    height: 72px;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 0 max(16px, env(safe-area-inset-left)) 0
      max(16px, env(safe-area-inset-right));
  }
  .site-header .brand {
    min-width: 0;
    font-size: 21px;
    gap: 7px;
    margin-right: auto;
  }
  .site-header .brand img {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
  }
  .nav-actions {
    flex-shrink: 0;
    gap: 8px;
  }
  .account-link {
    display: none;
  }
  .cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 8px;
    border-radius: 10px;
  }
  .cart-icon {
    display: block;
    flex-shrink: 0;
  }
  .cart-link .cart-label {
    display: none;
  }
  .cart-link #cart-count {
    position: absolute;
    top: -4px;
    right: -3px;
    margin: 0;
    width: 18px;
    height: 18px;
    font-size: 10px;
  }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cfd9d0;
    border-radius: 10px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    color: var(--ink);
  }
  .menu-toggle span,
  .menu-toggle span::before,
  .menu-toggle span::after {
    display: block;
    height: 2px;
    width: 19px;
    background: currentColor;
    border-radius: 2px;
  }
  .menu-toggle span {
    position: relative;
  }
  .menu-toggle span::before,
  .menu-toggle span::after {
    position: absolute;
    content: "";
    left: 0;
  }
  .menu-toggle span::before {
    top: -6px;
  }
  .menu-toggle span::after {
    top: 6px;
  }
  .menu-open .menu-toggle span {
    background: transparent;
  }
  .menu-open .menu-toggle span::before {
    top: 0;
    transform: rotate(45deg);
  }
  .menu-open .menu-toggle span::after {
    top: 0;
    transform: rotate(-45deg);
  }
  #primary-nav {
    position: absolute;
    top: 71px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    width: auto;
    margin: 0;
    padding: 12px 16px 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-top: 0;
    box-shadow: 0 12px 20px #23392e0d;
    max-height: calc(100dvh - 80px);
    overflow-y: auto;
  }
  .menu-open #primary-nav {
    display: flex;
  }
  #primary-nav a {
    display: flex;
    align-items: center;
    font-size: 14px;
    padding: 12px 14px;
    min-height: 48px;
    border-radius: 8px;
  }
  #primary-nav a:hover {
    background: #eaf0e4;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    gap: 28px;
    padding-top: 36px;
    padding-bottom: 42px;
  }
  .hero h1 {
    font-size: clamp(32px, 7.7vw, 52px);
    line-height: 1.3;
  }
  .hero-copy > p {
    font-size: 15px;
  }
  .hero-visual {
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
    padding: 8px;
  }
  .hero-visual::before {
    display: none;
  }
  .hero-visual img {
    width: 100%;
    height: auto;
    aspect-ratio: 32 / 23;
    object-fit: contain;
    transform: none !important;
    will-change: auto;
  }
  .hero-footnote {
    align-items: flex-start;
    line-height: 1.7;
  }
  .hero-footnote i {
    flex-shrink: 0;
  }
  .visual-top {
    padding: 12px 10px;
    font-size: 9px;
    letter-spacing: 1.2px;
    gap: 10px;
  }
  .visual-bottom {
    gap: 12px;
    padding: 10px 12px 14px;
    flex-wrap: wrap;
  }
  .visual-bottom .pill {
    flex-shrink: 0;
  }
  .auth-layout,
  .detail-grid,
  .cart-layout,
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
  .auth-layout {
    gap: 20px;
    margin: 30px auto 45px;
  }
  .admin-layout {
    display: block;
  }
  .admin-sidebar {
    display: flex;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 16px;
    margin-bottom: 24px;
    gap: 6px;
  }
  .admin-sidebar .eyebrow {
    width: 100%;
    margin: 0 0 7px;
  }
  .admin-sidebar a {
    margin: 0;
    padding: 10px 12px;
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 13px;
  }
  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
    min-height: 48px;
    max-width: 100%;
  }
  .btn,
  .btn.small,
  .account-tabs a,
  .filter-tabs button,
  .text-link {
    min-height: 44px;
  }
  .text-link {
    display: inline-flex;
    align-items: center;
    white-space: normal;
  }
  .btn {
    white-space: normal;
    text-align: center;
  }
  .button-row > form {
    width: 100%;
  }
  .button-row .quantity {
    width: auto;
    min-width: 0;
    flex: 1;
    max-width: 100%;
  }
  .admin-content h1 {
    font-size: clamp(25px, 4.5vw, 32px);
  }
  .table-title {
    flex-wrap: wrap;
  }
  .table-wrap {
    border: 1px solid var(--line);
    border-radius: 8px;
  }
  .table-wrap td,
  .table-wrap th {
    white-space: normal;
    overflow-wrap: anywhere;
    min-width: 100px;
  }
  .table-wrap td code {
    display: inline-block;
    max-width: 190px;
  }
  .receipt .table-wrap td:first-child {
    min-width: 140px;
  }
  .receipt .table-wrap td:not(:first-child),
  .receipt .table-wrap th:not(:first-child) {
    min-width: 72px;
  }
  .receipt-header {
    flex-direction: column;
  }
  .receipt address {
    overflow-wrap: anywhere;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat strong {
    font-size: clamp(19px, 3.9vw, 28px);
    overflow-wrap: anywhere;
  }
}
@media print {
  .receipt {
    padding: 0;
    border: 0;
    margin: 0;
    max-width: none;
  }
  .receipt .table-wrap {
    border: 0;
    border-radius: 0;
    overflow: visible;
  }
  .receipt .table-wrap td,
  .receipt .table-wrap th {
    min-width: 0;
  }
}
@media screen and (max-width: 600px) {
  .container {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  .hero h1 {
    font-size: clamp(29px, 8vw, 43px);
  }
  .hero-copy {
    padding: 0;
  }
  .hero-copy > p br {
    display: none;
  }
  .hero-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .eyebrow {
    letter-spacing: 1.4px;
    font-size: 10px;
  }
  .hero-footnote {
    font-size: 11px;
  }
  .trust-strip {
    gap: 20px 12px;
  }
  .trust-item {
    align-items: flex-start;
    font-size: 12px;
    line-height: 1.7;
  }
  .trust-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
  }
  .section-head {
    display: block;
  }
  .section-head .text-link {
    margin-top: 8px;
  }
  .section-head p {
    font-size: 13px;
  }
  .product-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .product-card {
    display: block;
    width: 100%;
    max-width: 480px;
    margin-inline: auto;
  }
  .product-card .product-art {
    display: block;
    margin: 10px 10px 0;
  }
  .product-art img {
    width: 100%;
    height: auto;
    aspect-ratio: 32 / 23;
    object-fit: contain;
  }
  .product-info {
    padding: 20px;
  }
  .product-info h3 {
    font-size: 23px;
  }
  .product-info p {
    font-size: 14px;
    line-height: 1.8;
  }
  .product-meta {
    font-size: 10px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .product-bottom {
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
  }
  .product-price {
    font-size: 18px;
  }
  .round-arrow {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .panel,
  .auth-panel,
  .verify-wrap .panel {
    padding: 20px;
  }
  .page-head h1,
  .detail-grid h1 {
    font-size: clamp(27px, 7.5vw, 34px);
  }
  .auth-layout h1 {
    font-size: 30px;
  }
  .page-head p,
  .notice {
    font-size: 13px;
  }
  .filter-tabs {
    gap: 8px;
  }
  .filter-tabs button {
    font-size: 13px;
    padding: 10px 16px;
  }
  .cart-row {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px 14px;
  }
  .cart-row img {
    width: 64px;
    height: auto;
  }
  .cart-row > strong {
    grid-column: 2;
  }
  .cart-row h3 {
    overflow-wrap: anywhere;
  }
  .cart-row button {
    min-height: 44px;
  }
  .summary-row {
    gap: 12px;
  }
  .summary-row.total {
    flex-wrap: wrap;
    font-size: 19px;
  }
  .order-total {
    gap: 12px;
    flex-wrap: wrap;
  }
  .order-head h3 {
    font-size: 16px;
    overflow-wrap: anywhere;
  }
  .account-tabs {
    gap: 8px;
  }
  .account-tabs a {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
  }
  .stats-grid {
    gap: 10px;
  }
  .stat {
    padding: 16px 12px;
  }
  .stat strong {
    font-size: clamp(18px, 5.2vw, 26px);
    letter-spacing: -0.5px;
  }
  .ecosystem {
    padding: 28px 22px;
  }
  .ecosystem h2 {
    font-size: clamp(25px, 7vw, 32px);
  }
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 20px;
  }
  .footer-grid > div:first-child {
    grid-column: 1 / -1;
  }
  .footer-grid > div > a:not(.brand) {
    min-height: 36px;
    padding-block: 6px;
  }
  .footer-bottom {
    padding-block: 18px max(18px, env(safe-area-inset-bottom));
    font-size: 10px;
  }
  .receipt {
    padding: 20px 16px;
  }
  .receipt-header h1 {
    font-size: 28px;
  }
  #toast {
    bottom: max(16px, env(safe-area-inset-bottom));
    width: max-content;
    max-width: calc(100vw - 32px);
    padding: 12px 16px;
  }
}
