/* Define the colors, font families, and baseline text shared by both Desk windows. */
:root {
  /* Use the light browser palette for native controls and scrollbars. */
  color-scheme: light;
  /* Use a dark green for readable primary text. */
  --ink: #17322e;
  /* Use a softer green-gray for supporting labels and explanatory copy. */
  --muted: #516761;
  /* Share a subdued separator color across cards and panels. */
  --line: #cdd8ce;
  /* Use warm off-white for content surfaces. */
  --card: #fffefa;
  /* Give the main page a slightly darker paper-colored backdrop. */
  --paper: #f4f5ee;
  /* Use teal to identify interactive elements and the prediction. */
  --teal: #14675d;
  /* Use the deepest green for headers and the chat callout. */
  --dark: #123f39;
  /* Prefer Source Sans 3 for regular text with local system fallbacks. */
  --font: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  /* Prefer Source Serif 4 for display headings with serif fallbacks. */
  --serif: "Source Serif 4", Georgia, serif;
  /* Set the base text to 16px with one-and-a-half line spacing. */
  font: 16px/1.5 var(--font);
  /* Make the shared ink color the default for descendant text. */
  color: var(--ink);
  /* Apply the paper color behind the page. */
  background: var(--paper);
/* Finish the shared theme before applying element and component rules. */
}
/* Include borders and padding in declared sizes, including pseudo-elements. */
*, *::before, *::after { box-sizing: border-box; }
/* Give the hidden attribute precedence over component layout styles. */
[hidden] { display: none !important; }
/* Remove the browser's default page margin. */
body { margin: 0; }
/* Reset heading, paragraph, and definition-list spacing so components can set their own rhythm. */
h1, h2, h3, p, dl { margin: 0; }
/* Use a medium-weight serif for the two highest heading levels. */
h1, h2 { font-family: var(--serif); font-weight: 500; }
/* Tighten line spacing on section headings. */
h2 { line-height: 1.22; }
/* Inherit page typography in interactive form controls. */
button, input, textarea, select { font: inherit; color: inherit; }
/* Show the pointer cursor on buttons and disclosure headings. */
button, summary { cursor: pointer; }
/* Remove the browser button border before applying individual variants. */
button { border: 0; }
/* Visibly dim unavailable controls and remove their action cursor. */
button:disabled, select:disabled, textarea:disabled { cursor: default; opacity: .55; }
/* Make keyboard focus visible with a separated amber outline. */
:focus-visible { outline: 3px solid #bd702f; outline-offset: 3px; }
/* Share input geometry across text fields, selects, and multiline fields. */
input, select, textarea {
  /* Give controls a full-width white surface, green-gray border, modest rounding, and inner padding. */
  width: 100%; border: 1px solid #a3b5a9; border-radius: .4rem; padding: .65rem .75rem; background: white;
/* Finish the shared input geometry before adding textarea-specific behavior. */
}
/* Allow more writing space without dragging a textarea wider than its column. */
textarea { resize: vertical; }
/* Put labels above fields and emphasize them with a moderately bold face. */
label { display: block; font-weight: 650; font-size: .94rem; }
/* Leave a small gap between a label and the field immediately after it. */
label + input, label + textarea { margin-top: .35rem; }
/* Use dark green and contrasting white text for both window headers. */
.mast, .chat-head { background: var(--dark); color: white; }
/* Align header and content to a centered 1100px maximum width with responsive side padding. */
.mast-inner, .desk { max-width: 1100px; padding-inline: clamp(1rem, 4vw, 3rem); margin-inline: auto; }
/* Arrange the wordmark and header label horizontally with a minimum header height. */
.mast-inner { display: flex; align-items: center; gap: 1.2rem; min-height: 4.25rem; }
/* Give the brand name a compact, bold typographic treatment. */
.wordmark { font-weight: 750; letter-spacing: -.055em; font-size: 1.52rem; }
/* Distinguish the AI suffix with lighter weight and a pale green color. */
.wordmark span { font-weight: 450; color: #b5e8c8; }
/* Separate the descriptive header label from the wordmark with a vertical border. */
.mast-label { color: #d6e7dd; padding-left: 1.2rem; border-left: 1px solid #578279; font-size: .88rem; }
/* Allow the space above main content to scale with the viewport. */
.desk { padding-block: clamp(1.5rem, 4vw, 3rem) 3rem; }
/* Limit the intro text width and separate it from the following controls. */
.page-intro { max-width: 45rem; margin-bottom: 1.15rem; }
/* Scale the page title between 2.4 and 3.75 rem while keeping its lines tight. */
.page-intro h1 { font-size: clamp(2.4rem, 5vw, 3.75rem); line-height: 1.08; letter-spacing: -.05em; margin-bottom: .55rem; }
/* Let long excerpts, labels, or chat text break inside their containers. */
.page-intro p, .small, .state, .source-text, .report, .chat-link p, .chat-content p { overflow-wrap: anywhere; }
/* Use the muted text color for supporting explanations and status messages. */
.page-intro p, .small, .state { color: var(--muted); }
/* Scale auxiliary text below the default body size. */
.small { font-size: .86rem; }
/* Display the live/demo indicator as a compact pale-green strip with a left accent. */
.environment { width: fit-content; margin: 0 0 1.25rem; border-left: 3px solid #628c77; padding: .2rem .65rem; font-size: .91rem; color: #34594e; background: #e5eee3; }
/* Give the proposal form and prediction card equal-width columns on wider screens. */
.desk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
/* Use a bordered, rounded card surface and responsive padding for major sections. */
.card { background: var(--card); border: 1px solid var(--line); border-radius: .75rem; padding: clamp(1rem, 2.3vw, 1.65rem); }
/* Scale card and chat-callout headings with the viewport. */
.card h2, .chat-link h2 { font-size: clamp(1.45rem, 2.8vw, 1.85rem); }
/* Separate the card heading from its fields or results. */
.card h2 { margin-bottom: 1rem; }
/* Stack proposal form controls using grid layout. */
.proposal form { display: grid; }
/* Keep a field's validation message with its input and leave room before the next label. */
.proposal label[for="work"] { margin-top: .9rem; }
.proposal [aria-invalid="true"] { border-color: #963d2b; }
.field-error { margin-top: .25rem; color: #86341f; font-size: .9rem; }
/* Separate form actions from the proposed-work field. */
.proposal .actions { margin-top: 1rem; }
/* Place related actions in a wrapping row with space between controls. */
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1.05rem; }
/* Give the primary action a bold white label on a rounded teal button. */
.primary { background: var(--teal); color: white; padding: .63rem .95rem; border-radius: .45rem; font-weight: 650; }
/* Darken an enabled primary button on hover. */
.primary:hover:enabled { background: #0c5047; }
/* Present secondary actions as underlined text with a small click target extension. */
.text-button, .light-link { padding: .3rem 0; background: none; font-size: .9rem; font-weight: 650; text-decoration: underline; text-underline-offset: .18em; }
/* Color standard secondary actions in the Desk's teal. */
.text-button { color: var(--teal); }
/* Identify the prediction card with a teal top border. */
.result { border-top: 3px solid var(--teal); }
/* Collapse the result's temporary status line after its message is cleared. */
.result .state:empty { display: none; }
/* Emphasize the selected pathway in large teal serif type. */
.route { font: 500 clamp(1.8rem, 4vw, 2.5rem)/1.12 var(--serif); color: var(--teal); margin-bottom: 1rem; }
/* Display the hearing probability and threshold side by side between horizontal separators. */
.metrics { display: grid; grid-template-columns: 1fr 1fr; border-block: 1px solid var(--line); padding-block: .8rem; gap: .8rem; }
/* Keep metric and service labels smaller and muted relative to values. */
.metrics dt, .services dt { color: var(--muted); font-size: .86rem; }
/* Use tabular numerals for score comparisons and remove default definition indentation. */
.metrics dd { font: 500 1.5rem var(--font); font-variant-numeric: tabular-nums; margin: .12rem 0 0; }
/* Set the operating-mode note apart from the numbers above it. */
.result .small { margin-top: .65rem; }
/* Indent warning bullets and use a brown tone for model limitations. */
.warning-list { padding-left: 1.15rem; color: #795021; }
/* Lay out chat actions and description on a wrapping dark callout below the prediction. */
.chat-link { margin-block: 1rem; padding: 1.25rem clamp(1rem, 2.3vw, 1.65rem); display: flex; justify-content: space-between; gap: .8rem 1.3rem; align-items: center; flex-wrap: wrap; background: var(--dark); border-radius: .75rem; color: #fffcf4; }
/* Use subdued light text for the chat callout's explanatory line. */
.chat-link p { font-size: .92rem; color: #cfdfd5; margin-top: .2rem; }
/* Invert the chat callout's primary action to retain contrast on the dark background. */
.chat-link .primary { background: #d4edc4; color: #173c30; }
/* Lighten the enabled chat button on hover. */
.chat-link .primary:hover:enabled { background: #e7f9da; }
/* Keep the alternate in-page chat link legible against the dark panel. */
.light-link { color: #e3f5e9; }
/* Separate neighboring evidence disclosures with a thin rule. */
.disclosure { border-top: 1px solid var(--line); }
/* Style disclosure summaries as padded, teal interactive labels. */
summary { padding: .65rem 0; font-weight: 650; color: var(--teal); }
/* Leave breathing room below expanded evidence, report, and service content. */
.disclosure > p, .report, .services { padding: .25rem 0 1rem; }
/* Preserve meaningful line breaks in source passages and chat text. */
.source-text, .turn-text { white-space: pre-wrap; }
/* Give generated report blocks a consistent vertical gap. */
.report { display: grid; gap: .5rem; }
/* Separate report subsection headings from the preceding passages. */
.report h3 { font-size: 1.03rem; margin-top: .5rem; }
/* Align service names with their returned statuses in two grid columns. */
.services { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; }
/* Remove default indentation from service-status values. */
.services dd { margin: 0; }
/* Define the floating chat drawer used as an alternative to a separate window. */
.drawer {
  /* Anchor the panel above content in the lower-right corner with a vertical layout. */
  position: fixed; z-index: 2; inset: auto 1rem 1rem auto; display: flex; flex-direction: column;
  /* Constrain drawer size to the viewport, preferring dynamic height where supported. */
  width: min(27rem, calc(100vw - 2rem)); height: min(46rem, 85vh); height: min(46rem, 85dvh);
  /* Use an outlined, rounded surface distinct from the page behind the drawer. */
  background: var(--card); border: 1px solid #84998a; border-radius: .65rem;
  /* Add depth and clip iframe content to the rounded boundary. */
  box-shadow: 0 .5rem 2.3rem #102d2440; overflow: hidden;
/* Finish the main floating-panel rules. */
}
/* Align the panel label and close control at opposite ends of its header. */
.drawer-bar { display: flex; justify-content: space-between; align-items: center; padding: .25rem .9rem; font-size: .83rem; background: #ebefe4; }
/* Let the embedded chat fill the space below the header without an extra frame border. */
.drawer iframe { width: 100%; flex: 1; border: 0; background: var(--card); }
/* Use the card surface color throughout the standalone chat. */
.chat-page { background: var(--card); }
/* Give the popup header compact inset spacing. */
.chat-head { padding: .85rem 1.2rem 1rem; }
/* Reduce the wordmark size to suit the narrower chat header. */
.chat-head .wordmark { font-size: 1rem; }
/* Set the chat title below the brand with a compact line height. */
.chat-head h1 { font-size: 2rem; line-height: 1.1; margin-top: .2rem; }
/* Center chat content and adapt its horizontal padding to narrow popups. */
.chat-content { max-width: 46rem; padding: 1rem clamp(.8rem, 4vw, 1.4rem) 2rem; margin: 0 auto; }
/* Distinguish linked-proposal details with a pale background and teal left border. */
.context-box { border-left: 3px solid var(--teal); padding: .75rem .85rem; background: #e9f0e4; }
/* Keep long property addresses readable inside the linked-context box. */
.context-box h2 { font-size: 1.23rem; overflow-wrap: anywhere; }
/* Use smaller type for the linked scope and expandable details. */
.context-box p, .context-box summary { font-size: .84rem; }
/* Separate the context status line from the address. */
.context-box p { margin-top: .25rem; }
/* Keep the linked-proposal disclosure compact. */
.context-box summary { padding: .35rem 0 0; }
/* Place the review-mode label and selector on a single spaced row. */
.mode-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 1rem 0 .25rem; }
/* Size the selector to its contents and reduce its padding inside the compact row. */
.mode-row select { width: auto; padding: .33rem .4rem; }
/* Use a small bold heading for related chat controls. */
.section-label { font: 650 .91rem var(--font); margin: 1rem 0 .4rem; }
/* Allow suggested questions to wrap across as many rows as needed. */
.suggestions { display: flex; flex-wrap: wrap; gap: .4rem; }
/* Style suggested questions as small, outlined rounded buttons. */
.suggestions button { padding: .35rem .6rem; border: 1px solid #b7c9bc; border-radius: 1rem; background: #f8faf6; color: #22594a; font-size: .84rem; }
/* Highlight a suggestion on hover only when it can be submitted. */
.suggestions button:hover:enabled { background: #e2eedf; }
/* Stack conversation turns with a consistent gap. */
.messages { display: grid; gap: .9rem; }
/* Prevent wide text from expanding a message card and frame each turn with padding. */
.turn { min-width: 0; padding: .75rem .85rem; border: 1px solid var(--line); border-radius: .6rem; }
/* Add space above the first message without shifting an empty transcript. */
.turn:first-child { margin-top: 1rem; }
/* Offset user turns from the left and tint them pale green. */
.user-turn { margin-left: 1.5rem; background: #edf2e9; }
/* Give assistant turns their own white background and slight right margin. */
.assistant-turn { margin-right: .4rem; background: #fff; }
/* Use a compact teal label for the speaker or answer origin. */
.turn h3 { margin: 0 0 .35rem; font: 650 .89rem var(--font); color: var(--teal); }
/* Keep conversation paragraphs slightly smaller than the base text. */
.turn p { font-size: .94rem; }
/* Divide embedded evidence, findings, and limitation disclosures from the answer. */
.turn details { margin: .6rem 0 0; border-top: 1px solid var(--line); }
/* Keep disclosure labels inside a chat turn concise. */
.turn summary { font-size: .88rem; padding: .35rem 0; }
/* Set quoted passages apart with a left rule and allow long strings to wrap. */
.turn blockquote { margin: .4rem 0 .6rem; border-left: 2px solid var(--line); padding-left: .6rem; font-size: .9rem; overflow-wrap: anywhere; }
/* Indent limitation items while keeping lists compact. */
.turn ul { margin: .25rem 0; padding-left: 1.2rem; font-size: .88rem; }
/* Indent individual review rounds and identify them with a green rule. */
.council-round { margin: .5rem 0; padding-left: .7rem; border-left: 2px solid #9ac3ac; }
/* Allow long reviewer and model labels to wrap inside the panel. */
.council-round strong { font-size: .85rem; overflow-wrap: anywhere; }
/* Use compact type for council findings. */
.council-round p { font-size: .88rem; }
/* Separate the free-text question form from the transcript. */
#chat-form { margin-top: 1.2rem; }
/* Keep the submit button at the end of the composer row beside status text. */
.composer-actions { display: flex; align-items: center; justify-content: flex-end; gap: .9rem; margin-top: .3rem; }
/* Give the status message the remaining width in the composer. */
.composer-actions .small { flex: 1; }
/* Constrain the source modal to the viewport and use the same outlined card style. */
dialog { color: var(--ink); border: 1px solid var(--line); background: var(--card); padding: 1.1rem; border-radius: .55rem; max-width: min(38rem, 91vw); max-height: 80vh; }
/* Dim the page behind an open source dialog. */
dialog::backdrop { background: #122f29a0; }
/* Align the dialog close action to the right. */
dialog form { text-align: right; }
/* Allow long source titles to wrap and separate them from the quoted passage. */
dialog h2 { margin-bottom: .65rem; overflow-wrap: anywhere; }
/* Adapt the main page and drawer once the viewport is 680px wide or narrower. */
@media (max-width: 680px) {
  /* Stack the form and prediction card in a single column. */
  .desk-grid { grid-template-columns: 1fr; }
  /* Reduce the gap between brand and header label on smaller screens. */
  .mast-inner { gap: .75rem; }
  /* Reduce header-label padding and type size to avoid crowding the wordmark. */
  .mast-label { padding-left: .75rem; font-size: .76rem; }
  /* Pin the drawer edge to edge across the bottom and use most of the viewport height. */
  .drawer { inset: auto 0 0; height: 89vh; height: 89dvh; width: 100%; }
/* Resume styles shared by large and small screens. */
}
/* Place the environment label and historical-case link on a wrapping row above the form. */
.desk-mode-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1.25rem; }
/* Put the environment indicator first without its standalone bottom margin. */
.desk-mode-row .environment { order: -1; margin: 0; }
/* Give historic-case and source links a consistent teal underline treatment. */
.case-link, .case-nav a, .record-links a { color: var(--teal); text-underline-offset: .18em; }
/* Use compact type for the cross-page navigation links. */
.case-link, .case-nav a { font-size: .9rem; }
/* Separate the archive page's return link from its title. */
.case-nav { margin-bottom: 1.2rem; }
/* Leave room between the prediction area and the comparison card. */
.precedents { margin-top: 1rem; }
/* Separate the comparison summary from the first historical record. */
.comparison-note { margin-bottom: 1rem; }
/* Divide precedent records with a line and allow long excerpts to wrap. */
.record-card { border-top: 1px solid var(--line); overflow-wrap: anywhere; }
/* Increase the clickable area around a record's summary. */
.record-card summary { padding: .85rem 0; }
/* Place the source category beside the title using smaller, muted text. */
.record-category { display: inline-block; margin-left: .75rem; color: var(--muted); font-size: .84rem; font-weight: 500; }
/* Align comparison labels and values in a responsive two-column definition list. */
.record-facts { display: grid; grid-template-columns: minmax(7rem, 9rem) 1fr; gap: .55rem 1rem; padding: .35rem 0 1rem; }
/* Emphasize the meaning of each record field. */
.record-facts dt { font-weight: 650; }
/* Remove the browser's default indentation from comparison values. */
.record-facts dd { margin: 0; }
/* Arrange source links as a wrapping row without bullet markers. */
.record-links { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: 0 0 .85rem; padding: 0; list-style: none; }
/* Tighten source-link spacing when the same list is shown inside a chat turn. */
.turn .record-links { margin: .5rem 0; padding: 0; }
/* Switch record layout for devices at or below 600px wide. */
@media (max-width: 600px) {
  /* Move the record category under the title with a small indent. */
  .record-category { display: block; margin: .1rem 0 0 1.05rem; }
  /* Stack each field label over its comparison value. */
  .record-facts { display: block; }
  /* Separate the next label from the preceding value in the stacked layout. */
  .record-facts dd + dt { margin-top: .7rem; }
/* Finish the small-screen adjustments. */
}

/* User-friendly prediction summary. */
.probability-summary {
  border-block: 1px solid var(--line);
  padding-block: .8rem;
  margin-bottom: 1rem;
}

.metric-label {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: .15rem;
}

.metric-value {
  font-size: 1.65rem;
  font-weight: 650;
  margin: 0;
}

.explanation {
  margin-top: 1rem;
}

.explanation h3 {
  font-size: 1rem;
  margin-bottom: .35rem;
}

.explanation p {
  margin: 0;
  line-height: 1.5;
}

.technical-details {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
}

.technical-details summary {
  font-size: .9rem;
}

.technical-details .small {
  margin-top: .5rem;
}
