/* Carshu responsive corrections. Existing colors and application flows stay local. */

/* The desktop navigation no longer fits next to the full logo and account links. */
@media (min-width:769px) and (max-width:1024px) {
  .tt-header-inner {
    display:grid;
    grid-template-columns:44px minmax(0,1fr) auto;
    align-items:center;
    height:auto;
    min-height:64px;
    gap:8px 12px;
    padding:10px 20px;
  }
  .tt-header-inner .tt-nav { display:none; }
  .tt-header-inner .tt-mobile-menu-btn {
    display:flex;
    grid-column:1;
    grid-row:1;
    width:44px;
    height:44px;
  }
  .tt-header-inner .tt-logo {
    grid-column:2;
    grid-row:1;
    justify-self:start;
    min-width:0;
    max-width:100%;
    height:auto;
  }
  .tt-header-inner .tt-header-actions {
    grid-column:3;
    grid-row:1;
    justify-self:end;
    min-width:0;
    gap:4px;
  }
  .tt-header-inner .tt-header-actions a {
    display:inline-flex;
    align-items:center;
    min-height:44px;
    white-space:nowrap;
  }
  .tt-header-inner .tt-header-search {
    grid-column:1 / -1;
    grid-row:2;
    width:100%;
    max-width:none;
    min-width:0;
    margin:0;
  }
  .tt-header-inner .tt-search-input { min-width:0; }
}

/* Keep the existing drawer behavior through the old, unusable 64px sidebar range. */
@media (max-width:900px) {
  .admin-body .admin-layout { flex-direction:column; }
  .admin-body .admin-content { width:100%; min-width:0; }
  .admin-body .admin-sidebar {
    position:fixed;
    inset:0 auto 0 0;
    width:240px;
    max-width:calc(100vw - 32px);
    height:100vh;
    height:100dvh;
    transform:translateX(-100%);
    z-index:200;
  }
  .admin-body .admin-sidebar.mobile-open { transform:translateX(0); }
  .admin-body .admin-sidebar-overlay {
    display:none;
    position:fixed;
    inset:0;
    background:rgb(0 0 0 / 40%);
    z-index:150;
  }
  .admin-body .admin-sidebar-overlay.show { display:block; }
  .admin-body .admin-logo { display:flex; }
  .admin-body .admin-nav a span { display:inline; }
  .admin-body .admin-nav .admin-nav-icon { display:inline-block; }
  .admin-body .admin-user-name,
  .admin-body .admin-logout-link { display:block; }
  .admin-body .admin-role-badge { display:inline-block; }
  .admin-body .admin-user-detail { min-width:0; overflow-wrap:anywhere; }
  .admin-body .admin-nav-item,
  .admin-body .admin-nav-toggle,
  .admin-body .admin-nav-sub a,
  .admin-body .admin-logout-link { min-height:44px; }
  .admin-body .admin-nav-sub a,
  .admin-body .admin-logout-link { display:flex; align-items:center; }
  .admin-body .admin-nav-group.open .admin-nav-sub { max-height:none; }
  .admin-body .admin-topbar {
    display:grid;
    grid-template-columns:44px minmax(0,1fr) auto;
    align-items:center;
    gap:8px;
    padding:10px 12px;
  }
  .admin-body .admin-sidebar-toggle {
    display:flex;
    align-items:center;
    justify-content:center;
    width:44px;
    min-height:44px;
    padding:6px;
  }
  .admin-body .admin-page-title {
    min-width:0;
    margin:0;
    line-height:1.4;
    overflow-wrap:anywhere;
  }
  .admin-body .admin-erp-link { margin-left:0; min-height:44px; }
}

/* Reserve a full row for the scrollable tablet navigation and let long names wrap. */
@media (max-width:768px) {
  .tablet-body .tablet-header-nav { flex:0 0 100%; min-width:0; }
  .tablet-body .tablet-header-left,
  .tablet-body .tablet-header-right { min-width:0; max-width:100%; }
  .tablet-body .tablet-header-right { flex-wrap:wrap; }
  .tablet-body .tablet-worker-chip {
    min-width:0;
    max-width:100%;
    overflow-wrap:anywhere;
  }
  .tablet-body .tablet-worker-dot { flex:none; }
  .tablet-body .tablet-header-nav a,
  .tablet-body .tablet-header-right .tablet-btn { min-height:44px; }
}

