:root {
  --bg: #f4f5f1;
  --panel: #ffffff;
  --panel-alt: #f9faf7;
  --sidebar: #edf0eb;
  --field-label: #39443f;
  --table-head-text: #3b4540;
  --text-box-ink: #2d3531;
  --upload-bg: rgba(255, 255, 255, 0.72);
  --icon-bg: #dfe7df;
  --empty-mark-bg: #e4e9e4;
  --ink: #1f2623;
  --muted: #66726b;
  --line: #d8ded5;
  --green: #166f5a;
  --green-dark: #0f5143;
  --amber: #ad7100;
  --red: #b4493f;
  --blue: #315f7d;
  --shadow: 0 18px 40px rgba(31, 38, 35, 0.08);
}

[data-theme="dark"] {
  --bg: #111715;
  --panel: #1b2320;
  --panel-alt: #151c19;
  --sidebar: #161d1a;
  --field-label: #d8e1db;
  --table-head-text: #d8e1db;
  --text-box-ink: #e8eee9;
  --upload-bg: rgba(27, 35, 32, 0.82);
  --icon-bg: #25362f;
  --empty-mark-bg: #25362f;
  --ink: #eef4ef;
  --muted: #9fafaa;
  --line: #324039;
  --green: #3fa989;
  --green-dark: #7fd0b6;
  --amber: #e1aa42;
  --red: #e17a70;
  --blue: #8bb9d3;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.auth-overlay {
  min-height: 100vh;
  padding: 24px;
  background: var(--bg);
  display: grid;
  place-items: center;
}

.auth-overlay[hidden] {
  display: none;
}

.auth-panel {
  width: min(100%, 420px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.auth-panel h1,
.auth-panel h2 {
  margin: 0;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form[hidden] {
  display: none;
}

.auth-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: var(--green-dark);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
}

.input-pane {
  min-height: 100vh;
  padding: 28px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand,
.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 27px;
  line-height: 1.2;
}

.brand-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.3;
}

.api-badge {
  width: 12px;
  min-width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--muted);
  color: transparent;
}

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

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 850;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.icon-button:hover {
  border-color: rgba(22, 111, 90, 0.45);
  transform: translateY(-1px);
}

.api-badge.ready {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.api-badge.missing {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.16);
}

.review-form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  font-size: 13px;
  font-weight: 750;
  color: var(--field-label);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

input {
  height: 44px;
  padding: 0 13px;
}

textarea {
  resize: vertical;
  min-height: 120px;
  padding: 12px 13px;
  line-height: 1.5;
}

input:focus,
textarea:focus {
  border-color: rgba(22, 111, 90, 0.72);
  box-shadow: 0 0 0 3px rgba(22, 111, 90, 0.12);
}

.upload-box {
  min-height: 78px;
  padding: 14px;
  border: 1px dashed #aab5ae;
  border-radius: 8px;
  background: var(--upload-bg);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.upload-box input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--icon-bg);
  color: var(--green-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  flex: 0 0 auto;
}

.upload-box strong,
.upload-box small {
  display: block;
}

