/* Law check — Open Alvary (/agents/)
 * Aligned with Open Alvary's design tokens (web/src/style.css) and
 * Chrome modern-web-guidance (spec draft 7, §§10.2–10.13).
 */

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/dm-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/dm-sans-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/dm-sans-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Libre Caslon Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/libre-caslon-display-latin-400-normal.woff2") format("woff2");
}

:root {
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  color: #1a1a1a;
  background: #fafafa;
  font-synthesis: none;
  font-weight: 400;
  --primary: #1a1a1a;
  --ink: #1a1a1a;
  --bg: #fafafa;
  --card: #ffffff;
  --accent: #8a5a2b;
  --muted: #6b6b6b;
  --line: #e5e5e5;
  --input-border: #dcdcdc;
  --input-focus: #b5b5b5;
  --surface: #ffffff;
  --page-bg: #fafafa;
  --serif: "Libre Caslon Display", Georgia, serif;
  --green-fg: #2f6b4f;
  --green-bg: #ddebe3;
  --amber-fg: #6e4a23;
  --amber-bg: #f3e9d9;
  /* "Not found", errors and refusals: plain grey, never red (owner, 2026-11-23); the words and the icon say it. */
  --alert-fg: #3a3a3a;
  --alert-bg: #f6f6f5;
  --grey-fg: #3a3a3a;
  --grey-bg: #f0f0f0;
  scroll-padding-block: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(16px + env(safe-area-inset-top, 0px));
  scroll-padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--primary);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: break-word;
  padding-inline-start: env(safe-area-inset-left, 0px);
  padding-inline-end: env(safe-area-inset-right, 0px);
}

/* Wrap links and code cleanly for 320px reflow without masking horizontal overflow. */
a,
code {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

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

button,
a,
select {
  touch-action: manipulation;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #737373;
  outline-offset: 5px;
}

/* A field with the focus: a slightly darker edge, never a heavy outline or a ring. The transparent
   outline is for forced colours, which draw it in the system's colour. */
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid transparent;
  outline-offset: -1px;
  border-color: var(--input-focus);
}

/* The law field suggests laws as it is typed in (a datalist); the browser's own arrow is not shown. */
.lc-input::-webkit-calendar-picker-indicator,
.lc-input::-webkit-list-button {
  display: none !important;
}

.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;
}

/* Skip link */
.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 100;
  background: #1a1a1a;
  color: #ffffff;
  padding: 14px;
  border-radius: 4px;
  text-decoration: none;
}

.skip-link:focus {
  top: calc(16px + env(safe-area-inset-top, 0px));
}

main:focus {
  outline: none;
}

/* Site header (matches web/src/style.css) */
.site-header {
  max-width: 1440px;
  margin: auto;
  min-block-size: 108px;
  padding: 0 5.6%;
  display: flex;
  align-items: center;
  gap: 32px;
  border-bottom: 1px solid var(--line);
}

.site-header a {
  color: inherit;
  text-decoration: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -1.4px;
  line-height: 1;
}

.brand-light {
  font-weight: 400;
  margin-left: 4px;
}

.site-nav {
  display: flex;
  gap: 26px;
  margin-left: auto;
  font-size: 14px;
  font-weight: 500;
}

.site-nav a {
  padding: 12px 0;
  min-block-size: 24px;
  display: inline-flex;
  align-items: center;
}

.site-nav a:hover,
.site-nav a[aria-current] {
  color: #1a1a1a;
}

.site-nav a[aria-current] {
  border-block-end: 2px solid var(--accent);
}

.mobile-toggle {
  display: none;
  min-block-size: 44px;
  min-inline-size: 44px;
  align-items: center;
  justify-content: center;
}

/* Main page container: one centred column, as in a chat */
.law-check-main {
  margin: 0;
  padding: 0;
}

.lc-chat {
  /* Fill the window under the site header, so the composer rests at the bottom from the start */
  min-block-size: calc(100dvh - 109px);
  display: flex;
  flex-direction: column;
}

/* The one centred column, used by the thread and by the composer */
.lc-col {
  inline-size: min(800px, 100% - 11.2vw);
  margin-inline: auto;
}
.lc-col-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-block-start: 28px;
}

.lc-scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  /* Hidden labels inside the thread are absolutely placed; without this they would sit outside the
     scrolling box and make the whole page scroll with it. */
  position: relative;
}
.lc-scroll:focus-visible {
  outline: 2px solid #737373;
  outline-offset: -2px;
}

/* Once a thread exists the page behaves like a chat: the site header and the composer keep their
   places and only the thread scrolls. A very short window (or a very high zoom) has no room for
   that, so there the page scrolls as an ordinary page. */
@media (min-height: 521px) {
  body.lc-threaded {
    block-size: 100dvh;
    display: flex;
    flex-direction: column;
  }
  body.lc-threaded .site-header {
    flex: none;
    inline-size: 100%;
    /* The thread needs the room more than the header does */
    min-block-size: 64px;
  }
  body.lc-threaded .brand {
    font-size: 22px;
    letter-spacing: -1px;
  }
  body.lc-threaded .brand-mark {
    inline-size: 30px;
    block-size: 30px;
  }
  body.lc-threaded .site-nav.expanded {
    top: 100%;
  }
  body.lc-threaded .site-footer {
    display: none;
  }
  body.lc-threaded .law-check-main {
    flex: 1;
    min-block-size: 0;
    display: flex;
    flex-direction: column;
  }
  body.lc-threaded .lc-chat {
    flex: 1;
    min-block-size: 0;
  }
  body.lc-threaded .lc-scroll {
    min-block-size: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
  body.lc-threaded .lc-col-thread {
    flex: none;
    padding-block-start: 20px;
  }
}

.lc-chat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
}

