:root {
  color-scheme: light;
  --paper: #ffffff;
  --canvas: #f4f6f5;
  --field: #f7f8f7;
  --ink: #202421;
  --ink-soft: #3f4641;
  --muted: #6d746f;
  --faint: #989f9a;
  --rule: #d9dedb;
  --rule-strong: #b8c0ba;
  --blue: #315f70;
  --blue-dark: #244b59;
  --blue-soft: #edf3f5;
  --red: #aa493d;
  --red-soft: #f8efed;
  --yellow: #b58d2d;
  --yellow-soft: #faf5e8;
  --green: #47725c;
  --header-height: 64px;
  --history-width: 236px;
  --summary-width: 312px;
  font-family:
    "Microsoft YaHei UI",
    "PingFang SC",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.65;
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
}

button:disabled {
  opacity: 0.72;
}

button,
textarea,
dialog {
  border-radius: 6px;
}

svg {
  display: block;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

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

[hidden] {
  display: none !important;
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  left: 50%;
  max-width: 160px;
  padding: 5px 8px;
  transform: translate(-50%, -3px);
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 120ms ease,
    transform 120ms ease;
  white-space: nowrap;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  transform: translate(-50%, 0);
  opacity: 1;
}

.app-shell {
  display: grid;
  grid-template-rows:
    var(--header-height)
    minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  background: var(--paper);
}

.app-header {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(190px, auto) minmax(0, 1fr) minmax(130px, auto);
  align-items: center;
  gap: 16px;
  min-height: var(--header-height);
  padding: 10px 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.brand,
.service-state,
.case-stage,
.privacy-note,
.composer-actions,
.history-panel-head,
.history-heading,
.local-note,
.summary-heading,
.history-item-copy,
.history-item-meta,
.assistant-heading,
.citation-heading,
.dialog-actions {
  display: flex;
  align-items: center;
}

.brand {
  min-width: 0;
  gap: 10px;
}

.brand strong {
  overflow: hidden;
  font-family:
    "STZhongsong",
    "Songti SC",
    "SimSun",
    serif;
  font-size: 17px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 34px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-family:
    "STZhongsong",
    "Songti SC",
    "SimSun",
    serif;
  font-size: 17px;
  font-weight: 600;
}

.brand-mark::after {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--paper);
  border-left: 2px solid var(--paper);
  background: var(--red);
  content: "";
}

.header-path {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-state {
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.service-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
}

.service-state[data-status="ok"] .service-dot {
  background: var(--green);
}

.service-state[data-status="error"] .service-dot {
  background: var(--red);
}

.header-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.quota-summary {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.quota-summary[data-exhausted="true"] {
  color: var(--red);
  font-weight: 700;
}

.account-button {
  display: flex;
  min-width: 0;
  max-width: 250px;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-soft);
  font-weight: 600;
}

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

.account-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell:not([data-identity="local"]):not(
    [data-identity="authenticated"]
  )
  [data-auth-only="true"] {
  display: none !important;
}

.app-shell[data-identity="local"]
  [data-trial-only="true"],
.app-shell[data-identity="authenticated"]
  [data-trial-only="true"] {
  display: none !important;
}

.app-shell[data-identity="loading"] [data-trial-only="true"] {
  visibility: hidden;
}

.trial-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
}

.trial-strip-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.trial-strip strong {
  font-size: 13px;
}

.trial-strip span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.trial-strip .trial-benefit {
  margin-top: 3px;
  color: var(--ink-soft);
  font-weight: 600;
}

.trial-strip-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.trial-auth-button {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--blue-dark);
  border-radius: 4px;
  background: var(--paper);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
}

.trial-auth-button:hover {
  background: var(--blue-soft);
}

.trial-register-button {
  background: var(--blue-dark);
  color: var(--paper);
}

.trial-register-button:hover {
  background: var(--blue);
}

.policy-link,
.text-link {
  margin: 0;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}

