body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans JP",sans-serif;background:#faf8f6;margin:0;color:#333}.wrap{max-width:900px;margin:30px auto;padding:24px;background:#fff}h1{margin-top:0}.products{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.card,.summary{border:1px solid #ddd;padding:16px;margin:10px 0;border-radius:8px}.card img{max-width:100%;height:180px;object-fit:cover}label{display:block;margin:12px 0}input,select,textarea{box-sizing:border-box;width:100%;padding:10px;margin-top:5px;border:1px solid #bbb;border-radius:5px}input[type=radio],input[type=checkbox]{width:auto}button,.button{display:inline-block;padding:12px 22px;border:0;border-radius:6px;background:#333;color:#fff;text-decoration:none;cursor:pointer}.error{color:#b00}nav{padding:15px 0;border-bottom:1px solid #ddd}@media(max-width:600px){.wrap{margin:0;padding:16px}}

.admin-head{display:flex;justify-content:space-between;align-items:center;gap:20px;border-bottom:1px solid #ddd;padding-bottom:12px}.dashboard{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:24px 0}.menu-card{border:1px solid #ddd;border-radius:10px;padding:20px;text-decoration:none;color:#333;background:#fff}.menu-card b,.menu-card span{display:block}.menu-card span{margin-top:7px;color:#777;font-size:14px}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:20px 0}.stats div{background:#f5f3f0;border-radius:10px;padding:18px;text-align:center}.stats strong{display:block;font-size:28px}.stats span{font-size:13px;color:#666}.calendar-nav{display:flex;justify-content:space-between;align-items:center;font-size:18px;margin:20px 0}.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:5px}.weekdays>div{text-align:center;font-weight:bold;padding:8px}.day{min-height:82px;border-radius:8px;overflow:hidden}.day.blank{background:transparent}.is-open{background:#eef8ef;border:1px solid #cfe4d0}.is-closed{background:#fff0f0;border:1px solid #ebcccc}.day-btn{width:100%;height:100%;min-height:82px;border:0;background:transparent;color:#333;padding:8px;display:flex;flex-direction:column;align-items:center;justify-content:space-between;cursor:pointer}.day-btn .day-number{align-self:flex-start;font-weight:bold}.day-btn .mark{font-size:28px;font-weight:bold}.day-btn small{color:#777}.legend{display:flex;gap:20px;margin:14px 0;color:#666;font-size:14px}.status{padding:3px 8px;border-radius:12px;background:#eee;font-size:12px}@media(max-width:650px){.dashboard,.stats{grid-template-columns:1fr}.calendar-grid{gap:2px}.day{min-height:60px}.day-btn{min-height:60px;padding:4px}.day-btn .mark{font-size:20px}.legend{flex-direction:column;gap:4px}}

.success{background:#eef8ef;border:1px solid #cfe4d0;padding:12px;border-radius:6px;color:#285b2c}
.product-admin-card{border:1px solid #ddd;border-radius:10px;padding:18px;margin:18px 0;background:#fff}
.product-admin-grid{display:grid;grid-template-columns:260px 1fr;gap:24px;align-items:start}
.product-image-box img{width:100%;height:220px;object-fit:cover;border-radius:8px;border:1px solid #ddd}
.no-image{height:220px;display:flex;align-items:center;justify-content:center;background:#f3f3f3;border:1px dashed #bbb;border-radius:8px;color:#888}
.remove-check,.inline-check{display:flex;gap:8px;align-items:center}
.remove-check input,.inline-check input{width:auto;margin:0}
.danger{background:#a33}
.product-image-box small{display:block;color:#777;margin-top:6px}
@media(max-width:700px){.product-admin-grid{grid-template-columns:1fr}.product-image-box img,.no-image{height:200px}}

.product-admin-grid.multi{grid-template-columns:360px 1fr}
.multi-images{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.image-slot{min-width:0}
.image-slot img,.image-slot .no-image{width:100%;height:110px;object-fit:cover;border-radius:8px}
.image-slot input[type=file]{font-size:12px}
.slot-title{font-weight:bold;font-size:13px;margin-bottom:5px}
.multi-images>small{grid-column:1/-1;color:#777}
@media(max-width:850px){.product-admin-grid.multi{grid-template-columns:1fr}.multi-images{grid-template-columns:repeat(3,1fr)}}
@media(max-width:520px){.multi-images{grid-template-columns:1fr}.image-slot img,.image-slot .no-image{height:180px}}

.deadline-box{background:#faf7f2;border:1px solid #e6ded3;padding:12px;border-radius:8px;margin:12px 0}
.deadline-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.weekday-settings{display:grid;gap:8px;margin-bottom:14px}
.weekday-row{display:grid;grid-template-columns:70px 80px 1fr 1fr 110px;gap:10px;align-items:end;border-bottom:1px solid #eee;padding:8px 0}
.weekday-row label{margin:0}
.weekday-row input[type=checkbox]{width:auto}
.detail-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px}
@media(max-width:750px){.weekday-row{grid-template-columns:1fr 1fr}.detail-grid,.deadline-row{grid-template-columns:1fr}.weekday-row strong{grid-column:1/-1}}

.shop-header{display:flex;gap:20px;align-items:center;border-bottom:1px solid #e5e1dc;padding-bottom:20px;margin-bottom:24px}
.shop-logo{width:110px;height:80px;object-fit:contain}
.shop-header h1{margin-bottom:6px}
.shop-message{margin:4px 0;color:#666}
.shop-meta{display:flex;flex-wrap:wrap;gap:14px;font-size:14px;color:#666}
.customer-calendar-wrap{max-width:720px;margin:15px 0 30px}
.customer-calendar-nav{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
.customer-calendar-nav button{padding:7px 14px}
.customer-calendar{display:grid;grid-template-columns:repeat(7,1fr);gap:5px}
.customer-weekday{text-align:center;font-weight:bold;padding:5px}
.customer-day{min-height:72px;border:1px solid #ddd;border-radius:8px;background:#fff;color:#333;display:flex;flex-direction:column;align-items:center;justify-content:center}
.customer-day span{font-weight:bold}
.customer-day small{font-size:30px;margin-top:3px}
.customer-day.available{background:#f2faf2;cursor:pointer}
.customer-day.available:hover{border-color:#777}
.customer-day.unavailable{background:#f3f3f3;color:#aaa;cursor:not-allowed}
.customer-day.selected{outline:3px solid #333}
.customer-day.blank{border:none;background:transparent}
.time-area{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 25px}
.time-button{background:#fff;color:#333;border:1px solid #bbb;padding:10px 16px}
.time-button.selected{background:#333;color:#fff}
.muted{color:#777}
.product-card{cursor:pointer}
.product-gallery{margin-bottom:12px}
.gallery-main img{width:100%;height:260px;object-fit:cover;border-radius:8px}
.gallery-thumbs{display:flex;gap:8px;margin-top:8px}
.thumb-btn{background:transparent;padding:0;border:2px solid transparent;width:70px;height:58px}
.thumb-btn.active{border-color:#333}
.thumb-btn img{width:100%;height:100%;object-fit:cover;border-radius:5px}
.deadline-note{font-size:12px;color:#777}
.company-master-grid{display:grid;grid-template-columns:280px 1fr;gap:24px}
.company-logo-preview{width:100%;max-height:180px;object-fit:contain;border:1px solid #ddd;border-radius:8px;padding:8px;box-sizing:border-box}
.logo-placeholder{height:150px;display:flex;align-items:center;justify-content:center;background:#f4f4f4;border:1px dashed #bbb;border-radius:8px;color:#888}
@media(max-width:700px){
.shop-header{align-items:flex-start}.shop-logo{width:80px;height:60px}
.customer-day{min-height:55px}.customer-day small{font-size:14px}
.gallery-main img{height:210px}
.company-master-grid{grid-template-columns:1fr}
}

.store-name-image{max-width:320px;max-height:90px;object-fit:contain;display:block;margin-bottom:8px}
.color-select-box{margin-top:12px}
.color-options{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.color-options label{display:flex;align-items:center;gap:5px;border:1px solid #ddd;border-radius:18px;padding:6px 10px;background:#fff;margin:0}
.color-options input{width:auto;margin:0}
@media(max-width:600px){.store-name-image{max-width:240px;max-height:70px}}

.product-card.selected-product{outline:3px solid #333;box-shadow:0 0 0 3px rgba(0,0,0,.05)}
.product-card input[type=radio][name="product_id"]{width:auto;margin-right:8px}


/* v7: mobile calendar optimization */
.customer-calendar-wrap{
  width:100%;
  max-width:720px;
  overflow:hidden;
}
.customer-calendar{
  width:100%;
  box-sizing:border-box;
}
.customer-calendar-nav{
  gap:8px;
}
.customer-calendar-nav strong{
  flex:1;
  text-align:center;
}
.customer-calendar-nav button{
  min-width:44px;
  min-height:44px;
}
.customer-day{
  box-sizing:border-box;
  width:100%;
  aspect-ratio:1 / 1;
  min-height:0;
  padding:4px;
}
.customer-day span{
  line-height:1.1;
}
.customer-day small{
  line-height:1;
}

@media(max-width:600px){
  .wrap{
    width:auto;
    max-width:none;
    margin:0;
    padding:14px 10px 30px;
  }

  .customer-calendar-wrap{
    margin:10px 0 22px;
  }

  .customer-calendar{
    grid-template-columns:repeat(7,minmax(0,1fr));
    gap:3px;
  }

  .customer-weekday{
    font-size:12px;
    padding:4px 0;
  }

  .customer-day{
    aspect-ratio:1 / 1.05;
    border-radius:6px;
    padding:2px;
    font-size:13px;
  }

  .customer-day span{
    font-size:13px;
  }

  .customer-day small{
    font-size:12px;
    margin-top:2px;
  }

  .customer-calendar-nav{
    margin-bottom:8px;
  }

  .customer-calendar-nav strong{
    font-size:16px;
  }

  .customer-calendar-nav button{
    padding:6px 10px;
    min-width:42px;
    min-height:40px;
  }

  .time-area{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:7px;
  }

  .time-button{
    width:100%;
    padding:10px 4px;
    font-size:14px;
  }
}

@media(max-width:380px){
  .customer-day{
    font-size:12px;
  }
  .customer-day span{
    font-size:12px;
  }
  .customer-day small{
    font-size:11px;
  }
  .time-area{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

.selected-file-name{
  margin-top:5px;
  font-size:12px;
  color:#777;
  word-break:break-all;
}
.selected-file-name.has-file{
  color:#333;
  font-weight:600;
}

.product-order-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:10px 0 18px}.product-order-row form{margin:0}.product-order-row button{margin:0}.product-order-row .danger{margin-left:auto}.field-master-table{width:100%;border-collapse:collapse;margin:10px 0 22px}.field-master-table th,.field-master-table td{border:1px solid #ddd;padding:9px;text-align:center}.field-master-table th:first-child,.field-master-table td:first-child{text-align:left}.field-master-table input[type=checkbox]{width:auto;margin:0}

.product-sort-master{margin-bottom:24px}.sort-list{display:grid;gap:8px;margin:12px 0}.sort-list label{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #ddd;padding:9px;border-radius:7px}.sort-list input{width:90px;margin:0}.customer-field-row{display:grid;grid-template-columns:1.2fr 1fr 1.5fr auto;gap:10px;align-items:end;border:1px solid #ddd;border-radius:8px;padding:12px;margin:10px 0}.customer-field-row label{margin:0}.field-flags{display:flex;gap:10px;flex-wrap:wrap;padding-bottom:8px}.field-flags label{display:flex;align-items:center;gap:4px}.field-flags input{width:auto;margin:0}.payment-master,.payment-options{display:grid;gap:9px;margin:10px 0 20px}.payment-options label{display:flex;align-items:center;gap:8px;border:1px solid #ddd;border-radius:8px;padding:12px}.payment-options input{width:auto;margin:0}.product-choice{display:flex;align-items:center;gap:8px;margin-bottom:10px}.product-choice input{width:auto;margin:0}.product-options{margin:18px 0}.notice-credit{background:#fff8dd;border:1px solid #ead98b;padding:10px;border-radius:7px}@media(max-width:800px){.customer-field-row{grid-template-columns:1fr}.sort-list label{align-items:center}.sort-list input{width:80px}}

.product-color{
  min-width:180px;
  max-width:100%;
}
@media(max-width:600px){
  .product-option-row{align-items:flex-start;flex-direction:column}
  .product-color{width:100%}
}

@media(max-width:600px){
  }

.notification-master{
  padding:14px;
  background:#f7f7f7;
  border-radius:8px;
  margin:10px 0 20px;
}
.notification-master label{
  margin-bottom:12px;
}

.product-quantity{
  min-width:90px;
  max-width:120px;
}
.product-options .product-option-row + .product-option-row{
  margin-top:10px;
}
@media(max-width:600px){
  .product-quantity{width:100%;max-width:100%}
}

.field-order-controls{display:flex;align-items:center;gap:8px;margin:0 0 10px;padding:8px;background:#f4f4f4;border-radius:6px}
.field-order-controls strong{margin-right:auto}
.field-order-controls button{padding:6px 10px}
@media(max-width:600px){.field-order-controls{flex-wrap:wrap}.field-order-controls strong{width:100%}}


/* 商品一覧：PC 2列 / スマートフォン 1列 */
@media(max-width:700px){.products{grid-template-columns:1fr}}

/* 商品管理：予約締切を縦並び */
.deadline-row.deadline-vertical{display:flex;flex-direction:column;gap:8px}
.deadline-row.deadline-vertical label{margin:0}
.deadline-inline{display:flex!important;align-items:center;gap:8px}
.deadline-inline input{width:180px;max-width:70%;margin-top:0}
.deadline-inline span{white-space:nowrap}

/* カテゴリー */
.product-category-label{display:inline-block;margin:8px 0 2px;padding:4px 9px;border-radius:999px;background:#f1ede7;font-size:12px;color:#665d54}
.category-admin-row{border:1px solid #ddd;border-radius:9px;padding:14px;margin:12px 0;background:#fff}
.category-edit-form{display:grid;grid-template-columns:minmax(240px,1fr) 120px auto;gap:12px;align-items:end}
.category-edit-form label{margin:0}
.category-order-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:10px}
.category-order-actions form{margin:0}
@media(max-width:700px){.category-edit-form{grid-template-columns:1fr}.deadline-inline input{width:100%;max-width:none}}

.product-category-filter{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 18px}
.category-filter-btn{width:auto;padding:8px 14px;border:1px solid #bbb;border-radius:999px;background:#fff;cursor:pointer}
.category-filter-btn.active{font-weight:700;border-width:2px}
@media(max-width:600px){
  .product-category-filter{gap:6px}
  .category-filter-btn{padding:7px 11px;font-size:14px}
}

/* v23 category button visibility/color */
.category-filter-btn,
.category-filter-btn:link,
.category-filter-btn:visited,
.category-filter-btn:hover,
.category-filter-btn:active,
.category-filter-btn:focus{
  color:#111 !important;
}
.category-filter-btn[hidden]{
  display:none !important;
}

/* Product copy and accessible disclosure */
.product-catch,.product-details-body{overflow-wrap:anywhere}
.product-price{display:block;font-size:1.4rem;line-height:1.5;color:#a12d48;margin:10px 0 16px;font-weight:700}
.product-details{margin:12px 0 16px;border-top:1px solid #ddd;border-bottom:1px solid #ddd;cursor:auto}
.product-details summary{padding:12px 8px;min-height:44px;box-sizing:border-box;cursor:pointer;font-weight:600;color:#333}
.product-details summary:focus-visible{outline:3px solid #a12d48;outline-offset:2px}
.product-details-body{padding:0 8px 14px;line-height:1.7}
.product-details .details-close-label{display:none}
.product-details[open] .details-open-label{display:none}
.product-details[open] .details-close-label{display:inline}

/* Shared customer header */
.shop-header.has-header-image{display:block}
.shop-header-image{display:block;width:100%;max-width:100%;height:auto;margin:0 0 16px}
.shop-header-info{min-width:0}
.company-header-preview{display:block;max-width:100%;height:auto}
@media(max-width:600px){.shop-header:not(.has-header-image){gap:12px;flex-wrap:wrap}.store-name-image{max-width:100%}.shop-header-image{margin-bottom:12px}}

/* Guidance spans all time-button columns, including mobile grids. */
.time-area > p{grid-column:1 / -1;flex-basis:100%;width:100%;min-width:0;box-sizing:border-box;white-space:normal}
.time-button{white-space:nowrap}
.customer-notice{margin:20px 0;padding:16px;background:#faf8f6;border:1px solid #e5e1dc;border-radius:8px;line-height:1.8;overflow-wrap:anywhere}

/* Fill the customer content width on desktop and mobile. */
.customer-calendar-wrap{width:100%;max-width:none;box-sizing:border-box}

/* Reservation navigation */
.reservation-nav{position:fixed;right:16px;bottom:calc(16px + env(safe-area-inset-bottom));z-index:900;display:flex;gap:8px;max-width:calc(100% - 32px)}
.reservation-nav button{box-shadow:0 2px 10px #0002;font-size:14px;padding:12px}
#toCustomer{background:#355e4b}
.reservation-nav [hidden],#mobileCallBar[hidden]{display:none!important}
body{padding-bottom:80px}
#mobileCallBar{position:fixed;top:0;left:0;right:0;z-index:1000;background:#355e4b;text-align:center;padding-top:env(safe-area-inset-top)}
#mobileCallBar a{display:block;color:white;text-decoration:none;padding:14px 8px;font-weight:700;font-size:15px}
@media(max-width:600px){body.has-mobile-call{padding-top:calc(52px + env(safe-area-inset-top))}.reservation-nav{right:10px;max-width:calc(100% - 20px)}}
@media print{.reservation-nav,#mobileCallBar{display:none!important}body{padding:0!important}}
