:root {
  color-scheme: light;
  --bg-1: #f0f4ff;
  --bg-2: #eaf2ff;
  --bg-3: #f7fbff;
  --text: #0f172a;
  --text-main: #111827;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #6366f1;
  --primary-2: #818cf8;
  --danger: #dc2626;
  --warning: #92400e;
  --radius: 18px;
  --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.08);
  --font-sans: "SF Pro Text", "SF Pro Display", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2) 55%, var(--bg-3));
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(680px 520px at 8% -8%, rgba(99, 102, 241, 0.16), rgba(99, 102, 241, 0)),
    radial-gradient(740px 560px at 96% 26%, rgba(52, 211, 153, 0.14), rgba(52, 211, 153, 0)),
    radial-gradient(640px 480px at 52% 112%, rgba(251, 191, 36, 0.10), rgba(251, 191, 36, 0));
}

#bgParticleCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.78;
  will-change: transform;
  contain: strict;
  transform: translateZ(0);
  pointer-events: none;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 20px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  font-size: 14px;
  z-index: 2000;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.18);
}

.validation-notice {
  width: min(620px, calc(100vw - 32px));
  min-height: 112px;
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 24px 28px;
  border-radius: 22px;
  border: 1px solid rgba(251, 146, 60, 0.24);
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.98), rgba(255, 247, 237, 0.98));
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

.validation-notice-title {
  text-align: left;
  color: #7c2d12;
  font-size: 24px;
  line-height: 1.05;
  font-weight: 800;
}

.validation-notice-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  width: 100%;
}

.validation-notice-list li {
  position: relative;
  padding-left: 18px;
  color: #9a3412;
  font-size: 15px;
  line-height: 1.48;
  font-weight: 600;
}

.validation-notice-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ea580c;
}

.validation-notice-actions {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.login-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1200;
}

.login-card {
  position: relative;
  z-index: 2;
  width: min(460px, 92vw);
  padding: 36px 34px 30px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(8px);
  transform: translateZ(0);
}

.login-card::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  pointer-events: none;
}

.login-title {
  font-size: 21px;
  font-weight: 700;
  margin: 6px 0 4px;
  letter-spacing: 0.03em;
  color: #0b1220;
}

.login-subtitle {
  font-size: 12.5px;
  color: #6b7280;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.login-input,
.textarea,
.table-select,
.table-input,
.table-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #f9fbff;
  font-size: 14px;
  color: var(--text-main);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.login-input {
  margin-bottom: 12px;
}

.masked-code-input {
  -webkit-text-security: disc;
  text-security: disc;
  letter-spacing: -0.08em;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0;
}

.masked-code-input::placeholder {
  letter-spacing: 0;
  font-family: var(--font-sans);
}

.textarea {
  resize: vertical;
  line-height: 1.6;
  min-height: 120px;
}

.login-input:focus,
.textarea:focus,
.table-select:focus,
.table-input:focus,
.table-textarea:focus {
  outline: none;
  border-color: #1b6cff;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(27, 108, 255, 0.15);
}

.framework-attention {
  border-color: #dc2626 !important;
  background: #fff5f5 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18) !important;
}

.login-actions,
.tab1-actions,
.tab1-table-actions,
.tab1-footer-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.login-actions {
  margin-top: 2px;
}

#loginBtn {
  width: 100%;
  justify-content: center;
  padding: 12px 16px;
  font-weight: 600;
  border-radius: 14px;
  letter-spacing: 0.02em;
}

.login-error {
  margin-top: 10px;
  min-height: 16px;
  color: var(--danger);
  font-size: 12px;
}

.divider {
  margin: 12px 0;
  height: 1px;
  background: rgba(148, 163, 184, 0.26);
}

.field-row,
.field {
  display: grid;
  gap: 6px;
}

.field-row label:not(.toggle-row),
.field label:not(.toggle-row) {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}

.admin-quick-meta-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 10px;
}

.inline-input {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-input .login-input {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.small-hint {
  font-size: 13px;
  line-height: 1.55;
}

.admin-quick-panel {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.admin-quick-actions {
  margin-top: 2px;
}

.admin-quick-actions .btn {
  flex: 1 1 0;
  min-width: 0;
}

@media (max-width: 640px) {
  .admin-quick-meta-row {
    grid-template-columns: 1fr;
  }
}

#login-screen .admin-quick-actions .btn.action-btn {
  justify-content: center;
}

.admin-import-modal {
  width: min(520px, calc(100vw - 32px));
}

.error-text {
  color: var(--danger);
}

.success-text {
  color: #15803d;
}

.muted {
  color: #64748b;
}

.app {
  position: relative;
  z-index: 2;
}

.content {
  width: min(1560px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 16px 0 36px;
}

.topbar {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.86);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 255, 0.92));
  box-shadow: var(--shadow-soft);
}

.title {
  font-size: 26px;
  line-height: 1.15;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.01em;
}

