/* App: sign-in, case library, interview room, scorecard, history */

.app-main { min-height: calc(100dvh - var(--nav-h)); }
.view-pad { padding-block: clamp(2rem, 1.5rem + 2vw, 3.5rem) 4rem; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.view-head .lead { margin-top: 0.5rem; font-size: 1.125rem; }

.credits { display: inline-flex; align-items: center; gap: 0.4rem; height: 2rem; padding: 0 0.8rem; border-radius: var(--pill); background: var(--fill); font-size: 0.8125rem; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.credits b { color: var(--text); font-weight: 600; }
.avatar { width: 2rem; height: 2rem; border-radius: 50%; border: 0; background: var(--accent-tint); color: var(--accent); font-weight: 650; font-size: 0.875rem; display: grid; place-items: center; transition: transform 100ms ease-out; }
.avatar:active { transform: scale(0.94); }
@media (max-width: 520px) { .credits .long, #end-btn .long { display: none; } }

/* Sign in */
.signin { min-height: calc(100dvh - var(--nav-h)); display: grid; place-items: center; padding: 2rem var(--gutter) 4rem; }
.signin .card { width: min(26rem, 100%); padding: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem); }
.signin .brand-mark { width: 3rem; height: 3rem; margin: 0 auto 1.25rem; }
.signin h1 { text-align: center; }
.signin .sub { text-align: center; color: var(--text-2); margin: 0.6rem 0 1.75rem; }
.signin .legal { text-align: center; margin: 1.25rem 0 0; }
.google-icon { width: 1.1rem; height: 1.1rem; }
.notice { padding: 0.9rem 1rem; border-radius: var(--r-sm); background: var(--fill); font-size: 0.9375rem; }
.notice.warn { background: var(--orange-tint); color: var(--text); }
.notice.ok { background: var(--green-tint); }

/* Case detail sheet */
.case-detail .meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.case-detail h2 { margin-bottom: 0.25rem; }
.case-detail .company { color: var(--text-2); font-size: 0.9375rem; margin-bottom: 1.25rem; }
.case-detail .prompt { white-space: pre-line; background: var(--fill); border-radius: var(--r-md); padding: 1rem 1.1rem; font-size: 1rem; line-height: 1.5; }
.case-detail .skills { margin: 1.1rem 0 1.5rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.case-detail .uses { text-align: center; margin-top: 0.75rem; }

/* Interview room */
.room {
  display: grid;
  grid-template-columns: minmax(17rem, 22rem) minmax(0, 1fr);
  height: calc(100dvh - var(--nav-h));
  max-width: 82rem;
  margin-inline: auto;
}
.brief {
  overflow-y: auto;
  padding: 1.5rem 1.25rem 2rem var(--gutter);
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.brief h2 { margin: 0.4rem 0 0.15rem; }
.brief .who { color: var(--text-2); font-size: 0.875rem; }
.brief .prompt { white-space: pre-line; font-size: 0.9375rem; line-height: 1.5; background: var(--fill); border-radius: var(--r-md); padding: 0.9rem 1rem; }
.brief .given { margin: 0; padding-left: 1.1rem; font-size: 0.875rem; color: var(--text-2); }
.brief .given li + li { margin-top: 0.3rem; }
.brief .section-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; color: var(--text-3); text-transform: uppercase; margin-bottom: 0.4rem; }
.notes { width: 100%; min-height: 9rem; resize: vertical; border-radius: var(--r-md); border: 1px solid var(--field-border); background: var(--elev); padding: 0.75rem 0.9rem; font-size: 0.9375rem; line-height: 1.45; }
.notes:focus { border-color: var(--accent); box-shadow: var(--focus); }
.tips { font-size: 0.8125rem; color: var(--text-2); margin: 0; padding-left: 1.1rem; }
.tips li + li { margin-top: 0.25rem; }

.chat { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-head {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--material);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}
.chat-head .t { font-weight: 600; font-size: 0.9375rem; letter-spacing: -0.008em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head .timer { font-variant-numeric: tabular-nums; font-size: 0.8125rem; color: var(--text-2); padding: 0.2rem 0.55rem; border-radius: var(--pill); background: var(--fill); }
.chat-head .timer.over { color: var(--orange); background: var(--orange-tint); }
.chat-head .timer.over::after { content: " over"; } /* not by colour alone */
.chat-head .spacer { flex: 1; }
.brief-toggle { display: none; }

.thread { flex: 1; overflow-y: auto; padding: 1.25rem clamp(1rem, 0.5rem + 2vw, 2.5rem) 1.5rem; display: flex; flex-direction: column; gap: 0.35rem; overscroll-behavior: contain; }
.msg { max-width: min(36rem, 82%); padding: 0.65rem 0.95rem; border-radius: 1.25rem; font-size: 1rem; line-height: 1.45; letter-spacing: -0.004em; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.them { align-self: flex-start; background: var(--bubble-them); color: var(--bubble-them-text); border-bottom-left-radius: 0.45rem; }
.msg.me { align-self: flex-end; background: var(--accent-fill); color: var(--on-accent); border-bottom-right-radius: 0.45rem; }
.msg.them + .msg.me, .msg.me + .msg.them, .typing-bubble { margin-top: 0.6rem; }
.msg.enter { animation: msg-in 280ms cubic-bezier(0.2, 0.9, 0.25, 1); }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
@media (prefers-reduced-motion: reduce) { .msg.enter { animation: fade-in 200ms ease; } }
@keyframes fade-in { from { opacity: 0; } }

.inline-error { align-self: center; margin-top: 0.75rem; font-size: 0.875rem; color: var(--red); background: var(--red-tint); padding: 0.5rem 0.85rem; border-radius: var(--pill); text-align: center; }
.end-banner { align-self: stretch; margin-top: 1.25rem; text-align: center; padding: 1.25rem; border-radius: var(--r-lg); background: var(--fill); }
.end-banner p { margin: 0 0 0.9rem; color: var(--text-2); }

.composer {
  padding: 0.75rem clamp(1rem, 0.5rem + 2vw, 2.5rem) calc(0.9rem + env(safe-area-inset-bottom));
  background: var(--material);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}
.composer-box { display: flex; align-items: flex-end; gap: 0.5rem; background: var(--elev); border: 1px solid var(--field-border); border-radius: 1.4rem; padding: 0.35rem 0.35rem 0.35rem 1rem; transition: border-color 160ms ease, box-shadow 160ms ease; }
.composer-box:focus-within { border-color: var(--accent); box-shadow: var(--focus); outline: 2px solid var(--accent); outline-offset: 2px; }
.composer textarea:focus-visible { outline: none; } /* the box above carries the ring */
.composer textarea { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; resize: none; padding: 0.5rem 0; max-height: 12rem; font-size: 1rem; line-height: 1.45; }
.send { width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 0; background: var(--accent-fill); color: var(--on-accent); display: grid; place-items: center; flex: none; transition: transform 100ms ease-out, opacity 160ms ease; }
.send:active:not(:disabled) { transform: scale(0.92); }
.send:disabled { opacity: 0.3; cursor: default; }
.composer .meta { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.4rem; padding-inline: 0.4rem; }

@media (max-width: 900px) {
  .room { grid-template-columns: minmax(0, 1fr); }
  .brief { display: none; }
  .brief-toggle { display: inline-flex; }
}

/* Writing the scorecard */
.working { min-height: calc(100dvh - var(--nav-h)); display: grid; place-items: center; text-align: center; padding: 2rem var(--gutter); }
.working .spinner { width: 1.75rem; height: 1.75rem; color: var(--accent); margin: 0 auto 1.25rem; }

/* Scorecard */
.report { max-width: 52rem; margin-inline: auto; }
.report-hero { text-align: center; margin-bottom: 2.5rem; }
.report-hero .verdict { display: inline-flex; height: 2rem; padding: 0 0.9rem; font-size: 0.875rem; margin-bottom: 1rem; }
.report-hero .lead { max-width: 38rem; margin: 1rem auto 0; }
.v-strong, .v-hire { background: var(--green-tint); color: var(--green); }
.v-lean { background: var(--accent-tint); color: var(--accent); }
.v-leanno { background: var(--orange-tint); color: var(--orange); }
.v-no { background: var(--red-tint); color: var(--red); }

.scores { display: grid; gap: 0.9rem; }
.score-row { display: grid; grid-template-columns: 7.5rem 1fr 2.5rem; align-items: center; gap: 1rem; }
.score-row .name { font-weight: 500; font-size: 0.9375rem; }
.score-row .bar { height: 0.5rem; border-radius: var(--pill); background: var(--fill-2); overflow: hidden; }
.score-row .bar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--accent); transform-origin: left; }
.score-row .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.score-def { font-size: 0.8125rem; color: var(--text-3); margin-top: -0.5rem; grid-column: 1 / -1; }

.report-section { margin-top: 2.25rem; }
.report-section > h2 { margin-bottom: 1rem; }
.list-clean { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.good li { display: flex; gap: 0.7rem; }
.good svg { flex: none; width: 1.25rem; height: 1.25rem; color: var(--green); margin-top: 0.15rem; }
.fix-item .issue { font-weight: 600; }
.fix-item .evidence { color: var(--text-2); font-size: 0.9375rem; margin: 0.35rem 0 0.6rem; }
.fix-item .better { font-size: 0.9375rem; background: var(--green-tint); border-radius: var(--r-sm); padding: 0.6rem 0.8rem; }
.fix-item .better b { font-weight: 600; }

.path { list-style: none; padding: 0; margin: 0; }
.path li { display: grid; grid-template-columns: 1.75rem 1fr; gap: 0.75rem; padding: 0.85rem 0; border-bottom: 1px solid var(--hairline); }
.path li:last-child { border-bottom: 0; }
.path .dot { width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; margin-top: 0.05rem; }
.path .dot svg { width: 0.85rem; height: 0.85rem; }
.path .done .dot { background: var(--green-tint); color: var(--green); }
.path .partial .dot { background: var(--orange-tint); color: var(--orange); }
.path .missed .dot { background: var(--red-tint); color: var(--red); }
.path .step { font-weight: 600; }
.path .note { color: var(--text-2); font-size: 0.9375rem; }
.path .status { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.01em; margin-left: 0.4rem; }
.path .done .status { color: var(--green); }
.path .partial .status { color: var(--orange); }
.path .missed .status { color: var(--red); }

.model-close { font-size: 1.0625rem; line-height: 1.55; border-left: 3px solid var(--accent); padding: 0.25rem 0 0.25rem 1.1rem; margin: 0; }
.report-actions { margin-top: 2.5rem; display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.transcript .msg { max-width: 100%; }
.transcript { display: flex; flex-direction: column; gap: 0.35rem; }

/* History */
.history { display: grid; gap: 0.6rem; }
.history-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem; padding: 1rem 1.25rem; }
.history-item .t { font-weight: 600; }
.history-item .s { color: var(--text-2); font-size: 0.875rem; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--text-2); }

/* Early access */
.pro-list { list-style: none; padding: 0; margin: 1.25rem 0 1.5rem; display: grid; gap: 0.6rem; }
.pro-list li { display: flex; gap: 0.6rem; }
.pro-list svg { flex: none; width: 1.2rem; height: 1.2rem; color: var(--accent); margin-top: 0.15rem; }
.pro-price { font-family: var(--font-display); font-size: 2.25rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; margin-top: 1rem; }
.pro-price small { font-size: 1rem; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.skeleton { background: var(--fill); border-radius: var(--r-lg); min-height: 13rem; }
