/* CV Mojo app (v2 preview): CV Interview (ch-). Builds on the ap-/tool toolkit in app.css. */

.ch [hidden] { display: none !important; }
.ch [tabindex="-1"]:focus { outline: none; }
.ch .ap-kicker .tool-ic { margin-bottom: 8px; }
.ch-cost { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ch-cost-out { color: #b42318; background: #fdecea; }
.ch-cost-out svg { color: #b42318; }
.ch-upgrade { font-size: 14px; font-weight: 700; }
.ch-small { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.ch-count { font-size: 13.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.ch-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 2px; font: inherit; font-size: 14px; font-weight: 700; color: var(--indigo); background: none; border: 0; border-radius: 8px; cursor: pointer; }
.ch-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.ch-confirm-q { flex-basis: 100%; margin: 0; font-size: 14.5px; font-weight: 700; color: var(--navy); }

/* Focus: every control gets a clear ring. */
.ch-link:focus-visible, .ch-edit:focus-visible, .ch-tool:focus-visible, .ch-skip:focus-visible, .ch-mic:focus-visible,
.ch-topic-edit:focus-visible, .ch-rec-cancel:focus-visible, .ch-log:focus-visible, .ch a:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }
.ch-create .btn:focus-visible, .ch-create .ch-link:focus-visible, .ch-how a:focus-visible { outline-color: var(--yellow); }

/* ── Start screen ──────────────────────────────────────────────────────── */
.ch-start { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.ch-acc { --accent: var(--cyan); }
.ch-setup { padding-top: 32px; }
.ch-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.ch-h { margin: 0 0 16px; padding: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; color: var(--navy); }
.ch-depths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-top: 6px; }
.ch-depth { position: relative; display: block; cursor: pointer; }
.ch-depth input { position: absolute; opacity: 0; pointer-events: none; }
.ch-depth-body { display: grid; justify-items: start; align-content: start; gap: 3px; height: 100%; padding: 18px 16px 16px; background: #fff; border: 2px solid var(--line); border-radius: 18px; transition: border-color .15s ease, background-color .15s ease, transform .15s ease; }
.ch-depth-ic { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 8px; color: var(--navy); background: var(--mist); border-radius: 13px; transform: rotate(-4deg); transition: background-color .15s ease; }
.ch-depth b { font-size: 1.05rem; color: var(--navy); }
.ch-depth-meta { font-size: 13.5px; color: var(--muted); }
.ch-depth:hover .ch-depth-body { border-color: var(--navy); transform: translateY(-2px); }
.ch-depth input:checked + .ch-depth-body { background: var(--cyan-soft); border-color: var(--navy); }
.ch-depth input:checked + .ch-depth-body .ch-depth-ic { background: var(--cyan); }
.ch-depth input:focus-visible + .ch-depth-body { outline: 3px solid var(--indigo); outline-offset: 2px; }
.ch-depth .cvm-sticker { top: -12px; right: 12px; }

.ch-voice-opt { display: grid; gap: 6px; margin-top: 22px; padding: 16px 18px; background: var(--channel-soft); border-radius: 16px; }
.ch-go { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 24px; }
.ch-go .btn { min-height: 50px; padding: 12px 26px; font-size: 15.5px; }
.ch-go .ch-small { flex: 1 1 220px; }

/* Saved interview */
.ch-resume { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 16px; margin-bottom: 26px; padding: 18px; background: var(--yellow-soft); border: 1px solid #e9ef8c; border-radius: 18px; }
.ch-resume-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; color: var(--navy); background: var(--yellow); border-radius: 14px; transform: rotate(-5deg); }
.ch-resume-text { flex: 1 1 240px; display: grid; gap: 2px; min-width: 0; }
.ch-resume-text b { font-size: 15.5px; color: var(--navy); }
.ch-resume-text > span { font-size: 13.5px; color: var(--muted); }
.ch-resume-text .ch-resume-warn { display: block; margin-top: 6px; font-weight: 600; color: var(--amber); }
.ch-resume-warn svg { margin-top: -2px; }
.ch-resume-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }

/* How it works */
.ch-how h2 { margin: 0 0 16px; font-size: 1.1rem; font-weight: 800; }
.ch-steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.ch-steps li { display: flex; gap: 12px; font-size: 14px; line-height: 1.5; }
.ch-steps b { display: block; font-size: 15px; color: #fff; }
.ch-step-n { flex: none; display: grid; place-items: center; width: 28px; height: 28px; font-size: 13.5px; font-weight: 800; color: var(--navy); background: var(--yellow); border-radius: 50%; }
.ch-steps li:nth-child(2) .ch-step-n { background: var(--cyan); }
.ch-steps li:nth-child(3) .ch-step-n { background: var(--channel); }
.ch-how-note { display: flex; align-items: flex-start; gap: 8px; margin: 20px 0 0; padding-top: 16px; font-size: 13.5px; border-top: 1px solid rgba(255, 255, 255, .14); }
.ch-how-note svg { flex: none; margin-top: 2px; color: var(--cyan); }

/* ── The interview ─────────────────────────────────────────────────────── */
.ch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.ch-chat { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 1px 2px rgba(25, 29, 59, .05), 0 2px 8px rgba(25, 29, 59, .04); }
.ch-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px 12px; }
.ch-prog { display: grid; gap: 1px; min-width: 0; margin: 0; }
.ch-prog b { font-size: 15px; color: var(--navy); }
.ch-prog span { overflow: hidden; font-size: 13.5px; font-weight: 600; color: var(--indigo); white-space: nowrap; text-overflow: ellipsis; }
.ch-voice-sw { flex: none; font-size: 13.5px; }
.ch-bar { display: block; height: 5px; margin: 0 22px; overflow: hidden; background: var(--mist); border-radius: 3px; }
.ch-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--indigo), var(--channel)); border-radius: 3px; transition: width .5s ease; }

