/*
 * Operation polish layer.
 * Keeps the existing page structure, but pushes every frontend toward a
 * denser workbench: compact copy, clearer risk states, and iPhone-safe controls.
 */
:root{
  --op-ink:#17202a;
  --op-muted:#5d6673;
  --op-line:rgba(23,32,42,.14);
  --op-line-strong:rgba(23,32,42,.22);
  --op-surface:rgba(255,255,255,.94);
  --op-surface-soft:rgba(248,250,252,.92);
  --op-primary:#1f4f62;
  --op-primary-strong:#153949;
  --op-accent:#24745f;
  --op-warn:#9a5b05;
  --op-danger:#a7352a;
  --op-radius:8px;
  --op-shadow:0 12px 30px rgba(15,23,42,.10);
  --op-shadow-soft:0 8px 18px rgba(15,23,42,.07);
}

body.ops-clean,
body.user-entry-page,
body.backend-shell-body,
body.backend2-body{
  color:var(--op-ink);
  letter-spacing:0;
}

body.ops-clean :is(h1,h2,h3,h4,p,span,strong,small,label,button,a,input,select,textarea,th,td),
body.user-entry-page :is(h1,h2,h3,h4,p,span,strong,small,label,button,a,input,select,textarea,th,td),
body.backend-shell-body :is(h1,h2,h3,h4,p,span,strong,small,label,button,a,input,select,textarea,th,td),
body.backend2-body :is(h1,h2,h3,h4,p,span,strong,small,label,button,a,input,select,textarea,th,td){
  letter-spacing:0 !important;
}

body.ops-clean :is(.container,.wrap,.page,.main,.content,.workspace,.backend-shell-main,.backend2-main),
body.user-entry-page :is(.container,.page,.entry-frame),
body.backend-shell-body :is(.backend-shell-main,.backend-shell-header),
body.backend2-body :is(.backend2-wrap){
  max-width:min(100% - 28px, 1280px);
}

@media (min-width: 981px){
  body.ops-clean.ops-nav-mounted :is(.container,.wrap,.page,.main,.content,.workspace){
    width:min(calc(100% - 28px), 1280px) !important;
    max-width:calc(100vw - 400px) !important;
  }

  body.ops-clean.ops-nav-mounted.ops-nav-collapsed :is(.container,.wrap,.page,.main,.content,.workspace){
    max-width:calc(100vw - 140px) !important;
  }

  body.ops-clean.ops-nav-mounted.ops-nav-floating:not(.ops-nav-collapsed) :is(.container,.wrap,.page,.main,.content,.workspace){
    max-width:calc(100vw - 360px) !important;
  }
}

body.ops-clean :is(.config-card,.form-card,.table-card,.summary-card,.result-box,.empty-state,.auth-page-hero,.auth-info-section,.auth-result-panel,.auth-risk-panel,.filter-card,.content-card,.meta-card,.stat-card,.chart-card,.tool-card,.danger-card,.result-card),
body.user-entry-page :is(.notice,.agreement-card,.promo-card,.game-url-card,.status-card,.item-card,.points-ad-card,.modifier-entry,.preview-box,.result,.empty-state,.entry-risk-card,.flow-card,.risk-card),
body.backend-shell-body :is(.backend-shell-hero,.backend-shell-panel,.backend-shell-cluster,.backend-shell-frame-card,.backend-shell-side-card,.backend-shell-mini,.backend-shell-login-card,.backend-shell-login-form),
body.backend2-body :is(.backend2-card,.backend2-hero,.backend2-home-hero,.backend2-home-signal-card,.backend2-home-summary-item,.backend2-home-spotlight-card,.backend2-toolbar){
  border:1px solid var(--op-line) !important;
  border-radius:var(--op-radius) !important;
  box-shadow:var(--op-shadow-soft) !important;
  background-color:var(--op-surface);
}

body.ops-clean .grid.polish-panel-grid{
  grid-template-columns:repeat(12,minmax(0,1fr)) !important;
}

body.ops-clean :is(.hero,.page-hero,.ui-hero,.auth-page-hero,.auth-info-section),
body.user-entry-page :is(.hero,.title,.entry-banner,.entry-hero),
body.backend-shell-body .backend-shell-hero,
body.backend2-body :is(.backend2-hero,.backend2-home-hero){
  padding:18px 20px !important;
  min-height:auto !important;
}