.breadcrumb {
  margin-top: 6px;
  font-size: 15px;
  color: #64748b;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.84);
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.user-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.16);
}

.step-nav {
  margin: 16px 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.step-item {
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.72);
  color: #64748b;
  border-radius: 999px;
  min-height: 40px;
  padding: 7px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.step-item:hover,
.step-item:focus,
.step-item.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.28);
}

.step-item:focus {
  outline: none;
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: inherit;
  background: rgba(241, 245, 249, 0.9);
}

.step-item:hover .step-num,
.step-item.active .step-num {
  background: rgba(255, 255, 255, 0.26);
}

.stage {
  margin-top: 18px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.stage > .panel-header {
  margin: 0;
}

.panel-header {
  margin: 0 2px 14px;
}

.panel-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

.meta {
  margin-top: 6px;
  font-size: 14px;
  color: #64748b;
  line-height: 1.55;
}

.card {
  border: 1px solid rgba(226, 232, 240, 0.84);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.92));
  box-shadow: var(--shadow-soft);
}

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

.card-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
  color: #0f172a;
  font-weight: 700;
}

.btn {
  border: 1px solid transparent;
  background: #e5e7eb;
  color: #0f172a;
  border-radius: 12px;
  padding: 8px 12px;
  min-height: 36px;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease, color 0.14s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-sm {
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
  padding: 6px 12px;
  min-height: 32px;
}

.btn-lg {
  border-radius: 12px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  min-height: 40px;
}

.btn-outline {
  border-color: rgba(226, 232, 240, 0.92);
  background: #ffffff;
  color: #64748b;
}

.btn-outline:hover {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 16px 32px rgba(99, 102, 241, 0.34);
}

.btn-link {
  border: 0;
  background: transparent;
  color: #4338ca;
  padding: 0;
  min-height: 0;
  border-radius: 0;
  font-weight: 600;
}

.btn-link:hover {
  transform: none;
  color: #312e81;
  text-decoration: underline;
}

.tab1-layout,
.tab2-layout,
.tab3-layout {
  display: grid;
  gap: 16px;
}

.tab1-brief-card .card-head {
  margin-bottom: 18px;
}

.tab1-target-grid {
  display: grid;
  gap: 18px;
  padding: 2px 0;
}

.tab1-target-grid .field {
  gap: 8px;
}

.tab1-target-grid .field-label {
  letter-spacing: 0;
  text-transform: none;
}

.tab1-brief-input {
  min-height: 196px;
}

.tab1-actions {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.tab1-actions-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
}

.summary-pills {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.08);
  color: #4338ca;
  font-size: 13px;
  font-weight: 700;
}

.summary-pill-status-empty {
  background: rgba(234, 88, 12, 0.12);
  color: #c2410c;
}

.summary-pill-status-ready {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.status-box {
  margin-top: 10px;
  border-radius: 14px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  background: rgba(238, 242, 255, 0.92);
  color: #312e81;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.55;
}

#tab1StatusBox {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #6b7280;
  padding: 0;
  flex: 1 1 280px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#tab1StatusBox:not(.hidden) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tab1-status-text {
  flex: 0 1 auto;
}

.tab1-status-complete-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

.status-box-warning {
  border-color: rgba(146, 64, 14, 0.18);
  background: #fff7ed;
  color: var(--warning);
}

