:root {
  --bg: #f6f2ea;
  --bg-rgb: 246, 242, 234;
  --glass: rgba(255, 255, 255, 0.78);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --nav-glass: rgba(255, 255, 255, 0.55);
  --nav-glass-scrolled: rgba(255, 255, 255, 0.38);
  --glass-border: rgba(0, 0, 0, 0.08);
  --text: #1c1916;
  --ink: #1c1916;
  --text-secondary: rgba(28, 25, 22, 0.62);
  --faint: rgba(28, 25, 22, 0.12);
  --leaf-teal: #2f8f86;
  --accent: #3a3532;
  --accent-hover: #2a2624;
  --accent-soft: rgba(58, 53, 50, 0.1);
  --btn-primary-text: #fff;
  --input-bg: rgba(255, 255, 255, 0.55);
  --input-bg-focus: rgba(255, 255, 255, 0.72);
  --btn-secondary-bg: rgba(255, 250, 244, 0.42);
  --btn-ghost-bg: rgba(255, 255, 255, 0.28);
  --avatar-bg: rgba(255, 250, 244, 0.55);
  --orb-a: rgba(232, 214, 190, 0.35);
  --orb-b: rgba(236, 196, 168, 0.22);
  --orb-c: rgba(214, 196, 176, 0.28);
  --border: rgba(58, 50, 43, 0.08);
  --shadow-glass: 0 8px 30px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --shadow-lift: 0 12px 36px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --radius: 22px;
  --radius-sm: 14px;
  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  --error: #d70015;
  --panel: rgba(255, 252, 248, 0.97);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #1c1916;
  --bg-rgb: 28, 25, 22;
  --glass: rgba(48, 44, 40, 0.78);
  --glass-strong: rgba(58, 54, 50, 0.9);
  --nav-glass: rgba(28, 25, 22, 0.5);
  --nav-glass-scrolled: rgba(28, 25, 22, 0.32);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text: #f3eee6;
  --ink: #f3eee6;
  --text-secondary: #b8aea4;
  --faint: rgba(243, 238, 230, 0.14);
  --accent: #f3eee6;
  --accent-hover: #e4d9cc;
  --accent-soft: rgba(243, 238, 230, 0.12);
  --btn-primary-text: #1c1916;
  --input-bg: rgba(255, 255, 255, 0.06);
  --input-bg-focus: rgba(255, 255, 255, 0.1);
  --btn-secondary-bg: rgba(255, 255, 255, 0.06);
  --btn-ghost-bg: rgba(255, 255, 255, 0.06);
  --avatar-bg: rgba(255, 255, 255, 0.08);
  --orb-a: rgba(120, 96, 72, 0.28);
  --orb-b: rgba(140, 100, 70, 0.18);
  --orb-c: rgba(90, 78, 68, 0.3);
  --border: rgba(255, 255, 255, 0.08);
  --shadow-glass: 0 8px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-lift: 0 12px 36px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --error: #ff6b6b;
  --panel: rgba(42, 38, 34, 0.97);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Topbar — same full-width liquid glass as the public site */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 1rem clamp(1rem, 3vw, 2rem);
  border: 0;
  background: rgba(var(--bg-rgb), 0.78);
  box-shadow: none;
  backdrop-filter: blur(12px) saturate(1.25);
  -webkit-backdrop-filter: blur(12px) saturate(1.25);
  transition: background 280ms ease, backdrop-filter 280ms ease, box-shadow 280ms ease;
}

.topbar.is-scrolled {
  background:
    linear-gradient(
      145deg,
      rgba(var(--bg-rgb), 0.58) 0%,
      rgba(var(--bg-rgb), 0.42) 42%,
      rgba(var(--bg-rgb), 0.52) 100%
    );
  backdrop-filter: blur(16px) saturate(1.35);
  -webkit-backdrop-filter: blur(16px) saturate(1.35);
  box-shadow: 0 12px 32px rgba(28, 25, 22, 0.03);
}

.topbar.is-scrolled::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    118deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0) 50%
  );
  pointer-events: none;
}

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.brand-home {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}

.brand-logo-wrap {
  --logo-h: 2.9rem;
  position: relative;
  display: block;
  height: var(--logo-h);
  width: calc(var(--logo-h) * 539 / 227);
  overflow: hidden;
}

