*{box-sizing:border-box}body{margin:0;font-family:"Noto Sans JP","Yu Gothic",sans-serif;background:#f9f3ea;color:#61364b}button{font-family:inherit;cursor:pointer}.admin-head{height:75px;background:#70354c;color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 27px;gap:18px}.brand{font-family:Georgia,serif;color:#fff;text-decoration:none;font-size:25px}.admin-head span{font-size:12px;color:#f7dec7}.admin-layout{display:grid;grid-template-columns:240px minmax(0,1fr);max-width:1240px;margin:auto;min-height:calc(100vh - 75px)}.admin-sidebar{background:#fff8ee;border-right:1px solid #e6d4c5;padding:30px 15px}.sidebar-caption{font-size:11px;color:#977574;letter-spacing:.12em;margin:0 12px 20px}.admin-sidebar>a,.admin-sidebar>.coming{display:flex;align-items:center;justify-content:space-between;gap:8px;text-decoration:none;color:#6c4650;padding:13px 12px;border-radius:10px;font-size:13px;margin-bottom:6px}.admin-sidebar .active{background:#f3e2d0;font-weight:bold;color:#79344d}.coming{opacity:.62}.coming small{font-size:10px}.admin-main{padding:40px clamp(18px,5vw,65px);max-width:880px;width:100%;margin:auto}.eyebrow{font-size:12px;letter-spacing:.15em;color:#b18152}.admin-main h1{font-size:clamp(23px,3vw,31px);margin:8px 0}.intro{color:#8a7274;font-size:14px;line-height:1.8}.admin-store-tabs{display:flex;gap:10px;margin:30px 0 16px}.admin-store-tabs button{flex:1;padding:13px;border:1px solid #d1b59c;border-radius:12px;background:#fff;color:#654054;font-weight:bold}.admin-store-tabs button.active{background:#773d59;color:#fff;border-color:#773d59}.calendar-control{display:flex;align-items:center;justify-content:center;gap:25px;margin:22px 0}.calendar-control h2{font-size:20px;margin:0;min-width:160px;text-align:center}.calendar-control button{width:38px;height:38px;font-size:28px;border:1px solid #dec5ad;background:white;border-radius:50%;color:#71364f}.admin-calendar .cal-date{min-height:72px;cursor:pointer;font-family:inherit}.admin-calendar .cal-date:hover{outline:2px solid #b48a60;outline-offset:-2px}.admin-calendar .cal-date:focus-visible{outline:3px solid #773d59}.admin-calendar .cal-date[aria-pressed="true"]{border-color:#b68e6d}.legend{display:flex;flex-wrap:wrap;justify-content:center;gap:18px;color:#8a6876;font-size:12px;margin:20px auto}.admin-actions{display:flex;flex-wrap:wrap;gap:10px;justify-content:end;margin:28px 0 8px}.admin-actions button{padding:12px 16px;border-radius:10px;border:1px solid #74384f;background:#74384f;color:white}.admin-actions button.secondary{background:#fffaf3;color:#74384f}.save-status{min-height:25px;color:#586e4b;font-size:13px}.note{font-size:12px;line-height:1.7;background:#fff1e5;padding:15px;border-radius:10px;color:#8a6c68}@media(max-width:700px){.admin-head{padding:12px;height:auto;flex-direction:column;align-items:start}.admin-layout{display:block}.admin-sidebar{display:none}.admin-main{padding:24px 12px}.admin-calendar{gap:3px}.admin-calendar .cal-date{min-height:54px}}

/* v32 repair: explicit seven-column date grid and coherent states in the admin page */
.admin-calendar{display:grid!important;grid-template-columns:repeat(7,minmax(0,1fr))!important;gap:6px;max-width:680px;width:100%;margin:0 auto;min-width:0}
.admin-calendar .cal-weekday{display:block;text-align:center;font-size:13px;font-weight:700;padding:9px 0;color:#81636b}
.admin-calendar .cal-weekday.sun{color:#ad5b6c}.admin-calendar .cal-weekday.sat{color:#63789e}
.admin-calendar .cal-date{display:flex;box-sizing:border-box;min-width:0;width:100%;height:72px;min-height:0;align-items:center;justify-content:center;flex-direction:column;gap:3px;border:1px solid #efdfca;border-radius:9px;background:#fffdf8;color:#634858;padding:5px 2px;font-size:15px}
.admin-calendar .cal-date.off-star{background:#fff1d6}.admin-calendar .cal-date.off-moon{background:#f1eafa}.admin-calendar .cal-date.off-star.off-moon{background:linear-gradient(120deg,#fff0d1 50%,#e9e2f8 50%)}
.admin-calendar .cal-day-number{font-size:15px;font-weight:600}.admin-calendar .cal-markers{min-height:19px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:14px}
.admin-calendar .mark-star{color:#b98629;font-weight:bold}.admin-calendar .mark-moon{color:#8470b8;font-weight:bold}.admin-calendar .cal-empty{min-width:0}
@media(max-width:700px){.admin-calendar{gap:3px}.admin-calendar .cal-date{height:55px;font-size:13px}.admin-calendar .cal-day-number{font-size:13px}.admin-calendar .cal-markers{font-size:11px}}

/* v33 news screen */
.news-admin-screen[hidden],.admin-main[hidden]{display:none!important}
.news-editor{display:grid;gap:14px;margin-top:24px}
.news-edit-card{background:#fffaf4;border:1px solid #e5c9ac;border-radius:14px;padding:18px;display:grid;gap:12px}
.news-edit-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;color:#74334b}
.news-edit-card label{display:grid;gap:6px;font-size:13px;color:#794e5d}
.news-edit-card input:not([type=checkbox]),.news-edit-card textarea{width:100%;box-sizing:border-box;font:inherit;padding:9px 11px;border:1px solid #dcbda1;border-radius:7px;background:#fff;color:#573144}
.news-edit-card textarea{min-height:65px;resize:vertical}.news-edit-head label{display:flex;align-items:center;gap:6px}
.remove-news{justify-self:end;background:transparent;border:1px solid #c9aa9b;border-radius:7px;color:#843f4f;padding:7px 12px;cursor:pointer}
.new-news-btn{margin-top:17px;border:1px solid #cfa577;color:#75354b;border-radius:9px;background:#fffaf2;padding:11px 17px;cursor:pointer}

/* v38: product manager and site theme cards */
.product-edit-body{display:grid;grid-template-columns:145px minmax(0,1fr);gap:18px;align-items:start}
.admin-product-thumb{width:145px;height:130px;object-fit:contain;border-radius:11px;background:#f0e3d5;border:1px solid #ead1b3}
.product-fields{display:grid;gap:10px}
.product-fields label{display:grid;gap:5px;font-size:13px;color:#714151}
.product-fields input,.product-fields textarea{width:100%;border:1px solid #dcbda1;border-radius:8px;padding:9px;font:inherit;background:#fff}
.product-fields textarea{min-height:75px}
.product-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.product-actions button{background:#fff5e9;border:1px solid #d3b291;border-radius:8px;padding:9px 12px;color:#74354b}
.style-choices{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin:20px 0 30px}
.style-choice{background:#fffaf5;border:2px solid #e5ccb1;border-radius:12px;padding:12px 6px;color:#6e3950;display:flex;align-items:center;flex-direction:column;gap:9px;font-size:12px}
.style-choice[aria-pressed=true]{background:#fff0da;border-color:#8b4b5b;box-shadow:0 0 0 2px #eed6bb}
.style-choice img{width:78px;height:78px}
.admin-setting-title{font-size:20px;margin:25px 0 8px;color:#743448}
.setting-line{display:flex;justify-content:space-between;align-items:center;margin:14px 0}.setting-line.subtle{font-size:11px;color:#96717b;margin-top:0}
.range-control{width:100%;accent-color:#793e57;cursor:pointer}
.settings-select{width:100%;background:#fffaf4;border:1px solid #d2b495;border-radius:9px;padding:11px;margin:8px 0 18px}
.setting-label{display:block;margin-top:15px}.check-line{display:block;margin:13px 0}
@media(max-width:700px){.admin-sidebar{display:flex;flex-wrap:wrap;padding:8px;gap:4px}.admin-sidebar>.sidebar-caption{display:none}.admin-sidebar>a{margin:0;padding:9px;font-size:12px}.product-edit-body{grid-template-columns:1fr}.style-choices{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* v39 - PIN lock, real image design selection */
[hidden],#protectedAdmin[hidden],#pinGate[hidden]{display:none!important}
.pin-gate{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 50% 15%,#fff5e1,#f7ece6 70%)}
.pin-card{width:min(100%,430px);padding:36px 34px 24px;background:#fffaf3;border:1px solid #d9b88b;border-radius:22px;box-shadow:0 15px 35px #6a324324;text-align:center}
.pin-eyebrow{font-size:11px;letter-spacing:.19em;color:#aa7943}
.pin-star{font-size:30px;color:#bf9035;margin:10px 0}
.pin-card h1{font-size:26px;margin:8px 0 12px;color:#763849}.pin-card>p{font-size:13px;color:#9c7477;line-height:1.7}
#pinForm{display:grid;gap:11px;margin:23px auto;text-align:left}
#pinForm label{font-size:13px;color:#714354}
#pinEntry{font:inherit;font-size:25px;text-align:center;letter-spacing:.4em;border:1px solid #d6ae88;border-radius:11px;background:#fff;padding:12px;color:#633448;max-width:100%;width:100%}
#pinEntry:focus-visible{outline:3px solid #c8a46c;outline-offset:2px}
#pinForm button{background:#763849;color:#fff;border:0;border-radius:10px;padding:13px;font-size:15px;font-weight:600}
.pin-error{min-height:22px;color:#a63f43!important;font-weight:bold}
.pin-card>a{display:inline-block;color:#773c50;font-size:13px;margin:4px auto 14px}
.pin-card .pin-demo-note{font-size:11px;color:#aa8280;border-top:1px solid #ecd9ca;padding-top:13px}
.admin-logout{background:transparent;border:1px solid #ead1d2;color:#fff;border-radius:7px;padding:7px 10px;font-size:12px;margin-left:10px}
.style-choices{grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}
.style-choice img{width:100%;height:110px;object-fit:contain}
.style-choice{min-width:0;padding:12px 5px}
@media(max-width:900px){.style-choices{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:560px){.style-choices{grid-template-columns:repeat(2,minmax(0,1fr))}.style-choice img{height:100px}.pin-card{padding:22px 18px}}


/* v42: align administrator calendar buttons with the month title. */
.calendar-control{display:grid;grid-template-columns:38px minmax(145px,auto) 38px;width:max-content;max-width:100%;align-items:center;justify-content:center;gap:16px;margin:22px auto}
.calendar-control h2{min-width:0;width:100%;margin:0;line-height:1.4;text-align:center}
.calendar-control button{display:grid;place-items:center;box-sizing:border-box;padding:0;margin:0;width:38px;height:38px;min-width:38px;min-height:38px}
.calendar-control button svg{width:17px;height:17px;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;fill:none;display:block}
@media(max-width:420px){.calendar-control{grid-template-columns:36px minmax(130px,auto) 36px;gap:9px}.calendar-control button{width:36px;height:36px;min-width:36px;min-height:36px}}

/* v43: calendar-admin key, action buttons and helper text remain readable at all widths. */
#calendar .legend{
 display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;
 width:100%;max-width:680px;margin:18px auto 12px;
}
#calendar .legend .legend-item{
 min-width:0;display:flex;justify-content:center;align-items:center;gap:7px;
 background:#fffaf4;border:1px solid #e8d3bd;border-radius:9px;
 padding:11px 7px;color:#755665;white-space:normal;
}
#calendar .legend .legend-symbol{font-size:17px;font-weight:700;line-height:1;flex:none}
#calendar .legend .legend-star{color:#b8852b}
#calendar .legend .legend-moon{color:#8472b4}
#calendar .legend .legend-both{color:#966583;font-size:14px;white-space:nowrap}
#calendar .legend .legend-label{font-size:12px;line-height:1.4;font-weight:600;overflow-wrap:normal;word-break:keep-all}
#calendar .admin-actions{justify-content:center;margin:18px auto 12px;gap:10px}
#calendar .admin-actions button{min-height:44px;white-space:normal;line-height:1.4;font-size:13px}
#calendar .save-status{max-width:680px;margin:0 auto 14px;min-height:0;line-height:1.7;font-size:13px;text-align:center}
#calendar .note{max-width:680px;margin:0 auto;line-height:1.8;font-size:13px;overflow-wrap:break-word}
@media(max-width:630px){
 #calendar .legend{gap:5px}
 #calendar .legend .legend-item{flex-direction:column;gap:4px;padding:9px 3px;text-align:center}
 #calendar .legend .legend-label{font-size:11px}
 #calendar .admin-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 #calendar .admin-actions button{width:100%;padding:10px 6px;font-size:12px}
}
@media(max-width:350px){#calendar .legend .legend-label{font-size:10px}}


/* v45: robust two-column admin shell. The sidebar and a single stage are
   the only grid children. Editing panels never become tiny grid columns. */
.admin-stage{min-width:0;width:100%;max-width:100%;}
.admin-stage>.admin-main{min-width:0;max-width:880px;width:100%;margin-inline:auto;}
.admin-stage>.admin-main[hidden]{display:none!important;}
#productsAdmin .news-editor,#productsAdmin .product-edit-card,#productsAdmin .product-fields{min-width:0;}
#productsAdmin .product-edit-card{width:100%;}
#productsAdmin .product-edit-body>*{min-width:0;}
#productsAdmin .product-fields input:not([type=checkbox]),
#productsAdmin .product-fields textarea{display:block;width:100%;min-width:0;max-width:100%;}
#productsAdmin .product-fields input[type=file]{min-width:0;}
@media(max-width:700px){
 .admin-stage{width:100%;}
 .admin-stage>.admin-main{padding:24px 14px;}
 #productsAdmin .product-edit-body{grid-template-columns:minmax(0,1fr);gap:12px;}
 #productsAdmin .product-edit-card{padding:14px;}
 #productsAdmin .admin-product-thumb{width:min(100%,180px);height:145px;}
 #productsAdmin .product-fields label{overflow-wrap:anywhere;}
}
