:root {
  --teal:      #003645;
  --teal-700:  #0a4a5c;
  --teal-050:  #e8f0f2;
  --red:       #e4051f;
  --red-600:   #c40419;
  --ink:       #14202a;
  --muted:     #5d6b76;
  --muted-2:   #8a96a0;
  --line:      #e3e8ec;
  --bg:        #ffffff;
  --tint:      #f6f9fc;
  --tint-2:    #eef3f7;
  --ok:        #1f9d6b;
  --radius:    14px;
  --radius-sm: 10px;
  --shadow:    0 10px 34px rgba(0, 54, 69, .08);
  --shadow-sm: 0 2px 10px rgba(0, 54, 69, .06);
  --ring:      0 0 0 4px rgba(0, 54, 69, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(900px 480px at 90% -120px, var(--teal-050) 0%, rgba(232,240,242,0) 70%),
    linear-gradient(180deg, var(--tint) 0%, #ffffff 38%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Maven Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 30px; background: rgba(255,255,255,.82);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-700) 100%);
  color: #fff; display: grid; place-items: center; font-size: 16px; font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.brand-name { font-weight: 800; letter-spacing: -.2px; color: var(--teal); font-size: 18px; }
.brand-tag { color: var(--muted); font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: none; align-items: center; gap: 9px; padding: 5px 6px 5px 12px;
  border: 1px solid var(--line); border-radius: 99px; background: #fff; font-size: 13.5px;
}
.user-chip.show { display: inline-flex; }
.user-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--teal);
  color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.logout { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; }
.logout:hover { color: var(--red); }

.wrap { width: 100%; max-width: 760px; margin: 46px auto; padding: 0 20px; flex: 1; }
.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 34px;
}
.hidden { display: none !important; }

.eyebrow { color: var(--red); font-weight: 700; font-size: 12.5px; letter-spacing: 1.4px;
  text-transform: uppercase; margin: 0 0 10px; }
h1 { font-size: 30px; line-height: 1.18; margin: 0 0 10px; letter-spacing: -.6px; color: var(--teal); font-weight: 800; }
h2 { font-size: 21px; margin: 0 0 14px; color: var(--teal); font-weight: 700; letter-spacing: -.2px; }
.lede { color: var(--muted); margin: 0 0 26px; font-size: 16px; }

.login { text-align: center; }
.login .brand-mark { width: 56px; height: 56px; font-size: 28px; border-radius: 14px; margin: 4px auto 18px; }
.btn-ms {
  display: inline-flex; align-items: center; gap: 12px; margin: 8px auto 0;
  background: var(--teal); color: #fff; border: 0; border-radius: var(--radius-sm);
  padding: 13px 22px; font-size: 15px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: background .15s, transform .05s;
}
.btn-ms:hover { background: var(--red); }
.btn-ms:active { transform: translateY(1px); }
.ms-logo { width: 18px; height: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.ms-logo i { display: block; }
.ms-logo i:nth-child(1){background:#f25022} .ms-logo i:nth-child(2){background:#7fba00}
.ms-logo i:nth-child(3){background:#00a4ef} .ms-logo i:nth-child(4){background:#ffb900}

.dropzone {
  display: block; border: 1.6px dashed #c8d3da; border-radius: var(--radius);
  background: var(--tint); padding: 38px; cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--teal); background: var(--teal-050); }
.dz-icon { width: 52px; height: 52px; margin: 0 auto; border-radius: 50%;
  background: #fff; border: 1px solid var(--line); display: grid; place-items: center;
  font-size: 24px; color: var(--teal); box-shadow: var(--shadow-sm); }
.dz-text { margin-top: 12px; color: var(--muted); }
.dz-text strong { color: var(--ink); }
.dz-file { margin-top: 10px; font-size: 14px; color: var(--teal); font-weight: 700; min-height: 18px; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 24px 0; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted);
  border: 0; padding: 0; margin: 0; font-weight: 600; }
.field input[type="email"] {
  background: #fff; border: 1px solid var(--line); color: var(--ink); border-radius: var(--radius-sm);
  padding: 11px 13px; font-size: 14.5px; outline: none; font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.field input[type="email"]:focus { border-color: var(--teal); box-shadow: var(--ring); }
.seg { display: flex; gap: 8px; }
.seg label {
  flex: 1; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px; font-size: 13px; color: var(--ink); cursor: pointer; text-align: center; transition: .12s;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.seg label:has(input:checked) { border-color: var(--teal); background: var(--teal-050); color: var(--teal); font-weight: 700; }
.seg label.disabled { color: var(--muted-2); cursor: not-allowed; opacity: .65; }
.seg input { accent-color: var(--teal); }
.note-managed { font-size: 12px; color: var(--muted-2); margin: -6px 0 0; }

.btn {
  appearance: none; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 11px 18px; border-radius: var(--radius-sm); font-size: 14.5px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: background .15s, color .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--teal); color: var(--teal); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  width: 100%; border: 0; color: #fff; background: var(--teal); font-size: 15.5px; padding: 14px;
  box-shadow: var(--shadow-sm);
}
.btn.primary:hover { background: var(--red); }
.btn.primary:disabled { opacity: .4; cursor: not-allowed; background: var(--teal); }
.btn.accent { background: var(--red); color: #fff; border: 0; }
.btn.accent:hover { background: var(--red-600); color: #fff; }
.hint { color: var(--muted-2); font-size: 12.5px; text-align: center; margin: 16px 0 0; }

.steps { list-style: none; padding: 0; margin: 10px 0 24px; }
.steps li { display: flex; align-items: center; gap: 13px; padding: 10px 0; color: var(--muted-2); border-bottom: 1px solid var(--tint-2); }
.steps li:last-child { border-bottom: 0; }
.steps li .dot { width: 12px; height: 12px; border-radius: 50%; background: #d8e0e5; flex: none; transition: .2s; }
.steps li.active { color: var(--teal); font-weight: 700; }
.steps li.active .dot { background: var(--teal); box-shadow: var(--ring); }
.steps li.done { color: var(--ink); }
.steps li.done .dot { background: var(--ok); }
.bar { height: 8px; background: var(--tint-2); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; width: 5%; border-radius: 99px;
  background: linear-gradient(90deg, var(--teal), var(--teal-700)); transition: width .5s ease; }
.progress-actions { text-align: center; margin-top: 20px; }
#cancel:hover { border-color: var(--red); color: var(--red); }
#cancel:disabled { opacity: .5; cursor: progress; }

.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.resume {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 26px; margin: 16px 0; line-height: 1.65; box-shadow: var(--shadow-sm);
}
.resume:focus { outline: none; border-color: var(--teal); box-shadow: var(--ring); }
.resume[contenteditable="true"] { background: #fffef9; }
.resume h2 { color: var(--teal); font-size: 16px; margin: 20px 0 6px; padding-bottom: 5px; border-bottom: 2px solid var(--teal-050); }
.resume h2:first-child { margin-top: 0; }
.resume h3 { font-size: 15px; margin: 14px 0 4px; color: var(--ink); }
.resume li { margin: 4px 0; }
.edit-banner { font-size: 12.5px; color: var(--red); font-weight: 600; margin: 0 0 6px; }
.transcript { margin-top: 10px; }
.transcript summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; }
.transcript summary:hover { color: var(--teal); }
.transcript pre { white-space: pre-wrap; color: var(--muted); font-size: 13.5px;
  background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin-top: 10px; }

.history-link { display: block; width: 100%; margin-top: 14px; background: transparent; border: 0; color: var(--teal); }
.history-link:hover { color: var(--red); border: 0; }

.hist-list { list-style: none; padding: 0; margin: 8px 0 0; }
.hist-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin-bottom: 8px; cursor: pointer; background: #fff; transition: border-color .12s, background .12s;
}
.hist-item:hover { border-color: var(--teal); background: var(--teal-050); }
.hist-name { font-weight: 700; color: var(--ink); }
.hist-meta { color: var(--muted-2); font-size: 13px; white-space: nowrap; }

.error-msg { color: var(--red); background: #fff5f5; border: 1px solid #f6c9ce;
  border-radius: var(--radius-sm); padding: 14px; font-size: 14px; }

.foot { text-align: center; color: var(--muted-2); font-size: 12px; padding: 26px; }
.foot b { color: var(--teal); }

@media (max-width: 560px) { .fields { grid-template-columns: 1fr; } .card { padding: 22px; } h1 { font-size: 25px; } }

@media print {
  body { background: #fff; }
  .topbar, .foot, .result-head, .transcript summary, .hint { display: none !important; }
  .wrap, .card { margin: 0; max-width: none; box-shadow: none; border: 0; padding: 0; }
  .resume { border: 0; box-shadow: none; padding: 0; }
  .transcript[open] pre { border: 0; }
}