.lc-chat-title {
  min-inline-size: 0;
  flex: 1 1 320px;
}

.lc-chat-head h1 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--primary);
}

.lc-lead {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
  max-width: 62ch;
}

.lc-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.lc-head-btn {
  padding: 6px 12px;
  border: 1px solid var(--input-border);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  min-block-size: 32px;
}
.lc-head-btn[hidden] {
  display: none;
}

/* Native <details> disclosures */
.lc-disclosure {
  font-size: 14px;
}

.lc-disclosure > summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--primary);
  min-block-size: 28px;
  padding-block: 4px;
  list-style-position: inside;
}

.lc-what-checked {
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
}

.lc-what-checked p {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--primary);
}

.lc-checked-table-wrap {
  overflow-x: auto;
}

.lc-checked-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.lc-checked-table th,
.lc-checked-table td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
}

.lc-checked-table th {
  border-top: none;
  font-weight: 600;
  color: var(--primary);
}

/* Global status banners (paused, offline, no Web Crypto) */
.lc-banner {
  margin: 16px 0;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid transparent;
}

.lc-banner[data-tone="amber"] {
  background: var(--amber-bg);
  color: var(--amber-fg);
  border-color: #d8c2a0;
}

.lc-banner[data-tone="red"] {
  background: var(--alert-bg);
  color: var(--alert-fg);
  border-color: #e6e6e6;
}

.lc-banner[data-tone="grey"] {
  background: var(--grey-bg);
  color: var(--grey-fg);
  border-color: #d4d4d4;
}

.lc-noscript {
  margin: 16px 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 15px;
}

/* Forms */
.lc-field {
  margin-bottom: 18px;
}

.lc-field label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

.lc-hint {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--muted);
}

.lc-input,
.lc-select,
.lc-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--input-border);
  border-radius: 5px;
  min-block-size: 42px;
}


.lc-input:user-invalid,
.lc-select:user-invalid,
.lc-textarea:user-invalid,
.lc-input[aria-invalid="true"],
.lc-select[aria-invalid="true"],
.lc-textarea[aria-invalid="true"] {
  border-color: var(--alert-fg);
  background: var(--surface);
}

.lc-error {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--alert-fg);
}

.lc-char-counter {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.lc-char-counter.over-limit {
  color: var(--alert-fg);
  font-weight: 600;
}

.lc-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 8px;
}

.lc-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
  border-radius: 5px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 500;
  min-block-size: 42px;
  min-inline-size: 42px;
}

.lc-btn-primary:hover {
  background: #333333;
}

.lc-btn-primary[aria-disabled="true"] {
  opacity: 0.6;
  cursor: wait;
}

.lc-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--input-border);
  border-radius: 5px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  min-block-size: 36px;
  min-inline-size: 36px;
}

.lc-examples {
  margin: 14px 0 8px;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.lc-link-btn {
  background: none;
  border: none;
  padding: 4px 2px;
  min-block-size: 28px;
  min-inline-size: 24px;
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 14px;
}

.lc-no-ai-note {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* Inline links inside page prose are always underlined (§10.2) */
.law-check-main a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Notices in the thread */
.lc-notice-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lc-notice-card[data-tone="red"] {
  border-color: #e6e6e6;
  background: var(--alert-bg);
  color: var(--alert-fg);
}

.lc-notice-card[data-tone="amber"] {
  border-color: #d8c2a0;
  background: var(--amber-bg);
  color: var(--amber-fg);
}

.lc-notice-card[data-tone="grey"] {
  background: var(--grey-bg);
  color: var(--grey-fg);
}

.lc-notice-card p {
  margin: 0;
  font-size: 15px;
}

/* Checking placeholder animation */
.lc-skeleton-bar {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, #ececec 25%, #f6f6f6 50%, #ececec 75%);
  background-size: 200% 100%;
  animation: lc-shimmer 1.4s infinite linear;
}

.lc-skeleton-bar.short {
  width: 55%;
}

@keyframes lc-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* ---- The thread ---------------------------------------------------------------------------- */
.lc-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-block: 18px 20px;
  min-inline-size: 0;
}

.lc-welcome {
  margin-block: auto;
  padding-block: 16px;
  text-align: center;
}
.lc-welcome[hidden] {
  display: none;
}
.lc-welcome-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px;
  text-wrap: balance;
}
.lc-welcome-sub {
  font-size: 15px;
  color: var(--muted);
  margin: 0 auto 16px;
  max-width: 58ch;
}
.lc-starter-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.lc-starter-pill {
  padding: 7px 14px;
  border: 1px solid var(--input-border);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 13.5px;
  min-block-size: 34px;
}
.lc-starter-pill[hidden] {
  display: none;
}
.lc-starter-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lc-thread-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.lc-thread-list:empty {
  display: none;
}

.lc-msg {
  min-inline-size: 0;
  scroll-margin-block: 12px;
}

