:root {
  --bg: #111416;
  --bg-elevated: #181d20;
  --surface: rgba(24, 29, 32, 0.9);
  --surface-soft: rgba(28, 35, 37, 0.82);
  --surface-strong: rgba(16, 20, 22, 0.96);
  --line: rgba(224, 230, 226, 0.1);
  --line-strong: rgba(224, 230, 226, 0.18);
  --text: #f4f1ea;
  --muted: #b7bdb6;
  --teal: #56d7c1;
  --teal-strong: #2eb89f;
  --sand: #e8d4b4;
  --amber: #e7a95e;
  --coral: #ef7d57;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}

body[data-theme="light"] {
  --bg: #f4efe6;
  --bg-elevated: #faf7f0;
  --surface: rgba(255, 252, 247, 0.92);
  --surface-soft: rgba(255, 251, 245, 0.86);
  --surface-strong: rgba(251, 247, 240, 0.96);
  --line: rgba(23, 32, 36, 0.1);
  --line-strong: rgba(23, 32, 36, 0.18);
  --text: #182126;
  --muted: #59656d;
  --shadow: 0 18px 44px rgba(50, 62, 71, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(86, 215, 193, 0.06), transparent 220px),
    linear-gradient(120deg, rgba(239, 125, 87, 0.08), transparent 32%),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(244, 241, 234, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 241, 234, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), black 18%, black 82%, rgba(0, 0, 0, 0.4));
}

body[data-theme="light"]::before {
  background-image:
    linear-gradient(rgba(23, 32, 36, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 36, 0.04) 1px, transparent 1px);
}

a {
  color: inherit;
}

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

button {
  cursor: pointer;
}

.app-page,
.admin-page {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
}

.app-page .topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(17, 20, 22, 0.88), rgba(17, 20, 22, 0.24));
}

.admin-page .topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(17, 20, 22, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

body[data-theme="light"] .app-page .topbar {
  background: linear-gradient(180deg, rgba(248, 244, 237, 0.94), rgba(248, 244, 237, 0.6));
  border-bottom: 1px solid rgba(23, 32, 36, 0.08);
}

body[data-theme="light"] .admin-page .topbar {
  background: rgba(248, 244, 237, 0.94);
  border-bottom: 1px solid rgba(23, 32, 36, 0.08);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #0f1315;
  background: linear-gradient(135deg, var(--sand), var(--teal));
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong,
.brand-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy strong {
  font-size: 15px;
}

.brand-copy span {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
}

.theme-toggle {
  appearance: none;
  font: inherit;
  background: transparent;
}

.topbar-status {
  font-size: 12px;
  color: var(--teal);
}

body[data-theme="light"] .inline-link {
  background: rgba(255, 255, 255, 0.54);
}

.app-shell,
.admin-layout {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 0 0 40px;
}

.auth-shell {
  display: grid;
  align-content: center;
  min-height: calc(100vh - 120px);
}

.auth-card {
  width: min(560px, 100%);
  margin: 28px auto 0;
}

.auth-form-grid {
  margin-top: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--sand);
}

.hero-band h1,
.admin-hero h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.12;
}

.hero-copy,
.panel-copy,
.metric-label,
.progress-label,
.help-text,
.field-hint,
.status-copy,
.empty-state {
  color: var(--muted);
}

.summary-grid,
.metric-row,
.result-tags,
.keyword-row,
.cta-stack,
.field-grid,
.question-grid,
.toolbar-row,
.stats-grid,
.table-toolbar {
  display: grid;
  gap: 12px;
}

.hero-band {
  position: relative;
  min-height: 540px;
  color: #f4f1ea;
  background:
    linear-gradient(90deg, rgba(17, 20, 22, 0.82) 0%, rgba(17, 20, 22, 0.54) 42%, rgba(17, 20, 22, 0.1) 100%),
    url("https://images.unsplash.com/photo-1558494949-ef010cbdcc31?auto=format&fit=crop&w=1800&q=80") 72% center/cover no-repeat;
}