body.ops-clean :is(.hero,.page-hero,.ui-hero,.auth-page-hero,.auth-info-section) :is(h1,h2),
body.user-entry-page :is(.hero,.title,.entry-banner,.entry-hero) :is(h1,h2),
body.backend-shell-body .backend-shell-hero h1,
body.backend2-body :is(.backend2-hero,.backend2-home-hero) h1{
  margin-top:0;
  font-size:clamp(24px,3.2vw,38px) !important;
  line-height:1.12 !important;
  text-wrap:balance;
}

body.ops-clean :is(.hero,.page-hero,.ui-hero,.auth-page-hero,.auth-info-section) :is(p,.note,.desc,.subtitle),
body.user-entry-page :is(.hero,.title,.entry-banner,.entry-hero) :is(p,.note,.desc,.subtitle),
body.backend-shell-body .backend-shell-hero p,
body.backend2-body :is(.backend2-hero,.backend2-home-hero) p{
  max-width:760px;
  color:var(--op-muted) !important;
  font-size:13px !important;
  line-height:1.55 !important;
}

body.ops-clean :is(.note,.hint,.desc,.subtitle,.muted,.help,.help-text,.ops-compact-note,.workflow-box,.summary-box,.context-summary,.auth-workflow-hint,.backend2-sub,.backend2-caption,.drop-note,.hint-block),
body.user-entry-page :is(.note,.hint,.desc,.subtitle,.muted,.redeem-tip,.entry-flow-copy,.entry-risk-copy,.flow-card p,.risk-card p),
body.backend-shell-body :is(.backend-shell-brand-copy span,.backend-shell-rule-list,.backend-shell-note-pill,.backend-shell-side-card p,.backend-shell-cluster-head p),
body.backend2-body :is(.backend2-sub,.backend2-nav-lead,.backend2-toolbar-copy span,.backend2-home-lead,.backend2-home-signal-card p,.backend2-home-summary-item p){
  color:var(--op-muted) !important;
  font-size:12px !important;
  line-height:1.45 !important;
}

body.ops-clean :is(.workflow-box,.context-summary,.auth-workflow-hint),
body.user-entry-page :is(.entry-flow-grid,.flow-strip,.redeem-tip),
body.backend-shell-body .backend-shell-rule-list{
  display:block !important;
  margin-top:8px !important;
  padding:8px 10px !important;
  border:1px solid rgba(23,32,42,.10) !important;
  border-radius:var(--op-radius) !important;
  background:rgba(248,250,252,.72) !important;
  box-shadow:none !important;
}

body.user-entry-page .entry-flow-grid{
  display:grid !important;
  gap:8px !important;
}

body.user-entry-page .flow-strip{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:8px !important;
}

body.user-entry-page .redeem-tip{
  display:block !important;
}

body.backend-shell-body .backend-shell-rule-list{
  padding-left:24px !important;
}

body.backend2-body :is(.backend2-nav-banner,.backend2-nav-meta){
  display:none !important;
}

body.backend2-body .backend2-nav-lead{
  display:block !important;
  margin:4px 0 6px !important;
  color:rgba(255,255,255,.72) !important;
  font-size:11px !important;
  line-height:1.35 !important;
}

body.ops-clean :is(.toolbar,.filters,.actions,.button-row,.btn-row,.form-actions,.auth-action-row,.backend2-actions,.ops-action-row),
body.user-entry-page :is(.toolbar,.actions,.button-row,.btn-row,.form-actions,.entry-actions),
body.backend-shell-body :is(.backend-shell-nav,.backend-shell-frame-actions),
body.backend2-body :is(.backend2-actions,.backend2-toolbar-right,.backend2-tag-row){
  gap:8px !important;
}

body.ops-clean :is(button,.btn,.button,a.btn,a.button,input[type="button"],input[type="submit"]),
body.user-entry-page :is(button,.btn,.button,a.btn,a.button,input[type="button"],input[type="submit"]),
body.backend-shell-body :is(button,.backend-shell-button,.backend-shell-chip,.backend-shell-ghost,.backend-shell-inline,.backend-shell-nav a),
body.backend2-body :is(button,.backend2-btn,a.backend2-btn){
  min-height:38px;
  border-radius:var(--op-radius) !important;
  font-weight:750 !important;
  text-decoration:none;
  box-shadow:none !important;
}