/* What the visitor sent: to the right, like any chat */
.lc-msg-user {
  align-self: flex-end;
  max-inline-size: min(86%, 580px);
  background: #efefef;
  color: var(--ink);
  border-radius: 14px 14px 4px 14px;
  padding: 9px 14px;
  font-size: 14.5px;
  line-height: 1.55;
  overflow-wrap: break-word;
}
.lc-user-text {
  white-space: pre-wrap;
}
.lc-user-cite {
  display: block;
  font-weight: 600;
}
.lc-user-quote {
  display: block;
  margin-block-start: 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  color: #3a3a3a;
}

/* A result card: checked by code, never styled like the AI's words */
.lc-msg-result {
  align-self: stretch;
}
.lc-msg-caption {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* The AI's own words: plain text with a standing label, never a card */
.lc-msg-ai {
  align-self: stretch;
}
.lc-ai-label {
  margin: 0 0 8px;
  padding-block-end: 6px;
  border-block-end: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.lc-ai-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  overflow-wrap: break-word;
  max-inline-size: 72ch;
}
.lc-ai-text p {
  margin: 0 0 10px;
}
.lc-ai-text ul,
.lc-ai-text ol {
  margin: 0 0 10px;
  padding-inline-start: 22px;
}
.lc-ai-text ul,
.lc-notice-card ul {
  list-style: disc;
}
.lc-ai-text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  background: #f2f2f2;
  padding: 1px 4px;
  border-radius: 3px;
}
.lc-ai-summary {
  margin: 10px 0 0;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 13px;
  background: #f6f6f5;
  color: var(--grey-fg);
}
.lc-ai-summary[data-tone="red"] {
  background: var(--alert-bg);
  color: var(--alert-fg);
}

/* What is happening now */
.lc-msg-status {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}
.lc-status-dot {
  flex: none;
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: lc-pulse 1.2s ease-in-out infinite;
}
@keyframes lc-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.lc-msg-note {
  align-self: stretch;
}
.lc-notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lc-notice-card ul {
  margin: 0;
  padding-inline-start: 18px;
  font-size: 15px;
}

.lc-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.lc-divider::before,
.lc-divider::after {
  content: "";
  flex: 1;
  border-block-start: 1px solid var(--line);
}

.lc-agents-disclosure {
  margin-block-start: 18px;
}
.lc-agents-disclosure[hidden] {
  display: none;
}
.lc-agents-intro {
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  text-align: left;
  line-height: 1.55;
}
.lc-agents-intro p {
  margin: 0 0 10px;
}
.lc-agents-intro p:last-child {
  margin-bottom: 0;
}
.lc-agents-roles {
  margin: 0 0 10px;
  padding-inline-start: 20px;
}
.lc-agents-roles li + li {
  margin-top: 4px;
}
.lc-agents-intro code {
  overflow-wrap: anywhere;
  font-size: 12.5px;
}

/* The agents' steps under an AI answer */
.lc-steps {
  margin-top: 10px;
  font-size: 13px;
  color: var(--grey-fg);
}
.lc-steps > summary {
  cursor: pointer;
  font-weight: 500;
  min-block-size: 28px;
  padding-block: 4px;
}
.lc-steps ol {
  margin: 6px 0 0;
  padding-inline-start: 22px;
  line-height: 1.5;
}
.lc-steps li + li {
  margin-top: 3px;
}

/* ---- The composer, docked at the bottom of the window --------------------------------------- */
/* The composer is the last thing in the column. With a thread above it, it is the bottom of the
   window and the thread scrolls over it; before that it sits in the page under the welcome text. */
.lc-dock {
  flex: none;
  padding-block: 10px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--page-bg);
}
/* No rule above the composer (owner, 2026-11-23): the thread fades out softly where it meets it. */
.lc-chat.has-thread .lc-scroll {
  mask-image: linear-gradient(to bottom, #000 calc(100% - 18px), transparent);
}

.lc-composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 10px;
  background: var(--card);
  border: 1px solid var(--input-border);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}
/* The composer keeps the same light border whether or not its message box has the focus; the text
   cursor in the box shows where typing goes. The transparent outline is there for forced colours,
   which show it in the system's colour. */
.lc-composer:has(.lc-composer-textarea:focus-visible) {
  outline: 2px solid transparent;
  outline-offset: 0;
}
.lc-dock.is-dragover .lc-composer {
  border-color: var(--accent);
  border-style: dashed;
  background: #fbf6ee;
}

.lc-composer .lc-field {
  margin: 0;
}
.lc-composer .lc-field label {
  font-size: 13px;
  margin-block-end: 4px;
}
.lc-citation-field[hidden] {
  display: none;
}
.lc-composer .lc-input {
  min-block-size: 40px;
  padding: 8px 10px;
}

/* The message box has no border of its own: the composer around it shows the focus */
.lc-composer-textarea,
.lc-composer-textarea:focus-visible {
  border: 0;
  outline: none;
  border-radius: 0;
  background: transparent;
}
.lc-composer-textarea {
  field-sizing: content;
  inline-size: 100%;
  block-size: auto;
  min-block-size: 2lh;
  max-block-size: 10lh;
  padding: 2px 0;
  resize: none;
}
/* With a thread above it the empty box is one line tall, so the composer covers less of the window */
.lc-chat.has-thread .lc-composer-textarea {
  min-block-size: 1lh;
}
.lc-composer-textarea[aria-invalid="true"] {
  background: transparent;
  box-shadow: inset 0 -1px 0 var(--alert-fg);
}

