:root {
  color-scheme: light;
  --bg: #eef3f8;
  --panel: #ffffff;
  --panel-soft: #edf4f6;
  --line: #cdd7e3;
  --text: #151d29;
  --muted: #5d6b7d;
  --accent: #006d77;
  --accent-2: #b84a00;
  --ok: #16824a;
  --shadow: 0 10px 28px rgba(16, 31, 51, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.auth-pending .app-shell,
body.auth-required .app-shell,
body.auth-ready .auth-gate {
  display: none !important;
}

body.auth-pending .portal-login label,
body.auth-pending .portal-login-actions,
body.auth-pending .portal-forgot-link,
body.auth-pending .portal-forgot-panel {
  display: none;
}

body.auth-pending,
body.auth-required {
  background: #e8eef4;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(232, 238, 244, 0.82)),
    repeating-linear-gradient(90deg, rgba(126, 145, 166, 0.1) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(126, 145, 166, 0.08) 0 1px, transparent 1px 72px),
    #e8eef4;
}

.auth-gate[hidden],
.app-shell[hidden] {
  display: none;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(360px, 440px);
  width: min(920px, 100%);
  min-height: 500px;
  border: 1px solid rgba(173, 188, 204, 0.9);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(16, 31, 51, 0.16);
  overflow: hidden;
}

.auth-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  border-right: 1px solid #cfd9e5;
  background:
    linear-gradient(145deg, rgba(0, 109, 119, 0.93), rgba(21, 29, 41, 0.96)),
    var(--accent);
  color: #fff;
  padding: 34px;
}

.auth-brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 18px;
  font-weight: 900;
}

.auth-brand-panel p {
  margin: 0;
  max-width: 280px;
  font-size: 34px;
  font-weight: 850;
  line-height: 1.06;
}

.auth-brand-panel span {
  display: block;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  font-weight: 700;
}

.portal-login {
  display: grid;
  align-content: center;
  min-width: 0;
  gap: 16px;
  background: #fff;
  padding: 42px 44px;
}

.portal-login h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.portal-login-head {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.portal-login-head > span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.3;
  text-transform: uppercase;
}

.portal-login label {
  display: grid;
  gap: 7px;
}

.portal-login label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.portal-login input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #bdcad8;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.portal-login input::placeholder {
  color: #8a98a8;
}

.portal-login input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 109, 119, 0.14);
}

.portal-login-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: stretch;
  gap: 10px;
  margin-top: 2px;
}

.portal-login-actions button,
.portal-logout {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  transition: border-color 0.15s, background 0.15s;
}

.portal-login-actions button:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  flex: 1 1 160px;
  min-width: 160px;
  min-height: 42px;
  font-size: 13px;
}

.portal-login-actions button:first-child:hover {
  background: #005a63;
  border-color: #005a63;
}

.portal-logout:hover {
  border-color: #8ca4b8;
  background: var(--panel-soft);
}

.portal-login-state {
  display: block;
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
}

.app-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 54px minmax(0, 1fr);
}

.sidebar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #f9fbfd;
  padding: 9px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
}

.sidebar-toggle {
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  width: 30px;
  height: 30px;
  transition: border-color 0.15s, background 0.15s;
}

.sidebar-toggle:hover {
  border-color: #8ca4b8;
  background: var(--panel-soft);
}

.sidebar-toggle svg {
  transition: transform 0.2s;
}

body.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

body.sidebar-collapsed .sidebar {
  overflow: visible;
  padding: 7px 6px;
}

body.sidebar-collapsed .brand {
  min-height: 40px;
  justify-content: center;
}

body.sidebar-collapsed .brand > div:not(.brand-mark) {
  display: none;
}

body.sidebar-collapsed .brand-mark {
  display: none;
}

body.sidebar-collapsed .sidebar-toggle {
  position: absolute;
  top: 9px;
  right: -10px;
  z-index: 3;
  margin-left: 0;
  width: 30px;
  box-shadow: 0 4px 12px rgba(16, 31, 51, 0.14);
}

body.sidebar-collapsed .rail {
  display: grid;
  grid-template-columns: 1fr;
}

body.sidebar-collapsed .manual-filter,
body.sidebar-collapsed .nav-panel {
  display: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.brand span,
.reader-toolbar span,
.stats span {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

.manual-card > span {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

.rail {
  display: flex;
  gap: 6px;
}

.rail-button {
  flex: 1;
}

.rail-button,
.reader-actions button,
.nav-title-row button {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  min-height: 32px;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.rail-button.active {
  border-color: var(--accent);
  background: #e5f3f2;
  color: var(--accent);
}

.manual-filter {
  display: grid;
  gap: 6px;
}

.manual-filter label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

select,
input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  padding: 7px 9px;
}

.nav-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  overflow: hidden;
}

.nav-title-row {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  font-size: 12.5px;
  font-weight: 700;
}

.manual-nav {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  padding: 4px;
}

.nav-node {
  margin: 1px 0;
}

.nav-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 3px 5px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: var(--panel-soft);
}

.nav-children {
  display: none;
  margin-left: 12px;
}

.nav-node.open > .nav-children {
  display: block;
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  padding: 8px 14px;
}

.quick-search {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(124px, auto) minmax(0, 560px);
  align-items: center;
  gap: 8px;
  width: min(860px, 100%);
}

.quick-search .search-history-dropdown {
  left: 0;
  right: 0;
}

.quick-search select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 0 28px 0 9px;
  font-size: 12px;
  font-weight: 750;
}

.quick-search input {
  width: 100%;
}

.topbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.account-menu-wrap {
  position: relative;
  flex: 0 1 auto;
  min-width: 0;
}

.portal-account-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 290px;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 8px;
  transition: border-color 0.15s, background 0.15s;
}

.portal-account-button:hover,
.portal-account-button[aria-expanded="true"] {
  border-color: var(--line);
  background: #fff;
}

.portal-user-pill {
  max-width: 260px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 13000;
  display: grid;
  min-width: 230px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(16, 31, 51, 0.16);
  padding: 6px;
}

.account-menu[hidden] {
  display: none;
}

.account-menu-identity {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid var(--line);
  padding: 8px 9px 10px;
  margin-bottom: 4px;
}

.account-menu-identity span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 850;
  text-transform: uppercase;
}

.account-menu-identity strong {
  max-width: 260px;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 0 9px;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}

.account-menu button:hover {
  background: var(--panel-soft);
}

.account-menu-logout {
  color: #9f1d2d !important;
}

#status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 0 10px;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-status {
  position: fixed;
  top: 58px;
  right: 16px;
  z-index: 12000;
  box-shadow: 0 10px 28px rgba(16, 31, 51, 0.14);
}

#status-pill[hidden],
.topbar-status[hidden] {
  display: none;
}

.account-password-dialog {
  position: fixed;
  inset: 0;
  z-index: 15000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.42);
}

.account-password-dialog[hidden] {
  display: none;
}

.account-password-sheet {
  display: grid;
  gap: 12px;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 54px rgba(16, 31, 51, 0.22);
  padding: 16px;
}

.account-password-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.account-password-head span,
.account-password-sheet label span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 850;
  text-transform: uppercase;
}

.account-password-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
  line-height: 1.15;
}

.account-password-head button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.account-password-sheet label {
  display: grid;
  gap: 6px;
}

.account-password-sheet input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
}

.account-password-sheet input:disabled {
  background: #f5f8fb;
  color: var(--muted);
}

.account-password-state {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.account-password-state--error {
  color: #a5162a;
}

.account-password-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.account-password-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 850;
}

.account-password-actions button[type="submit"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* ── Feedback Trigger Button ─────────────────────────────────────── */

.feedback-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.feedback-trigger:hover {
  background: #f5f8fb;
}

/* ── Feedback Dialog ─────────────────────────────────────────────── */

.feedback-dialog {
  position: fixed;
  inset: 0;
  z-index: 15000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.42);
}

.feedback-dialog[hidden] {
  display: none;
}

.feedback-sheet {
  display: grid;
  gap: 12px;
  width: min(480px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 54px rgba(16, 31, 51, 0.22);
  padding: 16px;
}

.feedback-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.feedback-head span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 850;
  text-transform: uppercase;
}

.feedback-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
  line-height: 1.15;
}

.feedback-head button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  flex-shrink: 0;
}

.feedback-intro {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.feedback-sheet label {
  display: grid;
  gap: 6px;
}

.feedback-sheet label span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 850;
  text-transform: uppercase;
}

.feedback-sheet select,
.feedback-sheet input,
.feedback-sheet textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  font-size: 13px;
  font-family: inherit;
}

.feedback-sheet textarea {
  resize: vertical;
  padding: 8px 10px;
  min-height: 100px;
}

