:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-soft: #f1f3f5;
  --border: #e1e4e8;
  --text: #1a1d1f;
  --text-label: #0a0a0a;
  --muted: #6c757d;
  --accent: #2d6a5a;
  --accent-hover: #235649;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Header ──────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 61px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
  line-height: 28px;
  letter-spacing: -0.45px;
}

.main-nav {
  display: flex;
  gap: 2px;
}

.nav-tab {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  background: none;
  transition: all 0.15s;
}

.nav-tab:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.nav-tab.active {
  color: var(--accent);
  background: rgba(45, 106, 90, 0.08);
  border-color: rgba(45, 106, 90, 0.15);
  font-weight: 600;
}

.tag {
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.15px;
}

/* ── Layout ──────────────────────────────────────────── */

.page {
  display: grid;
  gap: 16px;
  width: calc(100vw - 32px);
  max-width: 1800px;
  margin: 24px auto;
  min-width: 0;
}

.page > * {
  min-width: 0;
}

/* ── Card ────────────────────────────────────────────── */

.card,
.viewer-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card {
  padding: 24px;
}

.card.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ── Project meta ────────────────────────────────────── */

.meta h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
  letter-spacing: 0.07px;
}

h1,
h2 {
  margin: 0 0 8px;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

.meta p {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.15px;
  color: var(--muted);
}

.meta strong {
  color: var(--text);
  font-weight: 500;
}

.meta .sep {
  color: var(--border);
  margin: 0 4px;
  user-select: none;
}

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

/* ── Buttons ─────────────────────────────────────────── */

button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.15px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

button:hover,
.link-button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.link-button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── Forms ────────────────────────────────────────────── */

.upload-form {
  margin-top: 16px;
  display: grid;
  gap: 12px;
  max-width: 480px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-label);
  line-height: 20px;
}

input[type="text"],
input[type="file"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

input[type="text"]::placeholder {
  color: var(--muted);
}

input[type="text"]:focus,
input[type="file"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ── Projects table (legacy, kept for other pages) ──── */

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 10px 8px;
  font-size: 14px;
  line-height: 20px;
}

th {
  color: var(--text);
  font-weight: 500;
  letter-spacing: -0.15px;
}

td {
  color: var(--text);
}

td a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.15px;
}

td a:hover {
  text-decoration: underline;
}

/* ── File browser ───────────────────────────────────── */

.browser-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-soft);
  border-color: var(--muted);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* Breadcrumb */

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 8px 14px;
  margin-bottom: 12px;
  background: var(--surface-soft);
  border-radius: 6px;
  font-size: 13px;
  min-height: 36px;
  transition: background 0.15s;
}

.breadcrumb.drop-over {
  background: #e0f2e9;
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
}

.breadcrumb a:hover {
  background: rgba(45, 106, 90, 0.08);
  text-decoration: underline;
}

.bc-sep {
  color: var(--muted);
  margin: 0 2px;
  user-select: none;
}

/* File list — columnar layout */

.fl-header,
.fl-row {
  display: grid;
  grid-template-columns: 28px 1fr 180px 100px 200px;
  align-items: center;
  gap: 0;
}

.fl-header {
  padding: 6px 12px;
  border-bottom: 2px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fl-header .fl-col-name { padding-left: 26px; }

.file-list {
  display: flex;
  flex-direction: column;
}

.fl-row {
  padding: 0 12px;
  min-height: 44px;
  border-bottom: 1px solid var(--border);
  cursor: default;
  user-select: none;
  transition: background 0.1s;
}

.fl-row:last-child {
  border-bottom: none;
}

.fl-row:hover {
  background: var(--surface-soft);
}

.fl-row.dragging {
  opacity: 0.4;
}

.fl-row.drop-over {
  background: #e0f2e9;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 4px;
}

/* Grip handle */

.fl-col-grip {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}

.grip-icon {
  width: 14px;
  height: 14px;
  color: var(--border);
  transition: color 0.1s;
}

.fl-row:hover .grip-icon {
  color: var(--muted);
}

/* Name column */

.fl-col-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
}

.row-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--muted);
}

.row-icon--folder {
  color: var(--accent);
}

.fl-row[data-type="folder"] {
  background: rgba(45, 106, 90, 0.04);
}