/* Dashboard comparisons and sparklines occupy their own rows on phones. */
@media (max-width:600px) {
  .admin-body .sdash .kpis { grid-template-columns:minmax(0,1fr); }
  .admin-body .sdash .kpi {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    align-content:start;
    gap:10px;
    min-width:0;
  }
  .admin-body .sdash .kpi .val {
    margin-top:0;
    min-width:0;
    flex-wrap:wrap;
    overflow-wrap:anywhere;
  }
  .admin-body .sdash .kpi > div:not(.label):not(.val) {
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:6px;
    min-width:0;
  }
  .admin-body .sdash .kpi .delta { margin-top:0; max-width:100%; }
  .admin-body .sdash .kpi .compare { margin-left:0; overflow-wrap:anywhere; }
  .admin-body .sdash .kpi .spark,
  .admin-body .sdash .kpi .kpi-sub {
    position:static;
    justify-self:end;
    max-width:100%;
  }
  .admin-body .sdash .kpi .kpi-sub { line-height:1.5; overflow-wrap:anywhere; }
}

/* Native date controls must not force a 320px viewport wider than the screen. */
@media (max-width:480px) {
  .erp-workspace .dsh-row2 { grid-template-columns:minmax(0,1fr); min-width:0; }
  .erp-workspace .dsh-field { min-width:0; max-width:100%; }
  .erp-workspace .dsh-field input {
    width:100%;
    min-width:0;
    max-width:100%;
    box-sizing:border-box;
  }
}

