/* Final responsive layer: keep the Poseidon composition while giving each
   workspace, form, and overlay room to work on narrow touch screens. */
.poseidon-category-portrait img { height: auto; }

@media (max-width: 900px) {
  #main :is(input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]), select, textarea),
  .poseidon-chat__form :is(input, textarea) {
    min-width: 0;
    max-width: 100%;
    font-size: 16px;
  }
  #main :is(input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]), select) {
    min-height: 44px;
  }
  #main:not(:has(.admin-page)) button,
  .mobile-nav a,
  .cart-drawer :is(button, .drawer-continue),
  .poseidon-chat :is(button, .poseidon-chat__footer a) {
    min-height: 44px;
  }
  .site-header .icon-button { width: 44px; min-width: 44px; height: 44px; }
  .site-header .header-actions { gap: 0; }
  .mobile-nav { max-height: calc(100dvh - 75px); overflow-y: auto; overscroll-behavior: contain; padding-bottom: max(16px,env(safe-area-inset-bottom)); }
  .cart-drawer .cart-stepper :is(button, output),
  .cart-line .cart-stepper :is(button, output) { min-width: 44px; height: 44px; }
  .cart-drawer .drawer-close,
  .search-panel .poseidon-search-close,
  .poseidon-chat :is(.poseidon-chat__close, .poseidon-chat__refresh) { width: 44px; height: 44px; flex-shrink: 0; }
  .cart-drawer .drawer-foot { padding-bottom: max(18px,env(safe-area-inset-bottom)); }
  .poseidon-harbor__card-foot :is(a, button),
  .poseidon-account-code-actions button,
  .account-identity button { display: inline-flex; align-items: center; min-height: 44px; }
  .poseidon-carousel__arrow { width: 44px; height: 44px; }
  #main .atlas-card .product-actions button { flex: 0 0 44px; width: 44px; min-width: 44px; height: 44px; }
  .atlas-card__bottom { gap: 10px; }
  .atlas-card__bottom > * { min-width: 0; }
  .atlas-card__bottom .price { flex-shrink: 0; }
  .atlas-product__purchase .quantity-options .quantity { width: 100%; min-width: 0; }
  .poseidon-flow-heading > div { min-width: 0; }
  .poseidon-flow-heading > img { width: 64px; height: 64px; padding: 7px; }
  .poseidon-payment-card > * { min-width: 0; }
  .poseidon-payment-card :is(p, strong, code) { overflow-wrap: anywhere; }
  .ocean-bundles .bundle-mast-inner { grid-template-columns: minmax(0,1fr); }
  .ocean-bundles .bundle-mast-copy { min-width: 0; }
  .ocean-bundles .bundle-strengths { flex-wrap: wrap; gap: 6px; }
  .ocean-bundles .bundle-strengths button { min-width: 54px; padding: 8px 10px; font-size: 12px; }
  .ocean-bundles .bundle-case-tools button,
  .ocean-bundles .bundle-case-bottom button { font-size: 12px; }
  .ocean-bundles .bundle-label-close,
  .category-dialog--atlas .category-dialog-close { width: 44px; height: 44px; }
  .category-dialog--atlas .category-record__actions button { width: 44px; height: 44px; }
  .poseidon-chat { right: 0; width: min(100%,430px); height: calc(100dvh - 24px); max-height: 760px; bottom: 0; border-radius: 12px; }
  .poseidon-support:has(.poseidon-chat:not([hidden])) { inset: 12px 8px max(12px,env(safe-area-inset-bottom)); pointer-events: none; }
  .poseidon-support:has(.poseidon-chat:not([hidden])) .poseidon-chat { pointer-events: auto; }
  .poseidon-support:has(.poseidon-chat:not([hidden])) .poseidon-support__launchers { display: none; }
  .poseidon-chat :is(.poseidon-chat__header,.poseidon-chat__form,.poseidon-chat__footer) { flex-shrink: 0; }
  .poseidon-chat__form input { min-height: 44px; }
}