.brand-logo {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: fill;
}

.brand-logo--inverse {
  width: calc(100% * 595 / 539);
  height: calc(100% * 283 / 227);
  inset: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
}

html[data-theme="dark"] .brand-logo:not(.brand-logo--inverse) {
  opacity: 0;
}

html[data-theme="dark"] .brand-logo--inverse {
  opacity: 1;
}

.brand-portal {
  flex-shrink: 0;
  padding-left: 0.85rem;
  border-left: 1px solid rgba(28, 25, 22, 0.12);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

.brand-portal:hover {
  color: var(--ink);
}

html[data-theme="dark"] .brand-portal {
  border-left-color: rgba(255, 255, 255, 0.16);
}

/* Layout */
.wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 7rem 24px 64px;
}

.foot {
  position: relative;
  z-index: 1;
  padding: 20px 28px 28px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
}

.foot p {
  margin: 0;
}

/* Cards */
.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-glass);
  padding: 28px;
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
}

.muted {
  color: var(--text-secondary);
}

/* Login */
.login-card {
  max-width: 400px;
  margin: 48px auto 0;
}

.login-card h1 {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.field input {
  font-family: inherit;
  font-size: 14px;
  padding: 11px 13px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--input-bg-focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Flash */
.flash {
  max-width: 400px;
  margin: 0 auto 18px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(215, 0, 21, 0.08);
  border: 1px solid rgba(215, 0, 21, 0.22);
  color: var(--error);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.flash p {
  margin: 0;
}

/* Portal */
.portal-head {
  margin-bottom: 32px;
}

.portal-head h1 {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.topbar-end {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--ink);
  overflow: hidden;
  flex-shrink: 0;
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0 0.55rem;
  height: 2.25rem;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
  cursor: pointer;
}

.lang-switch button + button {
  border-left: 1px solid var(--ink);
}

.lang-switch button.is-on {
  background: var(--ink);
  color: var(--bg);
}

.topbar-run {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--faint);
  padding: 0 0.85rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease;
}

.topbar-run:hover {
  transform: translateY(-1px);
  border-color: var(--ink);
}

.theme-toggle,
.updates-btn,
.profile-btn,
.knowledge-link {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
  font-size: 0;
  text-decoration: none;
}

.theme-toggle:hover,
.updates-btn:hover,
.updates-btn[aria-expanded="true"],
.profile-btn:hover,
.profile-btn[aria-expanded="true"],
.knowledge-link:hover {
  color: var(--ink);
  box-shadow: none;
}

.knowledge-menu {
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.knowledge-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 280px;
  max-width: calc(100vw - 36px);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--panel);
  box-shadow: var(--shadow-lift);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  z-index: 60;
}

.knowledge-panel a {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
}

.knowledge-panel a:hover {
  background: var(--accent-soft);
}

.theme-toggle svg,
.updates-btn svg,
.profile-btn svg,
.knowledge-link svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

.profile-menu {
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-menu--logo,
.profile-btn--logo {
  width: auto;
  height: 2.9rem;
}

.client-avatar {
  box-sizing: border-box;
  width: auto;
  height: 2.9rem;
  max-width: 12rem;
  border-radius: 0;
  object-fit: contain;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  flex-shrink: 0;
  display: block;
}

.client-avatar--dark {
  display: none;
}

html[data-theme="dark"] .client-avatar--light {
  display: none;
}

html[data-theme="dark"] .client-avatar--dark {
  display: block;
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  box-shadow: var(--shadow-lift);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  z-index: 60;
}

.profile-dropdown-name {
  margin: 0;
  padding: 10px 12px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.profile-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}

.profile-dropdown-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-dropdown-item:hover {
  background: var(--accent-soft);
}

.empty {
  margin-top: 40px;
  text-align: center;
}

.cards {
  display: grid;
  gap: 18px;
}

.client-group {
  margin-bottom: 2.5rem;
  scroll-margin-top: 5.5rem;
}

.client-group-head {
  margin: 0 0 14px;
}

.client-group-head h2 {
  margin: 0 0 2px;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.client-group-head .muted {
  margin: 0;
  font-size: 13px;
}

.analysis-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.analysis-card:hover {
  transform: translateY(-2px);
  background: var(--glass-strong);
  box-shadow: var(--shadow-lift);
}

.analysis-card h2 {
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.analysis-card .topic {
  margin: 0 0 28px;
  font-size: 13px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.card-head h2 {
  margin: 0 0 12px;
}

.card-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.card-toggle h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.card-chevron {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-top: 0.45rem;
  flex-shrink: 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.analysis-card:not(.is-collapsed) .card-chevron {
  margin-top: 0.35rem;
  transform: rotate(45deg);
}

.analysis-card.is-collapsed .actions,
.analysis-card.is-collapsed .topic {
  display: none;
}

.analysis-card.is-collapsed .card-head {
  margin-bottom: 0;
}

.card-order {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.card-drag,
.card-order-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  min-height: 1.75rem;
  padding: 0;
  border: 1px solid var(--faint);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1;
}

.card-drag {
  cursor: grab;
}

.card-drag:active {
  cursor: grabbing;
}

.card-drag svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.analysis-card.is-dragging {
  opacity: 0.45;
  transform: none;
}

.analysis-card.is-dragging:hover {
  transform: none;
}

.analysis-groups {
  display: grid;
  gap: 14px;
}

.analysis-group-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--shadow-glass);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.analysis-group-toggle:hover {
  background: var(--glass-strong);
}

.analysis-group-toggle .card-chevron {
  margin-top: 0;
}

.analysis-group:not(.is-collapsed) > .analysis-group-toggle .card-chevron {
  transform: rotate(45deg);
}

.analysis-group-label {
  flex: 1;
  min-width: 0;
}

.analysis-group-label h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.analysis-group-body .analysis-group-toggle {
  padding: 14px 16px;
}

.analysis-group-body .analysis-group-label h2 {
  font-size: 15px;
}

.analysis-group-count {
  flex-shrink: 0;
  font-size: 13px;
}

.analysis-group-body {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding-left: 14px;
}

.analysis-group.is-collapsed > .analysis-group-body {
  display: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-ghost {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 0;
  min-height: 2.75rem;
  padding: 0 1.15rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  box-shadow: none;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-ghost:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.btn-primary:hover {
  background: var(--ink);
}

.btn-secondary,
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--faint);
}

.btn-secondary:hover,
.btn-ghost:hover {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.login-card .btn-primary {
  margin-top: 4px;
  width: 100%;
  padding: 12px;
}

.logout-form {
  margin: 0;
}

.updates-menu {
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.updates-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--error);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  line-height: 14px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}

.updates-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 360px;
  max-width: calc(100vw - 36px);
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--panel);
  box-shadow: var(--shadow-lift);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  z-index: 60;
}

.updates-panel-head {
  padding: 10px 12px 8px;
}

.updates-panel-head h2 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
}

.updates-panel-head .muted {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.updates-empty {
  margin: 8px 12px 12px;
}

.updates-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.updates-item {
  padding: 12px;
  border-top: 1px solid var(--glass-border);
}

.updates-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.updates-item-meta time {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.updates-new {
  display: none;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--error);
}

.updates-item.is-new .updates-new {
  display: inline;
}

.updates-item h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.updates-item-analysis {
  margin: 6px 6px 0 0;
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 8px;
}

.updates-item-body {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

/* PDF viewer */
.viewer-body {
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.viewer-body::before {
  display: none;
}

.viewer-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-strong);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
}

.viewer-title {
  flex: 1;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viewer-frame {
  flex: 1;
  width: 100%;
  border: 0;
}

.viewer-video {
  display: block;
  width: 100%;
  height: calc(100vh - 53px);
  background: #111;
  object-fit: contain;
}

.viewer-video::cue {
  font-size: 16px;
  line-height: 1.25;
}

/* Transcript */
.transcript {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

/* Renaming map */
.rename-card {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.rename-lead,
.rename-summary {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}

.rename-count {
  font-weight: 600;
}

.rename-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 14px;
  line-height: 1.5;
}

.rename-legend li {
  display: flex;
  gap: 0.65rem;
  align-items: baseline;
}

.rename-swatch {
  width: 0.7rem;
  height: 0.7rem;
  margin-top: 0.35rem;
  flex-shrink: 0;
  border-radius: 2px;
  background: currentColor;
}

.rename-legend .is-kept,
.rename-row.is-kept { color: inherit; }
.rename-legend .is-kept .rename-swatch,
.rename-row.is-kept { --rename-mark: #2e7d32; }
.rename-legend .is-flipped .rename-swatch,
.rename-row.is-flipped { --rename-mark: #c62828; }
.rename-legend .is-added .rename-swatch,
.rename-row.is-added { --rename-mark: #1565c0; }
.rename-legend .is-rejected .rename-swatch,
.rename-row.is-rejected { --rename-mark: rgba(28, 25, 22, 0.45); }

html[data-theme="dark"] .rename-legend .is-kept .rename-swatch,
html[data-theme="dark"] .rename-row.is-kept { --rename-mark: #9ccc65; }
html[data-theme="dark"] .rename-legend .is-flipped .rename-swatch,
html[data-theme="dark"] .rename-row.is-flipped { --rename-mark: #ef9a9a; }
html[data-theme="dark"] .rename-legend .is-added .rename-swatch,
html[data-theme="dark"] .rename-row.is-added { --rename-mark: #90caf9; }
html[data-theme="dark"] .rename-legend .is-rejected .rename-swatch,
html[data-theme="dark"] .rename-row.is-rejected { --rename-mark: rgba(243, 238, 230, 0.45); }

.rename-legend .rename-swatch {
  background: var(--rename-mark);
}

.rename-search input {
  width: 100%;
  max-width: 28rem;
  font-family: inherit;
  font-size: 14px;
  padding: 11px 13px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
}

.rename-search input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--input-bg-focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.rename-groups {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rename-group {
  padding: 0.85rem 0;
  border-top: 1px solid var(--faint);
}

.rename-group h2 {
  margin: 0 0 0.35rem;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.rename-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rename-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin: 0;
  padding: 0.15rem 0 0.15rem 0.8rem;
  box-shadow: inset 3px 0 0 var(--rename-mark, transparent);
  font-size: 14px;
  line-height: 1.7;
}

.rename-row[hidden],
.rename-group[hidden] {
  display: none !important;
}

.rename-became {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  white-space: nowrap;
}

.rename-from {
  font-weight: 500;
}

.rename-tag,
.rename-to {
  color: var(--text-secondary);
}

.rename-tag {
  margin-left: auto;
  font-size: 12px;
}

.rename-result {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin: 0.35rem 0 0;
  padding-left: 0.8rem;
  font-size: 15px;
  line-height: 1.5;
}

.rename-result .rename-to {
  color: var(--text);
  font-weight: 600;
}

.rename-arrow {
  color: var(--text-secondary);
}

.nodes-card {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.nodes-lead,
.nodes-why {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}

.nodes-part {
  padding: 0.85rem 0 0;
  border-top: 1px solid var(--faint);
}

.nodes-part h2 {
  margin: 0 0 0.35rem;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.nodes-list {
  margin: 0.2rem 0 0;
  padding-left: 1.2rem;
}

.nodes-list li {
  font-size: 14px;
  line-height: 1.7;
}

.nodes-why {
  margin-top: 0.65rem;
  color: var(--text-secondary);
}

.nodes-why strong {
  color: var(--text);
  font-weight: 600;
}

.rename-unused .rename-to {
  color: var(--text);
  font-weight: 500;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .brand {
    gap: 0.6rem;
  }

  .brand-portal {
    padding-left: 0.65rem;
    font-size: 0.72rem;
  }

  .wrap {
    padding-top: 6.25rem;
  }

  .portal-head h1,
  .login-card h1 {
    font-size: 24px;
  }

  @media (max-width: 420px) {
    .brand-portal {
      display: none;
    }
  }

  .updates-panel,
  .knowledge-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    top: 4.75rem;
    width: auto;
    max-width: none;
    min-width: 0;
  }
}

.staff-access,
.staff-grant {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 14px 0 0;
}

.staff-access {
  padding-top: 14px;
  border-top: 1px solid var(--faint);
}

.staff-grant select {
  font-family: inherit;
  font-size: 0.88rem;
  min-height: 2.75rem;
  min-width: 220px;
  padding: 0 12px;
  border: 1px solid var(--faint);
  border-radius: 0;
  background: var(--input-bg);
  color: var(--text);
}