.empty-state {
  border: 1px dashed rgba(203, 213, 225, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  padding: 20px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.framework-table-shell {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.keyword-preview {
  margin: 12px 0 0;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: #0f172a;
  color: #dbeafe;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.framework-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.framework-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.framework-col-controls {
  width: 16.5%;
}

.framework-col-topic {
  width: 15%;
}

.framework-col-question {
  width: 18.5%;
}

.framework-col-bullish,
.framework-col-bearish {
  width: 25%;
}

.framework-table th,
.framework-table td {
  border-bottom: 1px solid rgba(226, 232, 240, 0.88);
  padding: 10px;
  vertical-align: top;
}

.framework-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(248, 250, 252, 0.96);
  color: #475569;
  text-align: left;
  font-size: 13px;
  letter-spacing: 0;
  line-height: 1.35;
}

.framework-table td:nth-child(1) {
  padding-left: 8px;
  padding-right: 8px;
}

.framework-table th:nth-child(1) {
  padding-left: 8px;
  padding-right: 8px;
}

.framework-table tr:last-child td {
  border-bottom: 0;
}

.table-textarea {
  resize: vertical;
  min-height: 126px;
  height: 126px;
  line-height: 1.55;
}

.table-input:disabled,
.table-textarea:disabled,
.table-select:disabled {
  background: rgba(248, 250, 252, 0.82);
  color: #475569;
}

.framework-control-cell {
  padding-top: 8px;
  padding-bottom: 8px;
}

.framework-control-shell {
  --framework-control-gap: 8px;
  --framework-editor-height: 126px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--framework-control-gap);
  min-height: var(--framework-editor-height);
  height: var(--framework-editor-height);
}

.framework-control-top {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: var(--framework-control-gap);
  min-height: 0;
}

.framework-control-select,
.framework-control-input,
.table-inline-delete {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.framework-control-select,
.framework-control-input {
  border-radius: 16px;
}

.table-inline-delete {
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
}

.table-inline-delete:not(:disabled):hover {
  border-color: #a5b4fc;
  background: #e0e7ff;
  color: #3730a3;
  box-shadow: 0 10px 22px rgba(99, 102, 241, 0.12);
}

.tab1-bottom-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tab1-footer-actions {
  margin-left: auto;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.placeholder-card {
  min-height: 220px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.input {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.86);
  padding: 10px 14px;
  color: #0f172a;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus {
  -webkit-text-fill-color: #0f172a;
  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 0 1000px rgba(255, 255, 255, 0.86) inset;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 0 1000px rgba(255, 255, 255, 0.86) inset;
  transition: background-color 9999s ease-out 0s;
}

.tab2-card {
  display: grid;
  gap: 16px;
}

.tab2-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mode-card {
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(248, 250, 252, 0.92);
  border-radius: 18px;
  padding: 16px;
  text-align: left;
  display: grid;
  gap: 8px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.mode-card:hover,
.mode-card.active {
  transform: translateY(-1px);
  border-color: rgba(14, 116, 144, 0.42);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.mode-card-title {
  font-weight: 700;
  color: #0f172a;
}

.mode-card-meta {
  font-size: 13px;
  color: #475569;
  line-height: 1.45;
}

.advanced-panel {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(248, 250, 252, 0.84);
}

.advanced-panel-title {
  font-weight: 600;
  color: #0f172a;
}

.advanced-panel summary {
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
}

.tab2-advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.tab2-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 14px;
}

.tab2-advanced-grid .field label,
.tab2-info-grid .field label {
  letter-spacing: 0;
  text-transform: none;
}

.tab2-query-textarea {
  min-height: 64px;
}

.tab2-section-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.tab2-product-category-head {
  justify-content: space-between;
  align-items: center;
}

.tab2-alias-toggle {
  justify-content: flex-end;
  font-size: 13px;
  color: #475569;
}

.tab2-alias-toggle input {
  margin: 0;
}

.tab2-section-head .advanced-panel-title {
  margin: 0;
  flex: 0 0 auto;
}

.tab2-keyword-pack-row {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
  align-items: center;
  min-width: 0;
}

.tab2-search-result-count-control {
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}

.tab2-search-result-count-select {
  width: 86px;
  min-width: 86px;
  padding: 8px 12px;
  border-radius: 12px;
}

.tab2-primary-actions,
.tab2-footer-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: center;
}

.tab2-inline-status {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab2-inline-status-success {
  color: #15803d;
}

.tab2-inline-status-error {
  color: #b91c1c;
}

.tab2-import-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.import-tile {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.84);
  padding: 16px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.import-tile-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.tab2-url-textarea {
  min-height: 64px;
}

.tab2-url-import-modal {
  width: min(760px, calc(100vw - 40px));
  display: grid;
  gap: 14px;
  padding: 22px 24px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

.tab2-url-modal-textarea {
  min-height: 220px;
}

.tab2-url-import-actions {
  display: flex;
  justify-content: flex-end;
}

.tab2-progress-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.progress-stat {
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 14px;
  display: grid;
  gap: 8px;
}

.progress-stat span {
  font-size: 12px;
  color: #64748b;
}

.progress-stat strong {
  font-size: 18px;
  color: #0f172a;
}

.tab2-library-controls {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #334155;
  font-size: 14px;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
  transition: background-color 120ms ease;
}

.switch-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.24);
  transition: transform 120ms ease;
}

.switch input:checked + .switch-slider {
  background: #2563eb;
}

.switch input:checked + .switch-slider::after {
  transform: translateX(16px);
}

.switch input:focus-visible + .switch-slider {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

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

.evidence-card {
  border: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0;
  background: transparent;
  padding: 6px 0;
  display: grid;
  gap: 6px;
}

.evidence-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.evidence-head-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.evidence-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.evidence-title {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  color: #0b57d0;
  text-decoration: underline;
  word-break: break-all;
  text-align: left;
  cursor: pointer;
}

.evidence-source-pill {
  flex: 0 0 auto;
}

.evidence-title:hover {
  text-decoration: underline;
}

.evidence-delete-btn {
  border: 0;
  background: transparent;
  color: #991b1b;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.2;
  text-decoration: underline;
}

#tab2LibrarySummary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.tab2-library-summary:empty {
  display: none;
}

.tab2-source-pill-auto {
  background: rgba(191, 219, 254, 0.88);
  color: #1d4ed8;
}

.tab2-source-pill-reports {
  background: rgba(220, 252, 231, 0.88);
  color: #166534;
}

.tab2-source-pill-urls {
  background: rgba(254, 240, 138, 0.92);
  color: #854d0e;
}

.tab2-source-pill-offline {
  background: rgba(233, 213, 255, 0.9);
  color: #7e22ce;
}

.evidence-text-modal {
  width: min(920px, calc(100vw - 40px));
  max-height: min(82vh, 860px);
  display: grid;
  gap: 14px;
  padding: 22px 24px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

.evidence-text-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.evidence-text-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}

.evidence-text-modal-body {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.16);
  white-space: pre-wrap;
  word-break: break-word;
  font: 13px/1.6 Georgia, "Times New Roman", serif;
  color: #334155;
  max-height: min(64vh, 680px);
  overflow: auto;
}

.tab3-product-evidence-modal {
  width: min(1120px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: min(78vh, 760px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.tab3-product-evidence-modal-head-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.tab3-product-evidence-modal-body {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.tab3-product-evidence-summary-card {
  display: grid;
}

.tab3-product-evidence-summary-card-inner {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: rgba(248, 250, 252, 0.96);
}

.tab3-product-evidence-summary-label {
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  justify-self: start;
  text-align: left;
  padding: 0;
}

.tab3-product-evidence-summary-body {
  font-size: 13px;
  line-height: 1.65;
  color: #0f172a;
  white-space: pre-wrap;
  word-break: break-word;
}

.tab3-product-evidence-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab3-product-evidence-summary-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.92);
  font-size: 12px;
  line-height: 1.4;
}

.tab3-product-evidence-summary-meta-label {
  color: #64748b;
  font-weight: 600;
}

.tab3-product-evidence-summary-meta-value {
  color: #0f172a;
  font-weight: 700;
}

.tab3-product-evidence-section {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.tab3-product-evidence-section-label {
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  justify-self: start;
  text-align: left;
  padding: 0 14px;
}

.tab3-product-evidence-modal-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  align-content: start;
  padding-right: 2px;
}

.tab3-product-evidence-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(191, 219, 254, 0.9);
  background: rgba(239, 246, 255, 0.7);
}

.tab3-product-evidence-group-label,
.tab3-product-evidence-ungrouped-label {
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
  color: #475569;
}

.tab3-product-evidence-group-list {
  display: grid;
  gap: 10px;
}

.tab3-product-evidence-ungrouped-label {
  padding: 2px 2px 0;
}

.tab3-product-evidence-item {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: rgba(248, 250, 252, 0.96);
}

.tab3-product-evidence-item-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tab3-product-evidence-item-link-row .tab3-inline-link-btn {
  font-size: 13px;
  line-height: 1.45;
}

.tab3-product-evidence-item-source-text {
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
  color: #0f172a;
}

.tab3-product-evidence-item-preview {
  min-width: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab3-product-evidence-item-details {
  display: grid;
  gap: 10px;
}

.tab3-product-evidence-item-toggle {
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.tab3-product-evidence-item-toggle::-webkit-details-marker {
  display: none;
}

.tab3-product-evidence-item-toggle::marker {
  content: "";
}

.tab3-product-evidence-item-body {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(226, 232, 240, 0.92);
  font-size: 13px;
  line-height: 1.6;
  color: #0f172a;
  white-space: pre-wrap;
  word-break: break-word;
}

.collect-more-panel {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.86);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.collect-more-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.collect-more-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.78);
  color: #334155;
  cursor: pointer;
}

.tab2-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.tab2-pagination-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.tab2-page-size {
  min-width: 120px;
}

.evidence-meta,
.evidence-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.evidence-pill {
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(226, 232, 240, 0.8);
  color: #334155;
  font-size: 12px;
}

.evidence-pill.source-auto {
  background: rgba(186, 230, 253, 0.8);
  color: #075985;
}

.evidence-pill.source-imported {
  background: rgba(220, 252, 231, 0.82);
  color: #166534;
}

.evidence-snippet {
  color: #334155;
  line-height: 1.6;
  white-space: pre-wrap;
}

.evidence-dimensions {
  display: grid;
  gap: 8px;
}

.evidence-dimension-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: #475569;
}

.tab3-layout {
  display: grid;
  gap: 18px;
}

.tab3-layout-primary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tab3-card {
  display: grid;
  gap: 16px;
}

#tab3SourceAnalysisShell {
  gap: 8px;
}

.tab3-card-primary {
  position: relative;
  height: 120px;
  padding-bottom: 6px;
  align-content: start;
  overflow: hidden;
}

.tab3-card-primary-action,
.tab3-card-primary-progress {
  height: 120px;
}

.tab3-card-primary .card-head {
  display: block;
  margin-bottom: 4px;
}

.tab3-inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tab3-card-primary-action .tab3-inline-actions {
  min-height: 0;
}

.tab3-inline-actions .btn {
  min-height: 34px;
}

.tab3-inline-display {
  min-height: 100%;
  display: grid;
  align-content: center;
  gap: 10px;
}

.tab3-inline-progress {
  position: absolute;
  top: 18px;
  right: 18px;
  left: auto;
  display: block;
  min-width: 0;
  margin-top: 0;
  padding: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 2;
}

.tab3-inline-progress.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.tab3-inline-progress-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 6px;
}