.lc-composer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding-block-start: 8px;
  border-block-start: 1px solid var(--line);
}

/* Check quote / Send: the same height and type as the mode buttons beside it (owner, 2026-11-23). */
.lc-composer-bar #composer-send {
  min-block-size: 32px;
  padding: 5px 14px;
  font-size: 13.5px;
  border-radius: 6px;
}

.lc-mode {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: #efefef;
  border-radius: 8px;
}
.lc-mode-btn {
  border: 0;
  background: transparent;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: #5e5e5e;
  min-block-size: 32px;
  white-space: nowrap;
}
.lc-mode-btn:hover {
  color: var(--ink);
}
/* The chosen mode is the white one on the grey track: no underline, no shadow (owner, 2026-11-23). Forced
   colours drop the backgrounds, so there it is underlined instead. */
.lc-mode-btn[aria-pressed="true"] {
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
}
@media (forced-colors: active) {
  .lc-mode-btn[aria-pressed="true"] {
    text-decoration: underline 2px;
    text-underline-offset: 4px;
  }
}
.lc-mode-btn:focus-visible {
  outline-offset: 1px;
}

.lc-short {
  display: none;
}

.lc-attach-btn {
  background: none;
  border: 0;
  padding: 5px 4px;
  min-block-size: 32px;
  font-size: 13.5px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The note takes what room is left and wraps inside it, so the Send button never drops a row */
.lc-composer-note {
  flex: 1 1 0;
  min-inline-size: 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
  text-align: end;
}

.lc-dock-foot {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

/* On a wide window the law and the quoted words sit side by side, so the composer is half as tall */
@media (min-width: 700px) {
  .lc-composer[data-mode="quote"] {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) 3fr;
    column-gap: 14px;
    row-gap: 8px;
    align-items: start;
  }
  .lc-composer[data-mode="quote"] .lc-message-field {
    border-inline-start: 1px solid var(--line);
    padding-inline-start: 14px;
  }
  .lc-composer[data-mode="quote"] .lc-composer-bar {
    grid-column: 1 / -1;
  }
}

/* On a phone, with a thread on screen, the composer folds to one row while it is not in use: the
   message box and its buttons. Clicking or tabbing into the box opens it with every field. The page
   sets "is-open" when a text field in the composer takes the focus and removes it when the focus
   leaves the composer, so pressing a button never moves that button from under the pointer. On a
   wider window it never folds: folding resized the thread on every click and made it jump (owner,
   2026-11-23). */
@media (max-width: 520px) {
  .lc-chat.has-thread .lc-dock:not(.is-open) .lc-composer {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
  .lc-chat.has-thread .lc-dock:not(.is-open) .lc-message-field {
    flex: 1 1 0;
    min-inline-size: 0;
    border: 0;
    padding: 0;
  }
  .lc-chat.has-thread .lc-dock:not(.is-open) .lc-citation-field,
  .lc-chat.has-thread .lc-dock:not(.is-open) .lc-composer-note,
  .lc-chat.has-thread .lc-dock:not(.is-open) .lc-dock-foot,
  .lc-chat.has-thread .lc-dock:not(.is-open) .lc-char-counter,
  .lc-chat.has-thread .lc-dock:not(.is-open) .lc-error {
    display: none;
  }
  /* The label stays for screen readers while folded */
  .lc-chat.has-thread .lc-dock:not(.is-open) #composer-label {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .lc-chat.has-thread .lc-dock:not(.is-open) .lc-composer-bar {
    flex: none;
    flex-wrap: nowrap;
    padding: 0;
    border: 0;
  }
  .lc-chat.has-thread .lc-dock:not(.is-open) .lc-composer-textarea {
    max-block-size: 1lh;
    overflow: hidden;
  }
  .lc-chat.has-thread .lc-dock:not(.is-open) .lc-attach-btn,
  .lc-chat.has-thread .lc-dock:not(.is-open) .lc-mode {
    display: none;
  }
}

/* The / menu opens upwards from the composer, over the thread, so nothing moves */
.lc-slash-anchor {
  position: relative;
}
.lc-slash-menu {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 6px;
  z-index: 5;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lc-slash-menu[hidden] {
  display: none;
}

.lc-slash-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.lc-slash-item:hover,
.lc-slash-item[aria-selected="true"] {
  background: #f0f0f0;
}
.lc-slash-item[aria-selected="true"] {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}
.lc-slash-cmd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.lc-slash-desc {
  font-size: 13px;
  color: var(--muted);
}

.lc-provider-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.lc-provider-pill:hover {
  border-color: var(--input-border);
}
.lc-provider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b7791f;
  flex: none;
}
.lc-provider-dot.is-connected {
  background: #2f6b4f;
}

/* Challenge runtime: tokens and required overrides (§10.5) */
#agent-app[hidden] {
  display: none;
}
#agent-app {
  --ns-font: "DM Sans", system-ui, -apple-system, sans-serif;
  --ns-bg: #ffffff;
  --ns-fg: #1a1a1a;
  --ns-primary: #1a1a1a;
  --ns-accent: #8a5a2b;
  --ns-radius: 6px;
  --ns-border: #e5e5e5;
  --ns-panelbg: #ffffff;
  --ns-msgbg: #f6f6f6;
  --ns-muted: #6b6b6b;
}