body[data-theme="light"] .hero-band {
  background:
    linear-gradient(94deg, rgba(15, 19, 21, 0.86) 0%, rgba(15, 19, 21, 0.58) 44%, rgba(15, 19, 21, 0.22) 100%),
    url("https://images.unsplash.com/photo-1558494949-ef010cbdcc31?auto=format&fit=crop&w=1800&q=80") 72% center/cover no-repeat;
}

.hero-overlay {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  min-height: 540px;
  padding: 120px 0 84px;
  display: flex;
  align-items: flex-end;
}

.hero-copy-block {
  max-width: 620px;
}

.hero-band .eyebrow,
.hero-band .hero-copy,
.hero-band .hero-stat span {
  color: rgba(244, 241, 234, 0.8);
}

.hero-band h1 {
  color: #f4f1ea;
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.hero-copy {
  max-width: 34rem;
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.75;
}

.hero-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 520px;
  margin-top: 24px;
}

.hero-stat {
  padding: 14px 0 0;
  border-top: 1px solid rgba(244, 241, 234, 0.22);
}

.hero-stat strong {
  display: block;
  font-size: 24px;
}

.hero-stat span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.hero-process {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-process span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(17, 20, 22, 0.4);
  border: 1px solid rgba(244, 241, 234, 0.16);
  font-size: 13px;
}

body[data-theme="light"] .hero-process span {
  color: #f4f1ea;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(244, 241, 234, 0.18);
}

body[data-theme="light"] .hero-stat {
  border-top-color: rgba(244, 241, 234, 0.18);
}

.app-shell {
  margin-top: -42px;
  position: relative;
  z-index: 2;
}

.tool-band {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.8fr);
  gap: 24px;
  align-items: start;
}

.tool-stage {
  min-width: 0;
}

.support-column {
  display: grid;
  gap: 18px;
}

.support-band {
  padding: 20px 0;
  border-top: 1px solid rgba(244, 241, 234, 0.1);
}

.support-band:first-child {
  border-top: 0;
}

.support-heading h2 {
  margin: 0;
  font-size: 18px;
}

.support-heading p {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

.support-checklist {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.support-item {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(244, 241, 234, 0.08);
}

.support-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.support-item strong,
.summary-cell strong,
.tag-card strong,
.salary-card strong {
  display: block;
}

.support-item span {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.metric-tile {
  padding: 14px 16px;
  border: 1px solid rgba(244, 241, 234, 0.14);
  border-radius: 8px;
  background: rgba(17, 20, 22, 0.48);
  backdrop-filter: blur(8px);
}

.metric-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
}

.metric-label {
  display: block;
  margin-top: 6px;
  font-size: 12px;
}

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

.tool-surface {
  overflow: hidden;
  background: rgba(17, 20, 22, 0.92);
}

body[data-theme="light"] .tool-surface,
body[data-theme="light"] .summary-cell,
body[data-theme="light"] .question-option,
body[data-theme="light"] .tag-card,
body[data-theme="light"] .dimension-card,
body[data-theme="light"] .action-card,
body[data-theme="light"] .salary-card,
body[data-theme="light"] .stat-card,
body[data-theme="light"] .delivery-panel,
body[data-theme="light"] .share-panel,
body[data-theme="light"] .result-footer-note,
body[data-theme="light"] .keyword-box,
body[data-theme="light"] .consult-box,
body[data-theme="light"] .delivery-benefit,
body[data-theme="light"] .table-panel,
body[data-theme="light"] .admin-panel {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(23, 32, 36, 0.1);
}

body[data-theme="light"] .tool-surface {
  background: rgba(252, 250, 246, 0.94);
}

.tool-header,
.panel-section,
.admin-panel,
.table-panel {
  padding: 22px;
}

.tool-header {
  border-bottom: 1px solid var(--line);
}

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

.step-label {
  font-size: 14px;
  color: var(--muted);
}

.progress-track {
  margin-top: 14px;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(244, 241, 234, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--sand));
}

body[data-theme="light"] .progress-track,
body[data-theme="light"] .metric-bar,
body[data-theme="light"] .mini-progress {
  background: rgba(23, 32, 36, 0.08);
}

.tool-body {
  padding: 22px;
}

.panel-title,
.question-title,
.result-score-value,
.metric-number,
.stat-number {
  font-weight: 700;
}

.panel-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.18;
}

.panel-copy {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.7;
}

.summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}

