/* Postik UX layer v3 — components for dialogs, tasks, drafts, icons, motion, tiles */

/* ---------- Inline icons (replacing emoji) ---------- */
.ux-ic { display: inline-flex; align-items: center; justify-content: center; vertical-align: -0.18em; width: 1.1em; height: 1.1em; flex-shrink: 0; }
.ux-ic.gap { margin-right: 0.38em; }
.ux-ic .ic, .ic { width: 100%; height: 100%; }
button .ux-ic, .btn .ux-ic { opacity: 0.92; }
.app-toast #toastIcon .ux-ic { width: 16px; height: 16px; color: var(--gold-200); }
.ux-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 0.05em; flex-shrink: 0; }
.ux-dot.gap { margin-right: 6px; }
.ux-dot-ok { background: var(--status-success); box-shadow: 0 0 0 3px rgba(76, 199, 154, 0.14); }
.ux-dot-bad { background: var(--status-danger); box-shadow: 0 0 0 3px rgba(239, 107, 107, 0.14); }
.ux-dot-warn { background: var(--status-warning); box-shadow: 0 0 0 3px rgba(232, 176, 79, 0.14); }
.ux-dot-idle { background: #6b6963; }

/* ---------- Buttons: extra variants ---------- */
.btn .ic { width: 17px; height: 17px; }
.btn.sm { min-height: 36px; padding: 8px 14px; font-size: 13px; border-radius: 12px; }
.btn-danger { background: linear-gradient(180deg, #e46a6a, #c44f4f); color: #fff; border: 1px solid rgba(255, 190, 190, 0.25); box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 10px 24px -10px rgba(228, 106, 106, 0.6); font-weight: 800; }
.btn-ghost-danger { background: rgba(239, 107, 107, 0.07); color: #f3a3a3; border: 1px solid rgba(239, 107, 107, 0.2); min-width: 46px; }
.btn-ghost-danger.wide { flex: 1; }
.ux-icon-btn { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); color: var(--text-muted); cursor: pointer; }
.ux-icon-btn .ic { width: 16px; height: 16px; }

/* ---------- Tap targets (min 40px) ---------- */
.bots-hub-header .tool-btn { min-height: 40px; padding: 0 16px; border-radius: 13px; font-size: 13px; }
.segment-btn { min-height: 40px; }
.cbot-btn-action-icon, .cbot-btn-action-danger { min-width: 42px; min-height: 42px; border-radius: 12px; }
.cbot-btn-action-primary, .cbot-btn-action-secondary { min-height: 42px; border-radius: 12px; }
.btn-post-action { min-height: 40px; border-radius: 12px; }
.btn-add-ch-glass { min-height: 34px; padding: 6px 13px; }
.sheet-close-btn { min-width: 36px; min-height: 36px; }

/* ---------- Unified stat tiles ---------- */
.audit-kpi-card, .cbot-saas-stat-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.audit-kpi-val, .cbot-saas-stat-num, .ux-stat-num, #profChannelsCount, #profPostsCount, #profRefsCount {
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; letter-spacing: -0.02em;
}
.audit-kpi-val { font-size: 24px; font-weight: 800; }
.cbot-saas-stat-num { font-size: 19px; font-weight: 800; color: #fff; }
.audit-kpi-label, .cbot-saas-stat-lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.audit-kpi-sub { font-size: 12px; color: var(--text-muted); }

/* ---------- Off-palette fixes ---------- */
.badge-privetka, .cbot-saas-type-badge.badge-privetka { background: rgba(207, 201, 189, 0.10); color: #e4dfd4; border: 1px solid rgba(207, 201, 189, 0.22); }
.activity-bar-fill { border-radius: 999px; }

/* ---------- Skeletons ---------- */
.skel-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.skel-card { height: 84px; border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.05); }
.skel-card.tall { height: 150px; }
.skel-line, .skel-pill { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.11) 40%, rgba(255,255,255,0.05) 80%); background-size: 240% 100%; animation: skel 1.3s ease-in-out infinite; }
.skel-line.w40 { width: 40%; } .skel-line.w55 { width: 55%; } .skel-line.w70 { width: 72%; }
.skel-pill { display: inline-block; width: 110px; height: 36px; border-radius: 12px; margin-right: 8px; }
@keyframes skel { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }

/* ---------- Dialog sheet ---------- */
.ux-dialog-backdrop { position: fixed; inset: 0; z-index: 100050; display: flex; align-items: flex-end; justify-content: center; background: rgba(4,4,5,0); backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); transition: background .22s ease, backdrop-filter .22s ease; }
.ux-dialog-backdrop.open { background: rgba(4,4,5,0.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ux-dialog { width: 100%; max-width: 520px; padding: 26px 20px calc(18px + env(safe-area-inset-bottom, 12px)); border-radius: 26px 26px 0 0; text-align: center;
  background: linear-gradient(180deg, #1b1b1d 0%, #121214 100%); border: 1px solid rgba(255,255,255,0.08); border-bottom: none;
  box-shadow: 0 -24px 60px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.06); transform: translateY(100%); transition: transform .3s cubic-bezier(0.22, 1, 0.36, 1); }
.ux-dialog-backdrop.open .ux-dialog { transform: translateY(0); }
.ux-dialog-ico { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--gold-200); background: linear-gradient(145deg, rgba(255, 255, 255,0.16), rgba(255, 255, 255,0.05)); border: 1px solid rgba(255, 255, 255,0.25); }
.ux-dialog.is-danger .ux-dialog-ico { color: #f3a3a3; background: rgba(239,107,107,0.09); border-color: rgba(239,107,107,0.25); }
.ux-dialog-ico .ic { width: 22px; height: 22px; }
.ux-dialog-title { font-size: 18px; font-weight: 800; letter-spacing: -0.025em; color: #fff; margin-bottom: 6px; }
.ux-dialog-text { font-size: 14px; line-height: 1.5; color: var(--text-muted); max-width: 360px; margin: 0 auto; white-space: pre-line; }
.ux-dialog-input { width: 100%; margin-top: 16px; padding: 13px 14px; border-radius: 14px; font: inherit; font-size: 16px; color: var(--text-main); background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); outline: none; }
.ux-dialog-input:focus { border-color: rgba(255, 255, 255,0.55); box-shadow: 0 0 0 4px rgba(255, 255, 255,0.1); }
.ux-dialog-actions { display: flex; gap: 10px; margin-top: 22px; }
.ux-dialog-actions .btn { flex: 1; }

/* ---------- Undo toast ---------- */
.ux-undo { position: fixed; left: 14px; right: 14px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); z-index: 10040; max-width: 460px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 16px; overflow: hidden;
  background: rgba(28, 27, 25, 0.96); border: 1px solid rgba(255,255,255,0.09); box-shadow: 0 18px 40px -12px rgba(0,0,0,0.85);
  transform: translateY(24px); opacity: 0; pointer-events: none; transition: transform .3s cubic-bezier(0.22,1,0.36,1), opacity .2s ease; }
.ux-undo.show { transform: none; opacity: 1; pointer-events: auto; }
.ux-undo-ico { width: 18px; height: 18px; color: var(--text-muted); display: inline-flex; }
.ux-undo-text { flex: 1; font-size: 13.5px; font-weight: 650; color: var(--text-main); }
.ux-undo-btn { min-height: 36px; padding: 0 14px; border-radius: 11px; border: 1px solid rgba(255, 255, 255,0.35); background: rgba(255, 255, 255,0.1); color: var(--gold-200); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.ux-undo-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--gold-400); transform-origin: left; }
.ux-undo.show .ux-undo-bar { animation: undoBar 5s linear forwards; }
@keyframes undoBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- Tasks ---------- */
.ux-task-tabs { margin-bottom: 12px; display: flex; }
.ux-task-tabs .segment-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; padding: 0 4px; white-space: nowrap; }
.ux-count { font-size: 10.5px; font-weight: 800; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.07); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ux-restart-summary { text-align: left; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); margin-bottom: 12px; font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.ux-restart-summary b { color: #fafafa; }
.ux-restart-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.ux-restart-preset { min-height: 36px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04); color: var(--text-muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.ux-restart-preset.active { background: linear-gradient(180deg, rgba(217,180,108,0.2), rgba(28,28,33,0.95)); border-color: rgba(217,180,108,0.5); color: #efd092; }
.ux-restart-input { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.14); background: #141418; color: #fafafa; font-size: 16px; margin-bottom: 14px; box-sizing: border-box; color-scheme: dark; }
.ux-live-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ux-live-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #7fd9b6; background: rgba(76, 199, 154, 0.09); border: 1px solid rgba(76, 199, 154, 0.24); font-variant-numeric: tabular-nums; }
.ux-live-pill i { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2); animation: applePulse 2.2s infinite; }
.ux-task.active { border-top-color: rgba(76, 199, 154, 0.28); }
.ux-task-telemetry { margin-top: 11px; padding: 8px 10px; border-radius: 12px; background: rgba(76, 199, 154, 0.05); border: 1px solid rgba(76, 199, 154, 0.14); }
.ux-telemetry-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; font-weight: 700; color: #a7f3d0; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.ux-telemetry-row .ux-telemetry-pct { color: rgba(239, 208, 146, 0.85); font-size: 11px; }
.ux-telemetry-bar { width: 100%; height: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.ux-telemetry-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4ade80, #efd092); transition: width 0.6s linear; }
.segment-btn.active .ux-count { background: rgba(255, 255, 255,0.18); color: var(--gold-200); }
.ux-search { position: relative; margin-bottom: 12px; }
.ux-search > .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-dim); pointer-events: none; }
.ux-search .search-input { width: 100%; padding: 12px 14px 12px 40px; font-size: 14px; -webkit-appearance: none; }
.ux-task-list { display: flex; flex-direction: column; gap: 10px; }
.ux-task { padding: 16px; border-radius: 20px; background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.016)); border: 1px solid rgba(255,255,255,0.065); border-top-color: rgba(255,255,255,0.1); box-shadow: var(--shadow-card); transition: opacity .2s ease, transform .2s ease; animation: uxIn .32s cubic-bezier(0.22,1,0.36,1) both; }
.ux-task:nth-child(2) { animation-delay: .03s; } .ux-task:nth-child(3) { animation-delay: .06s; } .ux-task:nth-child(4) { animation-delay: .09s; } .ux-task:nth-child(n+5) { animation-delay: .12s; }
.ux-task.leaving, .ux-draft.leaving { opacity: 0; transform: scale(0.97); }
.ux-task.done { opacity: 0.78; }
.ux-task-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ux-task-mode { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.ux-task-mode .ic { width: 14px; height: 14px; color: var(--gold-200); }
.ux-task-mode b { color: var(--text-dim); font-weight: 700; font-variant-numeric: tabular-nums; }
.ux-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.01em; border: 1px solid transparent; }
.ux-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ux-status.is-on { color: #7fd9b6; background: rgba(76,199,154,0.09); border-color: rgba(76,199,154,0.25); }
.ux-status.is-on i { box-shadow: 0 0 0 3px rgba(76,199,154,0.18); animation: applePulse 2.4s infinite; }
.ux-status.is-pause { color: #f0c77a; background: rgba(232,176,79,0.08); border-color: rgba(232,176,79,0.22); }
.ux-status.is-done { color: var(--text-muted); background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); }
.ux-task-title { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; color: #fff; line-height: 1.3; }
.ux-task-preview { margin-top: 6px; font-size: 13px; color: var(--text-muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ux-task-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ux-task-meta span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 10px; font-size: 12px; color: var(--text-muted); background: rgba(255,255,255,0.035); border: 1px solid rgba(255,255,255,0.05); }
.ux-task-meta span b { color: var(--text-main); font-weight: 700; }
.ux-task-meta .ic { width: 13px; height: 13px; color: var(--text-dim); }
.ux-task-period { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ux-task-period .ic { width: 14px; height: 14px; color: var(--text-dim); }
.ux-task-period .sep { color: var(--text-dim); }
.ux-task-actions { display: flex; gap: 8px; margin-top: 14px; }
.ux-task-actions .btn { min-height: 42px; padding: 10px 14px; font-size: 13.5px; }
.ux-task-actions .btn-secondary { flex: 1; }
.empty-state.compact { padding: 28px 20px; }

/* ---------- Draft card ---------- */
.ux-draft { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; margin-bottom: 16px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255,0.12), rgba(255, 255, 255,0.03)); border: 1px solid rgba(255, 255, 255,0.28); transition: opacity .2s, transform .2s; animation: uxIn .35s cubic-bezier(0.22,1,0.36,1) both; }
.ux-draft-ico { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--gold-200); background: rgba(255, 255, 255,0.12); flex-shrink: 0; }
.ux-draft-ico .ic { width: 18px; height: 18px; }
.ux-draft-body { flex: 1; min-width: 0; }
.ux-draft-title { font-size: 14px; font-weight: 800; color: #fff; }
.ux-draft-text { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.ux-draft-actions { display: flex; gap: 6px; align-items: center; }

/* ---------- Timezone collapse ---------- */
.ux-tz-toggle { width: 100%; margin-top: 2px; }
.ux-collapsible { display: none !important; }
.ux-collapsible.open { display: grid !important; margin-top: 12px; animation: uxIn .25s ease both; }
div.ux-collapsible.open:not(.pill-grid-2) { display: block !important; }

/* ---------- Keyboard open: hide floating chrome ---------- */
body.kb-open .app-bottom-dock, body.kb-open .step-footer { opacity: 0; pointer-events: none; transform: translateY(20px); }
.app-bottom-dock, .step-footer { transition: opacity .18s ease, transform .22s ease; }

/* ---------- Motion ---------- */
@keyframes uxIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ux-view-in { animation: uxIn .32s cubic-bezier(0.22,1,0.36,1) both; }
.ux-view-in .clean-section-card { animation: uxIn .38s cubic-bezier(0.22,1,0.36,1) both; }
.ux-view-in .clean-section-card:nth-of-type(2) { animation-delay: .04s; }
.ux-view-in .clean-section-card:nth-of-type(3) { animation-delay: .08s; }
.ux-view-in .clean-section-card:nth-of-type(n+4) { animation-delay: .12s; }
.btn, .segment-btn, .pill-btn, .dock-tab-btn { transition: transform .16s cubic-bezier(0.22,1,0.36,1), background .2s ease, border-color .2s ease, color .2s ease; }
@media (prefers-reduced-motion: reduce) { .ux-view-in, .ux-task, .ux-draft, .skel-line, .ux-view-in .clean-section-card { animation: none !important; } }

/* ═══════════ OP UI polish 20261118: status badge dots ═══════════ */
.badge-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.badge-dot-green { background: #3ddc84; box-shadow: 0 0 8px rgba(61, 220, 132, 0.6); }
.badge-dot-amber { background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.55); }
.badge-dot-red { background: #f87171; box-shadow: 0 0 8px rgba(248, 113, 113, 0.55); }
.badge-dot-gray { background: #8a867e; }
.badge-dot-neutral { background: #a3a09a; opacity: 0.7; }
.badge-status-banned {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.badge-status-frozen {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.38);
  color: #fcd34d;
}
.cbot-saas-card.cbot-card-banned {
  border-color: rgba(239, 68, 68, 0.38);
}
.cbot-saas-card.cbot-card-frozen {
  border-color: rgba(245, 158, 11, 0.42);
}
#btnCheckBotsHealth.is-spinning svg {
  animation: opSaveSpin 0.75s linear infinite;
}
.fmt-toolbar { display: flex; flex-wrap: wrap; gap: 4px; }
.fmt-btn {
  min-width: 38px; height: 38px; padding: 0 11px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.09);
  color: #e4e4e7; font-size: 13px; font-weight: 600; cursor: pointer;
}
.fmt-btn:active { background: rgba(255, 255, 255, 0.14); }
.cbot-btn-action-icon.is-alert {
  border-color: rgba(245, 158, 11, 0.45);
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.12);
}
.daily-chart-wrap {
  display: flex; align-items: flex-end; gap: 6px; height: 52px; padding-top: 6px;
}
.daily-chart-col {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 9.5px; color: #71717a;
}
.daily-chart-bar {
  width: 100%; max-width: 20px; border-radius: 4px 4px 2px 2px; background: #ffffff; opacity: 0.85;
}
.ab-stat-row {
  display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px;
  border-radius: 8px; background: rgba(255,255,255,0.04); font-size: 11px; color: #d4d4d8;
}
.badge-dot-pulse { animation: badgeDotPulse 1.6s ease-in-out infinite; }
@keyframes badgeDotPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.82); } }

