/* Shared manager components: scoped selectors, independent of page styles. */
.mgr-empty, .mgr-error, .mgr-picker, .mgr-skeleton, .mgr-tenant-badge { box-sizing: border-box; color: var(--mgr-text); font-family: inherit; line-height: 1.6; }
.mgr-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 24px; background: var(--mgr-surface); border: 1px solid #e5e7eb; border-radius: var(--mgr-radius); text-align: center; }
.mgr-empty-icon { display: grid; place-items: center; width: 48px; height: 48px; background: var(--bg); border-radius: 16px; font-size: 24px; }
.mgr-empty--info .mgr-empty-icon { background: var(--mgr-accent-soft); }
.mgr-empty--success .mgr-empty-icon { background: var(--state-green); }
.mgr-empty--warning .mgr-empty-icon { background: var(--state-amber); }
.mgr-empty-title { font-size: 16px; font-weight: 650; overflow-wrap: anywhere; }
.mgr-empty p, .mgr-error p { margin: 0; overflow-wrap: anywhere; }
.mgr-secondary { color: var(--mgr-secondary); font-size: var(--text-small); }
.mgr-error { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; border: 1px solid #fecaca; border-left: 3px solid #b91c1c; background: var(--surface); padding: 18px 20px; border-radius: var(--mgr-radius); }
.mgr-button { appearance: none; display: inline-flex; align-items: center; justify-content: center; min-height: var(--control-min-size); padding: 8px 16px; border: 1px solid var(--mgr-border); border-radius: var(--radius-sm); background: var(--mgr-surface); color: var(--mgr-accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: background-color 140ms ease, border-color 140ms ease; }
.mgr-button:hover { background: var(--mgr-accent-soft); border-color: var(--mgr-accent); }
.mgr-button:focus-visible, .mgr-picker-input:focus-visible, [role="tablist"] [role="tab"]:focus-visible { outline: 3px solid var(--mgr-ring); outline-offset: 3px; }
/* 画面固有の outline:none より優先し、キーボード操作の現在地を保つ。 */
:is(button, a[href], input, select, textarea, [role="tab"], .tab, .atab, .etab, .stab, .role-tab, .store-tab):focus-visible {
  outline: 3px solid var(--mgr-ring, #0068b7) !important; outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--mgr-surface, #fff);
}
/* 固定ヘッダー・下部操作バーの外へフォーカスをスクロールする。 */
html { scroll-padding-block: var(--mgr-focus-header-offset, 96px) var(--mgr-focus-footer-offset, 96px); }
:focus { scroll-margin-block: 8px; }
.skip-link {
  position: fixed; top: max(8px, env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left)); z-index: 2000;
  box-sizing: border-box; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); overflow: auto;
  padding: 12px 16px; background: var(--mgr-surface, #fff); color: var(--mgr-accent, #0068b7);
  border-radius: var(--radius-sm, 6px); white-space: normal; overflow-wrap: anywhere;
  transform: translateY(calc(-100% - max(16px, env(safe-area-inset-top))));
}
.skip-link:focus { transform: translateY(0); outline: 3px solid var(--mgr-ring, #0068b7); outline-offset: 3px; }
@media (max-width: 768px) {
  html { --mgr-focus-header-offset: 160px; }
}
@media (forced-colors: active) {
  :focus-visible, .skip-link:focus { outline-color: Highlight !important; }
}
@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  .skip-link { transition: none; }
}
.mgr-tenant-badge { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; max-width: 100%; padding: 7px 12px; border: 1px solid var(--mgr-border); border-radius: var(--radius-sm); background: var(--mgr-surface); font-size: var(--text-small); }
.mgr-tenant-label { color: var(--mgr-secondary); font-size: 12px; }
.mgr-tenant-badge strong { overflow-wrap: anywhere; }
.mgr-picker { position: relative; width: 100%; min-width: 0; }
.mgr-picker-input { box-sizing: border-box; width: 100%; min-height: var(--control-min-size); padding: 10px 12px; border: 1px solid var(--mgr-border); border-radius: var(--radius-sm); background: var(--mgr-surface); color: var(--mgr-text); font: inherit; font-size: 14px; transition: border-color 140ms ease; }
.mgr-picker-input::placeholder { color: var(--mgr-secondary); opacity: 1; }
.mgr-picker-input:hover { border-color: var(--mgr-accent); }
.mgr-picker-panel { position: absolute; inset: calc(100% + 6px) 0 auto; z-index: 300; padding: 6px; border: 1px solid var(--mgr-border); border-radius: var(--mgr-radius); background: var(--mgr-surface); box-shadow: 0 8px 28px #11182718, 0 2px 6px #1118270a; }
.mgr-picker-panel[hidden] { display: none; }
.mgr-picker-list { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow-y: auto; overscroll-behavior: contain; }
.mgr-picker-option { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: var(--control-min-size); box-sizing: border-box; padding: 8px 10px; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.mgr-picker-option:hover, .mgr-option-active { background: var(--mgr-accent-soft); }
.mgr-picker-option[aria-selected="true"] { color: var(--mgr-accent); font-weight: 600; box-shadow: inset 3px 0 var(--mgr-accent); }
.mgr-picker-count { margin: 6px 10px; }
.mgr-skeleton { display: grid; gap: 12px; padding: 20px; border-radius: var(--mgr-radius); background: var(--mgr-surface); }
.mgr-skeleton-line { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%); background-size: 200% 100%; animation: mgr-shimmer 1.8s ease-in-out infinite; }
.mgr-skeleton-line:last-child { width: 65%; }
@keyframes mgr-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
[role="tablist"] [role="tab"] { min-height: var(--control-min-size); }
.mgr-button, [role="tablist"] [role="tab"] { min-width: var(--control-min-size); }
@media (max-width: 520px) {
  /* ラベル幅は縮小せず、短いタブにも共通の最小操作幅を適用する。 */
  .admin-tabs .atab { min-width: var(--control-min-size); }
  .mgr-picker-input { font-size: 16px; }
  .mgr-empty { padding: 24px 16px; }
  .mgr-error { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .mgr-skeleton-line { animation: none; background: var(--border); }
  .mgr-button, .mgr-picker-input { transition: none; }
  .mgr-picker-list { scroll-behavior: auto; }
}

.mgr-notice-danger { color: var(--red, #b91c1c); font-weight: 700; margin-left: 8px; }
.mgr-filter-indicator { display: inline-block; padding: 4px 10px; border-radius: 12px; background: #fff7ed; color: #9a3412; font-size: 12px; margin-bottom: 8px; }

.mgr-error.mgr-warning { border-color: #fed7aa; border-left-color: #b45309; background: #fffbeb; }

/* Manager switcher, confirmation and action sheets. */
.mgr-switcher, .mgr-dialog, .mgr-action-sheet, .mgr-bottom-bar { box-sizing: border-box; color: var(--mgr-text); font-family: inherit; line-height: 1.6; }
.mgr-switcher { position: relative; }
.mgr-switcher [hidden], .mgr-modal-layer[hidden] { display: none !important; }
.mgr-switcher button, .mgr-dialog button, .mgr-action-sheet button, .mgr-bottom-bar button { min-height: 44px; }
.mgr-store-current { gap: 24px; text-align: left; max-width: 100%; }
.mgr-store-current strong, .mgr-store-current small, .mgr-store-row small { display: block; overflow-wrap: anywhere; }
.mgr-store-current small, .mgr-store-row small { font-size: 12px; color: var(--mgr-secondary); font-weight: 400; }
.mgr-store-current strong { color: var(--mgr-text); }
.mgr-scrim { position: fixed; inset: 0; z-index: 1000; background: #11182733; }
.mgr-switcher-panel { position: absolute; top: calc(100% + 8px); left: 0; width: min(420px, calc(100vw - 32px)); z-index: 1001; box-sizing: border-box; display: flex; flex-direction: column; gap: 12px; padding: 20px; max-height: min(560px, calc(100vh - var(--mgr-picker-top, 120px) - 16px)); overflow:hidden; animation:mgr-panel-enter 140ms ease-out; background: var(--mgr-surface); border: 1px solid var(--mgr-border); border-radius: 16px; box-shadow: 0 16px 48px #11182726; }
.mgr-sheet-heading, .mgr-area-heading, .mgr-compare-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mgr-switcher-panel > :not(.mgr-store-results) { flex-shrink:0; }
.mgr-store-results { flex:1 1 auto; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.mgr-store-results h3 { font-size: 12px; color: var(--mgr-secondary); margin: 20px 8px 8px; }
.mgr-store-results h3:first-child { margin-top: 0; }
.mgr-store-row, .mgr-area-heading { box-sizing: border-box; width: 100%; min-height: 48px; border: 0; border-radius: var(--radius-sm); background: var(--surface); color: var(--mgr-text); font: inherit; font-size: 14px; text-align: left; padding: 10px 12px; cursor: pointer; }
.mgr-store-row { display: flex; align-items: center; gap: 12px; overflow-wrap: anywhere; }
.mgr-store-row input { pointer-events: none; width: 18px; height: 18px; accent-color: var(--mgr-accent); flex-shrink: 0; }
.mgr-store-row:hover, .mgr-area-heading:hover, .mgr-store-row[aria-pressed="true"] { background: var(--mgr-accent-soft); }
.mgr-store-row[aria-pressed="true"] { box-shadow: inset 3px 0 var(--mgr-accent); }
.mgr-area-heading { font-weight: 600; background: var(--bg); margin: 4px 0; }
.mgr-area-heading span { font-size: 12px; color: var(--mgr-secondary); }
.mgr-switcher-count { margin: 0; }
.mgr-compare { display:flex; align-items:center; gap:12px; border:0; background:transparent; color:var(--mgr-text); text-align:left; font:inherit; cursor:pointer; padding:4px 0; }
.mgr-compare small { display:block; color:var(--mgr-secondary); font-size:12px; }
.mgr-switch-track { width:36px; height:22px; background:#64748b; border-radius:20px; padding:3px; box-sizing:border-box; flex-shrink:0; }
.mgr-switch-track::after { content:''; display:block; width:16px; height:16px; border-radius:50%; background:#fff; transition:transform 140ms ease; }
.mgr-compare[aria-checked="true"] .mgr-switch-track { background:var(--mgr-accent); }
.mgr-compare[aria-checked="true"] .mgr-switch-track::after { transform:translateX(14px); }
.mgr-store-name { flex:1; min-width:0; font-weight:600; }
.mgr-store-row .mgr-store-tag { margin-left:auto; padding:2px 8px; background:#f1f5f9; border-radius:20px; white-space:nowrap; }
@keyframes mgr-panel-enter { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
@keyframes mgr-sheet-enter { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:translateY(0); } }
.mgr-compare-footer { border-top: 1px solid var(--mgr-border); padding-top: 12px; font-size: 14px; }
.mgr-primary { background: var(--mgr-accent); border-color: var(--mgr-accent); color: #fff; }
.mgr-primary:hover { background: #005493; color: #fff; }
.mgr-danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.mgr-danger:hover { background: #991b1b; border-color: #991b1b; }
.mgr-danger-text, .mgr-irreversible { color: #b91c1c; font-weight: 600; }
.mgr-modal-layer { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; background: #11182770; padding: 16px; box-sizing: border-box; }
.mgr-dialog, .mgr-action-sheet { width: min(100%, 480px); max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border-radius: 20px; padding: 24px; box-shadow: 0 24px 80px #11182733; }
.mgr-dialog { display:flex; flex-direction:column; overflow:hidden; box-sizing:border-box; width:min(100%,760px); max-height:calc(100vh - 32px); }
.mgr-dialog > h2, .mgr-dialog-actions { flex-shrink:0; }
#mgr-confirm-body { overflow-y:auto; min-height:0; overscroll-behavior:contain; }
.mgr-rebuild-provisional { min-height:48px; margin:8px 0 12px; }
.mgr-rebuild-provisional span { min-width:0; overflow-wrap:anywhere; }
.mgr-rebuild-provisional input:focus-visible { outline:3px solid var(--mgr-ring); outline-offset:2px; }
.mgr-diff-summary { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; margin:8px 0 20px; }
.mgr-diff-summary > div { padding:12px; background:#edf6ff; border:1px solid #cbdfee; border-radius:var(--radius); font-size:12px; color:#005493; }
.mgr-diff-summary strong { display:block; font-size:28px; margin-top:6px; }
.mgr-diff-summary .mgr-diff-added { color:var(--green); background:var(--state-green); }
.mgr-diff-summary .mgr-diff-removed { color:#991b1b; background:#fff1f2; }
.mgr-diff-table { overflow-x:auto; }
.mgr-diff-table table { width:100%; border-collapse:collapse; font-size:13px; text-align:left; }
.mgr-diff-table th { color:var(--mgr-secondary); background:#f8fafc; }
.mgr-diff-table th,.mgr-diff-table td { padding:12px 8px; border-bottom:1px solid #e5e7eb; overflow-wrap:anywhere; }
.mgr-preview-complete { padding:16px; background:var(--state-green); color:var(--green); border-radius:var(--radius); font-weight:600; }
.mgr-dialog h2, .mgr-action-sheet h2 { font-size: var(--text-heading); margin: 0 0 16px; overflow-wrap: anywhere; }
.mgr-dialog p { white-space: pre-wrap; overflow-wrap: anywhere; }
.mgr-confirm-details { margin: 20px 0; }
.mgr-confirm-details > div { display: grid; grid-template-columns: 100px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid #e5e7eb; }
.mgr-confirm-details dt { color: var(--mgr-secondary); font-size: var(--text-small); }
.mgr-confirm-details dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.mgr-preview { border: 1px solid var(--mgr-border); border-radius: 12px; padding: 0 16px; background: var(--bg); }
.mgr-preview strong, .mgr-preview del { display: block; }
.mgr-preview del { color: var(--mgr-secondary); }
.mgr-dialog-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.mgr-bottom-bar { display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--mgr-border); box-shadow: 0 -4px 20px #11182708; }
.mgr-bottom-bar > :first-child { flex: 1; }
.mgr-bottom-bar > :last-child { min-width: 48px; font-size: 24px; }
.mgr-action-sheet { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.mgr-action-sheet > .mgr-button { width: 100%; margin-top: 16px; }
.mgr-switcher button:focus-visible, .mgr-dialog button:focus-visible, .mgr-action-sheet button:focus-visible, .mgr-bottom-bar button:focus-visible { outline: 3px solid var(--mgr-ring); outline-offset: 2px; }
.mgr-switcher button, .mgr-action-sheet button { transition: background-color 140ms ease; }
.mgr-bottom-bar button:disabled, .mgr-action-sheet button:disabled { color: #4b5563; background: var(--border); cursor: not-allowed; }
@media (max-width: 520px) {
  .mgr-switcher-panel { position: fixed; inset: auto 0 0; width: 100%; max-height: 85dvh; animation:mgr-sheet-enter 140ms ease-out; border-radius: 20px 20px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); }
  .mgr-switcher-panel input { font-size: 16px; }
  .mgr-bottom-bar { position: fixed; inset: auto 0 0; z-index: 900; }
  .mgr-modal-layer:has(.mgr-action-sheet) { padding: 0; align-items: end; }
  .mgr-action-sheet { width: 100%; box-sizing: border-box; border-radius: 20px 20px 0 0; max-height: 85dvh; }
  .mgr-modal-layer:has(.mgr-dialog) { padding:0; align-items:end; }
  .mgr-dialog { padding:20px 16px calc(16px + env(safe-area-inset-bottom)); border-radius:20px 20px 0 0; animation:mgr-sheet-enter 140ms ease-out; }
  .mgr-dialog-actions { flex-direction:column; gap:8px; margin-top:16px; }
  .mgr-dialog-actions button { width:100%; min-height:44px; }
  .mgr-diff-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .mgr-confirm-details > div { grid-template-columns: 80px 1fr; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .mgr-switcher button, .mgr-action-sheet button, .mgr-switch-track::after { transition: none; }
  .mgr-switcher-panel, .mgr-dialog { animation:none; }
}
/* Keep the closing surface visible for the same short transition as entry. */
@supports (transition-behavior: allow-discrete) {
  .mgr-switcher-panel, .mgr-scrim { transition:opacity 140ms ease, transform 140ms ease, display 140ms allow-discrete; }
  .mgr-switcher-panel[hidden], .mgr-scrim[hidden] { opacity:0; }
  .mgr-switcher-panel[hidden] { transform:translateY(-6px); }
  @media(max-width:520px) { .mgr-switcher-panel[hidden] { transform:translateY(24px); } }
  @media(prefers-reduced-motion:reduce) { .mgr-switcher-panel, .mgr-scrim { transition:none; } }
}
.mgr-store-row-current { box-shadow:inset 3px 0 var(--mgr-accent); }

/* 従業員の追加条件はSPだけ折りたたむ。同じ入力・状態をPCでも使用する。 */
.prod-emp-filter-panel,.prod-emp-filter-fields { display:contents; }
.prod-emp-filter-toggle,.prod-emp-active-chips,.prod-emp-panel-title,.prod-emp-panel-close { display:none; }
.prod-emp-sort-row { flex-basis:100%; }
.mgr-filter-chip { min-height:44px; padding:8px 12px; border:1px solid #b6cee2; border-radius:22px; background:#edf5fc; color:#004b85; font:inherit; cursor:pointer; overflow-wrap:anywhere; }
@media (max-width:520px) {
  .prod-emp-segments { display:grid!important; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px!important; }
  .prod-emp-segments .btn { min-width:0; min-height:44px; padding:8px; }
  .prod-emp-toolbar { display:grid!important; grid-template-columns:minmax(0,1fr) auto; align-items:center!important; gap:8px!important; }
  .prod-emp-search-row { min-width:0!important; width:100%; }
  .prod-emp-search-row input { width:100%; min-width:0; min-height:44px; font-size:16px; }
  .prod-emp-filter-toggle { display:inline-flex; gap:6px; align-items:center; justify-content:center; min-height:44px; padding:8px 10px; }
  #prod-emp-filter-count:not(:empty) { border-radius:var(--radius); padding:2px 6px; color:#fff; background:var(--brand); font-size:12px; }
  .prod-emp-active-chips { display:flex; flex-wrap:wrap; gap:6px; grid-column:1/-1; min-width:0; }
  .prod-emp-active-chips:empty { display:none; }
  .prod-emp-active-chips .btn { min-height:44px; }
  .prod-emp-filter-panel { display:none; grid-column:1/-1; min-width:0; padding:16px; border:1px solid #b6cee2; border-radius:var(--radius); background:#f5f9fd; }
  .prod-emp-filter-panel.is-open { display:block; }
  .prod-emp-panel-title { display:block; margin:0 0 12px; font-size:16px; color:#004b85; }
  .prod-emp-filter-fields { display:flex; flex-direction:column; gap:10px; align-items:stretch; margin-bottom:16px; }
  .prod-emp-filter-fields > div { min-width:0!important; }
  .prod-emp-filter-panel button,.prod-emp-filter-panel label,.prod-emp-filter-panel select { min-height:44px; }
  .prod-emp-filter-panel select { max-width:100%; font-size:16px; }
  .prod-emp-sort-row { align-items:stretch!important; }
  .prod-emp-sort-row > select { width:100%!important; }
  .prod-emp-filter-panel .emp-cols { width:100%; min-width:0; }
  .prod-emp-filter-panel .emp-cols-note { display:block; margin:6px 0!important; font-size:12px; line-height:1.5; color:#465467; }
  .prod-emp-filter-panel .emp-cols-panel { max-width:100%; box-sizing:border-box; }
  .prod-emp-panel-close { display:block; width:100%; }
}
@media (min-width:521px) {
  .prod-emp-toolbar { row-gap:12px!important; }
  .prod-emp-toolbar .prod-emp-sort-row { margin-bottom:0!important; }
  .prod-emp-toolbar #prod-emp-issue-chips { flex-basis:100%; margin-bottom:0!important; }
}

/* Shared manager form defaults; inline mobile font sizes also need overriding. */
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  color:var(--text); background-color:var(--surface); border-color:var(--border);
  border-radius:var(--radius-sm); font-size:var(--text-input);
}
input::placeholder, textarea::placeholder { color:var(--muted); opacity:1; }
@media (max-width:768px) {
  input, select, textarea { font-size:16px!important; }
  button, .btn, .tab, .atab, .role-tab, .store-tab, [role="tab"], .mgr-picker-option { min-height:44px; }
  /* Tiny remove controls remain compact inside assignment tables. */
  .shift-chip .chip-x { min-height:0; }
}
/* Store overview: compact rows with a shared, persistent date axis. */
.mgr-heatmap{min-width:0;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:var(--space-6);box-shadow:var(--shadow);font-variant-numeric:tabular-nums}
.mgr-heatmap header{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap}.mgr-heatmap h2{font-size:var(--text-heading);margin:0}.mgr-heatmap header>div{color:var(--muted);font-size:12px;min-width:180px}
.mgr-heat-progressbar{height:3px;background:var(--border);margin-top:6px;border-radius:3px;overflow:hidden}.mgr-heat-progressbar span{display:block;height:100%;background:var(--brand);transition:width .15s}
.mgr-heat-kpi{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0}.mgr-heat-kpi button{display:flex;align-items:baseline;gap:6px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--bg);padding:8px 10px;color:var(--text);cursor:pointer;font:inherit;font-size:12px}.mgr-heat-kpi strong{font-size:20px;line-height:1.2}.mgr-heat-kpi small{color:var(--muted);font-size:11px}
.mgr-heat-controls{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;align-items:center;margin-bottom:12px}.mgr-heat-filters{display:flex;gap:4px;flex-wrap:wrap}.mgr-heat-filters button,.mgr-heat-no-results button{font:inherit;font-size:12px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:7px 10px;background:var(--surface);color:var(--muted);cursor:pointer}.mgr-heat-controls label{font-size:12px;color:var(--muted)}.mgr-heat-controls select{font:inherit;border:1px solid var(--border);border-radius:var(--radius-sm);padding:6px;background:var(--surface);color:var(--text)}.mgr-heatmap button[aria-pressed="true"]{color:var(--brand);background:var(--blue-lt);border-color:var(--brand)}.mgr-heatmap button:focus-visible,.mgr-heatmap select:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.mgr-heat-legend{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:12px}.mgr-heat-legend>span{padding:3px 6px;border-radius:4px;font-size:11px}.mgr-heat-note{color:var(--muted);font-size:11px}
.mgr-heat-heading,.mgr-heat-row{display:grid;grid-template-columns:minmax(220px,2.8fr) minmax(0,7fr) 126px;gap:12px;align-items:center}.mgr-heat-heading{position:sticky;top:var(--mgr-heat-sticky-top,64px);z-index:40;background:var(--surface);color:var(--muted);font-size:11px;padding:8px 0;border-bottom:1px solid var(--border)}.mgr-heat-heading>div,.mgr-heat-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}.mgr-heat-heading>div span{text-align:center}.mgr-heat-heading small{margin-left:4px}.mgr-heat-heading>span:last-child{text-align:right}
.mgr-heat-row{min-height:50px;box-sizing:border-box;border-bottom:1px solid var(--border);content-visibility:auto;contain-intrinsic-size:auto 50px}.mgr-heat-store{display:flex;align-items:center;gap:6px;min-width:0;min-height:0;text-align:left;border:0;background:transparent;color:var(--text);font:inherit;font-size:13px;font-weight:600;cursor:pointer;padding:4px;border-radius:4px;line-height:19px}.mgr-heat-store span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.mgr-heat-store i{font-style:normal;color:var(--brand);flex-shrink:0}.mgr-heat-store:hover{background:var(--blue-lt);color:var(--brand)}
.mgr-heat-cell{padding:8px 1px;text-align:center;border-radius:4px;font-size:12px;font-weight:700;min-width:0;line-height:18px}.mgr-heat-ok{background:var(--state-green);color:var(--green)}.mgr-heat-mild{background:var(--state-amber);color:var(--amber)}.mgr-heat-severe{background:var(--state-amber);color:var(--red);box-shadow:inset 0 -3px 0 var(--red)}.mgr-heat-empty,.mgr-heat-error,.mgr-heat-loading{background:var(--state-gray);color:var(--gray)}.mgr-heat-loading{animation:mgr-heat-pulse 1.5s ease-in-out infinite}.mgr-heat-total{font-size:12px;font-weight:600;color:var(--muted);text-align:right;white-space:nowrap}.mgr-heat-retry{min-height:0;border:1px solid var(--border);background:var(--surface);color:var(--red);padding:6px 4px;font:inherit;font-size:11px;border-radius:4px;cursor:pointer;white-space:nowrap}.mgr-heat-no-results{text-align:center;padding:24px 12px;color:var(--muted);font-size:13px}
@keyframes mgr-heat-pulse{50%{opacity:.45}}@media(prefers-reduced-motion:reduce){.mgr-heat-loading{animation:none}.mgr-heat-progressbar span{transition:none}}
@media(max-width:600px){.mgr-heatmap{padding:12px;max-width:100%;box-sizing:border-box}.mgr-heat-row{grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;padding:6px 0;min-height:88px;contain-intrinsic-size:auto 88px}.mgr-heat-store{min-height:38px;font-size:12px;line-height:17px}.mgr-heat-days{grid-column:1/-1;grid-row:2}.mgr-heat-total,.mgr-heat-retry{grid-column:2;grid-row:1}.mgr-heat-retry{min-height:32px}.mgr-heat-heading{grid-template-columns:minmax(0,1fr);gap:0}.mgr-heat-heading>span{display:none}.mgr-heat-heading small{display:block;margin:2px 0 0}.mgr-heat-days,.mgr-heat-heading>div{gap:3px}.mgr-heat-cell{font-size:10px;padding:6px 0}.mgr-heat-kpi{gap:4px;margin:12px 0}.mgr-heat-kpi button{padding:6px;gap:4px;flex-wrap:wrap}.mgr-heat-kpi strong{font-size:18px}.mgr-heat-controls{gap:8px}.mgr-heat-filters{gap:3px}.mgr-heat-filters button{padding:6px 7px;font-size:11px}.mgr-heat-note{flex-basis:100%;line-height:1.5}}

/* MGR-25: compact heatmap controls on phones; desktop legend stays unchanged. */
.mgr-heat-legend-mobile{display:none}
@media(max-width:600px){
 .mgr-heatmap header{flex-wrap:nowrap;gap:4px}.mgr-heatmap h2{font-size:18px;white-space:nowrap}.mgr-heatmap header>div{display:none}
 .mgr-heatmap .mgr-heat-kpi{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin:8px 0}
 .mgr-heatmap .mgr-heat-kpi button{height:44px;min-height:44px;min-width:0;padding:3px 5px;display:grid;grid-template-columns:1fr auto;gap:0 3px;text-align:left;box-sizing:border-box}
 .mgr-heat-kpi button>span{font-size:12px;white-space:nowrap}.mgr-heat-kpi strong{font-size:18px}.mgr-heat-kpi small{grid-column:1/-1;font-size:10px;line-height:12px}
 .mgr-heatmap .mgr-heat-controls{flex-wrap:nowrap;gap:6px;margin-bottom:6px}
 .mgr-heatmap .mgr-heat-filters{flex:1;min-width:0;flex-wrap:nowrap;overflow-x:auto}
 .mgr-heat-filters button{flex-shrink:0;white-space:nowrap;min-height:44px}
 .mgr-heat-controls label{flex:0 0 132px;font-size:0;min-width:0}.mgr-heat-controls select{width:100%;min-height:44px;font-size:var(--text-input);box-sizing:border-box}
 .mgr-heatmap>.mgr-heat-legend{display:none}.mgr-heat-legend-mobile{display:block;margin-bottom:4px}
 .mgr-heat-legend-mobile summary{display:flex;align-items:center;gap:8px;min-height:44px;font-size:12px;cursor:pointer}
 .mgr-heat-swatches{display:flex;gap:4px}.mgr-heat-swatches i{width:16px;height:16px;border-radius:4px}
 .mgr-heat-legend-mobile .mgr-heat-legend{margin:0 0 8px}.mgr-heat-note{display:block}
}