@media (max-width: 600px) {
  .site-header { padding-inline: 8px; }
  .mobile-nav { max-height: calc(100dvh - 68px); }
  .site-header .header-brand { width: 96px; min-width: 96px; }
  .atlas-home .atlas-duo .poseidon-kits-art { min-height: 0; }
  .atlas-home .atlas-duo .poseidon-kits-art img { height: auto; aspect-ratio: 2169 / 725; }
  .poseidon-category-portrait img { aspect-ratio: 4 / 3; object-position: 76% center; }
  .atlas-home .poseidon-categories--atlas .poseidon-category-intro h2 { font-size: clamp(58px,14vw,80px); line-height: .95; }
  .atlas-home .spotlight-filter-bar button { min-height: 44px; }
  .atlas-home .poseidon-carousel .spotlight-track .product-card.atlas-card { flex-basis: min(82vw,330px); }
  .atlas-card .product-body.atlas-card__body,
  .atlas-home .spotlight-track .atlas-card .product-body { padding-inline: 17px; }
  .atlas-card__bottom { flex-wrap: wrap; }
  .atlas-card__bottom > .card-price { flex: 1 0 100%; }
  .atlas-card__bottom > .product-actions { display: flex; align-items: center; justify-content: space-between; flex: 1; }
  .atlas-card .product-actions a { display: flex; align-items: center; min-height: 44px; }
  .atlas-product__step > div:first-child { flex-wrap: wrap; gap: 8px; }
  .atlas-product__step h2 { font-size: 26px; line-height: 1.15; }
  .atlas-product__purchase .quantity-options { gap: 6px; }
  .atlas-product__purchase .quantity-options .quantity { padding-inline: 4px; }
  .atlas-product__purchase .variants { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .atlas-product__related-head { display: block; }
  .atlas-product__related-head h2 { font-size: clamp(40px,10vw,58px); line-height: 1.08; overflow-wrap: anywhere; }
  .atlas-docs__request { grid-template-columns: minmax(0,1fr); padding: 24px 20px; }
  .atlas-docs__request > * { min-width: 0; }
  .atlas-docs__request h3 { font-size: clamp(34px,10vw,45px); line-height: 1.06; }
  .atlas-docs__request button { width: 100%; min-width: 0; padding-inline: 14px; gap: 12px; }
  .atlas-docs__end h2 { font-size: clamp(46px,12vw,68px); }
  .poseidon-flow-heading { display: block; position: relative; padding-top: 4px; }
  .poseidon-flow-heading > img { display: none; }
  .poseidon-flow-heading h1 { font-size: clamp(44px,11vw,60px); line-height: 1.06; }
  .poseidon-commerce-flow .commerce-card { min-width: 0; padding: 22px 18px; }
  .commerce-coupon-form > div { display: flex; min-width: 0; gap: 7px; }
  .commerce-coupon-form input { flex: 1; width: 100%; min-width: 0; padding-inline: 10px; text-transform: none; letter-spacing: 0; }
  .commerce-coupon-form button { flex-shrink: 0; padding-inline: 12px; }
  .poseidon-payment-card { padding: 20px 16px; }
  .poseidon-payment-card figure { padding: 12px; }
  .poseidon-payment-card h3 { font-size: 26px; }
  .poseidon-payment-card .poseidon-payment-total { font-size: 30px; }
  .account-stat-grid > div { min-width: 0; }
  .poseidon-account .account-stat-grid strong { font-size: 25px; }
  .account-panel-top { flex-wrap: wrap; }
  .account-identity strong { overflow-wrap: anywhere; }
  .ocean-bundles .bundle-mast h1 { font-size: clamp(60px,17vw,90px); line-height: .95; }
  .ocean-bundles .bundle-mode a { grid-template-columns: 24px minmax(0,1fr); gap: 8px; }
  .ocean-bundles .bundle-mode a b { grid-column: 2; grid-row: 3; }
  .ocean-bundles .bundle-mode a strong { font-size: 30px; line-height: 1.05; }
  .ocean-bundles .bundle-slot.filled { grid-template-columns: minmax(0,1fr) 44px; }
  .ocean-bundles .bundle-slot-main { grid-column: 1/-1; min-width: 0; }
  .ocean-bundles .bundle-slot-main strong { font-size: 13px; overflow-wrap: anywhere; }
  .ocean-bundles .bundle-slot-main small { font-size: 11px; }
  .ocean-bundles .bundle-slot-view { grid-column: 1; grid-row: 2; justify-self: start; padding-inline: 12px; font-size: 12px; }
  .ocean-bundles .bundle-slot-clear { grid-column: 2; grid-row: 2; width: 44px; height: 44px; margin: 0; }
  .ocean-bundles .bundle-case-bottom { flex-wrap: wrap; gap: 8px; }
  .ocean-bundles .bundle-single-strength { font-size: 12px; }
  .bundle-label-dialog { width: calc(100% - 24px); max-width: 100%; max-height: calc(100dvh - 24px); overflow-y: auto; }
  .bundle-label-info { min-width: 0; }
  .bundle-label-info h2 { overflow-wrap: anywhere; }
  .category-dialog--atlas .category-dialog-header h2 { font-size: clamp(32px,8vw,44px); line-height: 1.05; overflow-wrap: normal; word-break: normal; }
  .category-dialog--atlas .category-record { grid-template-columns: 60px minmax(0,1fr); grid-template-rows: auto auto auto; gap: 10px 12px; padding-block: 18px; }
  .category-dialog--atlas .category-record__index { display: none; }
  .category-dialog--atlas .category-record__visual { grid-column: 1; grid-row: 1/4; width: 60px; height: 98px; align-self: center; }
  .category-dialog--atlas .category-record__visual .vial-art { height: 88px; }
  .category-dialog--atlas .category-record__details { grid-column: 2; grid-row: 1; }
  .category-dialog--atlas .category-record__details h3 { font-size: 27px; line-height: 1.1; }
  .category-dialog--atlas .category-record__price { grid-column: 2; grid-row: 2; text-align: left; }
  .category-dialog--atlas .category-record__price small { font-size: 9px; }
  .category-dialog--atlas .category-record__price strong { font-size: 17px; }
  .category-dialog--atlas .category-record__actions { grid-column: 2; grid-row: 3; padding: 0; }
  .category-dialog--atlas .category-record__actions a { display: flex; align-items: center; min-height: 44px; font-size: 12px; }
  .poseidon-chat { right: 0; width: min(100%,430px); height: calc(100dvh - 24px); max-height: 760px; bottom: 0; border-radius: 12px; }
  .poseidon-support:has(.poseidon-chat:not([hidden])) { inset: 12px 8px max(12px,env(safe-area-inset-bottom)); pointer-events: none; }
  .poseidon-support:has(.poseidon-chat:not([hidden])) .poseidon-chat { pointer-events: auto; }
  .poseidon-support:has(.poseidon-chat:not([hidden])) .poseidon-support__launchers { display: none; }
  .poseidon-chat__header { padding: 13px; flex-shrink: 0; }
  .poseidon-chat__header h2 { font-size: 29px; }
  .poseidon-chat__history { min-height: 60px; }
  .poseidon-chat__suggestions { padding: 8px 12px; gap: 6px; flex-shrink: 0; }
  .poseidon-chat__suggestions button { padding: 8px 10px; font-size: 11px; }
  .poseidon-chat__form { padding: 12px; flex-shrink: 0; }
  .poseidon-chat__form textarea { min-height: 64px; }
  .poseidon-chat__form input { min-height: 44px; }
  .poseidon-chat__send { min-width: 84px; }
  .poseidon-chat__footer { padding: 8px 12px; flex-shrink: 0; }
  .poseidon-chat__footer a { display: inline-flex; align-items: center; }
  .site-footer nav a { display: flex; align-items: center; min-height: 44px; line-height: 1.4; }
  .site-footer .footer-bottom { flex-wrap: wrap; gap: 12px; }
}

@media (max-width: 359px) {
  .poseidon-account .account-stat-grid { grid-template-columns: 1fr; }
  .poseidon-account .account-stat-grid > div { min-height: 88px; padding: 16px; }
  .poseidon-profile-setup .poseidon-profile-fields { grid-template-columns: minmax(0,1fr); }
  .poseidon-profile-fields .commerce-field { grid-column: 1/-1; }
}

@media (max-height: 560px) and (max-width: 900px) {
  .poseidon-chat { overflow-y: auto; }
  .poseidon-chat__header { padding: 10px 12px; }
  .poseidon-chat__header h2 { font-size: 24px; }
  .poseidon-chat__suggestions { display: none; }
  .poseidon-chat__history { min-height: 40px; max-height: 90px; }
  .poseidon-chat__form { grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); gap: 6px 10px; padding: 8px 12px; }
  .poseidon-chat__form label { min-width: 0; }
  .poseidon-chat__form textarea { height: 44px; min-height: 44px; }
  .poseidon-chat__form-bottom { grid-column: 1/-1; }
  .poseidon-chat__form-bottom small { display: none; }
}