/* ═══════════ OP UI polish 20261118: sticky save bar (z-index below modals 10050 / AI 100000) ═══════════ */
#opSaveBar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; display: none; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(14, 14, 17, 0.92); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.65); }
#opSaveBar.op-save-bar-show { display: flex; animation: opSaveBarIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes opSaveBarIn { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
#opSaveDirty { display: none; flex: 1; align-items: center; min-width: 0; font-size: 12.5px; font-weight: 650; color: #fbbf24;
  animation: opDirtyPulse 1.8s ease-in-out infinite; }
@keyframes opDirtyPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
#opSaveState { display: none; flex: 1; align-items: center; font-size: 12.5px; font-weight: 700; color: #4ade80; white-space: nowrap; }
#opSaveState.op-save-state-error { color: #f87171; }
#opSaveBarBtn { flex: 1; min-width: 132px; min-height: 46px; padding: 11px 18px; border-radius: 13px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.08); color: #e4e4e7;
  font: inherit; font-size: 14px; font-weight: 700;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
#opSaveBar:has(#opSaveDirty:not([style*="none"])) #opSaveBarBtn { background: #ffffff; color: #09090b; border-color: #ffffff; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); }
#opSaveBarBtn:active { transform: scale(0.985); background: #e4e4e7; }
#opSaveBar:has(#opSaveDirty:not([style*="none"]), #opSaveState:not([style*="none"])) #opSaveBarBtn { flex: 0 0 auto; }
#opSaveBarBtn:disabled { opacity: 0.65; cursor: default; }
#opSaveBarBtn.op-save-busy::before { content: ''; display: inline-block; width: 13px; height: 13px; margin-right: 7px;
  vertical-align: -2px; border-radius: 50%; border: 2px solid rgba(9, 9, 11, 0.25); border-top-color: #09090b;
  animation: opSaveSpin 0.7s linear infinite; }