.fl-row[data-type="folder"]:hover {
  background: rgba(45, 106, 90, 0.09);
}

.fl-row[data-type="folder"] .row-icon--folder {
  background: rgba(45, 106, 90, 0.12);
  border-radius: 4px;
  padding: 2px;
  width: 22px;
  height: 22px;
}

.item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fl-row[data-type="folder"] .item-name {
  color: var(--accent);
  font-weight: 600;
}

/* Source file column */

.fl-col-file {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Date column */

.fl-col-date {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

/* Action buttons column */

.fl-col-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.12s;
}

.fl-row:hover .fl-col-actions {
  opacity: 1;
}

.row-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
  line-height: 18px;
}

.row-btn:hover {
  background: var(--surface-soft);
  border-color: var(--muted);
}

.row-btn--open {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.row-btn--open:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.row-btn--delete {
  color: #c62828;
  border-color: #e0e0e0;
}

.row-btn--delete:hover {
  background: #fbe9e7;
  border-color: #ef9a9a;
  color: #b71c1c;
}

/* Rename input */

.rename-input {
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  padding: 2px 8px;
  border: 2px solid var(--accent);
  border-radius: 4px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  width: 100%;
  max-width: 320px;
}

/* Context menu */

.ctx-menu {
  display: none;
  position: absolute;
  z-index: 100;
  min-width: 150px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08);
  padding: 4px;
}

.ctx-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.ctx-menu button:hover {
  background: var(--surface-soft);
}

.ctx-menu .ctx-danger {
  color: #d32f2f;
}

.ctx-menu .ctx-danger:hover {
  background: #fbe9e7;
}

.empty-msg {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
  font-size: 14px;
}

/* Responsive: stack on narrow */

@media (max-width: 800px) {
  .fl-header { display: none; }
  .fl-row {
    grid-template-columns: 24px 1fr auto;
    gap: 6px;
    padding: 8px 10px;
  }
  .fl-col-file,
  .fl-col-date { display: none; }
  .fl-col-actions { opacity: 1; }
}

/* ── Viewer ──────────────────────────────────────────── */

.viewer-card {
  overflow: hidden;
  height: calc(100vh - 120px);
  min-height: 480px;
  padding: 1px;
}

iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 6px;
  background: var(--surface-soft);
}

/* ── Auto-zoom controls ─────────────────────────────── */

.viewer-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-label);
  cursor: pointer;
}

.toggle-control input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

#zoom-factor-select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
}

#zoom-factor-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

#auto-zoom-status {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* ── Header right ────────────────────────────────────── */

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── License badge ───────────────────────────────────── */

.license-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  border: 1.5px solid var(--border);
  background: var(--surface-soft);
  color: var(--muted);
}

.license-badge:hover {
  background: var(--surface);
  border-color: var(--muted);
}

.license-badge svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.badge-trial {
  border-color: #d4a843;
  background: #fef9e7;
  color: #8b6914;
}

.badge-trial:hover {
  background: #fdf3ce;
  border-color: #c49b2e;
}

.badge-active {
  border-color: #2d6a5a;
  background: #e8f5e9;
  color: #1b5e20;
}

.badge-active:hover {
  background: #c8e6c9;
  border-color: #1b5e20;
}

.badge-expired {
  border-color: #c62828;
  background: #fce4ec;
  color: #b71c1c;
}

.badge-expired:hover {
  background: #f8bbd0;
  border-color: #b71c1c;
}

/* ── License banner ──────────────────────────────────── */

.license-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.license-banner--expired {
  border-color: #ef9a9a;
  background: #fff5f5;
}

.license-banner-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text);
}

.license-banner-content svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: #c62828;
}

/* ── Modal overlay ───────────────────────────────────── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  position: relative;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  padding: 32px;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}

.modal-box h2 {
  margin: 0 0 16px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.license-info {
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 22px;
}

.license-info .expired-text {
  color: #c62828;
  font-weight: 500;
}

.license-section {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

.license-section h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
}

.promo-row {
  display: flex;
  gap: 8px;
}

.promo-row input {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.promo-row button {
  flex-shrink: 0;
}

.promo-msg {
  font-size: 13px;
  margin: 6px 0 0;
  min-height: 18px;
  color: var(--muted);
}

.promo-msg.success {
  color: #2e7d32;
  font-weight: 500;
}

.promo-msg.error {
  color: #c62828;
  font-weight: 500;
}

.btn-buy {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  padding: 10px 16px;
}

/* Disabled upload form styling */

