@media (max-width: 767px) {
  :root {
    --header-h: 3.65rem;
    --tabbar-h: calc(3.65rem + env(safe-area-inset-bottom));
    --page-pad-x: 1rem;
    --page-pad-y: 1.1rem;
    --page-pad-bottom: 2rem;
    --grid-gap: 1.15rem 0.75rem;
    --empty-pad: 1.75rem 1rem;
    --space: 1rem;
  }

  .site-header {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .header-bar {
    grid-template-columns: 1fr auto;
    gap: 0.65rem;
  }

  .site-nav {
    display: none;
  }

  .brand {
    font-size: 1.05rem;
    max-width: 48vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-tools {
    gap: 0.4rem;
  }

  .lang-btn {
    padding: 0.32rem 0.45rem;
    font-size: 0.68rem;
    min-height: 1.85rem;
  }

  .nav {
    gap: 0.35rem;
    font-size: 0.78rem;
  }

  .nav-mypage-link,
  .nav-action {
    display: none;
  }

  .nav-admin .nav-admin-btn {
    font-size: 0.78rem;
  }

  .nav-admin-panel {
    min-width: 8.5rem;
    right: -0.25rem;
  }

  .nav-admin-panel a {
    padding: 0.65rem 0.75rem;
    min-height: var(--touch);
    display: flex;
    align-items: center;
  }

  .nav-user {
    gap: 0.35rem;
    padding-left: 0.45rem;
    margin-left: 0;
  }

  .nav-name-text,
  .nav-user .btn-text {
    display: none;
  }

  .nav-profile-short {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: var(--panel-bg);
    border: 1px solid var(--line);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ink);
  }

  .nav-profile-short.is-alert {
    background: var(--accent-soft);
    border-color: transparent;
    color: var(--accent-strong);
  }

  .btn-nav {
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
  }

  /* Mobile bottom tab bar */
  .mobile-tabbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-tabbar);
    min-height: var(--tabbar-h);
    padding: 0.35rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom));
    background: var(--tabbar-bg);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(16px) saturate(1.2);
    box-shadow: var(--shadow-sm);
  }

  .mobile-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: var(--touch);
    padding: 0.35rem 0.2rem;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-align: center;
    position: relative;
    transition: color 0.15s ease, background 0.15s ease;
  }

  .cart-label-full { display: none; }
  .cart-label-short { display: inline; }

  .admin-hub-grid {
    grid-template-columns: 1fr;
  }

  .nav-account .nav-name-text {
    display: none;
  }

  .nav-admin-panel,
  .nav-account-panel {
    min-width: 10rem;
    right: -0.5rem;
  }

  .mobile-tabbar a.is-active {
    color: var(--accent-strong);
    background: var(--accent-soft);
  }

  .home-paths {
    grid-template-columns: 1fr;
    margin: 0;
    padding: 0;
  }

  .home-path {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 1.15rem 1rem;
  }

  .home-path:last-child { border-bottom: 0; }

  .home-path::after {
    left: 1rem;
    right: 1rem;
  }

  .home-path-title {
    font-size: 1.15rem;
  }

  .home-guide-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.9rem 1rem 1rem;
  }

  .home-guide-bar-copy {
    flex-basis: auto;
    font-size: 0.86rem;
  }

  /* 히어로: 전체 화면 강박 완화 (계획서 ~48–56dvh), 타이포·CTA 여유 */
  .hero-home {
    min-height: calc(100dvh - var(--header-h) - var(--tabbar-h));
    max-height: none;
    padding: 2rem 1.15rem 4.5rem;
    justify-content: center;
  }

  .hero:not(.hero-home) {
    min-height: auto;
    padding: 2rem 1.15rem;
  }

  .hero-atmosphere::after {
    content: none;
  }

  .hero-copy {
    max-width: 100%;
  }

  .hero .lede {
    max-width: 100%;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .eyebrow {
    margin-bottom: 0.7rem;
    font-size: 0.75rem;
  }

  .hero h1,
  .hero-brand {
    font-size: clamp(2.05rem, 9.5vw, 2.85rem);
    line-height: 1.02;
    margin-bottom: 0.85rem;
    overflow-wrap: anywhere;
  }

  .hero-logo {
    height: clamp(2.35rem, 12vw, 3.25rem);
    max-width: min(11rem, 68vw);
    margin-bottom: 0.85rem;
  }

  .hero-scroll {
    position: absolute;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%);
    letter-spacing: 0.14em;
    text-indent: 0.14em;
    width: max-content;
    margin: 0;
  }

  .cta-row {
    width: 100%;
    flex-direction: column;
    margin-bottom: 1.25rem;
  }

  .cta-row .btn {
    min-width: 0;
    width: 100%;
    white-space: normal;
  }

  .cta-row .btn,
  .auth-actions .btn,
  .bid-form > .btn,
  .bid-sheet > .btn,
  .about-links .btn,
  .section-foot .btn {
    width: 100%;
    text-align: center;
    padding: 0.95rem 1.15rem;
    min-height: var(--touch);
  }

  .bid-bar-mobile .btn {
    width: auto;
    min-width: 7.5rem;
    padding: 0.85rem 1.1rem;
  }

  .input,
  .chip,
  select.input {
    font-size: 16px;
  }

  .section-head-row {
    flex-direction: column;
    align-items: stretch;
  }

  .section-head-row .btn {
    width: 100%;
    text-align: center;
  }

  .page-about .section-head {
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
  }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .about-aside {
    position: static;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      'logo meta'
      'links links';
    align-items: start;
    gap: 0.75rem 1rem;
    padding: 0.85rem;
  }

  .about-logo {
    grid-area: logo;
    width: 5.5rem;
  }

  .about-logo img,
  .about-logo-placeholder {
    max-width: 5.5rem;
    aspect-ratio: 1;
    object-fit: contain;
  }

  .about-meta {
    grid-area: meta;
    display: grid;
    gap: 0.55rem;
    min-width: 0;
  }

  .about-links {
    grid-area: links;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }

  .about-links .btn {
    width: 100%;
    min-height: var(--touch);
    padding: 0.75rem 0.65rem;
    font-size: 0.86rem;
  }

  .about-bio {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .about-bio h2,
  .about-bio h3,
  .page-doc .doc-body h2,
  .page-doc .doc-body h3 {
    font-size: 1.05rem;
    margin-top: 1.15rem;
  }

  .page-doc .doc-body {
    padding-top: 0.85rem;
  }

  .filter-row-sticky {
    top: var(--header-h);
    margin-left: -0.15rem;
    margin-right: -0.15rem;
    padding-left: 0.15rem;
    padding-right: 0.15rem;
  }

  .mypage-tabs .chip {
    min-height: var(--touch);
    padding: 0.65rem 1.05rem;
  }

  .mypage-row a,
  .order-detail h2 {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .order-detail h2 {
    font-size: 1.35rem;
    margin: 0.25rem 0 0.5rem;
  }

  .order-hero {
    max-height: 200px;
  }

  .footer-inner {
    padding-top: 1.15rem;
    padding-bottom: 1rem;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
  }

  .footer-aside {
    justify-items: start;
    text-align: left;
    padding-top: 0.35rem;
    border-top: 1px solid var(--line);
  }

  .footer-aside .footer-links {
    justify-content: flex-start;
  }

  .footer-links {
    gap: 0.55rem 0.9rem;
  }

  body::after {
    width: 55vw;
    height: 55vw;
    top: 8%;
    right: -18%;
    opacity: 0.9;
  }

  .home-path:hover::after {
    transform: none;
  }

  .home-path::after {
    display: none;
  }

  .art-card:hover {
    transform: none;
  }

  .art-card:hover .art-card-media img {
    transform: none;
  }

  .art-card:active {
    transform: scale(0.985);
  }

  .gallery-grid {
    gap: var(--grid-gap);
  }

  .page-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.15rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line);
  }

  .page-head > div:first-child {
    width: 100%;
  }

  .page-head > a.btn,
  .page-head > .btn {
    width: auto;
    display: inline-flex;
  }

  .page-head-actions {
    width: 100%;
    margin-top: 0.35rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-start;
    align-items: center;
  }

  .page-head-actions .btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    padding: 0.45rem 0.8rem;
    font-size: 0.85rem;
  }

  .detail-layout {
    gap: 1.25rem;
  }

  /* —— 전역 가로 넘침·여백 폴리시 —— */
  body {
    background-attachment: scroll;
  }

  .app,
  .page,
  .page-shell,
  .hero-copy,
  .home-paths,
  .home-guide-bar,
  .role-guide,
  .footer-inner {
    max-width: 100%;
    min-width: 0;
  }

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

  .page-head h1 {
    font-size: clamp(1.55rem, 7vw, 2rem);
    overflow-wrap: anywhere;
  }

  .page-head p,
  .lede,
  .muted,
  .art-card-title,
  .art-card-meta,
  .detail-panel h1,
  .detail-panel h2 {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .footer-inner {
    /* site-footer의 tabbar-h에 safe-area 포함 — 이중 inset 제거 */
    padding-bottom: 1.15rem;
  }

  .admin-subnav,
  .mypage-tabs,
  .role-guide-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.35rem;
    margin-left: -0.15rem;
    margin-right: -0.15rem;
    padding-left: 0.15rem;
    padding-right: 0.15rem;
  }

  .admin-subnav::-webkit-scrollbar,
  .mypage-tabs::-webkit-scrollbar,
  .role-guide-tabs::-webkit-scrollbar {
    display: none;
  }

  .admin-subnav a,
  .mypage-tabs .chip,
  .role-guide-tabs .chip {
    flex: 0 0 auto;
  }

  .role-guide {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 2rem;
  }

  .role-guide-scene,
  .role-guide-callout,
  .role-guide-faq-item {
    overflow-wrap: anywhere;
  }

  .role-guide-matrix td:first-child {
    min-width: 7rem;
  }

  .detail-facts div {
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
  }

  .cart-item {
    grid-template-columns: 4.5rem 1fr;
    gap: 0.75rem;
    padding: 0.85rem;
  }

  .cart-thumb img {
    width: 4.5rem;
    height: 4.5rem;
  }

  .cart-info {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .shop-buy-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    width: 100%;
    margin-top: 1rem;
  }

  .shop-buy-row .qty-field {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 0.88rem;
  }

  .shop-buy-row input[type='number'] {
    width: 5.5rem;
    text-align: center;
  }

  .shop-buy-row .buy-btns {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    width: 100%;
  }

  .shop-buy-row .buy-btns .btn {
    flex: 1 1 50%;
    width: 50%;
    text-align: center;
    min-height: 2.75rem;
    font-weight: 600;
  }

  .editor-toolbar {
    flex-wrap: wrap;
  }

  .gallery-grid > *,
  .art-card {
    min-width: 0;
  }

  .form-actions:not(.page-head-actions):not(.admin-actions):not(.detail-actions) {
    display: grid;
    gap: 0.55rem;
  }

  .form-actions:not(.page-head-actions):not(.admin-actions):not(.detail-actions) .btn {
    width: 100%;
  }

  .page-head-actions,
  .admin-actions,
  .detail-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
    justify-content: flex-start !important;
    align-items: center !important;
    width: 100%;
    margin-top: 0.5rem;
  }

  .page-head-actions .btn,
  .page-head-actions a.btn,
  .page-head-actions button.btn,
  .admin-actions .btn,
  .admin-actions a.btn,
  .admin-actions button.btn,
  .detail-actions .btn,
  .detail-actions a.btn,
  .detail-actions button.btn {
    width: auto !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    padding: 0.42rem 0.8rem !important;
    font-size: 0.82rem !important;
    min-height: 2.1rem !important;
    line-height: 1.3 !important;
    border-radius: var(--radius-btn, 6px);
  }

  .bid-bar-mobile .bid-compact {
    min-width: 0;
  }

  .bid-bar-mobile .bid-compact > div {
    min-width: 0;
    overflow: hidden;
  }

  .admin-item > *,
  .mypage-row > *,
  .bid-stats > *,
  .detail-facts span,
  .cart-info {
    min-width: 0;
  }

  .mypage-row:not(.mypage-order) {
    grid-template-columns: 1fr;
  }

  .mypage-row-meta {
    text-align: left;
  }

  .admin-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .theme-tone-grid {
    grid-template-columns: 1fr;
  }

  .admin-subnav {
    mask-image: linear-gradient(90deg, #000 88%, transparent);
  }
}