@keyframes opSaveSpin { to { transform: rotate(360deg); } }

/* ═══════════ OP UI polish 20261118: inline hint chip (open/close without JS) ═══════════ */
details.op-hint { position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; vertical-align: middle; cursor: pointer;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14);
  color: #a3a09a; font-size: 12px; font-weight: 800; line-height: 1; }
details.op-hint summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; border-radius: 50%; color: inherit; font: inherit; outline: none;
  -webkit-tap-highlight-color: transparent; }
details.op-hint summary::-webkit-details-marker { display: none; }
details.op-hint[open] { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.4); color: #ffffff; }
details.op-hint .op-hint-body { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: 220px; padding: 10px 12px; border-radius: 12px; z-index: 950; cursor: default; text-align: left;
  background: #18181b; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.75);
  color: #a3a09a; font-size: 12.5px; line-height: 1.45; font-weight: 500; }

/* ═══════════ OP UI polish 20261118: mobile 390px — compact bar, tap targets ≥ 40px ═══════════ */
@media (max-width: 390px) {
  #opSaveBar { gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); }
  #opSaveBarBtn { min-height: 42px; padding: 9px 14px; font-size: 13px; }
  #opSaveDirty { font-size: 11.5px; }
  #opSaveState { font-size: 11.5px; }
  details.op-hint .op-hint-body { width: 190px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .badge-dot-pulse, #opSaveBar.op-save-bar-show, #opSaveDirty, #opSaveBarBtn.op-save-busy::before { animation: none; }
}