:root {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #283c35;
  background: #f7f8f4;
  font-size: 14px;
  --green: #375e4b;
  --line: #dfe5dc;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
textarea,
input {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green);
  padding: 10px 16px;
  border-radius: 8px;
}
button:hover {
  background: #eef2e9;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #bc9b58;
  outline-offset: 3px;
}
textarea:focus,
input:focus {
  outline: 2px solid #7b9b84;
}
button.active,
#send,
#confirmCategory {
  background: var(--green);
  color: #fff;
}
.layout {
  display: grid;
  grid-template-columns: 20% 80%;
  min-height: 100vh;
}
aside {
  padding: 32px 24px;
  background: #eaf0e6;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.brand {
  text-decoration: none;
  color: #283c35;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 3px;
}
.brand span {
  font-size: 10px;
  letter-spacing: 1px;
  margin-left: 8px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: #6d8271;
}
.brand + .eyebrow {
  margin-top: 55px;
}
h1 {
  font-size: 23px;
  line-height: 1.65;
  font-weight: 500;
  margin: 10px 0 16px;
}
h2 {
  font-weight: 500;
  font-size: 25px;
  margin: 10px 0;
}
h3 {
  font-size: 17px;
  font-weight: 500;
}
.muted {
  color: #748075;
  line-height: 1.9;
}
.muted,
aside p {
  font-size: 12px;
}
nav {
  display: grid;
  gap: 9px;
  margin: 32px 0;
}
nav button {
  text-align: left;
  background: transparent;
  border: 0;
  padding: 15px 13px;
}
#progress {
  display: grid;
  gap: 11px;
  font-size: 11px;
  color: #6b7d6b;
}
.progressrow {
  display: flex;
  justify-content: space-between;
}
.sidebottom {
  margin-top: auto;
  padding-top: 40px;
}
.sidebottom button {
  font-size: 11px;
  padding: 7px;
  background: transparent;
  border: none;
}
.sidebottom p {
  font-size: 10px;
  line-height: 1.8;
  color: #7a8777;
}
main {
  padding: 34px 5vw 50px;
  max-width: 1500px;
  width: 100%;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
#status {
  font-size: 11px;
  color: #718370;
  background: #edf1e8;
  border-radius: 20px;
  padding: 9px 13px;
  max-width: 40%;
}
.uploadbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f0f1e9;
  padding: 20px 24px;
  border-radius: 12px;
  margin-bottom: 22px;
}
.uploadbar strong {
  font-size: 13px;
  font-weight: 500;
}
.uploadbar p {
  color: #87917f;
  font-size: 11px;
  margin-bottom: 0;
}
.uploadbar button {
  background: transparent;
  font-size: 12px;
  white-space: nowrap;
}
.conversation {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.chathead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid #eef0eb;
  font-size: 12px;
}
.chathead button {
  border: none;
  font-size: 11px;
  color: #7f897e;
}
#chat {
  height: 42vh;
  min-height: 280px;
  overflow: auto;
  padding: 28px 24px;
  scroll-behavior: smooth;
}
.bubble {
  margin-bottom: 24px;
  max-width: 85%;
  white-space: pre-wrap;
  line-height: 1.9;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.bubble .speaker {
  font-size: 10px;
  color: #91a18c;
  display: block;
  margin-bottom: 7px;
}
.bubble.user {
  margin-left: auto;
  background: #eef3e9;
  padding: 13px 18px;
  border-radius: 12px 12px 2px 12px;
}
.bubble.assistant {
  padding-right: 15px;
}
.reviewlink {
  display: block;
  margin-top: 14px;
  background: #f7f8f3;
  font-size: 12px;
}
#composer {
  border-top: 1px solid #edf0e9;
  padding: 20px 24px;
}
label {
  font-size: 11px;
  color: #7b8c77;
}
textarea {
  display: block;
  width: 100%;
  border: 0;
  resize: vertical;
  background: transparent;
  color: #354a3b;
  line-height: 1.8;
  margin: 10px 0;
  padding: 6px;
}
textarea::placeholder {
  color: #adb6a7;
  font-size: 12px;
}
.composefoot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.composefoot > span {
  font-size: 10px;
  color: #9ba592;
}
.composefoot button {
  font-size: 12px;
}
.sectionhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card {
  padding: 22px 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 15px 0;
}
.cardtop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.tag {
  font-size: 10px;
  background: #eff2e8;
  padding: 5px 9px;
  border-radius: 15px;
  color: #7a846e;
}
.record {
  padding: 13px 0;
  border-bottom: 1px solid #eef0e9;
  line-height: 1.8;
}
.record strong {
  font-size: 12px;
  font-weight: 500;
  color: #73816f;
  display: block;
}
.value {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
details {
  font-size: 11px;
  color: #7a8674;
  margin-top: 9px;
}
blockquote {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-left: 2px solid #d4ddcb;
  margin: 10px 0;
  padding: 4px 12px;
}
#feedback {
  font-size: 12px;
  color: #8c632d;
  line-height: 1.8;
  margin: 10px 0;
  white-space: pre-wrap;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  max-width: 650px;
  width: 92%;
  max-height: 85vh;
  padding: 28px;
  color: #283c35;
}
dialog::backdrop {
  background: #263b3555;
}

