/* Operator workspace. Every rule is scoped away from the public site. */
body.admin-mode {
  --bg: #f7f8fa;
  --ink: #20242b;
  --text: #30363f;
  --muted: #65707e;
  --line: #e2e5e9;
  --green: #18734c;
  --red: #c03434;
  --amber: #98620c;
  --teal: #315bd2;
  --blue: #315bd2;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body.admin-mode::before, body.admin-mode::after,
body.admin-mode > .site-footer { display: none; }
body.admin-mode .app { width: 100%; max-width: none; margin: 0; padding: 0; }
body.admin-mode .admin-console { min-height: 100dvh; padding-left: 232px; }
body.admin-mode .admin-icon { width: 19px; height: 19px; flex: 0 0 19px; vertical-align: middle; }
body.admin-mode .admin-sidebar {
  position: fixed; z-index: 40; inset: 0 auto 0 0;
  width: 232px; display: flex; flex-direction: column;
  background: #fff; border-right: 1px solid var(--line);
}
body.admin-mode .admin-sidebar-brand { display: flex; align-items: center; padding: 30px 24px 26px; }
body.admin-mode .admin-sidebar-brand a { display: grid; gap: 12px; }
body.admin-mode .admin-sidebar-brand img { width: 178px; height: auto; }
body.admin-mode .admin-sidebar-brand span { font-size: 11px; color: var(--muted); letter-spacing: .09em; }
body.admin-mode .admin-tabs {
  position: static; display: block; margin: 0; padding: 0 14px 20px;
  border: 0; background: none; box-shadow: none; backdrop-filter: none;
  overflow: auto; flex: 1;
}
body.admin-mode .admin-nav-group { margin-bottom: 24px; }
body.admin-mode .admin-nav-group > p { margin: 0 12px 9px; color: #7c8490; font-size: 11px; font-weight: 600; letter-spacing: .05em; }
body.admin-mode .admin-tabs a {
  display: flex; justify-content: flex-start; align-items: center; gap: 12px;
  min-height: 44px; margin: 3px 0; padding: 10px 12px;
  border: 1px solid transparent; border-radius: 6px;
  background: none; color: #58616d; font-size: 13px; font-weight: 500;
  box-shadow: none; text-decoration: none;
}
body.admin-mode .admin-tabs a:hover { background: #f4f5f7; color: var(--ink); }
body.admin-mode .admin-tabs a.is-active { background: #edf1fc; color: #2c50b6; font-weight: 700; border-color: #e0e7fc; }
body.admin-mode .admin-sidebar-footer { padding: 16px 22px; border-top: 1px solid var(--line); }
body.admin-mode .admin-account { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
body.admin-mode .admin-account-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: #edf0f5; font-size: 13px; font-weight: 700; }
body.admin-mode .admin-account strong { display: block; font-size: 11px; font-weight: 600; }
body.admin-mode .admin-account small { display: block; font-size: 11px; color: var(--muted); }
body.admin-mode .admin-logout { display: flex; align-items: center; gap: 9px; min-height: 40px; background: none; border: none; padding: 6px 0; color: var(--muted); cursor: pointer; font-size: 12px; }
body.admin-mode .admin-workspace { min-width: 0; }
body.admin-mode .admin-topbar {
  position: sticky; top: 0; z-index: 20; min-height: 68px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 12px 32px; background: #fff; border-bottom: 1px solid var(--line);
}
body.admin-mode .admin-topbar-title { display: flex; align-items: center; gap: 16px; min-width: 0; }
body.admin-mode .admin-breadcrumb { font-size: 12px; color: var(--muted); white-space: nowrap; }
body.admin-mode .admin-breadcrumb > span { margin-left: 16px; color: #c3c7ce; }
body.admin-mode .admin-topbar h1 { margin: 0; font-size: 14px; font-weight: 650; line-height: 1.4; letter-spacing: 0; }
body.admin-mode .admin-public-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; color: var(--muted); font-size: 12px; white-space: nowrap; }
body.admin-mode .admin-public-link .admin-icon { width: 14px; height: 14px; flex-basis: 14px; }
body.admin-mode .admin-section { max-width: 1560px; margin: 0 auto; padding: 24px 32px 48px; }
body.admin-mode .admin-section > * { min-width: 0; }
body.admin-mode .admin-section-jumps { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 24px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
body.admin-mode .admin-section-jumps[hidden] { display: none; }
body.admin-mode .admin-section-select { display: none; }
body.admin-mode .admin-section-jumps button { background: none; border: none; border-radius: 4px; padding: 4px 0; min-height: 32px; cursor: pointer; font-size: 12px; color: var(--muted); font-weight: 500; }
body.admin-mode .admin-section-jumps button:hover { color: #315bd2; text-decoration: underline; text-underline-offset: 5px; }
body.admin-mode .admin-panel, body.admin-mode .notice {
  padding: 24px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; box-shadow: 0 1px 2px #20242b03; backdrop-filter: none;
  min-width: 0; scroll-margin-top: 88px;
}
body.admin-mode .admin-section > .admin-panel { margin: 0 0 24px; }
body.admin-mode .admin-section .admin-layout { margin-bottom: 24px; gap: 24px; }
body.admin-mode .admin-section h2 { margin: 0 0 10px; font-size: 18px; line-height: 1.5; font-weight: 700; letter-spacing: -.025em; }
body.admin-mode .admin-section h3 { font-size: 15px; line-height: 1.55; font-weight: 650; }
body.admin-mode .admin-help { font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.8; }
body.admin-mode .eyebrow { font-size: 10px; color: #79828e; letter-spacing: .12em; font-weight: 600; margin-bottom: 7px; }
body.admin-mode .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
body.admin-mode .toolbar > div:first-child { flex: 1 1 270px; min-width: 0; }
body.admin-mode .toolbar h2 { margin-bottom: 5px; }
body.admin-mode .toolbar .admin-help { max-width: 76em; }
body.admin-mode .compact-toolbar { margin-bottom: 20px; }
body.admin-mode .select-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
body.admin-mode .action-button, body.admin-mode .mini-button,
body.admin-mode .chip, body.admin-mode .admin-icon-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 8px 14px; border: 1px solid #dce0e6; border-radius: 6px;
  background: #fff; color: #39424e; font-size: 12px; font-weight: 600;
  line-height: 1.5; box-shadow: 0 1px 2px #20242b06; cursor: pointer;
  text-shadow: none; transform: none; white-space: normal;
}
body.admin-mode .mini-button { min-height: 34px; padding: 5px 10px; font-size: 12px; }
body.admin-mode .action-button:hover, body.admin-mode .mini-button:hover, body.admin-mode .chip:hover { background: #f4f6f9; border-color: #bbc3cf; transform: none; box-shadow: none; }
body.admin-mode .action-button.primary { background: #252a34; color: #fff; border-color: #252a34; }
body.admin-mode .action-button.primary:hover { background: #3d4552; }
body.admin-mode .mini-button.danger, body.admin-mode .action-button.danger { color: #b32e35; border-color: #ebc9cc; background: #fff; }
body.admin-mode button:disabled { cursor: not-allowed; opacity: .5; }
body.admin-mode .chip.is-active { background: #edf1fc; color: #2c50b6; border-color: #cbd6f8; box-shadow: none; }
body.admin-mode :is(a,button,input,select,textarea,summary):focus-visible { outline: 3px solid #91acf0; outline-offset: 3px; }
body.admin-mode input:not([type="checkbox"]):not([type="radio"]),
body.admin-mode select, body.admin-mode textarea {
  border: 1px solid #d8dde4; background: #fff; color: #252c35;
  border-radius: 6px; min-height: 40px; padding: 8px 11px;
  font-weight: 400; font-size: 13px; max-width: 100%; box-shadow: 0 1px 2px #20242b03;
}
body.admin-mode input[type="checkbox"], body.admin-mode input[type="radio"] { accent-color: #315bd2; width: 18px; height: 18px; }
body.admin-mode .admin-filter-select { width: auto; min-width: 140px; }
body.admin-mode .admin-form { gap: 20px; }
body.admin-mode .admin-form .checkbox-label { display: flex; align-items: center; gap: 9px; min-height: 32px; }
body.admin-mode .admin-form .checkbox-label input { flex: 0 0 18px; margin: 0; }
body.admin-mode .form-grid { gap: 16px; }
body.admin-mode .form-grid label, body.admin-mode .admin-form > label { font-size: 12px; font-weight: 600; color: #424b58; gap: 7px; }
body.admin-mode .admin-form textarea { line-height: 1.8; min-height: 104px; }
body.admin-mode .period-form-grid, body.admin-mode .upload-panel,
body.admin-mode .lottery-condition-tags, body.admin-mode .lottery-batch-products { background: #f8f9fb; border-color: var(--line); border-radius: 6px; }
body.admin-mode .dashboard-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
body.admin-mode .dashboard-metric { padding: 18px; min-height: 120px; gap: 6px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: none; }
body.admin-mode .dashboard-metric span { font-size: 12px; font-weight: 500; color: var(--muted); }
body.admin-mode .dashboard-metric strong { font-size: 29px; line-height: 1.25; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
body.admin-mode .dashboard-metric small { font-size: 11px; font-weight: 400; line-height: 1.6; }
body.admin-mode .dashboard-metric.ok { border-color: #d1e6da; background: #fcfefd; }
body.admin-mode .dashboard-metric.warn { border-color: #ebdfc7; background: #fffefa; }
body.admin-mode .dashboard-metric.bad { border-color: #efcdd0; background: #fffafb; }
body.admin-mode .scrape-summary { gap: 12px; grid-template-columns: repeat(3,minmax(0,1fr)); }
body.admin-mode .scrape-summary > div { border-color: var(--line); border-radius: 6px; background: #fafbfc; padding: 16px; }
body.admin-mode .scrape-summary strong { font-size: 27px; font-weight: 650; font-variant-numeric: tabular-nums; }
body.admin-mode .scrape-summary span { font-size: 11px; font-weight: 500; }
body.admin-mode .evidence-summary:not(.price-evidence-summary) { grid-template-columns: repeat(4,minmax(0,1fr)); }
body.admin-mode .coverage-overview { gap: 12px; }
body.admin-mode .coverage-shortage-group { border-color: var(--line); background: #fff; border-radius: 6px; }
body.admin-mode .coverage-shortage-group summary { background: #f7f8fa; }
body.admin-mode .coverage-shortage-row { background: #fff; }
body.admin-mode .table-wrap { border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: none; max-width: 100%; overflow: auto; }
body.admin-mode table { font-size: 12px; }
body.admin-mode th { background: #f6f7f9; color: #646d7a; font-size: 11px; font-weight: 600; padding: 12px 14px; }
body.admin-mode td { padding: 14px; font-size: 12px; line-height: 1.7; border-color: #edf0f3; }
body.admin-mode tbody tr:hover td { background: #fafbfe; }
body.admin-mode td a:not(.mini-button) { color: #3156b8; text-underline-offset: 3px; }
body.admin-mode .evidence-matrix .evidence-missing-link,
body.admin-mode .evidence-matrix .evidence-missing-link > :is(span,small) { color: var(--red); }
body.admin-mode .scrape-board { gap: 16px; }
body.admin-mode .scrape-group { background: #fff; border-radius: 7px; padding: 18px; box-shadow: none; }
body.admin-mode .scrape-page-pill { background: #f7f9fb; border-radius: 5px; box-shadow: none; }
body.admin-mode .scrape-page-pill strong { font-size: 12px; font-weight: 600; }
body.admin-mode .calendar-tabs-panel, body.admin-mode .evidence-tabs-panel { padding: 6px; background: #f0f2f5; border-color: #e5e8ed; }
body.admin-mode .calendar-admin-tabs { gap: 4px; }
body.admin-mode .calendar-admin-tabs button { min-height: 60px; padding: 10px 14px; background: transparent; border-color: transparent; border-radius: 5px; box-shadow: none; }
body.admin-mode .calendar-admin-tabs button.is-active { background: #fff; border-color: #dfe4ed; color: #2c50b6; box-shadow: 0 1px 3px #20242b0a; }
body.admin-mode .calendar-admin-tabs strong { font-size: 13px; font-weight: 650; }
body.admin-mode .calendar-admin-tabs span { font-size: 11px; font-weight: 400; color: var(--muted); }
body.admin-mode .calendar-primary-panel { border-color: var(--line); box-shadow: none; }
body.admin-mode .calendar-panel-title > span { background: #eef2fb; color: #3156b8; border-radius: 4px; font-size: 11px; }
body.admin-mode .calendar-admin-details summary { font-size: 15px; font-weight: 600; }
body.admin-mode .calendar-workflow-grid > div { background: #f8f9fb; border-color: var(--line); border-radius: 6px; }
body.admin-mode .calendar-workflow-grid strong { background: #e9edf5; color: #566581; border-radius: 5px; }
body.admin-mode .calendar-workflow-grid small { font-weight: 400; }
body.admin-mode .evidence-stage-tabs { gap: 4px; }
body.admin-mode .evidence-stage-tabs button { border-color: transparent; background: transparent; border-radius: 5px; font-size: 13px; font-weight: 500; box-shadow: none; }
body.admin-mode .evidence-stage-tabs button.is-active { background: #fff; border-color: #dfe4ed; color: #2c50b6; }
body.admin-mode .evidence-card { border-radius: 7px; box-shadow: none; background: #fff; }
body.admin-mode .evidence-price-row strong { font-size: 22px; }
body.admin-mode .admin-notice-list { gap: 14px; }
body.admin-mode .admin-notice-card { border: 1px solid #e9dcc6; border-left: 3px solid #c08a30; border-radius: 6px; padding: 20px; background: #fff; box-shadow: none; }
body.admin-mode .admin-notice-card.critical { background: #fff; border-color: #edcfd0; border-left-color: #cb444c; }
body.admin-mode .admin-notice-card.workflow-resolved { border-color: #d2e6d9; border-left-color: #3b8860; }
body.admin-mode .admin-notice-card h3 { font-size: 14px; }
body.admin-mode .admin-notice-context { gap: 0; border-top: 1px solid #edf0f3; }
body.admin-mode .admin-notice-context > div { background: none; border: 0; border-bottom: 1px solid #edf0f3; border-radius: 0; padding: 10px 0; }
body.admin-mode .admin-notice-context dt { font-size: 11px; font-weight: 500; color: var(--muted); }
body.admin-mode .admin-notice-context dd { font-size: 12px; font-weight: 400; color: #424b58; }
body.admin-mode .admin-notice-context .next dd { color: #244d9f; font-weight: 500; }
body.admin-mode .weekly-focus-card, body.admin-mode .weekly-report-summary,
body.admin-mode .weekly-revenue-actions, body.admin-mode .weekly-kpi-card { border-radius: 7px; box-shadow: none; }
body.admin-mode .empty:not(.status-badge) { background: #f8f9fb; border: 1px dashed #d9dfe7; border-radius: 6px; color: var(--muted); font-size: 13px; padding: 28px 18px; }
body.admin-mode .status-badge { min-height: 24px; padding: 3px 7px; border: 0; border-radius: 4px; font-size: 11px; line-height: 1.5; font-weight: 600; }
body.admin-mode .empty.good { color: var(--green); background: #f6fbf8; border-color: #d2e6d9; }
body.admin-mode .admin-console-footer { max-width: 1560px; margin: auto; display: flex; align-items: center; gap: 12px; padding: 20px 32px; border-top: 1px solid var(--line); color: #7c8490; font-size: 10px; }
body.admin-mode .admin-console-footer button { margin-left: auto; min-height: 36px; border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; }
body.admin-mode .admin-icon-button { width: 40px; height: 40px; padding: 8px; flex-shrink: 0; }
body.admin-mode .admin-menu-toggle, body.admin-mode .admin-menu-close,
body.admin-mode .admin-sidebar-backdrop { display: none; }
body.admin-mode .app > .section { max-width: 520px; margin: 8vh auto; padding: 28px 20px; }
body.admin-mode .app > .section h1 { font-size: 26px; letter-spacing: -.03em; }
body.admin-mode .app > .section .lead { font-size: 13px; line-height: 1.8; }
/* The narrow login card must never inherit the old desktop two-column grid.
   Otherwise the note becomes a vertical strip and stretches all form rows. */
body.admin-mode .login-panel { grid-template-columns: minmax(0,1fr); align-items: start; gap: 20px; max-width: 100%; }
body.admin-mode .login-panel > * { min-width: 0; }
body.admin-mode .login-form { align-self: start; align-content: start; gap: 12px; }
body.admin-mode .login-form label { font-size: 13px; align-content: start; }
body.admin-mode .login-form input { width: 100%; height: 48px; min-height: 48px; }
body.admin-mode .login-form .action-button { width: 100%; height: 48px; min-height: 48px; }
body.admin-mode .security-note { margin: 0; font-size: 12px; border-top: 1px solid var(--line); padding: 16px; overflow-wrap: anywhere; }
body.admin-mode .security-note h2 { font-size: 13px; }
@media (max-width: 1200px) {
  body.admin-mode .admin-console { padding-left: 208px; }
  body.admin-mode .admin-sidebar { width: 208px; }
  body.admin-mode .admin-sidebar-brand { padding: 28px 20px; }
  body.admin-mode .admin-sidebar-brand img { width: 166px; }
  body.admin-mode .admin-section { padding: 22px; }
  body.admin-mode .admin-topbar { padding-inline: 22px; }
  body.admin-mode .admin-panel { padding: 20px; }
  body.admin-mode .admin-layout, body.admin-mode .admin-layout.wide { grid-template-columns: minmax(0,1fr); }
  body.admin-mode .coverage-overview { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  body.admin-mode .admin-section-jumps { display: none; }
  body.admin-mode .admin-section-select:not([hidden]) { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; color: var(--muted); font-size: 12px; white-space: nowrap; }
  body.admin-mode .admin-section-select select { width: 100%; min-width: 0; }
  body.admin-mode .admin-console { padding-left: 0; }
  body.admin-mode .admin-sidebar { visibility: hidden; transform: translateX(-100%); width: min(288px,calc(100vw - 48px)); z-index: 60; }
  body.admin-mode .is-menu-open .admin-sidebar { visibility: visible; transform: none; }
  body.admin-mode .admin-sidebar-brand { justify-content: space-between; padding: 22px 16px; }
  body.admin-mode .admin-menu-toggle, body.admin-mode .admin-menu-close { display: inline-flex; }
  body.admin-mode .is-menu-open .admin-sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 50; background: #17223266; border: 0; width: 100%; height: 100dvh; }
  body.admin-mode .admin-breadcrumb { display: none; }
  body.admin-mode .admin-topbar { min-height: 64px; padding: 10px 18px; }
  body.admin-mode .admin-topbar-title { gap: 12px; }
  body.admin-mode .admin-tabs a { min-height: 46px; font-size: 14px; }
  body.admin-mode .action-button, body.admin-mode .mini-button, body.admin-mode .chip { min-height: 44px; }
  body.admin-mode input:not([type="checkbox"]):not([type="radio"]), body.admin-mode select, body.admin-mode textarea { font-size: 16px; min-height: 44px; }
}
@media (max-width: 600px) {
  body.admin-mode .admin-section { padding: 16px 14px 32px; }
  body.admin-mode .admin-topbar { padding-inline: 14px; gap: 8px; }
  body.admin-mode .admin-topbar h1 { font-size: 13px; }
  body.admin-mode .admin-public-link { font-size: 11px; gap: 5px; }
  body.admin-mode .admin-panel, body.admin-mode .notice { padding: 18px 14px; border-radius: 7px; }
  body.admin-mode .admin-section > .admin-panel { margin-bottom: 18px; }
  body.admin-mode .admin-section-jumps { gap: 4px 14px; margin-bottom: 18px; padding-bottom: 12px; }
  body.admin-mode .admin-section-jumps button { min-height: 40px; font-size: 11px; }
  body.admin-mode .dashboard-metrics, body.admin-mode .scrape-summary,
  body.admin-mode .evidence-summary:not(.price-evidence-summary) { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  body.admin-mode .dashboard-metric { min-height: 112px; padding: 13px 11px; }
  body.admin-mode .dashboard-metric strong { font-size: 25px; }
  body.admin-mode .dashboard-metric span, body.admin-mode .dashboard-metric small { font-size: 11px; }
  body.admin-mode .scrape-summary > div { padding: 13px; }
  body.admin-mode .scrape-summary strong { font-size: 24px; }
  body.admin-mode .admin-notice-card { padding: 16px 12px; }
  body.admin-mode .admin-notice-context > div { grid-template-columns: minmax(0,1fr); gap: 3px; }
  body.admin-mode .form-grid { grid-template-columns: minmax(0,1fr); }
  body.admin-mode .calendar-admin-tabs { gap: 2px; }
  body.admin-mode .calendar-tabs-panel { padding: 4px; }
  body.admin-mode .calendar-admin-tabs button { padding: 10px 6px; min-height: 68px; }
  body.admin-mode .calendar-admin-tabs strong { font-size: 12px; }
  body.admin-mode .calendar-admin-tabs span { font-size: 10px; line-height: 1.6; }
  body.admin-mode .calendar-workflow-grid { grid-template-columns: minmax(0,1fr); }
  body.admin-mode .admin-filter-select { min-width: 0; width: 100%; }
  body.admin-mode .select-row { width: 100%; }
  body.admin-mode .select-row select { flex: 1; width: auto; }
  body.admin-mode .toolbar > div:first-child { flex-basis: 100%; }
  body.admin-mode .admin-console-footer { padding-inline: 16px; gap: 8px; }
}