.app-body {
  display: grid;
  grid-template-columns: var(--history-width) minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.app-shell:not([data-identity="local"]):not(
    [data-identity="authenticated"]
  )
  .app-body {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell[data-view="case"] .app-body {
  grid-template-columns:
    var(--history-width)
    minmax(430px, 1fr)
    var(--summary-width);
}

.app-shell:not([data-identity="local"]):not(
    [data-identity="authenticated"]
  )[data-view="case"]
  .app-body {
  grid-template-columns:
    minmax(430px, 1fr)
    var(--summary-width);
}

.history-panel {
  position: relative;
  z-index: 20;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: 14px 11px 12px;
  overflow: hidden;
  border-right: 1px solid var(--rule);
  background: var(--canvas);
}

.history-panel-head {
  gap: 8px;
}

.new-session-button {
  display: flex;
  min-width: 0;
  min-height: 42px;
  flex: 1;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  font-weight: 600;
}

.new-session-button:hover {
  border-color: var(--ink-soft);
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.icon-button:hover {
  border-color: var(--rule);
  background: var(--paper);
  color: var(--ink);
}

.icon-button-small {
  width: 30px;
  height: 30px;
}

.history-toggle,
.history-close {
  display: none;
}

.history-heading {
  justify-content: space-between;
  gap: 8px;
  margin: 22px 5px 7px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.history-status {
  margin: 4px 8px;
  color: var(--muted);
  font-size: 13px;
}

.history-status[data-state="error"] {
  color: var(--red);
}

.history-list {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: var(--rule-strong) transparent;
  scrollbar-width: thin;
}

.history-item {
  position: relative;
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr) 30px;
  align-items: stretch;
  gap: 9px;
  width: 100%;
  min-height: 58px;
  padding: 9px 5px 9px 7px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  text-align: left;
}

.history-item:hover,
.history-item:focus-within,
.history-item[aria-current="true"] {
  background: var(--paper);
}

.history-mark {
  width: 3px;
  min-height: 38px;
  background: var(--rule-strong);
}

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

.history-item-main {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.history-item-copy {
  min-width: 0;
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
}

.history-item-copy strong,
.history-item-copy small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-copy strong {
  font-size: 13px;
  font-weight: 600;
}

.history-item-copy small {
  color: var(--muted);
  font-size: 12px;
}

.history-delete {
  align-self: center;
  width: 30px;
  height: 30px;
  opacity: 0;
}

.history-item:hover .history-delete,
.history-item:focus-within .history-delete,
.history-delete:focus-visible {
  opacity: 1;
}

.history-delete:hover {
  border-color: #e5cbc6;
  background: var(--red-soft);
  color: var(--red);
}

.history-retry[data-loading="true"] .icon {
  animation: spin 800ms linear infinite;
}

.local-note {
  gap: 7px;
  margin-top: auto;
  padding: 13px 8px 2px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 12px;
}

.drawer-backdrop {
  display: none;
}

.main-content {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--paper);
  scrollbar-color: var(--rule-strong) transparent;
  scrollbar-width: thin;
}

.new-screen {
  display: grid;
  min-height: 100%;
  align-content: center;
  padding: 52px clamp(24px, 7%, 88px);
}

.new-inner {
  width: min(100%, 760px);
  margin: 0 auto;
}

.new-copy {
  margin-bottom: 26px;
}

.section-kicker,
.case-number {
  display: block;
  color: var(--blue);
  font-family:
    "Bahnschrift",
    "DIN Alternate",
    "Microsoft YaHei UI",
    sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.new-copy h1,
.case-title-block h1,
.summary-heading h2,
.dialog-copy h2 {
  margin: 0;
  font-family:
    "STZhongsong",
    "Songti SC",
    "SimSun",
    serif;
  font-weight: 600;
}

.new-copy h1 {
  margin-top: 8px;
  font-size: 30px;
  line-height: 1.3;
}

.new-copy p {
  max-width: 570px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.composer {
  overflow: visible;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
}

.composer:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 116px;
  padding: 16px 17px 9px;
  resize: vertical;
  border: 0;
  border-radius: 6px 6px 0 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  line-height: 1.7;
}

.composer textarea::placeholder {
  color: var(--faint);
}

.composer textarea:disabled {
  background: var(--field);
  color: var(--muted);
}

.attachment-list {
  display: grid;
  min-width: 0;
  border-top: 1px solid var(--rule);
}

.attachment-list:empty {
  display: none;
}

.attachment-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px 10px;
  min-width: 0;
  min-height: 58px;
  padding: 8px 10px 8px 13px;
  border-bottom: 1px solid var(--rule);
  background: #fbfcfb;
}

.attachment-item:last-child {
  border-bottom: 0;
}

.attachment-item-mark {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--paper);
  color: var(--muted);
}

.attachment-item-mark .icon {
  width: 14px;
  height: 14px;
}

.attachment-item[data-status="confirmed"] .attachment-item-mark {
  border-color: #b8d0c2;
  background: #eef5f1;
  color: var(--green);
}

.attachment-item[data-status="failed"] .attachment-item-mark {
  border-color: #e5cbc6;
  background: var(--red-soft);
  color: var(--red);
}

.attachment-item-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
  line-height: 1.4;
}

.attachment-item-copy strong,
.attachment-item-copy span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.attachment-item-copy strong {
  font-size: 13px;
  font-weight: 600;
}

.attachment-item-copy span {
  color: var(--muted);
  font-size: 11px;
}

.attachment-item-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.attachment-command {
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.attachment-command:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue-dark);
}

.attachment-remove:hover:not(:disabled) {
  border-color: #e5cbc6;
  background: var(--red-soft);
  color: var(--red);
}

.attachment-item-warning {
  grid-column: 2 / -1;
  margin: -1px 0 1px;
  color: #806318;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.attachment-blocker {
  margin: 0;
  padding: 7px 13px;
  border-top: 1px solid var(--rule);
  background: var(--field);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.attachment-blocker[data-tone="warning"] {
  background: var(--yellow-soft);
  color: #806318;
}

.attachment-blocker[data-tone="error"] {
  background: var(--red-soft);
  color: var(--red);
}

.composer-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 54px;
  gap: 12px;
  padding: 8px 9px 9px 15px;
}