.summary-cell {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.summary-cell strong {
  display: block;
  font-size: 18px;
}

.summary-cell span {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.cta-row,
.wizard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cta-row {
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  color: #101416;
  background: linear-gradient(135deg, var(--sand), var(--teal));
}

.btn-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
}

.btn-ghost {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

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

body[data-theme="light"] .btn-secondary,
body[data-theme="light"] .btn-ghost {
  background: rgba(255, 255, 255, 0.68);
}

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

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

.field.wide {
  grid-column: 1 / -1;
}

.field label {
  font-size: 14px;
  color: var(--muted);
}

.text-input,
.text-select,
.text-area {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(17, 20, 22, 0.84);
}

.text-area {
  min-height: 110px;
  resize: vertical;
}

body[data-theme="light"] .text-input,
body[data-theme="light"] .text-select,
body[data-theme="light"] .text-area {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(23, 32, 36, 0.12);
}

.field-hint {
  font-size: 12px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}

.checkbox-row input {
  margin-top: 2px;
}

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

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(86, 215, 193, 0.12);
}

.status-copy {
  font-size: 14px;
}

.question-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.question-option {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  text-align: left;
}

.question-option strong {
  font-size: 15px;
}

.question-option span {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.question-option.is-selected {
  border-color: rgba(86, 215, 193, 0.62);
  background: rgba(86, 215, 193, 0.12);
}

body[data-theme="light"] .question-option.is-selected {
  background: rgba(86, 215, 193, 0.16);
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.question-counter {
  font-size: 13px;
  color: var(--sand);
}

.question-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.26;
}

.question-detail {
  margin-top: 10px;
  line-height: 1.7;
  color: var(--muted);
}

.question-dimension {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--sand);
  background: rgba(232, 212, 180, 0.12);
}

.wizard-actions {
  margin-top: 22px;
  justify-content: space-between;
}

.inline-error {
  margin-top: 14px;
  font-size: 13px;
  color: var(--coral);
}

.loading-panel {
  display: grid;
  gap: 16px;
  min-height: 260px;
  place-content: center;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 4px solid rgba(244, 241, 234, 0.12);
  border-top-color: var(--teal);
  border-radius: 999px;
  animation: spin 1s linear infinite;
}

.section-kicker {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--sand);
}

.metric-row {
  gap: 14px;
}

.metric-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.metric-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #101416;
  background: linear-gradient(135deg, var(--teal), var(--sand));
}

.metric-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(244, 241, 234, 0.08);
  overflow: hidden;
}

.metric-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--amber));
}

.metric-value-text {
  font-size: 12px;
  color: var(--muted);
}

.info-list,
.check-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.info-list li,
.check-list li {
  margin-bottom: 10px;
  line-height: 1.6;
}

.salary-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.salary-table th,
.salary-table td {
  padding: 10px 0;
  border-bottom: 1px solid rgba(244, 241, 234, 0.08);
  font-size: 13px;
  text-align: left;
}

.salary-table th {
  color: var(--muted);
  font-weight: 500;
}

.result-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
}

.result-score-badge {
  display: grid;
  place-items: center;
  width: 106px;
  height: 106px;
  border: 1px solid rgba(86, 215, 193, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(86, 215, 193, 0.14), rgba(232, 212, 180, 0.1)),
    rgba(255, 255, 255, 0.02);
}

.result-score-value {
  font-size: 36px;
}

.result-score-label {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.result-title {
  margin: 0;
  font-size: 28px;
}

.result-copy {
  margin-top: 10px;
  line-height: 1.7;
  color: var(--muted);
}

.result-tags {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}

.tag-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.tag-card strong {
  display: block;
  font-size: 14px;
}

.tag-card span {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.dimension-grid,
.action-grid,
.stats-grid {
  display: grid;
  gap: 14px;
}

.dimension-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 22px;
}

.dimension-card,
.action-card,
.stat-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.dimension-card h3,
.action-card h3,
.table-panel h2,
.admin-panel h2 {
  margin: 0;
  font-size: 17px;
}

.dimension-card p,
.action-card p,
.stat-card p {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.mini-progress {
  margin-top: 12px;
  height: 10px;
  border-radius: 999px;
  background: rgba(244, 241, 234, 0.08);
  overflow: hidden;
}

.mini-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--sand));
}

