/* Mobile refinements shared by all pages */
@media (max-width: 767px) {
  :root {
    --mobile-pad: 1.25rem;
  }

  html {
    scroll-padding-top: 5rem;
  }

  body {
    overflow-x: hidden;
  }

  header > div:first-child {
    padding-left: var(--mobile-pad) !important;
    padding-right: var(--mobile-pad) !important;
  }

  header > div:first-child > div {
    height: 5rem !important;
  }

  header a img {
    height: 3rem !important;
  }

  #menuBtn {
    width: 3rem;
    height: 3rem;
    font-size: 1.1rem;
  }

  #mobileNav nav {
    padding: .75rem var(--mobile-pad) 1.1rem;
  }

  #mobileNav nav > a {
    padding-top: .7rem;
    padding-bottom: .7rem;
  }

  main > section > div[class*="max-w-"] {
    padding-left: var(--mobile-pad) !important;
    padding-right: var(--mobile-pad) !important;
  }

  main section[class~="py-24"],
  main section[class~="py-20"] {
    padding-top: 3.5rem !important;
    padding-bottom: 3.5rem !important;
  }

  main section > div[class~="py-20"],
  main section > div[class~="py-24"] {
    padding-top: 3.5rem !important;
    padding-bottom: 3.5rem !important;
  }

  main h1,
  main h2,
  main h3,
  main p,
  main li,
  main dd {
    word-break: keep-all;
    overflow-wrap: break-word;
  }

  main h1[class~="text-3xl"],
  main h1[class~="text-4xl"] {
    font-size: 1.875rem !important;
    line-height: 1.3 !important;
  }

  main h2[class~="text-3xl"] {
    font-size: 1.65rem !important;
    line-height: 1.35 !important;
  }

  main [class~="mt-14"] {
    margin-top: 2.25rem !important;
  }

  main [class~="mt-16"],
  main [class~="mt-20"] {
    margin-top: 3rem !important;
  }

  main [class~="p-8"] {
    padding: 1.25rem !important;
  }

  footer > div {
    padding: 3rem var(--mobile-pad) !important;
  }

  footer img {
    max-height: 4.5rem;
    width: auto;
  }

  footer [class~="gap-12"] {
    gap: 2rem !important;
  }

  /* Home */
  .page-home main > section:first-child > div.relative {
    padding-top: 4.5rem !important;
    padding-bottom: 4rem !important;
  }

  .page-home main > section:first-child h1 {
    margin-top: 1.5rem !important;
    font-size: 2rem !important;
    line-height: 1.32 !important;
  }

  .page-home main > section:first-child h1 br {
    display: none;
  }

  .page-home main > section:first-child h1 + p {
    margin-top: 1.5rem !important;
    font-size: 1rem !important;
    line-height: 1.85 !important;
  }

  .page-home main > section:first-child h1 + p + div {
    margin-top: 2rem !important;
  }

  .page-home main > section:first-child dl {
    margin-top: 3rem !important;
    padding-top: 1.75rem !important;
    row-gap: 1.5rem !important;
    column-gap: 1rem !important;
  }

  .page-home main > section:first-child dl dd {
    font-size: 1.65rem !important;
  }

  .page-home main section [class~="mt-14"] {
    margin-top: 2rem !important;
  }

  /* Product */
  .page-product main > section:first-child > div,
  .page-order main > section:first-child > div,
  .page-company main > section:first-child > div,
  .page-services main > section:first-child > div,
  .page-works main > section:first-child > div,
  .page-tech main > section:first-child > div,
  .page-support main > section:first-child > div {
    padding-top: 3.5rem !important;
    padding-bottom: 3.5rem !important;
  }

  .page-product main > section:first-child h1 span {
    display: inline-block;
    white-space: nowrap;
  }

  .page-product main > section:nth-of-type(2) > div > div {
    gap: 2.5rem !important;
  }

  .page-product main > section:nth-of-type(2) > div > div > div:first-child > div:first-child {
    padding: 1.25rem !important;
  }

  .page-product main img[class~="h-[24rem]"] {
    height: 19rem !important;
  }

  .page-product main div[class~="grid-cols-3"] {
    gap: .5rem !important;
  }

  .page-product main div[class~="grid-cols-3"] figure {
    padding: .55rem !important;
  }

  .page-product main div[class~="grid-cols-3"] figure img {
    height: 5.5rem !important;
    max-width: 100%;
  }

  .page-product main div[class~="grid-cols-3"] figcaption {
    font-size: .7rem !important;
    line-height: 1.45 !important;
  }

  .page-product main h2 {
    font-size: 1.35rem !important;
  }

  .page-product main ul li {
    gap: .75rem !important;
    padding: 1rem !important;
  }

  .page-product main dl > div {
    flex-direction: column;
    gap: .3rem !important;
    padding: .9rem 1rem !important;
  }

  .page-product main dl dt {
    width: auto !important;
    font-size: .8rem;
  }

  .page-product main dl dd {
    font-size: .92rem;
    line-height: 1.65;
  }

  .page-product main table,
  .page-works main table,
  .page-order main table {
    display: block;
    min-width: 0 !important;
    width: 100%;
  }

  .page-product main table thead,
  .page-works main table thead,
  .page-order main table thead {
    display: none;
  }

  .page-product main table tbody,
  .page-works main table tbody,
  .page-order main table tbody {
    display: grid;
    width: 100%;
  }

  .page-product main table tr,
  .page-works main table tr,
  .page-order main table tr {
    display: block;
    padding: 1rem;
    border-bottom: 1px solid #e2e9f4;
  }

  .page-product main table tr:last-child,
  .page-works main table tr:last-child,
  .page-order main table tr:last-child {
    border-bottom: 0;
  }

  .page-product main table td,
  .page-works main table td,
  .page-order main table td {
    display: grid;
    grid-template-columns: 5.8rem minmax(0, 1fr);
    gap: .5rem;
    padding: .25rem 0 !important;
    white-space: normal !important;
    font-size: .875rem;
    line-height: 1.6;
  }

  .page-product main table td::before,
  .page-works main table td::before,
  .page-order main table td::before {
    color: #5c7cb6;
    font-size: .75rem;
    font-weight: 700;
  }

  .page-product main table td:nth-child(1)::before { content: "품목"; }
  .page-product main table td:nth-child(2)::before { content: "치수"; }
  .page-product main table td:nth-child(3)::before { content: "비고"; }

  .page-product main img[class~="min-w-[560px]"] {
    min-width: 0 !important;
    width: 100% !important;
  }

  .page-product main > section:nth-of-type(2) > div > div[class~="rounded-2xl"] {
    padding: 1.25rem !important;
  }

  .page-product main a[href="order.html"] {
    min-height: 3.25rem;
  }

  /* Works */
  .page-works main table tbody {
    gap: .75rem;
  }

  .page-works main table tr {
    border: 1px solid #e2e9f4;
    border-radius: .8rem;
  }

  .page-works main table td {
    display: block;
  }

  .page-works main table td:first-child {
    color: #f2711c;
    font-size: .75rem;
    padding-bottom: .35rem !important;
  }

  .page-works main table td:nth-child(2) {
    font-size: .95rem;
    line-height: 1.7;
  }

  .page-works main table td:nth-child(3) {
    margin-top: .45rem;
    font-size: .82rem;
  }

  .page-works main table td:nth-child(3)::before {
    content: "발주처  ";
    color: #5c7cb6;
    font-weight: 700;
  }

  /* Technology matrix tables */
  .page-tech main table {
    min-width: 0 !important;
    table-layout: fixed;
    font-size: .76rem !important;
  }

  .page-tech main table th,
  .page-tech main table td {
    padding: .65rem .25rem !important;
    white-space: normal !important;
  }

  .page-tech main table th:first-child,
  .page-tech main table td:first-child {
    width: 36%;
    padding-left: .55rem !important;
    text-align: left;
  }

  .page-tech main h2[class~="px-8"],
  .page-tech main div[class~="px-8"] {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Order form */
  .page-order main ol {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: start;
    gap: .25rem !important;
    font-size: .72rem !important;
  }

  .page-order main ol li:nth-child(odd) {
    flex-direction: column;
    text-align: center;
    line-height: 1.45;
  }

  .page-order main ol li:nth-child(even) {
    padding-top: .3rem;
  }

  .page-order main > section:nth-of-type(2) > div > div[class~="bg-navy-900"] {
    margin-top: 2rem !important;
    padding: 1.25rem !important;
  }

  .page-order main form {
    margin-top: 2rem !important;
  }

  .page-order main form > div[class~="grid"] {
    gap: 1.15rem !important;
  }

  .page-order main form input,
  .page-order main form textarea,
  .page-order main form button {
    min-height: 3.25rem;
    font-size: 1rem !important;
  }

  .page-order main form > div[class~="bg-navy-950/40"] {
    padding: 1rem !important;
  }

  .page-order main table tr {
    border-color: rgba(255, 255, 255, .13);
  }

  .page-order main table td {
    display: block;
    color: rgba(255, 255, 255, .82);
  }

  .page-order main table td:nth-child(2)::before { content: "수집 항목 · "; }
  .page-order main table td:nth-child(3)::before { content: "이용 목적 · "; }
  .page-order main table td:nth-child(4)::before { content: "보유 기간 · "; }

  .page-order main button[type="submit"] {
    width: 100%;
  }

  .page-order main > section:nth-of-type(2) > div > div:last-child {
    padding: 1.25rem !important;
  }

  /* Compact cards on information-heavy pages */
  .page-company main [class~="px-8"],
  .page-services main [class~="px-8"],
  .page-support main [class~="px-8"] {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }
}

@media (max-width: 359px) {
  :root { --mobile-pad: 1rem; }

  .page-home main > section:first-child h1,
  main h1[class~="text-3xl"],
  main h1[class~="text-4xl"] {
    font-size: 1.7rem !important;
  }

  .page-product main div[class~="grid-cols-3"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-product main div[class~="grid-cols-3"] figure:last-child {
    grid-column: span 2;
  }
}