form[data-locked="true"] {
  opacity: 0.55;
  pointer-events: none;
}

/* ── Lifecycle ────────────────────────────────────────── */

.lc-source-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.lc-tab {
  padding: 10px 20px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}

.lc-tab:hover {
  color: var(--text);
}

.lc-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.lc-project-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.project-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface);
}

.project-card:hover {
  border-color: var(--accent);
  background: rgba(45, 106, 90, 0.04);
}

.project-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-card svg {
  color: var(--muted);
  flex-shrink: 0;
}

.lc-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 24px;
  margin-top: 16px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  transition: all 0.2s;
  cursor: pointer;
}

.lc-upload-area:hover,
.lc-upload-area.drag-over {
  border-color: var(--accent);
  background: rgba(45, 106, 90, 0.04);
}

.lc-upload-area p {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.mapping-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mapping-label {
  font-size: 13px;
  font-weight: 600;
  min-width: 100px;
  color: var(--text);
}

.mapping-select {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
}

.mapping-preview {
  margin-top: 20px;
}

.mapping-preview h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
}

.preview-table-wrap {
  overflow-x: auto;
  max-height: 200px;
}

.lc-table--preview {
  font-size: 12px;
}

.lc-table--preview td,
.lc-table--preview th {
  padding: 4px 8px;
  white-space: nowrap;
}

.lc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.lc-header h2 {
  margin: 0;
}

.lc-actions {
  display: flex;
  gap: 8px;
}