.section-divider {
  margin: 28px 0 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.section-divider h2,
.section-divider h3 {
  margin: 0;
}

.action-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.action-card span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #101416;
  background: linear-gradient(135deg, var(--sand), var(--teal));
}

.salary-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.salary-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.salary-card strong {
  display: block;
  font-size: 18px;
}

.salary-card span {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.keyword-row {
  grid-template-columns: 1fr auto;
  margin-top: 20px;
}

.keyword-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.keyword-label {
  font-size: 13px;
  color: var(--muted);
}

.keyword-value {
  font-size: 14px;
}

.support-card {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(232, 169, 94, 0.28);
  border-radius: 8px;
  background: rgba(231, 169, 94, 0.08);
}

body[data-theme="light"] .support-card {
  background: rgba(231, 169, 94, 0.14);
  border-color: rgba(231, 169, 94, 0.22);
}

.support-card h3 {
  margin: 0;
  font-size: 16px;
}

.support-card p {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.delivery-panel,
.share-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.delivery-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 220px;
  gap: 20px;
  padding: 18px;
}

.delivery-copy > strong {
  font-size: 20px;
}

.delivery-copy > p {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.delivery-benefits {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.delivery-benefit {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid rgba(244, 241, 234, 0.08);
  border-radius: 8px;
  background: rgba(17, 20, 22, 0.54);
}

.delivery-benefit span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  font-size: 12px;
  color: #101416;
  background: linear-gradient(135deg, var(--sand), var(--teal));
}

.delivery-benefit strong {
  font-size: 14px;
}

.keyword-box-stacked,
.consult-box {
  margin-top: 16px;
}

.consult-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 74px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 20, 22, 0.44);
}

.delivery-qr-wrap {
  display: grid;
  align-content: start;
}

.delivery-qr-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(244, 241, 234, 0.12);
  background: #fff;
}

.delivery-qr-caption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.delivery-qr-placeholder {
  display: grid;
  place-content: center;
  min-height: 220px;
  padding: 20px;
  border: 1px dashed rgba(244, 241, 234, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(86, 215, 193, 0.08), rgba(86, 215, 193, 0.02)),
    rgba(17, 20, 22, 0.54);
  text-align: center;
}

body[data-theme="light"] .delivery-qr-placeholder {
  background:
    linear-gradient(180deg, rgba(86, 215, 193, 0.08), rgba(86, 215, 193, 0.03)),
    rgba(255, 255, 255, 0.72);
  border-color: rgba(23, 32, 36, 0.14);
}

.pseudo-qr {
  display: grid;
  grid-template-columns: repeat(17, 1fr);
  grid-template-rows: repeat(17, 1fr);
  width: 156px;
  height: 156px;
  margin: 0 auto 16px;
  padding: 8px;
  border-radius: 8px;
  background: #f4f1ea;
}

.pseudo-qr-cell {
  background: transparent;
}

.pseudo-qr-cell.is-filled {
  background: #111416;
}

body[data-theme="light"] .pseudo-qr {
  background: #ffffff;
}

body[data-theme="light"] .pseudo-qr-cell.is-filled {
  background: #182126;
}

.delivery-qr-placeholder strong {
  font-size: 16px;
}