.input-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 12px;
}

.composer-actions {
  justify-content: flex-end;
  gap: 11px;
}

.composer-tool-button {
  width: 40px;
  height: 40px;
  border-color: var(--rule);
  background: var(--paper);
  color: var(--ink-soft);
}

.composer-tool-button:hover:not(:disabled) {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.composer-tool-button[data-status="loading"] .icon {
  animation: spin 800ms linear infinite;
}

.privacy-note,
.character-count {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.privacy-note {
  gap: 6px;
}

.privacy-note .icon {
  width: 16px;
  height: 16px;
}

.send-button {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

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

.send-button:disabled {
  border-color: var(--rule-strong);
  background: var(--rule-strong);
}

.button-spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgb(255 255 255 / 45%);
  border-top-color: var(--paper);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.send-button[data-loading="true"] .button-spinner {
  display: block;
}

.send-button[data-loading="true"] .send-icon {
  display: none;
}

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

.starter-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 26px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.starter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 82px;
  padding: 13px 12px;
  border: 0;
  border-right: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.starter:last-child {
  border-right: 0;
}

.starter:hover {
  background: var(--field);
}

.starter-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.starter-copy small {
  color: var(--muted);
}

.starter-copy strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.starter .icon {
  color: var(--blue);
}

.case-screen {
  min-height: 100%;
}

.case-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(18px, 4%, 36px) 18px;
  border-bottom: 1px solid var(--rule);
}

.case-title-block {
  min-width: 0;
}

.case-number {
  color: var(--muted);
}

.case-title-block h1 {
  max-width: 660px;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 23px;
  line-height: 1.35;
}

.case-stage {
  flex: 0 0 auto;
  gap: 8px;
  padding: 4px 0 4px 11px;
  border-left: 3px solid var(--yellow);
  color: var(--muted);
  white-space: nowrap;
}

.case-stage-mark {
  width: 7px;
  height: 7px;
  background: var(--yellow);
}

.case-stage[data-status="ready"] {
  border-color: var(--blue);
}

.case-stage[data-status="ready"] .case-stage-mark {
  background: var(--blue);
}

.case-stage[data-status="escalate"] {
  border-color: var(--red);
}

.case-stage[data-status="escalate"] .case-stage-mark {
  background: var(--red);
}

.case-alert {
  margin: 18px clamp(18px, 4%, 36px) 0;
  padding: 12px 14px;
  border-left: 3px solid var(--red);
  background: var(--red-soft);
  color: var(--ink-soft);
}

.case-alert p {
  margin: 0;
}

.case-alert[data-tone="warning"] {
  border-left-color: var(--yellow);
  background: var(--yellow-soft);
}

.case-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.thread {
  display: grid;
  align-content: start;
  gap: 24px;
  width: min(100%, 820px);
  min-height: 280px;
  margin: 0 auto;
  padding: 28px clamp(18px, 5%, 44px);
}

.thread-placeholder {
  align-self: start;
  padding: 20px 0;
  color: var(--muted);
  text-align: center;
}

.message {
  min-width: 0;
}

.user-message {
  justify-self: end;
  width: min(88%, 560px);
  padding: 13px 15px;
  border-radius: 6px 6px 2px 6px;
  background: var(--field);
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.message-meta strong {
  color: var(--ink);
  font-weight: 600;
}

.message p,
.message ul,
.message ol {
  margin-top: 0;
  margin-bottom: 0;
}

.message p,
.message li {
  overflow-wrap: anywhere;
}

.message-attachments {
  display: grid;
  margin-top: 12px;
  border-top: 1px solid var(--rule);
}

.message-attachments-heading {
  margin: 0;
  padding: 8px 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.message-attachment {
  border-top: 1px solid var(--rule);
}

.message-attachment summary {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  cursor: pointer;
  list-style: none;
}

.message-attachment summary::-webkit-details-marker {
  display: none;
}

.message-attachment-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.message-attachment-copy strong,
.message-attachment-copy span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.message-attachment-copy strong {
  font-size: 12px;
  font-weight: 600;
}

.message-attachment-copy span {
  color: var(--muted);
  font-size: 11px;
}

.message-attachment-chevron {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 120ms ease;
}

.message-attachment[open] .message-attachment-chevron {
  transform: rotate(180deg);
}

.message-attachment-text {
  padding: 2px 0 10px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.assistant-message {
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr);
  gap: 14px;
  width: min(100%, 700px);
}

.assistant-rule {
  background: var(--blue);
}

.assistant-message[data-status="escalate"] .assistant-rule {
  background: var(--red);
}

.assistant-message[data-turn-kind="plan_update"] .assistant-rule {
  background: var(--green);
}

.assistant-message[data-turn-kind="new_case"] .assistant-rule {
  background: var(--yellow);
}

.assistant-message[data-turn-kind="unverified_guidance"] .assistant-rule {
  background: var(--yellow);
}

.assistant-message[data-turn-kind="emergency_guidance"] .assistant-rule {
  background: var(--red);
}

.assistant-content {
  min-width: 0;
}

.assistant-heading {
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.assistant-heading strong {
  font-weight: 600;
}

.assistant-heading small {
  color: var(--muted);
  white-space: nowrap;
}

.coverage-banner {
  display: grid;
  gap: 5px;
  margin: 10px 0 4px;
  padding: 10px 12px;
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
}

.coverage-banner[data-mode="unverified_guidance"] {
  border-left-color: var(--yellow);
  background: var(--yellow-soft);
}

.coverage-banner[data-mode="emergency_guidance"] {
  border-left-color: var(--red);
  background: var(--red-soft);
}

.coverage-heading {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 10px;
}

.coverage-heading strong,
.coverage-heading span {
  overflow-wrap: anywhere;
}

.coverage-heading strong {
  font-size: 13px;
}

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

.coverage-banner p {
  color: var(--ink-soft);
  font-size: 13px;
}

.coverage-banner .coverage-risks {
  color: var(--red);
  font-weight: 700;
}

.plan-update-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 2px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.plan-update-note .icon {
  width: 15px;
  height: 15px;
}

.plan-update-details {
  margin-top: 18px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.plan-update-details > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 11px 0;
  color: var(--blue-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.plan-update-details > summary::-webkit-details-marker {
  display: none;
}

.plan-update-details > summary span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.plan-update-chevron {
  width: 16px;
  height: 16px;
  transition: transform 160ms ease;
}

.plan-update-details[open] .plan-update-chevron {
  transform: rotate(180deg);
}

.plan-update-details-body {
  min-width: 0;
  padding-bottom: 4px;
}

.plan-update-details-body > .response-section:first-child {
  margin-top: 4px;
}

.reply-copy {
  max-width: 66ch;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.question-list,
.plan-list,
.limitation-list,
.reply-action-list,
.guidance-action-list,
.guidance-evidence-list,
.guide-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 20px;
}

.reply-action-list {
  gap: 6px;
}

.guidance-action-list,
.guidance-evidence-list {
  color: var(--ink-soft);
}

.emergency-action-list {
  color: var(--ink);
  font-weight: 600;
}

.emergency-action-list li::marker {
  color: var(--red);
  font-weight: 700;
}

.guidance-question {
  padding: 10px 12px;
  border-left: 3px solid var(--yellow);
  background: var(--yellow-soft);
  color: var(--ink-soft);
  font-weight: 600;
}

.new-case-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--rule);
}

.new-case-block small {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.new-case-action {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--blue);
  background: var(--paper);
  color: var(--blue-dark);
  font-weight: 700;
}

.new-case-action:hover {
  background: var(--blue-soft);
}

.new-case-action .icon {
  width: 16px;
  height: 16px;
}

.response-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.response-section h3,
.summary-section h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
}

.response-label {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}

.response-lead {
  color: var(--ink-soft);
}

.communication-copy {
  padding: 11px 13px;
  border-left: 3px solid var(--rule-strong);
  background: var(--field);
  white-space: pre-wrap;
}

.communication-guide {
  display: grid;
  gap: 13px;
}

.communication-context {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--rule);
}

.communication-row {
  display: grid;
  grid-template-columns: minmax(62px, auto) minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.communication-row:nth-child(even) {
  border-right: 0;
}

.communication-row dt,
.communication-row dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.communication-row dt {
  color: var(--muted);
  font-size: 12px;
}

.communication-row dd {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 600;
}

.communication-message {
  padding: 12px 14px;
  border-left: 3px solid var(--blue);
  background: var(--field);
}

.communication-message strong,
.guide-list-block > strong {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
}

.communication-message p {
  color: var(--ink-soft);
  line-height: 1.8;
  white-space: pre-wrap;
}

.guide-list-block {
  min-width: 0;
}

.guide-list-block[data-tone="required-before-send"] {
  padding: 10px 12px;
  border-left: 3px solid var(--yellow);
  background: var(--yellow-soft);
}

.guide-list-block .guide-list {
  margin-top: 5px;
  color: var(--ink-soft);
}

.time-limit {
  display: grid;
  gap: 5px;
  padding: 11px 13px;
  border-left: 3px solid var(--yellow);
  background: var(--yellow-soft);
}

.time-limit p {
  margin: 0;
}

.time-limit small {
  color: var(--muted);
}

.response-runtime {
  margin-top: 22px;
  padding-top: 13px;
  border-top: 1px dashed var(--rule-strong);
}

.runtime-heading {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.runtime-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--rule);
}

.runtime-field {
  display: grid;
  grid-template-columns: minmax(58px, auto) minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 11px;
  line-height: 1.45;
}

.runtime-field:nth-child(even) {
  border-right: 0;
}

.runtime-field dt {
  color: var(--muted);
}

.runtime-field dd {
  min-width: 0;
  margin: 0;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.citation-list {
  display: grid;
  border-top: 1px solid var(--rule);
}

.citation {
  border-bottom: 1px solid var(--rule);
}

.citation summary {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  cursor: pointer;
  list-style: none;
}

.citation summary::-webkit-details-marker {
  display: none;
}

.citation-number {
  color: var(--blue);
  font-family:
    "Bahnschrift",
    "DIN Alternate",
    sans-serif;
  font-weight: 700;
}

.citation-heading {
  min-width: 0;
  align-items: flex-start;
  flex-direction: column;
  gap: 1px;
}

.citation-heading strong,
.citation-heading small {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.citation-heading strong {
  font-weight: 600;
}

.citation-heading small {
  color: var(--muted);
}

.citation-chevron {
  color: var(--muted);
  transition: transform 120ms ease;
}

.citation[open] .citation-chevron {
  transform: rotate(180deg);
}

.citation-body {
  padding: 0 0 13px 36px;
}

.citation-body p {
  margin: 0 0 8px;
  color: var(--ink-soft);
  white-space: pre-wrap;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.source-link:hover {
  text-decoration: underline;
}

.case-composer {
  width: min(calc(100% - 48px), 748px);
  margin: 4px auto 28px;
}

.case-composer textarea {
  min-height: 78px;
}

.case-composer[data-readonly="true"] {
  border-color: var(--rule);
}

.case-summary {
  min-width: 0;
  min-height: 0;
  padding: 22px 18px 28px;
  overflow-x: hidden;
  overflow-y: auto;
  border-left: 1px solid var(--rule);
  background: var(--canvas);
  scrollbar-color: var(--rule-strong) transparent;
  scrollbar-width: thin;
}

.summary-heading {
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
}

.summary-heading h2 {
  margin-top: 3px;
  font-size: 20px;
}

.summary-state {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.summary-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 18px;
}

.summary-progress span {
  height: 4px;
  background: var(--rule-strong);
}

.summary-progress span[data-complete="true"] {
  background: var(--blue);
}

.summary-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--rule-strong);
}

.summary-section[data-tone="pending"] {
  border-top-color: var(--yellow);
}

.summary-section[data-tone="escalate"] {
  border-top-color: var(--red);
}

.summary-section:first-child {
  margin-top: 0;
}

.summary-empty {
  margin: 0;
  color: var(--muted);
}

.summary-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
}

.summary-signal {
  width: 7px;
  height: 7px;
  margin-top: 7px;
  background: var(--blue);
}

.summary-signal[data-tone="pending"] {
  background: var(--yellow);
}

.summary-signal[data-tone="escalate"] {
  background: var(--red);
}

.summary-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

.summary-copy small {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
}

.summary-copy strong {
  font-weight: 600;
}

.summary-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.summary-list li {
  position: relative;
  padding-left: 16px;
  overflow-wrap: anywhere;
}

.summary-list li::before {
  position: absolute;
  top: 0.75em;
  left: 2px;
  width: 5px;
  height: 5px;
  transform: translateY(-50%);
  background: var(--blue);
  content: "";
}

ol.summary-list {
  padding-left: 20px;
  list-style: decimal;
}

ol.summary-list li {
  padding-left: 2px;
}

ol.summary-list li::before {
  display: none;
}

.summary-section[data-tone="pending"] .summary-list li::before {
  background: var(--yellow);
}

.summary-section[data-tone="escalate"] .summary-list li::before {
  background: var(--red);
}

.summary-section[data-tone="escalate"] ol.summary-list li::marker {
  color: var(--red);
  font-weight: 700;
}

.summary-citation {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
}

.summary-citation span:first-child {
  color: var(--blue);
  font-family:
    "Bahnschrift",
    "DIN Alternate",
    sans-serif;
  font-weight: 700;
}

.summary-citation-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.summary-citation-copy strong {
  overflow-wrap: anywhere;
}

.summary-citation-copy .source-link {
  justify-self: start;
  font-size: 12px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(360px, calc(100% - 36px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 11px 13px;
  border-left: 3px solid var(--blue);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgb(32 36 33 / 14%);
  background: var(--ink);
  color: var(--paper);
  overflow-wrap: anywhere;
}

.toast[data-tone="error"] {
  border-left-color: #ef8d80;
}

.confirm-dialog {
  width: min(430px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 20px 70px rgb(32 36 33 / 20%);
}

.confirm-dialog::backdrop {
  background: rgb(32 36 33 / 34%);
}

.confirm-dialog form {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 13px;
  padding: 22px;
}

.dialog-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #e5cbc6;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
}

.dialog-copy {
  min-width: 0;
}

.dialog-copy .section-kicker {
  color: var(--red);
}

.dialog-copy h2 {
  margin-top: 4px;
  font-size: 20px;
}

.dialog-copy p {
  margin: 8px 0 0;
  color: var(--muted);
}

.dialog-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.text-button,
.danger-button,
.inline-action {
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  font-weight: 600;
}

.text-button:hover,
.inline-action:hover {
  border-color: var(--ink-soft);
}

.danger-button {
  border-color: var(--red);
  background: var(--red);
  color: var(--paper);
}

.danger-button:hover {
  background: #913d34;
}

.inline-action {
  min-height: 34px;
  padding: 5px 10px;
}

.primary-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid var(--blue-dark);
  background: var(--blue-dark);
  color: var(--paper);
  font-weight: 700;
}

.primary-button:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--ink);
}

.primary-button[data-loading="true"] .button-spinner {
  display: block;
}

.auth-dialog,
.privacy-dialog {
  width: min(500px, calc(100% - 32px));
  max-height: min(88vh, 820px);
  max-height: min(88dvh, 820px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 20px 70px rgb(32 36 33 / 20%);
}

.auth-dialog {
  width: min(480px, calc(100% - 32px));
  border-color: #cbd2ce;
  border-radius: 8px;
  box-shadow:
    0 24px 64px rgb(32 36 33 / 18%),
    0 4px 14px rgb(32 36 33 / 8%);
}

.privacy-dialog {
  width: min(720px, calc(100% - 32px));
}

.auth-dialog::backdrop,
.privacy-dialog::backdrop {
  background: rgb(32 36 33 / 38%);
}

.dialog-header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 15px;
  border-bottom: 1px solid var(--rule);
}

.dialog-header > div {
  min-width: 0;
}

.dialog-header h2 {
  margin: 3px 0 0;
  font-family:
    "STZhongsong",
    "Songti SC",
    "SimSun",
    serif;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.4;
}

.dialog-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.auth-dialog-header {
  position: relative;
  display: block;
  padding: 27px 58px 20px;
  border-bottom: 0;
  text-align: center;
}

.auth-dialog-header .section-kicker {
  color: var(--blue);
  font-size: 10px;
}

.auth-dialog-header h2 {
  margin-top: 5px;
  font-size: 24px;
}

.auth-dialog-header p {
  margin-top: 7px;
  line-height: 1.6;
}

.auth-dialog-header .icon-button {
  position: absolute;
  top: 14px;
  right: 14px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 0 28px;
  padding: 4px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--field);
}

.auth-tabs button {
  min-height: 36px;
  padding: 7px 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.auth-tabs button:hover:not([data-active="true"]) {
  background: rgb(255 255 255 / 66%);
  color: var(--ink-soft);
}

.auth-tabs button[data-active="true"] {
  background: var(--paper);
  color: var(--blue-dark);
  box-shadow:
    0 1px 3px rgb(32 36 33 / 10%),
    inset 0 0 0 1px rgb(184 192 186 / 58%);
}

.auth-form {
  display: grid;
  gap: 17px;
  padding: 22px 28px 28px;
}

.form-field {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.field-control {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
}

.field-control-icon {
  position: absolute;
  z-index: 1;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--faint);
  pointer-events: none;
}

.form-field .field-control input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 9px 42px;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  outline: 0;
  background: #fcfdfc;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
}

.form-field .field-control input::placeholder {
  color: #959c97;
}

.form-field .field-control:focus-within input {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.form-field .field-control:focus-within .field-control-icon {
  color: var(--blue);
}

.form-field .field-control input:disabled {
  background: var(--field);
  color: var(--muted);
}

.password-toggle {
  position: absolute;
  z-index: 2;
  right: 5px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.password-toggle .icon {
  width: 17px;
  height: 17px;
}

.field-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.verification-code-input {
  font-variant-numeric: tabular-nums;
}

.privacy-check {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 7px;
  padding: 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.privacy-check label {
  display: inline-flex;
  min-width: 0;
  align-items: flex-start;
  gap: 7px;
}

.privacy-check input,
.privacy-acceptance input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--blue-dark);
}

.privacy-check small {
  width: 100%;
  padding-left: 23px;
  color: var(--faint);
  font-size: 11px;
}

.captcha-slot {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border: 1px solid var(--rule);
  background: var(--field);
  color: var(--muted);
  font-size: 12px;
}

.captcha-button {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--blue-dark);
  background: var(--paper);
  color: var(--blue-dark);
  font-weight: 700;
}

.captcha-button:hover:not(:disabled) {
  background: var(--blue-soft);
}

.captcha-slot[data-status="verified"],
.captcha-slot[data-status="local"] {
  border-color: #b8d0c2;
  background: #eef5f1;
  color: var(--green);
}

.captcha-slot[data-status="error"] {
  border-color: #e5cbc6;
  background: var(--red-soft);
  color: var(--red);
}

.form-error {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--red);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.form-error:empty {
  min-height: 0;
  margin: 0;
}

.auth-secondary-actions {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 14px;
}

.auth-dialog-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
  margin-top: 0;
}