.tab3-inline-progress-track {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.96);
  overflow: hidden;
}

.tab3-inline-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.92) 0%, rgba(96, 165, 250, 0.92) 100%);
  transition: width 180ms ease;
}

.tab3-inline-progress-duration {
  width: 34px;
  min-width: 34px;
  text-align: left;
  color: #64748b;
  font-size: 11px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  padding-bottom: 2px;
}

.tab3-inline-progress-note {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 3px);
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.3;
  min-height: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab3-config-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: end;
}

.tab3-radio-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mode-card.compact {
  min-height: 92px;
  align-content: start;
}

.mode-card.compact input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tab3-toggle {
  min-height: 42px;
}

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

.tab3-progress-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.tab3-scorecard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tab3-scorecard-card {
  border-radius: 18px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.9);
  display: grid;
  gap: 10px;
}

.tab3-scorecard-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.tab3-scorecard-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 24px;
  font-weight: 800;
}

.tab3-scorecard-meta {
  font-size: 13px;
  color: #475569;
}

.score-up {
  color: #15803d;
}

.score-down {
  color: #b91c1c;
}

.tone-empty {
  background: rgba(248, 250, 252, 0.88);
}

.tone-positive {
  background: linear-gradient(180deg, rgba(220, 252, 231, 0.86), rgba(255, 255, 255, 0.96));
}