/* 清单修复：连接、进度、长消息与窄屏操作。 */
#status[data-state="connected"] { background: #e5f3e8; color: #245b39; }
#status[data-state="disconnected"] { background: #f3eedf; color: #70551e; }
#status[data-state="error"] { background: #fbe9e7; color: #90382e; }
.progressrow > span:first-child::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #a2aaa4; }
.progressrow[data-state="confirmed"] > span:first-child::before { background: #357b54; }
.progressrow[data-state="pending"] > span:first-child::before { background: #b58a32; }
.long-message summary { cursor: pointer; }
.long-message[open] summary { margin-bottom: 16px; }
.empty-actions { display: flex; gap: 12px; flex-wrap: wrap; padding: 16px; }
#latest:not([hidden]) { position: fixed; bottom: 200px; right: 36px; z-index: 5; background: #fff; box-shadow: 0 2px 12px #0002; }
nav button { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
dialog { overflow-y: auto; scroll-padding-bottom: 100px; }
.modalfoot { z-index: 2; padding-bottom: 16px; flex-wrap: wrap; }
@media (max-width: 600px) { #latest:not([hidden]) { right: 16px; bottom: 220px; } .composefoot { flex-wrap: wrap; } }
.modalhead,
.modalfoot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.modalfoot {
  position: sticky;
  bottom: -28px;
  background: #fff;
  padding: 20px 0 0;
}
.editrow {
  margin: 18px 0;
}
.editrow textarea {
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 8px;
  min-height: 65px;
}
.editrow label {
  font-size: 12px;
}
pre.reporttext {
  white-space: pre-wrap;
  font: inherit;
  line-height: 2;
  overflow-wrap: anywhere;
}
.deferred {
  font-size: 11px;
  color: #94794c;
  margin-top: 10px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 800px) {
  .layout {
    grid-template-columns: 1fr;
  }
  aside {
    padding: 18px 20px;
  }
  aside h1,
  aside > .muted,
  .brand + .eyebrow,
  .sidebottom p {
    display: none;
  }
  nav {
    display: flex;
    overflow: auto;
    margin: 16px 0;
  }
  nav button {
    white-space: nowrap;
    font-size: 11px;
    padding: 10px;
  }
  .sidebottom {
    padding: 0;
    margin: 0;
  }
  #progress {
    grid-template-columns: 1fr 1fr;
    font-size: 10px;
  }
  main {
    padding: 23px 18px;
  }
  header {
    gap: 10px;
  }
  h2 {
    font-size: 21px;
  }
  .uploadbar {
    padding: 16px;
    gap: 10px;
  }
  .uploadbar strong {
    font-size: 11px;
  }
  #chat {
    height: 42vh;
  }
  .composefoot {
    align-items: flex-end;
  }
  .composefoot > span {
    max-width: 45%;
  }
  .sectionhead {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* 左右独立滚动；右侧随消息数量延展，不再把历史关在固定高度里。 */
@media (min-width: 801px) {
  body {
    height: 100dvh;
    overflow: hidden;
  }
  .layout {
    height: 100dvh;
    min-height: 0;
  }
  aside {
    height: 100dvh;
    overflow: auto;
  }
  main {
    height: 100dvh;
    min-height: 0;
    display: block;
    padding: 20px 3vw;
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-gutter: stable;
  }
  header {
    margin-bottom: 12px;
  }
  header h2 {
    font-size: 23px;
    margin: 7px 0;
  }
  #feedback:empty {
    display: none;
  }
  #feedback {
    margin: 0 0 8px;
  }
  main > section:not(#chatView) {
    overflow: visible;
  }
  #chatView {
    display: block;
    min-height: 0;
  }
  .uploadbar {
    min-height: 70px;
    margin: 0 0 12px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    text-align: left;
    padding: 12px 20px;
  }
  .uploadbar strong {
    font-size: 14px;
  }
  .uploadbar p {
    font-size: 11px;
    line-height: 1.6;
    margin: 5px 0 0;
  }
  .uploadbar button {
    background: #fff;
    padding: 10px 20px;
    flex-shrink: 0;
  }
  .conversation {
    min-height: calc(100dvh - 200px);
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  .chathead {
    flex: none;
    padding: 8px 20px;
    min-height: 42px;
  }
  .chathead > div:last-child {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  #chat {
    height: auto;
    min-height: 300px;
    flex: 1;
    overflow: visible;
    padding: 18px 24px;
    scroll-behavior: auto;
  }
  #composer {
    flex: none;
    position: sticky;
    bottom: -20px;
    z-index: 2;
    background: white;
    border-radius: 0 0 14px 14px;
    padding: 10px 18px;
  }
  #composer > label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  #message {
    height: calc(5.4em + 18px);
    min-height: calc(5.4em + 18px);
    max-height: max(calc(5.4em + 18px), 40dvh);
    margin: 0 0 5px;
    padding: 4px;
    resize: vertical;
  }
  .composefoot {
    gap: 8px;
  }
  .composefoot button {
    padding: 8px 15px;
  }
  .bubble {
    margin-bottom: 18px;
    max-width: 88%;
    font-size: 14px;
    line-height: 1.8;
  }
  .bubble.user {
    padding: 10px 16px;
  }
  .bubble .speaker {
    margin-bottom: 4px;
  }
}
.connection {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  max-width: 45%;
}
#status {
  max-width: none;
  line-height: 1.6;
}
.connection button {
  white-space: nowrap;
  font-size: 11px;
  padding: 8px 12px;
}
#apiKey {
  display: block;
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}
#connectionFeedback {
  color: #8c632d;
  font-size: 12px;
  line-height: 1.8;
}
@media (max-width: 800px) {
  body {
    height: 100dvh;
    overflow: hidden;
  }
  .layout {
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  aside {
    flex: none;
    padding: 10px 14px;
  }
  .brand {
    font-size: 19px;
  }
  aside > p,
  aside > h1,
  #progress,
  .sidebottom p {
    display: none;
  }
  nav {
    margin: 8px 0 2px;
    gap: 5px;
  }
  nav button {
    padding: 8px 10px;
  }
  .sidebottom {
    padding: 0;
  }
  .sidebottom button {
    padding: 4px 7px;
    font-size: 10px;
  }
  main {
    flex: 1;
    min-height: 0;
    display: block;
    padding: 10px 12px 12px;
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-gutter: stable;
  }
  header {
    margin: 0 0 8px;
    align-items: center;
  }
  header h2 {
    font-size: 17px;
    margin: 4px 0;
  }
  header .eyebrow {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .connection {
    max-width: 48%;
    gap: 5px;
    flex-wrap: wrap;
  }
  #status {
    font-size: 9px;
    padding: 5px 8px;
  }
  .connection button {
    padding: 5px 8px;
  }
  #feedback:empty {
    display: none;
  }
  #feedback {
    font-size: 11px;
    margin: 0 0 6px;
  }
  main > section:not(#chatView) {
    overflow: visible;
  }
  #chatView {
    display: block;
  }
  .uploadbar {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    margin: 0 0 8px;
    padding: 10px 12px;
    gap: 10px;
  }
  .uploadbar strong {
    font-size: 12px;
  }
  .uploadbar p {
    font-size: 9px;
    line-height: 1.5;
    margin: 4px 0 0;
  }
  .uploadbar button {
    font-size: 10px;
    padding: 8px 10px;
    flex-shrink: 0;
  }
  .conversation {
    min-height: calc(100dvh - 300px);
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  .chathead {
    flex: none;
    min-height: 36px;
    padding: 5px 10px;
    font-size: 11px;
  }
  .chathead > div:last-child {
    display: flex;
    gap: 4px;
  }
  .chathead button {
    font-size: 9px;
    padding: 5px;
  }
  #chat {
    height: auto;
    min-height: 250px;
    flex: 1;
    padding: 12px;
    overflow: visible;
  }
  .bubble {
    max-width: 95%;
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.8;
  }
  #composer {
    position: sticky;
    bottom: -12px;
    z-index: 2;
    background: white;
    flex: none;
    padding: 8px 10px;
    border-radius: 0 0 14px 14px;
  }
  #composer > label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  #message {
    height: calc(5.4em + 18px);
    min-height: calc(5.4em + 18px);
    max-height: max(calc(5.4em + 18px), 40dvh);
    margin: 0 0 4px;
    padding: 3px;
    font-size: 14px;
  }
  .composefoot {
    align-items: center;
  }
  .composefoot > span {
    max-width: 55%;
    font-size: 9px;
  }
  .composefoot button {
    font-size: 11px;
    padding: 7px 10px;
  }
}

