:root {
  --ink: #17211b;
  --muted: #637069;
  --soft: #89938d;
  --line: #dce3dd;
  --line-strong: #c6d0c8;
  --background: #f2f5f1;
  --surface: #ffffff;
  --surface-muted: #f7f9f6;
  --green: #1f6c45;
  --green-dark: #174d34;
  --green-soft: #dfeee4;
  --lime: #c6dd69;
  --yellow: #f2c75c;
  --amber-soft: #fff6dd;
  --red: #b8463d;
  --red-soft: #fbe9e7;
  --shadow: 0 16px 44px rgba(26, 48, 35, 0.10);
  font-family: Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--background);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  min-width: 320px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--background);
}

.site-footer {
  min-height: 34px;
  padding: 7px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--green-dark); text-decoration: underline; }
.site-footer a:focus-visible { outline: 3px solid rgba(31,108,69,.22); outline-offset: 2px; }

button, textarea, input, select { font: inherit; letter-spacing: 0; }
button { color: inherit; }

.environment-banner {
  min-height: 36px;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #4a3710;
  background: var(--amber-soft);
  border-bottom: 1px solid #ead79f;
  font-size: 12px;
  line-height: 1.5;
}

.environment-banner.filing {
  color: #12452d;
  background: var(--green-soft);
  border-bottom-color: #b7d3bf;
}

.topbar {
  height: 68px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand-block, .topbar-actions, .panel-heading, .conversation-toolbar,
.context-status, .composer-input-row, .composer-meta, .dialog-header,
.dialog-actions, .result-title-row, .result-actions, .message-meta {
  display: flex;
  align-items: center;
}

.brand-block { min-width: 0; gap: 12px; }
.brand-block h1 { margin: 0; font-size: 17px; line-height: 1.25; font-weight: 700; }
.brand-block p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  background: var(--green-dark);
  overflow: hidden;
}

.brand-mark span, .brand-mark i {
  position: absolute;
  display: block;
  width: 15px;
  height: 8px;
  border-radius: 80% 10% 80% 10%;
  background: var(--lime);
  transform: rotate(-34deg);
}

.brand-mark span { left: 7px; top: 10px; }
.brand-mark i { right: 5px; bottom: 8px; transform: rotate(146deg); }

.topbar-actions { gap: 8px; }

.runtime-badge {
  min-height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
}

.runtime-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.runtime-badge.ready i { background: #31a168; }
.runtime-badge.blocked i { background: var(--red); }

.icon-text-button, .quiet-button, .text-button, .primary-button, .send-button,
.upload-button, .square-button, .account-button, .auth-tab, .inline-link {
  border: 0;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-text-button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: 12px;
  white-space: nowrap;
}

.account-button {
  min-height: 34px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #b8cdbd;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.account-button i { width: 8px; height: 8px; border-radius: 50%; background: var(--soft); }
.account-button.authenticated i { background: #31a168; }
.account-button:hover { border-color: var(--green); background: #d4e8da; }

button:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(31,108,69,.22);
  outline-offset: 2px;
}

.icon-text-button:hover, .quiet-button:hover, .square-button.subtle:hover { background: var(--surface-muted); border-color: var(--line-strong); }

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 242px minmax(480px, 1fr) 294px;
  overflow: hidden;
}

.workspace > * { min-height: 0; }

.history-panel, .evidence-panel {
  min-width: 0;
  background: var(--surface);
  overflow: hidden;
}

.history-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
}

.evidence-panel { overflow-y: auto; border-left: 1px solid var(--line); }

.panel-heading, .conversation-toolbar { justify-content: space-between; gap: 12px; }
.panel-heading { min-height: 76px; padding: 16px; }
.panel-heading h2, .conversation-toolbar h2, .inspector-section h2 { margin: 3px 0 0; font-size: 14px; line-height: 1.35; }

.eyebrow {
  display: block;
  color: var(--soft);
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
}

.square-button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-size: 20px;
  line-height: 1;
}

.square-button:hover { background: var(--green-dark); }
.square-button.subtle { border: 1px solid var(--line); background: var(--surface); color: var(--muted); }

.conversation-list { flex: 1; overflow-y: auto; padding: 0 8px 10px; }
.conversation-empty { margin: 12px; color: var(--soft); font-size: 11px; text-align: center; }

.conversation-item {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  overflow: hidden;
}