.ch-log { display: flex; flex-direction: column; gap: 14px; height: clamp(340px, 56vh, 620px); padding: 22px; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.ch-msg { display: flex; align-items: flex-end; gap: 10px; max-width: min(84%, 720px); }
.ch-msg--me { align-self: flex-end; flex-direction: row-reverse; }
.ch-msg-body { display: grid; justify-items: start; gap: 6px; min-width: 0; }
.ch-msg--me .ch-msg-body { justify-items: end; }
.ch-mark { flex: none; width: 34px; height: 34px; margin-bottom: 2px; font-size: 12.5px; border-radius: 10px; }
.ch-mark::after { left: 8px; right: 8px; bottom: 6px; height: 2.5px; }
.ch-av { width: 34px; height: 34px; margin-bottom: 2px; font-size: 13px; }
.ch-who { font-size: 12.5px; font-weight: 800; letter-spacing: .02em; color: var(--indigo); }
.ch-bubble { max-width: 100%; padding: 12px 16px; font-size: 15px; line-height: 1.6; color: var(--navy); overflow-wrap: anywhere; background: var(--channel-soft); border-radius: 18px 18px 18px 6px; }
.ch-bubble.is-current { background: var(--yellow-soft); box-shadow: inset 0 0 0 1.5px #e3ea7a; }
.ch-msg--me .ch-bubble { color: #fff; background: var(--indigo); border-radius: 18px 18px 6px 18px; }
.ch-msg--me .ch-bubble.is-skipped { font-style: italic; color: var(--muted); background: #fff; box-shadow: inset 0 0 0 1.5px #cfd2e6; }
.ch-msg.is-editing { width: 100%; max-width: 100%; }
.ch-msg.is-editing .ch-av { display: none; }

.ch-q-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-tool, .ch-edit { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 700; color: var(--navy); background: #fff; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; transition: border-color .15s ease, color .15s ease; }
.ch-tool:hover, .ch-edit:hover { color: var(--indigo); border-color: var(--indigo); }
.ch-tool svg, .ch-edit svg { color: var(--indigo); }
.ch-q-tools.is-speaking .ch-tool { color: #fff; background: var(--navy); border-color: var(--navy); }
.ch-q-tools.is-speaking .ch-tool svg { color: var(--yellow); }
.ch-msg--me .ch-edit { padding: 3px 10px; font-size: 12.5px; color: var(--muted); border-color: transparent; background: none; }
.ch-msg--me .ch-edit:hover { color: var(--indigo); border-color: var(--line); background: #fff; }

/* Typing dots */
.ch-dots { display: inline-flex; gap: 5px; padding: 15px 16px; }
.ch-dots i { width: 7px; height: 7px; background: var(--indigo); border-radius: 50%; opacity: .35; animation: ch-dot 1s ease-in-out infinite; }
.ch-dots i:nth-child(2) { animation-delay: .15s; }
.ch-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ch-dot { 50% { opacity: 1; transform: translateY(-3px); } }
@keyframes ch-in { from { opacity: 0; translate: 0 8px; } }
.ch-in { animation: ch-in .3s ease both; }

/* Composer */
.ch-compose { padding: 14px 18px 14px; background: #fff; border-top: 1px solid var(--line); }
.ch-input-row { display: flex; align-items: flex-end; gap: 10px; }
.ch .ch-input { flex: 1; min-width: 0; min-height: 52px; max-height: 220px; padding: 13px 16px; font-size: 15px; line-height: 1.5; resize: none; border-radius: 16px; field-sizing: content; }
.ch .ch-input[readonly] { background: var(--mist); }
@supports not (field-sizing: content) {
  .ch .ch-input { min-height: 84px; resize: vertical; }
  .ch .ch-edit-input { min-height: 120px; }
}
.ch-mic { flex: none; display: grid; place-items: center; width: 50px; height: 50px; padding: 0; color: var(--navy); background: var(--yellow); border: 0; border-radius: 50%; cursor: pointer; transition: background-color .15s ease, box-shadow .15s ease; }
.ch-mic:hover { background: #fbff8a; }
.ch-mic.is-on { color: #fff; background: #e5484d; box-shadow: 0 0 0 6px rgba(229, 72, 77, .18); }
.ch-mic:disabled { opacity: .55; cursor: progress; }
.ch .ch-send { flex: none; width: 50px; height: 50px; min-height: 50px; padding: 0; }
.ch-compose-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; margin-top: 8px; }
.ch-skip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 4px; font: inherit; font-size: 14px; font-weight: 700; color: var(--muted); background: none; border: 0; border-radius: 8px; cursor: pointer; }
.ch-skip:hover { color: var(--indigo); }
.ch-keys { font-size: 12.5px; color: var(--muted); }
.ch-note { margin: 10px 0 0; padding: 9px 12px; font-size: 13.5px; font-weight: 600; line-height: 1.5; color: var(--navy); background: var(--amber-soft); border-radius: 12px; }
.ch-note:empty { margin: 0; padding: 0; }

/* Recording */
.ch-rec { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; padding: 8px 10px 8px 14px; font-size: 13.5px; font-weight: 700; color: #b42318; background: #fdecea; border-radius: 999px; }
.ch-rec-text { flex: 1; min-width: 0; }
.ch-wave { display: inline-flex; align-items: center; gap: 3px; height: 16px; }
.ch-wave i { width: 3px; height: 5px; background: #e5484d; border-radius: 2px; animation: ch-wave .8s ease-in-out infinite alternate; }
.ch-wave i:nth-child(2) { animation-delay: .15s; }
.ch-wave i:nth-child(3) { animation-delay: .3s; }
.ch-wave i:nth-child(4) { animation-delay: .45s; }
.ch-wave i:nth-child(5) { animation-delay: .6s; }
@keyframes ch-wave { to { height: 16px; } }
.ch-rec.is-busy { color: var(--indigo); background: #e4e7fb; }
.ch-rec.is-busy .ch-wave i { background: var(--indigo); }
.ch-rec-cancel { padding: 4px 12px; font: inherit; font-size: 12.5px; font-weight: 700; color: inherit; background: #fff; border: 1.5px solid currentColor; border-radius: 999px; cursor: pointer; }

/* All questions answered */
.ch-done { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; padding: 4px 2px; }
.ch-done p { flex: 1 1 260px; margin: 0; font-size: 15px; color: var(--muted); }
.ch-done b { color: var(--navy); }

/* Editing an answer */
.ch-editor { display: grid; gap: 10px; width: 100%; padding: 14px; background: #fff; border: 2px solid var(--indigo); border-radius: 16px; box-shadow: 0 10px 24px rgba(25, 29, 59, .08); }
.ch-editor-label { font-size: 13.5px; font-weight: 700; color: var(--navy); }
.ch-editor-label span { color: var(--indigo); }
.ch .ch-edit-input { min-height: 96px; max-height: 320px; font-size: 15px; field-sizing: content; }
.ch-editor .ap-error { margin: 0; }
.ch-editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ch-editor-actions .btn { min-height: 38px; padding: 7px 16px; font-size: 14px; }

/* Side panel */
.ch-aside { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 16px; }
.ch-topics-card { padding: 22px; }
.ch-topics-card .db-card-h { margin-bottom: 12px; }
.ch-topics { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.ch-topic { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 6px; font-size: 14px; color: var(--muted); border-radius: 10px; }
.ch-topic-dot { flex: none; display: grid; place-items: center; width: 24px; height: 24px; font-size: 12px; font-weight: 800; color: var(--muted); background: var(--mist); border-radius: 50%; }
.ch-topic-label { flex: 1; min-width: 0; }
.ch-topic-label em { font-size: 12.5px; font-style: normal; color: var(--muted); }
.ch-topic.is-done { color: var(--navy); }
.ch-topic.is-done .ch-topic-dot { color: #fff; background: var(--ok); }
.ch-topic.is-skipped .ch-topic-dot { background: #fff; box-shadow: inset 0 0 0 1.5px #cfd2e6; }
.ch-topic.is-current { font-weight: 700; color: var(--navy); background: var(--yellow-soft); }
.ch-topic.is-current .ch-topic-dot { color: var(--navy); background: var(--yellow); }
.ch-topic-edit { flex: none; padding: 3px 8px; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--indigo); background: none; border: 0; border-radius: 8px; cursor: pointer; }
.ch-topic-edit:hover { background: var(--mist); }
.ch-restart { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ch-confirm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ch-confirm-actions .btn { min-height: 36px; padding: 6px 14px; font-size: 13.5px; }
.ch-tip { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; font-size: 14px; line-height: 1.5; color: var(--navy); background: var(--cyan-soft); border-radius: 16px; }
.ch-tip svg { flex: none; margin-top: 2px; color: var(--indigo); }
.ch-tip p { margin: 0; }

/* ── Check your answers ────────────────────────────────────────────────── */
.ch-review { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.ch-answers-card .db-card-h { margin-bottom: 6px; }
.ch-answers { display: grid; gap: 0; margin: 18px 0 0; padding: 0; list-style: none; }
.ch-ans { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.ch-ans-n { flex: none; display: grid; place-items: center; width: 28px; height: 28px; font-size: 13px; font-weight: 800; color: var(--navy); background: var(--mist); border-radius: 50%; }
.ch-ans-main { flex: 1; min-width: 0; }
.ch-ans-label { margin: 2px 0 0; font-size: 15.5px; font-weight: 800; color: var(--navy); }
.ch-ans-q { margin: 2px 0 10px; font-size: 13.5px; color: var(--muted); }
.ch-ans-body { display: grid; justify-items: start; gap: 8px; }
.ch-ans-body.is-editing { justify-items: stretch; }
.ch-ans-text { padding: 12px 14px; font-size: 15px; line-height: 1.6; color: var(--navy); overflow-wrap: anywhere; background: var(--channel-soft); border-radius: 14px; }
.ch-ans-text p { margin: 0; }
.ch-ans-text p + p { margin-top: 8px; }
.ch-ans-skip { margin: 0; font-size: 14px; font-style: italic; color: var(--muted); }
.ch-transcript { display: grid; gap: 8px; margin-top: 18px; }
.ch-transcript .ap-textarea { font-size: 13.5px; }

.ch-review-aside { position: sticky; top: calc(var(--header-h) + 24px); }
.ch-create { padding-top: 30px; }
.ch-create .cvm-sticker { top: -12px; right: 20px; }
.ch-create h2 { margin: 0 0 8px; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.ch-create p { margin: 0; font-size: 14.5px; line-height: 1.55; }
.ch-create .ap-error { margin-top: 16px; color: #8a1c12; }
.ch-create .ap-error a { color: inherit; font-weight: 800; }
.ch-create .btn:disabled { opacity: .6; cursor: not-allowed; }
.ch-create-cost { margin-top: 10px !important; font-size: 13.5px !important; text-align: center; color: #c9cdea; }
.ch-create-cost a { font-weight: 800; color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.ch-create-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .14); }
.ch-create .ch-link { font-size: 13.5px; color: #fff; }
.ch-create .ch-link svg { color: var(--yellow); }

.ch-working { min-height: 360px; }

/* ── Smaller screens ───────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .ch-start, .ch-layout, .ch-review { grid-template-columns: minmax(0, 1fr); }
  .ch-aside, .ch-review-aside { position: static; }
  .ch-aside { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
}
@media (max-width: 760px) {
  .ch-depths { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ch-depth-body { grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: center; padding: 14px 16px; }
  .ch-depth-ic { grid-row: span 2; margin: 0; }
  .ch-depth .cvm-sticker { top: -10px; }
  .ch-setup { padding-top: 26px; }
  .ch-go .btn { width: 100%; }
  .ch-top { padding: 14px 16px 10px; }
  .ch-bar { margin: 0 16px; }
  .ch-log { height: clamp(320px, 58vh, 560px); padding: 16px 12px; }
  .ch-msg { max-width: 94%; gap: 8px; }
  .ch-mark, .ch-av { width: 30px; height: 30px; }
  .ch-mark::after { left: 7px; right: 7px; bottom: 5px; }
  .ch-bubble { padding: 11px 14px; font-size: 14.5px; }
  .ch-compose { padding: 12px; }
  .ch-input-row { gap: 8px; }
  .ch-mic, .ch .ch-send { width: 46px; height: 46px; min-height: 46px; }
  .ch-keys { display: none; }
  .ch-ans { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .ch-in, .ch-dots i, .ch-wave i { animation: none; }
  .ch-wave i { height: 10px; }
  .ch-bar i, .ch-depth-body, .ch-depth-ic, .ch-mic { transition: none; }
  .ch-depth:hover .ch-depth-body { transform: none; }
  .ch-log { scroll-behavior: auto; }
}
