:root {
  --ink: #0a0a0a;
  --muted: #6b7280;
  --soft: #9ca3af;
  --line: #e8eaf0;
  --line-strong: #d9dde6;
  --bg: #f5f6f8;
  --card: #ffffff;
  --accent: #0ea5e9;
  --accent-ink: #0369a1;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 18px 40px -28px rgba(15, 23, 42, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

/* ── Login ─────────────────────────────────────────────────────────────── */

.login-shell {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background: radial-gradient(70% 90% at 50% -10%, #e8f4fe 0%, transparent 60%),
    radial-gradient(50% 60% at 90% 100%, #eef2ff 0%, transparent 60%), var(--bg);
}

.login-card {
  width: min(420px, 100%);
  padding: 32px 30px 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand svg {
  width: 26px;
  height: 26px;
}

.login-card h1 {
  margin: 22px 0 6px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.login-card p.sub {
  margin: 0 0 22px;
  font-size: 13.5px;
  color: var(--muted);
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--soft);
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fbfcfd;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.field input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.btn-block {
  width: 100%;
}

.login-error {
  display: none;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12.5px;
  font-weight: 600;
}

.login-error.is-on {
  display: block;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pill {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

/* ── App shell ─────────────────────────────────────────────────────────── */

.app-shell {
  min-height: 100vh;
}

/* Floating capsule bar — same idea as the public site's nav pill. */
.capsule {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}

.capsule-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(1120px, 100%);
  padding: 8px 8px 8px 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 32px -16px rgba(15, 23, 42, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}

.capsule .brand {
  font-size: 15px;
}

.capsule-spacer {
  flex: 1;
}

.hamburger {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.hamburger span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Slide-over menu. */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(300px, 86vw);
  padding: 16px 14px;
  background: var(--card);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px -30px rgba(15, 23, 42, 0.45);
  transform: translateX(102%);
  visibility: hidden;
  transition: transform 0.28s cubic-bezier(0.22, 0.9, 0.3, 1), visibility 0.28s;
}

.drawer.is-open {
  transform: none;
  visibility: visible;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--soft);
}

.drawer-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #f4f6f9;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
}

.drawer-close:hover {
  background: #e9eef5;
  color: var(--ink);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8, 12, 20, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.scrim.is-on {
  opacity: 1;
  visibility: visible;
}

/* Floating bottom nav — the primary switcher on phones. */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 44px -18px rgba(15, 23, 42, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  transform: translateX(-50%);
}

.bottom-nav .nav-item {
  width: auto;
  flex-direction: column;
  gap: 3px;
  padding: 7px 11px;
  border-radius: 16px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #64748b;
  text-align: center;
}

.bottom-nav .nav-item svg {
  width: 18px;
  height: 18px;
}

.bottom-nav .nav-item.is-active {
  background: #eef7fe;
  color: var(--accent-ink);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #404a5a;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  opacity: 0.75;
}

.nav-item:hover {
  background: #f4f6f9;
}

.nav-item.is-active {
  background: #eef7fe;
  color: var(--accent-ink);
}

.nav-item.is-active svg {
  opacity: 1;
}

.drawer-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.user-meta {
  min-width: 0;
  line-height: 1.25;
}

.user-meta strong {
  display: block;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta span {
  font-size: 11px;
  color: var(--soft);
}

.logout {
  margin-top: 8px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: #475569;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.logout:hover {
  border-color: #cbd5e1;
  color: var(--ink);
}

.main {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 96px 20px 120px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.topbar .spacer {
  flex: 1;
}

.search {
  width: min(280px, 40vw);
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  outline: none;
}

.search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.role-badge {
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid;
}

.role-badge[data-role="SUPER_ADMIN"] {
  border-color: #f0c36b;
  background: #fff7e6;
  color: #92400e;
}

.role-badge[data-role="DEPUTY_ADMIN"] {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.role-badge[data-role="ADMIN"] {
  border-color: #c7f0d6;
  background: #f0fdf4;
  color: #15803d;
}

.demo-flag {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px dashed var(--line-strong);
  background: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--soft);
}

/* ── Cards + tables ────────────────────────────────────────────────────── */

.grid {
  display: grid;
  gap: 14px;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.split {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}

.card {
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.card h2 {
  margin: 0 0 4px;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.card p.hint {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--soft);
}

.stat-value {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat-delta {
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ok);
}

.stat-delta.is-down {
  color: var(--danger);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  padding: 8px 0;
  text-align: left;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--soft);
  border-bottom: 1px solid var(--line);
}

td {
  padding: 11px 0;
  border-bottom: 1px solid #f1f3f7;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: 0;
}

td .sub {
  display: block;
  font-size: 11.5px;
  color: var(--soft);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #f1f5f9;
  color: #475569;
}

.badge.ok {
  background: #ecfdf3;
  color: #15803d;
}

.badge.warn {
  background: #fff7ed;
  color: #c2410c;
}

.badge.owner {
  background: #fff7e6;
  color: #92400e;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin: 2px 0 16px;
}

.toolbar .search {
  width: min(360px, 100%);
}

.toolbar .btn {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
}

.state {
  padding: 22px 4px;
  color: var(--soft);
  text-align: center;
}

.state strong {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.state p {
  margin: 4px 0 0;
  font-size: 12px;
}

td.bio {
  max-width: 320px;
  color: var(--muted);
  font-size: 12.5px;
}

/* ── Home CMS ──────────────────────────────────────────────────────────── */

.hs-toolbar {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 4px;
}

.hs-toolbar h2 {
  margin: 0;
}

.hs-toolbar .spacer {
  flex: 1;
}

.hs-editor {
  margin-bottom: 14px;
  border-color: #cfe6f8;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.06);
}

.hs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

/* ── Home features editor ──────────────────────────────────────────────── */

.hs-form {
  display: block;
}

.hs-card {
  padding: 18px;
}

.hs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.hs-head h2 {
  margin: 0 0 4px;
  font-size: 15px;
}

.hs-head .hint {
  margin: 0;
  max-width: 62ch;
  font-size: 12px;
  color: var(--muted);
}

.hs-pill {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #15803d;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hs-block {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.hs-block-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.hs-step {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: #e0f2fe;
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 800;
}

.hs-block-copy {
  flex: 1 1 150px;
  min-width: 0;
}

.hs-block-copy h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
}

.hs-block-copy p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}

.hs-count {
  padding: 1px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
}

.feat-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  align-items: start;
}

.feat-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.feat-card.is-open {
  border-color: #cfe6f8;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.08);
}

.feat-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 8px 7px 10px;
}

.feat-toggle {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.feat-toggle:hover {
  background: #f8fafc;
}

.feat-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
}

.feat-card.is-open .feat-num {
  background: var(--accent);
  color: #fff;
}

.feat-preview {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.feat-preview strong,
.feat-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feat-preview strong {
  font-size: 12.5px;
}

.feat-preview span {
  font-size: 11px;
  color: var(--soft);
}

.feat-chevron {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.feat-tools {
  flex: none;
  display: flex;
  gap: 2px;
}

.feat-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.feat-icon:hover:not(:disabled) {
  background: #f1f5f9;
  color: var(--ink);
}

.feat-icon:disabled {
  opacity: 0.25;
  cursor: default;
}

.feat-icon.feat-del:hover {
  background: #fef2f2;
  color: var(--danger);
}

.feat-body {
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fcfdfe;
}

.feat-body[hidden] {
  display: none;
}

.feat-body .field {
  margin-bottom: 10px;
}

.feat-body .field:last-child {
  margin-bottom: 0;
}

.feat-empty {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--soft);
  font-size: 12.5px;
  text-align: center;
}

.hs-savebar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.hs-savebar .btn {
  min-height: 42px;
}

.feat-status {
  font-size: 12px;
  color: var(--muted);
}

.hs-dirty {
  padding: 3px 9px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hs-dirty[hidden] {
  display: none;
}

/* ── Per-card icon picker ──────────────────────────────────────────────── */

.feat-icon-chip {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--accent-ink);
}

.feat-icon-chip:empty {
  display: none;
}

.feat-icon-chip img,
.feat-emoji {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.feat-emoji-fallback {
  font-size: 16px;
  line-height: 1;
}

.feat-icon-default {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--soft);
}

.feat-pick {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 4px 10px;
  margin-bottom: 12px;
}

.feat-pick-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--soft);
}

.feat-pick-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.feat-pick-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.feat-pick-preview {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  overflow: hidden;
}

.feat-pick-preview img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.feat-pick-preview .feat-icon-default {
  width: 26px;
  height: 26px;
  border: 0;
  color: rgba(255, 255, 255, 0.8);
}

.feat-pick-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feat-pick-action {
  flex: none;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

body.ip-open {
  overflow: hidden;
}

.ip-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: rgba(15, 23, 42, 0.42);
}

.ip-overlay[hidden] {
  display: none;
}

.ip-sheet {
  display: flex;
  flex-direction: column;
  width: min(720px, 100%);
  max-height: min(86vh, 760px);
  overflow: hidden;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 30px 80px -30px rgba(15, 23, 42, 0.6);
}

.ip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
}

.ip-head strong {
  font-size: 14.5px;
}

.ip-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  cursor: pointer;
}

.ip-close:hover {
  background: #e2e8f0;
}

.ip-tabs {
  display: flex;
  gap: 6px;
  padding: 0 18px;
}

.ip-tab {
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ip-tab.is-active {
  border-color: transparent;
  background: var(--ink);
  color: #fff;
}

.ip-search {
  margin: 12px 18px 4px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fbfcfd;
  font-size: 13px;
  outline: none;
}

.ip-search:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

.ip-grid {
  flex: 1;
  overflow-y: auto;
  padding: 8px 18px 16px;
}

.ip-group + .ip-group {
  margin-top: 14px;
}

.ip-group-name {
  display: block;
  margin-bottom: 8px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--soft);
}

.ip-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
}

.ip-tiles-emoji {
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
}

.ip-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 68px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.ip-tile svg {
  width: 22px;
  height: 22px;
  color: var(--accent-ink);
}

.ip-tile:hover {
  border-color: var(--accent);
  background: #f0f9ff;
  transform: translateY(-1px);
}

.ip-tile.is-current {
  border-color: var(--accent);
  background: #e0f2fe;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.ip-tile span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ip-tile-emoji {
  min-height: 58px;
  padding: 8px;
  font-size: 22px;
  line-height: 1;
}

.ip-tile-emoji img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.ip-empty {
  padding: 30px 0;
  text-align: center;
  color: var(--soft);
  font-size: 12.5px;
}

.ip-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
}

.ip-foot .btn {
  flex: none;
  white-space: nowrap;
}

.ip-hint {
  font-size: 11.5px;
  color: var(--soft);
  text-align: right;
}

/* ── Ticker (marquee) editor ───────────────────────────────────────────── */

.mq-preview {
  overflow: hidden;
  margin-bottom: 12px;
  padding: 11px 0;
  border-radius: 12px;
  background: #0f172a;
}

.mq-preview-track {
  display: flex;
  align-items: center;
  gap: 16px;
  width: max-content;
  animation: mqPreview 26s linear infinite;
}

.mq-preview:hover .mq-preview-track {
  animation-play-state: paused;
}

.mq-preview-track span {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #cbd5e1;
  white-space: nowrap;
}

.mq-preview-track i {
  flex: none;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #38bdf8;
}

@keyframes mqPreview {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.mq-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.mq-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.mq-chip-x {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
}

.mq-chip-x:hover {
  background: #fee2e2;
  color: var(--danger);
}

.mq-empty {
  font-size: 12px;
  color: var(--soft);
}

.mq-add {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mq-add .btn {
  flex: none;
  min-height: 44px;
}

.mq-input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fbfcfd;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.mq-input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

@media (prefers-reduced-motion: reduce) {
  .mq-preview-track {
    animation: none;
  }
}

/* ── Posts (drops) ─────────────────────────────────────────────────────── */

.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fbfcfd;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
}

.field select:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

.posts-card {
  margin-top: 14px;
}

.post-list {
  display: grid;
  gap: 10px;
}

.post-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.post-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.post-head .spacer {
  flex: 1;
}

.post-date {
  font-size: 11.5px;
  color: var(--soft);
}

.post-item h3 {
  margin: 0 0 4px;
  font-size: 13.5px;
  letter-spacing: -0.01em;
}

.post-item p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.post-thumb {
  display: block;
  width: 100%;
  max-height: 160px;
  margin-top: 10px;
  border-radius: 10px;
  object-fit: cover;
}

.post-item .post-del:hover {
  border-color: #fecaca;
  background: #fff;
  color: var(--danger);
}

/* Local photo picker in the composer */

.post-photo-empty {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: #fbfcfd;
}

.post-photo-hint {
  font-size: 11.5px;
  color: var(--soft);
}

.post-photo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfd;
}

.post-photo-preview img {
  width: 84px;
  height: 64px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
  background: #e2e8f0;
}

.post-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hs-check {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hs-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fbfcfd;
  font: inherit;
  font-size: 13.5px;
  resize: vertical;
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

.btn-ghost {
  background: #fff;
  border-color: var(--line-strong);
  color: #334155;
}

.btn-danger {
  background: #fff;
  border-color: #fecaca;
  color: #b91c1c;
  margin-left: auto;
}

.btn-sm {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

td code {
  padding: 1px 6px;
  border-radius: 6px;
  background: #f1f5f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: #475569;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.list-row .grow {
  flex: 1;
  min-width: 0;
}

.list-row strong {
  display: block;
  font-size: 12.5px;
}

.list-row span {
  font-size: 11.5px;
  color: var(--soft);
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 150px;
  margin-top: 10px;
}

.bars i {
  flex: 1;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #7dd3fc, #0ea5e9);
  min-height: 8px;
}

.bars span {
  font-size: 10px;
  color: var(--soft);
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.denied {
  max-width: 430px;
  margin: 0 auto;
  text-align: center;
}

.denied h2 {
  margin: 14px 0 6px;
}

.denied p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13.5px;
}

@media (max-width: 980px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 88px 14px 112px;
  }

  .hs-grid {
    grid-template-columns: 1fr;
  }

  .capsule {
    top: 10px;
    padding: 0 10px;
  }

  .capsule-inner {
    padding: 7px 7px 7px 14px;
  }

  .role-badge {
    display: none;
  }
}

@media (max-width: 620px) {
  .hs-card {
    padding: 16px 14px;
  }

  .hs-block-head .btn {
    margin-left: 34px;
  }

  .feat-list {
    grid-template-columns: 1fr;
  }
}