/* CRITICAL (§10.5): Hide runtime-drawn model presentation cards so a model can never forge a receipt look */
#agent-app .ns-presentation { display: none; }

/* Recolour runtime LLM badge to neutral grey so it never collides with receipt band colours */
#agent-app .ns-llmbadge {
  background: #f0f0f0;
  color: #3a3a3a;
  border: 1px solid #d4d4d4;
}

/* Label every AI final answer bubble */
#agent-app .ns-msg.bot.ns-rich::before {
  content: "AI's answer. Only quotes with a receipt were checked.";
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #6b6b6b;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e5e5e5;
}

/* This page draws the thread itself; the runtime's own chat and settings panels are never shown */
#agent-app [data-ns-slot="chat"],
#agent-app [data-ns-slot="settings"] {
  display: none !important;
}

#agent-app [data-ns-slot="agents"] {
  block-size: 420px;
  margin-block-start: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: auto;
}

#agent-app .ns-chat {
  background: var(--ns-bg);
}

#agent-app input[type="checkbox"],
#agent-app input[type="radio"] {
  width: auto;
}

#agent-app .ns-header {
  flex-wrap: wrap;
}

#agent-app .ns-settings-body label {
  margin: 4px 0;
  font-weight: 400;
}

#agent-app .ns-w-label {
  font-family: inherit;
}

#agent-app .ns-widget label {
  margin: 0;
}

#agent-app .ns-w-radio label,
#agent-app .ns-w-multi label,
#agent-app .ns-w-toggle {
  font-weight: 400;
}

#agent-app .ns-w-toggle {
  font-size: 13px;
}

#agent-app button {
  margin: 0;
}

#agent-app .ns-w-choice {
  color: var(--ns-fg);
}

#agent-app .ns-devtoggle:not(.on):hover,
#agent-app .ns-modal-close:hover {
  background: transparent;
}

#agent-app .ns-w-choice:disabled:hover {
  background: #fafbfc;
}

#agent-app .ns-consent {
  background: #fffbeb;
}

#agent-app .ns-msgs:has(.ns-consent-actions) > .ns-turn-status {
  display: none;
}

#agent-app .ns-msg {
  overflow-wrap: break-word;
}

#agent-app .ns-consent-actions {
  flex-wrap: wrap;
}

#agent-app .ns-consent-actions button {
  white-space: nowrap;
}

/* Site footer (matches web/src/style.css) */
.site-footer {
  max-width: 1440px;
  margin: auto;
  padding: 35px 5.6%;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 23px;
  letter-spacing: -1px;
}

.footer-brand-name span {
  display: block;
  font-size: 13px;
  letter-spacing: 0;
  margin-top: 4px;
  color: var(--muted);
}

.site-footer p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
}

.footer-links a {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-block-size: 24px;
}