@media (max-width: 767px) and (max-height: 640px) {
  .hero-scroll {
    display: none;
  }

  .hero,
  .hero-home {
    min-height: 0;
    padding-top: 1.35rem;
    padding-bottom: 1.75rem;
  }
}

@media (max-width: 380px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .brand {
    max-width: 42vw;
  }

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

@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --grid-gap: 1.45rem 1.1rem;
    --empty-pad: 2rem 1.15rem;
  }

  .hero-copy {
    max-width: 36rem;
  }

  .site-nav a {
    padding: 0.5rem 0.75rem;
    font-size: 0.86rem;
  }

  .nav {
    gap: 0.55rem;
    font-size: 0.84rem;
  }

  .home-paths,
  .home-paths-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-path {
    border-right: 1px solid var(--line);
  }

  .home-path:nth-child(2n) {
    border-right: 0;
  }

  .home-path:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  /* odd last cell in 2-col: keep right edge clean */
  .home-paths > .home-path:last-child:nth-child(odd) {
    border-right: 0;
  }

  .hero-atmosphere::after {
    width: min(36vw, 300px);
  }
}

@media (min-width: 1024px) {
  .hero-copy {
    padding-left: max(0px, calc((100vw - var(--content-max)) / 2));
  }

  .mobile-tabbar {
    display: none !important;
  }
}