.library-tabs {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}
.library-tabs button[aria-pressed="true"] {
  background: var(--green);
  color: white;
}
.card > button {
  margin-top: 12px;
}
#libraryView {
  overflow: auto;
}
#reportView {
  padding-top: 12px;
}

/* 右侧用户气泡已能区分身份，不重复占用一行标签。 */
.bubble.user .speaker {
  display: none;
}

#libraryView {
  overflow: visible;
}
#delivery {
  max-width: 95%;
  padding: 14px 18px;
  border-radius: 10px;
  background: #f4f6f0;
  border: 1px solid #dfe5dc;
  white-space: normal;
}
#delivery[data-kind="error"] {
  background: #fff8ee;
  border-color: #e8d4b2;
}
#delivery p {
  margin: 5px 0;
  white-space: pre-wrap;
}
#delivery button {
  margin: 8px 8px 0 0;
  font-size: 12px;
}
.delivery-label {
  font-size: 11px;
  color: #7a8674;
}
main::-webkit-scrollbar {
  width: 12px;
}
main::-webkit-scrollbar-thumb {
  background: #aeb9ac;
  border: 3px solid #f7f8f4;
  border-radius: 8px;
}
main::-webkit-scrollbar-track {
  background: #f0f2ed;
}

/* 至少显示三行完整输入，按内容自动增长，长文仍可滚动和手动拉高。 */
#message {
  font-size: 16px;
  line-height: 1.8;
  padding: 8px 12px;
  box-sizing: border-box;
  resize: vertical;
  width: 100%;
  overflow-y: auto;
}