/* Keep receipt navigation in the normal mobile flow; ERP relocates it into its command bar. */
.carshu-workday-shortcut{position:fixed;right:16px;bottom:18px;z-index:1000;display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 18px;border:1px solid #0758db;border-radius:24px;background:#0758db;color:#fff;text-decoration:none;font:600 13px/1.4 system-ui,sans-serif;box-shadow:0 4px 20px #0758db26;box-sizing:border-box}
.carshu-workday-shortcut:hover{background:#0648b6;border-color:#0648b6;color:#fff;text-decoration:none}
.carshu-workday-shortcut:focus-visible{outline:3px solid #24adff;outline-offset:3px}
.erp-workspace :is(.erp-footer,.ebar) .carshu-workday-shortcut{position:static;margin:0;min-height:38px;padding:0 12px;border-radius:8px;box-shadow:none;flex:none}
@media(max-width:900px){.admin-body .carshu-workday-shortcut{position:static;margin:16px;max-width:calc(100% - 32px)}}
@media print{.carshu-workday-shortcut{display:none}}

/* Preserve the complete 3:1 logo beside comfortably sized phone menu/account targets. */
@media(max-width:768px){
 .tt-header-inner{grid-template-columns:44px minmax(0,1fr) auto}
 .tt-header-inner .tt-mobile-menu-btn{width:44px;height:44px;min-height:44px}
 .tt-header-inner .tt-header-actions a{display:inline-flex;align-items:center;min-height:44px;box-sizing:border-box}
}

/* Keep the day/week/month labels horizontal when dashboard headings need another row. */
@media(max-width:600px){
 .admin-body .sdash .card-head{flex-wrap:wrap;min-width:0}
 .admin-body .sdash .card-head>div:first-child{flex:1 1 160px;min-width:0}
 .admin-body .sdash .card-head .seg{flex:0 0 auto;max-width:100%}
 .admin-body .sdash .seg button{white-space:nowrap;min-height:38px}
}

/* Utility text may wrap without being cropped by the old fixed 30px phone strip. */
@media(max-width:768px){
 .tt-utilbar{height:auto}
 .tt-utilbar .tt-utilbar-inner{height:auto;min-height:30px;padding-block:5px;flex-wrap:wrap;gap:2px 12px}
 .tt-utilbar .tt-utilbar-left{font-size:11px;line-height:1.45;min-width:0}
 .tt-utilbar .tt-utilbar-right{flex:none;gap:10px;font-size:11px;line-height:1.45}
 .tt-utilbar .tt-utilbar-right a{white-space:nowrap}
 body .auth-page{min-height:0;margin:24px auto;padding:0 12px}
 .auth-page .auth-card{padding:24px 16px}
 .auth-page .auth-member-tab{min-width:0;min-height:48px;padding:10px 4px;font-size:13px;line-height:1.45;word-break:keep-all}
 .auth-page .auth-field{font-size:16px;min-width:0}
 .auth-page .auth-links-row{flex-wrap:wrap;gap:6px 10px}
 .auth-page .auth-links-row a{min-height:44px;display:inline-flex;align-items:center;word-break:keep-all}
 .mypage-wrap .coupon-box-grid{grid-template-columns:minmax(0,1fr)}
 .mypage-wrap .my-coupon-card,.mypage-wrap .mc-right{min-width:0;max-width:100%}
 .mypage-wrap .mc-right{overflow-wrap:anywhere}
 .mypage-wrap .mc-status-badge{position:static;display:inline-block;margin-bottom:6px}
 .mypage-wrap .my-review-item{grid-template-columns:56px minmax(0,1fr);gap:10px}
 .mypage-wrap .my-review-item .mr-thumb{width:56px;height:56px}
 .mypage-wrap .my-review-item>form{grid-column:2;justify-self:end}
 .mypage-wrap .my-review-item>div{min-width:0;overflow-wrap:anywhere}
 .mypage-wrap .order-table{display:block;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
 .mypage-wrap .order-table :is(th,td){white-space:nowrap}
 .mypage-wrap .mypage-profile-card :is(.mp-name,.mp-email){overflow-wrap:anywhere}
 .mypage-wrap :is(.btn-confirm-order,.btn-review-write,.btn-modal-submit,.btn-modal-cancel){min-height:44px;white-space:normal;word-break:keep-all}
 .ba-wrap .ba-heading{flex-wrap:wrap;gap:10px}
 .ba-wrap .ba-heading>div{min-width:0}
 .ba-wrap .ba-heading h1{word-break:keep-all}
 .ba-wrap :is(.btn,.ba-side nav a){min-height:44px}
 .ba-wrap :is(input,select),.checkout-wrap :is(input[type=text],input[type=tel],select){font-size:16px}
 .checkout-wrap :is(.ck-pay-body,.ck-cr-opt){min-width:0;overflow-wrap:anywhere}
 .checkout-wrap .checkout-submit{width:100%;white-space:normal;word-break:keep-all;line-height:1.5;padding:12px}
 .checkout-wrap .ck-cr-opt{min-height:44px}
}
@media(min-width:769px) and (max-width:1024px){
 .checkout-wrap .checkout-layout{grid-template-columns:minmax(0,1fr)}
 .checkout-wrap :is(.checkout-summary,.checkout-form){grid-column:1;grid-row:auto;position:static;width:100%}
}
/* Automatic guide movement remains active; hide only its requested visible buttons. */
.rh-discovery .rhd-promotions .rhd-promo-buttons{display:none}

/* Long product names stay readable inside catalog cards and order results. */
.tp-wrap :is(.tp-name-block,.tpc-card,.tp-card){min-width:0}
.tp-wrap :is(.tpc-model,.tp-name-block){overflow-wrap:anywhere}
.cart-wrap .cart-item-name{display:block;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.5}
.oc-wrap .oc-orderno{overflow-wrap:anywhere}
.oc-wrap .oc-item-row{gap:12px;align-items:flex-start}
.oc-wrap .oc-item-name{flex:1;min-width:0;overflow-wrap:anywhere;text-align:left}
.oc-wrap .oc-item-qty{flex:none;margin-left:0}
.oc-wrap .oc-pay-row{gap:12px;align-items:flex-start}
.oc-wrap .oc-pay-row>span{flex:none}
.oc-wrap .oc-pay-row>strong{min-width:0;overflow-wrap:anywhere;text-align:right}
.oc-wrap .oc-pay-note{overflow-wrap:anywhere}
.oc-wrap .oc-btn{display:flex;align-items:center;justify-content:center;min-width:0;min-height:48px;padding:12px;line-height:1.5;word-break:keep-all}
@media(max-width:768px){
 body:has(.tt-header){padding-bottom:calc(64px + env(safe-area-inset-bottom,0px))}
 .tt-app-tabbar{height:calc(64px + env(safe-area-inset-bottom,0px))}
 body:has(.pdh-wrap) .pdh-action-row{bottom:calc(64px + env(safe-area-inset-bottom,0px))}
 body.cbt-buybar-page,body:has(.pdh-wrap){padding-bottom:calc(140px + env(safe-area-inset-bottom,0px))}
 .pdh-wrap :is(.pdh-title,.pdh-total-row strong){min-width:0;overflow-wrap:anywhere}
 body:has(.pdh-wrap) .pd-tabs{overflow-y:hidden;align-items:stretch;gap:4px}
 body:has(.pdh-wrap) .pd-tab-btn{flex:none;min-height:44px;padding:12px;white-space:nowrap}
 .pdh-wrap .pdh-action-row :is(.pdh-buy-btn,.pdh-reserve-btn){min-width:0;min-height:46px;white-space:normal;line-height:1.3;padding:6px}
 .pdh-wrap .pdh-coupon-info b{white-space:normal;overflow-wrap:anywhere}
 .pdh-wrap .pdh-coupon-btn{min-height:44px}
 body:has(.pdh-wrap) .resv-modal-box :is(input,select,textarea){font-size:16px;min-width:0;max-width:100%}
 body:has(.pdh-wrap) .resv-modal-box :is(.btn-resv-submit,.btn-modal-cancel){min-height:44px}
 body:has(.pdh-wrap) .resv-modal-close{width:44px;height:44px;top:14px;right:14px;display:grid;place-items:center}
 .tp-wrap .tp-grid-consumer{grid-template-columns:repeat(2,minmax(0,1fr))}
 .cart-wrap .cart-item{display:grid;grid-template-columns:20px 60px minmax(0,1fr) 44px;gap:12px 8px;align-items:start}
 .cart-wrap .cart-item-check{grid-column:1;grid-row:1;align-self:center}
 .cart-wrap .cart-item-img{grid-column:2;grid-row:1;width:60px;height:60px}
 .cart-wrap .cart-item-info{grid-column:3 / 5;grid-row:1;min-width:0;max-width:100%}
 .cart-wrap .cart-item-name{display:block;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.5}
 .cart-wrap .cart-qty-form{grid-column:2 / 4;grid-row:2;min-width:0;justify-self:start}
 .cart-wrap .cart-item-qty :is(button,input){width:44px;height:44px;font-size:16px;flex:none}
 .cart-wrap .cart-item>form:not(.cart-qty-form){grid-column:4;grid-row:2;justify-self:end}
 .cart-wrap .cart-item-remove{width:44px;height:44px;border:1px solid #e2e8f0;border-radius:9px;background:#f8fafc}
 .cart-wrap .cart-item-price{grid-column:2 / 5;grid-row:3;width:auto;min-width:0;text-align:left;overflow-wrap:anywhere}
 .cart-wrap .cart-item-price .now{font-size:18px}
 .cart-wrap .cart-summary-row{gap:12px;align-items:flex-start}
 .cart-wrap .cart-summary-row>*{min-width:0;overflow-wrap:anywhere}
 .cart-wrap .cart-summary-row>span:last-child,.cart-wrap .cart-summary-row>strong{text-align:right}
 .cart-wrap .cart-checkout-btn{min-height:52px;line-height:1.5;padding:14px 12px;white-space:normal;word-break:keep-all}
 body .oc-wrap{width:calc(100% - 24px);max-width:480px;margin:24px auto;padding:28px 20px}
 .oc-wrap .oc-title{font-size:20px;word-break:keep-all}
 .oc-wrap .oc-actions{flex-direction:column}
 /* Keep help available after the transaction card without covering its total or CTA. */
 body:has(:is(.cart-wrap,.oc-wrap)) :is(#cbtFab,#kakaoFab):not(.cbt-hidden){position:relative;inset:auto;display:inline-flex;vertical-align:middle;margin:0 0 20px 16px;transform:none}
}
