/* =====================================================================
   COSMUSE v1.4.0 — phone app layer (loaded after styles.css + atelier.css)
   Wide screens are untouched: everything that changes lives inside
   @media (max-width: 650px). Phone = bottom tab bar, sticky action bar,
   finger-sized controls, bottom-sheet dialogs, compact cards, agenda calendar.
   ===================================================================== */

/* Elements that only exist on phones */
.phone-only,
.phone-only-inline,
.tab-bar,
.sticky-cta {
  display: none;
}

/* Studio "more" sheet and shared list links (used on every width) */
.sheet-links {
  display: grid;
  gap: 8px;
}
.sheet-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px solid #e6dcd5;
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
}
.sheet-link .icon {
  width: 20px;
  height: 20px;
  color: var(--brand-dark, #a04b64);
  flex-shrink: 0;
}
.sheet-link span {
  flex: 1;
}
.sheet-link .icon:last-child {
  color: #b9aeae;
  width: 16px;
}
.sheet-link.active {
  background: var(--brand-soft, #f3dfe6);
  border-color: var(--brand, #d6b2c0);
}
.tel-link {
  color: inherit;
  text-decoration: none;
}
.agenda-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid #eee9e0;
  color: inherit;
  text-decoration: none;
  line-height: 1.6;
}
.agenda-row > div {
  flex: 1;
  min-width: 0;
}
.agenda-row .thumb {
  width: 44px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  background: #f5f2ed;
  flex-shrink: 0;
}
.agenda-row > .icon {
  width: 16px;
  color: #b9aeae;
  flex-shrink: 0;
}
.agenda-head {
  padding: 14px 0 6px;
}
.my-actions {
  gap: 20px; /* same spacing the two buttons had before they were grouped */
}

@media (max-width: 650px) {
  :root {
    --tabbar: 62px;
    --safe-b: env(safe-area-inset-bottom, 0px);
  }
  .phone-only {
    display: block;
  }
  .phone-only-inline {
    display: inline-flex;
  }
  html {
    scroll-padding-top: 80px;
  }
  body {
    font-size: 15px;
    line-height: 1.65;
    /* room for the bottom tab bar */
    padding-bottom: calc(var(--tabbar) + var(--safe-b));
  }
  .container {
    width: calc(100% - 32px);
  }

  /* ---------- Header: brand + 3 round buttons, nothing cut off ---------- */
  .announcement {
    display: none;
  }
  .site-header {
    height: 60px;
  }
  .site-header .nav-inner {
    gap: 10px;
  }
  .site-header .brand {
    font-size: 21px;
    letter-spacing: 1.6px;
    overflow: visible;
    text-overflow: clip;
    flex: 1;
    min-width: 0;
  }
  .brand-sub {
    display: none;
  }
  .brand > span {
    font-size: 12px;
  }
  .nav-tools {
    gap: 6px;
    flex-shrink: 0;
  }
  .nav-tools .icon-btn,
  .nav-tools .btn {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .nav-tools .icon {
    width: 19px;
    height: 19px;
  }
  .nav-tools .divider,
  .nav-account-label,
  .nav-tools > a.flex {
    display: none;
  }
  .mode-bar {
    font-size: 11px;
    padding: 8px 14px;
    gap: 4px 8px;
    flex-wrap: wrap;
  }

  /* Phone dropdown menu (hamburger) */
  .mobile-menu {
    top: 60px;
    padding: 10px 16px 16px;
    gap: 0;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 20px 50px #2a1f2318;
    max-height: calc(100dvh - 60px);
    overflow: auto;
  }
  .mobile-menu > a {
    display: block;
    padding: 13px 4px;
    font-size: 16px;
    border-bottom: 1px solid #efe8e2;
  }
  .mobile-menu > a.active {
    color: var(--brand-dark, #a04b64);
  }
  .mobile-menu-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding-top: 14px;
    font-size: 13px;
  }
  .mobile-menu-sub a,
  .mobile-menu-sub .text-btn {
    color: #7a6f6a;
    font-size: 13px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  /* ---------- Bottom tab bar ---------- */
  .tab-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: flex;
    align-items: stretch;
    height: calc(var(--tabbar) + var(--safe-b));
    padding: 0 4px var(--safe-b);
    background: #fffcf8f2;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid #e8dcd5;
    box-shadow: 0 -8px 30px #57404a0c;
  }
  .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #8a7d7a;
    font-size: 10.5px;
    line-height: 1.2;
    text-decoration: none;
    background: none;
    border: 0;
    padding: 6px 2px;
    min-width: 0;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }
  .tab-item .icon {
    width: 23px;
    height: 23px;
    stroke-width: 1.7;
  }
  .tab-item span {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .tab-item.active {
    color: var(--brand-dark, #a04b64);
  }
  .tab-item.active::before {
    content: "";
    position: absolute;
    top: 0;
    width: 28px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: var(--brand, #be617b);
  }
  .tab-count {
    position: absolute;
    top: 4px;
    left: calc(50% + 6px);
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--brand, #be617b);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    display: grid;
    place-items: center;
    line-height: 1;
  }
  body.modal-open .tab-bar {
    display: none;
  }

  /* Motion toggle and toasts sit above the tab bar, icon-only toggle */
  .motion-toggle {
    left: auto;
    right: 10px;
    bottom: calc(var(--tabbar) + var(--safe-b) + 10px);
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    justify-content: center;
    opacity: 0.8;
  }
  .motion-toggle span {
    display: none;
  }
  /* Pages with a sticky action bar (product, booking) keep the corner free */
  body:has(.sticky-cta) .motion-toggle {
    display: none;
  }
  #toasts {
    bottom: calc(var(--tabbar) + var(--safe-b) + 12px);
    left: 12px;
    right: 12px;
  }
  .toast {
    font-size: 13px;
  }
  .skip {
    display: none;
  }

  /* ---------- Finger-sized controls ---------- */
  .btn {
    min-height: 46px;
    font-size: 13px;
    padding: 10px 18px;
    border-radius: 12px;
  }
  .btn.small {
    min-height: 40px;
    font-size: 12px;
    padding: 8px 14px;
  }
  .btn.full {
    width: 100%;
  }
  .icon-btn {
    width: 40px;
    height: 40px;
  }
  .text-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
  }
  input,
  select,
  textarea,
  .form-grid input,
  .form-grid select,
  .form-grid textarea,
  .auth-card input,
  .modal input,
  .modal select,
  .modal textarea,
  .filter-date input {
    font-size: 16px; /* iOS does not zoom in on 16px fields */
    min-height: 46px;
    padding: 10px 13px;
    border-radius: 12px;
  }
  textarea {
    min-height: 96px;
  }
  label {
    font-size: 13px;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .form-grid .span2 {
    grid-column: auto;
  }
  .modal .form-grid {
    grid-template-columns: 1fr;
  }
  .modal label,
  .form-grid label {
    font-size: 13px;
  }
  .check-label {
    gap: 12px;
    font-size: 13px;
    align-items: flex-start;
  }
  .check-label input {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    min-height: 0;
    margin-top: 2px;
  }
  .radio-cards {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .radio-card {
    padding: 13px 10px;
    font-size: 13px;
    min-height: 56px;
  }
  .form-note {
    font-size: 12px;
  }
  .callout {
    font-size: 13px;
    line-height: 1.7;
  }
  .small {
    font-size: 12px;
  }
  .page-intro,
  .studio-heading p,
  .section-heading p,
  .detail-description,
  .rich-text {
    font-size: 13.5px;
    line-height: 1.75;
  }
  .page {
    padding: 18px 0 40px;
  }
  .page-title {
    font-size: 26px;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }
  .eyebrow {
    font-size: 9px;
    letter-spacing: 2px;
  }
  .back-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    font-size: 13px;
  }
  .panel {
    padding: 16px;
    border-radius: 16px;
  }
  .between {
    flex-wrap: wrap;
    gap: 12px;
  }
  .tabs {
    gap: 7px;
    padding-bottom: 12px;
    margin-bottom: 16px;
  }
  .tab {
    font-size: 12.5px;
    padding: 8px 13px;
    min-height: 40px;
    border: 1px solid #e6dcd5;
    background: #fff;
    border-radius: 999px;
  }
  .tab.active {
    border-color: var(--brand, #d6b2c0);
  }

  /* ---------- Storefront: home / catalog ---------- */
  .hero {
    padding-top: 22px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .hero h1 {
    font-size: clamp(32px, 9.2vw, 40px);
    line-height: 1.25;
    letter-spacing: -0.8px;
    margin: 12px 0 12px;
  }
  .hero h1 br {
    display: none;
  }
  .hero-description {
    font-size: 14px;
    line-height: 1.75;
    margin-bottom: 18px;
  }
  .hero-image-wrap {
    max-width: 100%;
    margin: 0;
  }
  .hero-image {
    aspect-ratio: 4 / 3;
    border-radius: 24px;
  }
  .search-field {
    padding: 8px 10px;
    border-right: 0;
  }
  .search-strip > .btn {
    border-radius: 14px;
  }
  .trust-row {
    font-size: 11.5px;
  }
  .avail-day {
    min-height: 38px;
    font-size: 12.5px;
    border-radius: 8px;
  }
  .today-grid {
    grid-template-columns: 1fr;
  }
  .print-actions .btn {
    flex: 1;
    justify-content: center;
  }
  .filter-row {
    gap: 8px;
  }
  .filter-select {
    flex: 1 1 calc(50% - 4px);
    justify-content: space-between;
    min-height: 44px;
  }
  .filter-select select {
    min-height: 36px;
    font-size: 14px;
  }
  .star-pick {
    font-size: 36px;
  }
  .accent-pick {
    gap: 10px;
  }
  .accent-dot {
    width: 34px;
    height: 34px;
  }
  .bar-chart.duo .bar {
    width: 10px;
  }
  .expense-row {
    flex-wrap: wrap;
  }
  .site-header {
    height: 60px;
  }
  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
    font-size: 14px;
  }
  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .hero-buttons .text-btn {
    justify-content: center;
    font-size: 13px;
  }
  .search-field label {
    font-size: 11px;
  }
  .search-strip > .btn {
    min-height: 46px;
    font-size: 13px;
  }
  .trust-row {
    font-size: 10.5px;
  }
  .atelier-ribbon span {
    font-size: 8px;
  }
  .toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-bottom: 6px;
  }
  .toolbar input {
    max-width: none;
    font-size: 16px;
  }
  .toolbar .btn {
    min-height: 46px;
  }
  .catalog-section {
    padding: 22px 0 30px;
  }
  .section-heading h2 {
    font-size: 22px;
  }
  .section-heading .serif {
    font-size: 14px;
  }
  .section-heading > .text-btn {
    font-size: 12px;
  }
  .categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .category {
    flex: 1 1 calc(50% - 4px);
    font-size: 12.5px;
    min-height: 44px;
    padding: 8px 10px;
    gap: 6px;
  }
  .category .icon {
    width: 15px;
    height: 15px;
    display: inline;
  }
  .sort {
    width: 100%;
    margin: 0;
    font-size: 14px;
    min-height: 44px;
    border: 1px solid #e6dcd5;
    border-radius: 12px;
    padding: 0 12px;
    background: #fff;
  }
  .filter-date {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
  }
  .filter-date label {
    font-size: 12px;
  }
  .filter-date input {
    min-height: 44px;
    font-size: 15px;
    padding: 8px 10px;
  }
  .filter-date .btn {
    grid-column: 1 / -1;
    min-height: 44px;
    font-size: 13px;
  }
  .filter-date .text-btn {
    grid-column: 1 / -1;
    justify-self: center;
    font-size: 12px;
  }
  .filters-summary {
    font-size: 13px;
  }
  .product-grid {
    gap: 16px 10px;
  }
  /* The whole picture is already a link: no hover button over the photo on touch */
  .product-action {
    display: none;
  }
  .sample-tag {
    bottom: 8px;
  }
  .product-title {
    font-size: 15px;
  }
  .product-subtitle {
    font-size: 11.5px;
  }
  .product-character {
    font-size: 9px;
  }
  .price-line strong {
    font-size: 17px;
  }
  .price-line small,
  .price-line .sizes {
    font-size: 10px;
  }
  .sample-tag {
    font-size: 9px;
  }
  .favorite {
    width: 34px;
    height: 34px;
  }
  .favorite .icon {
    width: 16px;
    height: 16px;
  }
  .steps {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .step {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 4px 14px;
    text-align: left;
    padding: 16px;
  }
  .step .step-icon {
    grid-row: 1 / 3;
    margin: 0;
  }
  .step h3 {
    font-size: 14px;
    margin: 0;
  }
  .step p {
    font-size: 12px;
    margin: 0;
  }
  .step .num {
    display: none;
  }
  .muse-invitation > .btn {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
  .footer {
    padding: 28px 0 24px;
  }
  .footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    font-size: 13px;
  }
  .footer-links a {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }
  .footer-bottom {
    font-size: 10.5px;
  }

  /* ---------- Product page + booking page: sticky action bar ---------- */
  .breadcrumbs {
    font-size: 12px;
    margin-bottom: 14px;
  }
  .detail-heading {
    font-size: 26px;
  }
  .detail-price {
    font-size: 24px;
    margin: 12px 0;
  }
  .detail-facts {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 12px;
  }
  .detail-facts small {
    font-size: 10px;
  }
  .detail-facts strong {
    font-size: 13px;
  }
  .thumbnails .icon-btn {
    width: 64px !important;
    height: auto;
  }
  .variant {
    min-height: 46px;
    min-width: 54px;
    font-size: 14px;
  }
  .date-pair {
    gap: 10px;
  }
  .availability-message {
    font-size: 13px;
  }
  .detail-cta {
    display: none; /* the sticky bar below replaces it */
  }
  .detail-accordion summary {
    font-size: 15px;
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  .sticky-cta {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    bottom: calc(var(--tabbar) + var(--safe-b) + 8px);
    z-index: 25;
    margin-top: 18px;
    padding: 10px 12px;
    border: 1px solid #e6dcd5;
    border-radius: 16px;
    background: #fffcf8f5;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 10px 30px #57404a1a;
  }
  .sticky-cta .cta-price {
    flex: 1;
    min-width: 0;
    line-height: 1.25;
  }
  .sticky-cta .cta-price strong {
    display: block;
    font-size: 19px;
    color: var(--brand-dark, #a04b64);
    font-weight: 600;
  }
  .sticky-cta .cta-price small {
    display: block;
    font-size: 10.5px;
    color: #8a7d7a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sticky-cta .btn {
    flex-shrink: 0;
    min-height: 46px;
    font-size: 13px;
    padding: 10px 14px;
  }
  .sticky-cta .btn.light {
    width: 46px;
    padding: 0;
    justify-content: center;
  }
  .sticky-cta .btn.light.active {
    color: var(--brand, #be617b);
    border-color: var(--brand, #d6b2c0);
    background: var(--brand-tint, #f8ecef);
  }
  .sticky-cta .btn.light.active .icon {
    fill: currentColor;
  }
  .booking-submit {
    display: none; /* the sticky bar below replaces it */
  }
  .booking-layout {
    gap: 14px;
  }
  .booking-summary .summary-row {
    font-size: 13px;
  }
  .summary-total strong {
    font-size: 20px;
  }
  .form-heading {
    font-size: 16px;
  }
  .form-heading .number {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  /* ---------- Account / order pages ---------- */
  .page .between > .btn,
  .page .between > .flex {
    margin-left: 0;
  }
  .page > .between:first-child,
  .page .between.page-actions {
    align-items: flex-start;
  }
  .my-actions {
    width: 100%;
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
  }
  .my-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 12.5px;
  }
  .order-card {
    padding: 14px;
    border-radius: 16px;
  }
  .order-head {
    font-size: 12.5px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .order-product h3 {
    font-size: 15px;
  }
  .order-product p {
    font-size: 12px;
  }
  .order-product img {
    width: 56px;
    height: 72px;
  }
  .order-product {
    flex-wrap: wrap;
  }
  .order-product > div:not(.order-price) {
    flex: 1;
    min-width: 0;
  }
  .order-price {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px solid #f1eae4;
    text-align: left;
  }
  .order-price br {
    display: none;
  }
  .order-price strong {
    font-size: 17px;
  }
  .order-price .btn {
    font-size: 12.5px;
    padding: 8px 14px;
    min-height: 40px;
    white-space: nowrap;
  }
  .progress-steps {
    padding: 18px 0 12px;
    gap: 2px;
  }
  .progress-step {
    font-size: 9.5px;
  }
  .progress-step span {
    width: 26px;
    height: 26px;
    border-width: 3px;
    margin-bottom: 6px;
  }
  .progress-step span .icon {
    width: 12px;
    height: 12px;
  }
  .progress-step:before {
    top: 12px;
  }
  .progress-step:not(.current) {
    font-size: 0; /* only the current stage keeps its label */
  }
  .progress-step.current {
    font-size: 10.5px;
    font-weight: 600;
  }
  .info-list p {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 6px;
    font-size: 13px;
    overflow-wrap: anywhere;
  }
  .summary-row {
    font-size: 13.5px;
  }
  .tracking-code {
    font-size: 15px;
    overflow-wrap: anywhere;
  }
  .issue-actions .btn {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
    font-size: 12.5px;
  }
  .auth-wrap {
    margin: 16px auto 36px;
  }
  .auth-decoration {
    min-height: 0;
    padding: 20px 22px;
  }
  .auth-decoration strong {
    font-size: 26px;
  }
  .auth-card {
    padding: 22px 18px;
  }
  .auth-card h1 {
    font-size: 24px;
  }
  .auth-card label {
    font-size: 13px;
  }
  .auth-toggle {
    font-size: 13px;
  }

  /* ---------- Studio (back office) ---------- */
  .sidebar {
    display: none; /* the bottom tab bar + "more" sheet replace the side menu */
  }
  .studio-main {
    padding: 16px 16px 30px;
  }
  .studio-notice {
    font-size: 12px;
  }
  .studio-heading {
    display: block;
    margin-bottom: 16px;
    padding-bottom: 14px;
  }
  .studio-heading h1 {
    font-size: 23px;
    line-height: 1.3;
  }
  .studio-heading p {
    font-size: 12.5px;
  }
  .studio-heading > .btn {
    width: 100%;
    justify-content: center;
    margin-top: 12px;
    font-size: 13.5px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
  }
  .stat {
    padding: 12px;
    border-radius: 14px;
  }
  .stat > span {
    font-size: 10.5px;
  }
  .stat strong {
    font-size: 21px;
    margin-top: 4px;
  }
  .stat small {
    font-size: 10px;
  }
  .studio-main .panel {
    padding: 14px;
  }
  .table-title {
    gap: 10px;
    flex-wrap: wrap;
  }
  .table-title h2 {
    font-size: 16px;
  }
  .table-title .text-btn {
    font-size: 12.5px;
  }
  .overdue-row {
    font-size: 13px;
    padding: 12px;
  }
  .overdue-alert h2 {
    font-size: 15px;
  }
  .info-list a.between {
    min-height: 44px;
    font-size: 13.5px;
  }
  .bar-chart .value {
    font-size: 9px;
  }
  .site-images {
    grid-template-columns: 1fr;
  }

  /* Generic stacked table card (customers, anything else) */
  .data-table tr {
    padding: 10px 12px;
    border-radius: 14px;
    margin-bottom: 10px;
  }
  .data-table td {
    font-size: 13px;
    padding: 6px 0;
  }
  .data-table td::before {
    font-size: 11.5px;
  }
  .data-table .badge {
    font-size: 11px;
  }
  .data-table .thumb {
    width: 44px;
    height: 54px;
    object-fit: cover;
    border-radius: 8px;
  }
  .customers-table td:first-child {
    justify-content: flex-start;
    text-align: left;
    font-size: 15px;
    font-weight: 500;
    padding-bottom: 8px;
    border-bottom: 1px solid #efe8e2;
    margin-bottom: 4px;
  }
  .customers-table td:first-child::before {
    content: none;
  }
  .customers-table td:first-child .shop-logo {
    flex-shrink: 0;
  }
  .customers-table .tel-link {
    color: var(--brand-dark, #a04b64);
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  /* Bookings: one compact card per rental — photo · name · amount / code · customer / dates / status */
  .orders-table tr {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    grid-template-areas:
      "img name total"
      "img code code"
      "img dates dates"
      "status status status";
    gap: 2px 12px;
    align-items: start;
    padding: 12px;
    position: relative;
    cursor: pointer;
  }
  .orders-table tr:active {
    background: #fcf6f2;
  }
  .orders-table td {
    display: block;
    padding: 0;
    text-align: left;
    font-size: 12.5px;
    min-width: 0;
  }
  .orders-table td::before {
    content: none;
  }
  .orders-table td:nth-child(1) {
    grid-area: code;
    color: #7a6f6a;
    font-size: 12px;
  }
  .orders-table td:nth-child(1) br {
    display: none;
  }
  .orders-table td:nth-child(1) strong {
    color: #292c2b;
    font-weight: 500;
  }
  .orders-table td:nth-child(1) .muted::before {
    content: " · ";
  }
  .orders-table td:nth-child(2),
  .orders-table td:nth-child(2) .flex {
    display: contents;
  }
  .orders-table td:nth-child(2) .thumb {
    grid-area: img;
    width: 48px;
    height: 60px;
  }
  .orders-table td:nth-child(2) span {
    grid-area: name;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
  }
  .orders-table td:nth-child(3) {
    grid-area: dates;
    color: var(--brand-dark, #a04b64);
    font-size: 12px;
  }
  .orders-table td:nth-child(4) {
    grid-area: total;
    font-weight: 600;
    font-size: 14px;
    text-align: right;
    white-space: nowrap;
  }
  .orders-table td:nth-child(5) {
    grid-area: status;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px;
    padding-top: 8px;
    margin-top: 6px;
    border-top: 1px solid #f1eae4;
  }
  .orders-table td:nth-child(6) {
    display: none; /* the whole card opens the booking */
  }
  .orders-table td[colspan] {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px 0 !important;
  }

  /* Products: photo · name/character · edit/delete, then price · sizes · visibility */
  .products-table tr {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    grid-template-areas:
      "img name actions"
      "img price price"
      "img sizes sizes"
      "status status status";
    gap: 2px 12px;
    align-items: start;
    padding: 12px;
  }
  .products-table td {
    display: block;
    padding: 0;
    text-align: left;
    font-size: 12.5px;
    min-width: 0;
  }
  .products-table td::before {
    content: none;
  }
  .products-table td:nth-child(1),
  .products-table td:nth-child(1) .flex {
    display: contents;
  }
  .products-table td:nth-child(1) .thumb {
    grid-area: img;
    width: 56px;
    height: 70px;
  }
  .products-table td:nth-child(1) .flex > div {
    grid-area: name;
    font-size: 12px;
    line-height: 1.4;
  }
  .products-table td:nth-child(1) strong {
    font-size: 15px;
    display: block;
  }
  .products-table td:nth-child(1) br {
    display: none;
  }
  .products-table td:nth-child(2) {
    display: none; /* category is already on the card as the collection line */
  }
  .products-table td:nth-child(3) {
    grid-area: price;
    color: var(--brand-dark, #a04b64);
    font-weight: 500;
    padding-top: 4px;
  }
  .products-table td:nth-child(3)::before {
    content: "ค่าเช่า / ประกัน ";
    color: #8a7d7a;
    font-weight: 400;
    font-size: 11.5px;
  }
  .products-table td:nth-child(4) {
    grid-area: sizes;
    color: #7a6f6a;
    font-size: 12px;
  }
  .products-table td:nth-child(4) br {
    display: none;
  }
  .products-table .size-item {
    display: inline-block;
    margin-right: 10px;
  }
  .products-table td:nth-child(5) {
    grid-area: status;
    padding-top: 8px;
    margin-top: 6px;
    border-top: 1px solid #f1eae4;
  }
  .products-table td:nth-child(6) {
    grid-area: actions;
  }
  .products-table .row-actions {
    gap: 4px;
  }
  .products-table .row-actions .icon-btn {
    width: 38px;
    height: 38px;
  }
  .products-table td[colspan] {
    grid-column: 1 / -1;
    text-align: center;
  }

  /* Calendar: month grid shows dots, the agenda list below shows the tapped day */
  .calendar-grid {
    border-radius: 10px;
    overflow: hidden;
  }
  .calendar-weekday {
    font-size: 10.5px;
    padding: 7px 2px;
  }
  .calendar-day {
    min-height: 54px;
    padding: 5px 3px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
  }
  .calendar-date {
    font-size: 12.5px;
    margin: 0;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
  }
  .calendar-day.today .calendar-date {
    background: var(--brand, #be617b);
    color: #fff;
    font-weight: 600;
  }
  .calendar-day.picked {
    background: var(--brand-tint, #fcf1f4);
    outline: 2px solid var(--brand, #be617b);
    outline-offset: -2px;
  }
  .calendar-day .calendar-event {
    /* queue chips become dots; the agenda list below names them */
    pointer-events: none;
    font-size: 0;
    width: 7px;
    height: 7px;
    padding: 0;
    margin: 0 1px;
    border-radius: 50%;
    background: var(--brand, #be617b);
    display: inline-block;
    border: 0;
    overflow: visible;
  }
  .calendar-day .calendar-event.late {
    background: #c94f4f;
  }
  .calendar-day .calendar-event:nth-of-type(n + 5) {
    display: none; /* at most 4 dots per day cell */
  }
  .calendar-agenda {
    margin-top: 14px;
  }
  .calendar-agenda .badge {
    font-size: 10.5px;
  }
  .table-title .flex h2 {
    font-size: 17px;
  }
  .table-title .flex .icon-btn {
    width: 40px;
    height: 40px;
  }

  /* ---------- Dialogs become bottom sheets ---------- */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  .modal {
    max-width: none;
    width: 100%;
    max-height: 94dvh;
    border-radius: 22px 22px 0 0;
    padding: 8px 18px calc(18px + var(--safe-b));
    box-shadow: 0 -20px 80px #1b211d33;
  }
  .modal.large {
    max-width: none;
  }
  .modal::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    margin: 4px auto 6px;
    border-radius: 2px;
    background: #ddd1cc;
  }
  .modal-top {
    margin-bottom: 12px;
  }
  .modal h2 {
    font-size: 19px;
  }
  .modal-footer {
    position: sticky;
    bottom: 0;
    margin: 18px -18px calc(-18px - var(--safe-b));
    padding: 12px 18px calc(12px + var(--safe-b));
    background: #fcfbf8f5;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    gap: 8px;
    border-top: 1px solid #ebe3dc;
  }
  .modal-footer .btn {
    flex: 1;
    justify-content: center;
    font-size: 13.5px;
    padding: 10px 8px;
  }
  .modal-footer .btn.light {
    flex: 0 0 auto;
    min-width: 88px;
  }
  .upload-previews {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .image-uploader {
    min-height: 60px;
    font-size: 12.5px;
  }
  .variant-row input {
    min-width: 0;
  }
  .variant-row input[name="variant_stock"] {
    max-width: 84px !important;
  }
  .payment-preview {
    max-height: 60dvh;
  }
}

/* Tiny phones (≤360px): slightly denser */
@media (max-width: 360px) {
  .tab-item {
    font-size: 9.5px;
  }
  .tab-item .icon {
    width: 21px;
    height: 21px;
  }
  .sticky-cta .btn.primary {
    font-size: 12px;
    padding: 10px 10px;
  }
  .category {
    font-size: 12px;
  }
  .orders-table tr {
    grid-template-columns: 42px 1fr auto;
  }
}