.auth-dialog-actions .primary-button {
  width: 100%;
  min-height: 44px;
  margin-left: 0;
  border-radius: 6px;
}

.auth-dialog-actions .danger-button {
  justify-self: start;
}

.privacy-dialog form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  max-height: min(88vh, 820px);
  max-height: min(88dvh, 820px);
}

.privacy-text {
  min-width: 0;
  min-height: 180px;
  padding: 18px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  scrollbar-color: var(--rule-strong) transparent;
  scrollbar-width: thin;
  white-space: pre-wrap;
}

.privacy-acceptance {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  padding: 12px 20px;
  border-top: 1px solid var(--rule);
  background: var(--blue-soft);
  font-size: 13px;
  font-weight: 600;
}

.privacy-acceptance span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.trial-captcha-section {
  padding: 12px 20px 0;
  border-top: 1px solid var(--rule);
}

.privacy-dialog .form-error {
  padding: 0 20px;
}

.privacy-dialog .form-error:not(:empty) {
  padding-top: 9px;
}

.privacy-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--rule);
  background: #fbfcfb;
}

.attachment-review-dialog {
  width: min(780px, calc(100% - 32px));
  max-height: min(86vh, 860px);
  max-height: min(86dvh, 860px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 20px 70px rgb(32 36 33 / 20%);
}

.attachment-review-dialog::backdrop {
  background: rgb(32 36 33 / 38%);
}

.attachment-review-dialog form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  max-height: min(86vh, 860px);
  max-height: min(86dvh, 860px);
}