.upload-box strong {
  font-size: 14px;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.upload-box small {
  color: var(--muted);
  font-size: 12px;
}

.primary-button,
.secondary-button {
  height: 44px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 750;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.primary-button {
  width: 100%;
  background: var(--green);
  color: #fff;
}

.primary-button.compact {
  width: auto;
  min-width: 170px;
  padding: 0 16px;
}

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

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.secondary-button {
  min-width: 96px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.danger-button {
  color: var(--red);
}

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

.status.error {
  color: var(--red);
}

.status.success {
  color: var(--green-dark);
}

.report-pane {
  min-width: 0;
  padding: 28px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 22px;
}

.report-toolbar {
  min-height: 52px;
}

.batch-tabs {
  height: 58px;
  margin: -28px -28px 0;
  padding: 0 40px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  overflow: visible;
}

.tab-list {
  min-width: 0;
  height: 58px;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 28px;
  overflow-x: auto;
}

.tab-button {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tab-button[hidden] {
  display: none !important;
}

.tab-button.active {
  background: #16896d;
  color: #fff;
}

.tab-button.active:hover {
  background: #0f6f5a;
}

.tab-button:focus-visible,
.profile-button:focus-visible {
  outline: 2px solid rgba(22, 137, 109, 0.72);
  outline-offset: 2px;
}

.profile-menu {
  position: relative;
  z-index: 12;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.profile-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-alt);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(31, 38, 35, 0.08);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.profile-button:hover,
.profile-button[aria-expanded="true"] {
  border-color: rgba(22, 137, 109, 0.42);
  box-shadow: 0 10px 24px rgba(22, 137, 109, 0.14);
  transform: translateY(-1px);
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #16896d;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}

.profile-avatar.large {
  width: 42px;
  height: 42px;
  font-size: 13px;
  flex: 0 0 auto;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 238px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.profile-dropdown[hidden] {
  display: none;
}

.profile-dropdown-header {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-dropdown-header strong,
.profile-dropdown-header small {
  display: block;
}

.profile-dropdown-header strong {
  margin-bottom: 3px;
  font-size: 14px;
}

.profile-dropdown-header small {
  color: var(--muted);
  font-size: 12px;
}

.profile-menu-item {
  width: 100%;
  min-height: 40px;
  margin-top: 4px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  text-align: left;
}

.profile-menu-item:hover {
  background: var(--panel-alt);
}

.profile-menu-item.danger {
  color: var(--red);
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  max-width: 760px;
  border-bottom: 1px solid transparent;
}

.metric {
  min-height: 58px;
  padding: 0 24px;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  text-align: center;
}

.metric:last-child {
  border-right: 0;
}

.metric strong {
  color: #1f2c42;
  font-size: 34px;
  line-height: 1;
}

.metric:nth-child(3) strong,
.metric:nth-child(4) strong {
  color: #2563eb;
}

[data-theme="dark"] .metric strong {
  color: var(--ink);
}

[data-theme="dark"] .metric:nth-child(3) strong,
[data-theme="dark"] .metric:nth-child(4) strong {
  color: #7aa7ff;
}

.metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.batch-workspace {
  display: grid;
  gap: 20px;
}

.view-section {
  display: grid;
  gap: 22px;
  align-content: start;
}

.view-section[hidden] {
  display: none;
}

.batch-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.batch-heading p {
  margin-bottom: 0;
  color: #516789;
  font-size: 17px;
  line-height: 1.45;
}

[data-theme="dark"] .batch-heading p {
  color: var(--muted);
}

.batch-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dropzone {
  min-height: 230px;
  padding: 32px;
  border: 2px dashed #d8e2ef;
  border-radius: 8px;
  background: var(--panel);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone.dragging {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.06);
}

.dropzone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #eef4ff;
  color: #2563eb;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 850;
}

[data-theme="dark"] .dropzone-icon {
  background: rgba(122, 167, 255, 0.13);
  color: #7aa7ff;
}

.dropzone strong {
  font-size: 18px;
}

.dropzone small {
  color: #516789;
  font-size: 14px;
}

[data-theme="dark"] .dropzone small {
  color: var(--muted);
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.batch-placeholder {
  min-height: 110px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  display: grid;
  align-content: center;
  gap: 6px;
}

.batch-placeholder strong {
  color: var(--ink);
}

.file-card {
  min-height: 214px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 10px;
  cursor: pointer;
}

.file-card.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.file-card-top,
.file-meta,
.file-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mini-action {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mini-action {
  border: 0;
  background: #eef4ff;
  color: #2563eb;
  cursor: pointer;
}

.mini-action:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.remove-file {
  background: rgba(180, 73, 63, 0.12);
  color: var(--red);
  font-size: 22px;
  font-weight: 850;
  line-height: 1;
}

.remove-file:not(:disabled):hover {
  background: rgba(180, 73, 63, 0.2);
}

.file-name {
  min-height: 42px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
}

.file-card small {
  color: #516789;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

[data-theme="dark"] .file-card small {
  color: var(--muted);
}

.status-chip,
.score-chip {
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.status-chip.pending {
  background: rgba(81, 103, 137, 0.1);
  color: #516789;
}

.status-chip.processing {
  background: rgba(37, 99, 235, 0.11);
  color: #2563eb;
}

.status-chip.completed {
  background: rgba(22, 111, 90, 0.12);
  color: var(--green-dark);
}

.status-chip.error {
  background: rgba(180, 73, 63, 0.11);
  color: var(--red);
}

.score-chip.good {
  background: rgba(22, 111, 90, 0.12);
  color: var(--green-dark);
}

.score-chip.mid {
  background: rgba(173, 113, 0, 0.12);
  color: var(--amber);
}

.score-chip.low {
  background: rgba(180, 73, 63, 0.11);
  color: var(--red);
}

.file-error {
  margin: 0;
  color: var(--red);
  font-size: 12px;
  line-height: 1.4;
}

.file-card-actions {
  align-self: end;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.link-button {
  border: 0;
  background: transparent;
  color: #2563eb;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  padding: 0;
  text-decoration: none;
  text-transform: uppercase;
}

.compact-empty {
  min-height: 270px;
}

.analysis-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.analysis-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.analysis-actions > select {
  width: 112px;
  height: 44px;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.sort-control select {
  width: 170px;
  height: 44px;
}

.analysis-heading h2 {
  margin-bottom: 4px;
}

.analysis-heading p {
  margin-bottom: 0;
  color: #516789;
  line-height: 1.45;
}

[data-theme="dark"] .analysis-heading p {
  color: var(--muted);
}

.super-admin-dashboard {
  display: grid;
  gap: 16px;
}

.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.admin-metric,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-metric {
  min-height: 92px;
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 6px;
}

.admin-metric strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

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

.admin-panel {
  min-width: 0;
  padding: 16px;
}

.admin-panel h3 {
  margin-bottom: 12px;
}

.admin-panel-title {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-panel-title h3 {
  margin: 0;
}

.usage-log-title {
  align-items: flex-end;
}

.usage-log-controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.usage-log-controls label {
  display: grid;
  gap: 4px;
}

.usage-log-controls span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.usage-log-controls input {
  width: 138px;
  height: 38px;
  padding: 0 8px;
}

.admin-panel p {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.admin-panel code {
  display: block;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

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

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

.admin-table th {
  color: var(--table-head-text);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

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

.admin-table td strong,
.admin-table td small,
.admin-list-item strong,
.admin-list-item span,
.admin-list-item small {
  display: block;
}

.admin-table td small,
.admin-list-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.admin-split-grid,
.admin-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-settings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.admin-list.compact {
  max-height: 420px;
  overflow: auto;
}

.admin-list-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
}

.admin-list-item span {
  margin-top: 4px;
  color: var(--ink);
  line-height: 1.4;
}

.admin-credit-controls {
  min-width: 280px;
  display: grid;
  grid-template-columns: 70px minmax(110px, 1fr) 96px;
  gap: 8px;
}

.admin-credit-controls .admin-small-button {
  width: 100%;
}

.admin-credit-input,
.admin-credit-reason,
.admin-setting-controls input {
  height: 38px;
  padding: 0 10px;
}

.admin-small-button {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  font-size: 12px;
}

.admin-setting-controls {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) auto;
  gap: 8px;
}

.shortlist-position-label {
  margin-top: 4px;
  font-size: 13px;
}

.analysis-cards {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.shortlist-layout {
  display: grid;
  gap: 18px;
  align-items: start;
}

.draft-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.draft-layout > * {
  min-width: 0;
}

.shortlist-groups,
.shortlist-tools {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.shortlist-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.shortlist-group-header {
  min-height: 48px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-alt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shortlist-group-header h3 {
  margin: 0;
}

.shortlist-group-header span {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 850;
}

.shortlist-group-cards {
  display: grid;
}

.shortlist-record-card {
  border-bottom: 1px solid var(--line);
}

.shortlist-record-card:last-child {
  border-bottom: 0;
}

.status-select-label {
  min-width: 210px;
  display: grid;
  gap: 7px;
}

.status-select-label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.shortlist-tools {
  position: sticky;
  top: 18px;
}

.shortlist-tool-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

.tool-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-panel-header h3 {
  margin: 0;
}

.prefill-grid {
  display: grid;
  gap: 10px;
}

.compact-field {
  gap: 6px;
}

.compact-field span {
  font-size: 12px;
}

.compact-field textarea {
  min-height: 150px;
}

.tool-caption {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.variable-buttons,
.tool-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.variable-button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 8px;
  background: #eef4ff;
  color: #2563eb;
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 750;
}

[data-theme="dark"] .variable-button {
  background: rgba(122, 167, 255, 0.13);
  color: #7aa7ff;
}

.draft-preview {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
  display: grid;
  gap: 8px;
}

.draft-preview h4 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.draft-preview strong {
  color: var(--ink);
  line-height: 1.35;
}

.draft-preview p {
  margin: 0;
  color: var(--text-box-ink);
  line-height: 1.55;
  white-space: pre-wrap;
}

.analysis-empty-card {
  min-height: 170px;
  padding: 28px;
  color: var(--muted);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  text-align: center;
}

.analysis-empty-card strong {
  color: var(--ink);
}

.analysis-card {
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.analysis-card:last-child {
  border-bottom: 0;
}

.analysis-card.selected {
  background: rgba(37, 99, 235, 0.04);
}

.analysis-card-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.candidate-summary {
  min-width: 0;
}

.candidate-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.candidate-summary h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.candidate-name-row h3 {
  margin-bottom: 8px;
}

.candidate-name-row .header-score-chip {
  min-height: 32px;
  margin-bottom: 8px;
  padding: 4px 10px;
  font-size: 16px;
  line-height: 1.3;
}

.shortlist-button {
  min-height: 32px;
  margin-bottom: 8px;
  padding: 0 12px;
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: 8px;
  background: #eef4ff;
  color: #2563eb;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.shortlist-button:hover {
  background: rgba(37, 99, 235, 0.14);
}

.shortlist-button:disabled {
  cursor: default;
  opacity: 0.75;
}

.shortlist-button.shortlisted {
  border-color: rgba(22, 111, 90, 0.25);
  background: rgba(22, 111, 90, 0.12);
  color: var(--green-dark);
}

.shortlist-button.delete-shortlist-candidate {
  border-color: rgba(180, 73, 63, 0.26);
  background: rgba(180, 73, 63, 0.08);
  color: var(--red);
}

.shortlist-button.delete-shortlist-candidate:hover {
  background: rgba(180, 73, 63, 0.14);
}

[data-theme="dark"] .shortlist-button {
  background: rgba(122, 167, 255, 0.13);
  color: #7aa7ff;
}

[data-theme="dark"] .shortlist-button.shortlisted {
  background: rgba(63, 169, 137, 0.16);
  color: var(--green-dark);
}

[data-theme="dark"] .shortlist-button.delete-shortlist-candidate {
  background: rgba(225, 122, 112, 0.14);
  color: var(--red);
}

.contact-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: #4f6380;
  font-size: 14px;
}

[data-theme="dark"] .contact-lines {
  color: var(--muted);
}

.contact-lines span,
.contact-lines a {
  overflow-wrap: anywhere;
}

.whatsapp-link {
  color: #16a34a;
  font-weight: 800;
}

.mini-download {
  min-width: 88px;
  height: 36px;
  flex: 0 0 auto;
  text-decoration: none;
}

.analysis-result-box {
  padding: 14px 16px;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  background: #eaf6ff;
  color: #263c58;
  display: grid;
  gap: 12px;
}

[data-theme="dark"] .analysis-result-box {
  background: rgba(37, 99, 235, 0.1);
  color: var(--ink);
}

.result-score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.result-section {
  display: grid;
  gap: 4px;
}

.result-section h4 {
  margin: 0;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

[data-theme="dark"] .result-section h4 {
  color: #7aa7ff;
}

.result-section p {
  margin: 0;
  line-height: 1.6;
}

.more-details-button {
  width: fit-content;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.more-details-button:hover {
  text-decoration: underline;
}

[data-theme="dark"] .more-details-button {
  color: #7aa7ff;
}

.details-panel {
  display: grid;
  gap: 10px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
}

.detail-card {
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
}

[data-theme="dark"] .detail-card {
  background: rgba(27, 35, 32, 0.62);
}

.detail-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.detail-card h5 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.detail-card header span {
  min-width: max-content;
  color: #2563eb;
  font-size: 12px;
  font-weight: 850;
}

[data-theme="dark"] .detail-card header span {
  color: #7aa7ff;
}

.detail-card dl {
  margin: 0;
  display: grid;
  gap: 5px;
}

.detail-card dt {
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

[data-theme="dark"] .detail-card dt {
  color: #7aa7ff;
}

.detail-card dd {
  margin: 0 0 6px;
  line-height: 1.5;
}

.detail-card dd p {
  margin: 0;
}

.detail-card dd p + p {
  margin-top: 10px;
}

.details-empty {
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow);
}

.empty-state.compact-empty {
  min-height: 220px;
}

.empty-state p {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.empty-mark {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--empty-mark-bg);
  color: var(--green-dark);
  display: grid;
  place-items: center;
  font-weight: 850;
}

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

.summary-grid {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
}

.score-panel,
.candidate-panel,
.recommendation-panel,
.section-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.score-panel {
  min-height: 126px;
  padding: 16px;
  display: grid;
  align-content: center;
  gap: 8px;
}

.score-label,
.recommendation-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

#overall-score {
  font-size: 44px;
  line-height: 1;
}

#overall-score::after {
  content: "/100";
  margin-left: 4px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

#score-copy {
  color: var(--muted);
  line-height: 1.45;
}

.candidate-panel {
  padding: 16px;
  min-height: 126px;
  display: grid;
  align-content: center;
}

.candidate-panel dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.candidate-panel div {
  min-width: 0;
}

dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

dd {
  margin: 0;
  min-height: 24px;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.recommendation-panel {
  grid-column: 1 / -1;
  min-height: 84px;
  padding: 16px;
  display: grid;
  grid-template-columns: 140px minmax(160px, 220px) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.recommendation-panel strong {
  font-size: 22px;
}

.recommendation-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.recommendation-panel.yes {
  border-color: rgba(22, 111, 90, 0.35);
}

.recommendation-panel.no {
  border-color: rgba(180, 73, 63, 0.35);
}

.section-block {
  padding: 18px;
}

.section-heading {
  min-height: 26px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.dimension-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dimension-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.dimension-table th,
.dimension-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}

.dimension-table th {
  background: var(--panel-alt);
  color: var(--table-head-text);
  font-size: 12px;
  text-transform: uppercase;
}

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

.score-pill {
  min-width: 58px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 850;
}

.score-pill.good {
  background: rgba(22, 111, 90, 0.12);
  color: var(--green-dark);
}

.score-pill.mid {
  background: rgba(173, 113, 0, 0.12);
  color: var(--amber);
}

.score-pill.low {
  background: rgba(180, 73, 63, 0.11);
  color: var(--red);
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.text-box,
.resume-text {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
  color: var(--text-box-ink);
  line-height: 1.62;
}

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 20px;
  background: rgba(7, 11, 9, 0.52);
  display: grid;
  place-items: center;
}

.settings-overlay[hidden] {
  display: none;
}

.settings-panel {
  width: min(100%, 460px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.settings-header {
  padding: 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-content {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.confirm-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.credit-confirm-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.credit-confirm-summary div,
.credit-confirm-remark {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
}

.credit-confirm-summary span,
.credit-confirm-remark small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.credit-confirm-summary strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.credit-confirm-remark p {
  margin: 6px 0 0;
  color: var(--ink);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.plan-settings-panel {
  width: min(100%, 680px);
}

.plan-settings-list,
.plan-settings-form {
  display: grid;
  gap: 10px;
}

.plan-settings-form {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.plan-settings-form h3 {
  margin: 0;
}

.plan-settings-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.plan-settings-item strong,
.plan-settings-item small {
  display: block;
}

.plan-settings-item small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.plan-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.compact-setting-row {
  min-height: 50px;
  padding: 10px 12px;
}

.setting-row {
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.setting-row strong,
.setting-row small {
  display: block;
}

.setting-row strong {
  margin-bottom: 4px;
}

.setting-row small {
  color: var(--muted);
  line-height: 1.45;
}

.switch-input {
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.switch-input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s ease, background 0.15s ease;
}

.switch-input:checked {
  border-color: rgba(22, 111, 90, 0.5);
  background: rgba(22, 111, 90, 0.18);
}

.switch-input:checked::after {
  transform: translateX(20px);
  background: var(--green);
}

select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: var(--panel);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 18px,
    calc(100% - 14px) 18px;
  background-repeat: no-repeat;
  background-size: 6px 6px;
  color: var(--ink);
  padding: 0 42px 0 12px;
  outline: none;
}

select:focus {
  border-color: rgba(22, 111, 90, 0.72);
  box-shadow: 0 0 0 3px rgba(22, 111, 90, 0.12);
}

.position-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 2px;
}

.position-button {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

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

.position-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.save-position-action {
  background: #16896d;
}

.save-position-action:not(:disabled):hover {
  background: #0f6f5a;
}

.delete-position-action {
  background: #a12f27;
}

.delete-position-action:not(:disabled):hover {
  background: #82251f;
}

.saved-position-field {
  gap: 5px;
  margin-top: 0;
  margin-bottom: -2px;
}

.saved-position-field select {
  height: 38px;
  min-width: 0;
}

.text-box {
  min-height: 140px;
  padding: 14px;
  white-space: pre-wrap;
}

.resume-text {
  max-height: 280px;
  padding: 16px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  white-space: pre-wrap;
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

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

  .summary-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

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

  .analysis-list-panel {
    position: static;
  }

  .candidate-panel dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .admin-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-split-grid,
  .admin-settings-grid {
    grid-template-columns: 1fr;
  }

  .recommendation-panel {
    grid-template-columns: 1fr;
  }

  .score-panel {
    min-height: 150px;
  }

  .batch-heading,
  .batch-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .batch-actions,
  .primary-button.compact,
  .batch-actions .secondary-button {
    width: 100%;
  }

  .shortlist-layout,
  .draft-layout {
    grid-template-columns: 1fr;
  }

  .shortlist-tools {
    position: static;
  }
}

@media (max-width: 620px) {
  .input-pane,
  .report-pane {
    padding: 18px;
  }

  .brand,
  .report-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .candidate-panel dl {
    grid-template-columns: 1fr;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }

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

  .credit-confirm-summary,
  .plan-form-grid {
    grid-template-columns: 1fr;
  }

  .secondary-button {
    width: 100%;
  }

  .batch-tabs {
    margin: -18px -18px 0;
    padding: 0 18px;
    gap: 10px;
  }

  .tab-list {
    gap: 18px;
  }

  .profile-dropdown {
    right: -4px;
  }

  .metrics-row {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .metric {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .dropzone {
    min-height: 190px;
    padding: 22px;
  }

  .file-grid {
    grid-template-columns: 1fr;
  }

  .analysis-card {
    padding: 18px;
  }

  .analysis-card-header {
    flex-direction: column;
  }

  .analysis-actions,
  .mini-download {
    width: 100%;
  }

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

  .analysis-actions select,
  .analysis-actions .primary-button.compact,
  .analysis-actions .secondary-button {
    width: 100%;
  }

  .sort-control {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .status-select-label {
    width: 100%;
    min-width: 0;
  }

  .tool-actions,
  .tool-actions .primary-button.compact,
  .tool-actions .secondary-button {
    width: 100%;
  }
}