.tone-negative {
  background: linear-gradient(180deg, rgba(254, 226, 226, 0.88), rgba(255, 255, 255, 0.96));
}

.tone-contested {
  background: linear-gradient(180deg, rgba(254, 249, 195, 0.92), rgba(255, 255, 255, 0.96));
}

.tab3-matrix-shell {
  display: grid;
  gap: 14px;
}

.tab3-layout-secondary {
  grid-template-columns: 1fr;
  margin-top: 0;
}

.tab3-analysis-card {
  align-content: start;
  min-height: 0;
}

.tab3-view-toggle-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 18px;
  margin-top: 10px;
  margin-bottom: 10px;
}

.tab3-view-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.tab3-view-toggle-btn:first-child {
  justify-self: end;
}

.tab3-view-toggle-btn:last-child {
  justify-self: start;
}

.tab3-view-toggle-btn.active {
  border-color: rgba(99, 102, 241, 0.28);
  background: rgba(238, 242, 255, 0.96);
  color: #4338ca;
}

.tab3-view-toggle-btn:hover {
  transform: translateY(-1px);
}

.tab3-matrix-table-wrap {
  overflow-x: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
}

.tab3-matrix-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.tab3-matrix-table th,
.tab3-matrix-table td {
  border-right: 1px solid rgba(226, 232, 240, 0.92);
  border-bottom: 1px solid rgba(226, 232, 240, 0.92);
  vertical-align: top;
}

.tab3-matrix-table th:last-child,
.tab3-matrix-table td:last-child {
  border-right: 0;
}

.tab3-matrix-table tbody tr:last-child th,
.tab3-matrix-table tbody tr:last-child td {
  border-bottom: 0;
}

.tab3-matrix-product-head,
.tab3-matrix-product-column-head,
.tab3-matrix-subdimension-row-head {
  padding: 9px 12px;
  background: rgba(248, 250, 252, 0.96);
  vertical-align: middle;
}

.tab3-matrix-product-head {
  width: 190px;
  min-width: 190px;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #334155;
  position: sticky;
  left: 0;
  z-index: 3;
}

.tab3-matrix-product-column-head {
  width: 126px;
  min-width: 126px;
  min-height: 52px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  color: #0f172a;
  word-break: break-word;
}

.tab3-matrix-lead-head,
.tab3-product-head-stack,
.tab3-subdimension-head-stack {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tab3-matrix-lead-head {
  min-height: 42px;
}

.tab3-product-head-stack {
  min-height: 42px;
  align-items: center;
  text-align: center;
}

.tab3-subdimension-head-stack {
  width: 100%;
  height: 42px;
  min-height: 42px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
}

.tab3-product-head-primary {
  line-height: 1.2;
}

.tab3-product-head-secondary {
  margin-top: 4px;
  line-height: 1.1;
}

.tab3-matrix-subdimension-row-head {
  width: 190px;
  min-width: 190px;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 0 10px;
  text-align: left;
  vertical-align: middle;
  position: sticky;
  left: 0;
  z-index: 2;
}

.tab3-matrix-head-combined {
  width: 100%;
  font-size: 12px;
  line-height: 1.24;
  color: #0f172a;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  padding: 1px 0 2px;
}

.tab3-matrix-head-combined-id {
  font-weight: 800;
  color: #0f172a;
}

.tab3-matrix-head-combined-sep,
.tab3-matrix-head-combined-topic {
  font-weight: 500;
  color: #0f172a;
}

.tab3-matrix-head-id {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6366f1;
  line-height: 1.1;
}

.tab3-matrix-head-topic {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 700;
  color: #0f172a;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab3-source-cell {
  width: 104px;
  min-width: 104px;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.98);
  vertical-align: middle;
}

