:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #d8dee8;
  --surface: #ffffff;
  --page: #f5f7fb;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --accent: #9a3412;
  --good: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

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

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 0 12px;
}

button:hover {
  border-color: var(--primary);
}

.primary,
form button[type="submit"] {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.primary:hover,
form button[type="submit"]:hover {
  background: var(--primary-dark);
}

.app-shell {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 22px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 31px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

h3 {
  margin-bottom: 8px;
  font-size: 14px;
}

.status {
  min-width: 122px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 8px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(460px, 1.05fr);
  gap: 16px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

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

.panel-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

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

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

select {
  min-height: 40px;
}

textarea {
  resize: vertical;
  line-height: 1.42;
}

.upload-box {
  border: 1px dashed #b7c1d1;
  border-radius: 8px;
  background: #f9fbfd;
  padding: 12px;
}

.upload-box span {
  color: var(--ink);
  font-weight: 700;
}

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

.score-card {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}

.ai-badge {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-bottom: 16px;
  padding: 6px 10px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}

.ai-badge.active {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.score-label {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 13px;
}

.score-value {
  margin-bottom: 0;
  font-size: 30px;
  font-weight: 700;
}

.meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f6;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  transition: width 180ms ease;
}

.meter .good {
  background: var(--good);
}

.meter .warn {
  background: var(--warn);
}

.meter .bad {
  background: var(--bad);
}

.evaluation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.evaluation-grid section,
.action-panel,
.evaluation-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.evaluation-summary {
  margin-bottom: 14px;
  line-height: 1.5;
}

ul,
ol {
  margin: 0;
  padding-left: 20px;
}

li {
  margin-bottom: 8px;
  line-height: 1.42;
}

.action-panel {
  margin-bottom: 14px;
}

.ai-build-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #86efac;
  border-radius: 8px;
  margin-bottom: 14px;
  background: #ecfdf5;
  padding: 14px;
}

.ai-build-panel > div {
  min-width: 220px;
}

.ai-build-panel h3 {
  margin-bottom: 4px;
  color: #14532d;
  font-size: 16px;
}

.ai-build-panel p {
  margin: 0;
  color: #166534;
  font-size: 13px;
  line-height: 1.4;
}

.ai-build-panel button {
  border-color: #047857;
  background: #047857;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

.ai-build-panel button:hover {
  background: #065f46;
}

.language-picker {
  min-width: 160px;
  color: #14532d;
  font-weight: 700;
}

.language-picker select {
  border-color: #86efac;
  background: #fff;
  color: var(--ink);
  font-weight: 400;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.chip {
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
}

.chip.matched {
  background: #e6f4f1;
  color: #0f5f58;
}

.chip.missing {
  background: #fff2dc;
  color: #8a4a06;
}

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

.recommendations {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.recommendations p {
  margin: 0;
  border-left: 3px solid var(--primary);
  background: #f2faf8;
  padding: 9px 10px;
  color: #25413e;
  font-size: 14px;
  line-height: 1.4;
}

#sectionFeedback {
  display: grid;
  gap: 8px;
}

#sectionFeedback p {
  margin: 0;
  line-height: 1.45;
}

#improvedCv {
  min-height: 520px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

@media (max-width: 1220px) {
  .workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 16px;
  }

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

  h1 {
    font-size: 25px;
  }

  .workspace,
  .two-col,
  .evaluation-grid,
  .score-card,
  .ai-build-panel {
    grid-template-columns: 1fr;
  }

  .ai-build-panel {
    align-items: stretch;
    flex-direction: column;
  }
}