/* Native <dialog> modal (modern-web-guidance: dialog) */
dialog.lc-dialog {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  border: 1px solid #d4d4d4;
  border-radius: 14px;
  padding: 24px;
  background: #ffffff;
  color: #1a1a1a;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  margin: auto;
}
dialog.lc-dialog:modal {
  overscroll-behavior: contain;
}
dialog.lc-dialog::backdrop {
  background: rgba(20, 20, 20, 0.55);
  backdrop-filter: blur(4px);
  overflow: hidden;
  overscroll-behavior: contain;
}
.lc-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.lc-dialog-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
}
.lc-dialog-close {
  border: 0;
  background: transparent;
  color: #6b6b6b;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.lc-dialog-close:hover {
  color: #1a1a1a;
  background: #f2f2f2;
}
.lc-dialog-sub {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.5;
  color: #6b6b6b;
}
.lc-provider-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}
@media (max-width: 480px) {
  .lc-provider-presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.lc-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border: 1.5px solid #e5e5e5;
  border-radius: 10px;
  background: #fafafa;
  color: #1a1a1a;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.lc-preset-btn:hover {
  border-color: #8c8c8c;
  background: #ffffff;
}
.lc-preset-btn[aria-pressed="true"] {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #ffffff;
}
.lc-preset-name {
  font-size: 14px;
  font-weight: 600;
}
.lc-preset-sub {
  font-size: 11px;
  color: #6b6b6b;
}
.lc-preset-btn[aria-pressed="true"] .lc-preset-sub {
  color: #d4d4d4;
}
.lc-connect {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid #e5e5e5;
}
.lc-connect[hidden] {
  display: none;
}
.lc-connect .lc-hint {
  margin: 0;
}
.lc-connect .lc-hint[data-tone="warn"] {
  color: #8a4b00;
}
.lc-model-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.lc-model-choices[hidden] {
  display: none;
}
.lc-model-chip {
  padding: 5px 11px;
  border: 1px solid #d4d4d4;
  border-radius: 999px;
  background: #fafafa;
  color: #1a1a1a;
  font: inherit;
  font-size: 12.5px;
  min-block-size: 32px;
  cursor: pointer;
}
.lc-model-chip:hover {
  border-color: #8c8c8c;
  background: #ffffff;
}
.lc-model-chip[aria-pressed="true"] {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #ffffff;
}
.lc-model-list-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 8px;
}
.lc-model-list-row .lc-hint {
  margin: 0;
  flex: 1 1 200px;
}
.lc-btn-small {
  padding: 5px 11px;
  font-size: 13px;
  min-block-size: 32px;
}
.lc-btn-small[hidden] {
  display: none;
}
.lc-dialog-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lc-key-input-row {
  display: flex;
  gap: 8px;
}
.lc-key-input-row .lc-input {
  flex: 1;
  min-inline-size: 0;
}
.lc-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  position: sticky;
  inset-block-end: -24px;
  margin-block-end: -24px;
  padding-block-end: 24px;
  background: #ffffff;
}
.lc-dialog-actions-right {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.lc-dialog-actions-right button {
  white-space: nowrap;
}
.lc-dialog-remove-row:has([hidden]) {
  display: none;
}
@media (max-width: 480px) {
  /* Short provider tiles, so the fields are not pushed under the buttons on a phone */
  .lc-preset-sub {
    display: none;
  }
}
.lc-btn-danger {
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #f6f6f5;
  color: #3a3a3a;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}


/* Inline links inside page prose are always underlined (§10.2) */
.law-check-main a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Responsive breakpoints */
@media (max-width: 1100px) {
  .site-nav {
    gap: 16px;
    font-size: 15px;
  }
}

@media (max-width: 800px) {
  .site-header {
    min-block-size: 86px;
    justify-content: space-between;
    position: relative;
  }
  .brand {
    font-size: 25px;
  }
  .mobile-toggle {
    display: inline-flex;
    background: none;
    border: none;
    color: #3a3a3a;
  }
  .site-nav {
    display: none;
  }
  .site-nav.expanded {
    display: flex;
    position: absolute;
    top: 85px;
    left: 0;
    right: 0;
    z-index: 10;
    background: #fafafa;
    padding: 20px 6%;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 5px;
  }
  .site-footer {
    flex-wrap: wrap;
  }
  .site-footer p {
    order: 3;
    width: 100%;
  }
  .lc-chat {
    min-block-size: calc(100dvh - 87px);
  }
  .lc-col-thread {
    padding-block-start: 18px;
  }
}

@media (max-width: 520px) {
  /* A phone's window is short: the note under the buttons and the long footer line give way to the thread */
  .lc-composer-note {
    display: none;
  }
  .lc-composer-bar #composer-send {
    margin-inline-start: auto;
  }
  .lc-dock-foot {
    font-size: 12px;
  }
  .lc-msg-user {
    max-inline-size: 92%;
  }
  /* With a thread on screen the footer line gives its room to the thread; it shows on the empty page */
  .lc-chat.has-thread .lc-dock-foot {
    display: none;
  }
  .lc-long {
    display: none;
  }
  .lc-short {
    display: inline;
  }
  .lc-composer {
    padding: 10px 12px 8px;
  }
  /* The mode switch and Send share a row; the saved-proof link sits under them */
  .lc-composer-bar .lc-mode {
    order: 1;
  }
  .lc-composer-bar #composer-send {
    order: 2;
  }
  .lc-composer-bar .lc-attach-btn {
    order: 3;
    flex-basis: 100%;
    text-align: start;
  }
}

/* Ensure boolean hidden hides flexed cards */
.lc-notice-card[hidden],
.lc-banner[hidden] {
  display: none;
}

/* Hide empty runtime slots so no stray bordered box renders */
#agent-app [data-ns-slot="header"]:empty {
  display: none;
}

/* Coarse pointer targets (WCAG 2.5.5) */
@media (pointer: coarse) {
  .lc-btn-primary,
  .lc-btn-secondary,
  .lc-link-btn,
  .lc-disclosure > summary,
  .site-nav a,
  .footer-links a,
  .lc-head-btn,
  .lc-provider-pill,
  .lc-starter-pill,
  .lc-mode-btn,
  .lc-attach-btn,
  .lc-dialog-close,
  .lc-btn-danger,
  .lc-slash-item {
    min-block-size: 44px;
    min-inline-size: 44px;
  }
}

/* Forced colours: states drawn with a background alone would vanish */
@media (forced-colors: active) {
  .lc-model-chip[aria-pressed="true"],
  .lc-preset-btn[aria-pressed="true"] {
    outline: 3px solid Highlight;
    outline-offset: -3px;
  }
  .lc-provider-dot {
    forced-color-adjust: none;
    background: GrayText;
  }
  .lc-provider-dot.is-connected {
    background: Highlight;
  }
  .lc-slash-item[aria-selected="true"] {
    outline-color: Highlight;
  }
  .lc-composer,
  .lc-msg-user,
  .lc-banner,
  .lc-notice-card {
    border: 1px solid CanvasText;
  }
  .lc-status-dot {
    forced-color-adjust: none;
    background: Highlight;
  }
}

/* Printing: the thread, not the composer or the site's chrome */
@media print {
  .skip-link,
  .site-header,
  .site-footer,
  .lc-dock,
  .lc-head-actions,
  .lc-welcome,
  .lc-disclosure,
  .lc-msg-status {
    display: none !important;
  }
  body.lc-threaded,
  body.lc-threaded .law-check-main,
  body.lc-threaded .lc-chat {
    display: block;
    block-size: auto;
  }
  body.lc-threaded .lc-scroll {
    overflow: visible;
  }
  .lc-chat {
    min-block-size: 0;
  }
  body {
    background: #ffffff;
  }
}

