/* Makronova Feedback admin. Plain CSS, no build step. */
:root {
  --bg: #F6F7FB;
  --surface: #ffffff;
  --text: #1c2733;
  --muted: #5d6b7a;
  --line: #E5E9F2;
  --sidebar: #ffffff;
  --sidebar-text: #1c2733;
  --sidebar-hover: rgba(17, 24, 39, 0.06);
  --brand: #c33764;
  --brand-dark: #9b2a4e;
  --brand-soft: #f8e6ed;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn: #9a6700;
  --warn-soft: #fff4d6;
  --ok: #1a7f37;
  --ok-soft: #e4f6ea;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0B0E17;
  --surface: #151C2E;
  --text: #F8FAFC;
  --muted: #94A3B8;
  --line: #26334D;
  --sidebar: #080C18;
  --sidebar-text: #cfe0e4;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --danger-soft: #3a1a18;
  --warn-soft: #3a2e12;
  --ok-soft: #143322;
  --brand-soft: color-mix(in srgb, var(--brand) 14%, var(--surface));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
pre { background: #0f1720; color: #d7e2ee; padding: 1rem; border-radius: var(--radius); overflow: auto; max-height: 28rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.narrow { max-width: 560px; }
.logo-preview { object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .35rem; vertical-align: middle; }
.mt { margin-top: 1rem; }
.mb { margin-bottom: 1rem; }

/* layout */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; transition: grid-template-columns .2s ease; }
.shell.sidebar-collapsed { grid-template-columns: 72px 1fr; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); border-right: 1px solid var(--line); padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-x: hidden; overflow-y: auto; }
.sidebar-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .25rem; margin-bottom: .75rem; }
.sidebar .brand { color: var(--text); font-weight: 700; font-size: 1.05rem; padding: .25rem .35rem; display: flex; align-items: center; gap: .65rem; min-width: 0; }
.sidebar .brand:hover { text-decoration: none; }
.brand-logo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #fff; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-name { font-size: .95rem; }
.sidebar-collapse { flex: 0 0 auto; background: transparent; border: 0; color: var(--sidebar-text); cursor: pointer; padding: .4rem; border-radius: 6px; line-height: 0; }
.sidebar-collapse:hover { background: var(--sidebar-hover); }
.sidebar-collapse .nav-svg { width: 22px; height: 22px; }
.sidebar nav a { display: flex; align-items: center; gap: .65rem; color: var(--sidebar-text); padding: .5rem .75rem; border-radius: 6px; margin-bottom: 2px; }
.sidebar nav a:hover { background: var(--sidebar-hover); text-decoration: none; }
.sidebar nav a.active { background: var(--brand); color: #fff; }
.nav-icon { display: flex; flex-shrink: 0; }
.nav-svg { display: block; }
.nav-label { min-width: 0; }
.sidebar.collapsed .sidebar-head { flex-direction: column; align-items: center; }
.sidebar.collapsed .brand { justify-content: center; padding: .15rem 0; }
.sidebar.collapsed .brand-logo { width: 36px; height: 36px; }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-label {
  width: 0; height: 0; margin: 0; padding: 0; overflow: hidden; opacity: 0; pointer-events: none;
}
.sidebar.collapsed nav a { justify-content: center; padding: .55rem .4rem; gap: 0; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); padding: .6rem 1.5rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.topbar .who { color: var(--muted); font-size: .9rem; flex: 1 1 auto; min-width: 0; }
.nav-back { flex: 0 0 auto; font-weight: 700; }
.alert-bell { text-decoration: none; color: inherit; font-weight: 600; }
.notice-toast {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 40; max-width: 22rem;
  background: #1a1a1a; color: #fff; padding: .9rem 1rem; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.notice-toast strong { display: block; margin-bottom: .25rem; }
.notice-toast a { color: #fff; font-weight: 700; }
.notice-toast p { margin: .2rem 0 .45rem; color: #eee; }
.content { padding: 1.5rem; max-width: 1200px; width: 100%; }
.menu-toggle { display: none; }

/* components */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.stat .num { font-size: 1.8rem; font-weight: 700; }
.stat .label { color: var(--muted); font-size: .85rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--bg); }
.table-wrap { overflow-x: auto; }
.table-scroll { max-height: 28rem; overflow: auto; }
.table-scroll thead th { position: sticky; top: 0; z-index: 1; }
.books-sections { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.25rem; }
.books-sections a {
  display: inline-block; border: 1px solid var(--line); border-radius: 6px;
  padding: .4rem .75rem; background: var(--surface); color: var(--text);
}
.books-sections a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.books-sections a.active { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.btn { display: inline-block; border: 1px solid var(--brand); background: var(--brand); color: #fff; padding: .45rem .9rem; border-radius: 6px; font-size: .9rem; cursor: pointer; font-family: inherit; line-height: 1.3; }
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn.secondary { background: var(--surface); color: var(--brand); }
.btn.secondary:hover { background: var(--brand-soft); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger.secondary { background: var(--surface); color: var(--danger); }
.btn.small { padding: .25rem .6rem; font-size: .8rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); border-radius: 8px; cursor: pointer;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.icon-btn[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.icon-svg { display: block; width: 18px; height: 18px; }

label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .25rem; }
label .req { color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=datetime-local], input[type=date], input:not([type]), select, textarea {
  width: 100%; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--surface); color: var(--text);
}
input[type=text], input[type=email], input[type=password], input[type=url], input:not([type]), textarea {
  min-height: 2.75rem; padding: .75rem .9rem;
}
textarea { min-height: 8rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.field { margin-bottom: .9rem; }
.field .hint { color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.field .error { color: var(--danger); font-size: .85rem; margin-top: .2rem; }
.checkbox { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.checkbox input { width: auto; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .35rem; }

.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #e8edf2; color: #394a5b; }
.badge.active, .badge.published, .badge.completed { background: var(--ok-soft); color: var(--ok); }
.badge.draft, .badge.pending, .badge.processing, .badge.disabled { background: var(--warn-soft); color: var(--warn); }
.badge.revoked, .badge.failed, .badge.suspended, .badge.inactive, .badge.expired, .badge.archived, .badge.retired { background: var(--danger-soft); color: var(--danger); }

.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid; }
.alert.ok { background: var(--ok-soft); border-color: #b9e4c7; color: #145a29; }
.alert.error { background: var(--danger-soft); border-color: #f5c2bc; color: #7a1a12; }
.alert.warn { background: var(--warn-soft); border-color: #f0dca0; color: #6b4a00; }
.alert ul { margin: .4rem 0 0 1.1rem; padding: 0; }
html[data-theme="dark"] .alert.ok { border-color: #2d6a45; color: #bbf7d0; }
html[data-theme="dark"] .alert.error { border-color: #7f2d28; color: #fecaca; }
html[data-theme="dark"] .alert.warn { border-color: #7a6418; color: #fde68a; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; background: #fff; padding: .25rem .5rem; border-radius: 4px; border: 1px dashed #999; user-select: all; }

.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; }
.url-box { display: flex; gap: .5rem; }
.url-box input { font-family: ui-monospace, Menlo, Consolas, monospace; }
.qr img { width: 200px; height: 200px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem; background: #fff; }
dl.kv { display: grid; grid-template-columns: 11rem 1fr; gap: .4rem 1rem; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; word-break: break-word; }

/* survey builder */
.q-item { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: .75rem; background: var(--surface); }
.q-item-follow-up { margin-left: 1.25rem; border-left: 3px solid var(--brand-soft); }
.q-item .q-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.q-item .q-text { font-weight: 600; }
.q-item .meta { color: var(--muted); font-size: .8rem; }
.q-item .opts { margin: .4rem 0 0 1rem; padding: 0; color: var(--muted); font-size: .85rem; }
.logic-row { display: grid; grid-template-columns: 2fr 1.2fr 1.5fr; gap: .5rem; margin-bottom: .4rem; }
.hidden { display: none; }

/* Staff login — Makronova dashboard split card (email + password only). */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  position: relative;
}
html[data-theme="dark"] .auth-page { background: var(--bg); }
.auth-page__bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(195, 55, 100, 0.06), transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(29, 38, 113, 0.05), transparent 50%);
}
html[data-theme="dark"] .auth-page__bg {
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(195, 55, 100, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(29, 38, 113, 0.18), transparent 50%);
}
.guest-theme { position: fixed; top: 1rem; right: 1rem; z-index: 2; }
.guest-theme .icon-btn { background: var(--surface); color: var(--text); border-color: var(--line); }
.auth-shell { position: relative; z-index: 1; width: 100%; max-width: 1140px; }
.auth-card {
  width: 100%;
  min-height: 640px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 4px 6px rgba(16, 24, 40, 0.03), 0 12px 16px rgba(16, 24, 40, 0.06), 0 24px 48px rgba(16, 24, 40, 0.08);
  overflow: hidden;
}
html[data-theme="dark"] .auth-card { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); }
.auth-composition { display: flex; flex-direction: row; min-height: 640px; }
.auth-forms {
  flex: 0 0 50%;
  width: 50%;
  padding: 2.75rem 2.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.auth-form-view { width: 100%; max-width: 440px; margin: 0 auto; }
.auth-brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 2rem; }
.auth-brand__logo { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; background: #fff; border-radius: 10px; }
.auth-brand__text { display: flex; flex-direction: column; gap: 0.1rem; }
.auth-brand__name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; color: var(--text); }
.auth-brand__tag { font-size: 0.72rem; font-weight: 500; color: var(--muted); }
.auth-heading { font-size: clamp(1.75rem, 4vw, 2.25rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 0.5rem; color: var(--text); }
.auth-lead { font-size: 0.9375rem; line-height: 1.55; color: var(--muted); margin: 0 0 1.75rem; }
.auth-alert { margin-bottom: 1.25rem; }
.auth-alert p { margin: 0; }
.auth-alert p + p { margin-top: 0.35rem; }
.auth-field { margin-bottom: 1.1rem; }
.auth-label { display: block; font-size: 0.8125rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text); }
.auth-input {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 0.875rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
html[data-theme="dark"] .auth-input { background: var(--bg); }
.auth-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
.auth-input.is-invalid { border-color: var(--danger); }
.auth-input.is-invalid:focus { box-shadow: 0 0 0 3px var(--danger-soft); }
.auth-pw { position: relative; }
.auth-pw .auth-input { padding-right: 2.75rem; }
.auth-pw-toggle {
  position: absolute; right: 0.35rem; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 8px; color: var(--muted); cursor: pointer;
}
.auth-pw-toggle:hover, .auth-pw-toggle:focus-visible { color: var(--text); background: var(--bg); outline: none; }
.auth-pw-toggle svg { width: 1.15rem; height: 1.15rem; display: block; }
.auth-pw-toggle .icon-hide { display: none; }
.auth-pw-toggle.is-visible .icon-show { display: none; }
.auth-pw-toggle.is-visible .icon-hide { display: block; }
.auth-row-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0.25rem 0 1.25rem; flex-wrap: wrap; }
.auth-check { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.8125rem; color: var(--muted); cursor: pointer; }
.auth-check input { width: 1rem; height: 1rem; accent-color: var(--brand); }
.auth-link { font-size: 0.8125rem; font-weight: 600; color: var(--brand); text-decoration: none; }
.auth-link:hover { text-decoration: underline; }
.auth-btn {
  width: 100%; min-height: 48px; padding: 0.75rem 1.25rem; font: inherit; font-size: 0.9375rem; font-weight: 600;
  border: none; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.auth-btn--primary { background: var(--brand); color: #fff; }
.auth-btn--primary:hover { background: var(--brand-dark); }
.auth-btn--primary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.auth-panel {
  flex: 0 0 50%;
  width: 50%;
  position: relative;
  background: linear-gradient(145deg, #1a1030 0%, #111318 45%, #1D2671 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 2.25rem;
  overflow: hidden;
}
.auth-panel__glow {
  position: absolute; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(195, 55, 100, 0.35), transparent 70%);
  top: -80px; right: -60px; pointer-events: none;
}
.auth-panel__content { position: relative; z-index: 1; max-width: 340px; }
.auth-panel__kicker { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.55); margin: 0 0 0.75rem; }
.auth-panel__title { font-size: clamp(1.5rem, 2.5vw, 1.85rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.85rem; }
.auth-panel__body { font-size: 0.9rem; line-height: 1.6; color: rgba(255,255,255,0.72); margin: 0 0 1.75rem; }
.auth-viz {
  height: 100px; margin-bottom: 1.75rem; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center; padding: 0.75rem 1rem;
}
.auth-viz svg { width: 100%; height: 100%; display: block; }
.auth-metrics {
  display: flex; gap: 1.25rem; margin-bottom: 0.5rem; padding: 0.75rem 0;
  border-top: 1px solid rgba(255,255,255,0.1); border-bottom: 1px solid rgba(255,255,255,0.1);
}
.auth-metric { flex: 1; text-align: center; }
.auth-metric__val { font-size: 1.35rem; font-weight: 700; color: #fff; }
.auth-metric__lbl { font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.45); margin-top: 0.15rem; }
.auth-metric__note { font-size: 0.6rem; color: rgba(255,255,255,0.35); margin: 0.75rem 0 0; text-align: center; }
@media (max-width: 768px) {
  .auth-page { padding: 0.75rem; align-items: flex-start; padding-top: 3.25rem; }
  .auth-card, .auth-composition { min-height: auto; }
  .auth-composition { flex-direction: column; }
  .auth-panel { display: none; }
  .auth-forms { width: 100%; flex: none; padding: 1.75rem 1.25rem 1.5rem; }
}

@media (max-width: 860px) {
  .shell, .shell.sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 20; width: 240px; left: -260px; transition: left .2s; }
  .sidebar.open { left: 0; }
  .sidebar-collapse { display: none; }
  .sidebar.collapsed .brand-text,
  .sidebar.collapsed .nav-label { width: auto; height: auto; overflow: visible; opacity: 1; pointer-events: auto; }
  .sidebar.collapsed .brand { justify-content: flex-start; padding: .25rem .35rem; }
  .sidebar.collapsed nav a { justify-content: flex-start; padding: .5rem .75rem; gap: .65rem; }
  .sidebar.collapsed .sidebar-head { flex-direction: row; align-items: flex-start; }
  .menu-toggle { display: inline-block; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .content { padding: 1rem; }
  dl.kv { grid-template-columns: 1fr; }
  .logic-row { grid-template-columns: 1fr; }
}

html[data-theme="dark"] body { background: var(--bg); color: var(--text); }
html[data-theme="dark"] .topbar { background: var(--surface); }
html[data-theme="dark"] input[type=text],
html[data-theme="dark"] input[type=email],
html[data-theme="dark"] input[type=password],
html[data-theme="dark"] input[type=number],
html[data-theme="dark"] input[type=url],
html[data-theme="dark"] input[type=datetime-local],
html[data-theme="dark"] input[type=date],
html[data-theme="dark"] input:not([type]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--surface); color: var(--text); border-color: var(--line);
}
html[data-theme="dark"] .badge { background: #1e293b; color: #cbd5e1; }
html[data-theme="dark"] .secret { background: var(--surface); color: var(--text); }
html[data-focus-mode="on"] .card,
html[data-focus-mode="on"] .stat,
html[data-focus-mode="on"] .px-card { opacity: .42; transition: opacity .15s ease; }
html[data-focus-mode="on"] .card:hover,
html[data-focus-mode="on"] .card:focus-within,
html[data-focus-mode="on"] .stat:hover,
html[data-focus-mode="on"] .stat:focus-within,
html[data-focus-mode="on"] .px-card:hover,
html[data-focus-mode="on"] .px-card:focus-within { opacity: 1; }

.content-wide { max-width: none; }
.px-dash { min-height: 70vh; }
.px-dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.15rem; }
.px-source-panel {
  display: flex; gap: .55rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: .55rem; margin: 0 0 1.15rem;
}
.px-source-icon {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  min-width: 92px; padding: .7rem .55rem; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: .78rem;
}
.px-source-icon:hover { text-decoration: none; color: var(--text); background: var(--bg); }
.px-source-icon.active { color: var(--brand); background: var(--brand-soft); }
.px-source-icon.is-locked { opacity: .55; cursor: not-allowed; }
.px-source-lock { font-size: .68rem; font-weight: 600; letter-spacing: .02em; }
.px-source-icon .icon-svg { width: 26px; height: 26px; }
.px-metrics {
  background: #F8FAFC;
  border-radius: 24px;
  padding: 20px;
}
html[data-theme="dark"] .px-metrics { background: transparent; }
.px-metrics .px-filters input,
.px-metrics .px-filters select {
  height: 40px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14px;
}
.px-metrics .px-stat,
.px-metrics .px-card {
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  padding: 20px;
}
html[data-theme="dark"] .px-metrics .px-stat,
html[data-theme="dark"] .px-metrics .px-card { border-color: var(--line); box-shadow: none; }
.px-metrics .px-stat-value { font-size: 28px; font-weight: 700; color: var(--text); }
.px-metrics .px-kpi-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.px-metrics .px-mid-grid { gap: 20px; }
.px-metrics #px-raw .table-wrap {
  /* Header is extra: 12px type at line-height 1.5 (18px) + .6rem padding top and bottom (1.2rem) + 1px border.
     Body rows are fixed at 52px, so this shows 8 rows and scrolls the rest. */
  max-height: calc(8 * 52px + 1.2rem + 18px + 1px);
  overflow: auto;
}
.px-metrics #px-raw th {
  background: transparent;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 600;
}
.px-metrics #px-raw thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
}
.px-metrics #px-raw td {
  height: 52px;
  font-size: 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.px-metrics #px-raw tbody tr:hover { background: var(--bg); }
@media (max-width: 900px) {
  .px-metrics .px-kpi-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .px-metrics { padding: 16px; }
  .px-metrics .px-kpi-tiles { grid-template-columns: 1fr; }
}
.px-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; align-items: end; margin-bottom: 1rem; }
.px-filters .field { margin: 0; }
.px-filter-go { display: flex; align-items: flex-end; }
.px-block { margin: 1.25rem 0 .5rem; }
.px-block h2 { margin: 0 0 .2rem; font-size: 1.05rem; }
.px-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; margin-bottom: 1rem; }
.px-stat-label { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .82rem; font-weight: 600; }
.px-stat-value { font-size: 1.85rem; font-weight: 700; }
.px-denom { font-size: 1rem; color: var(--muted); font-weight: 600; }
.px-kpi-icon { width: 18px; height: 18px; flex-shrink: 0; }
.px-section-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.px-section-head h2 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: .4rem; }
.px-badge { font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: .15rem .55rem; }
.px-kpi-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.px-kpi-tiles .px-stat { margin-bottom: 0; }
.px-top-grid, .px-second-grid, .px-mid-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.px-mid-grid > .px-span { grid-column: 1 / -1; }
.px-kpi-row { display: grid; gap: .75rem; }
.px-kpi { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 1rem; }
.px-kpi span { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .85rem; }
.px-kpi strong { font-size: 1.35rem; }
.px-tone { display: grid; gap: .45rem; }
.px-tone-card { display: flex; align-items: center; justify-content: space-between; gap: .75rem; border-radius: 8px; padding: .45rem .7rem; color: #fff; }
.px-tone-card span { font-size: .8rem; }
.px-tone-card strong { font-size: 1.15rem; }
.px-tone-card em { font-style: normal; font-size: .8rem; opacity: .9; }
.px-tone-pos { background: #22C55E; }
.px-tone-neu { background: #F59E0B; }
.px-tone-neg { background: #F43F5E; }
.px-pills { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: .75rem; }
.px-pill { border-radius: 999px; padding: .2rem .65rem; font-size: .78rem; font-weight: 600; }
.px-pill-green { background: var(--ok-soft); color: var(--ok); }
.px-pill-amber { background: var(--warn-soft); color: var(--warn); }
.px-pill-red { background: var(--danger-soft); color: var(--danger); }
.px-chart-wrap { display: flex; justify-content: center; height: 220px; }
.px-chart-wrap canvas { max-width: 280px; width: 100%; }
.px-chart-wrap.px-chart-wrap-lg { height: 340px; }
.px-chart-wrap.px-chart-wrap-lg canvas { max-width: 420px; }
.px-pill-key { display: inline-flex; align-items: center; gap: .35rem; background: var(--brand-soft); color: var(--text); }
html[data-theme="dark"] .px-pill-key { border: 1px solid var(--line); }
.px-line-wrap { height: 220px; }
.px-line-wrap canvas { width: 100%; height: 100%; }
.px-bar-wrap { height: 180px; }
.px-bar-wrap canvas { width: 100%; height: 100%; }
.px-bar-wrap-lg { height: 280px; }
.px-board-metric { margin-top: 1.25rem; }
.px-board-metric h3 { margin: 0 0 .35rem; font-size: 1rem; }
@media (max-width: 900px) {
  .px-mid-grid, .px-top-grid, .px-second-grid { grid-template-columns: 1fr; }
}
.gauge-wrap-c { height: 220px; padding: .35rem 0 .75rem; display: flex; justify-content: center; align-items: center; position: relative; }
.gauge-wrap-c canvas { max-height: 190px; width: 100%; }
.csat-title-stars { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }
.csat-star { display: inline-flex; line-height: 0; }
.csat-star svg { display: block; }
.csat-star--full svg path { fill: #F59E0B; }
.csat-star--empty svg path { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.csat-star--half .csat-star-bg { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.csat-star--half .csat-star-fg { fill: #F59E0B; stroke: none; }
.px-chart { max-width: 100%; height: auto; color: var(--line); }
.px-chart-label { fill: var(--text); }
.px-chart-axis { fill: var(--muted); }
.px-chart-dot { fill: var(--brand); }
.px-chart-series { stroke: var(--brand); }
.px-range-metric { margin-bottom: 1rem; }
.px-range-metric:last-child { margin-bottom: 0; }
.px-range-metric h3 { margin: 0; font-size: .95rem; }
.px-range-points { display: flex; flex-wrap: wrap; gap: .5rem; }
.px-range-point {
  min-width: 3.25rem; border: 1px solid var(--line); border-radius: 8px;
  padding: .35rem .55rem; text-align: center; background: var(--bg);
}
.px-range-point span { display: block; color: var(--muted); font-size: .75rem; font-weight: 600; }
.px-range-point strong { font-size: 1.05rem; }
.px-action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.px-action-grid .px-span { grid-column: 1 / -1; }
.px-dot { width: 10px; height: 10px; border-radius: 99px; background: var(--brand); flex-shrink: 0; }
.px-bar { height: 8px; background: var(--line); border-radius: 99px; margin: .2rem 0 .7rem; overflow: hidden; }
.px-bar-fill { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 99px; }
.px-bar-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .85rem; }
.px-map { min-height: 280px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 1rem; }
.px-map-live { padding: 0; overflow: hidden; }
.px-map-svg { width: 100%; height: auto; display: block; }
.px-map-fallback { fill: var(--surface); }
.px-metric-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.px-metric-chip {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: .3rem .75rem;
  color: var(--muted); font-size: .8rem; font-weight: 600;
}
.px-metric-chip:hover { text-decoration: none; color: var(--text); }
.px-metric-chip.active { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.px-raw-export { margin: 0 0 1rem; }
.books-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.books-stat { display: flex; flex-direction: column; gap: .35rem; text-decoration: none; color: inherit; }
.books-stat strong { font-size: 1.6rem; }
.books-bars { display: flex; align-items: flex-end; gap: .4rem; height: 160px; }
.books-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.books-bar i { display: block; width: 100%; min-height: 2px; background: var(--brand); border-radius: 4px 4px 0 0; }
.books-bar span { margin-top: .35rem; font-size: .75rem; color: var(--muted); }
.books-breakdown { display: grid; grid-template-columns: 140px 1fr; gap: 1rem; align-items: center; }
.books-donut { width: 120px; height: 120px; border-radius: 50%; display: block; }
.books-bar i.h-0 { height: 0%; }
.books-bar i.h-1 { height: 1%; }
.books-bar i.h-2 { height: 2%; }
.books-bar i.h-3 { height: 3%; }
.books-bar i.h-4 { height: 4%; }
.books-bar i.h-5 { height: 5%; }
.books-bar i.h-6 { height: 6%; }
.books-bar i.h-7 { height: 7%; }
.books-bar i.h-8 { height: 8%; }
.books-bar i.h-9 { height: 9%; }
.books-bar i.h-10 { height: 10%; }
.books-bar i.h-11 { height: 11%; }
.books-bar i.h-12 { height: 12%; }
.books-bar i.h-13 { height: 13%; }
.books-bar i.h-14 { height: 14%; }
.books-bar i.h-15 { height: 15%; }
.books-bar i.h-16 { height: 16%; }
.books-bar i.h-17 { height: 17%; }
.books-bar i.h-18 { height: 18%; }
.books-bar i.h-19 { height: 19%; }
.books-bar i.h-20 { height: 20%; }
.books-bar i.h-21 { height: 21%; }
.books-bar i.h-22 { height: 22%; }
.books-bar i.h-23 { height: 23%; }
.books-bar i.h-24 { height: 24%; }
.books-bar i.h-25 { height: 25%; }
.books-bar i.h-26 { height: 26%; }
.books-bar i.h-27 { height: 27%; }
.books-bar i.h-28 { height: 28%; }
.books-bar i.h-29 { height: 29%; }
.books-bar i.h-30 { height: 30%; }
.books-bar i.h-31 { height: 31%; }
.books-bar i.h-32 { height: 32%; }
.books-bar i.h-33 { height: 33%; }
.books-bar i.h-34 { height: 34%; }
.books-bar i.h-35 { height: 35%; }
.books-bar i.h-36 { height: 36%; }
.books-bar i.h-37 { height: 37%; }
.books-bar i.h-38 { height: 38%; }
.books-bar i.h-39 { height: 39%; }
.books-bar i.h-40 { height: 40%; }
.books-bar i.h-41 { height: 41%; }
.books-bar i.h-42 { height: 42%; }
.books-bar i.h-43 { height: 43%; }
.books-bar i.h-44 { height: 44%; }
.books-bar i.h-45 { height: 45%; }
.books-bar i.h-46 { height: 46%; }
.books-bar i.h-47 { height: 47%; }
.books-bar i.h-48 { height: 48%; }
.books-bar i.h-49 { height: 49%; }
.books-bar i.h-50 { height: 50%; }
.books-bar i.h-51 { height: 51%; }
.books-bar i.h-52 { height: 52%; }
.books-bar i.h-53 { height: 53%; }
.books-bar i.h-54 { height: 54%; }
.books-bar i.h-55 { height: 55%; }
.books-bar i.h-56 { height: 56%; }
.books-bar i.h-57 { height: 57%; }
.books-bar i.h-58 { height: 58%; }
.books-bar i.h-59 { height: 59%; }
.books-bar i.h-60 { height: 60%; }
.books-bar i.h-61 { height: 61%; }
.books-bar i.h-62 { height: 62%; }
.books-bar i.h-63 { height: 63%; }
.books-bar i.h-64 { height: 64%; }
.books-bar i.h-65 { height: 65%; }
.books-bar i.h-66 { height: 66%; }
.books-bar i.h-67 { height: 67%; }
.books-bar i.h-68 { height: 68%; }
.books-bar i.h-69 { height: 69%; }
.books-bar i.h-70 { height: 70%; }
.books-bar i.h-71 { height: 71%; }
.books-bar i.h-72 { height: 72%; }
.books-bar i.h-73 { height: 73%; }
.books-bar i.h-74 { height: 74%; }
.books-bar i.h-75 { height: 75%; }
.books-bar i.h-76 { height: 76%; }
.books-bar i.h-77 { height: 77%; }
.books-bar i.h-78 { height: 78%; }
.books-bar i.h-79 { height: 79%; }
.books-bar i.h-80 { height: 80%; }
.books-bar i.h-81 { height: 81%; }
.books-bar i.h-82 { height: 82%; }
.books-bar i.h-83 { height: 83%; }
.books-bar i.h-84 { height: 84%; }
.books-bar i.h-85 { height: 85%; }
.books-bar i.h-86 { height: 86%; }
.books-bar i.h-87 { height: 87%; }
.books-bar i.h-88 { height: 88%; }
.books-bar i.h-89 { height: 89%; }
.books-bar i.h-90 { height: 90%; }
.books-bar i.h-91 { height: 91%; }
.books-bar i.h-92 { height: 92%; }
.books-bar i.h-93 { height: 93%; }
.books-bar i.h-94 { height: 94%; }
.books-bar i.h-95 { height: 95%; }
.books-bar i.h-96 { height: 96%; }
.books-bar i.h-97 { height: 97%; }
.books-bar i.h-98 { height: 98%; }
.books-bar i.h-99 { height: 99%; }
.books-bar i.h-100 { height: 100%; }
@media (max-width: 860px) {
  .px-top-grid, .px-second-grid, .px-mid-grid, .px-action-grid { grid-template-columns: 1fr; }
  .gauge-wrap-c { height: 185px; padding: .25rem 0 .5rem; }
  .gauge-wrap-c canvas { max-height: 165px; }
}