.lc-stats {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.stat-total {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.stat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.stat-dot.active { background: #2e7d32; }
.stat-dot.nrnd { background: #e65100; }
.stat-dot.eol { background: #c62828; }
.stat-dot.unk { background: #9e9e9e; }

.lc-risk-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface-soft);
  margin-bottom: 16px;
}

.bar-seg { min-width: 2px; transition: width 0.3s; }
.bar-active { background: #2e7d32; }
.bar-nrnd { background: #e65100; }
.bar-eol { background: #c62828; }
.bar-unk { background: #bdbdbd; }

.lc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.lc-filters {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.lc-filter-spacer { flex: 1; }

.lc-filter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.lc-filter-label select,
.lc-filter-label input {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
}

.lc-filter-label input {
  width: 200px;
}

.lc-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 200px);
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.lc-table {
  min-width: 1600px;
  border-collapse: separate;
  border-spacing: 0;
}

.lc-table thead {
  position: sticky;
  top: 0;
  z-index: 3;
}

.lc-table th {
  background: var(--surface-soft);
  user-select: none;
}

.lc-table th,
.lc-table td {
  padding: 8px 10px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.lc-table th {
  text-align: center;
}

.lc-table td {
  text-align: left;
}

.lc-table th {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  position: relative;
  padding: 10px 10px;
  vertical-align: middle;
  height: 40px;
}

.th-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Sortable headers */
.th-sortable {
  cursor: pointer;
}
.th-sortable:hover {
  color: var(--text);
}
.sort-icon::after {
  content: '⇅';
  font-size: 10px;
  opacity: 0.3;
  margin-left: 2px;
}
.th-sortable.sort-asc .sort-icon::after {
  content: '▲';
  opacity: 0.8;
  color: var(--accent);
}
.th-sortable.sort-desc .sort-icon::after {
  content: '▼';
  opacity: 0.8;
  color: var(--accent);
}

/* Resize handle */
.col-resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  cursor: col-resize;
  z-index: 3;
}
.col-resize-handle:hover,
.col-resize-handle.active {
  background: var(--accent);
  opacity: 0.4;
}

/* Default column widths (via colgroup) */
.lc-table col.col-alts     { width: 60px; }
.lc-table col.col-ref      { width: 130px; }
.lc-table col.col-mpn      { width: 170px; }
.lc-table col.col-mfr      { width: 130px; }
.lc-table col.col-status   { width: 100px; }
.lc-table col.col-risk     { width: 80px; }
.lc-table col.col-desc     { width: 200px; }
.lc-table col.col-stock    { width: 90px; }
.lc-table col.col-trend    { width: 50px; }
.lc-table col.col-price    { width: 80px; }
.lc-table col.col-actions  { width: 70px; }
.lc-table col.col-sup-name  { width: 120px; }
.lc-table col.col-sup-sku   { width: 100px; }
.lc-table col.col-sup-price { width: 80px; }

.th-sup-group {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--muted);
  border-left: 2px solid var(--border);
  background: var(--surface-soft);
}

.lc-sub-header th {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--muted);
  padding: 4px 8px;
  background: var(--surface-soft);
  border-bottom: 2px solid var(--border);
}

.lc-table td.ref-cell,
.lc-table td.desc-cell {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lc-table td.desc-cell {
  max-width: 200px;
}

.sup-cell {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.sup-price { text-align: right; }

.mpn-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
  transition: border-color 0.15s;
}
.mpn-link:hover {
  border-bottom-style: solid;
}

.clickable { cursor: pointer; }
.stat-item.clickable:hover { opacity: 0.8; }
.bar-seg.clickable:hover { opacity: 0.85; }
.filter-active { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.bar-seg.filter-active { outline-offset: -1px; }

/* BOM Price summary (compact, inline with filters) */
.lc-bom-price {
  flex-shrink: 0;
}

.bom-price-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.bom-price-unit, .bom-price-qty, .bom-price-total {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.bom-price-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.bom-price-value {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  white-space: nowrap;
}

.bom-price-value--big {
  font-size: 16px;
  color: var(--accent);
}

.bom-price-note {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.bom-price-sep {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.bom-qty-input {
  width: 64px;
  padding: 4px 6px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  background: var(--bg);
  color: var(--text);
}

.trend-cell { text-align: center; }
.trend-up   { color: #16a34a; font-size: 0.85em; }
.trend-down { color: #dc2626; font-size: 0.85em; }
.trend-stable { color: #6b7280; font-size: 0.65em; }
.trend-na   { color: #d1d5db; }

.lc-table td.stock-cell { text-align: right; }
.lc-table td.price-cell { text-align: right; }
.lc-table td.td-detail  { text-align: center; overflow: visible; }
.lc-table td.td-alts,
.lc-table th.th-alts     { text-align: center; overflow: visible; }

/* Alts expand/collapse toggle */
.alts-row-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
  cursor: pointer;
  font-size: 11px;
  color: var(--muted);
  transition: all 0.15s;
}
.alts-toggle-all {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 4px;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
}
.alts-row-toggle:hover,
.alts-toggle-all:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.alts-row-toggle .alts-chevron,
.alts-toggle-all .alts-chevron {
  transition: transform 0.2s;
}
.alts-row-toggle.open .alts-chevron,
.alts-toggle-all.open .alts-chevron {
  transform: rotate(180deg);
}
.alts-count {
  font-weight: 600;
  font-size: 10px;
  min-width: 12px;
}
.alts-none {
  color: var(--border);
  font-size: 11px;
}

/* Alternative sub-rows */
.alt-row {
  background: #f8f9fb !important;
}
.alt-row td {
  border-bottom: 1px solid #eef0f3;
  font-size: 12px;
}
.alt-indent {
  color: var(--muted);
  font-size: 13px;
}
.alt-mpn-cell {
  opacity: 0.85;
}
.row-btn-link {
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.row-btn-link:hover { text-decoration: underline; }

.mpn-cell {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
}

.desc-cell {
  font-size: 12px;
  color: var(--muted);
}

.stock-cell {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.price-cell {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 500;
}

.risk-score {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}
.risk-score.rs-critical { background: #fee; color: #b91c1c; }
.risk-score.rs-high     { background: #fff3cd; color: #92400e; }
.risk-score.rs-medium   { background: #e0e7ff; color: #3730a3; }
.risk-score.rs-low      { background: #d1fae5; color: #065f46; }

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.status-low { background: #e8f5e9; color: #1b5e20; }
.status-high { background: #fff3e0; color: #e65100; }
.status-critical { background: #fce4ec; color: #b71c1c; }
.status-medium { background: #f5f5f5; color: #616161; }

.risk-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.risk-low { color: #2e7d32; }
.risk-high { color: #e65100; }
.risk-critical { color: #c62828; }
.risk-medium { color: #757575; }

tr.risk-critical { background: #fff8f8; }
tr.risk-high { background: #fffbf5; }

.detail-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--surface-soft);
  border-radius: 6px;
  font-size: 13px;
}

.spec-name {
  color: var(--muted);
  font-weight: 500;
}

.spec-val {
  color: var(--text);
  font-weight: 600;
}

/* Detail modal supply table */
.detail-supply-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}
.detail-supply-table th,
.detail-supply-table td {
  padding: 6px 10px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.detail-supply-table th {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
}

/* Alternatives cards */
.alts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin: 12px 0 20px;
}

.alt-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  transition: box-shadow 0.15s;
}
.alt-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

.alt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.alt-mpn {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.alt-card-mfr {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.alt-card-desc {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}

.alt-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.alt-stock {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.alt-price {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.alt-ds-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}
.alt-ds-link:hover {
  text-decoration: underline;
}

.modal-box--wide {
  width: min(780px, calc(100vw - 32px));
}

.lc-loading {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
}

.lc-progress-wrap {
  width: min(420px, calc(100vw - 48px));
  text-align: center;
}

.lc-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

#lc-progress-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent);
}

.lc-progress-track {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.lc-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.lc-progress-detail {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
  min-height: 18px;
}

/* ── Lifecycle History ────────────────────────────────── */

.lc-history {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.lc-history-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin: 0 0 10px;
}

.hist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface);
}

.hist-row:hover {
  border-color: var(--accent);
  background: rgba(45, 106, 90, 0.03);
}

.hist-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hist-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hist-meta {
  font-size: 12px;
  color: var(--muted);
}

.hist-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.hist-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.hist-badge--ok {
  background: #d1fae5;
  color: #065f46;
}

.hist-badge--warn {
  background: #fee2e2;
  color: #991b1b;
}

.hist-del {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.1s;
}

.hist-row:hover .hist-del {
  opacity: 1;
}

.hist-del:hover {
  background: #fbe9e7;
  color: #c62828;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Update Banner ───────────────────────────────────── */

.update-banner {
  background: linear-gradient(135deg, #1e3a5f 0%, #1a2744 100%);
  border-bottom: 1px solid rgba(59, 130, 246, 0.3);
}

.update-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #93c5fd;
}

.update-banner-inner svg { flex-shrink: 0; color: #60a5fa; }

.update-banner-btn {
  margin-left: auto;
  padding: 5px 16px;
  background: #3b82f6;
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  transition: background 0.2s;
}

.update-banner-btn:hover { background: #2563eb; }

.update-banner-close {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.update-banner-close:hover { color: #9ca3af; }

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 980px) {
  .page {
    width: calc(100vw - 16px);
    margin: 12px auto;
  }

  .site-header {
    padding: 14px 12px;
  }

  .header-left {
    gap: 12px;
  }

  .brand {
    font-size: 17px;
  }

  .nav-tab {
    padding: 5px 10px;
    font-size: 12px;
  }

  .card {
    padding: 16px;
  }

  .card.compact {
    flex-direction: column;
    align-items: flex-start;
  }

  .meta h1 {
    font-size: 20px;
    line-height: 28px;
  }

  .viewer-card {
    height: 72vh;
    min-height: 360px;
  }

  .license-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .lc-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .lc-stats {
    gap: 12px;
  }

  .lc-table-wrap {
    max-height: 60vh;
  }

  .lc-table col.col-desc { width: 120px; }
  .lc-table col.col-mfr  { width: 100px; }
}

/* ── Feedback FAB ─────────────────────── */

.feedback-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent, #2d6a5a);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 900;
}

.feedback-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

/* ── Feedback form ────────────────────── */

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feedback-form .field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
  margin-top: 4px;
}

.feedback-form select,
.feedback-form input,
.feedback-form textarea {
  padding: 8px 10px;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-card, #fff);
  color: var(--text-primary, #1a1d1f);
  resize: vertical;
}

.feedback-form select:focus,
.feedback-form input:focus,
.feedback-form textarea:focus {
  outline: none;
  border-color: var(--accent, #2d6a5a);
  box-shadow: 0 0 0 2px rgba(45, 106, 90, 0.12);
}

@media (max-width: 640px) {
  .header-left {
    gap: 8px;
  }

  .brand {
    font-size: 15px;
  }

  .main-nav {
    gap: 1px;
  }

  .nav-tab {
    padding: 4px 8px;
    font-size: 11px;
  }

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

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

  .lc-filter-label input {
    width: 100%;
  }

  .lc-upload-area {
    padding: 32px 16px;
  }

  .feedback-fab {
    bottom: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
  }

  .home-hero {
    padding: 40px 16px;
  }

  .home-cards {
    flex-direction: column;
    max-width: 100%;
  }

  .home-card {
    min-height: auto;
    padding: 28px 24px;
  }
}

/* ── Home Page ──────────────────────────────────────────── */

.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 62px);
  padding: 60px 24px;
  text-align: center;
}

.home-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.8px;
  margin: 0 0 8px;
  color: var(--text);
}

.home-subtitle {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 48px;
  max-width: 420px;
  line-height: 1.5;
}

.home-cards {
  display: flex;
  gap: 24px;
  max-width: 720px;
  width: 100%;
}

.home-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 32px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  min-height: 260px;
}

.home-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(45, 106, 90, 0.1);
  transform: translateY(-2px);
}

.home-card-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.home-card-icon--health {
  background: rgba(45, 106, 90, 0.1);
  color: var(--accent);
}

.home-card-icon--assembly {
  background: rgba(59, 91, 136, 0.1);
  color: #3b5b88;
}

.home-card-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.3px;
}

.home-card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 auto;
  padding-bottom: 16px;
}

.home-card-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.1px;
}

.home-card--disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
  position: relative;
}

.home-card--disabled:hover {
  border-color: var(--border);
  box-shadow: none;
  transform: none;
}

.home-card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--muted);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.nav-tab--disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.nav-badge-soon {
  font-size: 9px;
  font-weight: 700;
  background: var(--muted);
  color: #fff;
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: 4px;
  vertical-align: 1px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ── Auth Pages ───────────────────────────────────────────── */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 62px);
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 32px;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 4px;
  text-align: center;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 28px;
  text-align: center;
}

.auth-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.auth-label span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.auth-label input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s;
}

.auth-label input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 106, 90, 0.1);
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: background 0.15s, border-color 0.15s;
}

.auth-btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.auth-btn--primary:hover {
  background: #245a4c;
}

.auth-btn--primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-btn--google {
  background: var(--surface);
  color: var(--text);
}

.auth-btn--google:hover {
  background: var(--surface-soft);
  border-color: var(--muted);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 12px;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-footer {
  text-align: center;
  margin: 24px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ── User menu in header ──────────────────────────────────── */

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s;
}

.user-menu:hover {
  border-color: var(--accent);
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 200px;
  z-index: 100;
  padding: 12px 0;
}

.user-dropdown-header {
  padding: 4px 16px 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.user-dropdown-plan {
  padding: 2px 16px 8px;
  font-size: 12px;
  color: var(--muted);
}

.user-dropdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.user-dropdown-item {
  display: block;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.1s;
}

.user-dropdown-item:hover {
  background: var(--surface-soft);
}

#user-area {
  position: relative;
}

/* ── Pricing Modal ────────────────────────────────────────── */

.pricing-cards {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.pricing-cards--three {
  gap: 16px;
}

.pricing-save {
  display: inline-block;
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.pricing-card--featured {
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(45, 106, 90, 0.18);
}

.pricing-card {
  flex: 1;
  max-width: 260px;
  padding: 28px 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
  position: relative;
}

.pricing-card--pro {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(45, 106, 90, 0.12);
}

.pricing-popular {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 14px;
  border-radius: 20px;
}

.pricing-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
}

.pricing-price {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  margin: 0 0 16px;
  color: var(--text);
}

.pricing-price span {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  text-align: left;
}

.pricing-features li {
  font-size: 13px;
  color: var(--text);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.pricing-features li::before {
  content: '✓ ';
  color: var(--accent);
  font-weight: 700;
}

.pricing-current {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  padding: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.user-dropdown-upgrade {
  color: var(--accent);
  font-weight: 600;
}

.user-dropdown-analyses {
  font-size: 11px;
  color: var(--muted);
}
