:root {
  --ink: #1f2933;
  --ink-soft: #344454;
  --muted: #667085;
  --muted-light: #84909d;
  --line: #d9dee5;
  --line-strong: #c9d0d9;
  --blue: #245f9c;
  --blue-deep: #194b7d;
  --blue-soft: #edf4fb;
  --green: #2e7d6e;
  --green-soft: #edf7f4;
  --amber: #a36a17;
  --amber-soft: #fff7e9;
  --red: #ad5048;
  --red-soft: #fff1ef;
  --surface: #fff;
  --surface-soft: #fafafa;
  --page: #f7f7f5;
  --focus: #8fb8e2;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); letter-spacing: -.025em; }
h1 { margin-bottom: 0; font-size: 30px; line-height: 1.25; }
h2 { margin: 0; font-size: 20px; line-height: 1.4; }
h3 { margin: 0; font-size: 15px; line-height: 1.5; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 0 max(24px, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .97);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 260px;
  color: var(--blue-deep);
  font-size: 17px;
  font-weight: 700;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 7px;
  color: #fff;
  background: var(--blue);
  font: 700 20px/1 Georgia, serif;
}
.brand small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; font-weight: 500; }
.primary-nav { display: flex; align-self: stretch; gap: 2px; }
.primary-nav a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 19px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: color .15s, border-color .15s, background .15s;
}
.primary-nav a:hover { color: var(--blue); background: #f8fafc; }
.primary-nav a.active { border-color: var(--blue); color: var(--blue-deep); }
.primary-nav i {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 10px;
  font-style: normal;
}
.header-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.save-status { color: var(--muted); font-size: 12px; }
.save-status::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #7ea7d2; vertical-align: 1px; }
.save-status.saved { color: var(--green); }
.save-status.saved::before { background: var(--green); }
.text-button { padding: 0; border: 0; color: var(--blue); background: transparent; font-size: 13px; font-weight: 700; }
.text-button:hover { color: var(--blue-deep); text-decoration: underline; text-underline-offset: 3px; }

main { width: min(1440px, calc(100% - 48px)); margin: 0 auto; }
.page { padding: 28px 0 64px; }
.page-intro { margin-bottom: 18px; }
.page-intro h1 { margin-bottom: 6px; }
.page-intro p, .page-heading > div > p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.eyebrow { display: none; }

.primary-button, .secondary-button {
  min-height: 40px;
  padding: 8px 15px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  transition: background .15s, border-color .15s, color .15s;
}
.primary-button { border: 1px solid var(--blue); color: #fff; background: var(--blue); }
.primary-button:hover { border-color: var(--blue-deep); background: var(--blue-deep); }
.primary-button:disabled { cursor: wait; opacity: .68; }
.secondary-button { border: 1px solid var(--line-strong); color: var(--ink-soft); background: #fff; }
.secondary-button:hover { border-color: #97aec6; color: var(--blue-deep); background: #f8fafc; }
.compact-button { min-height: 34px; padding: 6px 11px; font-size: 12px; }

.editing-profile-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid #b9cee3;
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  background: #f6f9fc;
}
.editing-profile-banner > div { display: flex; align-items: center; gap: 10px; }
.editing-profile-banner > div > span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-weight: 800; }
.editing-profile-banner p { display: grid; margin: 0; }
.editing-profile-banner strong { color: var(--blue-deep); font-size: 13px; }
.editing-profile-banner small { color: var(--muted); font-size: 11px; }

.workday-overview {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
}
.workday-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-direction: column;
  gap: 10px;
  padding: 15px 16px;
  border-right: 1px solid var(--line);
  background: #fbfbfa;
}
.workday-heading span { color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.workday-heading h2 { display: none; }
.workday-heading .text-button { font-size: 11px; }
.workday-body { display: grid; grid-template-columns: minmax(430px, .92fr) minmax(360px, 1.08fr); }
.workday-stats { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; padding: 0; }
.workday-stats > div { display: grid; align-content: center; justify-items: center; min-width: 0; padding: 14px 8px; }
.workday-stats > div + div { border-left: 1px solid #e7eaee; }
.workday-stats dt { color: var(--muted); font-size: 10px; font-weight: 600; white-space: nowrap; }
.workday-stats dd { margin: 2px 0 0; color: var(--ink); font-size: 22px; font-weight: 700; }
.workday-stats > div:first-child dd { color: var(--red); }
.workday-stats > div:nth-child(3) dd, .workday-stats > div:nth-child(5) dd { color: var(--green); }
.next-work-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 16px;
  border-left: 1px solid var(--line);
  background: #f8fafc;
}
.next-work-item > span { padding: 3px 7px; border-radius: 4px; color: #79521a; background: #fff1d6; font-size: 10px; font-weight: 700; }
.next-work-item strong { display: block; overflow: hidden; color: var(--ink-soft); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.next-work-item p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.workday-clear { display: grid; place-items: center; margin: 0; padding: 16px; border-left: 1px solid var(--line); color: var(--muted); background: #fafafa; font-size: 12px; }
.reminder-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #e3cfa7;
  border-left: 3px solid var(--amber);
  border-radius: 6px;
  background: var(--amber-soft);
}
.reminder-banner > div { display: flex; align-items: center; gap: 10px; }
.reminder-banner > div > span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #7e571d; background: #ffedc9; font-weight: 800; }
.reminder-banner p { display: grid; margin: 0; color: var(--ink-soft); }
.reminder-banner strong { font-size: 13px; }
.reminder-banner small { color: var(--muted); font-size: 11px; }

.analysis-workspace {
  display: grid;
  grid-template-columns: 460px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}
.intake-card { padding: 24px; border-right: 1px solid var(--line); background: #fbfbfa; }
.card-heading, .result-top, .section-mini-heading, .script-box > div, .page-heading, .result-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.card-heading p, .result-top p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.card-heading > span { padding: 4px 8px; border: 1px solid #cedbea; border-radius: 5px; color: var(--blue-deep); background: var(--blue-soft); font-size: 11px; font-weight: 700; }
.form-section { min-width: 0; margin: 20px 0 0; padding: 17px 0 0; border: 0; border-top: 1px solid var(--line); }
.form-section legend { display: flex; align-items: center; gap: 8px; padding: 0 10px 0 0; color: var(--ink-soft); background: #fbfbfa; font-size: 13px; font-weight: 700; }
.form-section legend span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-size: 10px; }
.form-section > label, .field-grid label { display: block; margin: 15px 0 7px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.intake-card label small { color: var(--muted); font-size: 11px; font-weight: 500; }
input, textarea, select { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: #fff; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
input, select { min-height: 42px; padding: 8px 11px; }
textarea { min-height: 108px; padding: 10px 11px; resize: vertical; line-height: 1.7; }
input:focus, textarea:focus, select:focus { border-color: #6f9dc9; box-shadow: 0 0 0 3px #e1edf8; outline: 0; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-grid label { margin-bottom: 0 !important; }
.field-grid select { margin-top: 7px; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; }
.form-footer p { max-width: 190px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }

.result-card { min-width: 0; padding: 26px 28px; }
.result-top { align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.intent-badge { padding: 4px 9px; border: 1px solid #b9d8cd; border-radius: 5px; color: #216b5a; background: var(--green-soft); font-size: 11px; font-weight: 700; }
.intent-badge[data-intent="高意向"] { border-color: #bfd2e7; color: var(--blue-deep); background: var(--blue-soft); }
.intent-badge[data-intent="需了解"] { border-color: #ead5ac; color: #7e571d; background: var(--amber-soft); }
.result-summary { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(250px, .75fr); margin-top: 18px; overflow: hidden; border: 1px solid #cfdce8; border-radius: 7px; background: #f4f8fc; }
.diagnosis, .objective { padding: 17px 18px; }
.diagnosis { border-left: 3px solid #6e9fce; }
.diagnosis span, .section-label, .objective span { color: var(--muted); font-size: 11px; font-weight: 700; }
.diagnosis p { margin: 6px 0 0; color: var(--ink-soft); font-size: 15px; font-weight: 600; line-height: 1.7; }
.objective { display: grid; align-content: center; gap: 6px; border-left: 1px solid #cfdce8; background: #fff; }
.objective strong { color: var(--blue-deep); font-size: 14px; line-height: 1.7; }
.path-section, .support-section { padding: 21px 0; border-bottom: 1px solid var(--line); }
.section-mini-heading { align-items: center; }
.section-mini-heading span { color: var(--muted); font-size: 11px; }
.conversation-path { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 13px 0 0; padding: 0; list-style: none; }
.conversation-path li { min-width: 0; padding: 14px; border: 1px solid #dce2e8; border-radius: 6px; background: #fcfcfb; }
.conversation-path li > span { display: grid; place-items: center; width: 23px; height: 23px; margin-bottom: 9px; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-size: 10px; }
.conversation-path b { color: var(--ink-soft); font-size: 13px; }
.conversation-path p { margin: 6px 0 0; color: #526171; font-size: 13px; line-height: 1.75; }
.avoidance-box { margin-top: 13px; padding: 13px 15px; border: 1px solid #e7d5b4; border-radius: 6px; background: #fffaf2; }
.avoidance-box > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.avoidance-box > div > span { color: #8a744e; font-size: 11px; }
.avoidance-box ul { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 0; padding: 0; list-style: none; }
.avoidance-box li { padding: 6px 9px; border: 1px solid #e8d8bd; border-radius: 4px; color: #6d512d; background: #fff; font-size: 12px; line-height: 1.5; }
.two-column-result { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-top: 17px; }
.two-column-result section + section { padding-left: 20px; border-left: 1px solid var(--line); }
.two-column-result p:not(.section-label) { margin: 6px 0 0; color: #47596a; font-size: 13px; line-height: 1.75; }
.next-step-copy { color: var(--blue-deep) !important; font-weight: 700; }
.script-box { margin-top: 19px; padding: 16px 18px; border: 1px solid #cbded6; border-radius: 6px; background: #f2f8f5; }
.script-box button { padding: 0; border: 0; color: var(--green); background: transparent; font-size: 12px; font-weight: 700; }
.script-box > p { margin: 8px 0 0; color: #334f48; font-size: 14px; line-height: 1.85; }
.result-actions { align-items: center; justify-content: flex-end; margin-top: 17px; }

.page-heading { align-items: flex-end; margin-bottom: 18px; }
.page-heading h1 { margin-bottom: 5px; font-size: 30px; }
.empty-state { display: grid; justify-items: center; padding: 64px 24px; border: 1px dashed var(--line-strong); border-radius: 7px; color: var(--muted); text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 12px; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-size: 17px; }
.empty-state h2 { font-size: 17px; }
.empty-state p { margin: 6px 0 17px; font-size: 13px; }
.compact-empty { margin-bottom: 12px; padding: 40px 24px; }

.funnel-panel { margin-bottom: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.funnel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.funnel-heading > div > span, .detail-section-heading > div > span, .dialog-header > div > span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 700; }
.funnel-heading h2 { font-size: 16px; }
.funnel-heading > p { display: grid; justify-items: end; margin: 0; }
.funnel-heading > p strong { color: var(--blue); font-size: 25px; line-height: 1; }
.funnel-heading > p span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.funnel-steps { display: grid; grid-template-columns: repeat(6, 1fr); margin: 14px 0 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.funnel-steps li { position: relative; display: grid; grid-template-columns: auto auto 1fr; gap: 7px; align-items: center; min-width: 0; padding: 12px 10px 2px; }
.funnel-steps li + li::before { position: absolute; top: 0; left: -1px; width: 1px; height: 100%; background: #e7eaee; content: ""; }
.funnel-steps li > span { color: var(--muted-light); font-size: 9px; }
.funnel-steps li > strong { color: var(--blue-deep); font-size: 19px; }
.funnel-steps p { display: grid; margin: 0; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.funnel-steps small { color: var(--muted-light); font-size: 9px; font-weight: 500; white-space: nowrap; }
.funnel-aside { margin: 10px 0 0; padding-top: 9px; border-top: 1px solid #e7eaee; color: var(--muted); font-size: 10px; }
.funnel-aside strong { color: var(--ink-soft); }
.profile-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) 190px 170px auto; gap: 10px; align-items: end; margin-bottom: 12px; }
.profile-toolbar label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.profile-toolbar input, .profile-toolbar select { min-height: 40px; padding: 7px 10px; font-size: 13px; }
.profile-toolbar > p { margin: 0 0 9px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.profile-list { display: grid; gap: 10px; }
.profile-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.profile-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 6px; color: var(--blue); background: var(--blue-soft); font-weight: 700; }
.profile-content { min-width: 0; }
.profile-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.profile-item h2 { font-size: 17px; }
.profile-meta { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.profile-status-group { display: flex; align-items: end; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.profile-status-group label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }
.profile-status-group select { width: 148px; min-height: 36px; padding: 5px 8px; font-size: 13px; font-weight: 700; }
.profile-status-group select[data-tone="success"] { border-color: #afd2c6; color: #226b5b; background: var(--green-soft); }
.profile-status-group select[data-tone="stopped"] { border-color: #dfc0bd; color: #8b403a; background: #fff7f6; }
.profile-status-group select[data-tone="paused"] { border-color: #e0cda7; color: #7c591f; background: var(--amber-soft); }
.profile-summary-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; margin-top: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fcfcfb; }
.profile-summary-grid section { min-width: 0; padding: 11px 13px; }
.profile-summary-grid section + section { border-left: 1px solid var(--line); }
.profile-summary-grid span { color: var(--muted); font-size: 10px; font-weight: 700; }
.profile-summary-grid p { margin: 4px 0 0; color: #47596a; font-size: 12px; line-height: 1.65; }
.profile-actions { display: flex; align-items: center; gap: 13px; margin-top: 13px; }
.profile-editor, .followup-editor { margin-top: 12px; border-top: 1px solid var(--line); }
.profile-editor summary, .followup-editor summary { width: max-content; padding-top: 11px; color: #4d657c; font-size: 12px; font-weight: 700; cursor: pointer; }
.profile-edit-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 12px 0; }
.profile-edit-grid label, .followup-edit-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.profile-edit-grid input, .profile-edit-grid select, .followup-edit-grid input, .followup-edit-grid select { min-height: 38px; padding: 7px 9px; font-size: 13px; }
.profile-note-field { grid-column: 1 / -1; }
.profile-note-field textarea, .followup-detail-field textarea { font-size: 13px; }

.followup-summary { display: flex; align-items: stretch; margin-bottom: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: #fff; }
.followup-summary > div { display: grid; min-width: 100px; padding: 10px 15px; }
.followup-summary > div + div { border-left: 1px solid var(--line); }
.followup-summary strong { color: var(--ink); font-size: 20px; }
.followup-summary span { font-size: 10px; }
.followup-summary > p { align-self: center; margin: 0 0 0 16px; font-size: 12px; }
.followup-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.followup-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 13px; align-items: start; padding: 16px 18px; border: 1px solid var(--line); border-left: 3px solid #84a9cd; border-radius: 7px; background: #fff; }
.followup-item[data-timing="overdue"] { border-left-color: var(--red); }
.followup-item[data-timing="today"] { border-left-color: var(--amber); }
.followup-item.done, .followup-item.cancelled { border-left-color: #a7b0ba; background: #fafafa; }
.followup-item > input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--blue); }
.followup-content { min-width: 0; }
.followup-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.followup-item h2 { font-size: 14px; line-height: 1.55; }
.followup-item p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.followup-item time { flex: none; color: #506273; font-size: 11px; font-weight: 700; }
.followup-actions, .followup-actions > div { display: flex; align-items: center; gap: 11px; }
.followup-actions { justify-content: space-between; margin-top: 8px; }
.task-status { padding: 3px 7px; border-radius: 4px; color: #48647e; background: #eef3f7; font-size: 10px; font-weight: 700; }
.followup-item[data-timing="overdue"] .task-status { color: #8e413b; background: var(--red-soft); }
.followup-item[data-timing="today"] .task-status { color: #79551d; background: var(--amber-soft); }
.followup-item.done .task-status, .followup-item.cancelled .task-status { color: #68737f; background: #eceff2; }
.followup-edit-grid { display: grid; grid-template-columns: 1fr 180px; gap: 10px; margin: 12px 0; }
.followup-title-field, .followup-detail-field { grid-column: 1 / -1; }

.profile-dialog { width: min(980px, calc(100% - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 8px; color: var(--ink); background: #fff; box-shadow: 0 24px 70px #172b3e38; }
.profile-dialog::backdrop { background: #1b2c3e80; backdrop-filter: blur(2px); }
.dialog-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); background: #fff; }
.dialog-header h1 { font-size: 26px; }
.dialog-close { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: #526171; background: #fff; font-size: 22px; line-height: 1; }
.dialog-close:hover { border-color: #a9b6c3; color: var(--blue); background: #f8fafc; }
.profile-dialog-content { min-width: 0; }
.detail-overview { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); background: #fafafa; }
.detail-overview > div { display: grid; gap: 3px; padding: 14px 22px; }
.detail-overview > div + div { border-left: 1px solid var(--line); }
.detail-overview span { color: var(--muted); font-size: 10px; font-weight: 700; }
.detail-overview strong { color: var(--ink-soft); font-size: 13px; }
.detail-context, .quick-record, .timeline-section { padding: 21px 24px; }
.quick-record, .timeline-section { border-top: 1px solid var(--line); }
.detail-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.detail-section-heading h2 { font-size: 18px; }
.detail-section-heading > p { max-width: 320px; margin: 1px 0 0; color: var(--muted); font-size: 11px; text-align: right; }
.detail-context dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border: 1px solid var(--line); border-radius: 6px; background: #fcfcfb; }
.detail-context dl > div { padding: 12px 14px; }
.detail-context dl > div:nth-child(even) { border-left: 1px solid var(--line); }
.detail-context dl > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
.detail-context dt { color: var(--muted); font-size: 10px; font-weight: 700; }
.detail-context dd { margin: 5px 0 0; color: #47596a; font-size: 12px; line-height: 1.7; }
.next-task-callout { display: flex; align-items: center; gap: 13px; margin: 12px 0 0; padding: 10px 13px; border-left: 3px solid #6f9dc9; background: #f4f8fc; }
.next-task-callout span { color: var(--muted); font-size: 10px; }
.next-task-callout strong { color: var(--blue-deep); font-size: 12px; }
.quick-record form { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.quick-record label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.quick-record .wide-field { grid-column: 1 / -1; }
.quick-record textarea { min-height: 80px; font-size: 12px; }
.quick-record input, .quick-record select { min-height: 40px; font-size: 12px; }
.quick-record button { justify-self: start; }
.profile-timeline { position: relative; margin: 0; padding: 0 0 0 17px; list-style: none; }
.profile-timeline::before { position: absolute; top: 6px; bottom: 8px; left: 5px; width: 1px; background: var(--line); content: ""; }
.profile-timeline li { position: relative; display: grid; grid-template-columns: 145px 1fr; gap: 17px; padding: 0 0 17px 15px; }
.profile-timeline li::before { position: absolute; top: 5px; left: -17px; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: #7f9db8; box-shadow: 0 0 0 1px #aebdca; content: ""; }
.profile-timeline li[data-event-type="communication"]::before { background: var(--blue); }
.profile-timeline li[data-event-type="stage"]::before { background: var(--amber); }
.profile-timeline li[data-event-type="followup-change"]::before { background: #5d768c; }
.profile-timeline time { color: var(--muted-light); font-size: 10px; }
.profile-timeline strong { color: var(--ink-soft); font-size: 12px; }
.profile-timeline p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.profile-timeline small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: 340px; padding: 11px 14px; border-radius: 6px; transform: translateY(16px); opacity: 0; color: #fff; background: #283f55; box-shadow: 0 12px 30px #102b5430; transition: .2s; font-size: 12px; pointer-events: none; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 1100px) {
  .app-header { padding: 0 24px; }
  .brand { min-width: 220px; }
  .analysis-workspace { grid-template-columns: 410px minmax(0, 1fr); }
  .result-card { padding: 24px; }
  .result-summary { grid-template-columns: 1fr; }
  .objective { border-top: 1px solid #cfdce8; border-left: 0; }
  .conversation-path { grid-template-columns: 1fr; }
  .conversation-path li { display: grid; grid-template-columns: 25px 1fr; gap: 9px; }
  .conversation-path li > span { margin: 0; }
  .conversation-path p { grid-column: 2; }
  .conversation-path b { align-self: end; }
  .workday-overview { grid-template-columns: 120px minmax(0, 1fr); }
  .workday-body { grid-template-columns: 1fr; }
  .next-work-item, .workday-clear { border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 900px) {
  .brand { min-width: auto; }
  .primary-nav { margin-left: 24px; }
  .analysis-workspace { grid-template-columns: 1fr; }
  .intake-card { border-right: 0; border-bottom: 1px solid var(--line); }
  .result-summary { grid-template-columns: minmax(0, 1.2fr) minmax(230px, .8fr); }
  .objective { border-top: 0; border-left: 1px solid #cfdce8; }
  .funnel-steps { grid-template-columns: repeat(3, 1fr); }
  .funnel-steps li:nth-child(4) { border-top: 1px solid var(--line); }
  .profile-toolbar { grid-template-columns: 1fr 1fr; }
  .profile-toolbar .search-field { grid-column: 1 / -1; }
  .profile-toolbar > p { margin: 0 0 8px; }
  .profile-summary-grid { grid-template-columns: 1fr 1fr; }
  .profile-summary-grid section:last-child { grid-column: 1 / -1; border-top: 1px solid var(--line); border-left: 0; }
  .detail-overview { grid-template-columns: 1fr 1fr; }
  .detail-overview > div:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
  .detail-overview > div:nth-child(4) { border-top: 1px solid var(--line); }
  .profile-dialog { max-height: calc(100vh - 24px); }
}

@media (max-width: 620px) {
  .app-header { min-height: 62px; padding: 0 14px; }
  .brand { font-size: 15px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand small, .save-status { display: none; }
  .primary-nav { margin-left: auto; gap: 0; }
  .primary-nav a { padding: 0 8px; font-size: 12px; }
  .primary-nav i { display: none; }
  .header-actions { margin-left: 8px; }
  .header-actions .text-button { font-size: 12px; }
  main { width: min(100% - 28px, 1440px); }
  .page { padding: 24px 0 44px; }
  .page-intro { margin-bottom: 15px; }
  .page-intro h1, .page-heading h1 { font-size: 26px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .editing-profile-banner { align-items: flex-start; flex-direction: column; }
  .workday-overview { grid-template-columns: 1fr; }
  .workday-heading { align-items: center; flex-direction: row; padding: 11px 13px; border-right: 0; border-bottom: 1px solid var(--line); }
  .workday-stats { grid-template-columns: repeat(3, 1fr); }
  .workday-stats > div:nth-child(4) { border-top: 1px solid #e7eaee; border-left: 0; }
  .workday-stats > div:nth-child(5) { border-top: 1px solid #e7eaee; }
  .next-work-item { grid-template-columns: 1fr; padding: 13px; }
  .next-work-item > span { width: max-content; }
  .next-work-item .compact-button { width: 100%; }
  .analysis-workspace { border-radius: 7px; }
  .intake-card, .result-card { padding: 19px; }
  .card-heading { align-items: center; }
  .form-section { margin-top: 18px; }
  .field-grid, .result-summary, .two-column-result { grid-template-columns: 1fr; }
  .objective { border-top: 1px solid #cfdce8; border-left: 0; }
  .two-column-result section + section { padding-top: 15px; padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .form-footer, .result-actions { align-items: stretch; flex-direction: column; }
  .form-footer p { max-width: none; }
  .form-footer .primary-button, .result-actions .primary-button, .result-actions .secondary-button { width: 100%; }
  .conversation-path li { padding: 13px; }
  .funnel-panel { padding: 15px; }
  .funnel-heading { align-items: flex-start; }
  .funnel-steps { grid-template-columns: 1fr 1fr; }
  .funnel-steps li { padding: 11px 7px; }
  .funnel-steps li:nth-child(3), .funnel-steps li:nth-child(5) { border-top: 1px solid var(--line); }
  .funnel-steps small { white-space: normal; }
  .profile-toolbar { grid-template-columns: 1fr; }
  .profile-toolbar .search-field { grid-column: auto; }
  .profile-toolbar > p { margin: 0; }
  .profile-item { grid-template-columns: 1fr; padding: 15px; }
  .profile-avatar { display: none; }
  .profile-title-row { align-items: stretch; flex-direction: column; }
  .profile-status-group { justify-content: flex-start; }
  .profile-status-group label, .profile-status-group select { width: 100%; }
  .profile-summary-grid { grid-template-columns: 1fr; }
  .profile-summary-grid section + section, .profile-summary-grid section:last-child { grid-column: auto; border-top: 1px solid var(--line); border-left: 0; }
  .profile-actions { align-items: stretch; flex-direction: column; }
  .profile-actions .compact-button { width: 100%; }
  .profile-edit-grid { grid-template-columns: 1fr; }
  .profile-note-field { grid-column: auto; }
  .followup-summary { display: grid; grid-template-columns: 1fr 1fr; }
  .followup-summary > div { min-width: 0; }
  .followup-summary > div:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
  .followup-summary > div:nth-child(4) { border-top: 1px solid var(--line); }
  .followup-summary > p { grid-column: 1 / -1; margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); }
  .followup-item { padding: 14px; }
  .followup-title-row { flex-direction: column; gap: 3px; }
  .followup-actions, .followup-actions > div { align-items: flex-start; flex-direction: column; }
  .followup-edit-grid { grid-template-columns: 1fr; }
  .followup-title-field, .followup-detail-field { grid-column: auto; }
  .profile-dialog { width: 100%; max-width: none; max-height: 100vh; margin: 0; border-radius: 0; }
  .dialog-header { padding: 17px; }
  .dialog-header h1 { font-size: 23px; }
  .detail-overview { grid-template-columns: 1fr 1fr; }
  .detail-overview > div { padding: 12px 14px; }
  .detail-context, .quick-record, .timeline-section { padding: 18px 16px; }
  .detail-section-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .detail-section-heading > p { text-align: left; }
  .detail-context dl { grid-template-columns: 1fr; }
  .detail-context dl > div:nth-child(even) { border-left: 0; }
  .detail-context dl > div + div { border-top: 1px solid var(--line); }
  .next-task-callout { align-items: flex-start; flex-direction: column; gap: 3px; }
  .quick-record form { grid-template-columns: 1fr; }
  .quick-record .wide-field { grid-column: auto; }
  .quick-record button { width: 100%; }
  .profile-timeline li { grid-template-columns: 1fr; gap: 3px; padding-left: 14px; }
}

@media (max-width: 420px) {
  .header-actions { display: none; }
  .brand > span:last-child { display: none; }
  .primary-nav { margin-left: auto; }
  .primary-nav a { padding: 0 7px; }
  .intake-card, .result-card { padding: 17px; }
  .diagnosis, .objective, .script-box { padding: 15px; }
}
