:root {
  --ink: #14201c;
  --ink-soft: #2a3a34;
  --paper: #f3f0e7;
  --paper-2: #e7e2d4;
  --line: rgba(20, 32, 28, 0.12);
  --teal: #0f6e56;
  --teal-deep: #0a4f3d;
  --amber: #c45c26;
  --amber-soft: #f0d5c4;
  --good: #1f7a4d;
  --warn: #9a6b12;
  --risk: #a33b2b;
  --shadow: 0 18px 40px rgba(20, 32, 28, 0.08);
  --radius: 18px;
  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body: "Figtree", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(15, 110, 86, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(196, 92, 38, 0.14), transparent 50%),
    linear-gradient(165deg, #f7f4ec 0%, #ebe6d8 45%, #e2ddd0 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(20, 32, 28, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 32, 28, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

.page {
  position: relative;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 1.75rem;
  animation: rise 0.55s ease both;
}

.brand {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

.brand-mark {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 12px;
  background:
    linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 55%, var(--amber) 120%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.tagline {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.disclaimer {
  margin: 0;
  max-width: 18rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: right;
}

.top-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
}

.unit-pill {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
  color: var(--teal-deep);
  background: rgba(15, 110, 86, 0.12);
}

.confidence-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: center;
  margin: 0 0 0.95rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  font-size: 0.82rem;
}

.confidence-label {
  color: var(--ink-soft);
  font-weight: 600;
}

.confidence-track {
  height: 7px;
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
}

.confidence-track > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--teal);
  transition: width 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.confidence-track > span.medium {
  background: var(--warn);
}

.confidence-track > span.low {
  background: var(--risk);
}

.confidence-value {
  font-size: 0.78rem;
  white-space: nowrap;
}

.confidence-value.high { color: var(--good); }
.confidence-value.medium { color: var(--warn); }
.confidence-value.low { color: var(--risk); }

.suggestions-box {
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  background: rgba(196, 92, 38, 0.07);
  border: 1px solid rgba(196, 92, 38, 0.2);
}

.suggestions-box h3 {
  margin: 0 0 0.45rem;
  color: var(--amber);
  font-size: 0.92rem;
}

.suggestions-box ul {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.empty-state .btn {
  margin-top: 0.85rem;
}

.factor-row .bar > span.good {
  background: linear-gradient(90deg, #1f7a4d, #3a9b6a);
}

.factor-row .bar > span.mid {
  background: linear-gradient(90deg, #9a6b12, #c4922e);
}

.factor-row .bar > span.low {
  background: linear-gradient(90deg, #a33b2b, #c45c26);
}

.layout {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 1.25rem;
  align-items: start;
}

.panel {
  background: color-mix(in srgb, var(--paper) 88%, white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.4rem 1.5rem;
  animation: rise 0.65s ease both;
}

.result-panel {
  position: sticky;
  top: 1rem;
  animation-delay: 0.08s;
}

h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h3 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 0 0 1rem;
  padding: 0.9rem 1rem 1rem;
  background: rgba(255, 255, 255, 0.35);
}

legend {
  padding: 0 0.35rem;
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--teal-deep);
}

.hint {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.upload-fieldset .hint {
  margin: 0.65rem 0 0;
}

.parser-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  align-items: end;
  margin-bottom: 0.85rem;
}

.input-mode-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.input-mode-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.45);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.input-mode-option input {
  width: auto;
  accent-color: var(--teal);
}

.input-mode-option:has(input:checked) {
  border-color: var(--teal);
  background: rgba(15, 110, 86, 0.1);
  color: var(--teal-deep);
}

.mode-hint {
  margin-top: 0;
}

.input-panel.hidden {
  display: none !important;
}

.parser-mode {
  flex: 1 1 220px;
}

.btn.tiny-bar {
  padding: 0.62rem 0.9rem;
  border-radius: 10px;
  font-size: 0.85rem;
}

.online-settings {
  margin-bottom: 0.85rem;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
}

.online-settings .hint {
  margin: 0.55rem 0 0.75rem;
}

.meta-dropzone {
  background:
    linear-gradient(135deg, rgba(196, 92, 38, 0.06), rgba(15, 110, 86, 0.05));
  border-color: color-mix(in srgb, var(--amber) 40%, var(--line));
}

.meta-dropzone:hover,
.meta-dropzone:focus-visible,
.meta-dropzone.dragover {
  border-color: var(--amber);
  background: rgba(196, 92, 38, 0.1);
}

.meta-actions {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.meta-actions .btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.upload-fieldset code {
  font-size: 0.84em;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  background: rgba(20, 32, 28, 0.06);
}

.cv-dropzone {
  border: 1.5px dashed color-mix(in srgb, var(--teal) 45%, var(--line));
  border-radius: 14px;
  padding: 1.1rem 1rem;
  background:
    linear-gradient(135deg, rgba(15, 110, 86, 0.06), rgba(196, 92, 38, 0.05));
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.cv-dropzone:hover,
.cv-dropzone:focus-visible,
.cv-dropzone.dragover {
  outline: none;
  border-color: var(--teal);
  background: rgba(15, 110, 86, 0.1);
  transform: translateY(-1px);
}

.cv-dropzone.busy {
  opacity: 0.7;
  pointer-events: none;
}

.cv-dropzone-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: center;
}

.cv-dropzone-body strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.cv-dropzone-body span {
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.cv-status {
  margin-top: 0.65rem;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--ink-soft);
  min-height: 1.2em;
}

.cv-status[data-tone="ok"] {
  color: var(--good);
}

.cv-status[data-tone="error"] {
  color: var(--risk);
}

.cv-status[data-tone="info"] {
  color: var(--ink-soft);
}

.grid {
  display: grid;
  gap: 0.85rem;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid .span-2 {
  grid-column: 1 / -1;
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.68rem 0.75rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  background: #fffdf8;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--teal) 65%, white);
  box-shadow: 0 0 0 3px rgba(15, 110, 86, 0.15);
}

.companies {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.company {
  border: 1px dashed color-mix(in srgb, var(--teal) 35%, var(--line));
  border-radius: 12px;
  padding: 0.85rem;
  background: rgba(15, 110, 86, 0.04);
  animation: rise 0.35s ease both;
}

.company-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.7rem;
}

.company-head h3 {
  margin: 0;
  font-size: 0.92rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 100%);
  color: #f7f4ec;
  box-shadow: 0 10px 22px rgba(15, 110, 86, 0.28);
}

.btn.primary:hover {
  background: linear-gradient(135deg, #128266 0%, var(--teal) 100%);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
}

.btn.ghost:hover {
  border-color: var(--teal);
  color: var(--teal-deep);
  background: rgba(15, 110, 86, 0.06);
}

.btn.tiny {
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  border-radius: 8px;
  background: transparent;
  border-color: var(--line);
  color: var(--risk);
}

.empty-state {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 0.4rem 0 0.2rem;
}

.hidden {
  display: none !important;
}

.gauge-wrap {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0.2rem auto 1rem;
}

.gauge {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-track,
.gauge-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
}

.gauge-track {
  stroke: var(--paper-2);
}

.gauge-fill {
  stroke: var(--teal);
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.3s ease;
}

.gauge-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.gauge-label span:first-child {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.gauge-label .pct {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-left: 0.1rem;
}

.risk-band {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.risk-band.high {
  color: var(--good);
}

.risk-band.medium {
  color: var(--warn);
}

.risk-band.low {
  color: var(--risk);
}

.summary {
  margin: 0 0 1.1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  background: rgba(15, 110, 86, 0.07);
  border: 1px solid rgba(15, 110, 86, 0.12);
  font-size: 0.92rem;
  line-height: 1.45;
}

.missing-box {
  margin: 0 0 1.1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  background: rgba(163, 59, 43, 0.07);
  border: 1px solid rgba(163, 59, 43, 0.18);
}

.missing-box h3 {
  margin: 0 0 0.35rem;
  color: var(--risk);
}

.missing-intro {
  margin: 0 0 0.55rem;
  font-size: 0.84rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.missing-box ul {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.25rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

label.field-missing {
  color: var(--risk);
}

input.field-missing,
select.field-missing {
  border-color: color-mix(in srgb, var(--risk) 55%, var(--line));
  background: #fff7f5;
  box-shadow: 0 0 0 3px rgba(163, 59, 43, 0.12);
}

.factors,
.drivers {
  margin-top: 1rem;
}

.factors ul,
.drivers ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.factor-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  align-items: center;
  font-size: 0.88rem;
}

.factor-row .bar {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
}

.factor-row .bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), color-mix(in srgb, var(--teal) 50%, var(--amber)));
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.driver-item {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-size: 0.88rem;
  line-height: 1.4;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
}

.driver-item .tag {
  flex-shrink: 0;
  margin-top: 0.1rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.4rem;
  border-radius: 6px;
}

.driver-item .tag.up {
  color: var(--good);
  background: rgba(31, 122, 77, 0.12);
}

.driver-item .tag.down {
  color: var(--risk);
  background: rgba(163, 59, 43, 0.12);
}

.foot {
  margin-top: 1.25rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-align: center;
  animation: rise 0.7s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: static;
  }

  .grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .disclaimer {
    text-align: left;
    max-width: none;
  }
}

@media (max-width: 560px) {
  .page {
    width: min(100% - 1.2rem, 1180px);
    padding-top: 1.25rem;
  }

  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 1.1rem;
  }
}