.review-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 15px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.review-dialog-copy {
  min-width: 0;
}

.review-dialog-copy h2 {
  margin: 3px 0 0;
  font-family:
    "STZhongsong",
    "Songti SC",
    "SimSun",
    serif;
  font-size: 21px;
  font-weight: 600;
}

.review-dialog-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.attachment-review-pages {
  min-width: 0;
  min-height: 0;
  padding: 4px 20px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: var(--rule-strong) transparent;
  scrollbar-width: thin;
}

.review-page {
  min-width: 0;
  padding: 16px 0 2px;
  border-bottom: 1px solid var(--rule);
}

.review-page:last-child {
  border-bottom: 0;
}

.review-page h3 {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.review-block {
  display: grid;
  min-width: 0;
  gap: 6px;
  margin-top: 11px;
}

.review-block:first-of-type {
  margin-top: 0;
}

.review-block-heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.review-block-heading strong {
  font-size: 12px;
}

.review-block-heading small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.review-block textarea {
  display: block;
  width: 100%;
  min-height: 82px;
  padding: 10px 11px;
  resize: vertical;
  border: 1px solid var(--rule-strong);
  outline: 0;
  background: var(--paper);
  line-height: 1.65;
}

.review-block textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.review-block[data-low-confidence="true"] textarea {
  border-color: #d8c382;
  background: #fffdf7;
}

.review-low-confidence {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 6px;
  color: #806318;
  font-size: 11px;
  line-height: 1.45;
}

.review-low-confidence .icon {
  width: 14px;
  height: 14px;
  margin-top: 1px;
}

.review-low-confidence span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.review-dialog-error {
  min-height: 20px;
  margin: 0;
  padding: 7px 20px 0;
  color: var(--red);
  font-size: 12px;
}

.review-dialog-error:empty {
  min-height: 0;
  padding-top: 0;
}

.review-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--rule);
  background: #fbfcfb;
}

