:root {
  color-scheme: light;
  --paper: #f6f9fd;
  --paper-strong: #ffffff;
  --paper-soft: #eef4fb;
  --paper-muted: #fafbfd;
  --ink: #10233f;
  --ink-soft: #52647a;
  --ink-muted: #6c7d90;
  --line: #dde6f0;
  --line-strong: #7d94ae;
  --blue: #245cf5;
  --blue-dark: #1e4ed8;
  --blue-soft: #edf3ff;
  --teal: #0b6e68;
  --teal-soft: #e7f8f5;
  --danger: #b42318;
  --danger-soft: #fff3f2;
  --warning: #8a5a00;
  --warning-soft: #fff7df;
  --white: #ffffff;
  --shadow: 0 24px 64px -38px rgba(16, 35, 63, 0.28);
  --font-sans: "Segoe UI Variable Text", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei UI", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--paper);
  scrollbar-color: var(--blue) var(--paper-soft);
  scrollbar-width: thin;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 4%, rgba(36, 92, 245, 0.11), transparent 28rem),
    radial-gradient(circle at 7% 24%, rgba(101, 230, 212, 0.15), transparent 25rem),
    var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  caret-color: var(--blue);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
input {
  min-height: 44px;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

textarea {
  resize: vertical;
}

::selection {
  color: var(--white);
  background: var(--blue);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--paper-soft);
}

::-webkit-scrollbar-thumb {
  border: 2px solid var(--paper-soft);
  background: var(--blue);
  background-clip: padding-box;
  border-radius: 8px;
}

:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 2px;
  box-shadow: 0 0 0 7px var(--ink);
}

#chatTitle:focus-visible,
#conversationTitle:focus-visible {
  outline: 0;
  box-shadow: none;
  text-decoration: underline;
  text-decoration-color: #aec3ff;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.topbar-inner {
  width: min(1280px, calc(100% - 40px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--blue);
}

.brand-mark::after {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--white);
  border-radius: 4px;
  background: #65e6d4;
  content: "";
}

.brand strong,
.brand div > span {
  display: block;
}

.brand strong {
  font-size: 21px;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.brand div > span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.archive-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  background: var(--white);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.archive-link:hover {
  color: var(--blue-dark);
  border-color: var(--blue);
  background: var(--blue-soft);
}

.environment-label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--paper-strong);
  font-size: 12px;
  font-weight: 600;
}

.secondary-label {
  color: var(--teal);
  border-color: #b9e2dc;
  background: var(--teal-soft);
}

.header-exit {
  min-height: 36px;
  margin-left: 4px;
  color: var(--ink);
}

.candidate-notice {
  padding: 9px 20px;
  border-bottom: 1px solid #cae8e3;
  color: var(--ink);
  background: var(--teal-soft);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

main {
  min-height: calc(100dvh - 107px);
}

.provider-intent {
  width: min(1160px, calc(100% - 40px));
  margin: 28px auto 0;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  border: 1px solid #b9e2dc;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--white), var(--teal-soft));
  box-shadow: var(--shadow);
}

.provider-intent h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
}

.provider-intent p {
  margin: 6px 0 0;
}