.tab3-source-count-stack {
  position: relative;
  min-height: 28px;
  width: 100%;
}

.tab3-source-count-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: opacity 120ms ease, transform 120ms ease;
  box-shadow: none;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.tab3-source-count-btn:hover,
.tab3-source-count-btn:focus-visible {
  transform: translate(-50%, calc(-50% - 1px));
}

.tab3-source-count-btn.bullish {
  left: 25%;
  color: #16a34a;
}

.tab3-source-count-btn.bearish {
  left: 75%;
  color: #dc2626;
}

.tab3-source-cell-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  width: 100%;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.9);
  font-size: 14px;
  font-weight: 700;
  color: #94a3b8;
}

.tab3-product-cell,
.tab3-product-cell-empty {
  width: 104px;
  min-width: 104px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.98);
  vertical-align: top;
}

.tab3-product-matrix-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
  align-items: center;
  max-width: 760px;
}

.tab3-product-matrix-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
  white-space: nowrap;
}

.tab3-product-matrix-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: #ffffff;
  flex: 0 0 auto;
}

.tab3-product-cell-empty {
  height: 42px;
  min-height: 42px;
  max-height: 42px;
}

.tab3-source-product-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.tab3-source-product-tab {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #475569;
  padding: 6px 11px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.tab3-source-product-tab:hover,
.tab3-source-product-tab:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, 0.28);
}

.tab3-source-product-tab.active {
  border-color: rgba(59, 130, 246, 0.68);
  background: rgba(239, 246, 255, 0.96);
  color: #2563eb;
}

.tab3-source-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-top: 4px;
}

.tab3-source-column {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: rgba(249, 250, 251, 0.96);
}

.tab3-source-column-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  color: #334155;
}

.tab3-source-column-list {
  display: grid;
  gap: 8px;
}

.tab3-source-evidence-shell {
  position: fixed;
  z-index: 1600;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  width: min(1120px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: min(78vh, 760px);
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  transform: translate(-50%, -50%);
}

.tab3-source-evidence-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tab3-source-evidence-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  color: #334155;
}

.tab3-source-evidence-close {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #64748b;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease;
}

.tab3-source-evidence-close:hover,
.tab3-source-evidence-close:focus-visible {
  border-color: rgba(99, 102, 241, 0.34);
  color: #4338ca;
  background: rgba(238, 242, 255, 0.9);
}

.tab3-source-evidence-detail {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.tab3-source-evidence-card {
  display: grid;
  gap: 10px;
}

.tab3-source-evidence-link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tab3-source-evidence-link-row .tab3-inline-link-btn {
  font-size: 13px;
  line-height: 1.45;
}

.tab3-source-segment-card {
  display: grid;
  gap: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: rgba(248, 250, 252, 0.96);
}

.tab3-source-segment-text {
  font-size: 13px;
  line-height: 1.6;
  color: #0f172a;
  white-space: pre-wrap;
}

.tab3-source-segment-highlight {
  background: rgba(251, 191, 36, 0.26);
  color: inherit;
  border-radius: 4px;
  padding: 0 2px;
}

.tab3-source-column-empty {
  font-size: 12px;
  line-height: 1.5;
  color: #94a3b8;
}

.tab3-source-summary-card {
  width: 100%;
  display: flex;
  align-items: flex-start;
  text-align: left;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.96);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.tab3-source-summary-card:hover,
.tab3-source-summary-card:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

.tab3-source-summary-card.active {
  border-color: rgba(99, 102, 241, 0.42);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
}

.tab3-source-summary-card.bullish {
  border-color: rgba(134, 239, 172, 0.9);
  background: rgba(240, 253, 244, 0.96);
}

.tab3-source-summary-card.bearish {
  border-color: rgba(252, 165, 165, 0.88);
  background: rgba(254, 242, 242, 0.96);
}

.tab3-source-summary-card.mixed {
  border-color: rgba(253, 230, 138, 0.88);
  background: rgba(255, 251, 235, 0.96);
}

.tab3-source-summary-card-text {
  font-size: 13px;
  line-height: 1.32;
  color: #0f172a;
  display: block;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.tab3-source-summary-card-prefix {
  font-weight: 800;
  color: #0f172a;
}

.tab3-source-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tab3-detail-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.96);
}

.tab3-detail-card-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
}

.tab3-detail-empty {
  font-size: 13px;
  line-height: 1.6;
  color: #64748b;
}

.tab3-summary-list,
.tab3-evidence-detail,
.tab3-product-detail {
  display: grid;
  gap: 10px;
}