body.ops-clean :is(button.primary,.btn-primary,.primary),
body.user-entry-page :is(button.primary,.btn-primary,.primary),
body.backend-shell-body :is(.backend-shell-button,.backend-shell-nav a[data-active="true"]),
body.backend2-body :is(.backend2-btn:not(.secondary):not(.warn):not(.bad):not(.danger)){
  background:linear-gradient(180deg,var(--op-primary),var(--op-primary-strong)) !important;
  color:#fff !important;
  border-color:transparent !important;
}

body.ops-clean :is(button.secondary,.btn.secondary,.secondary,a.secondary),
body.user-entry-page :is(button.secondary,.btn.secondary,.secondary,a.secondary),
body.backend-shell-body :is(.backend-shell-ghost,.backend-shell-chip,.backend-shell-nav a),
body.backend2-body :is(.backend2-btn.secondary){
  background:var(--op-surface-soft) !important;
  color:var(--op-ink) !important;
  border:1px solid var(--op-line) !important;
}

body.ops-clean :is(button.warn,.btn.warn,.button.warn,a.btn.warn,a.button.warn,input[type="button"].warn,input[type="submit"].warn),
body.user-entry-page :is(button.warn,.btn.warn,.button.warn,a.btn.warn,a.button.warn,input[type="button"].warn,input[type="submit"].warn),
body.backend2-body :is(.backend2-btn.warn,button.warn){
  background:linear-gradient(180deg,#b45309,#7c3f00) !important;
  border-color:rgba(124,63,0,.78) !important;
  color:#fff !important;
}

body.ops-clean :is(.warning,.notice.warn,.status.warn,.message.warn,.result.warn,.result-box.warn,.pill.warn,.chip.warn,.badge.warn),
body.user-entry-page :is(.warning,.notice.warn,.status.warn,.message.warn,.result.warn,.result-box.warn,.pill.warn,.chip.warn,.badge.warn),
body.backend2-body :is(.backend2-status.warn,.status.warn,.pill.warn,.chip.warn,.badge.warn){
  background:#fff7e8 !important;
  border-color:#e8c78e !important;
  color:#7b4600 !important;
}

body.ops-clean :is(button.danger,button.bad,.btn.danger,.btn.bad,.button.danger,.button.bad,a.btn.danger,a.btn.bad,input[type="button"].danger,input[type="button"].bad,input[type="submit"].danger,input[type="submit"].bad),
body.user-entry-page :is(button.danger,button.bad,.btn.danger,.btn.bad,.button.danger,.button.bad,a.btn.danger,a.btn.bad,input[type="button"].danger,input[type="button"].bad,input[type="submit"].danger,input[type="submit"].bad),
body.backend2-body :is(.backend2-btn.bad,.backend2-btn.danger,button.danger,button.bad){
  background:linear-gradient(180deg,#c24135,#8f241d) !important;
  border-color:rgba(143,36,29,.78) !important;
  color:#fff !important;
}

body.ops-clean :is(.error,.status.danger,.status.bad,.status.error,.message.danger,.message.bad,.message.error,.result.danger,.result.bad,.result.error,.result.err,.result-box.danger,.result-box.bad,.result-box.error,.pill.bad,.pill.danger,.chip.bad,.chip.danger,.badge.bad,.badge.danger),
body.user-entry-page :is(.error,.status.danger,.status.bad,.status.error,.message.danger,.message.bad,.message.error,.result.danger,.result.bad,.result.error,.result.err,.result-box.danger,.result-box.bad,.result-box.error,.pill.bad,.pill.danger,.chip.bad,.chip.danger,.badge.bad,.badge.danger),
body.backend2-body :is(.backend2-status.bad,.backend2-status.danger,.backend2-status.error,.status.bad,.status.danger,.status.error,.pill.bad,.pill.danger,.chip.bad,.chip.danger,.badge.bad,.badge.danger){
  background:#fff1ef !important;
  border-color:#ebb8b1 !important;
  color:#8f241d !important;
}

body.ops-clean :is(.progress-fill.warn,.version-progress-fill.warn),
body.user-entry-page :is(.progress-fill.warn,.version-progress-fill.warn),
body.backend2-body :is(.progress-fill.warn,.version-progress-fill.warn){
  background:linear-gradient(90deg,#b45309 0%,#f59e0b 100%) !important;
  border-color:transparent !important;
  color:inherit !important;
}

body.ops-clean :is(.progress-fill.bad,.version-progress-fill.bad,.progress-fill.danger,.version-progress-fill.danger),
body.user-entry-page :is(.progress-fill.bad,.version-progress-fill.bad,.progress-fill.danger,.version-progress-fill.danger),
body.backend2-body :is(.progress-fill.bad,.version-progress-fill.bad,.progress-fill.danger,.version-progress-fill.danger){
  background:linear-gradient(90deg,#b91c1c 0%,#ef4444 100%) !important;
  border-color:transparent !important;
  color:inherit !important;
}

body.ops-clean :is(.risk,.risk-note,.auth-risk-panel,.auth-risk-copy,.high-risk,.danger-zone),
body.user-entry-page :is(.risk,.risk-note,.entry-risk-card,.agreement-warning),
body.backend2-body :is(.risk,.risk-note,.danger-zone){
  display:block !important;
  border:1px solid #e8c78e !important;
  background:#fff7e8 !important;
  color:#6d3f00 !important;
}

body.ops-clean :is(input:not([type]),input[type="text"],input[type="search"],input[type="number"],input[type="email"],input[type="password"],input[type="url"],input[type="tel"],input[type="date"],input[type="datetime-local"],input[type="time"],select,textarea),
body.user-entry-page :is(input:not([type]),input[type="text"],input[type="search"],input[type="number"],input[type="email"],input[type="password"],input[type="url"],input[type="tel"],input[type="date"],input[type="datetime-local"],input[type="time"],select,textarea),
body.backend-shell-body :is(input:not([type]),input[type="text"],input[type="search"],input[type="number"],input[type="email"],input[type="password"],input[type="url"],input[type="tel"],input[type="date"],input[type="datetime-local"],input[type="time"],select,textarea),
body.backend2-body :is(input:not([type]),input[type="text"],input[type="search"],input[type="number"],input[type="email"],input[type="password"],input[type="url"],input[type="tel"],input[type="date"],input[type="datetime-local"],input[type="time"],select,textarea){
  border-radius:var(--op-radius) !important;
  border:1px solid var(--op-line-strong) !important;
  background:#fff !important;
}

body.ops-clean :is(.table-wrap,.table-wrapper,.table-scroll,.overflow-table),
body.user-entry-page :is(.table-wrap,.table-wrapper,.table-scroll,.overflow-table),
body.backend2-body :is(.backend2-table-wrap,.table-wrap,.table-wrapper),
body.backend-shell-body :is(.table-wrap,.table-wrapper){
  border-radius:var(--op-radius);
  border:1px solid var(--op-line);
  background:#fff;
}

body.ops-clean :is(th),
body.user-entry-page :is(th),
body.backend2-body :is(th),
body.backend-shell-body :is(th){
  background:#f4f7f9 !important;
  color:#22303d !important;
}

body.backend2-body .backend2-nav-copy span{
  display:none !important;
}

body.backend2-body .backend2-nav-link small,
body.backend2-body .backend2-nav-link:is(:hover,.active) small{
  display:block !important;
  margin-top:2px;
  color:rgba(255,255,255,.70) !important;
  font-size:11px !important;
  line-height:1.35 !important;
  max-height:2.8em;
  overflow:hidden;
  overflow-wrap:anywhere;
}

body.backend2-body .backend2-hero::after{
  opacity:.16 !important;
  filter:none !important;
}

body.backend2-body .backend2-hero::before{
  opacity:.58 !important;
}

body.backend-shell-body .backend-shell-hero::after,
body.ops-clean :is(.orb,.blob,.glow,.decor-orb){
  display:none !important;
}

body.user-entry-page :is(.entry-risk-grid,.entry-flow-grid,.entry-quick-grid){
  margin-top:10px !important;
}

@media (max-width: 760px){
  body.ops-clean,
  body.user-entry-page,
  body.backend-shell-body,
  body.backend2-body{
    font-size:14px;
  }

  body.ops-clean :is(.container,.wrap,.page,.main,.content,.workspace,.backend-shell-main,.backend2-main),
  body.user-entry-page :is(.container,.page,.entry-frame),
  body.backend-shell-body :is(.backend-shell-main,.backend-shell-header),
  body.backend2-body :is(.backend2-wrap){
    max-width:100%;
  }

  body.ops-clean :is(.hero,.page-hero,.ui-hero,.auth-page-hero,.auth-info-section),
  body.user-entry-page :is(.hero,.title,.entry-banner,.entry-hero),
  body.backend-shell-body .backend-shell-hero,
  body.backend2-body :is(.backend2-hero,.backend2-home-hero){
    padding:14px !important;
  }

  body.backend2-body .backend2-nav-link small{
    display:block !important;
    max-height:3.9em;
  }
}
