:root {
  color-scheme: light;
  --ink: #152820;
  --muted: #607068;
  --paper: #f5f4ee;
  --card: #fffef8;
  --line: #d8ddd5;
  --green: #175c45;
  --green-dark: #0f4433;
  --mint: #dff0e6;
  --error: #8c322d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); min-height: 100vh; }
.topbar { max-width: 1120px; margin: 0 auto; padding: 24px; display: flex; align-items: center; justify-content: space-between; }
.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 12px; font-weight: 750; }
.brand-logo { display: block; width: clamp(150px, 18vw, 215px); height: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.role-badge { padding: 7px 10px; border-radius: 999px; background: var(--mint); color: var(--green-dark); font-size: 12px; font-weight: 800; text-transform: capitalize; }
.clinical-scope { display: grid; gap: 5px; padding: 14px 18px; border: 1px solid #dfc382; border-radius: 14px; background: #fff8e9; color: #67460d; text-align: left; }
.clinical-scope strong { font-size: 13px; }
.clinical-scope span { font-size: 13px; line-height: 1.5; }
.language-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.language-switch button { display: inline-grid; place-items: center; width: 42px; min-height: 34px; padding: 5px 7px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; }
.language-switch button:hover { background: #eef4ef; color: var(--ink); }
.language-switch button.is-active { background: var(--green); color: white; }
.language-flag { display: block; width: 25px; height: 17px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(15,35,27,.18); object-fit: cover; }
main { min-height: calc(100vh - 170px); }
.hero { max-width: 1180px; margin: 32px auto 42px; padding: 0 24px; text-align: center; }
.hero-intro { position: relative; max-width: 820px; margin: 0 auto 34px; padding: 22px 24px 4px; }
.hero-intro::before { content: ""; position: absolute; z-index: -1; top: -28px; left: 50%; width: min(680px, 88vw); height: 190px; border-radius: 50%; background: radial-gradient(ellipse, rgba(223,240,230,.78) 0%, rgba(223,240,230,0) 72%); transform: translateX(-50%); pointer-events: none; }
.hero-intro .eyebrow { display: inline-flex; margin-bottom: 18px; padding: 7px 11px; border: 1px solid #c5ded0; border-radius: 999px; background: rgba(255,254,248,.82); }
.hero-intro h1 { font-size: clamp(40px, 5.8vw, 64px); line-height: 1.02; }
.hero-intro .lead { margin-bottom: 0; }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 14px; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 7vw, 72px); line-height: .98; letter-spacing: -.035em; margin: 0 auto 24px; max-width: 800px; font-weight: 500; }
.lead { font-size: 19px; line-height: 1.65; color: var(--muted); max-width: 680px; margin: 0 auto 36px; }
.login-card, .upload-card, .result-card, .app-shell { background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 18px 60px rgba(21,40,32,.08); padding: 34px; }
.login-card { max-width: 520px; margin: 0 auto; }
.login-card h2 { margin-top: 0; }
.login-card p { color: var(--muted); margin-bottom: 24px; }
.button { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 12px 20px; border: 1px solid transparent; font: inherit; font-weight: 750; cursor: pointer; text-decoration: none; }
.button-primary { background: var(--green); color: white; }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { background: transparent; border-color: var(--line); color: var(--ink); }
.button-danger { background: transparent; border-color: #d9aaa6; color: var(--error); }
.button-wide { width: 100%; margin-top: 18px; padding: 15px; }
.notice { max-width: 520px; padding: 12px 16px; margin: 0 auto 18px; border-radius: 12px; background: #fff3d8; color: #624613; }
.upload-card { position: relative; max-width: 1080px; margin: 0 auto; text-align: left; }
.userline { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.status-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: #2c9c69; margin-right: 5px; }
.dropzone { display: flex; min-height: 190px; border: 1.5px dashed #9eaaa2; border-radius: 16px; background: #fafaf5; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-align: center; color: var(--muted); }
.dropzone:hover { border-color: var(--green); background: var(--mint); }
.drop-title { color: var(--ink); font-size: 19px; font-weight: 750; }
.dropzone input { max-width: 90%; margin-top: 10px; }
.selected-files { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.fineprint { color: var(--muted); font-size: 13px; margin: 18px 0 0; }
.ocr-note { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 18px; padding: 14px 16px; border: 1px solid #c5ded0; border-radius: 14px; background: #f1f8f4; color: var(--green-dark); text-align: left; }
.ocr-note-icon { display: grid; flex: 0 0 auto; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--mint); font-size: 18px; font-weight: 850; }
.ocr-note > span:last-child { display: grid; gap: 3px; font-size: 13px; line-height: 1.5; }
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; max-width: 1120px; padding: 0 24px; margin: 0 auto 60px; }
.trust-grid article { padding: 25px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 7px; text-align: center; }
.trust-grid span { color: var(--muted); font-size: 14px; }
.result-page { max-width: 1080px; margin: 52px auto; padding: 0 24px; }
.backlink { display: inline-block; color: var(--green); margin-bottom: 20px; text-decoration: none; font-weight: 700; }
.result-card { padding: clamp(28px, 6vw, 60px); }
.result-card h1 { font-size: clamp(34px, 5vw, 54px); text-align: left; margin-left: 0; }
.summary { font-size: 17px; line-height: 1.72; padding-top: 25px; border-top: 1px solid var(--line); }
.error-card { border-top: 4px solid var(--error); }
.source-chip { display: inline-flex; max-width: 100%; margin: -6px 0 22px; padding: 7px 11px; border-radius: 999px; background: #eef4ef; color: var(--green-dark); font-size: 12px; font-weight: 750; overflow-wrap: anywhere; }
.document-assistant { margin-top: 22px; padding: clamp(24px, 4vw, 38px); border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: 0 18px 60px rgba(21,40,32,.06); }
.document-assistant-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.document-assistant-heading h2 { margin: 0 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 32px; font-weight: 500; }
.document-assistant-heading p { max-width: 650px; margin: 0; color: var(--muted); }
.document-tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.document-tool-card { display: grid; align-content: start; gap: 13px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fafaf5; }
.document-tool-ask { border-color: #b9d5e4; background: #f3f8fb; }
.document-tool-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--mint); color: var(--green-dark); font-size: 22px; font-weight: 850; }
.document-tool-ask .document-tool-icon { background: #dceef6; color: #245c76; }
.document-tool-label { color: var(--green); font-size: 10px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.document-tool-ask .document-tool-label { color: #245c76; }
.document-tool-card h3 { margin: 4px 0 7px; font-size: 20px; }
.document-tool-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.document-tool-card label { margin-top: 5px; font-size: 13px; font-weight: 750; }
.document-tool-card textarea { min-height: 105px; }
.document-answer { margin-top: 20px; overflow: hidden; border: 1px solid #b9d5e4; border-radius: 16px; background: white; }
.document-answer[hidden] { display: none; }
.document-answer-heading { display: flex; align-items: center; gap: 9px; padding: 13px 17px; border-bottom: 1px solid #cfe1ea; background: #eaf5fa; color: #245c76; font-size: 13px; }
.document-answer-heading > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #245c76; color: white; font-weight: 850; }
.document-answer .markdown-body { padding: 20px; line-height: 1.65; }
.site-footer { color: var(--muted); font-size: 13px; padding: 28px 22px; border-top: 1px solid var(--line); }
.site-footer-inner { display: grid; gap: 16px; max-width: 1180px; margin: 0 auto; }
.footer-meta { text-align: center; line-height: 1.7; }
.site-footer a, .trust-grid a, .compliance-summary a { color: var(--green); }
.site-footer strong { color: var(--ink); }
.concept-status { display: inline-flex; width: fit-content; margin: 0 0 12px; padding: 7px 10px; border: 1px solid #dfbd73; border-radius: 999px; background: #fff5d9; color: #69490e; font-size: 12px; font-weight: 850; }
.record-safety-warning { display: grid; gap: 5px; margin-top: 18px; padding: 15px 17px; border: 1px solid #dfbd73; border-radius: 14px; background: #fff8e9; }
.record-safety-warning strong { color: #65440b; }
.record-safety-warning span { color: #745d31; font-size: 13px; line-height: 1.5; }
.result-metadata { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.security-contact { margin-top: 18px !important; padding-top: 14px; border-top: 1px solid var(--line); }
.download-warning-copy { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.consent-inline { display: flex; align-items: flex-start; gap: 10px; margin: 15px 0; color: var(--green-dark); font-size: 14px; line-height: 1.5; }

.compliance-summary { max-width: 1120px; margin: 0 auto 72px; padding: 42px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); box-shadow: 0 18px 60px rgba(21,40,32,.06); scroll-margin-top: 24px; }
.compliance-back { max-width: 1120px; margin: 32px auto 14px; padding: 0 24px; }
.compliance-heading { max-width: 760px; margin: 0 auto 30px; text-align: center; }
.compliance-heading h2 { margin: 0 0 14px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(32px, 5vw, 48px); font-weight: 500; letter-spacing: -.025em; }
.compliance-heading p { margin: 0; color: var(--muted); line-height: 1.65; }
.compliance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; text-align: left; }
.compliance-grid article { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: #fafaf5; }
.compliance-label { display: inline-block; margin-bottom: 9px; color: var(--green); font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.compliance-grid h3 { margin: 0 0 12px; font-size: 21px; overflow-wrap: anywhere; }
.compliance-grid p, .compliance-grid li { color: var(--muted); font-size: 14px; line-height: 1.62; }
.compliance-grid p { margin: 0 0 12px; }
.compliance-grid p:last-of-type { margin-bottom: 0; }
.compliance-grid ul { margin: 0; padding-left: 20px; }
.compliance-grid li { margin: 7px 0; }
.compliance-grid li strong { color: var(--ink); }
.evidence-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.evidence-links a { max-width: 100%; padding: 7px 10px; border: 1px solid #b9d2c4; border-radius: 999px; background: var(--mint); font-size: 12px; font-weight: 750; overflow-wrap: anywhere; text-decoration: none; }
.evidence-links a:hover { border-color: var(--green); }
.compliance-download-card { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 22px; padding: 26px; border: 1px solid #b9d2c4; border-radius: 18px; background: var(--mint); text-align: left; }
.compliance-download-card > div { min-width: 0; }
.compliance-download-card h3 { margin: 0 0 10px; font-size: 22px; }
.compliance-download-card p { margin: 6px 0; color: var(--green-dark); font-size: 14px; line-height: 1.6; }
.compliance-download-card small { display: block; margin-top: 12px; color: var(--muted); line-height: 1.5; }
.compliance-download-card code { overflow-wrap: anywhere; }
.compliance-download-card .button { flex: 0 0 auto; }
.compliance-download-button { border-color: #79a38e; background: #fffef8; color: var(--green-dark); box-shadow: 0 6px 18px rgba(15,68,51,.09); }
.compliance-download-button:hover { border-color: var(--green-dark); background: var(--green-dark); color: white; }
.compliance-updated { margin: 26px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; text-align: center; }
.privacy-statement { max-width: 1040px; margin: 0 auto 72px; padding: clamp(28px, 5vw, 56px); border: 1px solid var(--line); border-radius: 24px; background: var(--card); box-shadow: 0 18px 60px rgba(21,40,32,.06); }
.privacy-heading { max-width: 820px; }
.privacy-heading h1 { max-width: 820px; font-size: clamp(36px, 5vw, 54px); line-height: 1.08; }
.privacy-version { margin-top: 12px !important; color: var(--green) !important; font-size: 12px; font-weight: 750; }
.privacy-section { padding: 28px 0; border-top: 1px solid var(--line); }
.privacy-section:first-of-type { border-top: 0; }
.privacy-section h2 { margin: 0 0 14px; font-family: Georgia, "Times New Roman", serif; font-size: 29px; font-weight: 500; }
.privacy-section p, .privacy-section li { color: var(--muted); line-height: 1.68; }
.privacy-section p { margin: 0 0 13px; }
.privacy-section p:last-child { margin-bottom: 0; }
.privacy-section ul { margin: 0 0 14px; padding-left: 23px; }
.privacy-section li { margin: 8px 0; }
.privacy-section strong { color: var(--ink); }
.privacy-section a, .privacy-document-footer a { color: var(--green); }
.privacy-contact-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 0 0 16px; padding: 19px 21px; border: 1px solid #c5ded0; border-radius: 16px; background: var(--mint); }
.privacy-contact-card p { color: var(--green-dark); }
.privacy-callout, .privacy-warning { display: grid; gap: 5px; margin-top: 18px; padding: 16px 18px; border: 1px solid #b9d5e4; border-radius: 14px; background: #f0f7fa; }
.privacy-callout span, .privacy-warning span { color: var(--muted); font-size: 14px; line-height: 1.55; }
.privacy-warning { border-color: #e6c98d; background: #fff7e6; }
.privacy-warning strong, .privacy-warning span { color: #704d12; }
.privacy-table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: 15px; }
.privacy-table { width: 100%; border-collapse: collapse; background: white; }
.privacy-table th, .privacy-table td { min-width: 170px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.5; text-align: left; vertical-align: top; }
.privacy-table th { background: #f2f5f1; color: var(--green-dark); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.privacy-table tr:last-child td { border-bottom: 0; }
.privacy-document-footer { padding: 22px 0 0; border-top: 1px solid var(--line); text-align: left; }

.model-note { margin: 0 0 24px; padding: 12px 14px; border-radius: 12px; background: var(--mint); color: var(--green-dark); font-size: 14px; }
code { font-size: .9em; overflow-wrap: anywhere; }
.input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.input-panel { position: relative; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: #fafaf5; }
.input-panel-wide { grid-column: 1 / -1; }
.input-panel h2 { margin: 0 0 6px; font-size: 21px; }
.input-panel > p { color: var(--muted); margin: 0 0 18px; }
.input-number { position: absolute; top: 20px; right: 20px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--mint); color: var(--green); font-weight: 800; font-size: 13px; }
.field-label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 750; }
textarea, input[type="url"], input[type="text"], select { width: 100%; border: 1px solid #aeb8b1; border-radius: 12px; background: white; color: var(--ink); font: inherit; padding: 13px 14px; }
textarea { min-height: 190px; resize: vertical; line-height: 1.55; }
textarea:focus, input[type="url"]:focus, input[type="text"]:focus, select:focus { outline: 3px solid rgba(23,92,69,.16); border-color: var(--green); }
.url-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.url-row .button { border-radius: 12px; }
.loading-overlay { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 28px; border-radius: 22px; background: rgba(255,254,248,.96); text-align: center; }
.loading-overlay[hidden] { display: none; }
.loading-overlay span:last-child { color: var(--muted); font-size: 14px; }
.spinner { width: 48px; height: 48px; border: 5px solid var(--mint); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.button:disabled { opacity: .6; cursor: wait; }

.markdown-body h1 { max-width: none; margin: 0 0 18px; font-size: 34px; line-height: 1.15; text-align: left; }
.markdown-body h2 { margin: 30px 0 11px; font-family: Georgia, "Times New Roman", serif; font-size: 27px; font-weight: 500; }
.markdown-body h1 + h2, .markdown-body h2:first-child { margin-top: 0; }
.markdown-body h3 { margin: 24px 0 9px; font-size: 21px; }
.markdown-body h4, .markdown-body h5, .markdown-body h6 { margin: 20px 0 8px; }
.markdown-body p { margin: 0 0 14px; }
.markdown-body ul, .markdown-body ol { margin: 0 0 18px; padding-left: 25px; }
.markdown-body li { margin: 7px 0; }
.markdown-body blockquote { margin: 18px 0; padding: 3px 0 3px 18px; border-left: 4px solid var(--mint); color: var(--muted); }
.markdown-body a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.markdown-body code { padding: 2px 5px; border-radius: 5px; background: #eef0eb; }
.markdown-body pre { overflow-x: auto; padding: 16px; border-radius: 12px; background: #eef0eb; }
.markdown-body pre code { padding: 0; background: transparent; }
.markdown-body table { display: block; width: 100%; margin: 20px 0; overflow-x: auto; border-collapse: collapse; }
.markdown-body th, .markdown-body td { min-width: 120px; padding: 10px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.markdown-body th { background: var(--mint); color: var(--green-dark); }
.markdown-body hr { margin: 28px 0; border: 0; border-top: 1px solid var(--line); }
.model-result { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.template-used { display: inline-block; margin: 20px 0 0; padding: 7px 11px; border-radius: 999px; background: var(--mint); color: var(--green-dark); font-size: 13px; font-weight: 700; }
.template-library { max-width: 920px; margin: 0 auto 22px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); text-align: left; }
.template-library summary { cursor: pointer; font-weight: 800; font-size: 18px; }
.template-library[open] summary { margin-bottom: 20px; }
.template-editor { display: grid; gap: 17px; }
.template-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 9px; align-items: center; }
.template-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.template-visibility { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #f8faf7; }
.template-visibility input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--green); }
.template-visibility span { display: grid; gap: 3px; }
.template-visibility small { color: var(--muted); }
.local-note, .template-status { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.template-status { min-height: 20px; color: var(--green-dark); }
.status-error { color: var(--error); }
.output-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.output-options label { display: grid; gap: 7px; font-size: 14px; font-weight: 750; }
.workspace { padding: clamp(25px, 4vw, 42px); }
.workspace-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.workspace-header h2 { margin: 3px 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 500; }
.workspace-header p { margin: 0; color: var(--muted); }
.workspace-header .userline { margin-bottom: 9px; }
.model-badge { flex: 0 0 auto; display: grid; min-width: 210px; gap: 3px; padding: 13px 16px; border: 1px solid #c5ded0; border-radius: 14px; background: var(--mint); color: var(--green-dark); text-align: left; }
.model-badge span { font-size: 10px; font-weight: 850; letter-spacing: .14em; }
.model-badge strong { font-size: 14px; }
.model-badge small { color: var(--green); }
.model-badge code { margin-top: 3px; color: var(--green-dark); font-size: 10px; }
.workflow-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fafaf5; }
.workflow-settings label, .template-toolbar label { display: grid; gap: 7px; font-size: 14px; font-weight: 750; }
.source-tabs { display: flex; gap: 4px; margin-top: 25px; padding: 5px; border-radius: 14px; background: #e9ece6; }
.source-tab { flex: 1; padding: 12px 18px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-weight: 750; cursor: pointer; }
.source-tab:hover { color: var(--ink); }
.source-tab.is-active { background: var(--card); color: var(--green-dark); box-shadow: 0 2px 10px rgba(21,40,32,.1); }
.source-tab:focus-visible { outline: 3px solid rgba(23,92,69,.22); outline-offset: 2px; }
.source-panel { padding: 30px 4px 2px; }
.source-panel[hidden] { display: none !important; }
.panel-heading { margin-bottom: 22px; }
.panel-heading h3 { margin: 0 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 27px; font-weight: 500; }
.panel-heading p { margin: 0; color: var(--muted); }
.upload-icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 3px; border-radius: 50%; background: var(--mint); color: var(--green); font-size: 23px; font-weight: 700; }
.template-library { max-width: none; margin: 14px 0 0; }
.source-panel textarea { min-height: 230px; }
.source-panel .fineprint { margin-top: 14px; }
.app-shell { position: relative; max-width: 1080px; margin: 0 auto; padding: clamp(25px, 4vw, 42px); text-align: left; }
.app-view[hidden] { display: none !important; }
.dashboard-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; margin-bottom: 30px; }
.dashboard-header h2 { margin: 2px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 38px; font-weight: 500; }
.dashboard-header p { margin: 0; color: var(--muted); }
.dashboard-header .userline { margin-bottom: 10px; }
.usage-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: -10px 0 24px; padding: 15px 18px; border: 1px solid #c6ddd4; border-radius: 16px; background: #edf7f2; }
.usage-card > div { display: flex; align-items: baseline; gap: 10px; }
.usage-card span, .usage-card p { color: #526761; }
.usage-card strong { color: var(--green); font-size: 21px; }
.usage-card p { margin: 0; font-size: 14px; }
.usage-card.is-exhausted { border-color: #e5b8b2; background: #fff1ef; }
.usage-card.is-exhausted strong, .usage-card.is-unavailable strong { color: #9a493f; }
.usage-card.is-unavailable { border-color: #dedbd2; background: #f5f3ed; }
.session-security-card { display: grid; gap: 10px; margin: 16px 0 24px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 15px; background: #f7f8f4; }
.session-security-card > div { display: flex; justify-content: space-between; gap: 18px; }
.session-security-card span, .session-security-card small { color: var(--muted); font-size: 13px; }
.session-security-card label { display: flex; align-items: flex-start; gap: 10px; color: var(--green-dark); font-size: 13px; line-height: 1.5; }
.footer-security-card { margin: 0; text-align: left; }
.model-stack { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.model-stack .model-badge { min-width: 175px; }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.action-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; min-height: 118px; padding: 21px; border: 1px solid var(--line); border-radius: 17px; background: #fafaf5; color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.action-card:hover { transform: translateY(-2px); border-color: #aac9b7; box-shadow: 0 10px 26px rgba(21,40,32,.08); }
.action-card:focus-visible { outline: 3px solid rgba(23,92,69,.22); outline-offset: 2px; }
.action-card > span:nth-child(2) { display: grid; gap: 7px; }
.action-card strong { font-size: 18px; }
.action-card small { color: var(--muted); font-size: 14px; line-height: 1.45; }
.action-card-secondary { grid-column: 1 / -1; min-height: 92px; background: transparent; }
.action-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: var(--mint); color: var(--green); font-size: 24px; font-weight: 750; }
.action-icon.recording { color: #a1322c; background: #f6dfdc; }
.action-arrow { color: var(--green); font-size: 22px; }
.workspace-view { min-height: 520px; }
.back-button { margin: 0 0 27px; padding: 0; border: 0; background: transparent; color: var(--green); font: inherit; font-weight: 750; cursor: pointer; }
.workspace-view .workflow-settings { grid-template-columns: 1fr; }
.consent-box { margin: 18px 0; padding: 16px 18px; border: 1px solid #d7c9a6; border-radius: 13px; background: #fff8e8; color: #604b19; }
.consent-box label { display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; cursor: pointer; }
.consent-box input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); }
.recorder { display: grid; gap: 26px; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: #fafaf5; }
.record-status { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.record-status time { font-variant-numeric: tabular-nums; font-size: 25px; font-weight: 750; }
.record-dot { width: 11px; height: 11px; border-radius: 50%; background: #aeb8b1; }
.recorder.is-recording .record-dot { background: #b63d35; box-shadow: 0 0 0 6px rgba(182,61,53,.13); animation: pulse 1.4s ease-in-out infinite; }
.audio-meter { display: flex; align-items: center; justify-content: center; gap: 7px; height: 76px; }
.audio-meter span { width: 8px; height: 18px; border-radius: 999px; background: #cbd5ce; }
.recorder.is-recording .audio-meter span { background: var(--green); animation: meter .8s ease-in-out infinite alternate; }
.recorder.is-recording .audio-meter span:nth-child(2), .recorder.is-recording .audio-meter span:nth-child(6) { animation-delay: -.25s; }
.recorder.is-recording .audio-meter span:nth-child(3), .recorder.is-recording .audio-meter span:nth-child(5) { animation-delay: -.5s; }
.recorder-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.recording-result { display: grid; gap: 10px; margin-top: 18px; padding: 20px; border: 1px solid #c5ded0; border-radius: 16px; background: var(--mint); }
.recording-result[hidden] { display: none !important; }
.recording-result audio { width: 100%; }
.recording-result-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.audio-language { display: grid; gap: 7px; max-width: 380px; margin-top: 18px; }
.transcript-card { position: relative; }
.transcript-lead { max-width: none; margin: 0 0 25px; text-align: left; }
.transcript-editor { min-height: 420px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 14px; }
.transcript-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.transcript-options label { display: grid; gap: 7px; font-size: 14px; font-weight: 750; }
.transcript-module-note { display: flex; align-items: baseline; gap: 10px; margin-top: 18px; padding: 13px 15px; border: 1px solid #c5ded0; border-radius: 13px; background: var(--mint); color: var(--green-dark); font-size: 13px; }
.transcript-module-note span { color: var(--muted); }
.live-language-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fafaf5; }
.live-language-grid label { display: grid; gap: 7px; font-size: 14px; font-weight: 750; }
.live-language-grid .live-microphone-field { grid-column: 1 / -1; }
.live-microphone-field small { color: var(--muted); font-size: 12px; font-weight: 500; }
.live-recorder { gap: 18px; margin-bottom: 22px; }
.live-signal-status { margin: -7px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.live-signal-status.has-signal { color: var(--green); font-weight: 750; }
.live-signal-status.no-signal { color: var(--error); font-weight: 750; }
.live-recorder.is-recording .audio-meter span { animation: none; transition: height .1s ease, background-color .1s ease; }
.live-output-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 0 0 12px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 13px; background: #fafaf5; color: var(--muted); font-size: 12px; }
.live-output-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.live-output-legend i { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 7px; background: #e9eeeb; color: var(--green-dark); font-style: normal; }
.live-output-legend .legend-translation i { background: #dff0e6; }
.live-output-stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.live-output-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: white; }
.live-output-transcript { border-color: #c7d1cc; box-shadow: inset 4px 0 0 #778d82; }
.live-output-translated { border-color: #8fc1a8; box-shadow: inset 4px 0 0 var(--green); }
.live-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 19px; border-bottom: 1px solid var(--line); background: #fafaf5; }
.live-output-translated .live-panel-heading { background: var(--mint); }
.live-panel-heading > div { display: grid; gap: 4px; }
.live-panel-heading .live-panel-title { display: flex; grid-template-columns: none; align-items: center; gap: 10px; }
.live-panel-heading .live-panel-title > div { display: grid; gap: 4px; }
.live-panel-heading .live-panel-title > div > span { color: var(--green); font-size: 10px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.live-panel-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #e9eeeb; font-size: 17px; }
.live-output-translated .live-panel-icon { background: white; color: var(--green-dark); font-weight: 850; }
.live-panel-heading h3 { margin: 0; font-size: 19px; }
.live-processing { display: inline-flex; align-items: center; gap: 7px; color: var(--green-dark); font-size: 12px; font-weight: 750; }
.live-processing[hidden] { display: none !important; }
.mini-spinner { width: 16px; height: 16px; border: 2px solid #bcd7c7; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.live-output-text { min-height: 150px; max-height: 310px; overflow-y: auto; padding: 18px 20px; line-height: 1.62; white-space: pre-wrap; }
.live-output-text p { margin: 0 0 12px; }
.live-output-text p:last-child { margin-bottom: 0; }
.live-placeholder { color: var(--muted); font-style: italic; }
.live-output-translated .live-output-text { font-style: italic; background: #fbfefc; }
.live-source-actions { padding: 0 18px 18px; }
.live-source-actions .button { width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.chat-view { display: flex; flex-direction: column; }
.chat-settings { flex: 0 1 360px; display: grid; gap: 10px; min-width: 310px; padding: 14px; border: 1px solid #c5ded0; border-radius: 14px; background: var(--mint); }
.chat-settings > label:first-child { display: grid; gap: 6px; color: var(--green-dark); font-size: 12px; font-weight: 800; }
.chat-settings select { padding: 9px 11px; border-color: #aac9b7; font-size: 14px; }
.chat-search-toggle { display: flex; align-items: flex-start; gap: 9px; color: var(--green-dark); cursor: pointer; }
.chat-search-toggle input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--green); }
.chat-search-toggle > span { display: grid; gap: 2px; }
.chat-search-toggle strong { font-size: 13px; }
.chat-search-toggle small { color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.35; }
.chat-search-toggle.is-disabled { cursor: not-allowed; opacity: .7; }
.source-preview { padding: 10px 11px; border: 1px solid #c5ded0; border-radius: 10px; background: white; color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.text-button { width: fit-content; padding: 0; border: 0; background: transparent; color: var(--green-dark); font: inherit; font-size: 12px; font-weight: 800; text-decoration: underline; cursor: pointer; }
.brave-warning { margin-bottom: 16px; padding: 15px 17px; border: 1px solid #e6c98d; border-radius: 14px; background: #fff7e6; color: #704d12; }
.brave-warning p { margin: 6px 0 10px; font-size: 13px; line-height: 1.5; }
.brave-warning label { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; font-weight: 700; }
.brave-warning input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--green); }
.domain-editor-header { display: flex; align-items: center; justify-content: space-between; }
.domain-editor-header .field-label { margin: 0; }
.domain-add-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.domain-list { display: grid; gap: 8px; min-height: 48px; }
.domain-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fafaf5; }
.domain-item code { overflow-wrap: anywhere; }
.domain-remove { border: 0; background: transparent; color: #9b3027; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.domain-empty { margin: 0; padding: 13px; border: 1px dashed var(--line); border-radius: 11px; color: var(--muted); font-size: 13px; }
.chat-privacy { display: flex; gap: 12px; align-items: baseline; margin-bottom: 16px; padding: 13px 16px; border: 1px solid #c5ded0; border-radius: 13px; background: var(--mint); color: var(--green-dark); font-size: 13px; }
.chat-privacy span { color: var(--muted); }
.chat-log { display: flex; flex-direction: column; gap: 18px; min-height: 360px; max-height: 58vh; overflow-y: auto; padding: 24px; border: 1px solid var(--line); border-radius: 18px 18px 0 0; background: #fafaf5; }
.chat-message { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 14px; align-items: start; }
.chat-message > strong { padding-top: 10px; color: var(--green-dark); font-size: 13px; }
.chat-message-body { min-width: 0; padding: 11px 15px; border: 1px solid var(--line); border-radius: 6px 16px 16px 16px; background: white; line-height: 1.5; white-space: normal; }
.chat-message .concept-status { margin-top: 4px; }
.chat-message-user .chat-message-body { background: var(--mint); border-color: #c5ded0; white-space: pre-wrap; }
.chat-message-assistant .chat-message-body.markdown-body p { margin-bottom: 9px; }
.chat-message-assistant .chat-message-body.markdown-body ul, .chat-message-assistant .chat-message-body.markdown-body ol { margin-bottom: 10px; padding-left: 23px; }
.chat-message-assistant .chat-message-body.markdown-body li { margin: 3px 0; }
.chat-message-assistant .chat-message-body.markdown-body li > p { margin: 0; }
.chat-message-assistant .chat-message-body.markdown-body li > ul, .chat-message-assistant .chat-message-body.markdown-body li > ol { margin: 4px 0; }
.chat-message-body.markdown-body p:last-child, .chat-message-body.markdown-body ul:last-child, .chat-message-body.markdown-body ol:last-child { margin-bottom: 0; }
.chat-message-body.markdown-body h1 { font-size: 25px; }
.chat-message-body.markdown-body h2 { margin-top: 20px; font-size: 22px; }
.chat-composer { padding: 14px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 18px 18px; background: white; }
.chat-composer textarea { min-height: 82px; max-height: 220px; border: 0; padding: 8px; resize: vertical; }
.chat-composer textarea:focus { outline: 0; }
.chat-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }
.typing-dot { display: inline-block; width: 7px; height: 7px; margin: 5px 3px; border-radius: 50%; background: var(--green); animation: typing 1s infinite ease-in-out; }
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes meter { from { height: 15px; } to { height: 62px; } }
@keyframes typing { 50% { transform: translateY(-4px); opacity: .45; } }

.admin-page { max-width: 1180px; margin: 0 auto 72px; padding: 42px 24px; }
.admin-heading { margin: 24px 0 30px; }
.admin-heading h1 { margin: 8px 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(36px, 5vw, 54px); font-weight: 500; }
.admin-heading p, .admin-section > p { color: var(--muted); }
.admin-section { margin-top: 22px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.admin-section h2 { margin: 0 0 16px; font-size: 23px; }
.admin-request-list { display: grid; gap: 10px; }
.admin-request { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; }
.admin-request > div { display: grid; gap: 4px; }
.admin-request span { color: var(--muted); font-size: 12px; }
.admin-request form { display: flex; flex-wrap: wrap; gap: 8px; }
.audit-explanation { margin-bottom: 18px; padding: 15px 17px; border-radius: 13px; background: var(--mint); }
.audit-explanation p { margin: 5px 0; color: var(--green-dark); font-size: 13px; line-height: 1.5; }
.audit-table code { word-break: break-all; }

@media (max-width: 700px) {
  .role-badge { display: none; }
  .topbar { align-items: flex-start; gap: 12px; }
  .topbar-actions { align-items: flex-end; flex-direction: column-reverse; }
  .brand-logo { width: 142px; }
  .recording-result-actions { grid-template-columns: 1fr; }
  .hero { margin-top: 35px; }
  .trust-grid { grid-template-columns: 1fr; }
  .compliance-summary { margin: 0 18px 52px; padding: 26px 18px; }
  .compliance-grid { grid-template-columns: 1fr; }
  .compliance-download-card { align-items: stretch; flex-direction: column; padding: 22px; }
  .privacy-statement { margin: 0 18px 52px; padding: 26px 18px; }
  .privacy-contact-card { flex-direction: column; gap: 6px; }
  .topbar { padding: 18px; }
  .login-card, .upload-card { padding: 24px; }
  .input-grid { grid-template-columns: 1fr; }
  .input-panel-wide { grid-column: auto; }
  .url-row { grid-template-columns: 1fr; }
  .template-toolbar, .output-options { grid-template-columns: 1fr; }
  .workspace-header { flex-direction: column; gap: 18px; }
  .model-badge { width: 100%; }
  .workflow-settings { grid-template-columns: 1fr; }
  .source-tabs { overflow-x: auto; }
  .source-tab { min-width: max-content; }
  .dashboard-header { flex-direction: column; }
  .usage-card { align-items: flex-start; flex-direction: column; }
  .session-security-card > div, .admin-request { align-items: flex-start; flex-direction: column; }
  .site-footer { padding: 22px 18px; }
  .model-stack { width: 100%; justify-content: stretch; }
  .model-stack .model-badge { flex: 1; min-width: 0; }
  .action-grid { grid-template-columns: 1fr; }
  .action-card-secondary { grid-column: auto; }
  .action-card { min-height: 105px; padding: 17px; }
  .transcript-options { grid-template-columns: 1fr; }
  .transcript-module-note { align-items: flex-start; flex-direction: column; }
  .live-language-grid { grid-template-columns: 1fr; }
  .live-output-stack, .document-tools-grid { grid-template-columns: 1fr; }
  .document-assistant-heading { flex-direction: column; }
  .chat-privacy { align-items: flex-start; flex-direction: column; }
  .chat-settings { width: 100%; min-width: 0; }
  .domain-add-row { grid-template-columns: 1fr; }
  .chat-log { padding: 15px; }
  .chat-message { grid-template-columns: 1fr; gap: 5px; }
  .chat-message > strong { padding: 0; }
  .chat-actions { align-items: stretch; flex-direction: column-reverse; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 1.8s; }
  .action-card { transition: none; }
  .recorder.is-recording .record-dot, .recorder.is-recording .audio-meter span { animation: none; }
  .typing-dot { animation: none; }
  .mini-spinner { animation: none; }
}
