/* Align offline / PWA chrome icons with top-bar height */
.top-bar-offline-cluster .chrome-ico {
  box-sizing: border-box;
}

/* Compact icon chrome — status / install / sim */
.chrome-ico {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--bg, #fff);
  color: var(--text, #0f172a);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.chrome-ico:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}
.chrome-ico:active { transform: translateY(0); }
.chrome-ico svg { display: block; pointer-events: none; }

.chrome-ico--status.is-online {
  border-color: rgba(5, 150, 105, 0.35);
  background: linear-gradient(160deg, #ecfdf5, #d1fae5);
  color: #047857;
}
.chrome-ico--status.is-offline {
  border-color: rgba(220, 38, 38, 0.4);
  background: linear-gradient(160deg, #fef2f2, #fee2e2);
  color: #b91c1c;
}
.chrome-ico--status.is-syncing {
  border-color: rgba(217, 119, 6, 0.4);
  background: linear-gradient(160deg, #fffbeb, #fef3c7);
  color: #b45309;
}
.chrome-ico--status.is-conflict {
  border-color: rgba(225, 29, 72, 0.45);
  background: linear-gradient(160deg, #fff1f2, #ffe4e6);
  color: #be123c;
}

.chrome-ico--install {
  border-color: rgba(180, 83, 9, 0.35);
  background: linear-gradient(160deg, #fffbeb, #fde68a);
  color: #92400e;
}
.chrome-ico--install:hover {
  background: linear-gradient(160deg, #fef3c7, #fcd34d);
  color: #78350f;
}

.chrome-ico--sim,
.chrome-ico--license {
  border-style: dashed;
  border-color: rgba(99, 102, 241, 0.45);
  background: linear-gradient(160deg, #eef2ff, #e0e7ff);
  color: #3730a3;
}
.chrome-ico--sim.is-on,
.chrome-ico--license.is-on {
  border-style: solid;
  border-color: rgba(220, 38, 38, 0.45);
  background: linear-gradient(160deg, #fef2f2, #fecaca);
  color: #991b1b;
}

.chrome-ico--lease {
  width: auto;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-color: rgba(14, 165, 233, 0.4);
  background: linear-gradient(160deg, #ecfeff, #cffafe);
  color: #0e7490;
}
.chrome-ico--lease-wide {
  min-width: 7.6rem;
  padding: 0 10px;
  border-radius: 11px;
}
.chrome-ico--lease.is-offline-mode {
  border-color: rgba(14, 165, 233, 0.55);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.12);
}
.chrome-ico--lease.is-urgent {
  border-color: rgba(249, 115, 22, 0.5);
  background: linear-gradient(160deg, #fff7ed, #ffedd5);
  color: #c2410c;
}
.chrome-lease-stack {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chrome-lease-time {
  font-size: 0.72rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  line-height: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.chrome-ico-badge {
  position: absolute;
  top: -5px;
  inset-inline-end: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg, #fff);
}

.chrome-ico-spin {
  animation: chrome-ico-spin 1s linear infinite;
}
@keyframes chrome-ico-spin { to { transform: rotate(360deg); } }

/* Lux tip under icons (native title kept for a11y / long-press) */
.top-bar-offline-cluster .chrome-ico[data-chrome-tip] {
  overflow: visible;
}
.top-bar-offline-cluster .chrome-ico[data-chrome-tip]::after {
  content: attr(data-chrome-tip);
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-start: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  z-index: 80;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
  transition: opacity .15s ease, transform .15s ease;
}
html[dir="rtl"] .top-bar-offline-cluster .chrome-ico[data-chrome-tip]::after,
.app-shell.rtl .top-bar-offline-cluster .chrome-ico[data-chrome-tip]::after {
  transform: translateX(50%) translateY(4px);
}
.top-bar-offline-cluster .chrome-ico[data-chrome-tip]:hover::after,
.top-bar-offline-cluster .chrome-ico[data-chrome-tip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
html[dir="rtl"] .top-bar-offline-cluster .chrome-ico[data-chrome-tip]:hover::after,
html[dir="rtl"] .top-bar-offline-cluster .chrome-ico[data-chrome-tip]:focus-visible::after,
.app-shell.rtl .top-bar-offline-cluster .chrome-ico[data-chrome-tip]:hover::after,
.app-shell.rtl .top-bar-offline-cluster .chrome-ico[data-chrome-tip]:focus-visible::after {
  transform: translateX(50%) translateY(0);
}

/* Legacy pill classes kept for any stray markup */
.offline-chip,
.offline-sim-btn,
.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

body.theme-zad-dark .chrome-ico--status.is-online,
html[data-theme="dark"] .chrome-ico--status.is-online,
.app-shell.theme-dark .chrome-ico--status.is-online {
  background: rgba(6, 78, 59, 0.55);
  border-color: rgba(52, 211, 153, 0.45);
  color: #d1fae5;
}
body.theme-zad-dark .chrome-ico--sim,
body.theme-zad-dark .chrome-ico--license,
html[data-theme="dark"] .chrome-ico--sim,
html[data-theme="dark"] .chrome-ico--license,
.app-shell.theme-dark .chrome-ico--sim,
.app-shell.theme-dark .chrome-ico--license {
  background: rgba(49, 46, 129, 0.55);
  border-color: rgba(165, 180, 252, 0.55);
  color: #e0e7ff;
}
body.theme-zad-dark .chrome-ico--sim.is-on,
body.theme-zad-dark .chrome-ico--license.is-on,
html[data-theme="dark"] .chrome-ico--sim.is-on,
html[data-theme="dark"] .chrome-ico--license.is-on,
.app-shell.theme-dark .chrome-ico--sim.is-on,
.app-shell.theme-dark .chrome-ico--license.is-on {
  background: rgba(127, 29, 29, 0.55);
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
}
body.theme-zad-dark .chrome-ico--lease,
html[data-theme="dark"] .chrome-ico--lease,
.app-shell.theme-dark .chrome-ico--lease {
  background: rgba(8, 47, 73, 0.65);
  border-color: rgba(56, 189, 248, 0.5);
  color: #a5f3fc;
}
body.theme-zad-dark .chrome-ico--lease.is-urgent,
html[data-theme="dark"] .chrome-ico--lease.is-urgent,
.app-shell.theme-dark .chrome-ico--lease.is-urgent {
  background: rgba(67, 20, 7, 0.65);
  border-color: rgba(251, 146, 60, 0.55);
  color: #fed7aa;
}

body.theme-zad-dark .chrome-ico--install,
html[data-theme="dark"] .chrome-ico--install,
.app-shell.theme-dark .chrome-ico--install {
  background: rgba(120, 53, 15, 0.55);
  border-color: rgba(251, 191, 36, 0.5);
  color: #fde68a;
}

.nav-menu a.nav-offline-locked,
.nav-menu .nav-group-toggle.nav-offline-locked {
  opacity: .38 !important;
  filter: grayscale(0.85);
  position: relative;
  cursor: not-allowed !important;
}
.nav-menu a.nav-offline-locked::after {
  content: "🔒";
  font-size: .7em;
  margin-inline-start: 6px;
  opacity: .95;
}
.nav-menu a.nav-offline-locked:hover,
.nav-menu .nav-group-toggle.nav-offline-locked:hover {
  cursor: not-allowed !important;
}
.nav-menu.is-offline-mode .nav-group.has-active:not(:has(a.nav-link:not(.nav-offline-locked))),
.nav-menu .nav-group.is-offline-locked {
  opacity: .72;
}
.nav-menu .nav-group.is-offline-locked .nav-group-toggle {
  pointer-events: none;
}

.offline-lock-page {
  max-width: 520px;
  margin: 12vh auto;
  padding: 28px 24px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--sx-accent, #8b5cf6) 14%, rgba(10,8,16,.82));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  text-align: center;
  color: #f8fafc;
}
.offline-lock-page .lock-ico { font-size: 2.4rem; margin-bottom: 8px; }
.offline-lock-page h2 { margin: 0 0 8px; font-size: 1.25rem; }
.offline-lock-page p { margin: 0 0 16px; opacity: .78; line-height: 1.5; }
.offline-toast-host {
  position: fixed;
  inset-inline-end: 16px;
  bottom: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}
.offline-toast {
  pointer-events: auto;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15,12,24,.92);
  border: 1px solid rgba(167,139,250,.35);
  color: #f8fafc;
  box-shadow: 0 16px 36px rgba(0,0,0,.4);
  font-size: .86rem;
}
.offline-toast strong { display: block; margin-bottom: 2px; }
.offline-sync-page { padding: 4px 2px 28px; max-width: min(1280px, 100%); }
.ofs-hero {
  display: flex; flex-wrap: nowrap; gap: 14px; align-items: center;
  justify-content: flex-start;
  padding: 16px 20px; margin-bottom: 14px;
  border-radius: 20px;
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(14,165,233,.14), transparent 50%),
    linear-gradient(165deg, rgba(15,23,42,.04), rgba(15,23,42,.02));
  border: 1px solid rgba(15,23,42,.08);
}
.ofs-hero-copy { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.ofs-kicker {
  margin: 0 0 4px; font-size: .68rem; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase; color: #0284c7;
}
.ofs-hero h2 { margin: 0 0 4px; font-size: 1.35rem; font-weight: 850; white-space: nowrap; }
.ofs-lead {
  margin: 0; max-width: none; opacity: .72; line-height: 1.45; font-size: .86rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ofs-hero-actions {
  display: flex; flex-wrap: nowrap; gap: 8px; align-items: center;
  flex: 0 0 auto; margin-inline-start: 4px;
}
.ofs-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px; font-size: .78rem; font-weight: 800;
  border: 1px solid transparent; line-height: 1; white-space: nowrap;
}
.ofs-pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.ofs-pill.is-on { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.ofs-pill.is-off { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
button.ofs-action {
  cursor: pointer; font: inherit; font-weight: 800; font-size: .78rem;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  appearance: none; -webkit-appearance: none;
}
button.ofs-action:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .1);
}
button.ofs-action:disabled {
  opacity: .45; cursor: not-allowed; transform: none; box-shadow: none;
}
.ofs-action-primary {
  background: linear-gradient(135deg, #e0f2fe, #bae6fd) !important;
  color: #0369a1 !important;
  border: 1px solid #7dd3fc !important;
  box-shadow: 0 4px 12px rgba(14, 165, 233, .18);
}
.ofs-action-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #bae6fd, #7dd3fc) !important;
  border-color: #38bdf8 !important;
}
.ofs-action-ghost {
  background: #fff !important;
  color: #334155 !important;
  border: 1px solid rgba(15, 23, 42, .14) !important;
}
.ofs-action-ghost:hover:not(:disabled) {
  background: #f8fafc !important;
  border-color: rgba(14, 165, 233, .35) !important;
  color: #0369a1 !important;
}
.ofs-action-ico {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; opacity: .85; flex: 0 0 auto;
}
.ofs-action-ico-refresh {
  border-radius: 2px;
  width: 9px; height: 9px;
  background: transparent;
  border: 2px solid currentColor;
  border-top-color: transparent;
  opacity: .9;
}
@media (max-width: 900px) {
  .ofs-hero { flex-wrap: wrap; align-items: flex-start; }
  .ofs-hero-actions { flex-wrap: wrap; margin-inline-start: 0; width: 100%; }
  .ofs-lead { white-space: normal; }
  .ofs-hero h2 { white-space: normal; }
}
.ofs-steps {
  list-style: none; margin: 0 0 14px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px;
}
.ofs-steps li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 16px;
  background: #fff; border: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 8px 20px rgba(15,23,42,.04);
}
.ofs-steps strong {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 10px;
  display: grid; place-items: center; font-size: .8rem;
  background: linear-gradient(135deg, #0ea5e9, #0369a1); color: #fff;
}
.ofs-steps span { font-size: .82rem; line-height: 1.45; opacity: .88; }
.ofs-auto-note {
  margin-bottom: 14px; padding: 14px 16px; border-radius: 16px;
  background: rgba(14,165,233,.08); border: 1px solid rgba(14,165,233,.2);
}
.ofs-auto-note strong { display: block; margin-bottom: 4px; }
.ofs-auto-note p { margin: 0; font-size: .86rem; line-height: 1.5; opacity: .85; }
.ofs-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.ofs-stat {
  padding: 14px 16px; border-radius: 16px;
  background: #fff; border: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 10px 24px rgba(15,23,42,.05);
}
.ofs-stat span { display: block; font-size: .72rem; font-weight: 700; opacity: .65; margin-bottom: 4px; }
.ofs-stat em { font-style: normal; font-size: 1.4rem; font-weight: 900; }
.ofs-stat-sm { font-size: .95rem !important; font-weight: 750 !important; }
.ofs-stat.ok { border-color: rgba(16,185,129,.25); }
.ofs-stat.warn { border-color: rgba(245,158,11,.35); background: #fffbeb; }
.ofs-stat.bad { border-color: rgba(239,68,68,.3); background: #fef2f2; }
.ofs-summary { margin: 0 0 12px; font-size: .82rem; opacity: .75; }
.ofs-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center;
}
.ofs-search {
  flex: 1 1 220px; display: flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 0 12px; border-radius: 12px;
  background: #fff; border: 1px solid rgba(15,23,42,.12);
}
.ofs-search input {
  flex: 1; border: 0; outline: 0; background: transparent; font: inherit; min-width: 0;
}
.ofs-toolbar select {
  min-height: 42px; padding: 0 12px; border-radius: 12px;
  border: 1px solid rgba(15,23,42,.12); background: #fff; font: inherit;
}
.ofs-panel {
  margin-bottom: 14px; padding: 14px 16px; border-radius: 18px;
  background: #fff; border: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 12px 28px rgba(15,23,42,.05);
}
.ofs-panel > header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 10px;
}
.ofs-panel h3 { margin: 0; font-size: 1rem; }
.ofs-panel small {
  padding: 2px 8px; border-radius: 999px; font-weight: 800;
  background: rgba(14,165,233,.12); color: #0369a1;
}
.ofs-empty { margin: 8px 0; opacity: .65; font-size: .88rem; }
.ofs-table-wrap { overflow: auto; }
.ofs-panel table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.ofs-panel th, .ofs-panel td {
  padding: 10px 8px; border-bottom: 1px solid rgba(15,23,42,.06); text-align: start;
}
.ofs-type, .ofs-status {
  display: inline-block; padding: 2px 8px; border-radius: 8px;
  background: rgba(15,23,42,.06); font-weight: 700; font-size: .75rem;
}
.offline-sync-page .stat-row { display: none; }

/* Offline license lock — luxury center gate */
.ofl-lock-overlay {
  position: fixed; inset: 0; z-index: 12000;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(70% 60% at 50% 20%, rgba(14,165,233,.22), transparent 55%),
    linear-gradient(160deg, rgba(8,12,24,.92), rgba(15,23,42,.94));
  backdrop-filter: blur(10px);
}
.ofl-lock-card {
  position: relative; width: min(520px, 100%);
  padding: 28px 26px 22px;
  border-radius: 24px;
  background: linear-gradient(165deg, rgba(255,255,255,.12), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  color: #f8fafc;
  overflow: hidden;
}
.ofl-lock-orb {
  position: absolute; width: 180px; height: 180px; border-radius: 50%;
  top: -60px; inset-inline-end: -40px;
  background: radial-gradient(circle, rgba(251,191,36,.35), transparent 70%);
  pointer-events: none;
}
.ofl-lock-kicker {
  margin: 0 0 6px; font-size: .72rem; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase; color: #67e8f9;
}
.ofl-lock-card h2 { margin: 0 0 8px; font-size: 1.45rem; font-weight: 850; }
.ofl-lock-lead { margin: 0 0 10px; opacity: .82; line-height: 1.55; font-size: .92rem; }
.ofl-lock-meta { margin: 0 0 14px; font-size: .82rem; opacity: .7; }
.ofl-lock-steps {
  display: grid; gap: 8px; margin-bottom: 16px;
}
.ofl-lock-steps > div {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: 14px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
}
.ofl-lock-steps span {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 9px;
  display: grid; place-items: center; font-size: .75rem; font-weight: 800;
  background: linear-gradient(135deg, #0ea5e9, #0369a1); color: #fff;
}
.ofl-lock-steps p { margin: 0; font-size: .84rem; line-height: 1.45; opacity: .9; }
.ofl-code-field { display: grid; gap: 6px; margin-bottom: 10px; font-size: .82rem; font-weight: 700; }
.ofl-code-field input {
  min-height: 46px; padding: 0 14px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(15,23,42,.55); color: #f8fafc; font: inherit; letter-spacing: .04em;
}
.ofl-lock-error { margin: 0 0 10px; color: #fecaca; font-size: .85rem; }
.ofl-lock-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ofl-lock-foot { margin: 0; font-size: .78rem; opacity: .65; line-height: 1.45; }

.owner-offline-license-card .owner-offline-code-row {
  margin: 12px 0 6px; padding: 12px 14px; border-radius: 14px;
  background: rgba(14,165,233,.08); border: 1px dashed rgba(14,165,233,.35);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.owner-offline-license-card .ic-invite-code {
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 800; letter-spacing: .04em; font-size: .95rem;
}
