/* CURATORIART 2026 — shared mobile integrity layer */
html,
body {
  min-width: 0 !important;
  max-width: 100%;
  overflow-x: clip;
}

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

:where(main,section,article,aside,form,fieldset,label,.market-shell,.panel-wrap,.studio-shell,.admin-shell,.profile-shell,.portfolio-editor-shell,.portfolio-editor-grid,.portfolio-form,.portfolio-preview,.portfolio-works) {
  min-width: 0;
}

@supports not (overflow: clip) {
  html,
  body { overflow-x: hidden; }
}

@media (max-width: 760px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body { min-width: 0 !important; }

  .brand {
    min-width: 0;
    min-height: 44px;
  }

  .brand__image {
    width: auto;
    max-width: min(154px, 44vw);
    height: auto;
    max-height: 34px;
  }

  :where(
    button,
    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
    select,
    .button,
    .btn,
    .primary-action,
    .secondary-action,
    .portfolio-save,
    .portfolio-url-card a,
    .portfolio-url-card button,
    .public-lesson-card a,
    .market-guest-header__login
  ) {
    min-height: 44px !important;
  }

  :where(
    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
    textarea,
    select
  ) {
    max-width: 100%;
    font-size: 16px !important;
  }

  :where(.auth-card,.panel-card,.portfolio-form,.profile-card,.request-form,.admin-section) label {
    font-size: 11px !important;
    line-height: 1.5 !important;
  }

  .eyebrow {
    font-size: 9px;
    line-height: 1.5;
    letter-spacing: .16em;
    overflow-wrap: anywhere;
  }

  /* Safe, scrollable role navigation for narrow phones. */
  body.has-panel-dock {
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .panel-dock-header {
    height: 68px;
    padding-inline: 14px;
  }

  .panel-dock {
    z-index: 90;
    left: 10px;
    right: 10px;
    bottom: max(9px, env(safe-area-inset-bottom));
    justify-content: flex-start;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .panel-dock::-webkit-scrollbar { display: none; }

  .panel-dock__item,
  .panel-dock__item.is-active {
    min-width: 48px !important;
    width: 48px !important;
    max-width: 48px;
    height: 50px;
    flex: 0 0 48px !important;
    padding: 0;
    scroll-snap-align: center;
  }

  .panel-dock__separator { flex: 0 0 1px; }

  /* Shared market and commerce geometry. */
  .market-shell {
    width: min(1500px, calc(100% - 28px));
    padding-top: 36px;
    padding-bottom: 88px;
  }

  .market-guest-header,
  .market-nav {
    min-width: 0;
    padding-inline: 16px;
  }

  .market-hero {
    gap: 30px;
    margin-bottom: 48px;
  }

  .market-hero h1 {
    margin-block: 22px;
    font-size: clamp(58px, 22vw, 88px);
    overflow-wrap: anywhere;
  }

  .market-search {
    min-height: 54px;
    padding: 5px;
    gap: 6px;
  }

  .market-search input {
    min-width: 0;
    padding-inline: 12px;
  }

  .market-search button {
    min-width: 72px;
    padding-inline: 14px;
  }

  .market-section { margin-top: 52px; }

  .art-card,
  .artist-card,
  .detail-copy,
  .detail-image,
  .cart-summary,
  .checkout-form,
  .order-list > article {
    min-width: 0;
    max-width: 100%;
  }

  .detail-copy h1,
  .shop-title,
  .orders-head h1 {
    overflow-wrap: anywhere;
  }

  .action-row button,
  .comment-form button,
  .request-form button,
  .cart-list form button,
  .order-list button {
    min-height: 48px;
  }

  .order-products a {
    width: 100%;
    min-width: 0 !important;
  }

  /* Public artist portfolio: portrait supports the story instead of dominating it. */
  .public-portfolio-hero {
    min-height: 0;
    padding: 22px 0 48px;
    gap: 24px;
  }

  .public-portfolio-portrait {
    width: 100%;
    max-width: none;
    max-height: 278px;
    aspect-ratio: 4 / 3;
    margin: 0;
  }

  .public-portfolio-portrait img,
  .public-portfolio-portrait > span {
    border-radius: 30px;
    transform: none;
  }

  .public-portfolio-portrait img { object-position: center 28%; }

  .public-portfolio-portrait.is-default img {
    padding: clamp(34px, 12vw, 54px);
    object-fit: contain;
    object-position: center;
    background: #f3ece2;
  }

  .public-portfolio-portrait i {
    inset: 8px 8px -8px 12px;
    border-radius: 30px;
    transform: rotate(2deg);
  }

  .public-portfolio-copy h1 {
    margin: 15px 0 10px;
    font-size: clamp(46px, 15vw, 72px);
    line-height: .9;
    letter-spacing: -.065em;
    overflow-wrap: anywhere;
  }

  .public-portfolio-copy h2 {
    margin-bottom: 18px;
    font-size: clamp(25px, 8.5vw, 38px);
    line-height: 1.02;
  }

  .public-portfolio-copy > p {
    font-size: 16px;
    line-height: 1.68;
  }

  .public-portfolio-meta,
  .public-portfolio-links { margin-top: 18px; }

  .public-portfolio-meta span,
  .public-portfolio-links a {
    min-height: 44px;
    padding: 11px 14px;
    display: inline-flex;
    align-items: center;
    font-size: 11px;
  }

  .public-lesson-card {
    padding: 22px;
    border-radius: 24px;
  }

  .public-lesson-card p {
    font-size: 14px;
    line-height: 1.65;
  }

  .public-lesson-card a {
    align-items: center;
    font-size: 12px;
  }

  .public-lesson-form {
    width: 100%;
    margin: 48px auto !important;
    padding: 22px !important;
  }

  .public-lesson-form select { min-height: 48px; }

  .consent-check input {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
  }

  /* Artist portfolio editor and upload forms. */
  .portfolio-editor-shell {
    width: calc(100% - 24px);
    padding: 22px 0 74px;
  }

  .portfolio-editor-head {
    gap: 24px;
    padding: 16px 0 28px;
  }

  .portfolio-editor-head h1 {
    margin: 14px 0 18px;
    font-size: clamp(52px, 17vw, 78px);
    overflow-wrap: anywhere;
  }

  .portfolio-editor-grid,
  .portfolio-editor-grid > *,
  .portfolio-form > *,
  .portfolio-field-grid,
  .portfolio-field-grid > *,
  .portfolio-works,
  .portfolio-work-grid,
  .portfolio-work-grid > * {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .portfolio-form,
  .portfolio-preview,
  .portfolio-works,
  .portfolio-url-card {
    padding: 18px;
    overflow: hidden;
    border-radius: 24px;
  }

  .portfolio-form > header,
  .portfolio-preview > header,
  .portfolio-works > header {
    min-width: 0;
    gap: 12px;
  }

  .portfolio-form header h2,
  .portfolio-works header h2 {
    min-width: 0;
    font-size: clamp(28px, 9vw, 40px);
    overflow-wrap: anywhere;
  }

  .portfolio-avatar-row {
    align-items: stretch;
    gap: 16px;
  }

  .portfolio-file span {
    min-height: 46px;
    align-items: center;
  }

  .portfolio-field-grid input,
  .portfolio-field-grid textarea {
    min-height: 48px;
  }

  .portfolio-preview-card {
    min-height: 330px;
    padding: 22px;
  }

  .portfolio-work-grid a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Profile editing. */
  .profile-shell {
    width: calc(100% - 20px);
    padding: 86px 0 44px;
  }

  .profile-card { padding: 16px; }

  .profile-photo-editor {
    gap: 14px;
    padding: 14px;
  }

  .profile-card .profile-fields input:not([type="file"]) {
    min-height: 50px;
    font-size: 16px;
  }

  .profile-card button[type="submit"] {
    min-height: 54px;
    padding-inline: 16px;
    font-size: 14px;
  }

  .password-row {
    min-height: 52px;
    padding-block: 10px;
  }

  /* Studio, artwork management and administration. */
  .studio-shell,
  .panel-wrap,
  .admin-shell {
    width: calc(100% - 24px);
    max-width: 100%;
    margin-inline: auto;
    padding-left: 0;
    padding-right: 0;
  }

  .studio-welcome,
  .panel-title,
  .admin-hero {
    min-width: 0;
  }

  .studio-welcome h1,
  .panel-title h1,
  .admin-hero h1 {
    overflow-wrap: anywhere;
  }

  .quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .quick-actions a {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .metric-grid article { min-height: 126px; }

  .metric-icon {
    min-width: 44px;
    min-height: 44px;
    right: 10px;
    top: 10px;
    display: grid;
    place-items: center;
  }

  .studio-card,
  .panel-card,
  .artwork-table,
  .admin-section,
  .admin-rail,
  .site-control-group {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .panel-card { padding: 20px; }

  .panel-card input,
  .panel-card textarea { min-height: 48px; }

  .artwork-upload > span {
    min-height: 58px;
    align-items: flex-start;
    flex-direction: column;
  }

  .artwork-upload {
    position: relative;
    overflow: hidden;
  }

  .artwork-upload input[type="file"] {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
  }

  .artwork-comments-link,
  .empty-market a,
  .member-activity header a,
  .studio-card header > a,
  .profile-health > a {
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
  }

  .admin-shell { padding-top: 20px; }

  .admin-hero {
    gap: 24px;
    padding: 20px 0 30px;
  }

  .admin-hero h1 {
    margin: 20px 0;
    font-size: clamp(58px, 20vw, 82px);
  }

  .admin-section,
  .admin-rail { padding: 18px; }

  .admin-row,
  .admin-row > *,
  .admin-art-grid article,
  .admin-art-grid article > *,
  .site-fields,
  .site-fields > *,
  .site-brand-grid,
  .site-brand-grid > *,
  .nav-setting-row,
  .nav-setting-row > * {
    min-width: 0;
    max-width: 100%;
  }

  .admin-row input,
  .admin-row select,
  .admin-row button,
  .admin-order-row select,
  .admin-order-row button,
  .site-copy input,
  .site-fields input,
  .site-fields textarea {
    min-height: 46px;
  }

  .admin-site-link,
  .notification-center > header form button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Auth screens: readable fields and reachable utility links. */
  .auth-shell,
  .auth-shell--register,
  .auth-card,
  .auth-story,
  .pending-card {
    min-width: 0;
    max-width: 100%;
  }

  .auth-card { padding-inline: 22px; }

  .auth-card input:not([type="checkbox"]),
  .auth-card textarea { min-height: 50px; }

  .auth-card a,
  .auth-brand,
  .pending-actions a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Homepage portfolio composition must never bleed beyond the screen. */
  .portfolio-teaser,
  .portfolio-showcase {
    min-width: 0;
    max-width: 100%;
    overflow: clip;
  }

  .portfolio-showcase__aura {
    inset: 5% 1% -3% 7%;
  }

  .portfolio-showcase__badge { right: 1%; }

  .portfolio-browser__intro p { font-size: 11px; }

  .portfolio-browser__tags span { font-size: 8px; }

  .site-footer a,
  .footer-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .scroll-cue { min-width: 44px; }
}

@media (max-width: 430px) {
  .public-portfolio-portrait {
    max-height: 246px;
    aspect-ratio: 1.32 / 1;
  }

  .profile-photo-editor { grid-template-columns: 1fr; }

  .avatar-stage {
    width: 104px;
    height: 104px;
    margin-inline: auto;
  }

  .profile-photo-copy { text-align: center; }
  .profile-card .file-label__surface { text-align: left; }

  .portfolio-showcase {
    width: 100%;
    aspect-ratio: .9 / 1;
  }

  .portfolio-browser__body {
    grid-template-columns: .78fr 1.22fr;
    padding: 13px;
    gap: 10px;
  }
}

@media (max-width: 350px) {
  .market-shell,
  .portfolio-editor-shell,
  .profile-shell,
  .studio-shell,
  .panel-wrap,
  .admin-shell {
    width: calc(100% - 16px);
  }

  .panel-dock { left: 6px; right: 6px; }
  .panel-dock__item,
  .panel-dock__item.is-active {
    flex: 0 0 46px !important;
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px;
  }

  .public-portfolio-portrait {
    max-height: 222px;
  }

  .public-portfolio-copy h1 { font-size: clamp(42px, 15vw, 58px); }

  .portfolio-form,
  .portfolio-preview,
  .portfolio-works,
  .portfolio-url-card,
  .profile-card,
  .studio-card,
  .panel-card,
  .admin-section,
  .admin-rail { padding: 14px; }
}

/* Hostinger production: mobile GPUs receive the same visual with less repaint work. */
@media (max-width: 700px) {
  .noise,
  #preloader.brand-motion {
    display: none !important;
  }

  .site-header,
  .site-header.is-scrolled {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .hero::before,
  .hero-lights::before,
  .hero-lights::after,
  .hero-light-dust {
    animation: none !important;
  }

  .hero::before,
  .hero-lights::before {
    filter: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel-dock { scroll-behavior: auto; }
  .brand-motion__logo { animation: none !important; }
}

/* 2026 release guard: tablet navigation becomes a safe bottom command bar. */
@media (min-width: 761px) and (max-width: 1100px) {
  body.has-panel-dock {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .panel-dock-header {
    height: 76px;
    padding-inline: 20px;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .panel-dock {
    position: fixed !important;
    z-index: 90;
    top: auto !important;
    right: 16px !important;
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
    left: 16px !important;
    width: auto !important;
    max-width: none !important;
    justify-content: center;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .panel-dock::-webkit-scrollbar { display: none; }

  .panel-dock__item,
  .panel-dock__item.is-active {
    min-width: 48px;
    min-height: 48px;
    flex: 0 0 auto;
  }
}

/* Public portfolio: media is strictly contained and can never cover its copy. */
@media (max-width: 760px) {
  .public-portfolio-hero {
    grid-template-columns: minmax(0,1fr) !important;
    grid-template-rows: auto auto auto;
    align-items: start;
    gap: clamp(22px,6vw,30px) !important;
  }

  .public-portfolio-portrait {
    position: relative;
    z-index: 0;
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: 3 / 2 !important;
    margin: 0 !important;
    overflow: hidden !important;
    isolation: isolate;
    border-radius: 30px;
  }

  .public-portfolio-portrait img,
  .public-portfolio-portrait > span {
    position: absolute !important;
    inset: 0;
    z-index: 1;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    border-radius: inherit !important;
    transform: none !important;
  }

  .public-portfolio-portrait i { display: none; }

  .public-portfolio-copy {
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
  }

  .public-portfolio-copy h1 { margin-top: 12px; }
}