/* Reduced motion for both page and runtime */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  #agent-app *,
  #agent-app *::before,
  #agent-app *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------------------------------------------
   Redesign approved 2026-11-23 (UX review round 3).
   Header: "Sign in" and the Law check button at the far right, as on every site page.
   Empty page: the AI key pill, the title and its text, then the composer and the "Try" examples,
   together in the middle of the window. The thread view is unchanged.
   --------------------------------------------------------------------------------------------------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
  margin-left: -6px;
}
.site-header .header-signin {
  font-size: 14px;
  font-weight: 500;
  color: #3a3a3a;
  white-space: nowrap;
}
.site-header .header-check {
  display: inline-flex;
  align-items: center;
  padding: 11px 18px;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.site-header .header-check:hover {
  background: #333;
}
.nav-signin {
  display: none !important;
}
.site-nav a {
  white-space: nowrap;
}
@media (max-width: 1180px) {
  .site-header {
    position: relative;
  }
  .mobile-toggle {
    display: inline-flex;
    background: none;
    border: none;
    color: #3a3a3a;
    order: 3;
  }
  .site-nav {
    display: none;
  }
  .site-nav.expanded {
    display: flex;
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    right: 0;
    z-index: 10;
    background: #fafafa;
    padding: 20px 6%;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 5px;
  }
  .site-nav.expanded .nav-signin {
    display: inline-flex !important;
  }
  .header-actions {
    order: 2;
    margin-left: auto;
    border-left: 0;
    padding-left: 0;
  }
  .site-header .header-signin {
    display: none;
  }
}
@media (max-width: 480px) {
  .site-header {
    gap: 12px;
  }
  .brand {
    font-size: 22px;
    gap: 8px;
  }
  .brand-mark {
    inline-size: 32px;
    block-size: 32px;
  }
  .site-header .header-check {
    padding: 9px 12px;
    font-size: 13.5px;
  }
  .mobile-toggle {
    margin-right: -10px;
  }
}

/* The empty page: everything in one centred column, in the middle of the window. The wrappers that
   hold the thread step aside (display: contents) so their parts can take their places around the
   composer; once a thread exists the page is laid out as before. */
.lc-chat:not(.has-thread) {
  justify-content: center;
  padding-block: 40px 28px;
}
.lc-chat:not(.has-thread) .lc-scroll,
.lc-chat:not(.has-thread) .lc-col-thread,
.lc-chat:not(.has-thread) .lc-thread,
.lc-chat:not(.has-thread) .lc-welcome {
  display: contents;
}
.lc-chat:not(.has-thread) .lc-chat-head,
.lc-chat:not(.has-thread) .lc-welcome-sub,
.lc-chat:not(.has-thread) .lc-starter-pills,
.lc-chat:not(.has-thread) .lc-banner,
.lc-chat:not(.has-thread) noscript,
.lc-chat:not(.has-thread) .lc-disclosure {
  inline-size: min(780px, 100% - 11.2vw);
  margin-inline: auto;
}
.lc-chat:not(.has-thread) .lc-chat-head {
  order: 1;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.lc-chat:not(.has-thread) .lc-head-actions {
  order: -1;
  justify-content: center;
}
.lc-chat:not(.has-thread) .lc-chat-title {
  flex: none;
}
.lc-chat:not(.has-thread) .lc-chat-head h1 {
  font-size: clamp(2.6rem, 5vw, 3.75rem);
  line-height: 1.04;
  margin: 0 0 14px;
}
.lc-chat:not(.has-thread) .lc-lead {
  max-width: 600px;
  margin-inline: auto;
  font-size: 17px;
  color: #3a3a3a;
}
.lc-chat:not(.has-thread) .lc-welcome-title {
  display: none;
}
.lc-chat:not(.has-thread) .lc-welcome-sub {
  order: 2;
  text-align: center;
  max-width: 600px;
  margin: 10px auto 0;
  font-size: 17px;
  color: #3a3a3a;
}
.lc-chat:not(.has-thread) .lc-banner {
  order: 2;
}
.lc-chat:not(.has-thread) .lc-dock {
  order: 3;
  padding-block-start: 30px;
  background: none;
}
.lc-chat:not(.has-thread) .lc-dock .lc-col {
  inline-size: min(780px, 100% - 11.2vw);
}
.lc-chat:not(.has-thread) .lc-starter-pills {
  order: 4;
  margin-block-start: 6px;
}
.lc-chat:not(.has-thread) .lc-disclosure {
  order: 5;
  margin-block-start: 22px;
  text-align: center;
}
.lc-chat:not(.has-thread) .lc-disclosure[open] {
  text-align: left;
}
.lc-chat:not(.has-thread) .lc-thread-list:empty {
  display: none;
}
@media (max-width: 800px) {
  .lc-chat:not(.has-thread) {
    padding-block: 28px 20px;
  }
  .lc-chat:not(.has-thread) .lc-lead,
  .lc-chat:not(.has-thread) .lc-welcome-sub {
    font-size: 15.5px;
  }
}

/* ---- The receipt panel (design approved 2026-11-23) ------------------------------------------ */
/* On a wide window the chosen check shows in full beside the thread; each card stays its verdict. */
.lc-panel[hidden] {
  display: none;
}
.lc-msg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin-block-end: 6px;
}
.lc-msg-head .lc-msg-caption {
  margin-block-end: 0;
}
.lc-panel-btn {
  display: none;
  margin-inline-start: 6px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
}
.lc-panel-btn:hover {
  border-color: var(--accent);
}
@media (min-width: 1100px) {
  .law-check-main.has-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    align-items: stretch;
  }
  .law-check-main.has-panel .lc-panel-btn {
    display: inline-flex;
  }
  body.lc-threaded .law-check-main.has-panel {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    min-block-size: 0;
    overflow: hidden;
  }
  body.lc-threaded .law-check-main.has-panel > .lc-chat {
    min-block-size: 0;
  }
  .lc-panel {
    /* Its hidden labels are absolutely placed: they stay inside the panel's own scrolling box. */
    position: relative;
    border-inline-start: 1px solid var(--line);
    background: #fff;
    padding: 22px 26px 28px;
    overflow-y: auto;
    min-block-size: 0;
  }
  body:not(.lc-threaded) .lc-panel {
    position: sticky;
    top: 0;
    max-block-size: 100dvh;
  }
}
.rp-tabs {
  display: flex;
  gap: 18px;
  border-block-end: 1px solid var(--line);
  margin-block: -4px 20px;
}
.rp-tab-btn {
  border: 0;
  background: none;
  padding: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
}
.rp-tab-btn[aria-selected="true"] {
  color: var(--primary);
  box-shadow: 0 1.5px 0 var(--primary);
}
.rp-tab-btn:focus-visible,
.rp-btn:focus-visible,
.rp-link:focus-visible,
.rp-json:focus-visible {
  outline: 3px solid #737373;
  outline-offset: 3px;
}
.rp-tab[hidden] {
  display: none;
}
.rp-kicker {
  margin: 0 0 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.rp-title {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--primary);
}
.rp-sub {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--muted);
}
.rp-lines {
  margin: 0 0 16px;
  padding-inline-start: 18px;
  font-size: 13.5px;
  color: #3a3a3a;
}
.rp-lines .secondary {
  color: var(--muted);
}
.rp-label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.rp-passage {
  margin: 0 0 16px;
  padding: 2px 0 2px 14px;
  border-inline-start: 2px solid var(--accent);
  font: 15px/1.65 Georgia, "Times New Roman", serif;
  color: #3a3a3a;
  overflow-wrap: anywhere;
}
.rp-passage mark {
  background: #f3e7d8;
  color: var(--primary);
}
.rp-quote {
  margin: 0 0 16px;
  padding: 10px 12px;
  background: #f4f4f4;
  border-radius: 8px;
  font-size: 14px;
  color: #3a3a3a;
}
.rp-verified {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 4px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f4f4f4;
  font-size: 13.5px;
}
.rp-verified b {
  font-weight: 600;
}
.rp-tick {
  flex: none;
  inline-size: 24px;
  block-size: 24px;
  border-radius: 50%;
  background: var(--primary);
  position: relative;
}
.rp-tick::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 5px;
  inline-size: 6px;
  block-size: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.rp-muted {
  color: var(--muted);
}
.rp-meta {
  margin: 18px 0 0;
  border-block-start: 1px solid var(--line);
  font-size: 13.5px;
}
.rp-meta div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-block-end: 1px solid #efefef;
}
.rp-meta dt {
  color: var(--muted);
  flex: none;
}
.rp-meta dd {
  margin: 0;
  text-align: end;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}