.provider-intent-meta {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.provider-intent-disclosure {
  color: var(--ink-soft);
  font-size: 13px;
}

.provider-intent-actions {
  display: grid;
  gap: 10px;
  min-width: 190px;
}

.page-kicker,
.form-kicker,
.section-kicker {
  margin: 0 0 6px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.login-layout {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(54px, 8vw, 96px) 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.72fr);
  gap: clamp(44px, 8vw, 108px);
  align-items: center;
}

.login-copy h1 {
  max-width: 12ch;
  margin: 0 0 22px;
  font-size: clamp(42px, 5.5vw, 66px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.login-copy > p:not(.page-kicker) {
  max-width: 58ch;
  margin: 0 0 34px;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.8;
}

.boundary-list {
  margin: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.boundary-list div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.boundary-list dt {
  color: var(--ink);
  font-weight: 700;
}

.boundary-list dd {
  margin: 0;
  color: var(--ink-soft);
}

.login-form {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.login-form h2 {
  margin: 0 0 8px;
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.form-help {
  margin: 0 0 24px;
  color: var(--ink-soft);
}

label {
  display: block;
  margin: 16px 0 7px;
  color: var(--ink);
  font-weight: 700;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--white);
  color: var(--ink);
  padding: 11px 13px;
}

select:hover,
input:hover,
textarea:hover {
  border-color: var(--blue);
}

textarea {
  line-height: 1.55;
}

.login-form .primary-button {
  width: 100%;
  margin-top: 22px;
}

.form-status {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--danger);
}

.activation-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.activation-panel summary {
  color: var(--blue-dark);
  cursor: pointer;
  font-weight: 700;
}

.activation-panel > p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.activation-panel .secondary-button {
  width: 100%;
  margin-top: 16px;
}

.adult-confirmation {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
}

.adult-confirmation input {
  flex: 0 0 auto;
  width: 20px;
  min-height: 20px;
  margin: 1px 0 0;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 11px;
  padding: 10px 16px;
  font-weight: 700;
  text-decoration: none;
}

.primary-button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 10px 24px -14px rgba(36, 92, 245, 0.68);
}

.primary-button:hover {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: var(--white);
  color: var(--ink);
}

.secondary-button:hover {
  color: var(--blue-dark);
  border-color: var(--blue);
  background: var(--blue-soft);
}

.danger-button {
  border: 1px solid var(--danger);
  background: var(--danger);
  color: var(--white);
}

.text-button {
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
}

.text-button:hover {
  color: var(--blue-dark);
  border-color: var(--line);
  background: var(--paper-soft);
}

.danger-text {
  color: var(--danger);
}

.danger-text:hover {
  color: var(--danger);
  border-color: #efb8b2;
  background: var(--danger-soft);
}

.compact-control {
  min-height: 40px;
  padding: 8px 12px;
  white-space: nowrap;
}

.primary-button[data-loading="true"]::before {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: var(--white);
  border-radius: 50%;
  content: "";
  animation: button-spin 700ms linear infinite;
}

.workspace {
  width: min(1280px, calc(100% - 40px));
  height: calc(100dvh - 151px);
  min-height: 640px;
  margin: 22px auto;
  display: grid;
  grid-template-columns: minmax(310px, 348px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}

.conversation-pane {
  min-width: 0;
  overflow-y: auto;
  padding: 24px 20px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(237, 243, 255, 0.82), rgba(246, 249, 253, 0.96) 42%, var(--paper) 100%);
}

.pane-context {
  margin-bottom: 24px;
  padding: 13px 14px;
  border: 1px solid #bee5df;
  border-radius: 12px;
  background: rgba(231, 248, 245, 0.86);
}

.context-label {
  display: block;
  margin-bottom: 2px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
}

.role-label {
  margin: 0 0 4px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
}

.pane-context .role-label {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.pane-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pane-heading h1,
.chat-header h2 {
  margin: 0;
  letter-spacing: -0.025em;
}

.pane-heading h1 {
  font-size: 28px;
  line-height: 1.15;
}

.pane-help {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.conversation-list {
  position: relative;
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.conversation-list[aria-busy="true"] {
  min-height: 76px;
}

.conversation-list[aria-busy="true"]::after {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background:
    linear-gradient(100deg, transparent 18%, rgba(255, 255, 255, 0.88) 42%, transparent 66%) 0 0 / 220% 100%,
    linear-gradient(var(--paper-soft), var(--paper-soft));
  content: "";
  pointer-events: none;
  animation: list-shimmer 1.05s linear infinite;
}

.conversation-item {
  position: relative;
  width: 100%;
  min-height: 76px;
  padding: 13px 14px 13px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  text-align: left;
}

.conversation-item::before {
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
  content: "";
}

.conversation-item:hover {
  border-color: #b9c9dc;
  background: var(--white);
}

.conversation-item[aria-current="true"] {
  border-color: #aec3ff;
  background: var(--white);
  box-shadow: 0 12px 28px -24px rgba(16, 35, 63, 0.7);
}

.conversation-item[aria-current="true"]::before {
  background: var(--blue);
}

.conversation-item strong,
.conversation-item span {
  display: block;
}

.conversation-item strong {
  font-size: 16px;
  line-height: 1.35;
}

.conversation-item span {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 12px;
}

.teacher-directory {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.teacher-directory h2 {
  margin: 0 0 12px;
  font-size: 19px;
}

.pool-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper-soft);
}

.pool-tab {
  min-width: 0;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--ink-soft);
  background: transparent;
  font-weight: 700;
}

.pool-tab[aria-selected="true"] {
  color: var(--white);
  background: var(--blue);
}

.directory-panel h3 {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 13px;
}

.profile-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 18px 44px -34px rgba(16, 35, 63, 0.42);
}

.profile-card::before {
  position: absolute;
  top: 0;
  right: 12px;
  left: 12px;
  height: 1px;
  background: linear-gradient(90deg, var(--blue), #35c7d0 72%, #65e6d4);
  content: "";
}

.directory-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 10px;
  padding: 17px 14px 14px;
}

.profile-mark {
  display: grid;
  place-items: center;
  width: 48px;
  aspect-ratio: 1;
  border-radius: 12px;
  color: var(--white);
  background: var(--blue);
  font-size: 18px;
  font-weight: 700;
}

.profile-mark.organization {
  color: var(--ink);
  border: 1px solid #9bdcd2;
  background: var(--teal-soft);
}

.directory-card-body {
  min-width: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 8px;
  padding: 4px 9px;
  border: 1px solid #b8cdfd;
  border-radius: 999px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 600;
}

.pill--quiet {
  color: var(--ink-soft);
  border-color: var(--line);
  background: var(--paper);
}

.directory-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.directory-card .summary {
  margin: 7px 0 12px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.directory-disclosure,
.organization-status {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.organization-status {
  padding: 9px 10px;
  border: 1px solid #9bdcd2;
  color: var(--teal);
  background: var(--teal-soft);
  white-space: pre-line;
}

.directory-card button {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
}

.teacher-card {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.teacher-card h3 {
  margin: 0;
  font-size: 16px;
}

.teacher-card p {
  margin: 7px 0 13px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.teacher-card button {
  min-height: 40px;
  padding: 8px 12px;
}

.chat-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper-strong);
}

.record-context {
  padding: 13px clamp(22px, 3.6vw, 46px);
  border-bottom: 1px solid var(--line);
  background: var(--paper-soft);
}

.record-context strong,
.record-context span {
  display: block;
}

.record-context strong {
  font-size: 13px;
}

.record-context p {
  max-width: 72ch;
  margin: 3px 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.record-context span {
  color: var(--teal);
  font-size: 11px;
  font-weight: 600;
}

.chat-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, auto);
  align-items: start;
  gap: 20px;
  min-height: 112px;
  padding: 22px clamp(22px, 3.6vw, 46px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.chat-heading-copy {
  min-width: 0;
}

.chat-header h2 {
  font-size: 27px;
  line-height: 1.15;
}

.conversation-state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 8px 0 0;
  padding: 3px 9px;
  border: 1px solid #b9e2dc;
  border-radius: 999px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 12px;
  font-weight: 700;
}

.conversation-state:empty {
  display: none;
}

.conversation-actions {
  display: flex;
  max-width: 520px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.conversation-actions .text-button {
  min-height: 40px;
  padding: 7px 10px;
  border-color: var(--line);
  background: var(--paper-muted);
  font-size: 13px;
}

.conversation-actions .quiet-action:hover {
  color: var(--blue-dark);
  border-color: #b6c7da;
  background: var(--blue-soft);
}

.mobile-back {
  display: none;
}

.empty-chat {
  flex: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 44px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 48%, rgba(36, 92, 245, 0.07), transparent 18rem),
    linear-gradient(180deg, var(--paper-strong), var(--paper-muted));
}

.empty-symbol {
  position: relative;
  width: 70px;
  height: 54px;
  margin-bottom: 22px;
  border: 2px solid #9bb4d2;
  border-radius: 14px;
  background: var(--white);
  box-shadow: 13px 13px 0 -3px var(--blue-soft);
}

.empty-symbol::before,
.empty-symbol::after {
  position: absolute;
  left: 17px;
  width: 34px;
  height: 3px;
  border-radius: 3px;
  background: #9bb4d2;
  content: "";
}

.empty-symbol::before {
  top: 17px;
}

.empty-symbol::after {
  top: 29px;
  width: 24px;
}

.empty-chat h2 {
  margin: 0 0 10px;
  font-size: 28px;
  letter-spacing: -0.025em;
}

.empty-chat > p:not(.section-kicker) {
  max-width: 52ch;
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.empty-boundaries {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.empty-boundaries span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-soft);
  background: var(--white);
  font-size: 12px;
}

.active-chat {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--paper-muted), var(--paper-strong) 34%);
}

.request-decision,
.privacy-reminder,
.policy-panel {
  margin: 16px clamp(20px, 3.6vw, 46px) 0;
  border-radius: 13px;
  padding: 15px 17px;
}

.request-decision {
  border: 1px solid #b9e2dc;
  background: var(--teal-soft);
  color: #164f49;
}

.request-decision p {
  margin: 0 0 12px;
  line-height: 1.6;
}

.request-decision > div,
.policy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.privacy-reminder {
  border: 1px solid #b9e2dc;
  background: var(--teal-soft);
  color: #164f49;
}

.privacy-reminder p {
  margin: 5px 0 0;
  line-height: 1.58;
}

.message-log {
  flex: 1;
  min-height: 190px;
  overflow-y: auto;
  margin: 0;
  padding: 26px clamp(20px, 3.6vw, 46px);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message {
  max-width: min(64ch, 76%);
  padding: 12px 14px;
  align-self: flex-start;
  border: 1px solid var(--line);
  border-radius: 5px 15px 15px 15px;
  background: var(--white);
  box-shadow: 0 14px 32px -30px rgba(16, 35, 63, 0.85);
}

.message.is-mine {
  align-self: flex-end;
  border-color: #bdceff;
  border-radius: 15px 5px 15px 15px;
  background: var(--blue-soft);
}

.message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.62;
}

.message footer {
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 11px;
}

.message .masked-note {
  display: inline;
  color: var(--warning);
  font-weight: 700;
}

.policy-panel {
  border: 1px solid #efb8b2;
  background: var(--danger-soft);
  color: #672929;
}

.policy-panel strong {
  display: block;
}

.policy-panel p {
  margin: 6px 0 10px;
  line-height: 1.58;
}

.policy-panel pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 10px 0;
  padding: 11px 12px;
  border: 1px solid #efc7c2;
  border-radius: 9px;
  background: var(--white);
  color: var(--ink);
  font-family: inherit;
}

.composer {
  padding: 14px clamp(20px, 3.6vw, 46px) 18px;
  border-top: 1px solid var(--line);
  background: rgba(246, 249, 253, 0.98);
}

.composer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 7px;
}

.composer-heading label {
  margin: 0;
}

.composer-heading span {
  color: var(--ink-muted);
  font-size: 12px;
}

.composer textarea {
  min-height: 76px;
  max-height: 180px;
  resize: vertical;
  border-color: #9eb2c8;
  background: var(--white);
}

.composer textarea:focus-visible {
  border-color: var(--blue);
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
}

.composer-footer p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

#sendButton {
  min-width: 88px;
}