.conversation-item:hover { background: var(--surface-muted); }
.conversation-item.active { border-color: #bad1c1; background: var(--green-soft); }
.conversation-select {
  min-width: 0;
  padding: 9px 8px 9px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.conversation-select strong, .conversation-select span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-select strong { font-size: 12px; font-weight: 650; }
.conversation-select span { margin-top: 5px; color: var(--soft); font-size: 10px; }
.conversation-delete {
  min-width: 42px;
  padding: 0 9px;
  border: 0;
  border-left: 1px solid transparent;
  background: transparent;
  color: #9b7772;
  font-size: 10px;
  cursor: pointer;
}
.conversation-item:hover .conversation-delete,
.conversation-item.active .conversation-delete { border-left-color: rgba(184,70,61,.14); }
.conversation-delete:hover, .conversation-delete:focus-visible { color: var(--red); background: var(--red-soft); }

.history-footer { padding: 12px; border-top: 1px solid var(--line); }
.quiet-button { width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 12px; }
.text-button { padding: 6px 0; background: transparent; color: var(--green); font-size: 11px; }
.history-footer .text-button { width: 100%; margin-top: 5px; color: var(--muted); }
.danger-text { color: var(--red); }

.conversation-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: 64px auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #f9fbf8;
}

.conversation-toolbar { padding: 12px 20px; background: rgba(255,255,255,0.84); border-bottom: 1px solid var(--line); }
.context-status { gap: 12px; color: var(--soft); font-size: 11px; }

.current-assessment-panel {
  min-width: 0;
  padding: 9px 20px;
  border-bottom: 1px solid #bfd6c6;
  background: #edf6ef;
}
.current-assessment-main { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.current-assessment-copy { min-width: 0; display: flex; align-items: baseline; gap: 9px; }
.current-assessment-kicker { flex: 0 0 auto; color: var(--green); font-size: 9px; font-weight: 750; letter-spacing: .06em; }
.current-assessment-title { min-width: 0; overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.current-assessment-meta { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.current-assessment-confidence { padding: 2px 6px; border-radius: 999px; color: var(--green-dark); background: #dcecdf; font-weight: 700; }
.current-assessment-revisions { color: #76580f; }

.message-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 24px clamp(18px, 4vw, 56px) 32px;
  scroll-behavior: smooth;
}

.empty-state {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
}

.empty-state h2 { margin: 18px 0 7px; color: var(--ink); font-size: 22px; }
.empty-state p { margin: 0; font-size: 13px; }
.scope-row { margin-top: 18px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.scope-row span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); font-size: 10px; }

.crop-visual { position: relative; width: 112px; height: 112px; border: 1px solid #bed2c3; border-radius: 8px; background: var(--green-soft); overflow: hidden; }
.crop-visual .stem { position: absolute; left: 54px; top: 25px; width: 4px; height: 68px; border-radius: 2px; background: var(--green-dark); transform: rotate(8deg); }
.crop-visual .leaf { position: absolute; width: 44px; height: 23px; border-radius: 90% 8% 90% 8%; background: var(--green); }
.crop-visual .leaf-one { left: 17px; top: 35px; transform: rotate(18deg); }
.crop-visual .leaf-two { right: 15px; top: 57px; transform: rotate(164deg); background: #49915f; }
.crop-visual .scan-line { position: absolute; inset: 0; height: 2px; background: var(--yellow); box-shadow: 0 0 8px rgba(242,199,92,.8); animation: scan 3s ease-in-out infinite; }
@keyframes scan { 0%,100% { transform: translateY(18px); } 50% { transform: translateY(91px); } }

.message { max-width: 760px; margin: 0 auto 20px; }
.message.user { display: flex; justify-content: flex-end; }
.user-bubble { max-width: min(78%, 620px); padding: 11px 13px; border-radius: 8px 8px 2px 8px; background: var(--green-dark); color: #fff; font-size: 13px; line-height: 1.55; }
.user-bubble .image-chip { margin-bottom: 7px; color: #d6ebdc; font-size: 10px; }
.message-image-preview { width: min(520px, 72vw); margin: -3px -5px 8px; border: 1px solid rgba(255,255,255,.18); border-radius: 6px; background: #f4f7f4; overflow: hidden; }
.message-image-preview img { display: block; width: 100%; max-height: 360px; object-fit: contain; }

.assistant-bubble { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 8px 24px rgba(29,60,40,.05); overflow: hidden; }
.assistant-notice { padding: 10px 14px; display: flex; align-items: flex-start; gap: 9px; color: #5d4715; background: var(--amber-soft); border-bottom: 1px solid #ead79f; font-size: 12px; line-height: 1.55; }
.assistant-notice .ai-label { flex: 0 0 auto; padding: 2px 7px; border-radius: 999px; color: #fff; background: #76580f; font-size: 11px; letter-spacing: .02em; }
.result-head { padding: 16px; border-bottom: 1px solid var(--line); }
.result-title-row { align-items: flex-start; justify-content: space-between; gap: 16px; }
.result-title-row h3 { margin: 3px 0 0; font-size: 18px; }
.crop-label { color: var(--green); font-size: 11px; font-weight: 650; }
.diagnosis-mode-badge { display: inline-flex; margin-right: 7px; padding: 2px 7px; border-radius: 999px; color: var(--green-dark); background: var(--green-soft); font-size: 9px; font-weight: 700; vertical-align: 1px; }
.historical-result { border-color: #d7ddd8; box-shadow: none; }
.historical-result .result-head, .historical-result .result-grid { opacity: .68; }
.historical-result-label { display: inline-flex; margin-right: 7px; padding: 2px 7px; border-radius: 999px; color: #6e6251; background: #ece9e2; font-size: 9px; font-weight: 700; }
.historical-result-note { padding: 8px 14px; color: #6e6251; background: #f4f2ed; border-bottom: 1px solid #ded9cf; font-size: 10px; }
.confidence-block { width: 120px; flex: 0 0 120px; text-align: right; }
.confidence-block strong { display: block; font-size: 16px; }
.confidence-block span { color: var(--soft); font-size: 9px; }
.confidence-track { height: 5px; margin-top: 7px; border-radius: 3px; background: #e7ece8; overflow: hidden; }
.confidence-track i { display: block; height: 100%; background: var(--green); }

.result-grid { display: grid; grid-template-columns: 1fr 1fr; }
.result-section { min-width: 0; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.result-section:nth-child(odd) { border-right: 1px solid var(--line); }
.result-section.full { grid-column: 1 / -1; border-right: 0; }
.result-section h4 { margin: 0 0 8px; font-size: 11px; color: var(--muted); }
.result-section p, .result-section li { margin: 0; color: #354239; font-size: 12px; line-height: 1.65; }
.result-section ul { margin: 0; padding-left: 17px; }
.uncertainty { color: #674d16 !important; }
.message-footer { min-height: 42px; padding: 8px 12px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; background: var(--surface-muted); }
.message-meta { gap: 10px; color: var(--soft); font-size: 9px; }
.result-actions { gap: 4px; }
.result-actions button { min-height: 27px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--muted); font-size: 10px; cursor: pointer; }
.result-actions .report-result-button { color: var(--green-dark); border-color: #b9d0c0; }
.result-actions button:hover, .result-actions button:focus-visible { border-color: var(--green); color: var(--green-dark); }

.correction-head { padding: 14px 16px; border-bottom: 1px solid #bfd6c6; background: #edf6ef; }
.correction-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.correction-label { display: block; margin-bottom: 4px; color: var(--green); font-size: 10px; font-weight: 750; }
.correction-head h3 { margin: 0; font-size: 18px; }
.correction-confidence { flex: 0 0 auto; color: var(--green-dark); font-size: 15px; font-weight: 750; }
.correction-reason { margin: 9px 0 0; color: #48564c; font-size: 11px; line-height: 1.6; }
.follow-up-body { padding: 16px; }
.follow-up-body p { margin: 0; color: #354239; font-size: 13px; line-height: 1.75; }
.follow-up-body p + p, .follow-up-body ul + p, .follow-up-body p + ul { margin-top: 9px; }
.follow-up-body ul, .follow-up-body ol { margin: 8px 0 0; padding-left: 20px; color: #354239; font-size: 13px; line-height: 1.75; }

.status-bubble { padding: 14px 16px; }
.status-row { display: flex; gap: 9px; align-items: center; color: var(--muted); font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.75); } }

.composer { padding: 12px clamp(16px, 3vw, 38px) 14px; background: var(--surface); border-top: 1px solid var(--line); }
.diagnosis-mode-row { min-height: 32px; margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.diagnosis-mode-title { color: var(--muted); font-size: 10px; font-weight: 650; }
.diagnosis-mode-switch { display: grid; grid-template-columns: repeat(2, minmax(104px, 1fr)); gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-muted); }
.diagnosis-mode-switch label { position: relative; cursor: pointer; }
.diagnosis-mode-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.diagnosis-mode-switch label > span { min-height: 28px; padding: 4px 10px; display: flex; align-items: baseline; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 5px; color: var(--muted); background: transparent; }
.diagnosis-mode-switch strong { font-size: 10px; }
.diagnosis-mode-switch small { color: var(--soft); font-size: 8px; }
.diagnosis-mode-switch input:checked + span { border-color: #b7d3bf; color: var(--green-dark); background: var(--surface); box-shadow: 0 2px 7px rgba(29,60,40,.07); }
.diagnosis-mode-switch input:checked + span small { color: var(--green); }
.diagnosis-mode-switch input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
.diagnosis-mode-switch input:disabled + span { cursor: not-allowed; opacity: .5; }
.image-preview { min-height: 62px; margin-bottom: 9px; padding: 8px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); }
.image-preview img { width: 46px; height: 46px; border-radius: 4px; object-fit: cover; }
.image-preview div { min-width: 0; flex: 1; }
.image-preview strong, .image-preview span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-preview strong { font-size: 11px; }
.image-preview span { margin-top: 5px; color: var(--soft); font-size: 9px; }

.composer-input-row { gap: 8px; align-items: flex-end; }
.upload-button { height: 42px; padding: 0 12px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); font-size: 11px; }
.upload-button:hover { border-color: var(--green); color: var(--green); }
.upload-button > span:first-of-type { font-size: 18px; }
.composer textarea { min-height: 42px; max-height: 130px; flex: 1; resize: none; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 6px; outline: none; color: var(--ink); background: var(--surface); font-size: 13px; line-height: 1.5; }
.composer textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,108,69,.10); }
.send-button, .primary-button { min-height: 42px; padding: 0 16px; border-radius: 6px; background: var(--green); color: #fff; font-size: 12px; font-weight: 650; }
.send-button:hover, .primary-button:hover { background: var(--green-dark); }
.send-button:disabled { cursor: not-allowed; opacity: .5; }
.composer-meta { justify-content: space-between; gap: 16px; margin-top: 7px; color: var(--soft); font-size: 9px; }

.inspector-section { padding: 18px; border-bottom: 1px solid var(--line); }
.runtime-facts { margin: 15px 0 0; }
.runtime-facts div { padding: 8px 0; display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; border-top: 1px solid var(--line); }
.runtime-facts dt { color: var(--soft); font-size: 10px; }
.runtime-facts dd { margin: 0; overflow-wrap: anywhere; text-align: right; font-size: 10px; font-weight: 600; }
.runtime-facts.compact div { grid-template-columns: 68px minmax(0, 1fr); }
.readiness-blockers { margin-top: 12px; padding: 10px; border-radius: 5px; color: #6b231f; background: var(--red-soft); font-size: 10px; line-height: 1.55; }
.transport-notice { margin-top: 12px; padding: 10px; border-radius: 5px; color: #5d4715; background: var(--amber-soft); font-size: 11px; line-height: 1.6; }
.guidance-list { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 11px; line-height: 1.75; }
.boundary-section p { margin: 10px 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.boundary-section .text-button { display: block; }
.inspector-section > .text-button { margin-top: 9px; }
.pending-contact { color: var(--soft); font-size: 10px; }

.dialog { width: min(92vw, 620px); max-height: 84vh; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(16,29,21,.42); }
.wide-dialog { width: min(92vw, 880px); }
.dialog-header { min-height: 66px; padding: 14px 18px; justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 3px 0 0; font-size: 16px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; max-height: 58vh; overflow-y: auto; }
.info-grid section { padding: 17px 18px; border-bottom: 1px solid var(--line); }
.info-grid section:nth-child(odd) { border-right: 1px solid var(--line); }
.info-grid .info-span-full { grid-column: 1 / -1; border-right: 0; }
.info-grid .disclosure-section { padding: 0; }
.info-grid h3 { margin: 0 0 7px; font-size: 12px; }
.info-grid p, .access-dialog p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.info-disclosure > summary { min-height: 50px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink); font-size: 12px; font-weight: 650; cursor: pointer; list-style: none; }
.info-disclosure > summary::-webkit-details-marker { display: none; }
.info-disclosure > summary::after { content: "+"; color: var(--green); font-size: 18px; font-weight: 500; }
.info-disclosure[open] > summary { border-bottom: 1px solid var(--line); }
.info-disclosure[open] > summary::after { content: "−"; }
.info-disclosure > summary small { margin-left: auto; color: var(--soft); font-size: 10px; font-weight: 500; }
.disclosure-body { padding: 16px 18px 18px; }
.info-section-intro { max-width: 720px; }
.processing-list, .third-party-list { margin-top: 12px; display: grid; gap: 8px; }
.processing-list { grid-template-columns: 1fr 1fr; }
.processing-item, .third-party-item { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); }
.processing-item:last-child { grid-column: 1 / -1; }
.processing-heading, .third-party-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.processing-heading strong, .third-party-heading strong { font-size: 11px; line-height: 1.45; }
.necessity-tag, .processor-status { flex: 0 0 auto; padding: 3px 6px; border-radius: 999px; color: var(--green-dark); background: var(--green-soft); font-size: 9px; line-height: 1.3; }
.sensitive-tag { color: #6b231f; background: var(--red-soft); }
.processing-item dl, .third-party-item dl { margin: 9px 0 0; display: grid; gap: 7px; }
.processing-item dl div, .third-party-item dl div { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px; font-size: 10px; line-height: 1.65; }
.processing-item dt, .third-party-item dt { color: var(--soft); }
.processing-item dd, .third-party-item dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.processing-alert { padding: 10px 12px; border: 1px solid #ead79f; border-radius: 6px; color: #5d4715 !important; background: var(--amber-soft); }
.public-facts { margin: 0; display: grid; gap: 7px; }
.public-facts div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; font-size: 10.5px; line-height: 1.6; }
.public-facts dt { color: var(--soft); }
.public-facts dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.filing-public-link { color: var(--green); font-weight: 650; }
.info-actions { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 7px; }
.compact-button { width: auto; min-height: 32px; padding: 0 10px; }
.danger-outline { color: var(--red); border-color: #e2bbb7; }
.action-feedback { margin-top: 9px !important; color: var(--green-dark) !important; }
.action-feedback.error-text { color: var(--red) !important; }
.legal-note { padding: 13px 18px; color: #5d4715; background: var(--amber-soft); font-size: 10px; line-height: 1.6; }
.access-dialog { padding-bottom: 18px; }
.access-dialog > p, .access-dialog > label, .access-dialog > input, .access-dialog > .dialog-actions { margin-left: 18px; margin-right: 18px; }
.access-dialog > p { margin-top: 16px; }
.field-label { display: block; margin-top: 16px; color: var(--muted); font-size: 10px; }
.text-field { width: calc(100% - 36px); height: 40px; margin-top: 7px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; outline: none; }
.text-field:focus { border-color: var(--green); }
.dialog-actions { justify-content: flex-end; margin-top: 14px; }

.auth-dialog { width: min(92vw, 470px); max-height: 92vh; overflow-y: auto; }
.auth-dialog::backdrop { background: rgba(12,27,18,.66); backdrop-filter: blur(3px); }
.auth-header { padding: 22px 24px 18px; display: flex; align-items: center; gap: 13px; }
.auth-header h2 { margin: 3px 0 0; font-size: 18px; }
.auth-header p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.brand-mark.small { width: 38px; height: 38px; flex-basis: 38px; }
.auth-tabs { margin: 0 24px; padding: 3px; display: grid; grid-template-columns: 1fr 1fr; border-radius: 7px; background: var(--surface-muted); }
.auth-tab { min-height: 36px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; cursor: pointer; }
.auth-tab.active { background: var(--surface); color: var(--green-dark); box-shadow: 0 2px 8px rgba(28,51,37,.08); }
.auth-environment-notice { margin: 14px 24px 0; padding: 10px 12px; border: 1px solid #ead79f; border-radius: 6px; color: #5d4715; background: var(--amber-soft); font-size: 11px; line-height: 1.65; }
.auth-environment-notice.filing { color: var(--green-dark); border-color: #b7d3bf; background: var(--green-soft); }
.auth-environment-notice.review { color: #164e73; border-color: #b6d4e6; background: #eaf5fb; }
.auth-form { padding: 5px 24px 24px; }
.review-demo-panel { margin-top: 13px; padding: 11px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #b6d4e6; border-radius: 6px; background: #f3f9fc; }
.review-demo-panel[hidden] { display: none; }
.review-demo-panel div { min-width: 0; }
.review-demo-panel strong { display: block; color: #164e73; font-size: 11px; }
.review-demo-panel p { margin: 4px 0 0; color: #446b82; font-size: 9px; line-height: 1.55; }
.review-demo-panel .quiet-button { flex: 0 0 auto; color: #164e73; border-color: #a8cadc; }
.auth-feedback-notice { margin: 13px 0 0; padding: 10px 12px; border: 1px solid #b7d3bf; border-radius: 6px; color: var(--green-dark); background: var(--green-soft); font-size: 10.5px; line-height: 1.6; }
.auth-feedback-notice.error { color: #6b231f; border-color: #e2bbb7; background: var(--red-soft); }
.auth-form .text-field, .identity-form .text-field, .delete-account-panel .text-field { width: 100%; }
.otp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.otp-row .quiet-button { min-width: 112px; height: 40px; margin-top: 7px; }
.development-notice { margin: 10px 0 0; padding: 10px; border: 1px solid #ead79f; border-radius: 6px; color: #604814; background: var(--amber-soft); font-size: 10px; line-height: 1.6; }
.consent-panel { margin-top: 15px; padding: 12px; display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); }
.registration-data-notice { margin: 0 0 2px; padding-bottom: 9px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.65; }
.consent-panel label, .sensitive-consent { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.consent-panel input, .sensitive-consent input { width: 15px; height: 15px; margin: 1px 0 0; flex: 0 0 15px; accent-color: var(--green); }
.inline-link { padding: 0; border: 0; background: transparent; color: var(--green); font-size: inherit; cursor: pointer; }
.auth-submit { width: 100%; margin-top: 17px; }
.auth-footnote { margin: 12px 0 0; color: var(--soft); font-size: 10.5px; line-height: 1.6; }
.auth-public-links { margin-top: 10px; padding-top: 9px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; border-top: 1px solid var(--line); }
.auth-public-links .text-button { padding: 2px 0; font-size: 10.5px; }

.account-dialog { width: min(94vw, 700px); }
.account-content { max-height: 70vh; overflow-y: auto; }
.account-status-card { margin: 18px 18px 12px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.account-status-card div { min-width: 0; padding: 13px; background: var(--surface-muted); }
.account-status-card div + div { border-left: 1px solid var(--line); }
.account-status-card span, .account-status-card strong { display: block; }
.account-status-card span { color: var(--soft); font-size: 9px; }
.account-status-card strong { margin-top: 6px; overflow-wrap: anywhere; font-size: 11px; }
.verification-progress { margin: 0 18px 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.verification-progress > div { min-width: 0; min-height: 58px; padding: 10px; display: flex; align-items: center; gap: 8px; background: var(--surface); }
.verification-progress > div + div { border-left: 1px solid var(--line); }
.verification-progress > div > span { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--soft); font-size: 9px; font-weight: 750; }
.verification-progress p, .verification-progress strong { display: block; }
.verification-progress p { min-width: 0; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.35; }
.verification-progress strong { margin-top: 3px; color: var(--soft); font-size: 9px; }
.verification-progress > div.complete { background: #eff7f1; }
.verification-progress > div.complete > span { color: #fff; border-color: var(--green); background: var(--green); }
.verification-progress > div.complete strong { color: var(--green-dark); }
.verification-progress > div.blocked { background: var(--red-soft); }
.verification-progress > div.blocked > span { color: #fff; border-color: var(--red); background: var(--red); }
.verification-progress > div.blocked strong { color: var(--red); }
.identity-mode-notice { margin: 0 18px 16px; padding: 10px 12px; border-radius: 6px; color: #604814; background: var(--amber-soft); font-size: 10px; line-height: 1.6; }
.identity-evidence-panel { margin: 0 18px 14px; padding: 11px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; border: 1px solid #b7d3bf; border-radius: 6px; background: #eff7f1; }
.identity-evidence-panel[hidden] { display: none; }
.identity-evidence-panel div { min-width: 0; }
.identity-evidence-panel span, .identity-evidence-panel strong { display: block; }
.identity-evidence-panel span { color: var(--soft); font-size: 9px; }
.identity-evidence-panel strong { margin-top: 4px; overflow-wrap: anywhere; color: var(--green-dark); font-size: 10px; }
.identity-evidence-panel p { grid-column: 1 / -1; margin: 2px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.account-enforcement-notice { margin: 0 18px 12px; padding: 11px 12px; border: 1px solid #e2bbb7; border-radius: 6px; color: #6b231f; background: var(--red-soft); font-size: 10px; line-height: 1.65; }
.identity-form, .account-actions-section { padding: 17px 18px 19px; border-top: 1px solid var(--line); }
.identity-form h3, .account-actions-section h3 { margin: 0 0 7px; font-size: 12px; }
.identity-form > p, .account-actions-section > p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.sensitive-summary { margin-top: 12px; padding: 10px 12px; border: 1px solid #ead79f; border-radius: 6px; background: var(--amber-soft); }
.sensitive-summary strong { display: block; color: #5d4715; font-size: 10px; }
.sensitive-summary p { margin: 5px 0 0; color: #6e5a2d; font-size: 9px; line-height: 1.7; }
.identity-form .primary-button { width: 100%; margin-top: 15px; }
.sample-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 12px; }
.sample-row .text-button { padding-bottom: 0; }
.danger-text { color: var(--red); }
.sensitive-consent { margin-top: 13px; }
.consent-management-section .info-actions { margin-bottom: 12px; }
.consent-renewal-panel { margin-top: 12px; padding: 12px; display: grid; gap: 9px; border: 1px solid #d5dfd7; border-radius: 6px; background: var(--green-soft); }
.consent-renewal-panel[hidden] { display: none; }
.consent-renewal-panel p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.consent-renewal-panel label { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.consent-renewal-panel input { width: 15px; height: 15px; margin: 1px 0 0; flex: 0 0 15px; accent-color: var(--green); }
.consent-renewal-panel .primary-button { width: 100%; margin-top: 2px; }
.consent-effect-note { margin-top: 10px !important; color: var(--soft) !important; }
.delete-account-panel { margin-top: 14px; padding: 13px; border: 1px solid #e2bbb7; border-radius: 6px; background: var(--red-soft); }
.delete-account-panel > p:first-child { margin: 0 0 10px; color: #6b231f; font-size: 10px; line-height: 1.65; }
.delete-account-panel .field-label { color: #6b231f; }
.delete-account-panel .danger-button { width: 100%; margin-top: 12px; }
.danger-button { background: var(--red); }
.danger-button:hover { background: #8d312b; }

.legal-dialog { width: min(92vw, 760px); }
.document-version { margin: 4px 0 0; color: var(--soft); font-size: 9px; }
.legal-document { max-height: 68vh; padding: 18px 22px 24px; overflow-y: auto; }
.legal-document h3 { margin: 20px 0 6px; font-size: 12px; }
.legal-document p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.legal-document .draft-warning { padding: 11px 12px; border: 1px solid #ead79f; border-radius: 6px; color: #5d4715; background: var(--amber-soft); }

.complaint-dialog { width: min(92vw, 660px); }
.dialog-form { padding: 16px 18px 18px; border-bottom: 1px solid var(--line); }
.dialog-form .field-label { margin-top: 13px; }
.dialog-form .text-field { width: 100%; margin-top: 7px; }
.select-field { appearance: auto; background: var(--surface); }
.textarea-field {
  width: 100%;
  min-height: 104px;
  margin-top: 7px;
  padding: 10px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
}
.textarea-field:focus { border-color: var(--green); }
.form-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.complaint-receipt { margin: 14px 18px 0; padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; border: 1px solid #b7d3bf; border-radius: 6px; background: var(--green-soft); }
.complaint-receipt[hidden] { display: none; }
.complaint-receipt strong { grid-column: 1 / -1; font-size: 11px; }
.complaint-receipt code { min-width: 0; overflow-wrap: anywhere; color: var(--green-dark); font-size: 11px; }
.complaint-lookup { padding: 2px 18px 16px; border-bottom: 1px solid var(--line); }
.lookup-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.complaint-lookup .text-field { width: 100%; }
.complaint-lookup .quiet-button { height: 40px; }
.complaint-lookup .complaint-list { margin-top: 10px; }
.complaint-history { max-height: 210px; padding: 15px 18px 18px; overflow-y: auto; }
.complaint-history h3 { margin: 0 0 10px; font-size: 12px; }
.complaint-list { display: grid; gap: 7px; }
.complaint-item { padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); }
.complaint-item strong { display: block; font-size: 11px; }
.complaint-item span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.complaint-item .complaint-content { white-space: pre-wrap; overflow-wrap: anywhere; }
.complaint-item .complaint-response { color: var(--green-dark); font-size: 10px; }

.toast { position: fixed; z-index: 20; left: 50%; bottom: 24px; max-width: min(90vw, 460px); padding: 10px 14px; border-radius: 6px; color: #fff; background: #26342b; box-shadow: var(--shadow); font-size: 11px; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity 160ms ease, transform 160ms ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #7d2b25; }
.mobile-only { display: none; }

@media (max-width: 1080px) {
  .workspace { grid-template-columns: 220px minmax(420px, 1fr); }
  .evidence-panel { display: none; }
}

@media (max-width: 760px) {
  body { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  .site-footer { min-height: 30px; padding: 5px 8px; gap: 5px; flex-wrap: wrap; font-size: 10px; }
  .environment-banner { min-height: 44px; padding: 7px 12px; text-align: left; }
  .topbar { height: 62px; padding: 0 12px; }
  .brand-block h1 { max-width: 160px; font-size: 12px; }
  .brand-block p { display: none; }
  .brand-mark { width: 30px; height: 30px; flex-basis: 30px; }
  .runtime-badge { display: none; }
  .mobile-only { display: inline-flex; }
  .icon-text-button { padding: 0 8px; }
  .account-button { max-width: 116px; padding: 0 8px; }
  .account-button span { overflow: hidden; text-overflow: ellipsis; }
  .workspace { position: relative; height: auto; min-height: 0; flex: 1; display: block; }
  .history-panel { position: absolute; z-index: 12; top: 0; bottom: 0; left: 0; width: min(86vw, 300px); box-shadow: var(--shadow); transform: translateX(-104%); transition: transform 180ms ease; }
  .history-panel.open { transform: translateX(0); }
  .conversation-panel { height: 100%; grid-template-rows: 56px auto minmax(0, 1fr) auto; }
  .conversation-toolbar { padding: 10px 14px; }
  .current-assessment-panel { padding: 8px 12px; }
  .current-assessment-main { gap: 8px; }
  .current-assessment-copy { display: block; }
  .current-assessment-kicker { display: block; margin-bottom: 2px; }
  .current-assessment-title { display: block; max-width: 58vw; }
  .current-assessment-meta { display: block; text-align: right; }
  .current-assessment-revisions { display: block; margin-top: 2px; }
  .context-status > span { display: none; }
  .message-list { padding: 18px 12px 22px; }
  .empty-state h2 { font-size: 19px; }
  .user-bubble { max-width: 88%; }
  .result-grid { grid-template-columns: 1fr; }
  .result-section:nth-child(odd) { border-right: 0; }
  .confidence-block { width: 94px; flex-basis: 94px; }
  .composer { padding: 10px; }
  .diagnosis-mode-title { display: none; }
  .diagnosis-mode-switch { width: 100%; }
  .upload-button { width: 42px; padding: 0; justify-content: center; }
  .upload-button > span:last-child { display: none; }
  .send-button { padding: 0 12px; }
  .composer-meta span:first-child { max-width: 70%; }
  .info-grid { grid-template-columns: 1fr; }
  .info-grid section:nth-child(odd) { border-right: 0; }
  .info-grid .info-span-full, .processing-item:last-child { grid-column: auto; }
  .processing-list { grid-template-columns: 1fr; }
  .processing-item dl div, .third-party-item dl div { grid-template-columns: 64px minmax(0, 1fr); }
  .message-footer { align-items: flex-start; }
  .result-actions { width: 100%; justify-content: flex-end; }
  .auth-dialog { width: calc(100vw - 20px); }
  .auth-header { padding: 19px 18px 15px; }
  .auth-tabs { margin: 0 18px; }
  .auth-environment-notice { margin-left: 18px; margin-right: 18px; }
  .auth-form { padding: 5px 18px 20px; }
  .review-demo-panel { align-items: flex-start; flex-direction: column; }
  .account-status-card { grid-template-columns: 1fr; }
  .account-status-card div + div { border-left: 0; border-top: 1px solid var(--line); }
  .verification-progress { grid-template-columns: 1fr 1fr; }
  .verification-progress > div + div { border-left: 0; }
  .verification-progress > div:nth-child(even) { border-left: 1px solid var(--line); }
  .verification-progress > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .identity-evidence-panel { grid-template-columns: 1fr; }
  .identity-evidence-panel p { grid-column: auto; }
  .otp-row { grid-template-columns: minmax(0, 1fr) 104px; }
  .otp-row .quiet-button { min-width: 0; }
}

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