.delivery-qr-placeholder span {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.delivery-qr-placeholder code {
  color: var(--sand);
}

.share-panel {
  padding: 18px;
}

.result-footer-note {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(244, 241, 234, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.result-footer-note strong {
  font-size: 15px;
}

.result-footer-note span {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

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

.admin-hero {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(17, 20, 22, 0.92), rgba(17, 20, 22, 0.7)),
    url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=1600&q=80") center/cover no-repeat;
  box-shadow: var(--shadow);
}

body[data-theme="light"] .admin-hero {
  background:
    linear-gradient(90deg, rgba(249, 245, 239, 0.94), rgba(249, 245, 239, 0.74)),
    url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=1600&q=80") center/cover no-repeat;
}

.admin-hero p {
  max-width: 40rem;
  margin-top: 12px;
  line-height: 1.7;
  color: var(--muted);
}

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

.stats-grid-wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  min-height: 120px;
}

.stat-number {
  display: block;
  font-size: 30px;
}

.table-toolbar {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  margin-top: 16px;
}

.admin-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.detail-panel {
  min-height: 100%;
}

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

.detail-header h2 {
  margin: 0;
  font-size: 24px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.detail-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.consult-history {
  display: grid;
  gap: 12px;
}

.consult-history-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.consult-history-item strong,
.consult-history-item span,
.consult-history-item p {
  display: block;
}

.consult-history-item span {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.consult-history-item p {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.compact-empty {
  padding: 16px 0;
}

.is-selected-row {
  background: rgba(86, 215, 193, 0.08);
}

body[data-theme="light"] .consult-history-item {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(23, 32, 36, 0.1);
}

body[data-theme="light"] .is-selected-row {
  background: rgba(86, 215, 193, 0.14);
}

.toolbar-row {
  grid-auto-flow: column;
  justify-content: start;
}

.toolbar-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
}

body[data-theme="light"] .toolbar-pill {
  background: rgba(255, 255, 255, 0.7);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 18px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

.data-table th,
.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(244, 241, 234, 0.08);
  vertical-align: top;
  font-size: 13px;
  text-align: left;
}

.data-table tbody tr {
  cursor: pointer;
}

body[data-theme="light"] .salary-table th,
body[data-theme="light"] .salary-table td,
body[data-theme="light"] .data-table th,
body[data-theme="light"] .data-table td {
  border-color: rgba(23, 32, 36, 0.08);
}

.data-table th {
  color: var(--muted);
  font-weight: 500;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
}

.level-A {
  color: #10201c;
  background: rgba(86, 215, 193, 0.88);
}

.level-B {
  color: #10201c;
  background: rgba(232, 212, 180, 0.88);
}

.level-C {
  color: #271d12;
  background: rgba(231, 169, 94, 0.88);
}

.level-D,
.level-E {
  color: #331a15;
  background: rgba(239, 125, 87, 0.88);
}

.empty-state {
  padding: 30px 0;
  text-align: center;
}

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

@media (max-width: 980px) {
  .tool-band {
    grid-template-columns: 1fr;
  }

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

  .stats-grid-wide,
  .admin-workspace {
    grid-template-columns: 1fr;
  }

  .action-grid,
  .salary-summary,
  .dimension-grid,
  .delivery-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar,
  .tool-header,
  .tool-body,
  .panel-section,
  .admin-panel,
  .table-panel,
  .admin-hero {
    padding: 18px;
  }

  .app-page .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px 14px 10px;
    background: rgba(17, 20, 22, 0.98);
    border-bottom: 1px solid rgba(244, 241, 234, 0.08);
  }

  body[data-theme="light"] .app-page .topbar {
    background: rgba(248, 244, 237, 0.98);
    border-bottom: 1px solid rgba(23, 32, 36, 0.08);
  }

  .app-shell,
  .admin-layout {
    width: min(100vw - 20px, 1180px);
  }

  .brand {
    width: 100%;
  }

  .brand-copy strong {
    font-size: 14px;
  }

  .brand-copy span {
    font-size: 11px;
  }

  .hero-band {
    min-height: 420px;
    background-position: 74% center;
  }

  .hero-overlay {
    width: min(100vw - 20px, 1180px);
    min-height: 420px;
    padding: 42px 0 40px;
  }

  .hero-band h1,
  .admin-hero h1,
  .panel-title,
  .result-title {
    font-size: 30px;
  }

  .field-grid,
  .question-grid,
  .summary-grid,
  .hero-stat-row,
  .result-tags,
  .salary-summary,
  .stats-grid,
  .stats-grid-wide,
  .detail-summary-grid,
  .table-toolbar {
    grid-template-columns: 1fr;
  }

  .tool-band {
    gap: 18px;
  }

  .app-shell {
    margin-top: -28px;
    padding-top: 0;
  }

  .wizard-actions,
  .cta-row,
  .step-row,
  .result-header,
  .keyword-row,
  .detail-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .question-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-score-badge {
    width: 90px;
    height: 90px;
  }

  .topbar-links {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }

  .inline-link {
    min-height: 34px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .topbar-status {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
  }
}