.tab3-summary-item-btn {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.tab3-summary-item-btn:hover,
.tab3-summary-item-btn:focus-visible,
.tab3-summary-item-btn.active {
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, 0.32);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.tab3-summary-item-text {
  font-size: 13px;
  line-height: 1.6;
  color: #0f172a;
}

.tab3-summary-item-meta {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: #64748b;
}

.tab3-evidence-trace-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.98);
}

.tab3-evidence-trace-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  color: #0f172a;
}

.tab3-evidence-trace-section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6366f1;
}

.tab3-evidence-trace-meta {
  font-size: 12px;
  line-height: 1.6;
  color: #64748b;
}

.tab3-evidence-trace-source {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tab3-evidence-trace-quote {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid rgba(99, 102, 241, 0.38);
  background: rgba(248, 250, 252, 0.94);
  font-size: 13px;
  line-height: 1.7;
  color: #0f172a;
}

.tab3-evidence-trace-body {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.94);
  font-size: 13px;
  line-height: 1.7;
  color: #0f172a;
  white-space: pre-wrap;
}

.tab3-inline-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #4338ca;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: underline;
  cursor: pointer;
}

.tab3-product-cell-btn {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.98);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  word-break: break-word;
  transition: transform 120ms ease, background-color 120ms ease;
}

.tab3-product-cell-btn.is-empty {
  display: none;
}

.tab3-product-cell-btn:hover,
.tab3-product-cell-btn:focus-visible {
  transform: translateY(-1px);
}

.tab3-product-cell-btn:focus-visible {
  outline: none;
}

.tab3-product-cell-btn.active {
  transform: translateY(-1px);
}

.tab3-product-cell-content {
  display: block;
  width: 100%;
}

.tab3-product-cell-btn.bullish-strong {
  background: #86efac;
}

.tab3-product-cell-btn.bullish-medium {
  background: #dcfce7;
}

.tab3-product-cell-btn.bullish-weak {
  background: #f0fdf4;
}

.tab3-product-cell-btn.bearish-strong {
  background: #fecaca;
}

.tab3-product-cell-btn.bearish-medium {
  background: #fee2e2;
}

.tab3-product-cell-btn.bearish-weak {
  background: #fef2f2;
}

.tab3-product-cell-btn.neutral {
  background: #ffffff;
}

.tab3-product-cell-btn.cautious {
  background: rgba(226, 232, 240, 0.9);
  border-color: rgba(203, 213, 225, 0.42);
  color: #64748b;
  box-shadow: none;
}

.tab3-product-cell-btn .tab3-source-summary-card-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab3-product-cell-btn.cautious .tab3-source-summary-card-text {
  color: #64748b;
}

.tab3-product-cell-btn.cautious .tab3-source-summary-card-prefix {
  color: #475569;
}

.tab3-product-summary {
  font-size: 14px;
  line-height: 1.75;
  color: #0f172a;
}

.tab3-product-evidence-item-meta {
  font-size: 12px;
  line-height: 1.6;
  color: #64748b;
}

.tab3-product-evidence-summary-card-inner.bullish-strong {
  background: #dcfce7;
}

.tab3-product-evidence-summary-card-inner.bullish-medium {
  background: #f0fdf4;
}

.tab3-product-evidence-summary-card-inner.bullish-weak {
  background: #f7fee7;
}

.tab3-product-evidence-summary-card-inner.bearish-strong {
  background: #fee2e2;
}

.tab3-product-evidence-summary-card-inner.bearish-medium {
  background: #fef2f2;
}

.tab3-product-evidence-summary-card-inner.bearish-weak {
  background: #fff1f2;
}

.tab3-product-evidence-summary-card-inner.neutral {
  background: #ffffff;
}

.tab3-product-evidence-summary-card-inner.cautious,
.tab3-product-matrix-legend-swatch.cautious {
  background: rgba(226, 232, 240, 0.96);
}

.tab3-product-evidence-summary-card-inner.cautious {
  border-color: rgba(100, 116, 139, 0.44);
}

.tab3-product-evidence-summary-card-inner.cautious .tab3-product-evidence-summary-body,
.tab3-product-evidence-summary-card-inner.cautious .tab3-product-evidence-summary-meta-value {
  color: #334155;
}

.tab3-product-matrix-legend-swatch.bullish-strong {
  background: #86efac;
}

.tab3-product-matrix-legend-swatch.bullish-medium {
  background: #dcfce7;
}

.tab3-product-matrix-legend-swatch.bullish-weak {
  background: #f0fdf4;
}

.tab3-product-matrix-legend-swatch.bearish-strong {
  background: #fecaca;
}

.tab3-product-matrix-legend-swatch.bearish-medium {
  background: #fee2e2;
}

.tab3-product-matrix-legend-swatch.bearish-weak {
  background: #fef2f2;
}

.tab3-matrix-section {
  display: grid;
  gap: 10px;
}

.tab3-matrix-section-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
}

.tab3-matrix-row {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
  color: #0f172a;
}