dialog {
  width: min(470px, calc(100% - 32px));
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 28px 80px -34px rgba(8, 23, 38, 0.7);
}

dialog::backdrop {
  background: rgba(16, 35, 63, 0.52);
  backdrop-filter: blur(4px);
}

dialog h2 {
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: -0.02em;
}

dialog > form > p:not(.form-kicker) {
  color: var(--ink-soft);
  line-height: 1.65;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes list-shimmer {
  to {
    background-position: -220% 0, 0 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .primary-button,
  .secondary-button,
  .danger-button,
  .text-button,
  .conversation-item {
    transition:
      transform 160ms ease-out,
      background-color 160ms ease-out,
      border-color 160ms ease-out,
      color 160ms ease-out,
      box-shadow 160ms ease-out;
  }

  .primary-button:active,
  .secondary-button:active,
  .danger-button:active {
    transform: scale(0.985);
  }
}

@media (max-width: 900px) {
  .secondary-label {
    display: none;
  }

  .workspace {
    grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  }

  .conversation-actions {
    max-width: 360px;
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 62px;
  }

  .topbar-inner {
    width: calc(100% - 28px);
    min-height: 62px;
  }

  .brand strong {
    font-size: 19px;
  }

  .brand div > span,
  .environment-label {
    display: none;
  }

  .archive-link {
    min-height: 34px;
    padding-inline: 10px;
  }

  .candidate-notice {
    padding: 8px 16px;
    font-size: 12px;
    line-height: 1.5;
  }

  main {
    min-height: calc(100dvh - 114px);
  }

  .provider-intent {
    width: min(100% - 28px, 560px);
    margin-top: 20px;
    padding: 20px;
    grid-template-columns: 1fr;
  }

  .provider-intent-actions {
    min-width: 0;
  }

  .login-layout {
    width: min(100% - 28px, 560px);
    padding: 38px 0 56px;
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .login-copy h1 {
    max-width: 13ch;
    font-size: clamp(39px, 11vw, 48px);
  }

  .login-copy > p:not(.page-kicker) {
    font-size: 16px;
  }

  .boundary-list div {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
  }

  .login-form {
    padding: 24px 20px;
  }

  .workspace {
    width: 100%;
    height: calc(100dvh - 114px);
    min-height: 0;
    margin: 0;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .conversation-pane {
    padding: 18px 16px 24px;
    border-right: 0;
  }

  .directory-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .profile-mark {
    width: 44px;
  }

  .pane-context {
    margin-bottom: 18px;
  }

  .chat-pane {
    display: none;
  }

  .workspace[data-mobile-view="chat"] .conversation-pane {
    display: none;
  }

  .workspace[data-mobile-view="chat"] .chat-pane {
    display: flex;
  }

  .mobile-back {
    grid-column: 1 / -1;
    display: inline-flex;
    justify-self: start;
    min-height: 44px;
    padding: 7px 10px;
    color: var(--blue-dark);
    border-color: var(--line);
    background: var(--paper-soft);
  }

  .chat-header {
    z-index: 4;
    min-height: 0;
    padding: 12px 14px 14px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
  }

  .mobile-back {
    grid-column: 1;
    grid-row: 1;
  }

  .chat-heading-copy {
    grid-column: 2;
    grid-row: 1;
  }

  .chat-header h2 {
    font-size: 23px;
  }

  .conversation-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: none;
    justify-content: flex-start;
    gap: 5px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  .conversation-actions .text-button {
    min-height: 44px;
    padding: 8px 10px;
    flex: 1 1 auto;
  }

  .request-decision,
  .privacy-reminder,
  .policy-panel {
    margin: 12px 14px 0;
  }

  .record-context {
    padding: 11px 14px;
  }

  .message-log {
    min-height: 0;
    padding: 18px 14px;
  }

  .message {
    max-width: 88%;
  }

  .composer {
    padding: 11px 14px max(14px, env(safe-area-inset-bottom));
  }

  .composer-footer {
    align-items: flex-end;
  }

  .composer-footer p {
    max-width: 22ch;
  }

  .empty-chat {
    padding: 28px 20px;
  }

  .empty-chat h2 {
    font-size: 25px;
  }

  .empty-boundaries {
    max-width: 280px;
  }

  dialog {
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 24px 20px;
  }
}

@media (max-width: 420px) {
  .candidate-notice {
    text-align: left;
  }

  .pane-heading {
    align-items: center;
  }

  .compact-control {
    max-width: 128px;
  }

  .request-decision > div,
  .policy-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .request-decision button,
  .policy-actions button {
    width: 100%;
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) and (max-height: 560px) {
  .topbar,
  .candidate-notice {
    display: none;
  }

  main,
  .workspace {
    min-height: 0;
    height: 100dvh;
  }

  .chat-header {
    padding-top: 8px;
    padding-bottom: 9px;
  }

  .composer {
    padding-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* Self-service intake inherits the archive palette; long tasks stay in the page. */
.intake-entry { min-height: 44px; white-space: nowrap; font-size: 14px; }
.intake-view { width: min(1200px, calc(100% - 48px)); margin: 32px auto 64px; }
.intake-heading { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px; margin-bottom: 24px; }
.intake-heading h1 { margin: 0; font-size: 28px; line-height: 1.3; }
.intake-heading p { margin: 8px 0 0; color: var(--ink-soft); }
.intake-status { padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-soft); color: var(--ink); }
.intake-status[data-success="true"] { color: var(--teal); background: var(--teal-soft); }
.intake-error { margin: 20px 0; padding: 16px 20px; border: 1px solid var(--danger); border-radius: 12px; background: var(--danger-soft); color: var(--danger); }
.intake-error a { color: inherit; display: inline-block; padding-block: 10px; text-underline-offset: 3px; }
.intake-form [aria-invalid="true"] { border-color: var(--danger); }
.intake-view :is(h1, h2, p, legend, label, button), #intakePrompt, #intakeDecision { overflow-wrap: anywhere; }
.intake-view :is(input, select, textarea) { min-width: 0; max-width: 100%; }
.intake-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 28px; }
.intake-actions > * { min-height: 44px; }
.intake-steps { display: flex; flex-wrap: wrap; gap: 16px 40px; margin: 32px 0 20px; padding-left: 24px; color: var(--ink-soft); }
.intake-steps [aria-current="step"] { color: var(--blue-dark); font-weight: 700; }
.intake-columns { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.intake-form, .intake-preview { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.intake-form h2, #intakeConfirmation > h2, .intake-preview h2 { margin: 0 0 24px; font-size: 24px; line-height: 1.35; }
.intake-form fieldset { min-width: 0; margin: 24px 0; padding: 0; border: 0; }
.intake-form legend { margin-bottom: 8px; padding: 0; color: var(--ink); font-weight: 700; }
.intake-form label { margin-top: 20px; }
.intake-form p, .intake-note { margin: 12px 0 20px; max-width: 72ch; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }
.intake-form .intake-offering { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.intake-check { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; margin: 8px 0; padding: 10px 0; font-size: 16px; font-weight: 400; }
.intake-check input { flex: 0 0 20px; width: 20px; min-height: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--blue); }
.intake-form .intake-check { margin: 0; }
.intake-preview h3 { margin: 0 0 20px; font-size: 22px; overflow-wrap: anywhere; }
.intake-preview-list { margin: 0; }
.intake-preview-list > div { padding-block: 12px; border-bottom: 1px solid var(--line); }
.intake-preview-list dt { color: var(--ink-soft); font-size: 14px; }
.intake-preview-list dd { margin: 5px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.intake-feedback { padding-left: 24px; color: var(--danger); }
.intake-help { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--ink-soft); }
.intake-help summary { cursor: pointer; min-height: 44px; color: var(--ink); }
#intakeDraftPreview { position: sticky; top: 100px; }
#intakeConfirmation { max-width: 880px; margin-inline: auto; }
#intakePrompt { max-height: calc(100dvh - 32px); overflow-y: auto; }
#intakePrompt .dialog-actions, #intakeDecision .dialog-actions { display: flex; flex-direction: column; }
#intakePrompt p, #intakeDecision p { color: var(--ink-soft); }
.intake-view :is(input, select, textarea, fieldset, h1, h2, [tabindex="-1"]) { scroll-margin-top: 120px; }
@media (max-width: 1023px) {
  .intake-columns { grid-template-columns: minmax(0, 1fr); }
  #intakeDraftPreview { position: static; }
}
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px 12px; padding-block: 8px; }
  .top-actions { flex-wrap: wrap; flex: 1; gap: 6px; }
  body:has(.intake-entry:not([hidden])) .topbar { display: block; }
  .intake-entry { min-height: 44px; padding: 8px 12px; }
  .intake-view { width: calc(100% - 32px); margin-top: 24px; }
  .intake-heading h1 { font-size: 24px; }
  .intake-form, .intake-preview { padding: 20px 16px; }
  .intake-actions { flex-direction: column; align-items: stretch; }
  .intake-heading > a { min-height: 44px; }
  body:has(#intakeView:not([hidden])) .topbar { display: block; position: static; }
  body:has(#intakeView:not([hidden])) main { height: auto; min-height: 0; }
}
@media (max-width: 360px) {
  .intake-view { width: calc(100% - 24px); }
  .top-actions { flex-basis: 100%; justify-content: flex-start; }
  .intake-heading > a { width: 100%; }
}

.resume-upload { margin-block: 24px 32px; padding-block: 0 24px; border-bottom: 1px solid var(--line); }
.resume-upload h3 { margin-top: 0; font-size: 20px; line-height: 1.45; }
.resume-upload p { line-height: 1.7; color: var(--ink-soft); }
.resume-upload input[type="file"] { width: 100%; min-width: 0; padding: 12px 0; font: inherit; }
.resume-upload input::file-selector-button { min-height: 44px; margin-right: 12px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font: inherit; cursor: pointer; }
.resume-upload details { margin-top: 20px; }
.resume-upload summary { cursor: pointer; line-height: 1.6; }
.resume-upload pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow-y: auto; padding: 16px; background: #f3f6fb; font: inherit; line-height: 1.7; }
.resume-upload[aria-busy="true"] #resumeStatus { color: #2458f5; }