.round-notice {
  padding: 12px 18px;
  background: #f3f5eb;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.8;
}
.round-notice > div {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.round-notice button {
  font-size: 12px;
  padding: 7px 12px;
}

.extraction-summary { margin: 0 0 18px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.extraction-summary p { margin: 8px 0; }
.extraction-categories { display: flex; flex-wrap: wrap; gap: 8px; }
.extraction-categories button { padding: 9px 12px; font-size: 12px; }
.confirmed-facts { padding: 14px; background: #f4f6f0; border-radius: 10px; }
.confirmed-facts summary { cursor: pointer; }

.metric-form { margin: 12px 0 8px; padding: 12px; background: #f4f6f0; border: 1px solid var(--line); border-radius: 10px; white-space: normal; }
.metric-form table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.metric-form caption { text-align: left; font-weight: 600; margin-bottom: 8px; }
.metric-label, .metric-value { text-align: left; padding: 6px; border-bottom: 1px solid var(--line); }
.metric-label { width: 42%; font-weight: 500; }
.metric-form input, .metric-form select { box-sizing: border-box; width: 100%; min-width: 0; font: inherit; padding: 6px; }
.metric-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.metric-feedback { color: #874d20; }
.metric-result { font-weight: 600; }
.timeline-check {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: normal;
}
.timeline-check p { margin: 6px 0; }

.library-section { margin-bottom: 16px; }
.library-entry { padding: 14px 0; border-top: 1px solid var(--line); }
.library-entry h4 { margin: 0 0 8px; font-size: 15px; }
.library-facts { margin: 0; }
.library-facts > div {
  display: grid;
  grid-template-columns: minmax(7rem, 0.27fr) minmax(0, 1fr);
  gap: 4px 12px;
  padding: 4px 0;
  overflow-wrap: anywhere;
}
.library-facts dt { color: var(--green); }
.library-facts dd { margin: 0; }
@media (max-width: 520px) {
  .library-facts > div { grid-template-columns: minmax(0, 1fr); }
}

#interviewCloseDialog, #interviewProgressDialog, #interviewFeedbackDialog {
  box-sizing: border-box;
  max-width: 520px;
  padding: clamp(16px, 4vw, 28px);
}
#interviewCloseTitle, #interviewProgressTitle, #interviewFeedbackTitle {
  margin: 0;
  font-size: 22px;
}
#interviewProgressList { margin: 14px 0 18px; }
#interviewProgressList > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
#interviewProgressList dd { margin: 0; }
.interview-summary { margin: 12px 0 0; }
.interview-actions, .interview-tags { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.interview-actions { margin-top: 12px; }
.interview-text-button {
  margin-top: 8px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#interviewFeedbackReceipt { color: var(--green); font-weight: 600; }
.interview-feedback-status:empty { display: none; }
.interview-tags button { padding: 5px 9px; font-size: 12px; }
.interview-tags button[aria-pressed="true"] { border-color: currentColor; background: #e6eee3; }

/* 桌面端按五列紧凑排列，移动端改为纵向字段，避免横向滚动。 */
.metric-form { max-width: 920px; }
.metric-form table { display: block; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px 10px;
}
.metric-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.metric-label, .metric-value {
  width: auto;
  padding: 5px 7px;
  border: 0;
}
.metric-label { padding-bottom: 0; font-size: 12px; }
.metric-value { padding-top: 2px; }
.metric-value:has(select):has(input[type="number"]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
}
.metric-form input, .metric-form select { padding: 5px; font-size: 13px; }
.metric-form > p.muted { font-size: 11px; line-height: 1.5; }
@media (max-width: 800px) {
  .metric-form { max-width: none; }
  .metric-grid { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .metric-field { display: grid; grid-template-columns: minmax(96px, 0.7fr) minmax(0, 1.3fr); align-items: center; }
  .metric-label, .metric-value { padding: 8px; }
  .metric-value:has(select):has(input[type="number"]) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.backup-notice { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 8px; background: #f0f3ec; color: #617364; }
.backup-notice p { flex: 1; margin: 0; font-size: 13px; line-height: 1.6; }
.backup-notice button { flex: 0 0 auto; width: auto; padding: 6px 10px; font-size: 13px; }
@media (max-width: 600px) { .backup-notice { flex-wrap: wrap; gap: 8px; } .backup-notice p { flex-basis: 100%; } }

.metric-title { display: block; width: 100%; margin: 0 0 14px; font-size: 15px; line-height: 1.6; writing-mode: horizontal-tb; overflow-wrap: break-word; }
.metric-field[hidden] { display: none; }
.metric-label, .metric-value { display: block; min-width: 0; }
#items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.review-category {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid #dce4db;
  border-radius: 14px;
  background: #f0f3ef;
}
.review-category[data-state="complete"] {
  color: #143d2b;
  background: #c8e8d3;
  border-color: #a3ceb1;
}
.review-category[data-state="pending"] { background: #e1efe4; border-color: #c6dfcb; }
.review-category:focus-within, .review-category:hover { border-color: #688c76; }
.review-category h3 { margin: 0; padding-right: 76px; }
.review-category h4 { margin: 4px 0 0; font-size: 13px; }
.review-category .review-category-open {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  font-weight: 650;
  text-align: left;
}
.review-category-open::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.review-category-status {
  position: absolute;
  top: 18px;
  right: 20px;
  padding: 3px 9px;
  border-radius: 12px;
  background: #ffffffa8;
  font-size: 12px;
  font-weight: 600;
}
.review-category-facts { display: grid; gap: 6px; margin: 0; }
.review-category-facts > div { display: grid; grid-template-columns: minmax(65px, 1fr) minmax(0, 2fr); gap: 10px; }
.review-category-facts dt { color: #405d4d; }
.review-category-facts dd { margin: 0; }
.review-category-facts dt, .review-category-facts dd, .review-category-note { overflow-wrap: anywhere; }
.review-category-facts dd { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.review-category-note { margin: 0; font-size: 13px; color: #405d4d; }
.review-category-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  color: #315640;
  font-size: 13px;
}
.review-category-actions > span { margin-right: auto; }
.review-category-actions button { position: relative; padding: 6px 10px; }
.review-history-message { border-top: 1px solid var(--line); padding: 12px 0; }
.review-history-message p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
#reviewConversationActions:empty { display: none; }
@media (max-width: 720px) {
  #items { grid-template-columns: minmax(0, 1fr); }
}
#reviewPoints { max-width: 760px; }
.review-point-toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.review-point { padding: 13px 0; border-bottom: 1px solid var(--line); }
.review-point-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-point-head h4 { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.review-point-head button, .review-point-editor button { padding: 6px 10px; }
.review-point-alert { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #a92e37; color: #fff; font-size: 12px; font-weight: 700; }
.review-point-value { margin: 6px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.review-point-editor:not([hidden]) { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 8px; }
.review-point-editor textarea { width: 100%; min-height: 60px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; }
.review-point-error { margin: 0; color: #a92e37; }
.review-point-error:empty, #reviewPointsFeedback:empty { display: none; }
#saveReviewPoints { margin-left: auto; background: var(--green); color: #fff; }
.review-topic-list { margin: 0; padding-left: 20px; display: grid; gap: 5px; overflow-wrap: anywhere; }
.review-detail-subject { margin: 20px 0 4px; font-weight: 650; color: #315640; }
#reviewPoints,
#reviewConversation {
  padding: 0;
  overflow: hidden;
  max-height: min(85vh, 85dvh);
}
#reviewPoints[open],
#reviewConversation[open] {
  display: flex;
  flex-direction: column;
}
#reviewPoints > .modalhead,
#reviewConversation > .modalhead {
  flex: 0 0 auto;
  padding: 10px 12px 10px 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.review-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 28px 12px;
}
#reviewPoints > .modalfoot,
#reviewConversation > .modalfoot {
  position: static;
  flex: 0 0 auto;
  padding: 10px 12px 10px 28px;
  border-top: 1px solid var(--line);
}
#reviewPoints > .modalhead h2,
#reviewConversation > .modalhead h2 {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
#reviewPoints .review-point-toolbar {
  flex: 0 0 auto;
}
#closeReviewPoints,
#closeReviewConversation {
  min-height: 44px;
  padding: 7px 10px;
  border-color: #9db2a4;
  background: #eff4ee;
  color: #244b36;
  font-weight: 600;
  white-space: nowrap;
}
#closeReviewPoints:hover,
#closeReviewConversation:hover {
  background: #dceade;
}
@media (max-width: 540px) {
  #reviewPoints > .modalhead,
  #reviewConversation > .modalhead { padding-left: 12px; gap: 8px; }
  #reviewPoints > .modalhead h2,
  #reviewConversation > .modalhead h2 { font-size: 18px; }
  #reviewPoints .review-point-toolbar { gap: 4px; }
  #viewReviewTranscript { padding: 6px 8px; }
}
.resume-entry-heading { line-height: 1.55; overflow-wrap: anywhere; }
.resume-entry-paragraph { margin: 8px 0 0; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.library-toolbar {
  align-items: center;
  margin-bottom: 14px;
}
@media (max-width: 480px) {
  .library-toolbar { gap: 6px; }
  .library-toolbar button { padding-inline: 9px; white-space: nowrap; }
}
.library-resume-original { margin: 10px 0; padding: 10px 14px; border-left: 3px solid #b2c7b8; background: #f5f7f3; }
.library-resume-original h5 { margin: 0 0 6px; font-weight: 650; font-size: inherit; }
.library-resume-original p { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.nancy-opening { white-space: normal; }
.nancy-opening p { margin: 0 0 12px; }
.nancy-opening p:last-child { margin-bottom: 0; font-weight: 600; }
.nancy-choices { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.nancy-choices button { flex: 1 1 170px; text-align: left; font-weight: 600; }
.nancy-choices small { display: block; margin-top: 4px; font-weight: 400; color: #516b5b; }
#openNancyAbout { padding: 3px 6px; border-color: transparent; color: var(--green); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.nancy-bio { margin: 14px 0 0; }
.nancy-bio dt { font-weight: 650; margin-top: 12px; }
.nancy-bio dd { margin: 4px 0 0; line-height: 1.65; }
.test-account-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.test-account-bar button { padding: 4px 8px; font-size: 12px; }
#testAccountName { font-size: 12px; color: #405f4d; }
#testAccountCode { display: block; width: 100%; margin-top: 5px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; }
#testAccountError { color: #a92e37; }
.nancy-career { margin: 24px 0 0; color: #254435; }
.nancy-career summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.nancy-career[open] summary { margin-bottom: 12px; }
#sessionClock { font-size: 12px; white-space: normal; }
.nancy-career h1 { margin: 0 0 10px; font-weight: 650; font-size: 20px; line-height: 1.25; }
.nancy-career h1 span { font-size: 13px; font-weight: 500; }
.nancy-career-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.nancy-career-stats > div { padding: 7px 8px; background: #f2f6ef; border: 1px solid #cddbcf; border-radius: 7px; }
.nancy-career-stats strong, .nancy-career-stats span { display: block; overflow-wrap: anywhere; }
.nancy-career-stats strong { color: #234a39; font-size: 15px; }
.nancy-career-stats span { font-size: 11px; }
.nancy-career ul { margin: 12px 0 0; padding-left: 16px; font-size: 12px; line-height: 1.6; }
.nancy-career li + li { margin-top: 4px; }
.nancy-hero { display: grid; grid-template-columns: minmax(112px, 150px) minmax(0, 1fr); gap: 20px; align-items: start; margin: 0 0 18px; padding: 20px; background: #fbf6e9; border: 1px solid #e6d8ba; border-radius: 18px; }
.nancy-portrait { display: grid; place-items: center; aspect-ratio: 1; padding: 4px; background: #f7f0df; border: 1px solid #c6b48e; border-radius: 18px; box-shadow: 3px 4px #e9ddc5; }
.nancy-portrait img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 13px; }
.nancy-dialogue { position: relative; padding: 14px 16px; background: #fffdf7; border: 1px solid #dbcbaa; border-radius: 5px 15px 15px 15px; }
.nancy-dialogue h3 { margin: 0 0 6px; color: #253e34; font-size: 20px; font-weight: 700; }
.nancy-dialogue p { margin: 6px 0; line-height: 1.65; }
.nancy-dialogue .nancy-privacy { margin-bottom: 0; color: #52634f; font-size: 12px; }
.nancy-role-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; list-style: none; padding: 0; margin: 13px 0 0; }
.nancy-role-flow li { position: relative; min-width: 0; padding: 8px 10px; border: 1px solid #aabea5; border-radius: 8px 11px 7px 9px; background: #eaf2e3; }
.nancy-role-flow li:nth-child(2) { background: #edf2f9; border-color: #a5b7cf; }
.nancy-role-flow li:nth-child(3) { background: #f8eee6; border-color: #d6ad91; }
.nancy-role-flow li:not(:last-child)::after { content: "→"; position: absolute; right: -15px; top: 25%; color: #654d36; }
.nancy-flow-mark { margin-right: 5px; color: #4d664f; font-size: 11px; }
.nancy-role-flow small { display: block; margin-top: 3px; line-height: 1.4; }
#testServerLink:not([hidden]) { display: inline-block; margin: 0 12px 12px 0; }
@media (max-width: 800px) {
  .nancy-career { display: none; }
  .nancy-hero { grid-template-columns: 82px minmax(0, 1fr); gap: 10px; padding: 10px; }
  .nancy-dialogue { padding: 9px; }
  .nancy-dialogue h3 { font-size: 16px; }
  .nancy-role-flow { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .nancy-role-flow li:not(:last-child)::after { content: none; }
}
.nancy-flow-section { margin-top: 12px; }
.nancy-flow-section h4 { margin: 0; color: #2e503c; font-size: 16px; }
.nancy-flow-section > p { margin: 4px 0; }
.nancy-role-flow li.nancy-flow-ability { background: #d8eadb; border: 2px solid #497560; padding: 7px 9px; }
.nancy-role-flow li:nth-child(4) { background: #f0edf7; border-color: #c1b3d4; }
.nancy-flow-tagline { color: #704d30; font-weight: 650; }
@media (max-width: 1100px) { .nancy-role-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nancy-role-flow li:not(:last-child)::after { content: none; } }
@media (max-width: 540px) { .nancy-role-flow { grid-template-columns: minmax(0, 1fr); } }
#voiceInput[aria-pressed="true"] { background: #f5e5dd; border-color: #c89279; color: #773e2d; }
#voiceHelp, #voiceStatus { display: block; font-size: 12px; color: #536958; }
#voiceStatus { margin: 4px 0 0; }
#voiceStatus:empty { display: none; }
.has-material .nancy-hero { display: none; }
@media (max-width: 540px) {
  .nancy-hero { grid-template-columns: minmax(0, 1fr); }
  .nancy-hero .nancy-portrait { display: none; }
}

.chat-timer-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
#sessionClock { display:inline-flex; align-items:center; justify-content:center; min-width:84px; padding:8px 12px; border:1px solid #c5d7cc; border-radius:9px; background:#eef5ef; color:#254c39; font-size:22px; font-weight:700; font-variant-numeric:tabular-nums; letter-spacing:1px; line-height:1.2; }
#sessionClock[data-state="paused"] { background:#fff4df; border-color:#dbba76; color:#79551f; }
.clock-status { font-size:12px; color:#536958; }
.chathead #pauseClock { min-height:42px; padding:9px 16px; border:1px solid #2e5943; border-radius:9px; background:#355f49; color:#fff; font-size:14px; font-weight:600; cursor:pointer; }
.chathead #pauseClock:hover:not(:disabled) { background:#244b37; }
.chathead #pauseClock[aria-pressed="true"] { background:#fff4df; border-color:#ae792a; color:#754b12; }
.chathead #pauseClock:disabled { background:#edf0ec; border-color:#ccd4ca; color:#6b7767; cursor:default; }
.chathead #pauseClock:focus-visible { outline:3px solid #b28b47; outline-offset:3px; }
@media(max-width:540px) { .chat-timer-toolbar { gap:7px; } #sessionClock { min-width:76px; font-size:20px; } .chathead #pauseClock { padding:9px 12px; } }