.review-character-count {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.review-character-count[data-over-limit="true"] {
  color: var(--red);
  font-weight: 700;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

@media (max-width: 1100px) {
  .app-body,
  .app-shell[data-view="case"] .app-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell[data-view="case"] .app-body {
    grid-template-columns: minmax(420px, 1fr) 292px;
  }

  .history-toggle,
  .history-close {
    display: grid;
  }

  .history-panel {
    position: fixed;
    z-index: 60;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    width: 284px;
    max-width: calc(100% - 48px);
    transform: translateX(-102%);
    box-shadow: 12px 0 36px rgb(32 36 33 / 12%);
    transition: transform 160ms ease;
  }

  .app-shell[data-history-open="true"] .history-panel {
    transform: translateX(0);
  }

  .drawer-backdrop {
    position: fixed;
    z-index: 50;
    inset: var(--header-height) 0 0;
    display: block;
    visibility: hidden;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgb(32 36 33 / 28%);
    opacity: 0;
    pointer-events: none;
    transition:
      opacity 160ms ease,
      visibility 160ms ease;
  }

  .app-shell[data-history-open="true"] .drawer-backdrop {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }
}

@media (hover: none) {
  .history-delete {
    opacity: 1;
  }
}

@media (max-width: 720px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-rows: auto auto;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .app-header {
    position: sticky;
    top: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 58px;
    padding: 9px 11px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 32px;
  }

  .header-path {
    display: none;
  }

  .header-controls {
    gap: 10px;
  }

  .service-state {
    display: none;
  }

  .account-button {
    max-width: min(220px, 46vw);
  }

  .auth-dialog,
  .privacy-dialog {
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .auth-dialog {
    width: calc(100% - 20px);
    max-width: 480px;
    height: fit-content;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    margin: auto;
    border: 1px solid #cbd2ce;
    border-radius: 8px;
    overflow-y: auto;
  }

  .privacy-dialog form {
    height: 100vh;
    height: 100dvh;
    max-height: none;
  }

  .attachment-review-dialog {
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .attachment-review-dialog form {
    height: 100vh;
    height: 100dvh;
    max-height: none;
  }

  .review-dialog-header {
    padding: 14px 16px 12px;
  }

  .attachment-review-pages {
    padding: 2px 16px 16px;
  }

  .review-dialog-error {
    padding-right: 16px;
    padding-left: 16px;
  }

  .review-dialog-footer {
    padding: 11px 16px 14px;
  }

  .app-body,
  .app-shell[data-view="case"] .app-body {
    display: block;
    height: auto;
    min-height: 0;
  }

  .history-panel {
    top: 58px;
  }

  .drawer-backdrop {
    inset: 58px 0 0;
  }

  .main-content {
    overflow: visible;
  }

  .new-screen {
    min-height: 0;
    padding: 40px 17px 28px;
  }

  .new-copy h1 {
    font-size: 27px;
  }

  .trial-strip {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .trial-strip-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .starter-list {
    grid-template-columns: 1fr;
  }

  .starter {
    min-height: 62px;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .starter:last-child {
    border-bottom: 0;
  }

  .case-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 20px 16px 15px;
  }

  .case-title-block h1 {
    font-size: 21px;
  }

  .case-alert {
    margin: 15px 16px 0;
  }

  .thread {
    gap: 22px;
    padding: 24px 16px;
  }

  .communication-context,
  .runtime-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .communication-row,
  .runtime-field {
    border-right: 0;
  }

  .user-message {
    width: 94%;
  }

  .case-composer {
    width: calc(100% - 32px);
    margin-bottom: 24px;
  }

  .case-summary {
    max-height: none;
    padding: 22px 16px 32px;
    overflow: visible;
    border-top: 1px solid var(--rule);
    border-left: 0;
  }

  .privacy-note {
    display: none;
  }

  [data-tooltip]::after {
    display: none;
  }
}

@media (max-width: 430px) {
  :root {
    --header-height: 92px;
  }

  .app-header {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 34px 38px;
    gap: 5px;
    min-height: var(--header-height);
    padding: 7px 10px 8px;
  }

  .brand strong {
    max-width: min(210px, calc(100vw - 74px));
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .quota-summary {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .account-button {
    max-width: 62vw;
  }

  .history-panel {
    top: var(--header-height);
  }

  .drawer-backdrop {
    inset: var(--header-height) 0 0;
  }

  .new-screen {
    padding-right: 14px;
    padding-left: 14px;
  }

  .new-copy {
    margin-bottom: 22px;
  }

  .composer-meta {
    grid-template-columns: 1fr;
    gap: 2px;
    padding-left: 12px;
  }

  .composer-actions {
    justify-content: space-between;
  }

  .attachment-item {
    grid-template-columns: 26px minmax(0, 1fr);
    padding-right: 9px;
    padding-left: 10px;
  }

  .attachment-item-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .attachment-item-warning {
    grid-column: 1 / -1;
    padding-left: 36px;
  }

  .review-dialog-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .review-dialog-footer .dialog-actions {
    justify-content: stretch;
    width: 100%;
    margin-top: 0;
  }

  .review-dialog-footer .text-button,
  .review-dialog-footer .primary-button {
    flex: 1 1 0;
  }

  .dialog-header:not(.auth-dialog-header) {
    padding: 14px 16px 12px;
  }

  .auth-dialog-header {
    padding: 23px 48px 17px;
  }

  .auth-dialog-header .icon-button {
    top: 10px;
    right: 10px;
  }

  .auth-tabs {
    margin: 0 20px;
  }

  .auth-form {
    gap: 15px;
    padding: 19px 20px 22px;
  }

  .captcha-slot {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }

  .captcha-button {
    width: 100%;
  }

  .privacy-text {
    padding: 15px 16px;
  }

  .privacy-acceptance {
    padding: 11px 16px;
  }

  .trial-captcha-section {
    padding: 11px 16px 0;
  }

  .privacy-dialog .form-error {
    padding-right: 16px;
    padding-left: 16px;
  }

  .privacy-dialog-footer {
    padding: 11px 16px 14px;
  }

  .input-error:empty {
    display: none;
  }

  .case-title-block h1 {
    font-size: 20px;
  }

  .assistant-heading {
    flex-direction: column;
    gap: 2px;
  }

  .coverage-heading {
    display: grid;
    gap: 2px;
  }

  .communication-row,
  .runtime-field {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .new-case-block {
    align-items: stretch;
    flex-direction: column;
  }

  .new-case-action {
    width: 100%;
  }

  .citation summary {
    grid-template-columns: 24px minmax(0, 1fr) auto;
  }

  .citation-body {
    padding-left: 32px;
  }
}

@media (max-width: 360px) {
  .brand strong {
    max-width: 190px;
    font-size: 16px;
  }

  .quota-summary {
    font-size: 11px;
  }

  .account-button {
    max-width: 59vw;
    padding-right: 7px;
    padding-left: 7px;
  }

  .auth-dialog-header {
    padding-right: 42px;
    padding-left: 42px;
  }

  .auth-dialog-header h2 {
    font-size: 22px;
  }

  .auth-tabs {
    margin-right: 14px;
    margin-left: 14px;
  }

  .auth-form {
    padding-right: 14px;
    padding-left: 14px;
  }

  .privacy-dialog-footer .text-button,
  .privacy-dialog-footer .primary-button {
    flex: 1 1 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