.rp-mono {
  font: 500 12.5px ui-monospace, Menlo, monospace;
}
.rp-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 14px 0 0;
  font-size: 13.5px;
  font-weight: 500;
}
.rp-buttons {
  display: flex;
  gap: 8px;
  margin-block-start: 16px;
}
.rp-btn {
  flex: none;
  padding: 9px 14px;
  border: 1px solid #d6d6d6;
  border-radius: 8px;
  background: #fff;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
}
.rp-btn-dark {
  flex: 1;
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.rp-json {
  margin: 0;
  max-block-size: 60vh;
  overflow: auto;
  padding: 12px;
  background: #f6f6f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 12px/1.5 ui-monospace, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (forced-colors: active) {
  .rp-tab-btn[aria-selected="true"] {
    text-decoration: underline;
  }
  .rp-passage mark {
    background: Mark;
    color: MarkText;
  }
  .rp-tick {
    background: CanvasText;
  }
}
/* Folded on a phone: the message and Send on one short line. */
@media (max-width: 520px) {
  .lc-chat.has-thread .lc-dock:not(.is-open) .lc-composer {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  /* The mode switch is hidden while folded, so the message and the button share one line. */
  .lc-chat.has-thread .lc-dock:not(.is-open) .lc-message-field {
    flex: 1 1 0;
  }
  .lc-chat.has-thread .lc-dock:not(.is-open) .lc-composer-bar {
    flex: none;
  }
  .lc-chat.has-thread .lc-dock:not(.is-open) .lc-composer-bar #composer-send {
    margin-inline-start: auto;
  }
  /* Two short lines when folded: the thread keeps most of the window. */
  .lc-chat.has-thread .lc-dock:not(.is-open) {
    padding-block: 8px calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .lc-chat.has-thread .lc-dock:not(.is-open) .lc-composer {
    padding: 8px 12px 6px;
    row-gap: 2px;
  }
}
