/* Zhicha industrial app shell — authoritative presentation layer. */
:root {
  --ia-ink: #112e2b;
  --ia-muted: #667b77;
  --ia-brand: #075a55;
  --ia-brand-deep: #043f3b;
  --ia-brand-strong: #086b63;
  --ia-mint: #e6f3ef;
  --ia-mint-strong: #b9e8db;
  --ia-canvas: #f1f5f3;
  --ia-card: #ffffff;
  --ia-line: #d8e3df;
  --ia-danger: #b44539;
  --ia-shadow: 0 16px 42px rgba(21, 59, 53, .08);
}

[hidden] { display: none !important; }

html { background: var(--ia-canvas); }
body {
  margin: 0;
  background:
    radial-gradient(circle at 14% 4%, rgba(170, 229, 216, .28), transparent 28rem),
    var(--ia-canvas);
  color: var(--ia-ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
.shell { width: min(100%, 540px); min-height: 100dvh; margin: 0 auto; padding: 0 18px 116px; }

/* Brand symbol: enterprise document + knowledge-search halo. */
.product-symbol {
  position: relative; display: inline-block; overflow: hidden;
  background: var(--ia-brand) url("/static/icon.svg") center / cover no-repeat;
}
.product-symbol::before, .product-symbol i, .product-symbol b { display: none; }

.app-splash { background: var(--ia-canvas); color: var(--ia-ink); }
.splash-logo { width: 78px; height: 78px; border-radius: 25px; box-shadow: 0 16px 32px rgba(7, 90, 85, .2); }
.app-header {
  position: sticky; top: 0; z-index: 32; margin: 0 -18px 16px; padding: max(14px, env(safe-area-inset-top)) 18px 12px;
  background: rgba(241, 245, 243, .92); border: 0; backdrop-filter: blur(20px) saturate(150%);
}
.brand-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 11px; }
.brand-mark { width: 48px; height: 48px; border: 0; border-radius: 15px; box-shadow: none; }
.brand-copy { min-width: 0; }
.brand-copy .eyebrow { display: none; }
.brand-copy h1 { margin: 0; color: var(--ia-ink); font-size: 1.04rem; letter-spacing: .01em; }
.brand-copy .workspace-title { margin: 2px 0 0; color: var(--ia-muted); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-search, .secure-status {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--ia-line); border-radius: 14px;
  background: rgba(255,255,255,.82); color: var(--ia-ink); box-shadow: none;
}
.header-search svg, .secure-status svg { width: 21px; height: 21px; }
.secure-status { font-size: 0; }

#protected-content { min-height: calc(100dvh - 94px); }
.ask-card, #result, .document-panel, .admin-page, .account-security { animation: ia-view-in .22s ease both; }
@keyframes ia-view-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* 1. Ask home */
.ask-card { display: grid; gap: 15px; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.knowledge-picker { margin: 0; border: 0; background: transparent; }
.selected-kb-card {
  min-height: 62px; padding: 11px 16px 11px 42px; border: 0; border-radius: 19px; background: var(--ia-mint); box-shadow: none;
}
.selected-kb-card::before { left: 17px; width: 10px; height: 10px; border: 5px solid rgba(7,90,85,.12); background: #309681; }
.selected-kb-card > span { color: var(--ia-muted); font-size: .68rem; }
.selected-kb-card strong { margin-top: 1px; color: var(--ia-ink); font-size: .94rem; }
.selected-kb-card .subtle { display: none; }
.knowledge-fields { margin-top: 8px; padding: 16px; border: 1px solid var(--ia-line); border-radius: 18px; background: #fff; box-shadow: var(--ia-shadow); }
.question-hero {
  position: relative; display: block; overflow: hidden; padding: 24px 20px 18px; border: 0; border-radius: 28px;
  background: var(--ia-brand-deep); color: #fff; box-shadow: 0 18px 38px rgba(4,63,59,.2);
}
.question-hero::after { content: ""; position: absolute; right: -70px; top: -48px; width: 210px; height: 210px; border: 28px solid rgba(148,224,204,.09); border-radius: 50%; pointer-events: none; }
.question-hero-copy { position: relative; z-index: 1; padding: 0 6px 18px; }
.question-hero-copy p { margin: 0 0 9px; color: #bce7dc; font-size: .72rem; }
.question-hero-copy h2 { max-width: 18rem; margin: 0; color: #fff; font-size: 1.42rem; line-height: 1.28; letter-spacing: -.02em; }
.question-hero-copy > span { display: block; max-width: 22rem; margin-top: 8px; color: rgba(255,255,255,.72); font-size: .82rem; line-height: 1.6; }
.hero-graphic { display: none; }
.question-box {
  position: relative; z-index: 2; display: grid; grid-template-columns: 1fr auto; gap: 10px; min-height: 174px; padding: 15px;
  border: 0; border-radius: 22px; background: #fff; box-shadow: none;
}
.question-box textarea { grid-column: 1 / -1; min-height: 92px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ia-ink); font-size: .94rem; line-height: 1.65; resize: none; box-shadow: none; }
.question-box textarea:focus { box-shadow: none; }
.question-box textarea:focus-visible { outline: 3px solid #178d80; outline-offset: 6px; border-radius: 6px; }
.composer-trust { align-self: center; color: var(--ia-muted); font-size: .75rem; }
.question-box button[type="submit"] { align-self: end; min-width: 104px; min-height: 48px; border: 0; border-radius: 15px; background: var(--ia-brand-strong); box-shadow: none; }
.answer-mode-selector { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 0; padding: 0; border: 0; }
.answer-mode-selector legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.answer-mode-selector label { position: relative; display: grid; gap: 1px; min-width: 0; padding: 8px 9px; border: 1px solid var(--ia-line); border-radius: 12px; background: #f8fbfa; color: var(--ia-muted); cursor: pointer; }
.answer-mode-selector input { position: absolute; opacity: 0; pointer-events: none; }
.answer-mode-selector span { color: var(--ia-ink); font-size: .78rem; font-weight: 800; }
.answer-mode-selector small { overflow: hidden; font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
.answer-mode-selector label:has(input:checked) { border-color: #79bdb1; background: var(--ia-mint); box-shadow: inset 0 0 0 1px rgba(4,109,98,.08); }
.answer-mode-selector label:has(input:checked) span { color: var(--ia-brand); }
.answer-mode-selector label:focus-within { outline: 2px solid rgba(4,109,98,.24); outline-offset: 2px; }
.analysis-shortcuts { gap: 10px; }
.analysis-shortcuts button { min-height: 52px; border: 1px solid var(--ia-line); border-radius: 17px; background: #fff; color: var(--ia-brand); box-shadow: none; }
.quick-questions { display: flex; gap: 8px; padding: 0; overflow-x: auto; scrollbar-width: none; }
.quick-questions::before { flex: 0 0 100%; margin: 10px 0 0; font-size: .86rem; color: var(--ia-ink); }
.quick-questions button { flex: 0 0 auto; min-height: 38px; border: 1px solid var(--ia-line); border-radius: 999px; background: #fff; color: #345650; }
.notice { padding: 14px 16px; border: 0; border-radius: 18px; background: #e8efec; box-shadow: none; }

/* 2. Answer detail */
.answer-empty-state { min-height: 34dvh; padding: 36px 24px; border: 1px solid var(--ia-line); border-radius: 24px; background: #fff; text-align: center; box-shadow: none; }
.answer-empty-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 24px; border-radius: 21px; background: var(--ia-mint); color: var(--ia-brand); }
.answer-empty-icon svg { width: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.answer-empty-state p { margin: 0; color: var(--ia-brand); font-size: .72rem; font-weight: 800; letter-spacing: .14em; }
.answer-empty-state h2 { margin: 9px 0 10px; font-size: 1.2rem; }
.answer-empty-state > span { display: block; color: var(--ia-muted); font-size: .84rem; line-height: 1.75; }
.answer-empty-state button { min-height: 48px; margin-top: 26px; padding: 0 24px; border: 0; border-radius: 15px; background: var(--ia-brand); color: #fff; font: inherit; font-weight: 800; }
.answer-processing-state { display: grid; place-items: center; min-height: 48dvh; padding: 34px 22px; border: 1px solid var(--ia-line); border-radius: 24px; background: #fff; text-align: center; box-shadow: var(--ia-shadow); }
.answer-processing-state > p:first-of-type { margin: 14px 0 2px; color: var(--ia-brand); font-size: .72rem; font-weight: 800; letter-spacing: .13em; }
.answer-processing-state h2 { margin: 5px 0 7px; font-size: 1.18rem; }
.answer-processing-state > span:not(.analysis-spinner) { max-width: 100%; color: var(--ia-muted); font-size: .82rem; line-height: 1.55; overflow-wrap: anywhere; }
.analysis-spinner { width: 42px; height: 42px; border: 4px solid var(--ia-mint-strong); border-top-color: var(--ia-brand); border-radius: 50%; animation: ia-spin .9s linear infinite; }
@keyframes ia-spin { to { transform: rotate(360deg); } }
.analysis-progress-steps { display: grid; grid-template-columns: repeat(7, minmax(76px, 1fr)); width: 100%; margin: 25px 0 14px; padding: 0 0 8px; overflow-x: auto; overscroll-behavior-inline: contain; list-style: none; counter-reset: progress; scrollbar-width: thin; }
.analysis-progress-steps li { position: relative; padding-top: 27px; color: #5f746f; font-size: .75rem; counter-increment: progress; }
.analysis-progress-steps li::before { content: counter(progress); position: absolute; z-index: 1; top: 0; left: 50%; display: grid; place-items: center; width: 21px; height: 21px; border: 2px solid #d6e2de; border-radius: 50%; background: #fff; transform: translateX(-50%); }
.analysis-progress-steps li::after { content: ""; position: absolute; top: 10px; right: 50%; width: 100%; height: 2px; background: #dfe8e5; }
.analysis-progress-steps li:first-child::after { display: none; }
.analysis-progress-steps li.is-active, .analysis-progress-steps li.is-complete { color: var(--ia-brand); font-weight: 800; }
.analysis-progress-steps li.is-active::before, .analysis-progress-steps li.is-complete::before { border-color: var(--ia-brand); background: var(--ia-brand); color: #fff; }
.answer-processing-state .loading { margin: 0; color: var(--ia-brand); font-size: .82rem; line-height: 1.55; }
.answer-processing-state #cancel-answer-job { min-height: 42px; margin-top: 14px; padding: 8px 16px; }
.answer-processing-state .error { width: 100%; margin: 10px 0 0; border: 1px solid #efd0cb; background: #fff1ef; text-align: left; }
.answer-job-history-panel { margin-top: 18px; border: 1px solid var(--ia-line); border-radius: 18px; background: #fff; box-shadow: var(--ia-shadow); }
.answer-job-history-panel > summary { padding: 16px 18px; color: var(--ia-brand); font-weight: 800; cursor: pointer; }
.answer-job-history-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px 12px; }
.answer-job-history-heading p { margin: 0; color: var(--ia-muted); font-size: .82rem; line-height: 1.5; }
.answer-job-history-heading button { flex: 0 0 auto; min-height: 40px; margin: 0; }
.answer-job-history-list { display: grid; gap: 10px; padding: 0 18px 18px; }
.answer-job-history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 13px 14px; border: 1px solid #dfe8e5; border-radius: 14px; background: #f8fbfa; }
.answer-job-history-item strong, .answer-job-history-item span { overflow-wrap: anywhere; }
.answer-job-history-item span { color: var(--ia-muted); font-size: .78rem; }
.answer-job-history-item button { grid-column: 2; grid-row: 1 / span 2; min-height: 40px; margin: 0; }
#result { gap: 14px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.result-heading { padding: 20px; border: 0; border-radius: 24px; background: var(--ia-brand-deep); color: #fff; }
.result-heading h2 { color: #fff; font-size: 1.2rem; }
.result-heading > div > span { color: #a9dfd2; }
.evidence-ready { background: rgba(255,255,255,.11); color: #dff9f2; }
#result[data-status="degraded"] .evidence-ready { background: rgba(255,183,77,.16); color: #ffe2b5; }
#result[data-status="blocked"] .evidence-ready { background: rgba(255,126,112,.16); color: #ffd6d1; }
.answer, .visual-review-panel, .photo-review-panel, .feedback, .evidence { border: 1px solid var(--ia-line); border-radius: 22px; background: #fff; box-shadow: none; }
.answer { padding: 22px 19px; color: #193733; font-size: .91rem; line-height: 1.82; white-space: normal; }
.answer h2, .answer h3 { color: var(--ia-brand-deep); }
.answer h3 { margin-top: 24px; padding-top: 14px; border-top: 1px solid #e8eeec; font-size: 1rem; }
.answer p { margin: 0 0 15px; }
.answer p:last-child { margin-bottom: 0; }
.answer ul, .answer ol { margin: 5px 0 17px; padding-left: 1.35rem; }
.answer li { padding-left: 2px; }
.answer code { padding: 2px 6px; border-radius: 6px; background: #edf4f2; color: var(--ia-brand-deep); font-size: .86em; }
.answer-tier { display: inline-flex; align-items: center; margin: 0 5px 3px 0; padding: 2px 7px; border-radius: 999px; background: #e8f5f1; color: #08796c; font-size: .72em; font-weight: 900; line-height: 1.55; vertical-align: .08em; }
.answer-tier.is-inference { background: #e8f1f7; color: #286d91; }
.answer-tier.is-general { background: #fff1dc; color: #94601f; }
.answer-tier.is-unknown { background: #f4e9ec; color: #82515d; }
.answer-evidence-legend { display: flex; flex-wrap: wrap; gap: 7px 12px; padding: 11px 14px; border: 1px solid var(--ia-line); border-radius: 15px; background: #f8fbfa; color: var(--ia-muted); font-size: .7rem; }
.answer-evidence-legend span { display: inline-flex; align-items: center; gap: 6px; }
.answer-evidence-legend i { width: 8px; height: 8px; border-radius: 50%; background: #6d8580; }
.answer-evidence-legend .tier-direct { background: #08796c; }
.answer-evidence-legend .tier-inference { background: #3f83a6; }
.answer-evidence-legend .tier-general { background: #c98636; }
.answer-evidence-legend .tier-unknown { background: #9b6a75; }
.feedback-reasons { display: flex; flex: 1 0 100%; flex-wrap: wrap; gap: 7px; padding-top: 8px; border-top: 1px solid var(--ia-line); }
.feedback-reasons[hidden] { display: none; }
.feedback-reasons > span { flex: 1 0 100%; color: var(--ia-muted); font-size: .72rem; }
.feedback-reasons button { min-height: 34px; font-size: .72rem; }
.answer-citation { display: inline-flex; align-items: center; justify-content: center; margin: 0 2px; padding: 1px 5px; border: 0; border-radius: 7px; background: var(--ia-mint); color: var(--ia-brand); font: inherit; font-size: .78em; font-weight: 900; line-height: 1.5; text-decoration: none; vertical-align: .12em; cursor: pointer; }
.answer-citation:hover, .answer-citation:focus-visible { background: var(--ia-brand); color: #fff; outline: none; }
.evidence-card.is-citation-target { border-color: var(--ia-brand); box-shadow: 0 0 0 3px rgba(4, 109, 98, .14), 0 18px 38px rgba(4, 63, 57, .12); }
.answer-table-scroll { max-width: 100%; margin: 13px 0 18px; overflow-x: auto; border: 1px solid var(--ia-line); border-radius: 14px; background: #fff; }
.answer table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: .84rem; line-height: 1.58; }
.answer th, .answer td { padding: 11px 12px; border-bottom: 1px solid #e5eeeb; text-align: left; vertical-align: top; }
.answer th { background: #edf6f3; color: var(--ia-brand-deep); font-size: .76rem; font-weight: 850; white-space: nowrap; }
.answer tr:last-child td { border-bottom: 0; }
.answer tbody tr:nth-child(even) { background: #fafcfb; }
.answer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.answer-actions .secondary-action { min-height: 42px; margin: 0; padding: 8px 14px; border-radius: 12px; }
.evidence-heading { margin: 10px 3px 0; color: var(--ia-ink); font-size: 1rem; }
.evidence { gap: 8px; padding: 9px; }
.evidence-card { padding: 0 !important; overflow: hidden; border-radius: 14px !important; }
.evidence-card > summary { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 11px; align-items: center; min-height: 62px; padding: 10px 13px; list-style: none; }
.evidence-card > summary::-webkit-details-marker { display: none; }
.evidence-reference { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--ia-mint); color: var(--ia-brand); font-size: .76rem; font-weight: 900; }
.evidence-card > summary > span:last-child { display: grid; gap: 3px; min-width: 0; padding-right: 24px; }
.evidence-card > summary strong { overflow: hidden; color: var(--ia-ink); font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.evidence-card > summary small { color: var(--ia-muted); font-size: .69rem; font-weight: 600; }
.evidence-card > summary::after { content: "+"; position: absolute; right: 17px; color: var(--ia-brand); font-size: 1.1rem; font-weight: 500; }
.evidence-card[open] > summary::after { content: "−"; }
.evidence-card-body { padding: 13px 15px 15px; border-top: 1px solid #e7efec; }
.evidence-metadata { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.evidence-metadata span { padding: 4px 7px; border-radius: 999px; background: #edf4f2; color: #55716b; font-size: .66rem; }
.evidence-card blockquote { margin: 0 0 12px; padding: 11px 12px; border-left: 3px solid #55a997; border-radius: 0 10px 10px 0; background: #f5f9f8; color: #3d5c56; font-size: .78rem; line-height: 1.68; white-space: pre-wrap; }
.evidence-source-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.evidence-card .source-link { display: inline-flex; min-height: 34px; align-items: center; padding: 5px 10px; border: 1px solid var(--ia-brand); border-radius: 9px; background: var(--ia-brand); color: #fff; font: inherit; font-size: .72rem; font-weight: 800; text-decoration: none; cursor: pointer; }
.evidence-card .secondary-source-link { background: #fff; color: var(--ia-brand); }
.evidence-page-dialog { width: min(94vw, 1080px); max-width: none; height: min(92vh, 920px); max-height: none; padding: 0; border: 0; border-radius: 24px; background: transparent; color: var(--ia-ink); box-shadow: 0 28px 80px rgba(4, 45, 42, .3); }
.evidence-page-dialog::backdrop { background: rgba(5, 27, 25, .64); backdrop-filter: blur(4px); }
.evidence-page-dialog > section { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; overflow: hidden; border: 1px solid rgba(255,255,255,.45); border-radius: 24px; background: #eef5f2; }
.evidence-page-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border-bottom: 1px solid var(--ia-line); background: #fff; }
.evidence-page-dialog header span { display: block; margin-bottom: 3px; color: var(--ia-brand); font-size: .68rem; font-weight: 850; letter-spacing: .08em; }
.evidence-page-dialog header h2 { margin: 0; color: var(--ia-ink); font-size: 1rem; }
.evidence-page-dialog header > button { display: grid; flex: 0 0 42px; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 13px; background: var(--ia-mint); color: var(--ia-brand); font-size: 1.4rem; cursor: pointer; }
.evidence-page-stage { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 18px; text-align: center; touch-action: pinch-zoom; }
.evidence-page-stage > p { display: grid; min-height: 240px; place-items: center; margin: 0; color: var(--ia-muted); font-size: .85rem; }
.evidence-page-stage > img { display: block; width: 100%; max-width: none; height: auto; margin: 0 auto; border-radius: 8px; background: #fff; box-shadow: 0 10px 32px rgba(4, 56, 50, .13); transition: width .18s ease; }
.evidence-page-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--ia-line); background: #fff; }
.evidence-page-zoom { display: flex; align-items: center; gap: 6px; }
.evidence-page-zoom button, .evidence-page-dialog footer > a { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; padding: 7px 12px; border: 1px solid var(--ia-line); border-radius: 11px; background: #fff; color: var(--ia-brand); font: inherit; font-size: .74rem; font-weight: 800; text-decoration: none; cursor: pointer; }
.evidence-page-zoom button:first-child, .evidence-page-zoom button:last-child { width: 38px; padding: 0; font-size: 1rem; }
.evidence-page-zoom button:disabled { opacity: .42; cursor: default; }
@media (max-width: 640px) {
  .answer-table-scroll { overflow: visible; border: 0; border-radius: 0; background: transparent; }
  .answer table, .answer tbody { display: grid; min-width: 0; gap: 9px; }
  .answer thead { display: none; }
  .answer tr { display: grid; gap: 4px; padding: 11px 12px; border: 1px solid var(--ia-line); border-radius: 12px; background: #f8fbfa; }
  .answer th, .answer td { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 9px; padding: 3px 0; border: 0; }
  .answer td::before { content: attr(data-label); color: var(--ia-muted); font-size: .68rem; font-weight: 700; }
  .answer td:first-child { padding-bottom: 7px; border-bottom: 1px solid #e3ece9; color: var(--ia-ink); font-weight: 800; }
  .answer td:first-child::before { color: var(--ia-brand); }
  .evidence-page-dialog { width: 100vw; height: 100dvh; margin: 0; border-radius: 0; }
  .evidence-page-dialog > section { border: 0; border-radius: 0; }
  .evidence-page-stage { padding: 10px; }
  .evidence-page-dialog footer { padding: 10px; }
  .evidence-page-dialog footer > a { padding-inline: 9px; }
}
.photo-review-panel { margin: 0; padding: 17px; }
.photo-review-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 0 12px; }
.photo-review-content { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 13px; align-items: start; }
.photo-review-content > img { display: block; width: 92px; height: 92px; border-radius: 14px; background: #e8efec; object-fit: cover; }
.photo-review-content p { margin: 0; color: #36534e; font-size: .83rem; line-height: 1.6; }
.photo-review-details { display: grid; gap: 8px; margin-top: 10px; }
.photo-review-details section { padding: 9px 10px; border-radius: 11px; background: #f2f7f5; }
.photo-review-details strong { color: var(--ia-brand); font-size: .76rem; }
.photo-review-details ul { margin: 5px 0 0; padding-left: 17px; color: #526b66; font-size: .76rem; line-height: 1.55; }

.question-photo-attachment { grid-column: 1 / -1; display: grid; grid-template-columns: 56px minmax(0, 1fr) 38px; gap: 10px; align-items: center; padding: 9px; border: 1px solid #cce2dc; border-radius: 14px; background: #eff8f5; }
.question-photo-attachment img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; }
.question-photo-attachment span { display: grid; gap: 3px; min-width: 0; }
.question-photo-attachment strong { color: var(--ia-brand-deep); font-size: .82rem; }
.question-photo-attachment small { color: var(--ia-muted); font-size: .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.question-photo-attachment button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #dcebe6; color: var(--ia-brand); font-size: 1.3rem; }

/* 3. Materials */
.document-panel, .account-security { margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.page-summary { min-height: 68px; margin-bottom: 12px; padding: 12px 4px; border: 0; background: transparent; }
.page-summary-icon { width: 44px; height: 44px; border-radius: 15px; background: var(--ia-brand); color: #fff; }
.page-summary strong { color: var(--ia-ink); font-size: 1.2rem; }
.page-summary small { margin-top: 2px; color: var(--ia-muted); font-size: .76rem; }
.materials-overview { margin: 0 0 12px; padding: 20px; border: 0; border-radius: 24px; background: var(--ia-brand-deep); color: #fff; box-shadow: var(--ia-shadow); }
.materials-overview > strong { color: #fff; font-size: 1.08rem; }
.materials-overview > span { color: rgba(255,255,255,.68); }
.materials-status-summary span { border-radius: 12px; background: rgba(255,255,255,.11); color: #dcf6f0; }
.material-section { margin: 10px 0; border: 1px solid var(--ia-line); border-radius: 20px; background: #fff; overflow: hidden; }
.material-section > summary { min-height: 68px; padding: 14px 17px; }
.material-section > summary span { color: var(--ia-ink); }
.material-section-content { padding: 0 16px 18px; }
.document-list article, .document-card { border-color: var(--ia-line); border-radius: 17px; background: #fff; }

/* 4. Administration */
.admin-page { margin-top: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.admin-page > header, .admin-page-header { margin-bottom: 12px; padding: 20px; border-radius: 24px; background: var(--ia-brand-deep); color: #fff; }
.admin-page > header h2, .admin-page-header h2 { color: #fff; }
.admin-section, .admin-subsection { border-color: var(--ia-line); border-radius: 20px; background: #fff; box-shadow: none; }
.admin-card-grid, .dashboard-cards { gap: 10px; }
.admin-card, .dashboard-card { border: 1px solid var(--ia-line); border-radius: 18px; background: #fff; box-shadow: none; }
.admin-output-panel { border-color: var(--ia-line); border-radius: 20px; background: #fff; }

/* 5. Profile */
.profile-identity-card { margin: 0 0 12px; padding: 20px; border: 0; border-radius: 24px; background: var(--ia-brand-deep); color: #fff; }
.profile-avatar { background: #fff; color: var(--ia-brand); }
.profile-identity-card small, .profile-identity-card p { color: #fff; }
.profile-session { background: rgba(255,255,255,.11); color: #d8f5ee; }
.profile-page { display: grid; gap: 10px; }
.profile-page .page-summary { min-height: 56px; margin-bottom: 2px; padding-top: 4px; padding-bottom: 4px; }
.profile-assurance-card, .about-app { margin: 0; padding: 15px; border: 1px solid var(--ia-line); border-radius: 18px; background: #fff; }
.profile-assurance-card { display: grid; gap: 15px; }
.profile-assurance-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.profile-assurance-card > header > span:first-child { display: grid; gap: 3px; }
.profile-assurance-card > header small { color: var(--ia-muted); font-size: .68rem; }
.profile-assurance-card > header strong { color: var(--ia-ink); font-size: .98rem; }
.profile-assurance-state { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; background: var(--ia-mint); color: var(--ia-brand); font-size: .65rem; font-weight: 800; white-space: nowrap; }
.profile-assurance-state i { width: 6px; height: 6px; border-radius: 50%; background: #2b9d80; }
.profile-assurance-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.profile-assurance-list li { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 10px; align-items: center; padding: 10px; border-radius: 13px; background: #f3f8f6; }
.profile-assurance-list li > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #dceee9; color: var(--ia-brand); font-size: .62rem; font-weight: 900; }
.profile-assurance-list li div { display: grid; gap: 2px; }
.profile-assurance-list li strong { color: var(--ia-ink); font-size: .78rem; }
.profile-assurance-list li small { color: var(--ia-muted); font-size: .68rem; line-height: 1.45; }
.profile-assurance-card > footer { display: flex; align-items: center; justify-content: space-between; margin: 0; padding-top: 12px; border-top: 1px solid #e6eeeb; }
.profile-assurance-card > footer > span { color: var(--ia-muted); font-size: .68rem; }
.profile-logout { min-height: 36px; padding: 6px 11px; border: 1px solid #ecc7c1; border-radius: 10px; background: #fff; color: var(--ia-danger); font: inherit; font-size: .72rem; font-weight: 800; }
.action-dialog footer button[type="submit"].danger-action {
  background: #a83f35;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  font: inherit;
  font-weight: 800;
}
.action-dialog footer button[type="submit"].danger-action:disabled {
  background: #bd746d;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
}
.profile-settings-card { border: 1px solid var(--ia-line); border-radius: 18px; background: #fff; overflow: hidden; }
.profile-settings-card > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 14px 16px; list-style: none; }
.profile-settings-card > summary::-webkit-details-marker { display: none; }
.profile-settings-card > summary span { color: var(--ia-ink); font-weight: 800; }
.profile-settings-card > summary small { color: var(--ia-muted); font-size: .72rem; }
.profile-settings-content { padding: 0 16px 16px; border-top: 1px solid #e7efec; }
.profile-settings-content > p { color: var(--ia-muted); font-size: .78rem; line-height: 1.5; }
.account-security > h2, .account-security > h2 + p { margin-right: 18px; margin-left: 18px; }
.about-app { background: var(--ia-mint); }
.about-app-compact { gap: 4px; }
.about-app-compact p { font-size: .78rem; line-height: 1.5; }
.site-compliance-footer { display: none; margin: 6px 0 0; padding: 13px 4px 0; border-top: 1px solid var(--ia-line); }
#protected-content[data-active-view="profile"] > .site-compliance-footer { display: block; }
.site-compliance-footer .legal-links { margin: 0 0 7px; }

/* Public product surface and time-limited filing review access. */
.auth-panel { display: grid; gap: 14px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.public-product-intro { position: relative; overflow: hidden; padding: 25px 21px 22px; border-radius: 28px; background: var(--ia-brand-deep); color: #fff; box-shadow: 0 18px 38px rgba(4,63,59,.2); }
.public-product-intro::after { content: ""; position: absolute; right: -72px; top: -76px; width: 220px; height: 220px; border: 30px solid rgba(148,224,204,.09); border-radius: 50%; pointer-events: none; }
.public-product-kicker { position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; margin: 0 0 12px; color: #bce7dc; font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.public-product-kicker span { width: 8px; height: 8px; border: 2px solid rgba(255,255,255,.55); border-radius: 50%; background: #5fd2b7; }
.public-product-intro h2 { position: relative; z-index: 1; max-width: 19rem; margin: 0; color: #fff; font-size: 1.48rem; line-height: 1.35; }
.public-product-intro > p:not(.public-product-kicker) { position: relative; z-index: 1; margin: 12px 0 0; color: rgba(255,255,255,.74); font-size: .84rem; line-height: 1.75; }
.public-product-flow { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.public-product-flow li { min-width: 0; padding: 11px 9px; border: 1px solid rgba(255,255,255,.11); border-radius: 14px; background: rgba(255,255,255,.07); }
.public-product-flow strong, .public-product-flow span { display: block; }
.public-product-flow strong { color: #effffb; font-size: .76rem; }
.public-product-flow span { margin-top: 4px; color: rgba(255,255,255,.6); font-size: .66rem; line-height: 1.45; }
.public-product-boundaries { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.public-product-boundaries span { padding: 5px 8px; border-radius: 999px; background: rgba(189,238,225,.12); color: #d8f5ee; font-size: .66rem; }
.public-login-card { padding: 20px; border: 1px solid var(--ia-line); border-radius: 24px; background: #fff; box-shadow: var(--ia-shadow); }
.public-login-card .auth-emblem { float: right; margin: 0 0 8px 12px; }
.public-login-card h2 { margin: 3px 0 7px; color: var(--ia-ink); font-size: 1.18rem; }
.public-login-card .login-description { margin: 0; color: var(--ia-muted); font-size: .79rem; line-height: 1.6; }
.public-login-card form { clear: both; margin-top: 16px; }
.public-login-card .auth-assurances { margin-top: 12px; }
.public-compliance-footer { margin: 0; padding: 5px 4px 0; border: 0; color: var(--ia-muted); text-align: center; }
.public-compliance-footer .legal-links { display: flex; justify-content: center; gap: 18px; margin-bottom: 5px; }
.public-compliance-footer a { color: var(--ia-brand); font-size: .76rem; text-decoration: none; }
.public-compliance-footer .filing-links, .site-compliance-footer .filing-links { gap: 7px 14px; }
.public-compliance-footer .police-beian-link, .site-compliance-footer .police-beian-link, .public-compliance-footer .icp-link, .site-compliance-footer .icp-link { font-size: .76rem; }
.review-mode-notice { display: grid; gap: 4px; margin: 0 0 12px; padding: 13px 15px; border: 1px solid #e6d4a7; border-radius: 16px; background: #fff8e8; color: #72551c; }
.review-mode-notice strong { font-size: .82rem; }
.review-mode-notice span { font-size: .74rem; line-height: 1.55; }
.form-fields-plain { display: grid; gap: 9px; }
body.is-review-account .analysis-shortcuts { grid-template-columns: 1fr; }
body.is-review-account #feedback-panel { display: none !important; }

input, select, textarea { border-color: var(--ia-line); border-radius: 13px; background: #fbfdfc; }
button { -webkit-tap-highlight-color: transparent; }
.secondary-action { border-color: var(--ia-line); border-radius: 13px; background: #fff; color: var(--ia-brand); }

.bottom-nav {
  position: fixed; z-index: 50; left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right)); bottom: max(9px, env(safe-area-inset-bottom));
  grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; width: auto; max-width: 520px; margin: 0 auto; padding: 7px;
  border: 1px solid rgba(205,219,214,.86); border-radius: 25px; background: rgba(255,255,255,.95); box-shadow: 0 14px 36px rgba(18,53,47,.16); backdrop-filter: blur(20px) saturate(150%);
}
.bottom-nav button { min-width: 0; min-height: 57px; padding: 5px 2px; border-radius: 18px; color: #6c817d; font-size: .66rem; }
.bottom-nav .nav-icon { width: 22px; height: 22px; }
.bottom-nav button.is-active { background: var(--ia-mint); color: var(--ia-brand); }
.bottom-nav button.is-active::after { display: none; }

@media (max-width: 719px) {
  #protected-content[data-active-view="answer"] [data-app-view]:not([data-app-view="answer"]) { display: none !important; }
  .site-compliance-footer { margin-bottom: 96px; }
}
@media (max-width: 390px) {
  .shell { padding-right: 13px; padding-left: 13px; }
  .app-header { margin-right: -13px; margin-left: -13px; padding-right: 13px; padding-left: 13px; }
  .brand-mark { width: 44px; height: 44px; }
  .question-hero { padding: 21px 15px 15px; border-radius: 24px; }
  .question-box { padding: 13px; }
  .bottom-nav .nav-label { font-size: .62rem; }
}
@media (min-width: 720px) {
  .shell { padding-bottom: 48px; }
  .bottom-nav { position: sticky; bottom: 18px; }
}

/* Tablet widths keep the same single-view navigation contract as phones and
   the desktop workbench.  Without this bridge, 720-1099px displayed every
   app view in one long page. */
@media (min-width: 720px) and (max-width: 1099px) {
  #protected-content[data-active-view="ask"] [data-app-view]:not([data-app-view="ask"]),
  #protected-content[data-active-view="answer"] [data-app-view]:not([data-app-view="answer"]),
  #protected-content[data-active-view="materials"] [data-app-view]:not([data-app-view="materials"]),
  #protected-content[data-active-view="profile"] [data-app-view]:not([data-app-view="profile"]),
  #protected-content[data-active-view="admin"] [data-app-view]:not([data-app-view="admin"]) { display: none !important; }
  #protected-content[data-active-view="admin"] #document-panel { display: block !important; margin-top: 5px; }
  #protected-content[data-active-view="admin"] #document-panel > summary,
  #protected-content[data-active-view="admin"] #document-panel > p,
  #protected-content[data-active-view="admin"] #document-panel > form,
  #protected-content[data-active-view="admin"] #document-panel > .materials-overview,
  #protected-content[data-active-view="admin"] #document-panel > .material-section,
  #protected-content[data-active-view="admin"] #document-panel > #upload-result,
  #protected-content[data-active-view="admin"] #document-panel > #admin-setup,
  #protected-content[data-active-view="admin"] #document-panel > #document-list { display: none !important; }
  #protected-content[data-active-view="admin"] #admin-controls:not([hidden]) { display: grid !important; }
}

/* Desktop workspace: the web app becomes a real wide-screen workbench while
   the existing touch-first layout remains authoritative below 1100px. */
@media (min-width: 1100px) {
  body.is-authenticated {
    background:
      radial-gradient(circle at 8% 2%, rgba(159, 224, 208, .24), transparent 31rem),
      linear-gradient(135deg, #eef4f1 0%, #f6f8f7 48%, #edf3f1 100%);
  }
  body.is-authenticated .shell {
    width: min(1440px, calc(100% - 48px));
    max-width: none;
    padding: 0 0 56px;
    overflow: visible;
  }
  body.is-authenticated .app-header {
    position: sticky;
    top: 0;
    z-index: 42;
    margin: 0 0 20px;
    padding: 18px 0 16px;
    border-bottom: 1px solid rgba(197, 216, 209, .72);
    background: rgba(241, 245, 243, .86);
    box-shadow: 0 10px 30px rgba(23, 54, 48, .035);
  }
  body.is-authenticated .brand-line {
    min-height: 54px;
    padding: 0 6px;
  }
  body.is-authenticated .brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(7, 90, 85, .14);
  }
  body.is-authenticated .brand-copy h1 { font-size: 1.16rem; }
  body.is-authenticated .brand-copy .workspace-title { font-size: .8rem; }
  body.is-authenticated .secure-status {
    width: auto;
    min-width: 112px;
    padding: 0 16px;
    font-size: .74rem;
    font-weight: 800;
  }

  #protected-content {
    position: relative;
    min-height: calc(100dvh - 112px);
    margin-left: 252px;
  }

  /* On desktop each navigation choice is an isolated workspace. The former
     mobile-only visibility rule caused every view to be stacked vertically. */
  #protected-content[data-active-view="ask"] [data-app-view]:not([data-app-view="ask"]),
  #protected-content[data-active-view="answer"] [data-app-view]:not([data-app-view="answer"]),
  #protected-content[data-active-view="materials"] [data-app-view]:not([data-app-view="materials"]),
  #protected-content[data-active-view="profile"] [data-app-view]:not([data-app-view="profile"]),
  #protected-content[data-active-view="admin"] [data-app-view]:not([data-app-view="admin"]) { display: none !important; }
  #protected-content[data-active-view="admin"] #document-panel {
    display: block !important;
    margin-top: 0;
  }
  #protected-content[data-active-view="admin"] #document-panel > summary,
  #protected-content[data-active-view="admin"] #document-panel > p,
  #protected-content[data-active-view="admin"] #document-panel > form,
  #protected-content[data-active-view="admin"] #document-panel > .materials-overview,
  #protected-content[data-active-view="admin"] #document-panel > .material-section,
  #protected-content[data-active-view="admin"] #document-panel > #upload-result,
  #protected-content[data-active-view="admin"] #document-panel > #admin-setup,
  #protected-content[data-active-view="admin"] #document-panel > #document-list { display: none !important; }
  #protected-content[data-active-view="admin"] #admin-controls:not([hidden]) { display: grid !important; }

  .bottom-nav {
    position: fixed;
    z-index: 50;
    top: 112px;
    right: auto;
    bottom: auto;
    left: max(24px, calc(50vw - 720px));
    display: grid;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: 1fr;
    gap: 7px;
    width: 220px;
    max-width: none;
    margin: 0;
    padding: 16px;
    border: 1px solid rgba(205, 219, 214, .9);
    border-radius: 24px;
    background: rgba(255,255,255,.84);
    box-shadow: 0 18px 46px rgba(18,53,47,.09);
    backdrop-filter: blur(22px) saturate(145%);
  }
  .bottom-nav::before {
    content: "工作台导航";
    padding: 2px 10px 8px;
    color: #78908b;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .1em;
  }
  .bottom-nav::after {
    content: "回答附来源依据";
    margin-top: 5px;
    padding: 13px 10px 2px;
    border-top: 1px solid #e3ece8;
    color: #7b918c;
    font-size: .68rem;
    line-height: 1.5;
  }
  .bottom-nav button {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: 52px;
    padding: 0 14px;
    border-radius: 15px;
    color: #607772;
    transition: color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
  }
  .bottom-nav .nav-icon { width: 24px; height: 24px; }
  .bottom-nav .nav-label { font-size: .82rem !important; font-weight: 800; }
  .bottom-nav button.is-active {
    background: linear-gradient(135deg, #deeee9, #eaf5f1);
    color: var(--ia-brand);
    box-shadow: inset 3px 0 0 var(--ia-brand);
  }

  .review-mode-notice {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    padding: 14px 18px;
  }
  .review-mode-notice strong { white-space: nowrap; }

  .page-summary {
    min-height: 76px;
    margin-bottom: 16px;
    padding: 10px 6px;
  }
  .page-summary strong { font-size: 1.34rem; }
  .page-summary small { font-size: .8rem; }
  .answer-empty-state { min-height: 62dvh; }
  .answer-processing-state { min-height: 62dvh; }
  #result { max-width: 1120px; }

  .profile-page {
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
    gap: 16px;
  }
  .profile-page .page-summary { grid-column: 1 / -1; }
  .profile-identity-card {
    grid-column: 1;
    min-height: 178px;
    margin: 0;
    padding: 28px;
  }
  .profile-assurance-card { grid-column: 2; padding: 20px; }
  .profile-settings-card { grid-column: 2; }
  .profile-page .about-app { grid-column: 1; align-self: start; padding: 20px; }

  .document-panel[data-app-view="materials"] > .materials-overview { padding: 26px; }
  .material-section > summary { min-height: 74px; padding-right: 22px; padding-left: 22px; }
  .material-section-content { padding: 0 22px 22px; }
  .admin-card-grid, .dashboard-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
  .ask-card {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px 20px;
    align-items: start;
  }
  .ask-card > .knowledge-picker { grid-column: 2; grid-row: 1; }
  .ask-card > .question-hero { grid-column: 1; grid-row: 1 / span 4; }
  .ask-card > .analysis-shortcuts { grid-column: 2; grid-row: 2; grid-template-columns: 1fr; }
  .ask-card > #consent-status,
  .ask-card > #index-status,
  .ask-card > #published-materials { grid-column: 2; }
  .ask-card > .quick-questions,
  .ask-card > #fault-card-panel,
  .ask-card > #recent-questions-panel { grid-column: 1; }
  .question-hero {
    display: grid;
    grid-template-columns: minmax(200px, .7fr) minmax(370px, 1.3fr);
    gap: 24px;
    align-items: stretch;
    min-height: 390px;
    padding: 28px;
  }
  .question-hero-copy {
    display: grid;
    align-content: center;
    padding: 12px 4px;
  }
  .question-hero-copy p { display: flex; }
  .question-hero-copy h2 { max-width: 15rem; font-size: clamp(1.7rem, 2.3vw, 2.25rem); }
  .question-hero-copy > span { max-width: 18rem; font-size: .9rem; }
  .question-box {
    grid-column: 2;
    grid-row: 1;
    min-height: 334px;
    padding: 20px;
    border-radius: 24px;
  }
  .question-box textarea { min-height: 218px; font-size: 1rem; }
  .quick-questions { flex-wrap: wrap; overflow: visible; }
  .quick-questions::before { flex: 0 0 100%; }
  .knowledge-fields { padding: 18px; }
}

@media (min-width: 1100px) and (hover: hover) {
  .bottom-nav button:hover {
    color: var(--ia-brand);
    background: #edf6f3;
    transform: translateX(3px);
  }
  .analysis-shortcuts button:hover,
  .quick-questions button:hover,
  .secondary-action:hover {
    border-color: #a9cec4;
    background: #eff7f4;
    color: var(--ia-brand-deep);
  }
}
@media (prefers-reduced-motion: reduce) {
  .analysis-spinner { animation-duration: 1.8s; }
}

/* Field workbench: clear reading hierarchy, large targets and local evidence. */
:root { --workbench-text: 16px; --workbench-radius: 16px; }
body { font-size: var(--workbench-text); }
body.field-font { --workbench-text: 18px; }
body:not(.is-authenticated) .header-search { display: none; }
body:not(.is-authenticated) .brand-line { grid-template-columns: auto minmax(0, 1fr) auto; }
.auth-panel { display: grid; gap: 24px; max-width: none; width: 100%; margin: 0; }
.public-login-card { order: 0; }
.public-product-intro { order: 1; }
.public-compliance-footer { order: 2; }
.public-login-card .auth-emblem, .public-login-card .auth-assurances, .public-product-flow, .public-product-boundaries { display: none; }
.public-login-card { padding: 24px; border-radius: var(--workbench-radius); box-shadow: none; }
.login-description, .login-help, .public-product-intro p { font-size: 14px; line-height: 1.7; }
.public-product-intro { padding: 16px; }
.public-product-intro h2 { font-size: 20px; }
.login-kicker { margin: 0 0 8px; }
.password-field { display: flex; gap: 8px; align-items: center; }
.password-field input { min-width: 0; flex: 1; }
.password-field button { flex: 0 0 60px; min-height: 46px; margin: 0; }
.login-help { margin-top: 16px; }
.login-help summary { cursor: pointer; color: var(--ia-brand); }
#password-caps-hint { color: #8a4f0a; font-size: 14px; }
.investigation-heading, .workbench-preferences { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
#investigation-context { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--ia-muted); font-size: 14px; }
.workbench-preferences { padding: 16px 0; }
.question-hero { border-radius: var(--workbench-radius); background: #fff; color: var(--ia-ink); border: 1px solid var(--ia-line); box-shadow: none; padding: 24px 16px 16px; }
.question-hero::after { display: none; }
.question-hero-copy h2 { color: var(--ia-ink); max-width: none; font-size: 24px; line-height: 1.4; }
.question-hero-copy p, .question-hero-copy > span { color: var(--ia-muted); font-size: 14px; }
.question-box { border: 1px solid var(--ia-line); border-radius: 12px; padding: 16px; }
.question-box textarea { font-size: var(--workbench-text); min-height: 128px; line-height: 1.7; }
.selected-kb-card { border-radius: 12px; }
.selected-kb-card > span, .selected-kb-card .subtle, .composer-trust, .draft-status, .answer-mode-selector small { font-size: 13px; }
.selected-kb-card .subtle { display: block; line-height: 1.6; }
.draft-status { grid-column: 1 / -1; color: var(--ia-muted); line-height: 1.6; }
.analysis-shortcuts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.analysis-shortcuts button { min-height: 48px; padding: 10px 6px; font-size: 13px; }
.answer-mode-selector small { white-space: normal; }
.answer-mode-selector span { font-size: 14px; }
#result { max-width: 1120px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.answer { font-size: calc(var(--workbench-text) * .91); line-height: 1.82; overflow-wrap: anywhere; }
.answer p, .answer li { font-size: inherit; line-height: inherit; }
.answer h3 { font-size: var(--workbench-text); line-height: 1.5; margin: 24px 0 12px; }
.answer > h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.answer-session-context { color: var(--ia-muted); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; border-bottom: 1px solid var(--ia-line); padding-bottom: 16px; }
.answer-check-records { margin: 16px 0; padding: 14px 16px; border: 1px solid var(--ia-line); border-radius: 12px; background: #f8fbfa; }
.answer-check-records > summary { cursor: pointer; color: var(--ia-brand); font-size: 14px; }
.answer-check-records #answer-presentation { padding-top: 12px; font-size: 14px; line-height: 1.7; }
.result-heading .evidence-ready span { color: inherit; font-size: 13px; }
.presentation-item { padding: 0 0 16px; border-bottom: 1px solid #edf1ef; }
.presentation-item label { display: grid; gap: 8px; font-size: 14px; color: var(--ia-muted); }
.presentation-item select, .presentation-item input { min-height: 44px; font-size: 16px; margin-top: 8px; max-width: 100%; }
.answer-technical-details { margin: 24px 0; border-top: 1px solid var(--ia-line); padding-top: 16px; }
.answer-technical-details summary { cursor: pointer; font-size: 14px; color: var(--ia-muted); }
.answer-technical-details .subtle { font-size: 13px; line-height: 1.7; }
.answer-actions { flex-wrap: wrap; gap: 8px; }
.answer-actions button, .secondary-action { min-height: 44px; }
#feedback-reasons label, #feedback-reasons select, #feedback-reasons input { width: 100%; min-width: 0; }
#feedback-reasons label { font-size: 14px; margin-top: 8px; }
#protected-content[data-active-view="records"] [data-app-view]:not([data-app-view="records"]) { display: none !important; }
.answer-job-history-panel { padding: 24px; background: #fff; border-radius: var(--workbench-radius); border: 1px solid var(--ia-line); }
.answer-history-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
.answer-history-search input, .answer-history-search select { min-width: 0; min-height: 44px; margin: 0; font-size: 16px; }
.answer-history-search label { font-size: 14px; align-self: center; }
.answer-history-search input[type="checkbox"] { min-height: 0; }
.answer-job-history-item { display: flex; flex-wrap: wrap; gap: 12px; padding: 20px 0; border-bottom: 1px solid var(--ia-line); }
.answer-job-history-item strong, .answer-job-history-item > span { flex-basis: 100%; overflow-wrap: anywhere; }
.answer-job-history-item > span { font-size: 13px; color: var(--ia-muted); line-height: 1.6; }
.evidence-excerpt-dialog, .photo-editor-dialog { box-sizing: border-box; border: 1px solid var(--ia-line); border-radius: 16px; padding: 24px; color: var(--ia-ink); background: #fff; max-height: 90dvh; overflow: auto; width: min(640px, calc(100vw - 24px)); }
.evidence-excerpt-dialog::backdrop, .photo-editor-dialog::backdrop { background: rgba(9, 32, 28, .28); }
.evidence-excerpt-dialog > header, .photo-editor-dialog > header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.evidence-excerpt-dialog h2, .photo-editor-dialog h2 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.evidence-excerpt-dialog header button, .photo-editor-dialog header button { min-width: 44px; min-height: 44px; padding: 0; }
.evidence-excerpt-dialog blockquote { margin: 20px 0; padding: 16px; border-left: 3px solid var(--ia-brand); background: #f3f7f5; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; font-size: var(--workbench-text); }
.photo-editor-dialog > p { font-size: 14px; line-height: 1.7; }
#photo-editor-canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.photo-editor-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.photo-editor-actions button { min-height: 44px; font-size: 14px; }
.question-photo-attachment { flex-wrap: wrap; }
.question-photo-attachment > span { min-width: 0; }
@media (max-width: 1099px) {
  #bottom-nav .admin-nav { display: none !important; }
  #bottom-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .evidence-excerpt-dialog { margin: auto 0 0; width: 100%; max-width: none; max-height: 78dvh; border-radius: 20px 20px 0 0; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
}
@media (max-width: 420px) {
  .answer-job-history-panel { padding: 16px; }
  .answer-history-search { grid-template-columns: minmax(0, 1fr); }
  .result-heading { flex-wrap: wrap; gap: 12px; }
  .question-hero { padding: 20px 12px 12px; }
}
@media (min-width: 850px) {
  body:not(.is-authenticated) .shell { width: min(1100px, calc(100% - 48px)); max-width: none; }
  .auth-panel { grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); gap: 40px; align-items: center; padding-top: 32px; }
  .public-product-intro { order: 0; }
  .public-login-card { order: 1; }
  .public-compliance-footer { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  #result, .answer-job-history-panel { max-width: 920px; }
  #protected-content .ask-card { grid-template-columns: minmax(0, 1fr); max-width: 920px; }
  #protected-content .ask-card > * { grid-column: auto; grid-row: auto; }
  .evidence-excerpt-dialog { margin: 90px 24px 24px auto; width: 420px; max-height: calc(100dvh - 114px); }
  #protected-content .question-hero { grid-template-columns: minmax(0, 1fr); }
  #protected-content .question-hero-copy { padding: 0 8px 24px; grid-column: 1; grid-row: 1; }
  #protected-content .question-box { grid-column: 1; grid-row: 2; }
  #protected-content .hero-graphic { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .ask-card, #result, .document-panel, .admin-page, .account-security { animation: none; }
}