.feedback-state {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.feedback-state--error {
  color: #a5162a;
}

.feedback-state--ok {
  color: #155724;
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.feedback-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.feedback-actions button[type="submit"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* ── Feedback Admin Panel ────────────────────────────────────────── */

.feedback-admin-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

.feedback-admin-filter-select {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
}

.feedback-admin-list {
  display: grid;
  gap: 10px;
  padding: 10px 0;
}

.feedback-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  display: grid;
  gap: 8px;
  background: #fff;
}

.feedback-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.feedback-item-title {
  font-size: 14px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
}

.feedback-item-meta {
  font-size: 11.5px;
  color: var(--muted);
}

.feedback-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #f3f4f6;
  color: var(--muted);
}

.feedback-badge--bug       { background: #fee2e2; color: #991b1b; }
.feedback-badge--feature_request { background: #dbeafe; color: #1e40af; }
.feedback-badge--praise    { background: #d1fae5; color: #065f46; }
.feedback-badge--general   { background: #f3f4f6; color: #374151; }

.feedback-status--new      { background: #fef3c7; color: #92400e; }
.feedback-status--reviewed { background: #dbeafe; color: #1e40af; }
.feedback-status--resolved { background: #d1fae5; color: #065f46; }

.feedback-item-body {
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.feedback-item-admin {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.feedback-item-admin-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.feedback-item-comment-wrap {
  display: grid;
  gap: 6px;
}

.feedback-item-comment {
  width: 100%;
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-family: inherit;
  resize: vertical;
  background: #f9fafb;
}

.feedback-item-save {
  justify-self: end;
  min-height: 28px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  padding: 0 12px;
  font-size: 11.5px;
  font-weight: 850;
  cursor: pointer;
}

.feedback-item-delete {
  min-height: 28px;
  border: 1px solid #fca5a5;
  border-radius: 5px;
  background: #fff;
  color: #b91c1c;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 850;
  cursor: pointer;
}

.feedback-item-status-select {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: 700;
}

.view {
  display: none;
  min-height: 0;
  height: 100%;
  overflow: auto;
  overflow-x: hidden;
  padding: 12px 14px;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.section-head.compact {
  align-items: start;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.1;
}

.dashboard-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
  min-width: 0;
}

.dashboard-title {
  margin: 0;
}

.dashboard-filter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 0 11px;
}

.dashboard-filter input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.category-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.categories-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.category-column {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  padding: 7px 9px;
}

.category-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  min-width: 0;
}

.category-column h2 {
  min-width: 0;
  margin: 0;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-column-head span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  min-height: 22px;
  border: 1px solid rgba(0, 109, 119, 0.22);
  border-radius: 999px;
  background: rgba(0, 109, 119, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.manual-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 6px;
  min-width: 0;
}

.manual-card {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 58px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 6px;
  background: white;
  color: inherit;
  cursor: pointer;
  padding: 8px 10px 7px;
  text-align: left;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(16, 31, 51, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.manual-card:hover {
  border-color: #8ca4b8;
  box-shadow: 0 10px 24px rgba(16, 31, 51, 0.12);
  transform: translateY(-1px);
}

.manual-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.manual-card-type {
  position: absolute;
  top: 7px;
  right: 8px;
}

.manual-card strong {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  padding-right: 48px;
  color: #08111d;
  font-size: 13.5px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.card-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-section {
  margin-top: 10px;
}

.pdf-section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.pdf-section-head h2 {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 6px;
}

.pdf-manual-card {
  border-top-color: var(--accent-2);
}

.dashboard-html-badge,
.dashboard-pdf-badge {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent-2, #e07b39);
  background: rgba(224, 123, 57, 0.1);
  border: 1px solid rgba(224, 123, 57, 0.3);
  border-radius: 3px;
  padding: 1px 4px;
  line-height: 1.4;
}

.dashboard-html-badge {
  color: var(--accent);
  background: rgba(0, 109, 119, 0.08);
  border: 1px solid rgba(0, 109, 119, 0.22);
}

.dashboard-empty {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 160px;
  border: 1px dashed #b7c5d4;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  text-align: center;
}

.dashboard-empty strong {
  color: var(--text);
  font-size: 15px;
}

.pdf-section-head h2 {
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
}

.pdf-doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pdf-doc-link {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--accent);
  font-size: 11.5px;
  text-decoration: none;
  white-space: nowrap;
}

.pdf-doc-link:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.pdf-nav-doc {
  padding-top: 6px;
  margin-top: 2px;
  border-top: 1px solid var(--line);
}

.pdf-nav-doc:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.pdf-nav-doc-header {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  margin-bottom: 2px;
}

.pdf-nav-doc-header:hover {
  background: var(--panel-soft);
  color: var(--text);
}

.pdf-nav-doc-header.active {
  color: var(--accent);
  background: var(--panel-soft);
}

.pdf-nav-chapters {
  margin-left: 8px;
  margin-bottom: 4px;
}

/* ── Supplementary document sections in the TOC ── */
.suppl-nav-divider {
  margin: 10px 0 6px;
  border-top: 1px solid var(--line);
}
.suppl-nav-section {
  padding-top: 4px;
}
.suppl-nav-header.suppl-header-collapsed {
  opacity: 0.6;
}
.suppl-nav-item {
  padding-left: 8px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}
.suppl-nav-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Supplementary admin panel ── */
/* ── Supplementary admin panel ── */
.suppl-admin-grid {
  grid-template-columns: 1fr;
  align-items: start;
}
.suppl-upload-panel,
.suppl-docs-panel {
  grid-column: 1 / -1;
}
.suppl-cat-form {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.suppl-cat-form input {
  flex: 1;
  min-width: 0;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  font-size: 13px;
}
.suppl-cat-form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.suppl-cat-form button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.suppl-cat-form button:hover { opacity: 0.88; }
.suppl-cat-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.suppl-cat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #f8fbfd;
  border: 1px solid var(--line);
}
.suppl-cat-row.active {
  border-color: rgba(0, 109, 119, 0.45);
  background: rgba(0, 109, 119, 0.08);
}
.suppl-cat-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.suppl-cat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.suppl-cat-count { font-size: 11px; color: var(--muted); }
.suppl-cat-sheet {
  width: min(560px, 100%);
}
.suppl-cat-delete {
  height: 26px;
  padding: 0 8px;
  border: 1px solid #d0d0d0;
  border-radius: 5px;
  background: #fff;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}
.suppl-cat-delete:hover { border-color: #c00; color: #c00; }
.manual-cat-rename-form { padding: 4px 8px; }
.manual-cat-rename-input {
  flex: 1;
  min-width: 0;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 6px;
  font-size: 13px;
}
.manual-cat-rename-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.suppl-upload-form { display: flex; flex-direction: column; gap: 12px; }
.suppl-upload-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.42fr) minmax(560px, 1fr);
  gap: 14px;
  align-items: start;
}
.suppl-upload-left,
.suppl-upload-edocs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.suppl-inline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.suppl-inline-head button {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  padding: 0 9px;
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  white-space: nowrap;
}
.suppl-inline-head button:hover {
  border-color: #8ca4b8;
  background: var(--panel-soft);
}
.suppl-drop-zone {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 14px;
  border: 2px dashed #9db3c7;
  border-radius: 8px;
  background: #f8fbfd;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.suppl-drop-zone:hover, .suppl-drop-zone.is-dragging {
  border-color: var(--accent);
  background: rgba(0,109,119,0.05);
}
.suppl-drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.suppl-drop-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 20px;
  display: grid; place-items: center; flex-shrink: 0;
}
.suppl-drop-copy { display: flex; flex-direction: column; gap: 2px; }
.suppl-drop-copy strong { font-size: 13px; color: var(--text); }
.suppl-drop-copy span { font-size: 11px; color: var(--muted); }
.suppl-file-queue { display: flex; flex-direction: column; gap: 4px; }
.suppl-file-queue[hidden] { display: none; }
.suppl-queue-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.suppl-queue-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suppl-queue-head {
  display: flex;
  gap: 8px;
  min-width: 0;
  align-items: center;
}
.suppl-queue-title-input {
  grid-column: 1 / -1;
  height: 28px; border: 1px solid var(--line); border-radius: 5px;
  padding: 0 8px; font-size: 12px; width: 100%; box-sizing: border-box;
}
.suppl-queue-title-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.suppl-queue-remove { height: 26px; padding: 0 8px; border: 1px solid #d0d0d0; border-radius: 5px; background: #fff; font-size: 11px; color: var(--muted); cursor: pointer; }
.suppl-queue-remove:hover { border-color: #c00; color: #c00; }
.suppl-queue-status { font-size: 11px; color: var(--muted); grid-column: 1 / -1; }
.suppl-upload-category {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.suppl-category-radio-list {
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.suppl-category-radio-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 4px 6px;
  border-radius: 5px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.suppl-category-radio-row:hover,
.suppl-category-radio-row:has(input[type=radio]:checked) {
  background: rgba(0, 109, 119, 0.08);
}
.suppl-category-radio-row input[type=radio] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.suppl-category-radio-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suppl-upload-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.suppl-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.suppl-field select { height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; font-size: 13px; font-weight: 400; color: var(--text); background: #fff; }
.suppl-field select[multiple] { height: auto; min-height: 160px; padding: 4px; }
.suppl-manual-filter {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
}
.suppl-manual-filter:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.suppl-manual-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-content: start;
  gap: 2px 10px;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.suppl-upload-edocs .suppl-manual-checklist {
  min-height: 420px;
  max-height: min(64vh, 640px);
}
.suppl-manual-check-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 24px;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  white-space: nowrap;
}
.feedback-sheet .suppl-manual-check-row {
  display: grid;
  gap: 7px;
}
.suppl-manual-check-row[hidden] {
  display: none;
}
.suppl-manual-check-row:hover {
  background: #f5f8fb;
}
.suppl-manual-check-row:has(input[type=checkbox]:checked) {
  background: rgba(0, 109, 119, 0.08);
}
.suppl-manual-check-row input[type=checkbox] {
  appearance: none;
  display: inline-grid;
  place-content: center;
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  margin: 0;
  padding: 0;
  border: 1px solid #9db3c7;
  border-radius: 3px;
  background: #fff;
  box-sizing: border-box;
  flex-shrink: 0;
  cursor: pointer;
}
.suppl-manual-check-row input[type=checkbox]::after {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  opacity: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}
.suppl-manual-check-row input[type=checkbox]:checked {
  border-color: var(--accent);
  background: var(--accent);
}
.suppl-manual-check-row input[type=checkbox]:checked::after {
  opacity: 1;
}
.suppl-manual-check-row input[type=checkbox]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.suppl-manual-check-row span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.feedback-sheet .suppl-manual-check-row span {
  color: var(--text);
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suppl-field select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.suppl-field-full { grid-column: 1 / -1; }
.suppl-hint { font-weight: 400; font-style: normal; text-transform: none; letter-spacing: 0; color: var(--muted); }
.suppl-upload-actions { display: flex; justify-content: flex-end; }
.suppl-upload-actions button {
  height: 34px; padding: 0 20px; border: none; border-radius: 6px;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer;
}
.suppl-upload-actions button:disabled { opacity: 0.5; cursor: not-allowed; }
.suppl-upload-actions button:not(:disabled):hover { opacity: 0.88; }

.suppl-doc-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(4, minmax(130px, 0.75fr)) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 9px;
}
.suppl-filter-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.suppl-filter-field span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 850;
  text-transform: uppercase;
}
.suppl-filter-field input,
.suppl-filter-field select {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 9px;
  font-size: 12px;
}
.suppl-filter-field input:focus,
.suppl-filter-field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.suppl-filter-reset {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.suppl-filter-reset:hover {
  border-color: #8ca4b8;
  background: var(--panel-soft);
}
.suppl-doc-table {
  min-width: 980px;
}
.suppl-doc-table th:first-child,
.suppl-doc-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 240px;
  max-width: 300px;
  background: #fff;
  box-shadow: 1px 0 0 var(--line);
}
.suppl-doc-table th:first-child {
  z-index: 4;
  background: #eaf1f8;
}
.suppl-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.suppl-sort-btn::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0.35;
}
.suppl-sort-btn.active[data-sort-dir="asc"]::after {
  border-bottom: 5px solid currentColor;
  opacity: 0.9;
}
.suppl-sort-btn.active[data-sort-dir="desc"]::after {
  border-top: 5px solid currentColor;
  opacity: 0.9;
}

.suppl-file-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 20px;
  padding: 0 6px;
  border: 1px solid #b8c7d6;
  border-radius: 5px;
  background: #f6f9fb;
  color: #253142;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  box-sizing: border-box;
}
.suppl-file-badge-pdf { border-color: #b6c8df; background: #eef5fc; color: #1f4e7a; }
.suppl-file-badge-doc,
.suppl-file-badge-docx { border-color: #b4c7e8; background: #eef4ff; color: #1f4fa3; }
.suppl-file-badge-xls,
.suppl-file-badge-xlsx { border-color: #abcdb9; background: #eef8f1; color: #197144; }
.suppl-file-badge-ppt,
.suppl-file-badge-pptx { border-color: #dfb69f; background: #fff3ed; color: #9a451e; }
.suppl-file-badge-jpg,
.suppl-file-badge-jpeg,
.suppl-file-badge-png { border-color: #c5bce8; background: #f5f1ff; color: #5943a6; }

/* Edit button in document list */
.suppl-actions-cell {
  width: 1%;
  white-space: nowrap;
}
.suppl-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
}
.suppl-edit-btn {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
}
.suppl-edit-btn:hover { background: var(--accent); color: #fff; }

/* Edit modal */
.suppl-edit-sheet {
  width: min(640px, 100%);
  max-height: 90vh;
  overflow-y: auto;
}
.suppl-edit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.suppl-edit-field input[type=text],
.suppl-edit-field select {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  background: #fff;
}
.suppl-edit-field input[type=text]:focus,
.suppl-edit-field select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.suppl-edit-checklist {
  max-height: 220px;
}

.suppl-download-sheet {
  width: min(460px, 100%);
}
.suppl-download-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbfd;
}
.suppl-download-card strong,
.suppl-download-card span:not(.suppl-file-badge) {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suppl-download-card strong {
  color: var(--text);
  font-size: 13px;
}
.suppl-download-card span:not(.suppl-file-badge) {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}
.suppl-download-note {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.suppl-download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.suppl-download-button:hover {
  opacity: 0.9;
}

.search-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 260px;
  gap: 8px;
  margin-bottom: 9px;
}

.search-history-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: calc(260px + 8px);
  background: white;
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  z-index: 200;
  overflow: hidden;
}

.search-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  padding: 9px 14px;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.search-history-item:hover {
  background: var(--panel-soft);
}

.search-history-item-icon {
  color: var(--muted);
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

.search-history-item-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-history-footer {
  border-top: 1px solid var(--line);
  padding: 6px 14px;
  display: flex;
  justify-content: flex-end;
}

.search-history-clear {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  padding: 3px 0;
}

.search-history-clear:hover {
  color: var(--accent);
}

.search-fallback-header {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 2px 4px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
}

.search-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.search-tab {
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: #f8fbfd;
  color: var(--muted);
  padding: 7px 11px;
  font-size: 12.5px;
  font-weight: 800;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.search-tab.active {
  background: white;
  color: var(--accent);
  border-color: var(--accent);
}

.search-tab span {
  color: inherit;
  font-size: 11px;
}

.search-panel {
  display: none;
}

.search-panel.active {
  display: block;
}

.search-summary {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 9px;
}

.search-results {
  display: grid;
  gap: 6px;
}

.other-manual-results-control {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  padding: 6px 10px;
}

.other-manual-results-control.is-expanded {
  justify-content: space-between;
  border-left: 4px solid var(--accent);
  background: white;
}

.other-manual-results-control strong {
  font-size: 12.5px;
}

.other-manual-results-control button {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 3px 0;
  font-size: 12.5px;
  font-weight: 800;
  text-align: left;
}

.other-manual-results-control button:hover {
  text-decoration: underline;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 8px 10px;
}

.result-card.result-part         { border-left: 4px solid #ea580c; }  /* Kürbisorange  */
.result-card.result-partlist     { border-left: 4px solid #2563eb; }  /* Klassisch Blau */
.result-card.result-fault        { border-left: 4px solid #dc2626; }  /* Korallenrot   */
.result-card.result-rep          { border-left: 4px solid #7c3aed; }  /* Violett       */
.result-card.result-adj          { border-left: 4px solid #0d9488; }  /* Teal          */
.result-card.result-bsd          { border-left: 4px solid #16a34a; }  /* Smaragdgrün   */
.result-card.result-troubleshooting { border-left: 4px solid #ca8a04; } /* Ocker       */
.result-card.result-iq           { border-left: 4px solid #9d174d; }  /* Pflaume       */
.result-card.result-service_mode { border-left: 4px solid #475569; }  /* Schieferblau  */
.result-card.result-wiring       { border-left: 4px solid #65a30d; }  /* Oliv          */
.result-card.result-page         { border-left: 4px solid #94a3b8; }  /* Hellgrau      */

.result-card button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}

.result-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.result-card strong {
  display: block;
  margin-bottom: 2px;
}

.result-location {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-kind {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.result-part .result-kind        { background: #ffedd5; color: #c2410c;  border-color: #fdba74; }  /* Kürbisorange  */
.result-partlist .result-kind   { background: #dbeafe; color: #1d4ed8;  border-color: #93c5fd; }  /* Klassisch Blau */
.result-fault .result-kind      { background: #fee2e2; color: #b91c1c;  border-color: #fca5a5; }  /* Korallenrot   */
.result-rep .result-kind        { background: #ede9fe; color: #6d28d9;  border-color: #c4b5fd; }  /* Violett       */
.result-adj .result-kind        { background: #ccfbf1; color: #0f766e;  border-color: #5eead4; }  /* Teal          */
.result-bsd .result-kind        { background: #dcfce7; color: #15803d;  border-color: #86efac; }  /* Smaragdgrün   */
.result-troubleshooting .result-kind { background: #fef9c3; color: #854d0e; border-color: #fde047; } /* Ocker      */
.result-iq .result-kind         { background: #fce7f3; color: #9d174d;  border-color: #f9a8d4; }  /* Pflaume       */
.result-service_mode .result-kind { background: #f1f5f9; color: #475569; border-color: #cbd5e1; } /* Schieferblau  */
.result-wiring .result-kind     { background: #ecfccb; color: #4d7c0f;  border-color: #bef264; }  /* Oliv          */
.result-page .result-kind       { background: #f8fafc; color: #64748b;  border-color: #cbd5e1; }  /* Hellgrau      */

.kind-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
}

.kind-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}

.kind-chip span {
  opacity: 0.7;
  font-weight: 400;
}

.kind-chip:hover {
  background: var(--panel-soft);
  color: var(--text);
}

.kind-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.kind-chip.active span {
  opacity: 0.85;
}

.part-meta {
  display: grid;
  grid-template-columns: minmax(120px, 170px) minmax(180px, 1fr) minmax(90px, 120px);
  gap: 6px;
  margin: 7px 0 0;
}

.fault-meta,
.nvm-meta {
  display: grid;
  grid-template-columns: minmax(240px, 1fr);
  gap: 8px;
  margin: 7px 0 0;
}

.nvm-meta {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.part-meta div {
  min-width: 0;
  border-left: 1px solid var(--line);
  padding: 1px 7px;
}

.fault-meta div,
.nvm-meta div {
  min-width: 0;
  border-left: 1px solid var(--line);
  padding: 1px 8px;
}

.part-meta div:first-child {
  border-left: 0;
  padding-left: 0;
}

.fault-meta div:first-child,
.nvm-meta div:first-child {
  border-left: 0;
  padding-left: 0;
}

.part-meta dt,
.fault-meta dt,
.nvm-meta dt {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.part-meta dd,
.fault-meta dd,
.nvm-meta dd {
  margin: 0;
  overflow: hidden;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fault-code {
  font-weight: 800;
}

.fault-description {
  max-width: 1120px;
}

.fault-description.muted {
  color: var(--muted);
  font-style: italic;
}

.fault-reference,
.nvm-source {
  display: inline-block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.nvm-description {
  max-width: 1120px;
}

.nvm-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(150px, 0.75fr) minmax(180px, 1fr) repeat(3, minmax(120px, 0.65fr));
  gap: 8px;
  margin-bottom: 8px;
}

.nvm-filter-grid label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.nvm-filter-grid span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.nvm-checkbox-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 6px;
  align-self: center;
  cursor: pointer;
}

.nvm-checkbox-label span {
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  text-transform: none !important;
}

.nvm-checkbox-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}

.nvm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nvm-toolbar button,
.nvm-detail-actions button,
.nvm-detail-actions a {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.nvm-toolbar button:hover,
.nvm-detail-actions button:hover,
.nvm-detail-actions a:hover {
  border-color: #8ca4b8;
  background: var(--panel-soft);
}

.nvm-results-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 10px;
  min-height: 0;
}

.nvm-table-wrap {
  min-width: 0;
  max-height: calc(100dvh - 260px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.nvm-results-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 12px;
}

.nvm-results-table th,
.nvm-results-table td {
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  vertical-align: top;
  text-align: left;
}

.nvm-results-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eaf1f8;
  color: #111827;
  font-size: 11px;
  text-transform: uppercase;
}

.nvm-results-table tr {
  cursor: pointer;
}

.nvm-results-table tbody tr:hover,
.nvm-results-table tbody tr.active {
  background: #edf7f7;
}

.nvm-results-table td {
  max-width: 320px;
  line-height: 1.3;
}

.nvm-results-table td:nth-child(1) {
  min-width: 150px;
}

.nvm-results-table td:nth-child(1) strong,
.nvm-results-table td:nth-child(1) span {
  display: block;
}

.nvm-results-table td:nth-child(1) span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
}

.nvm-source-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--accent);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
}

.nvm-detail {
  min-width: 0;
  max-height: calc(100dvh - 260px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 10px;
}

.nvm-detail .muted {
  color: var(--muted);
}

.nvm-detail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.nvm-detail-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.nvm-detail-head strong {
  font-size: 20px;
}

.nvm-detail-grid {
  display: grid;
  gap: 8px;
  margin: 0;
}

.nvm-detail-grid div {
  min-width: 0;
  border-bottom: 1px solid #edf1f5;
  padding-bottom: 7px;
}

.nvm-detail-grid dt {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.nvm-detail-grid dd {
  margin: 2px 0 0;
  font-size: 12.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.nvm-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.admin-view.active {
  display: block;
}

.admin-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-actions[hidden] {
  display: none;
}

.admin-actions button,
.admin-panel-head button,
.admin-form button,
.admin-import-confirm button,
.admin-import-toolbar button,
.admin-login-form button,
.admin-user-form button,
.admin-user-bulk-form button,
.admin-upload-form button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.admin-actions button:hover,
.admin-panel-head button:hover,
.admin-form button:hover,
.admin-import-confirm button:hover,
.admin-import-toolbar button:hover,
.admin-login-form button:hover,
.admin-user-form button:hover,
.admin-user-bulk-form button:hover,
.admin-upload-form button:hover {
  border-color: #8ca4b8;
  background: var(--panel-soft);
}

.admin-actions button:disabled,
.admin-panel-head button:disabled,
.admin-form button:disabled,
.admin-import-confirm button:disabled,
.admin-import-toolbar button:disabled,
.admin-login-form button:disabled,
.admin-user-form button:disabled,
.admin-user-bulk-form button:disabled,
.admin-upload-form button:disabled {
  opacity: 0.55;
  cursor: default;
}

.admin-user-state {
  max-width: 240px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-login-panel {
  max-width: 760px;
  margin-bottom: 10px;
}

.admin-login-panel[hidden],
#admin-workspace[hidden] {
  display: none;
}

.admin-workspace {
  display: grid;
  gap: 10px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  padding: 6px;
}

.admin-tab {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 850;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.admin-tab:hover,
.admin-tab.active {
  border-color: #8ca4b8;
  background: #fff;
  color: var(--text);
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.active {
  display: block;
}

.admin-login-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.admin-login-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-login-form span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-login-form input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 8px;
}

.admin-summary-grid,
.admin-status-grid,
.admin-grid {
  display: grid;
  gap: 10px;
}

.admin-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 10px;
}

.admin-status-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  margin-bottom: 10px;
}

.admin-grid {
  grid-template-columns: minmax(560px, 1.25fr) minmax(360px, 0.75fr);
}

.admin-edoc-grid {
  grid-template-columns: minmax(320px, 0.55fr) minmax(600px, 1.45fr);
}

.admin-grid .admin-panel:last-child {
  grid-column: 1 / -1;
}

.admin-edoc-grid .admin-panel:last-child {
  grid-column: auto;
}

.admin-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 10px;
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 9px;
}

.admin-panel-head h2 {
  margin: 0;
  font-size: 14px;
}

.admin-panel-head-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.admin-panel-note {
  margin: -2px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.admin-pdf-family {
  margin-bottom: 20px;
}

.admin-pdf-family-name {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-pdf-modules {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-pdf-module {
  padding: 12px;
}

.admin-pdf-module-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.admin-pdf-module.collapsed .admin-pdf-module-head {
  padding-bottom: 0;
  border-bottom: none;
}
.admin-pdf-module.collapsed .admin-pdf-module-body {
  display: none;
}
.pdf-collapse-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  transition: transform 0.15s;
}
.pdf-collapse-btn:hover { color: var(--accent); }
.admin-pdf-module.collapsed .pdf-collapse-btn { transform: rotate(-90deg); }

.admin-pdf-module-title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-pdf-module-title strong {
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
}

.admin-pdf-module-title span {
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

.admin-pdf-module-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.pdf-card-status {
  min-width: 92px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}

.pdf-card-status[data-tone="success"] { color: #0f7a4f; font-weight: 700; }
.pdf-card-status[data-tone="dirty"] { color: #8a5a00; font-weight: 700; }
.pdf-card-status[data-tone="error"] { color: #b52230; font-weight: 700; }

.admin-pdf-meta {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.admin-pdf-meta label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11.5px;
  color: var(--muted);
  flex: 1;
  min-width: 160px;
}

.admin-pdf-meta input,
.admin-pdf-meta select {
  font-size: 12.5px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: white;
  color: var(--text);
}

.pdf-upload-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed #9fb4c7;
  border-radius: 8px;
  background: #f8fbfd;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.pdf-upload-zone:hover,
.pdf-upload-zone:focus-visible,
.pdf-upload-zone.is-dragging {
  border-color: var(--accent);
  background: rgba(0, 109, 119, 0.06);
  outline: none;
}

.pdf-upload-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pdf-upload-copy strong {
  font-size: 13px;
  color: var(--text);
}

.pdf-upload-copy span {
  font-size: 12px;
  color: var(--muted);
}

.pdf-upload-queue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.pdf-upload-queue[hidden] {
  display: none;
}

.pdf-upload-queue-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pdf-upload-progress-text {
  color: var(--muted);
  font-size: 11.5px;
}

.pdf-progress-track {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe8ef;
}

.pdf-progress-bar {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.2s ease;
}

.pdf-upload-queue-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.admin-pdf-add-form {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 0 4px;
}

.admin-pdf-add-form input {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  font-size: 12.5px;
  min-width: 200px;
  flex: 1;
}

.admin-pdf-add-form .admin-action-btn {
  min-height: 34px;
  padding: 0 14px;
}

.admin-state,
.admin-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.admin-state:empty {
  display: none;
}

.admin-status-pending {
  border-color: #d9b86f;
  background: #fff8e6;
  color: #7a5700;
}

.admin-status-running {
  border-color: #7db1ca;
  background: #e8f5fb;
  color: #075d7d;
}

.admin-status-succeeded {
  border-color: #8bc9a6;
  background: #eaf8f0;
  color: var(--ok);
}

.admin-status-failed,
.admin-status-cancelled {
  border-color: #d38d8d;
  background: #fff0f0;
  color: #a11818;
}

.admin-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.admin-kv div {
  min-width: 0;
  border-left: 1px solid var(--line);
  padding-left: 8px;
}

.admin-kv dt,
.admin-form span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-kv dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-size: 12.5px;
  line-height: 1.35;
}

.admin-upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.admin-import-preview {
  margin-top: 9px;
}

.admin-import-preview:empty {
  display: none;
}

.admin-import-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.admin-import-list {
  display: grid;
  gap: 8px;
}

.admin-import-item {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 8px;
}

.admin-import-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.admin-import-item-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12.5px;
}

.admin-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-soft);
}

.admin-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.15s ease;
}

.admin-import-preview dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.admin-import-preview div {
  min-width: 0;
}

.admin-import-preview dt {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-import-preview dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-size: 12.5px;
}

.admin-import-preview p {
  margin: 7px 0 0;
  border-left: 3px solid #d9b86f;
  background: #fff8e6;
  padding: 6px 8px;
  color: #7a5700;
  font-size: 12px;
  line-height: 1.3;
}

.admin-import-confirm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-import-confirm dl {
  grid-column: 1 / -1;
}

.admin-import-confirm label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-import-confirm span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-import-confirm button {
  grid-column: 1 / -1;
  justify-self: end;
}

.admin-drop {
  display: grid;
  min-height: 42px;
  border: 1px dashed #9db3c7;
  border-radius: 6px;
  background: #f8fbfd;
  place-items: center;
  padding: 8px;
  transition: background 0.15s, border-color 0.15s;
}

.admin-drop.dragging {
  border-color: var(--accent);
  background: rgba(0, 109, 119, 0.08);
}

.admin-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.admin-drop span {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.admin-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-form button {
  grid-column: 1 / -1;
  justify-self: end;
}

.admin-user-shell {
  display: grid;
  gap: 12px;
}

.admin-user-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  padding: 6px;
}

.admin-user-tab {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
}

.admin-user-tab.active {
  border-color: #8ca4b8;
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(16, 31, 51, 0.06);
}

.admin-user-tab-panel {
  display: none;
}

.admin-user-tab-panel.active {
  display: block;
}

.admin-user-create-shell {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.admin-user-create-shell summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.admin-user-create-shell summary::-webkit-details-marker {
  display: none;
}

.admin-user-create-shell[open] summary {
  border-bottom: 1px solid var(--line);
}

.admin-user-create-shell .admin-user-form {
  padding: 12px;
}

.admin-user-form,
.admin-user-bulk-form {
  display: grid;
  gap: 8px;
}

.admin-user-form {
  grid-template-columns: 1fr 1fr;
  align-items: end;
}

.admin-user-form .admin-user-form-full {
  grid-column: 1 / -1;
}

.admin-user-form .admin-checkbox {
  align-self: center;
}

.admin-user-form > button {
  justify-self: end;
}

.admin-user-form label,
.admin-user-bulk-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-user-form span,
.admin-user-bulk-form span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-user-form input,
.admin-user-form select,
.admin-user-bulk-form textarea,
.admin-user-toolbar input,
.admin-user-toolbar select,
.admin-inline-create input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 8px;
  font: inherit;
}

.admin-user-bulk-form textarea {
  min-height: 104px;
  padding: 8px;
  resize: vertical;
}

.admin-multi-select {
  min-height: 76px !important;
  padding: 6px 8px !important;
}

.admin-form-actions,
.admin-user-toolbar,
.admin-inline-create {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-form-actions {
  justify-content: flex-end;
}

.admin-user-toolbar {
  margin-bottom: 10px;
}

.admin-user-toolbar input {
  flex: 1 1 260px;
}

.admin-user-toolbar select {
  flex: 0 1 190px;
}

.admin-inline-create {
  margin-bottom: 10px;
}

.admin-inline-create input {
  flex: 1;
}

.admin-inline-create button,
.admin-form-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  transition: border-color 0.15s, background 0.15s;
}

.admin-inline-create button:hover,
.admin-form-actions button:hover {
  border-color: #8ca4b8;
  background: var(--panel-soft);
}

.admin-bulk-preview-wrap {
  margin-top: 10px;
  max-height: 180px;
}

.admin-bulk-preview-table {
  min-width: 560px;
}

.admin-chip {
  display: inline-flex !important;
  max-width: none !important;
  margin: 2px 4px 2px 0 !important;
  border: 1px solid rgba(0, 109, 119, 0.25);
  border-radius: 999px;
  background: rgba(0, 109, 119, 0.08);
  color: var(--accent) !important;
  padding: 2px 7px;
  font-size: 11px !important;
  font-weight: 800;
  white-space: nowrap;
}

.admin-chip-soft {
  border-color: rgba(93, 107, 125, 0.28);
  background: #f4f7fa;
  color: var(--muted) !important;
}

.admin-muted {
  color: var(--muted);
  font-size: 11px;
}

.admin-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.admin-group-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  padding: 10px;
}

.admin-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.admin-group-head strong,
.admin-group-edit-panel input {
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  padding: 0 8px;
  font: inherit;
  font-weight: 800;
}

.admin-group-head strong {
  display: flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-group-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.admin-group-permissions {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  font: inherit;
}

.admin-group-permission-summary {
  min-height: 28px;
}

.admin-group-editor {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  padding: 12px;
}

.admin-group-editor[hidden] {
  display: none;
}

.admin-group-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.admin-group-editor-head h3 {
  margin: 0;
  font-size: 16px;
}

.admin-group-editor-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-group-name-field {
  display: grid;
  max-width: 360px;
  gap: 4px;
}

.admin-group-name-field span,
.admin-permission-section h4 {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-group-name-field input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  padding: 0 8px;
  font: inherit;
  font-weight: 800;
}

.admin-permission-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.admin-permission-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px;
}

.admin-permission-section h4 {
  margin: 0 0 8px;
}

.admin-permission-list {
  display: grid;
  gap: 6px;
}

.admin-permission-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 24px;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.admin-permission-check input {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

.admin-group-members {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 24px;
}

.admin-group-members span,
.admin-empty-card {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.admin-checkbox,
.admin-inline-check {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 7px !important;
}

.admin-checkbox input,
.admin-inline-check input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
}

.admin-inline-check + .admin-inline-check {
  margin-top: 5px;
}

.admin-user-form button,
.admin-user-bulk-form button {
  justify-self: end;
}

.admin-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.admin-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-manual-table {
  min-width: 920px;
}

.admin-users-table {
  min-width: 860px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  position: sticky;
  top: 0;
  background: #eaf1f8;
  color: #111827;
  font-size: 11px;
  text-transform: uppercase;
}

.admin-table td strong,
.admin-table td span:not(.admin-status):not([class*="-badge"]) {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-table td span:not(.admin-status):not([class*="-badge"]) {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
}

/* Badge chips inside table cells stay inline */
.admin-table td [class*="-badge"] {
  display: inline-flex;
  vertical-align: middle;
}

.admin-pdf-badge {
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border: 1px solid rgba(0, 109, 119, 0.26);
  border-radius: 4px;
  background: rgba(0, 109, 119, 0.1);
  color: #006d77;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

/* Status cell: wrap badges horizontally */
.note-status-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
}

.admin-empty {
  color: var(--muted);
  text-align: center;
}

.admin-inline-input,
.admin-inline-select {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 8px;
  font: inherit;
}

.admin-inline-input:focus,
.admin-inline-select:focus {
  outline: 2px solid rgba(0, 109, 119, 0.22);
  border-color: var(--accent);
}

.admin-inline-short {
  min-width: 92px;
}

.admin-row-save,
.admin-user-save,
.admin-user-reset {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.admin-row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  min-width: 100px;
}

/* Placeholder shown instead of Edit/Delete for admin-managed notes */
.admin-row-locked {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.admin-user-edit-panel {
  display: grid;
  grid-template-columns: minmax(210px, 0.9fr) minmax(220px, 1fr) minmax(260px, 1.2fr);
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  padding: 10px;
}

.admin-user-edit-panel label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-user-edit-panel label > span,
.admin-user-edit-checks span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-user-edit-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  grid-column: 1 / 3;
  align-self: center;
}

.admin-user-edit-actions {
  grid-column: 3;
  align-self: center;
  justify-content: flex-end;
}

.admin-row-actions button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.admin-row-actions button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 109, 119, 0.06);
}

.admin-row-actions button:last-child:not(:first-child):hover {
  border-color: rgba(181, 34, 48, 0.5);
  color: #b52230;
  background: rgba(220, 53, 69, 0.08);
}

.admin-row-save:hover,
.admin-user-save:hover,
.admin-user-reset:hover {
  border-color: #8ca4b8;
  background: var(--panel-soft);
}

.result-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

mark {
  border-radius: 3px;
  background: #ffe8a3;
  color: inherit;
  padding: 0 2px;
}

.reader-view.active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  height: 100%;
  overflow: hidden;
}

.reader-view.active.pdf-reader-mode {
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

.pdf-reader-mode .reader-toolbar {
  display: none;
}

.reader-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 7px 9px;
  min-height: 42px;
}

.reader-head {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.reader-context-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.reader-doc-title {
  display: block;
  max-width: min(520px, 40vw);
  overflow: hidden;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-toolbar strong {
  display: block;
  max-width: min(1020px, 70vw);
  overflow: hidden;
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-toolbar .reader-doc-title {
  max-width: min(520px, 40vw);
  font-size: 12.5px;
}

.reader-toolbar span {
  display: block;
  max-width: min(1020px, 70vw);
  overflow: hidden;
  font-size: 11px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  align-items: center;
}

.reader-meta {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.reader-meta-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(248, 251, 253, 0.72);
  color: var(--muted);
  padding: 0 7px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.reader-actions button {
  display: grid;
  width: 33px;
  min-width: 33px;
  height: 32px;
  place-items: center;
  padding: 0;
  font-size: 15px;
}

.reader-actions button:hover,
.nav-title-row button:hover,
.rail-button:hover {
  border-color: #8ca4b8;
  background: var(--panel-soft);
}

#reader-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

#reader-frame.reader-frame-loading {
  opacity: 0;
}

.app-figure-zoom {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: stretch;
  padding: 42px 18px 18px;
  background: rgba(15, 23, 42, 0.86);
  overflow: hidden;
}

.app-figure-zoom > button {
  position: fixed;
  top: 10px;
  right: 14px;
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 6px;
  background: #fff;
  color: #111827;
  padding: 0 12px;
  font-weight: 800;
}

.app-zoom-sheet {
  display: grid;
  grid-template-columns: minmax(380px, 0.72fr) minmax(560px, 1.28fr);
  gap: 14px;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.app-zoom-sheet-figure-only {
  grid-template-columns: minmax(0, 1fr);
}

.app-zoom-table,
.app-zoom-figure {
  min-width: 0;
  min-height: 0;
  border-radius: 8px;
  background: #fff;
}

.app-zoom-table {
  overflow: auto;
  padding: 10px;
}

.app-zoom-figure {
  overflow: hidden;
}

.app-zoom-table table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.app-zoom-table th,
.app-zoom-table td {
  border: 1px solid var(--line);
  padding: 2px 4px;
  line-height: 1.08;
  vertical-align: top;
}

.app-zoom-table th {
  background: #eaf1f8;
}

.app-zoom-table .note {
  margin: 8px 0 0;
  border: 1px solid #f0d4a8;
  border-left: 4px solid var(--accent-2);
  border-radius: 7px;
  background: #fff7ed;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.2;
}

.app-zoom-figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  padding: 10px;
}

.app-zoom-image-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.app-zoom-figure img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-out;
}

.app-zoom-hotspot {
  position: absolute;
  display: block;
  border: 1px solid transparent;
  background: rgba(0, 109, 119, 0);
}

.app-zoom-hotspot:hover {
  border-color: rgba(0, 109, 119, 0.62);
  background: rgba(0, 109, 119, 0.12);
}

.app-zoom-figure p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
}

/* ── Annotation trigger button ──────────────────────────────────────────── */

.annotation-trigger {
  position: fixed;
  z-index: 900;
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
  cursor: pointer;
  transition: opacity 0.12s;
}

.annotation-trigger:hover {
  background: #005a63;
}

/* ── Annotation marks in reader ─────────────────────────────────────────── */

.modern-annotation {
  border-radius: 2px !important;
  padding: 0 1px !important;
  cursor: pointer !important;
  border-bottom: 2px solid currentColor !important;
}

.modern-annotation-note        { background: rgba(255,209,102,0.28) !important; color: #b87400 !important; }
.modern-annotation-correction  { background: rgba(220,53,69,0.14) !important;  color: #b52230 !important; }
.modern-annotation-alternative { background: rgba(0,109,119,0.14) !important;  color: #005a63 !important; }
.modern-annotation-warning     { background: rgba(253,126,20,0.18) !important; color: #b84a00 !important; }

.modern-annotation-icon {
  display: inline-block !important;
  font-size: 12px !important;
  line-height: 1 !important;
  margin-left: 1px !important;
  cursor: pointer !important;
  opacity: 0.75 !important;
  vertical-align: middle !important;
  user-select: none !important;
}
.modern-annotation-icon:hover { opacity: 1 !important; }

/* ── Annotation modal ───────────────────────────────────────────────────── */

.annotation-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(21, 29, 41, 0.54);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.annotation-modal[hidden] {
  display: none;
}

.annotation-modal--side {
  justify-content: flex-end;
  align-items: stretch;
  background: transparent;
  padding: 12px;
  pointer-events: none;
}

.annotation-modal-sheet {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  box-shadow: 0 26px 70px rgba(16, 31, 51, 0.22);
  width: min(920px, calc(100vw - 48px));
  max-height: min(820px, calc(100dvh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.2s, max-height 0.2s;
}

.annotation-modal--side .annotation-modal-sheet {
  width: min(430px, calc(100vw - 28px));
  height: calc(100dvh - 24px);
  max-height: calc(100dvh - 24px);
  border-color: rgba(255, 255, 255, 0.68);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 62px rgba(16, 31, 51, 0.2);
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  padding: 0;
  pointer-events: auto;
}

.annotation-modal--side .annotation-modal-header {
  background: rgba(255, 255, 255, 0.78);
}

.annotation-modal--side .annotation-modal-anchor {
  background: rgba(237, 244, 246, 0.76);
}

.annotation-modal--side .annotation-view-item {
  background: rgba(248, 251, 253, 0.82);
}

.annotation-modal-sheet--expanded {
  width: calc(100vw - 32px) !important;
  max-height: calc(100dvh - 32px) !important;
  border-radius: 8px;
}

.annotation-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
}

.annotation-modal-header strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.annotation-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.annotation-modal-close,
.annotation-modal-minimize,
.annotation-modal-expand {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: transparent;
  border: 1px solid transparent;
  font-size: 16px;
  color: var(--muted);
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
}

.annotation-modal-close:hover,
.annotation-modal-minimize:hover,
.annotation-modal-expand:hover {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}

.annotation-modal-minimize {
  display: none;
}

.annotation-modal--side .annotation-modal-minimize {
  display: inline-grid;
}

#annotation-view-panel,
#annotation-edit-panel {
  overflow: auto;
  padding: 16px 20px 18px;
}

#annotation-edit-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#annotation-edit-panel[hidden],
#annotation-view-panel[hidden] {
  display: none;
}

.annotation-modal--side #annotation-view-panel:not([hidden]) {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.annotation-modal-anchor {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--muted);
  background: rgba(237, 244, 246, 0.86);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 8px 11px;
  border-radius: 7px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 92px;
  overflow: auto;
  line-height: 1.4;
}

.annotation-category-section {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  min-height: 48px;
}

.annotation-section-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 12px 0 6px;
  margin-right: 8px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
  flex-shrink: 0;
}

.annotation-type-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.annotation-type-btn {
  min-height: 34px;
  padding: 0 18px;
  border-radius: 7px;
  border: 1px solid rgba(157, 179, 199, 0.82);
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.annotation-type-btn:hover {
  border-color: rgba(0, 109, 119, 0.45);
  color: var(--text);
  background: var(--panel);
}

.annotation-type-btn.active {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.42) inset, 0 6px 14px rgba(16, 31, 51, 0.12);
}

.annotation-type-btn.active[data-type="note"]        { background: #f5c335; color: #3d2b00; border-color: #d4a010; }
.annotation-type-btn.active[data-type="correction"]  { background: #b52230; color: #fff;    border-color: #9f1d29; }
.annotation-type-btn.active[data-type="alternative"] { background: var(--accent); color: #fff; border-color: #005a63; }
.annotation-type-btn.active[data-type="warning"]     { background: #b84a00; color: #fff;    border-color: #9f3d00; }

.annotation-format-toolbar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px;
}

.annotation-format-toolbar button {
  display: inline-grid;
  place-items: center;
  min-width: 31px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.1s, color 0.1s, background 0.1s;
}

.annotation-format-toolbar button:hover {
  border-color: var(--line);
  background: var(--panel);
  color: var(--accent);
}

.toolbar-sep {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: var(--line);
  margin: 0 4px;
  flex-shrink: 0;
}

.toolbar-insert {
  font-size: 11px !important;
  font-weight: 800 !important;
  color: var(--accent) !important;
  border-color: rgba(0,109,119,0.35) !important;
  background: rgba(0,109,119,0.08) !important;
  padding: 0 10px;
  white-space: nowrap;
}

.toolbar-insert:hover {
  background: rgba(0,109,119,0.18) !important;
  border-color: var(--accent) !important;
}

.annotation-admin-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  padding: 8px 10px;
}

.annotation-admin-controls[hidden] {
  display: none;
}

.annotation-admin-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.annotation-admin-controls select {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  padding: 0 8px;
  color: var(--text);
  font-size: 12px;
}

.annotation-admin-controls .annotation-admin-check {
  display: inline-flex;
  grid-auto-flow: column;
  align-items: center;
  min-height: 30px;
  text-transform: none;
}

.annotation-internal-link-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(220px, 1.4fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 10px;
  border: 1px solid rgba(0, 109, 119, 0.28);
  border-radius: 6px;
  background: rgba(0, 109, 119, 0.06);
  padding: 10px;
}

.annotation-internal-link-panel[hidden] {
  display: none;
}

.annotation-internal-link-panel label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.annotation-internal-link-panel label[hidden] {
  display: none;
}

.annotation-internal-link-panel select,
.annotation-internal-link-panel input {
  min-height: 32px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
}

.annotation-internal-actions {
  display: flex;
  gap: 6px;
}

.annotation-internal-actions button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.annotation-internal-actions button:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.annotation-internal-link-panel p {
  grid-column: 1 / -1;
  min-height: 16px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.annotation-content {
  flex: 1 1 auto;
  width: 100%;
  min-height: clamp(145px, 26dvh, 260px);
  max-height: 48dvh;
  border: 1px solid rgba(0, 109, 119, 0.45);
  border-radius: 7px;
  padding: 12px;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(0, 109, 119, 0.04);
}

.annotation-content:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 109, 119, 0.14);
}

.annotation-content::placeholder {
  color: #7a8796;
}

.annotation-images-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.annotation-image-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.annotation-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.annotation-image-thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  line-height: 18px;
  padding: 0;
  text-align: center;
}

.annotation-image-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
  width: fit-content;
}

.annotation-image-label input[type="file"] {
  display: none;
}

.annotation-modal-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 4px;
}

.annotation-visibility-choice {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: fit-content;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  font-size: 12px;
  background: transparent;
}

.annotation-visibility-choice legend {
  font-size: 0;
  line-height: 0;
  padding: 0;
  margin: 0;
  width: 0;
  float: left;
}

.annotation-visibility-choice label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 13px 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #edf4f6;
  cursor: pointer;
  font-weight: 800;
  color: var(--muted);
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, color 0.12s;
  white-space: nowrap;
  user-select: none;
}

.annotation-visibility-choice label::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(93, 107, 125, 0.52);
  border-radius: 50%;
  background: var(--panel);
  box-shadow: inset 0 0 0 3px var(--panel);
  flex: 0 0 auto;
  transition: background 0.12s, border-color 0.12s;
}

.annotation-visibility-choice label:hover {
  border-color: rgba(0, 109, 119, 0.36);
  color: var(--text);
  background: #f8fbfd;
}

.annotation-visibility-choice label:has(input:checked) {
  border-color: rgba(0, 109, 119, 0.5);
  background: rgba(0, 109, 119, 0.08);
  color: var(--text);
  box-shadow: 0 1px 5px rgba(16, 31, 51, 0.08);
}

.annotation-visibility-choice label:has(input:checked)::before {
  border-color: var(--accent);
  background: var(--accent);
}

.annotation-visibility-choice input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.annotation-modal-btns {
  display: flex;
  gap: 8px;
}

.annotation-modal-btns button {
  min-height: 36px;
}

.annotation-modal-btns button:last-child {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 0 22px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.annotation-modal-btns button:last-child:disabled {
  opacity: 0.5;
  cursor: default;
}

.annotation-modal-sheet[data-note-type="note"]        .annotation-modal-btns button:last-child { background: #b87400; }
.annotation-modal-sheet[data-note-type="correction"]  .annotation-modal-btns button:last-child { background: #b52230; }
.annotation-modal-sheet[data-note-type="alternative"] .annotation-modal-btns button:last-child { background: var(--accent); }
.annotation-modal-sheet[data-note-type="warning"]     .annotation-modal-btns button:last-child { background: #b84a00; }

.annotation-modal-btns button:first-child {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 16px;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.annotation-modal-btns button:first-child:hover {
  border-color: rgba(0, 109, 119, 0.35);
  background: var(--panel);
}

.annotation-modal-state {
  flex: 0 0 auto;
  margin: 0;
  min-height: 0;
  border: 0;
  border-radius: 7px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.annotation-modal-state:empty {
  display: none;
}

.annotation-modal-state--error {
  border: 1px solid rgba(181, 34, 48, 0.26);
  border-left: 4px solid #b52230;
  background: rgba(181, 34, 48, 0.08);
  color: #8f1b26;
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 800;
}

.annotation-modal-state--saving {
  border: 1px solid rgba(0, 109, 119, 0.22);
  border-left: 4px solid var(--accent);
  background: rgba(0, 109, 119, 0.07);
  color: var(--muted);
  padding: 8px 11px;
}

/* ── Annotation view panel ──────────────────────────────────────────────── */

.annotation-view-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(620px, 68dvh);
  overflow-y: auto;
  margin-bottom: 10px;
  padding-right: 4px;
}

.annotation-modal--side .annotation-view-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.annotation-view-section {
  display: grid;
  gap: 8px;
}

.annotation-view-section h3 {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.annotation-view-item {
  background: var(--surface, #f8f9fa);
  border: 1px solid var(--line, #e0e0e0);
  border-radius: 6px;
  padding: 10px 12px;
}

.annotation-view-item-pinned,
.nvm-annotation-item-pinned {
  border-color: rgba(0, 109, 119, 0.45);
  box-shadow: inset 3px 0 0 var(--accent);
}

.annotation-view-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.annotation-view-meta {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

.annotation-view-body {
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 6px;
  white-space: pre-wrap;
  word-break: break-word;
}

.annotation-view-body p,
.annotation-view-body ul,
.annotation-view-body ol,
.annotation-view-body blockquote,
.nvm-annotation-body p,
.nvm-annotation-body ul,
.nvm-annotation-body ol,
.nvm-annotation-body blockquote {
  margin: 0 0 6px;
}

.annotation-view-body ul,
.annotation-view-body ol,
.nvm-annotation-body ul,
.nvm-annotation-body ol {
  padding-left: 18px;
}

.annotation-view-body blockquote,
.nvm-annotation-body blockquote {
  border-left: 3px solid var(--line);
  padding-left: 8px;
  color: var(--muted);
}

.annotation-view-body code,
.nvm-annotation-body code {
  border-radius: 4px;
  background: rgba(21, 29, 41, 0.07);
  padding: 1px 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.note-internal-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
  background: rgba(0, 109, 119, 0.1);
  padding: 0 4px;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.note-internal-link::before {
  content: "eDOC";
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  padding: 0 3px;
  font-size: 9px;
  line-height: 14px;
  letter-spacing: 0;
}

.annotation-view-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.annotation-view-actions button {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}

.annotation-view-delete {
  color: var(--danger, #c0392b) !important;
  border-color: var(--danger, #c0392b) !important;
}

.annotation-return-bar {
  position: fixed;
  right: 20px;
  bottom: 18px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(460px, calc(100vw - 40px));
  border: 1px solid rgba(0, 109, 119, 0.28);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 42px rgba(16, 31, 51, 0.2);
  padding: 9px 10px 9px 13px;
}

.annotation-return-bar[hidden] {
  display: none;
}

.annotation-return-bar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.annotation-return-bar button {
  min-height: 32px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
}

.annotation-return-bar button:not(.annotation-return-dismiss) {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 0 12px;
}

.annotation-return-dismiss {
  display: inline-grid;
  place-items: center;
  width: 30px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  padding: 0;
}

.annotation-view-add {
  font-size: 12px;
  background: none;
  border: 1px dashed var(--accent);
  color: var(--accent);
  border-radius: 4px;
  padding: 5px 12px;
  cursor: pointer;
  width: 100%;
}

.annotation-view-add:hover { background: rgba(0,109,119,0.06); }

.ann-official-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(0,109,119,0.18);
  color: #005a63;
}

.ann-private-badge,
.ann-public-badge,
.ann-status-badge,
.ann-pinned-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
}

.ann-private-badge { background: rgba(93, 107, 125, 0.14); color: var(--muted); }
.ann-public-badge { background: rgba(22, 130, 74, 0.14); color: #0f6b3b; }
.ann-pinned-badge { background: rgba(21, 29, 41, 0.09); color: var(--text); }
.ann-status-new { background: rgba(255,209,102,0.35); color: #8a5a00; }
.ann-status-in_review { background: rgba(0,109,119,0.14); color: #005a63; }
.ann-status-approved { background: rgba(22,130,74,0.14); color: #0f6b3b; }
.ann-status-recommended { background: rgba(0,109,119,0.2); color: #004d55; }
.ann-status-rejected { background: rgba(220,53,69,0.16); color: #a51f2b; }
.ann-status-archived { background: rgba(93,107,125,0.16); color: var(--muted); }

.annotation-nvm-edit {
  font-size: 11px;
  margin-top: 4px;
  background: none;
  border: none;
  color: var(--accent);
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

/* ── NVM annotation section ─────────────────────────────────────────────── */

.nvm-annotations {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nvm-annotations-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.nvm-annotation-item {
  background: var(--panel-soft);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid transparent;
}

.nvm-annotation-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.nvm-annotation-images {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.nvm-annotation-images img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  cursor: pointer;
}

.nvm-annotation-body {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.45;
}

/* ── Admin annotations tab ──────────────────────────────────────────────── */

.admin-annotations-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-annotations-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-annotations-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.admin-annotations-filters select {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  font-size: 12px;
  background: var(--panel);
}

.admin-annotations-table td {
  max-width: 240px;
  vertical-align: top;
}

.my-notes-table {
  min-width: 1120px;
  table-layout: fixed;
}

.admin-annotations-table.my-notes-table th:first-child,
.admin-annotations-table.my-notes-table td:first-child {
  width: 74px;
  text-align: left;
  padding: 7px 8px;
}

.my-notes-table th:nth-child(2),
.my-notes-table td:nth-child(2) {
  width: 24%;
}

.my-notes-table th:nth-child(3),
.my-notes-table td:nth-child(3) {
  width: 22%;
}

.my-notes-table th:nth-child(4),
.my-notes-table td:nth-child(4) {
  width: 150px;
}

.my-notes-table th:nth-child(5),
.my-notes-table td:nth-child(5) {
  width: 110px;
}

.my-notes-table th:nth-child(6),
.my-notes-table td:nth-child(6) {
  width: 180px;
}

.my-notes-table th:nth-child(7),
.my-notes-table td:nth-child(7) {
  width: 112px;
}

.my-notes-table th:nth-child(8),
.my-notes-table td:nth-child(8) {
  width: 146px;
}

.my-notes-table .admin-note-preview {
  max-width: none;
}

.my-notes-table .admin-ann-anchor-link {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.my-notes-table .note-status-cell {
  display: table-cell;
  vertical-align: top;
  white-space: normal;
}

.my-notes-table .note-status-cell > * {
  margin: 0 4px 4px 0;
}

.admin-inline-textarea {
  width: min(320px, 100%);
  min-height: 68px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.admin-note-preview {
  max-width: 360px;
  max-height: 96px;
  overflow: auto;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
}

.admin-note-preview p,
.admin-note-preview ul,
.admin-note-preview ol,
.admin-note-preview blockquote {
  margin: 0 0 5px;
}

.admin-note-preview ul,
.admin-note-preview ol {
  padding-left: 17px;
}

.admin-ann-anchor-link {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: normal;
}

.admin-ann-anchor-link:hover {
  text-decoration: underline;
}

.ann-type-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.ann-type-note        { background: rgba(255,209,102,0.35); color: #b87400; }
.ann-type-correction  { background: rgba(220,53,69,0.18);  color: #b52230; }
.ann-type-alternative { background: rgba(0,109,119,0.18);  color: #005a63; }
.ann-type-warning     { background: rgba(253,126,20,0.22); color: #b84a00; }

@media (max-width: 980px) {
  html,
  body.auth-ready {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    min-height: 100dvh;
    height: auto;
    overflow: visible;
  }

  .sidebar {
    min-height: auto;
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .quick-search {
    width: 100%;
    grid-template-columns: auto minmax(118px, auto) minmax(0, 1fr);
  }

  .topbar-meta {
    justify-content: flex-start;
  }

  .portal-user-pill {
    max-width: min(240px, 100%);
  }

  .manual-nav {
    max-height: 260px;
  }

  .search-row,
  .dashboard-head,
  .section-head {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .nvm-filter-grid,
  .nvm-results-layout,
  .admin-summary-grid,
  .admin-status-grid,
  .admin-grid,
  .admin-edoc-grid,
  .admin-users-layout,
  .admin-user-form,
  .admin-user-edit-panel,
  .admin-form,
  .admin-login-form,
  .admin-upload-form {
    grid-template-columns: 1fr;
  }

  .suppl-doc-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .suppl-upload-layout {
    grid-template-columns: 1fr;
  }

  .suppl-upload-edocs .suppl-manual-checklist {
    min-height: 360px;
    max-height: 520px;
  }

  .suppl-filter-search,
  .suppl-filter-reset {
    grid-column: 1 / -1;
  }

  .admin-grid .admin-panel:last-child {
    grid-column: auto;
  }

  .admin-groups-panel,
  .admin-users-panel {
    grid-column: auto;
  }

  .admin-user-toolbar,
  .admin-user-tabs,
  .admin-form-actions {
    flex-wrap: wrap;
  }

  .admin-kv {
    grid-template-columns: 1fr;
  }

  .admin-import-preview dl {
    grid-template-columns: 1fr;
  }

  .nvm-table-wrap,
  .nvm-detail {
    max-height: none;
  }

  .categories-pair {
    grid-template-columns: 1fr;
  }

  .part-meta {
    grid-template-columns: 1fr;
  }

  .fault-meta {
    grid-template-columns: 1fr;
  }

  .app-zoom-sheet {
    grid-template-columns: 1fr;
  }

  .annotation-modal {
    align-items: stretch;
    padding: 10px;
  }

  .annotation-modal-sheet {
    width: 100%;
    max-height: calc(100dvh - 20px);
    padding: 14px;
  }

  .annotation-content {
    min-height: clamp(140px, 24dvh, 190px);
    max-height: 42dvh;
  }

  .annotation-view-list {
    max-height: 62dvh;
  }

  .annotation-internal-link-panel {
    grid-template-columns: 1fr;
  }

  .annotation-internal-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 560px) {
  .suppl-doc-toolbar {
    grid-template-columns: 1fr;
  }

  .suppl-inline-head {
    align-items: stretch;
    flex-direction: column;
  }

  .suppl-inline-head button {
    width: 100%;
  }

  .suppl-upload-edocs .suppl-manual-checklist {
    min-height: 320px;
    max-height: 420px;
  }

  .suppl-doc-table {
    min-width: 680px;
  }

  .suppl-doc-table th:nth-child(3),
  .suppl-doc-table td:nth-child(3),
  .suppl-doc-table th:nth-child(5),
  .suppl-doc-table td:nth-child(5),
  .suppl-doc-table th:nth-child(6),
  .suppl-doc-table td:nth-child(6) {
    display: none;
  }

  .suppl-doc-table th:first-child,
  .suppl-doc-table td:first-child {
    min-width: 190px;
    max-width: 220px;
  }

  .annotation-content {
    min-height: clamp(90px, 16dvh, 130px);
  }

  .annotation-modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .annotation-modal-btns {
    justify-content: flex-end;
  }

  .annotation-category-section {
    display: grid;
    gap: 8px;
    align-items: stretch;
  }

  .annotation-section-label {
    padding: 0 0 8px;
    margin: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .annotation-type-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .annotation-type-btn {
    width: 100%;
    padding: 0 10px;
  }
}

@media (max-width: 700px) {
  .annotation-modal.annotation-modal--side {
    align-items: flex-end;
    padding: 8px;
  }

  .annotation-modal--side .annotation-modal-sheet {
    width: 100%;
    height: min(78dvh, 620px);
    max-height: calc(100dvh - 16px);
    border-radius: 10px;
    padding: 0;
  }

  .annotation-return-bar {
    right: 10px;
    bottom: 10px;
    left: 10px;
    max-width: none;
    flex-wrap: wrap;
  }

  .annotation-return-bar span {
    flex: 1 1 100%;
  }

  .annotation-return-bar button:not(.annotation-return-dismiss) {
    flex: 1 1 auto;
  }
}

/* --- Audit Tab --- */
.admin-audit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 14px;
  flex-wrap: wrap;
}

.admin-audit-bar input[type="text"] {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  background: var(--panel);
  color: var(--text);
  min-width: 160px;
}

.admin-audit-table .admin-audit-meta {
  font-size: 11px;
  color: var(--muted);
  max-width: 260px;
  word-break: break-all;
}

/* --- Versions subtable --- */
.admin-versions-subtable {
  margin: 0;
  border-radius: 0;
  border-top: 1px solid var(--line);
  background: var(--panel-soft, #f8f9fa);
}

.admin-version-row td {
  font-size: 12px;
}

.admin-row-versions {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.admin-row-versions:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Scraping deactivation badge --- */
.admin-deactivation-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(220, 53, 69, 0.12);
  color: #b52230;
  border: 1px solid rgba(181, 34, 48, 0.3);
  letter-spacing: 0.02em;
}

/* --- User action buttons --- */
.admin-user-unlock {
  min-height: 28px;
  border: 1px solid rgba(22, 130, 74, 0.45);
  border-radius: 6px;
  background: rgba(22, 130, 74, 0.08);
  color: var(--ok);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.admin-user-unlock:hover {
  background: rgba(22, 130, 74, 0.18);
  border-color: var(--ok);
}

.admin-user-delete {
  min-height: 28px;
  border: 1px solid rgba(181, 34, 48, 0.35);
  border-radius: 6px;
  background: rgba(220, 53, 69, 0.06);
  color: #b52230;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.admin-user-delete:hover {
  background: rgba(220, 53, 69, 0.14);
  border-color: #b52230;
}

/* --- Dashboard Stats Grid --- */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.admin-stat-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 10px;
  text-align: center;
  gap: 4px;
}

.admin-stat-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
}

.admin-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-stat-warn .admin-stat-value { color: #b84a00; }
.admin-stat-err .admin-stat-value { color: #b52230; }
.admin-stat-warn--active { background: #fff7ed; border-color: rgba(184, 74, 0, 0.25); }
.admin-stat-err--active { background: #fff1f2; border-color: rgba(181, 34, 48, 0.25); }

/* --- Import Log --- */
.admin-import-log-row td {
  padding: 0;
  background: #1e2329;
}

.admin-import-log-pre {
  margin: 0;
  padding: 12px 16px;
  font-family: "Fira Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 320px;
  overflow-y: auto;
}

.admin-import-log {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.admin-import-log:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-import-delete {
  min-height: 26px;
  border: 1px solid rgba(181, 34, 48, 0.35);
  border-radius: 6px;
  background: rgba(220, 53, 69, 0.06);
  color: #b52230;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.admin-import-delete:hover {
  background: rgba(220, 53, 69, 0.14);
  border-color: #b52230;
}

/* --- Annotations Bulk Bar --- */
.admin-bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 10px;
  flex-wrap: wrap;
}

.admin-bulk-bar button {
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.admin-bulk-bar button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 109, 119, 0.06);
}

/* --- Settings Tab --- */
.admin-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-smtp-test-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.admin-smtp-test-form label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.admin-smtp-test-form input[type="email"] {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  min-width: 200px;
}

/* --- Export Links --- */
.admin-export-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.admin-export-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: rgba(0, 109, 119, 0.06);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.admin-export-link:hover {
  background: rgba(0, 109, 119, 0.14);
}

/* --- Checkbox column in annotations table --- */
.admin-annotations-table th:first-child,
.admin-annotations-table td:first-child {
  width: 32px;
  text-align: center;
  padding: 4px;
}

@media (max-width: 1500px) {
  .pdf-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
}

@media (max-width: 1100px) {
  .admin-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .admin-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── Primary / secondary buttons ─────────────────────────────────────────── */
.btn-primary {
  min-height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.btn-primary:hover { background: #005a63; }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.btn-secondary {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary:hover { background: rgba(0, 109, 119, 0.08); }
.btn-secondary:disabled { opacity: 0.5; cursor: default; }

/* ── Forgot-password panel ────────────────────────────────────────────────── */
.portal-input-wrap {
  position: relative;
}
.portal-input-wrap input {
  padding-left: 36px;
}
.portal-input-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}

.portal-forgot-link {
  margin: 0;
  text-align: right;
}

.portal-forgot-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.portal-forgot-btn:hover { color: var(--accent); }

.portal-forgot-panel {
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.portal-forgot-panel[hidden] {
  display: none;
}

.portal-forgot-panel > p {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  margin: 0;
}

.portal-login-actions .portal-forgot-btn {
  flex: 0 1 auto;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  text-decoration: none;
}

.portal-login-actions .portal-forgot-btn:hover {
  border-color: #8ca4b8;
  background: var(--panel-soft);
  color: var(--text);
}

@media (max-width: 760px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
    width: min(460px, 100%);
    min-height: 0;
  }

  .auth-brand-panel {
    flex-direction: row;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid #cfd9e5;
    padding: 22px 24px;
  }

  .auth-brand-panel p {
    font-size: 24px;
  }

  .auth-brand-panel span {
    margin-top: 5px;
    font-size: 12px;
  }

  .portal-login {
    align-content: start;
    padding: 28px 24px;
  }
}

@media (max-width: 460px) {
  .auth-gate {
    padding: 14px;
  }

  .auth-brand-panel {
    padding: 18px;
  }

  .auth-brand-mark {
    width: 44px;
    height: 44px;
  }

  .portal-login {
    padding: 24px 18px;
  }

  .portal-login-actions button:first-child {
    min-width: 100%;
  }
}

/* ── Dashboard system info ────────────────────────────────────────────────── */
.dashboard-system-info {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.dashboard-system-kv {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 20px;
  margin: 0;
}
.dashboard-system-kv > div { display: contents; }
.dashboard-system-kv dt {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  align-self: center;
}
.dashboard-system-kv dd {
  font-size: 13px;
  color: var(--text);
  margin: 0;
  word-break: break-all;
}

/* ── Settings layout ──────────────────────────────────────────────────────── */
.admin-settings-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 20px;
  align-items: start;
}
.admin-settings-main { display: flex; flex-direction: column; gap: 20px; }
.admin-settings-side { display: flex; flex-direction: column; gap: 20px; }

.admin-settings-fieldset {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-bottom: 4px;
}
.admin-settings-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-settings-field > span:not(.admin-settings-hint) {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-settings-field input[type="text"],
.admin-settings-field input[type="email"],
.admin-settings-field input[type="password"],
.admin-settings-field input[type="number"] {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  min-width: 0;
  width: 100%;
  max-width: 380px;
}
.admin-settings-field input:focus {
  outline: none;
  border-color: var(--accent);
}
.admin-settings-field--bool {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.admin-settings-field--bool > span {
  text-transform: none;
  font-size: 13px;
  color: var(--text);
  letter-spacing: normal;
}
.admin-settings-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  margin-top: 2px;
}
.admin-settings-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.admin-settings-divider {
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}

/* ── SMTP test row ────────────────────────────────────────────────────────── */
.admin-smtp-test-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.admin-smtp-test-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.admin-smtp-test-row label span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.admin-smtp-test-row input[type="email"] {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  min-width: 180px;
}

/* ── Index job cancel button ──────────────────────────────────────────────── */
.admin-index-cancel {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}
.admin-index-cancel:hover {
  border-color: #c0392b;
  color: #c0392b;
}
.admin-index-cancel:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ── Set Password button (users table) ───────────────────────────────────── */
.admin-set-pw {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.admin-set-pw:hover { border-color: var(--accent); color: var(--accent); }
.admin-set-pw:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 900px) {
  .admin-settings-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Comms tab ────────────────────────────────────────────────────────────── */
.admin-comms-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
  align-items: start;
}
.admin-comms-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}
.admin-comms-field > span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-comms-field input,
.admin-comms-field select,
.admin-comms-field textarea {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  resize: vertical;
}
.admin-comms-field input:focus,
.admin-comms-field select:focus,
.admin-comms-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.admin-comms-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
}

.comms-history-row:hover td { background: var(--panel-soft); }
.comms-history-detail td { padding: 0 !important; border-top: none !important; }
.comms-history-detail-inner {
  padding: 10px 14px 14px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

@media (max-width: 900px) {
  .admin-comms-layout { grid-template-columns: 1fr; }
}

/* ── Backup tab ───────────────────────────────────────────────────────────── */
.admin-backup-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}
.admin-backup-scope-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}
.admin-backup-scope-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.admin-backup-scope-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(0, 109, 119, 0.04);
}
.admin-backup-scope-option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.admin-backup-scope-option div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.admin-backup-scope-option strong {
  font-size: 13px;
  color: var(--text);
}
.admin-backup-scope-option span {
  font-size: 12px;
  color: var(--muted);
}
.admin-backup-create-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}
.backup-filename-cell {
  font-size: 12px;
  font-family: monospace;
  word-break: break-all;
}
.admin-action-btn {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.admin-action-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(0,109,119,0.05); }

/* PDF module table */
.admin-pdf-files-table { margin-top: 8px; }
.pdf-filename-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11.5px;
  word-break: break-all;
  color: var(--muted);
}
.pdf-filename-cell strong { color: var(--text); font-size: 12px; }
.pdf-filename-cell span { color: var(--muted); }
.pdf-empty-cell { padding: 6px 0; font-size: 12px; }
.pdf-encrypted-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  padding: 1px 6px;
  margin-top: 3px;
}
.pdf-encrypted-badge::before { content: "🔒"; font-size: 10px; }

/* PDF upload row */
.pdf-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.pdf-choose-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(0, 109, 119, 0.28);
  border-radius: 6px;
  background: rgba(0, 109, 119, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.pdf-choose-btn:hover {
  border-color: var(--accent);
  background: rgba(0, 109, 119, 0.12);
}

.pdf-chosen-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

/* PDF module head buttons — inherit from admin-panel-head button rule */
.pdf-save-btn,
.pdf-module-delete-btn,
.pdf-clear-btn,
.pdf-upload-btn {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.pdf-save-btn:hover,
.pdf-clear-btn:hover,
.pdf-upload-btn:hover {
  border-color: #8ca4b8;
  background: var(--panel-soft);
}

.pdf-save-btn:disabled,
.pdf-module-delete-btn:disabled,
.pdf-clear-btn:disabled,
.pdf-upload-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.pdf-module-delete-btn:hover {
  border-color: rgba(181, 34, 48, 0.5);
  color: #b52230;
  background: rgba(220, 53, 69, 0.08);
}

/* ── Restore dialog ───────────────────────────────────────────────────────── */
.admin-restore-dialog {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.admin-restore-dialog:not([hidden]) {
  display: flex;
}
.admin-restore-dialog[hidden] {
  display: none;
}
.admin-restore-dialog-inner {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 32px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.admin-restore-dialog-inner h3 {
  margin: 0 0 6px;
  font-size: 17px;
}
.admin-restore-filename {
  font-size: 12px;
  font-family: monospace;
  color: var(--muted);
  word-break: break-all;
  margin: 0 0 14px;
}
.admin-restore-scope-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 16px;
}
.admin-restore-scope-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.admin-restore-scope-options input[type="radio"] {
  accent-color: var(--accent);
}
.admin-restore-warn {
  font-size: 12px;
  color: #c0392b;
  background: rgba(192, 57, 43, 0.08);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 0 0 16px;
}
.admin-restore-dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 900px) {
  .admin-backup-layout { grid-template-columns: 1fr; }
}

/* ── Notification Bell ─────────────────────────────────────────────────────── */
.notif-bell-wrap {
  position: relative;
}
.notif-bell {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  padding: 4px 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  position: relative;
  transition: color 0.15s;
}
.notif-bell:hover { color: var(--text-1); }
.notif-badge {
  position: absolute;
  top: 0px;
  right: 0px;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 1000;
  overflow: hidden;
}
.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.notif-read-all {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent);
  font-size: 12px;
  padding: 0;
}
.notif-read-all:hover { text-decoration: underline; }
.notif-list {
  max-height: 360px;
  overflow-y: auto;
}
.notif-empty {
  padding: 24px 14px;
  color: var(--text-2);
  font-size: 13px;
  text-align: center;
}
.notif-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  background: rgba(0, 109, 119, 0.05);
  transition: background 0.12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--panel-soft); }
.notif-item.notif-read {
  background: none;
  opacity: 0.65;
}
.notif-item-msg {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}
.notif-item-date {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.notif-item.notif-announcement {
  border-left: 3px solid var(--accent);
}
.notif-item-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 3px;
}
.admin-comms-channels {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-comms-checkbox {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.admin-comms-checkbox input[type="checkbox"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}
.admin-comms-checkbox span {
  font-size: 13px;
  color: var(--text);
}

/* ── Note Search View ─────────────────────────────────────────────────────── */
.notesearch-view { padding: 0 0 40px; }
.notesearch-bar {
  padding: 0 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notesearch-query-label { display: block; }
.notesearch-query {
  width: 100%;
  max-width: 600px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 14px;
  background: var(--input-bg, var(--surface));
  color: var(--text-1);
}
.notesearch-query:focus { outline: 2px solid var(--accent); border-color: transparent; }
.notesearch-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── Annotation Votes ─────────────────────────────────────────────────────── */
.ann-vote-bar {
  padding: 6px 0 2px;
}
.ann-vote-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-2);
  transition: all 0.15s;
}
.ann-vote-btn:hover { border-color: var(--accent); color: var(--accent); }
.ann-vote-btn--active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb, 94,106,210), 0.10);
  color: var(--accent);
  font-weight: 600;
}

/* ── Annotation Replies ───────────────────────────────────────────────────── */
.ann-reply-section {
  margin-top: 6px;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}
.ann-reply-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--accent);
  padding: 0;
  margin-bottom: 6px;
}
.ann-reply-toggle:hover { text-decoration: underline; }
.ann-reply-body { padding: 4px 0 0; }
.ann-reply-loading { font-size: 12px; color: var(--text-2); padding: 6px 0; }
.ann-reply-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.ann-reply-item {
  background: var(--hover, rgba(0,0,0,0.03));
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
}
.ann-reply-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 3px;
  font-size: 11px;
  color: var(--text-2);
}
.ann-reply-author { font-weight: 600; color: var(--text-1); }
.ann-reply-content p { margin: 0; }
.ann-reply-delete {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: #c0392b;
  padding: 2px 0 0;
  display: block;
}
.ann-reply-delete:hover { text-decoration: underline; }
.ann-reply-form { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.ann-reply-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  resize: vertical;
  background: var(--input-bg, var(--surface));
  color: var(--text-1);
  box-sizing: border-box;
}
.ann-reply-input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.ann-reply-submit {
  align-self: flex-end;
  padding: 4px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
.ann-reply-submit:hover { opacity: 0.88; }
.ann-reply-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Note results in search tab ─────────────────────────────────────────── */
.search-note-results {
  margin-top: 20px;
  border-top: 2px solid var(--border);
  padding-top: 12px;
}
.search-notes-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0 4px;
}
.search-notes-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.search-notes-count {
  font-size: 12px;
  color: var(--text-2);
}
.result-note {
  cursor: pointer;
}
.search-note-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.search-note-author {
  font-size: 11px;
  color: var(--text-2);
}

/* ── Analytics Tab ─────────────────────────────────────────────────────────── */
.analytics-layout { display: flex; flex-direction: column; gap: 20px; padding-bottom: 24px; }

/* Header */
.analytics-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.analytics-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  margin: 0;
  flex: 1 1 auto;
}
.analytics-days-filter {
  display: flex;
  gap: 4px;
  background: var(--surface-2, #f1f5f9);
  border-radius: 8px;
  padding: 3px;
}
.analytics-days-btn {
  padding: 4px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.analytics-days-btn:hover { background: var(--surface-1); color: var(--text-1); }
.analytics-days-btn.active { background: var(--surface-1); color: var(--accent, #0f7b8c); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* KPI cards */
.analytics-kpi-row { display: flex; gap: 12px; flex-wrap: wrap; }
.analytics-kpi {
  flex: 1 1 110px;
  min-width: 0;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 10px;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.analytics-kpi--accent { border-left: 3px solid var(--accent, #0f7b8c); }
.analytics-kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.analytics-kpi-label { font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; }
.analytics-kpi-sub { font-size: 10px; color: var(--text-3, var(--text-2)); }

/* Section titles */
.analytics-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  padding: 4px 0 0;
  border-top: 1px solid var(--border-1);
}

/* DAU bar chart */
.analytics-chart-panel { overflow: hidden; }
.analytics-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  padding: 8px 4px 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.analytics-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 0 16px;
  min-width: 16px;
  max-width: 40px;
  height: 100%;
  justify-content: flex-end;
  gap: 2px;
  cursor: default;
}
.analytics-bar {
  width: 100%;
  background: var(--accent, #0f7b8c);
  border-radius: 3px 3px 0 0;
  transition: opacity 0.15s;
}
.analytics-bar-group:hover .analytics-bar { opacity: 0.7; }
.analytics-bar-label {
  font-size: 8px;
  color: var(--text-2);
  writing-mode: vertical-rl;
  white-space: nowrap;
  max-height: 32px;
  overflow: hidden;
  margin-top: 2px;
}
.analytics-bar-val { font-size: 8px; color: var(--text-1); font-weight: 600; }

/* Tables row */
.analytics-tables-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.analytics-table-panel { flex: 1 1 220px; min-width: 0; overflow: hidden; }
.analytics-table-panel--wide { flex: 2 1 300px; }
.analytics-panel-hint { font-size: 11px; color: var(--text-2); font-weight: 400; }

/* Ranked table with inline bars */
.analytics-ranked-table { width: 100%; table-layout: fixed; }
.analytics-ranked-table thead th { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); padding: 4px 6px; }
.analytics-ranked-table td { padding: 5px 6px; vertical-align: middle; font-size: 12px; }
.analytics-rank { width: 24px; color: var(--text-2); font-size: 11px; text-align: right; }
.analytics-count { width: 44px; text-align: right; font-weight: 600; font-size: 12px; }
.analytics-label-cell { position: relative; overflow: hidden; }
.analytics-label-text {
  position: relative;
  z-index: 1;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.analytics-inline-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--accent, #0f7b8c);
  opacity: 0.08;
  border-radius: 2px;
  pointer-events: none;
}
.analytics-ranked-table tbody tr:hover .analytics-inline-bar { opacity: 0.15; }

/* Horizontal country bars */
.analytics-hbar-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.analytics-hbar-row { display: flex; align-items: center; gap: 8px; }
.analytics-hbar-label { flex: 0 0 100px; font-size: 12px; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.analytics-hbar-track { flex: 1 1 auto; height: 10px; background: var(--surface-2, #f1f5f9); border-radius: 5px; overflow: hidden; }
.analytics-hbar-fill { height: 100%; background: var(--accent, #0f7b8c); border-radius: 5px; transition: width 0.3s; }
.analytics-hbar-val { flex: 0 0 28px; font-size: 11px; font-weight: 600; color: var(--text-2); text-align: right; }

/* Part-number datasets */
.part-number-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}
.part-number-active-panel,
.part-number-upload-panel { min-width: 0; }
.part-number-active-panel .admin-panel-head > div,
.part-number-upload-panel .admin-panel-head > div { min-width: 0; }
.part-number-active-panel .eyebrow,
.part-number-upload-panel .eyebrow {
  margin: 0 0 2px;
  color: var(--text-2);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.part-number-active-panel h2,
.part-number-upload-panel h2 { margin: 0; }
.part-number-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.part-number-stat {
  min-width: 0;
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.part-number-stat strong {
  display: block;
  color: var(--text-1);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.part-number-stat span {
  display: block;
  margin-top: 2px;
  color: var(--text-2);
  font-size: 10px;
}
.part-number-meta { margin-top: 12px; }
.part-number-active-actions,
.part-number-preview-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.part-number-active-actions [hidden],
.part-number-preview-actions [hidden] {
  display: none !important;
}
.part-number-preview-actions span {
  color: var(--text-2);
  font-size: 11px;
}
.part-number-upload-form { display: grid; gap: 10px; }
.part-number-drop {
  display: grid;
  place-items: center;
  min-height: 126px;
  padding: 18px;
  border: 1px dashed #8baab5;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface-1));
  color: var(--text-1);
  cursor: pointer;
  text-align: center;
}
.part-number-drop:hover { border-color: var(--accent); }
.part-number-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.part-number-drop span { font-weight: 700; }
.part-number-drop small { margin-top: 5px; color: var(--text-2); }
.part-number-preview {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.part-number-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.part-number-preview-head > div { min-width: 0; }
.part-number-preview-head strong,
.part-number-preview-label { display: block; }
.part-number-preview-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.part-number-preview-label {
  margin-bottom: 2px;
  color: var(--text-2);
  font-size: 10px;
  text-transform: uppercase;
}
.part-number-validation-ok,
.part-number-message-list {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 11px;
}
.part-number-validation-ok {
  border: 1px solid #abd7c1;
  background: #effaf4;
  color: #17633c;
}
.part-number-message-list.is-warning {
  border: 1px solid #e8ca87;
  background: #fff8e7;
  color: #72500b;
}
.part-number-message-list.is-error {
  border: 1px solid #e5a5a5;
  background: #fff1f1;
  color: #8c2424;
}
.part-number-message-list p { margin: 5px 0 0; }
.part-number-history td small { display: block; margin-top: 2px; color: var(--text-2); }
.admin-state.is-success { color: #177245; }

/* Part-number search groups */
.part-number-result-group {
  margin: 12px 0 18px;
  padding: 10px;
  border: 1px solid #b9d0d8;
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 3%, var(--surface-1));
}
.part-number-result-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 3px 8px;
}
.part-number-result-group-head > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.part-number-result-group-head > span {
  color: var(--text-2);
  font-size: 11px;
  white-space: nowrap;
}
.part-number-result-kicker {
  flex-basis: 100%;
  color: var(--text-2);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.part-number-new-format {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e8f1ff;
  color: #24558f;
  font-size: 9px;
  font-weight: 700;
  vertical-align: middle;
}
.part-number-match-note {
  margin: 0 3px 9px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #fff7d8;
  color: #664b05;
  font-size: 11px;
}
.part-number-result-items {
  display: grid;
  gap: 8px;
}
.part-number-result-items .result-card { margin: 0; }

@media (max-width: 980px) {
  .part-number-admin-layout { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .part-number-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .part-number-result-group-head { align-items: flex-start; flex-direction: column; }
}

/* ── Toasts ─────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #24313f;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 6px 22px rgba(15, 26, 38, 0.28);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: auto;
}
.toast.visible { opacity: 1; transform: translateY(0); }
.toast[data-tone="success"] { background: #0f7a4f; }
.toast[data-tone="error"] { background: #b52230; }
.toast-message { flex: 1 1 auto; overflow-wrap: anywhere; }
.toast-action {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: transparent;
  color: #fff;
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.toast-action:hover { background: rgba(255, 255, 255, 0.14); }
.toast-close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.toast-close:hover { color: #fff; }

/* ── Busy buttons ───────────────────────────────────────────────────────── */
.btn-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 7px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
button.busy { cursor: progress; }
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ── PDF processing steps (parcel-tracking style) ───────────────────────── */
.pdf-steps-row {
  padding: 10px 14px 12px;
  border-top: 1px solid rgba(31, 45, 61, 0.08);
}
.pdf-steps {
  display: flex;
  align-items: flex-start;
  list-style: none;
  margin: 0;
  padding: 0;
}
.pdf-steps li {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  text-align: center;
}
.pdf-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 8px;
  left: calc(50% + 12px);
  right: calc(-50% + 12px);
  height: 2px;
  border-radius: 2px;
  background: #d4dbe4;
}
.pdf-steps li[data-state="done"]:not(:last-child)::after { background: #0f7a4f; }
.pdf-step-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #b6c0cc;
  background: #fff;
  box-sizing: border-box;
  flex: 0 0 auto;
}
.pdf-steps li[data-state="done"] .pdf-step-dot {
  border-color: #0f7a4f;
  background: #0f7a4f;
}
.pdf-steps li[data-state="done"] .pdf-step-dot::before {
  content: "✓";
  display: block;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
}
.pdf-steps li[data-state="active"] .pdf-step-dot {
  border-color: #1f6feb;
  background: #1f6feb;
  animation: pdf-step-pulse 1.2s ease-in-out infinite;
}
.pdf-steps li[data-state="failed"] .pdf-step-dot {
  border-color: #b52230;
  background: #b52230;
}
.pdf-steps li[data-state="failed"] .pdf-step-dot::before {
  content: "✕";
  display: block;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
}
@keyframes pdf-step-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31, 111, 235, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(31, 111, 235, 0); }
}
.pdf-step-label {
  font-size: 11px;
  font-weight: 600;
  color: #5b6b7d;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pdf-steps li[data-state="active"] .pdf-step-label { color: #16283b; font-weight: 700; }
.pdf-steps li[data-state="done"] .pdf-step-label { color: #0f7a4f; }
.pdf-steps li[data-state="failed"] .pdf-step-label { color: #b52230; font-weight: 700; }
.pdf-step-subtitle {
  font-size: 10px;
  font-weight: 500;
  color: #6b7a8c;
  white-space: nowrap;
}
.pdf-steps-compact {
  display: none;
  font-size: 12px;
  font-weight: 600;
  color: #16283b;
}
@media (max-width: 640px) {
  .pdf-steps { display: none; }
  .pdf-steps-compact { display: block; }
}

/* ── PDF worker status dot ──────────────────────────────────────────────── */
.pdf-worker-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #5b6b7d;
  max-width: 420px;
}
.pdf-worker-status::before {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #b6c0cc;
}
.pdf-worker-status[data-state="online"] { color: #0f7a4f; }
.pdf-worker-status[data-state="online"]::before { background: #17a668; }
.pdf-worker-status[data-state="offline"] { color: #b52230; }
.pdf-worker-status[data-state="offline"]::before { background: #d6293a; }

/* The hidden attribute must win over .admin-action-btn's display rule. */
.pdf-job-retry-btn[hidden] { display: none; }
