:root {
  --bg:#f2f5f8;
  --panel:#fff;
  --text:#17212b;
  --muted:#6f7b87;
  --line:#dfe5ea;
  --soft:#f7f9fb;
  --primary:#0f6fff;
  --primary-dark:#0957cb;
  --nav:#0f172a;
  --nav2:#172033;
  --danger:#d94848;
  --danger-soft:#fff0f0;
  --success:#2f9b55;
  --success-soft:#ebf8ef;
  --warning:#d99016;
  --warning-soft:#fff6df;
  --info:#367ec4;
  --info-soft:#eaf4ff;
  --purple:#7355c5;
  --purple-soft:#f1edff;
  --shadow:0 10px 30px rgba(22,35,48,.06);
  --radius:14px;
  --sidebar:224px;
  --timeline-slot:44px;
  --timeline-cast:174px;
}
*{box-sizing:border-box}
html{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;background:var(--bg);color:var(--text)}
body{margin:0;min-width:320px;background:var(--bg);font-size:14px}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
button:disabled{opacity:.5;cursor:not-allowed}
input,select,textarea{outline:none}
input:focus,select:focus,textarea:focus{border-color:#8ab6ff!important;box-shadow:0 0 0 3px rgba(15,111,255,.10)}
[hidden]{display:none!important}
.app-shell{min-height:100dvh}
.sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar);background:var(--nav);color:#fff;z-index:70;display:flex;flex-direction:column;border-right:1px solid rgba(255,255,255,.05)}
.brand{height:72px;padding:14px 16px;display:flex;align-items:center;gap:11px;border-bottom:1px solid rgba(255,255,255,.08)}
.brand-mark{width:38px;height:38px;border-radius:11px;background:linear-gradient(135deg,#2d8cff,#0f6fff);display:grid;place-items:center;font-weight:700;font-size:20px;box-shadow:0 7px 18px rgba(15,111,255,.27)}
.brand-copy{display:grid;gap:2px}.brand-copy strong{font-size:13px}.brand-copy span{font-size:9px;color:#91a0b4;letter-spacing:.05em;text-transform:uppercase}
.side-nav{padding:9px 8px 14px;overflow-y:auto;flex:1;scrollbar-width:thin}
.nav-group-label{color:#657287;font-size:9px;font-weight:700;letter-spacing:.13em;padding:14px 10px 6px}
.nav-item{width:100%;border:0;background:transparent;color:#aab5c4;min-height:42px;border-radius:9px;padding:0 10px;display:grid;grid-template-columns:1fr auto;align-items:center;gap:7px;text-align:left;font-size:12px;font-weight:700;margin:1px 0}
.nav-item:hover{background:rgba(255,255,255,.055);color:#fff}.nav-item.active{background:#263247;color:#fff}.nav-count{min-width:20px;height:20px;border-radius:10px;background:#33506f;color:#d7e7ff;display:grid;place-items:center;font-size:9px}.nav-count.warn{background:#784f18;color:#ffe4ac}
.sidebar-foot{padding:10px;border-top:1px solid rgba(255,255,255,.08)}
.shop-status{display:flex;gap:9px;align-items:center;background:rgba(255,255,255,.04);border-radius:10px;padding:9px}.shop-status .pulse{width:9px;height:9px;background:#47ca75;border-radius:50%;box-shadow:0 0 0 4px rgba(71,202,117,.12)}.shop-status div{display:grid;gap:1px}.shop-status strong{font-size:11px}.shop-status small{font-size:9px;color:#8491a4}
.main-area{min-height:100dvh;margin-left:var(--sidebar)}
.topbar{position:sticky;top:0;z-index:55;min-height:72px;padding:10px 22px;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:14px}
.topbar-title{display:flex;align-items:center;gap:10px}.topbar h1{margin:0;font-size:20px;letter-spacing:-.02em}.topbar p{margin:3px 0 0;color:var(--muted);font-size:11px}.top-actions{display:flex;align-items:center;gap:8px}.mobile-menu-button{display:none}
.page-body{padding:18px 22px 34px;max-width:1840px;margin:0 auto}.view{display:none}.view.active{display:block}
.btn{border:1px solid transparent;border-radius:10px;min-height:42px;padding:0 14px;font-weight:700;font-size:12px;display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap}.btn-primary{background:var(--primary);color:#fff}.btn-primary:hover{background:var(--primary-dark)}.btn-light{background:#fff;border-color:var(--line);color:#33404d}.btn-light:hover{background:#f9fafb}.btn-danger{background:#fff;border-color:#efc2c2;color:#b93636}.btn-white{background:#fff;color:#17212b}.btn-dark{background:#0f172a;color:#fff}.text-btn{border:0;background:transparent;color:var(--primary);font-size:11px;font-weight:700;padding:5px}.icon-btn{position:relative;border:1px solid var(--line);background:#fff;width:42px;height:42px;border-radius:10px;color:#ef9a21;font-size:12px}.icon-btn span{position:absolute;right:-3px;top:-4px;min-width:18px;height:18px;border-radius:9px;background:#e34848;color:#fff;display:grid;place-items:center;font-size:9px;font-weight:700}.step-btn{width:42px;flex:0 0 42px;height:42px;border:1px solid var(--line);background:#fff;border-radius:10px;font-size:23px;line-height:1}.small-btn{min-height:30px;padding:0 10px;border:1px solid var(--line);background:#fff;border-radius:7px;font-size:10px;font-weight:700}.small-btn.primary{color:var(--primary);border-color:#bcd4ff;background:#f6f9ff}.small-btn.danger{color:#bd4141;border-color:#f0cccc;background:#fff8f8}
.hero-strip{background:linear-gradient(115deg,#0e1c32,#142b49 60%,#0f6fff);color:#fff;border-radius:18px;padding:20px 22px;margin-bottom:14px;display:flex;justify-content:space-between;align-items:center;gap:18px;box-shadow:0 12px 28px rgba(16,34,59,.12)}.eyebrow{font-size:9px;font-weight:700;letter-spacing:.16em;color:#8fbbff}.hero-strip h2{font-size:24px;margin:4px 0}.hero-strip p{margin:0;color:#bdcbe0;font-size:11px}.hero-actions{display:flex;gap:8px}
.stats-grid{display:grid;gap:10px;margin-bottom:14px}.stats-grid.six{grid-template-columns:repeat(6,1fr)}.stats-grid.five{grid-template-columns:repeat(5,1fr)}.stats-grid.four{grid-template-columns:repeat(4,1fr)}.stats-grid.three{grid-template-columns:repeat(3,1fr)}.stat-card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:14px 15px;box-shadow:0 2px 10px rgba(20,33,45,.025);min-width:0}.stat-label{display:block;color:var(--muted);font-size:10px;font-weight:700;margin-bottom:6px}.stat-card strong{font-size:21px;line-height:1.1;letter-spacing:-.025em}.stat-card small{color:var(--muted);font-size:9px;margin-left:4px}.compact-stats .stat-card{padding:12px 14px}.compact-stats .stat-card strong{font-size:19px}
.content-grid{display:grid;gap:14px;margin-bottom:14px}.home-main-grid{grid-template-columns:1.45fr .85fr}.three-col{grid-template-columns:repeat(3,1fr)}.sales-grid{grid-template-columns:.9fr 1.1fr}.panel{background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);min-width:0}.flush-panel{overflow:hidden}.panel-head{padding:14px 15px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:10px}.panel-head h2,.section-title{margin:0;font-size:14px}.panel-head p,.section-sub{margin:3px 0 0;color:var(--muted);font-size:10px}.section-sub{margin-top:4px}.section-title{font-size:15px}
.toolbar{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:13px}.wrap-toolbar{flex-wrap:wrap}.toolbar-actions{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap}.grow{flex:1;min-width:240px}.search-box{min-height:42px;background:#fff;border:1px solid var(--line);border-radius:10px;display:flex;align-items:center;padding:0 11px;gap:7px}.search-box span{color:#8d97a2}.search-box input{border:0;background:transparent;width:100%;min-width:0;font-size:13px}.control-select{height:42px;border:1px solid var(--line);background:#fff;border-radius:10px;padding:0 31px 0 10px;font-size:12px;font-weight:700}.field{display:grid;gap:5px;min-width:0}.field>span{font-size:10px;color:#596674;font-weight:700}.field input,.field select,.field textarea{width:100%;min-height:42px;border:1px solid var(--line);background:#fff;border-radius:9px;padding:9px 10px;font-size:13px}.field textarea{min-height:90px;resize:vertical}.compact-field{min-width:150px}.picker-shell{cursor:pointer}.picker-shell input{cursor:pointer}.suffix-input{position:relative}.suffix-input input{padding-right:32px}.suffix-input span{position:absolute;right:10px;top:50%;transform:translateY(-50%);font-weight:700;color:#77838f}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:15px}.form-grid .full{grid-column:1/-1}.form-actions{display:flex;justify-content:flex-end;gap:8px}.form-actions.full{grid-column:1/-1}
.table-wrap{width:100%;overflow:auto}.table-wrap table{width:100%;border-collapse:collapse;min-width:850px}.table-wrap th{position:sticky;top:0;background:#f8fafb;z-index:2;color:#66727d;font-size:10px;text-align:left;font-weight:700;padding:11px 12px;border-bottom:1px solid var(--line);white-space:nowrap}.table-wrap td{font-size:11px;padding:11px 12px;border-bottom:1px solid #edf1f4;vertical-align:middle}.table-wrap tbody tr:hover{background:#fbfcfd}.table-wrap tbody tr:last-child td{border-bottom:0}.row-actions{display:flex;gap:5px;justify-content:flex-end}.empty-cell{text-align:center!important;color:var(--muted);padding:30px!important}.always-table table{min-width:520px}.desktop-table{}
.mobile-cards{display:none}.badge{display:inline-flex;align-items:center;justify-content:center;min-height:24px;padding:0 8px;border-radius:999px;font-size:9px;font-weight:700;white-space:nowrap}.badge.reserved{color:#23609c;background:var(--info-soft)}.badge.serving,.badge.done{color:#24713e;background:var(--success-soft)}.badge.moving{color:#6748aa;background:var(--purple-soft)}.badge.pending{color:#9a6212;background:var(--warning-soft)}.badge.cancel,.badge.ng{color:#af3f3f;background:var(--danger-soft)}.badge.neutral{color:#5d6874;background:#eef1f4}.badge.waiting{color:#a0423d;background:#fff0ef}.badge.active{color:#24713e;background:var(--success-soft)}
.stack-list{padding:7px 14px 12px}.stack-item{padding:10px 0;border-bottom:1px solid #edf1f4;display:flex;align-items:center;justify-content:space-between;gap:10px}.stack-item:last-child{border-bottom:0}.stack-main{min-width:0}.stack-title{font-size:12px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stack-sub{margin-top:3px;color:var(--muted);font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stack-side{text-align:right;flex:0 0 auto}.stack-side strong{display:block;font-size:11px}.stack-side small{display:block;color:var(--muted);font-size:9px;margin-top:2px}.summary-block{padding:16px}.summary-row{display:flex;justify-content:space-between;gap:10px;padding:9px 0;border-bottom:1px solid #edf1f4}.summary-row:last-child{border-bottom:0}.summary-row span{color:var(--muted);font-size:10px}.summary-row strong{font-size:13px}
.live-board{padding:8px}.live-row{display:grid;grid-template-columns:minmax(100px,1fr) 86px minmax(160px,1.3fr) 86px;align-items:center;gap:8px;padding:9px;border-bottom:1px solid #edf1f4;border-radius:9px}.live-row:last-child{border-bottom:0}.live-row:hover{background:#f9fbfd}.live-cast strong{display:block;font-size:12px}.live-cast small{color:var(--muted);font-size:9px}.live-next{font-size:10px;color:#4c5965;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.live-sales{text-align:right;font-weight:700;font-size:11px}
.schedule-toolbar{align-items:flex-end}.date-stepper,.period-switch{display:flex;align-items:flex-end;gap:7px}.schedule-panel{overflow:hidden}.schedule-headline{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-bottom:1px solid var(--line);gap:10px}.schedule-legend{display:flex;flex-wrap:wrap;gap:11px;color:#5b6672;font-size:9px;font-weight:700}.schedule-legend span{display:flex;align-items:center;gap:5px}.legend-box{width:12px;height:12px;border-radius:3px;border:1px solid rgba(0,0,0,.08)}.legend-box.available{background:#e05b54}.legend-box.reserved{background:#377fba}.legend-box.moving{background:#7a60c1}.legend-box.serving{background:#3da158}.legend-box.done{background:#61b963}.legend-box.break{background:#edae44}.schedule-count{font-size:10px;color:var(--muted);font-weight:700}.timeline-scroll{overflow:auto;max-height:calc(100dvh - 246px);min-height:420px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.timeline-table{display:grid;grid-template-columns:var(--timeline-cast) calc(var(--timeline-slot) * 48);width:max-content;min-width:100%}.timeline-corner{position:sticky;left:0;top:0;z-index:9;background:#f8fafb;border-right:1px solid var(--line);border-bottom:1px solid var(--line);min-height:48px;padding:0 11px;display:flex;align-items:center;font-size:10px;font-weight:700}.timeline-hours{position:sticky;top:0;z-index:8;display:grid;grid-template-columns:repeat(24,calc(var(--timeline-slot) * 2));height:48px;background:#f8fafb;border-bottom:1px solid var(--line)}.timeline-hour{display:flex;align-items:center;justify-content:center;border-right:1px solid #dfe5ea;font-size:10px;font-weight:700}.timeline-cast{position:sticky;left:0;z-index:6;background:#fff;border-right:1px solid var(--line);border-bottom:1px solid var(--line);min-height:96px;padding:10px;display:grid;align-content:center;gap:4px}.timeline-cast strong{font-size:12px}.timeline-cast small{font-size:9px;color:var(--muted)}.timeline-cast .cast-actions{position:absolute;right:6px;top:6px;display:flex;gap:3px}.timeline-track{position:relative;display:grid;grid-template-columns:repeat(48,var(--timeline-slot));grid-template-rows:96px;min-height:96px;border-bottom:1px solid var(--line)}.timeline-slot{grid-row:1;border-right:1px solid #e2e7eb;display:flex;align-items:center;justify-content:center;color:#fff;font-size:9px;font-weight:700}.timeline-slot:nth-child(2n){border-right-color:#cfd7de}.timeline-slot.off{background:#fff;color:transparent}.timeline-slot.available{background:#df5b54;box-shadow:inset 0 6px 0 #fff,inset 0 -6px 0 #fff}.timeline-booking{grid-row:1;grid-column:var(--col)/span var(--span);z-index:3;margin:6px 1px 21px;border:1px solid rgba(0,0,0,.08);border-radius:6px;color:#fff;padding:6px 4px;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;text-align:center;box-shadow:0 2px 7px rgba(0,0,0,.08)}.timeline-booking.reserved{background:#377fba}.timeline-booking.moving{background:#765bbc}.timeline-booking.serving{background:#3c9e57}.timeline-booking.done{background:#5eb761}.timeline-booking strong{font-size:10px}.timeline-booking small{font-size:8px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.timeline-break{grid-row:1;grid-column:var(--col)/span var(--span);z-index:2;margin:30px 1px 6px;border-radius:5px;background:#edac42;color:#fff;display:grid;place-items:center;font-size:8px;font-weight:700}.timeline-now{position:absolute;z-index:5;top:0;bottom:0;left:var(--now-left,0%);width:2px;background:#e6232d;pointer-events:none}.timeline-now:before{content:"現在";position:absolute;top:2px;left:4px;background:#e6232d;color:#fff;padding:3px 4px;border-radius:3px;font-size:7px;font-weight:700;white-space:nowrap}.timeline-empty{grid-column:1/-1;padding:46px;text-align:center;color:var(--muted)}.timeline-help{display:none;margin:0;padding:8px 10px;border-top:1px solid var(--line);background:#fafbfc;color:var(--muted);font-size:9px}
.dispatch-layout{display:grid;grid-template-columns:1.35fr .65fr;gap:14px}.dispatch-queue,.driver-grid{padding:10px}.dispatch-card{border:1px solid var(--line);border-radius:11px;padding:11px;margin-bottom:8px;background:#fff}.dispatch-card:last-child{margin-bottom:0}.dispatch-top{display:flex;justify-content:space-between;gap:10px;margin-bottom:8px}.dispatch-title{font-size:12px;font-weight:700}.dispatch-meta{font-size:9px;color:var(--muted);margin-top:3px}.dispatch-actions{display:grid;grid-template-columns:1fr auto;gap:7px}.dispatch-actions select{height:38px;border:1px solid var(--line);border-radius:8px;padding:0 8px;background:#fff;font-size:11px}.driver-card{border:1px solid var(--line);border-radius:11px;padding:11px;margin-bottom:8px}.driver-card-head{display:flex;justify-content:space-between;gap:10px}.driver-card strong{font-size:12px}.driver-card p{font-size:9px;color:var(--muted);margin:5px 0 0}.driver-card-actions{display:flex;gap:5px;margin-top:8px}
.sales-control-bar{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:13px}.segmented{display:inline-flex;background:#e8edf2;border:1px solid var(--line);padding:3px;border-radius:10px}.segment{border:0;background:transparent;min-height:36px;min-width:82px;border-radius:7px;font-size:11px;font-weight:700;color:#697580}.segment.active{background:#fff;color:#17212b;box-shadow:0 1px 5px rgba(0,0,0,.07)}.date-link{border:0;background:transparent;color:var(--primary);font-weight:700;text-decoration:underline;text-underline-offset:3px;padding:0}
.task-board{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.task-card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:13px;box-shadow:var(--shadow)}.task-card.done{opacity:.62}.task-head{display:flex;justify-content:space-between;gap:8px}.task-title{font-weight:700;font-size:12px}.task-card p{color:var(--muted);font-size:10px;line-height:1.55;margin:7px 0 10px}.task-foot{display:flex;align-items:center;justify-content:space-between;gap:7px}.task-due{font-size:9px;color:var(--muted)}
.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.setting-list{padding:3px 15px 13px}.switch-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid #edf1f4;position:relative}.switch-row:last-child{border-bottom:0}.switch-row div{display:grid;gap:3px}.switch-row strong{font-size:11px}.switch-row span{font-size:9px;color:var(--muted)}.switch-row input{position:absolute;opacity:0;pointer-events:none}.switch-row i{width:42px;height:24px;border-radius:12px;background:#cfd7de;position:relative;transition:.2s;flex:0 0 auto}.switch-row i:after{content:"";position:absolute;width:18px;height:18px;border-radius:50%;background:#fff;left:3px;top:3px;box-shadow:0 1px 4px rgba(0,0,0,.2);transition:.2s}.switch-row input:checked+i{background:var(--primary)}.switch-row input:checked+i:after{transform:translateX(18px)}.data-actions{padding:15px;display:grid;gap:8px}.file-label{cursor:pointer}.file-label input{display:none}.note-box{margin:0 15px 15px;background:#f7f9fb;border:1px solid #e7ebef;border-radius:9px;padding:10px;color:var(--muted);font-size:9px;line-height:1.5}.trash-list{padding:8px 15px 15px}.trash-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 0;border-bottom:1px solid #edf1f4}.trash-item:last-child{border-bottom:0}.trash-item strong{font-size:10px}.trash-item small{display:block;color:var(--muted);font-size:8px;margin-top:2px}
.modal-backdrop{position:fixed;inset:0;background:rgba(9,17,29,.48);z-index:100;display:flex;align-items:center;justify-content:center;padding:20px}.modal{width:min(720px,100%);max-height:min(88dvh,900px);background:#fff;border-radius:16px;box-shadow:0 30px 80px rgba(0,0,0,.25);display:flex;flex-direction:column;overflow:hidden}.modal-head{padding:15px 16px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.modal-head h2{font-size:16px;margin:0}.modal-head p{font-size:9px;color:var(--muted);margin:3px 0 0}.icon-close{border:0;background:#eff2f5;width:32px;height:32px;border-radius:8px;font-size:20px;line-height:1}.modal-body{padding:15px;overflow-y:auto}.modal-foot{padding:12px 15px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:8px}.modal-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:11px}.modal-form-grid .full{grid-column:1/-1}.modal-section-title{grid-column:1/-1;font-size:10px;font-weight:700;color:#4e5a66;padding-top:5px;border-top:1px solid #edf1f4;margin-top:2px}.danger-zone{grid-column:1/-1;display:flex;justify-content:flex-end;padding-top:8px}.inline-note{grid-column:1/-1;background:#fff7e5;border:1px solid #f5dfaa;border-radius:8px;padding:8px 10px;color:#8c661d;font-size:9px;line-height:1.5}.conflict-note{grid-column:1/-1;background:#fff0f0;border:1px solid #f2c8c8;border-radius:8px;padding:8px 10px;color:#ad3b3b;font-size:9px;font-weight:700}
.toast-wrap{position:fixed;right:18px;bottom:18px;z-index:130;display:grid;gap:7px}.toast{background:#182130;color:#fff;border-radius:10px;padding:10px 12px;min-width:220px;max-width:320px;box-shadow:0 12px 32px rgba(0,0,0,.2);font-size:10px;font-weight:700;animation:toastIn .18s ease}@keyframes toastIn{from{transform:translateY(8px);opacity:0}to{transform:none;opacity:1}}
.notification-drawer{position:fixed;right:0;top:0;bottom:0;width:min(390px,92vw);background:#fff;z-index:111;box-shadow:-20px 0 50px rgba(0,0,0,.15);display:flex;flex-direction:column}.drawer-shade{position:fixed;inset:0;background:rgba(5,12,22,.28);z-index:110}.drawer-head{padding:16px;border-bottom:1px solid var(--line);display:flex;align-items:flex-start;justify-content:space-between}.drawer-head strong{font-size:14px}.drawer-head span{display:block;color:var(--muted);font-size:9px;margin-top:3px}.drawer-list{padding:8px 14px;overflow-y:auto}.alert-item{display:flex;gap:9px;padding:11px 0;border-bottom:1px solid #edf1f4}.alert-dot{width:9px;height:9px;border-radius:50%;background:#e69b28;margin-top:4px;flex:0 0 auto}.alert-dot.danger{background:#db4c4c}.alert-dot.info{background:#3e82c8}.alert-item strong{display:block;font-size:10px}.alert-item span{display:block;color:var(--muted);font-size:9px;line-height:1.5;margin-top:2px}
.bottom-nav,.sheet-backdrop{display:none}
@media(max-width:1200px){.stats-grid.six{grid-template-columns:repeat(3,1fr)}.stats-grid.five{grid-template-columns:repeat(3,1fr)}.home-main-grid,.dispatch-layout{grid-template-columns:1fr}.three-col{grid-template-columns:1fr 1fr}.sales-grid{grid-template-columns:1fr}.task-board{grid-template-columns:1fr 1fr}}
@media(max-width:900px){:root{--sidebar:194px}.page-body{padding:15px}.stats-grid.four{grid-template-columns:repeat(2,1fr)}.settings-grid{grid-template-columns:1fr}}
@media(max-width:760px){
  :root{--timeline-slot:40px;--timeline-cast:110px}
  body{padding-bottom:calc(66px + env(safe-area-inset-bottom))}.sidebar{display:none}.main-area{margin-left:0}.topbar{min-height:62px;padding:8px 12px}.topbar h1{font-size:17px}.topbar p{font-size:9px}.mobile-menu-button{display:grid;place-items:center;width:36px;height:36px;border:1px solid var(--line);background:#fff;border-radius:9px}.hide-mobile{display:none!important}.page-body{padding:11px 12px 18px}.top-actions{gap:6px}.top-actions .btn-primary{min-height:40px;padding:0 11px}.icon-btn{width:40px;height:40px}.hero-strip{padding:16px;border-radius:14px;display:block}.hero-strip h2{font-size:20px}.hero-actions{margin-top:13px}.hero-actions .btn{flex:1}.stats-grid.six,.stats-grid.five,.stats-grid.four,.stats-grid.three{grid-template-columns:1fr 1fr;gap:8px}.stat-card{padding:11px}.stat-card strong{font-size:18px}.home-main-grid,.three-col,.dispatch-layout,.task-board{grid-template-columns:1fr}.toolbar{align-items:stretch;flex-direction:column}.toolbar-actions{width:100%;display:grid;grid-template-columns:1fr 1fr}.toolbar-actions>*{min-width:0;width:100%}.toolbar-actions .btn:only-child{grid-column:1/-1}.grow{width:100%;min-width:0}.search-box{width:100%}.control-select{width:100%}.desktop-table{display:none}.mobile-cards{display:grid;gap:8px;padding:10px}.mobile-card{border:1px solid var(--line);border-radius:11px;background:#fff;padding:11px}.mobile-card-top{display:flex;justify-content:space-between;gap:10px;margin-bottom:9px}.mobile-card-title{font-size:12px;font-weight:700}.mobile-card-sub{font-size:9px;color:var(--muted);margin-top:3px}.mobile-card-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.mobile-data span{display:block;font-size:8px;color:var(--muted);font-weight:700;margin-bottom:2px}.mobile-data strong{display:block;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-card-actions{display:flex;gap:6px;margin-top:10px}.mobile-card-actions .small-btn{flex:1}.panel-head{padding:12px}.live-row{grid-template-columns:1fr auto;gap:6px}.live-next{grid-column:1/-1}.live-sales{display:none}.sales-control-bar{align-items:stretch;flex-direction:column}.segmented{width:100%}.segment{flex:1}.period-switch{width:100%}.period-switch .compact-field{flex:1;min-width:0}.schedule-toolbar .date-stepper{width:100%}.schedule-toolbar .date-stepper .compact-field{flex:1;min-width:0}.schedule-toolbar .toolbar-actions{grid-template-columns:1fr 1fr}.schedule-panel{margin:0 -12px;border-radius:0;border-left:0;border-right:0}.schedule-headline{align-items:flex-start;flex-direction:column}.timeline-scroll{max-height:calc(100dvh - 270px);min-height:430px}.timeline-cast,.timeline-track{min-height:90px}.timeline-track{grid-template-rows:90px}.timeline-cast{padding:8px}.timeline-cast strong{font-size:11px}.timeline-cast small{font-size:8px}.timeline-booking{margin:5px 1px 19px}.timeline-help{display:block}.dispatch-actions{grid-template-columns:1fr}.modal-backdrop{padding:0;align-items:flex-end}.modal{width:100%;max-height:94dvh;border-radius:17px 17px 0 0}.modal-form-grid{grid-template-columns:1fr}.modal-form-grid .full,.modal-section-title,.inline-note,.conflict-note,.danger-zone{grid-column:auto}.modal-foot .btn{flex:1}.form-grid{grid-template-columns:1fr}.form-grid .full{grid-column:auto}.form-actions.full{grid-column:auto}.bottom-nav{position:fixed;display:grid;grid-template-columns:repeat(5,1fr);left:0;right:0;bottom:0;z-index:75;background:#fff;border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom);box-shadow:0 -8px 24px rgba(0,0,0,.05)}.bottom-item{min-height:62px;border:0;background:#fff;color:#7a8590;display:flex;align-items:center;justify-content:center}.bottom-item small{font-size:9px;font-weight:700}.bottom-item.active{color:var(--primary)}.sheet-backdrop{position:fixed;inset:0;background:rgba(8,15,25,.42);z-index:120;align-items:flex-end}.sheet-backdrop:not([hidden]){display:flex}.mobile-sheet{width:100%;background:#fff;border-radius:18px 18px 0 0;padding:8px 12px calc(18px + env(safe-area-inset-bottom));max-height:76dvh;overflow-y:auto}.sheet-handle{width:42px;height:4px;border-radius:2px;background:#d7dde3;margin:0 auto 8px}.sheet-head{display:flex;justify-content:space-between;align-items:center;padding:4px 2px 10px}.sheet-head strong{font-size:14px}.sheet-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.sheet-menu-item{border:1px solid var(--line);background:#fff;border-radius:11px;min-height:54px;display:flex;align-items:center;justify-content:center;text-align:center;font-weight:700;font-size:11px}.toast-wrap{right:10px;left:10px;bottom:calc(76px + env(safe-area-inset-bottom))}.toast{min-width:0;max-width:none;width:100%}
  /* iOS Safari: 16px未満の入力フォントでフォーカス時ズームされるのを防止 */
  input,select,textarea{font-size:16px!important}
}

/* ===== MAX v2: masters / payroll / supporters ===== */
.btn-small{min-height:34px;padding:0 10px;font-size:10px}
.master-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:14px}
.master-list{padding:6px 14px 14px}
.master-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 0;border-bottom:1px solid #edf1f4}
.master-item:last-child{border-bottom:0}
.master-item>div:first-child{min-width:0;display:grid;gap:3px}
.master-item strong{font-size:11px}
.master-item span{font-size:9px;color:var(--muted);line-height:1.45}
.master-item>div:last-child{display:flex;align-items:center;gap:6px;flex:0 0 auto}
.master-note{margin:0}
.check-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.check-card{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:9px;padding:8px 9px;background:#fff;min-width:0;cursor:pointer}
.check-card:hover{background:#f9fbfd}
.check-card input{width:18px!important;height:18px;min-height:18px!important;flex:0 0 18px;accent-color:var(--primary)}
.check-card span{display:grid;gap:2px;min-width:0}
.check-card strong{font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.check-card small{font-size:8px;color:var(--muted)}
.money-input{position:relative}
.money-input>span{position:absolute;left:10px;top:50%;transform:translateY(-50%);font-size:11px;font-weight:700;color:#7a8590;z-index:1}
.money-input input{padding-left:25px!important}
.field>small{font-size:8px;color:var(--muted);line-height:1.45}
.salary-rate-table{display:grid;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.salary-rate-row{display:grid;grid-template-columns:minmax(120px,1fr) minmax(140px,190px);align-items:center;gap:10px;padding:8px 10px;border-bottom:1px solid #edf1f4;background:#fff}
.salary-rate-row:last-child{border-bottom:0}
.salary-rate-row>span{display:grid;gap:2px}
.salary-rate-row strong{font-size:10px}
.salary-rate-row small{font-size:8px;color:var(--muted)}
.salary-rate-row input{min-height:38px!important}
.price-breakdown{display:flex;flex-wrap:wrap;align-items:center;gap:6px;background:#f7f9fb;border:1px solid #e7ebef;border-radius:9px;padding:9px 10px;font-size:9px;color:#66727d}
.price-breakdown span:after{content:"＋";margin-left:6px;color:#a2abb4}
.price-breakdown span:nth-last-of-type(1):after{content:"";margin:0}
.price-breakdown strong{margin-left:auto;color:#17212b;font-size:11px}
.payroll-detail-head{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:10px}
.payroll-detail-head span{background:#f2f5f8;border:1px solid #e5e9ed;border-radius:999px;padding:5px 8px;font-size:9px;font-weight:700;color:#5f6b76}
.payroll-detail-table{min-width:0!important}
.payroll-detail-table td:first-child{font-weight:700}
.payroll-detail-table .num{text-align:right;white-space:nowrap}
.payroll-detail-table .negative{color:#b84747}
.payroll-detail-table .subtotal td{border-top:2px solid #dfe5ea;font-weight:700}
.payroll-detail-table .grand-total td{background:#f3f8ff;font-size:13px;font-weight:700;border-top:2px solid #bfd6fb}

@media(max-width:1200px){.master-grid{grid-template-columns:1fr 1fr}.master-grid .panel:last-child{grid-column:1/-1}}
@media(max-width:760px){
  .master-grid{grid-template-columns:1fr}.master-grid .panel:last-child{grid-column:auto}
  .check-grid{grid-template-columns:1fr}
  .salary-rate-row{grid-template-columns:1fr 140px}
  .price-breakdown{align-items:flex-start}.price-breakdown strong{width:100%;margin-left:0;padding-top:5px;border-top:1px solid #e2e7ec}
  #view-payroll .toolbar-actions{grid-template-columns:1fr 1fr}
  #view-payroll .toolbar-actions .segmented{grid-column:1/-1}
  #view-payroll .toolbar-actions .date-stepper{grid-column:1/-1}
  #view-supporters .toolbar-actions{grid-template-columns:1fr 1fr}
}

/* ===== PC typography adjustment: mobile is intentionally unchanged ===== */
@media (min-width: 761px){
  body{font-size:15px}
  .brand-copy strong{font-size:14px}
  .brand-copy span{font-size:10px}
  .nav-group-label{font-size:10px}
  .nav-item{font-size:13px}
  .nav-count{font-size:10px}
  .shop-status strong{font-size:12px}
  .shop-status small{font-size:10px}

  .topbar h1{font-size:21px}
  .topbar p{font-size:12px}
  .btn{font-size:13px}
  .text-btn{font-size:12px}
  .small-btn,.btn-small{font-size:11px}

  .eyebrow{font-size:10px}
  .hero-strip p{font-size:12px}
  .stat-label{font-size:11px}
  .stat-card small{font-size:10px}

  .panel-head h2,.section-title{font-size:15px}
  .panel-head p,.section-sub{font-size:11px}
  .section-title{font-size:16px}

  .search-box input{font-size:14px}
  .control-select{font-size:13px}
  .field>span{font-size:11px}
  .field input,.field select,.field textarea{font-size:14px}
  .field>small{font-size:9px}

  .table-wrap th{font-size:11px}
  .table-wrap td{font-size:12px}
  .badge{font-size:10px}

  .drawer-head strong{font-size:15px}
  .drawer-head span{font-size:10px}
  .alert-item strong{font-size:11px}
  .alert-item span{font-size:10px}

  .master-item strong{font-size:12px}
  .master-item span{font-size:10px}
  .check-card strong{font-size:11px}
  .check-card small{font-size:9px}
  .money-input>span{font-size:12px}
  .salary-rate-row strong{font-size:11px}
  .salary-rate-row small{font-size:9px}
  .price-breakdown{font-size:10px}
  .price-breakdown strong{font-size:12px}
  .payroll-detail-head span{font-size:10px}
}

/* ===== MAX v3: modal stability / customer history / supporter relations ===== */
.modal{width:min(820px,100%)}
.modal>form{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.modal-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding-bottom:24px;-webkit-overflow-scrolling:touch}
.modal-foot{flex:0 0 auto;background:#fff;position:relative;z-index:2}
.modal-body:focus{outline:none}
.modal-body::-webkit-scrollbar{width:10px}
.modal-body::-webkit-scrollbar-thumb{background:#cfd7df;border-radius:999px;border:2px solid #fff}
.modal-body::-webkit-scrollbar-track{background:#fff}

.relation-summary{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.relation-kpi{border:1px solid var(--line);background:#f8fafc;border-radius:10px;padding:10px}
.relation-kpi span{display:block;font-size:9px;color:var(--muted);font-weight:700;margin-bottom:3px}
.relation-kpi strong{display:block;font-size:13px}

.history-section{grid-column:1/-1;border-top:1px solid var(--line);padding-top:12px;margin-top:2px;min-width:0}
.history-head{display:flex;justify-content:space-between;align-items:flex-end;gap:10px;margin-bottom:8px}
.history-head>div{min-width:0}
.history-head strong{font-size:12px;display:block}
.history-head small{font-size:9px;color:var(--muted);display:block;margin-top:2px}
.customer-history-list{display:grid;gap:7px;padding-right:2px}
.customer-history-item{display:grid;grid-template-columns:100px 120px minmax(150px,1.2fr) minmax(150px,1fr) 95px;gap:8px;align-items:center;border:1px solid var(--line);border-radius:10px;padding:9px 10px;background:#fff;min-width:0}
.customer-history-item>div{min-width:0}
.customer-history-item .history-date strong,.customer-history-item .history-cast strong{display:block;font-size:11px}
.customer-history-item .history-date small,.customer-history-item .history-cast small,.customer-history-item .history-detail small,.customer-history-item .history-place small{display:block;font-size:9px;color:var(--muted);margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.customer-history-item .history-detail strong,.customer-history-item .history-place strong{display:block;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.customer-history-item .history-amount{text-align:right}
.customer-history-item .history-amount strong{display:block;font-size:11px}
.customer-history-item .history-amount .badge{margin-top:4px}

.supporter-link-note{grid-column:1/-1;background:#f4f8ff;border:1px solid #d7e5ff;color:#345477;border-radius:9px;padding:9px 10px;font-size:9px;line-height:1.55}
.supporter-cast-list{display:grid;gap:8px}
.supporter-cast-card{border:1px solid var(--line);border-radius:11px;padding:10px 11px;background:#fff;display:grid;grid-template-columns:minmax(140px,1.1fr) repeat(4,minmax(90px,.8fr));gap:8px;align-items:center}
.supporter-cast-card .cast-main strong{font-size:12px;display:block}
.supporter-cast-card .cast-main small{font-size:9px;color:var(--muted);display:block;margin-top:2px}
.supporter-cast-card .cast-metric span{display:block;font-size:8px;color:var(--muted);font-weight:700;margin-bottom:2px}
.supporter-cast-card .cast-metric strong{display:block;font-size:10px}
.supporter-name-cell{display:grid;gap:3px}
.supporter-name-cell small{font-size:9px;color:var(--muted)}

@media (max-width:760px){
  .modal{width:100%;max-height:94dvh}
  .modal>form{min-height:0}
  .modal-body{padding-bottom:20px}
  .relation-summary{grid-template-columns:1fr 1fr}
  .relation-kpi:last-child{grid-column:1/-1}
  .customer-history-list{max-height:none;overflow:visible}
  .customer-history-item{grid-template-columns:1fr 1fr;gap:7px}
  .customer-history-item .history-detail,.customer-history-item .history-place{grid-column:1/-1}
  .customer-history-item .history-amount{text-align:left;display:flex;align-items:center;justify-content:space-between;gap:8px;grid-column:1/-1;border-top:1px solid #edf1f4;padding-top:7px}
  .customer-history-item .history-amount .badge{margin-top:0}
  .supporter-cast-card{grid-template-columns:1fr 1fr}
  .supporter-cast-card .cast-main{grid-column:1/-1}
}


/* ===== MAX v4: PC readability + full-day timetable fit ===== */
@media (min-width: 761px){
  /* PCでは06:00〜翌05:00を横スクロールなしで1画面に収める */
  :root{--timeline-cast:156px}
  .timeline-scroll{overflow-x:hidden;overflow-y:auto}
  .timeline-table{width:100%;min-width:0;grid-template-columns:var(--timeline-cast) minmax(0,1fr)}
  .timeline-hours{width:100%;grid-template-columns:repeat(24,minmax(0,1fr))}
  .timeline-track{width:100%;grid-template-columns:repeat(48,minmax(0,1fr))}
  .timeline-hour,.timeline-slot{min-width:0;padding-left:0;padding-right:0;overflow:hidden}
  .timeline-booking{min-width:0}

  /* PC表示では補足文字を含め11px未満にしない */
  .brand-copy span,
  .nav-group-label,
  .nav-count,
  .shop-status small,
  .icon-btn span,
  .small-btn,
  .eyebrow,
  .stat-label,
  .stat-card small,
  .panel-head p,
  .section-sub,
  .field>span,
  .field>small,
  .table-wrap th,
  .badge,
  .stack-sub,
  .stack-side small,
  .summary-row span,
  .live-cast small,
  .live-next,
  .schedule-legend,
  .schedule-count,
  .timeline-corner,
  .timeline-hour,
  .timeline-cast small,
  .timeline-slot,
  .timeline-booking strong,
  .timeline-booking small,
  .timeline-break,
  .timeline-now:before,
  .timeline-help,
  .dispatch-meta,
  .driver-card p,
  .task-card p,
  .task-due,
  .switch-row span,
  .note-box,
  .trash-item strong,
  .trash-item small,
  .modal-head p,
  .modal-section-title,
  .inline-note,
  .conflict-note,
  .toast,
  .drawer-head span,
  .alert-item strong,
  .alert-item span,
  .btn-small,
  .master-item span,
  .check-card strong,
  .check-card small,
  .salary-rate-row strong,
  .salary-rate-row small,
  .price-breakdown,
  .payroll-detail-head span,
  .relation-kpi span,
  .history-head small,
  .customer-history-item .history-date small,
  .customer-history-item .history-cast small,
  .customer-history-item .history-detail small,
  .customer-history-item .history-place small,
  .customer-history-item .history-detail strong,
  .customer-history-item .history-place strong,
  .supporter-link-note,
  .supporter-cast-card .cast-main small,
  .supporter-cast-card .cast-metric span,
  .supporter-cast-card .cast-metric strong,
  .supporter-name-cell small{font-size:11px!important}
}

/* ===== MAX v5: exact timetable columns + delete actions ===== */
@media (min-width: 761px){
  /* 時刻ヘッダーも30分セルと同じ48列グリッドを使い、境界線を完全に揃える */
  .timeline-hours{
    display:grid;
    grid-template-columns:repeat(48,minmax(0,1fr));
    width:100%;
    min-width:0;
  }
  .timeline-hour{
    grid-column:span 2;
    width:auto;
    min-width:0;
  }
  .timeline-track{
    display:grid;
    grid-template-columns:repeat(48,minmax(0,1fr));
    width:100%;
    min-width:0;
  }
  .timeline-slot{
    width:auto;
    min-width:0;
  }
  .timeline-table{
    grid-template-columns:var(--timeline-cast) minmax(0,1fr);
    width:100%;
    min-width:0;
  }
}

.master-item>div:last-child{flex-wrap:wrap;justify-content:flex-end}
.row-actions{flex-wrap:wrap}


/* ===== MAX v6: configurable timetable / typography / simplified navigation ===== */
:root{--timeline-cols:48}
body,button,input,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}

/* フォントウェイトは normal / bold の2段階に統一 */
body{font-weight:400}
strong,b,.brand-copy strong,.nav-group-label,.nav-item,.btn,.text-btn,.small-btn,.badge,.panel-head h2,.section-title,.stat-label,.timeline-corner,.timeline-hour,.timeline-slot,.schedule-legend,.schedule-count,.modal-section-title,.conflict-note,.toast,.master-item strong,.check-card strong,.salary-rate-row strong,.payroll-detail-table .subtotal td,.payroll-detail-table .grand-total td{font-weight:700}

/* サイドメニューは文字だけで判別しやすく */
.nav-item{grid-template-columns:minmax(0,1fr) auto;gap:8px;padding-left:12px;padding-right:10px}
.nav-item>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.timeline-hours,.timeline-track{grid-template-columns:repeat(var(--timeline-cols),var(--timeline-slot))}
.timeline-hour{grid-column:span 2}
.timeline-setting-group{display:grid;grid-template-columns:1fr 1fr;gap:12px;border:1px solid var(--line);border-radius:11px;background:#f8fafc;padding:12px}
.timeline-setting-head{grid-column:1/-1;display:flex;align-items:baseline;justify-content:space-between;gap:12px;border-bottom:1px solid #e6ebef;padding-bottom:9px}
.timeline-setting-head strong{font-size:12px}
.timeline-setting-head span{font-size:11px;color:var(--muted)}
.timeline-setting-preview{grid-column:1/-1;background:#fff;border:1px solid var(--line);border-radius:9px;padding:9px 10px;font-size:11px;color:#52606d}

@media (min-width:761px){
  .timeline-hours,.timeline-track{grid-template-columns:repeat(var(--timeline-cols),minmax(0,1fr))}
  .timeline-scroll{overflow-x:hidden}
}

@media (max-width:760px){
  .timeline-setting-group{grid-template-columns:1fr}
  .timeline-setting-head,.timeline-setting-preview{grid-column:auto}
  .timeline-setting-head{display:grid;gap:3px}
  .bottom-item small{font-size:11px;font-weight:700}
  .sheet-menu-item{font-size:12px;font-weight:700}
}


/* SEO overview: visible, useful content for visitors and search engines */
.seo-overview{margin-top:18px;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:22px 24px}
.seo-overview-copy{max-width:820px}
.seo-overview-label{margin:0 0 6px;font-size:11px;font-weight:700;letter-spacing:.08em;color:#64748b}
.seo-overview h2{margin:0 0 8px;font-size:18px;font-weight:700;color:#0f172a}
.seo-overview p{margin:0;line-height:1.75;color:#475569}
.seo-feature-list{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;max-width:420px}
.seo-feature-list span{display:inline-flex;align-items:center;min-height:30px;padding:5px 10px;border:1px solid #e2e8f0;border-radius:999px;background:#f8fafc;font-size:11px;font-weight:700;color:#334155;white-space:nowrap}
@media (max-width: 767px){.seo-overview{display:block;padding:18px 16px}.seo-overview h2{font-size:17px}.seo-feature-list{justify-content:flex-start;max-width:none;margin-top:14px}.seo-feature-list span{font-size:12px}}