.tab3-matrix-row:hover,
.tab3-matrix-row.active {
  transform: translateY(-1px);
  border-color: rgba(79, 70, 229, 0.35);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.08);
}

.tab3-matrix-row-head,
.tab3-matrix-row-counts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.tab3-matrix-id {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.tab3-matrix-topic {
  font-weight: 700;
  color: #0f172a;
}

.tab3-matrix-total,
.tab3-matrix-score {
  font-size: 13px;
  color: #475569;
}

.tab3-detail-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.tab3-detail-filters .input {
  min-width: 180px;
}

.tab3-signal-list {
  display: grid;
  gap: 14px;
}

.signal-card {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.92);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.signal-card.status-confirmed {
  border-color: rgba(22, 163, 74, 0.32);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.14);
}

.signal-card.status-rejected {
  opacity: 0.72;
  background: rgba(248, 250, 252, 0.9);
}

.signal-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.signal-direction-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.signal-direction-badge.bullish {
  background: rgba(220, 252, 231, 0.9);
  color: #166534;
}

.signal-direction-badge.bearish {
  background: rgba(254, 226, 226, 0.92);
  color: #991b1b;
}

.signal-confidence {
  font-size: 13px;
  color: #475569;
}

.signal-summary {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.6;
}

.signal-quote {
  margin: 0;
  padding: 14px 16px;
  border-left: 4px solid rgba(99, 102, 241, 0.36);
  border-radius: 16px;
  background: rgba(238, 242, 255, 0.82);
  color: #312e81;
  line-height: 1.7;
  white-space: pre-wrap;
}

.signal-source {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: #475569;
}

.signal-source a {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
}

.signal-source a:hover {
  text-decoration: underline;
}

.signal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.signal-action-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.signal-action-btn.confirm {
  background: rgba(220, 252, 231, 0.92);
  color: #166534;
}

.signal-action-btn.reject {
  background: rgba(254, 226, 226, 0.94);
  color: #991b1b;
}

.signal-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.signal-user-status {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.signal-user-status.confirmed {
  color: #166534;
}

.signal-user-status.rejected {
  color: #991b1b;
}

.tab3-traceability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.traceability-card {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.9);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.traceability-card-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

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

.traceability-item {
  font-size: 13px;
  color: #334155;
  line-height: 1.55;
}

@media (max-width: 1140px) {
  .content {
    width: calc(100vw - 14px);
  }

  .topbar {
    position: static;
    grid-template-columns: 1fr;
  }

  .step-nav {
    justify-content: flex-start;
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .tab2-mode-grid,
  .tab2-import-grid,
  .tab2-progress-grid,
  .tab2-library-controls,
  .tab3-config-grid,
  .tab3-progress-grid,
  .tab3-scorecard-grid,
  .tab3-traceability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab2-info-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .login-card {
    width: calc(100vw - 12px);
    padding: 24px 18px 20px;
  }

  .title {
    font-size: 23px;
  }

  .step-item {
    min-height: 34px;
    padding: 6px 10px;
  }

  .step-num {
    width: 18px;
    height: 18px;
  }

  .tab1-actions,
  .tab1-table-actions,
  .tab1-footer-actions,
  .tab1-bottom-actions,
  .tab2-primary-actions,
  .tab2-footer-actions,
  .tab3-primary-actions {
    align-items: stretch;
  }

  .tab1-actions .btn,
  .tab1-actions-main .btn,
  .tab1-table-actions .btn,
  .tab1-footer-actions .btn,
  .tab1-bottom-actions > .btn,
  .tab2-footer-actions .btn,
  .tab3-primary-actions .btn,
  .tab3-inline-actions .btn {
    width: 100%;
  }

  .tab2-primary-actions .btn {
    width: auto;
    flex: 0 0 auto;
  }

  .tab1-bottom-actions {
    flex-wrap: wrap;
  }

  .tab1-actions {
    flex-wrap: wrap;
  }

  .tab1-actions-main {
    width: 100%;
    flex-wrap: wrap;
  }

  #tab1StatusBox {
    flex-basis: 100%;
  }

  .tab2-mode-grid,
  .tab2-import-grid,
  .tab2-progress-grid,
  .tab2-library-controls,
  .tab2-advanced-grid,
  .tab3-config-grid,
  .tab3-radio-row,
  .tab3-progress-grid,
  .tab3-scorecard-grid,
  .tab3-traceability-grid {
    grid-template-columns: 1fr;
  }

  .tab3-matrix-row {
    align-items: flex-start;
  }

  .tab3-layout-primary {
    grid-template-columns: 1fr;
  }

  .tab3-view-toggle-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .tab3-view-toggle-btn:first-child,
  .tab3-view-toggle-btn:last-child {
    justify-self: stretch;
  }

  .tab3-source-detail-grid {
    grid-template-columns: 1fr;
  }

  .tab3-matrix-table {
    min-width: 720px;
  }

  .tab3-view-toggle-row {
    gap: 6px;
  }
}
