/* Web adaptation of Apple's HIG: system typography, inset groups, semantic
   color, accessible controls, and translucent navigation above solid content. */
:root {
  --app-safe-top: calc(max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px)) + var(--tg-content-safe-area-inset-top, 0px));
  --app-safe-bottom: calc(max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px)) + var(--tg-content-safe-area-inset-bottom, 0px));
  --app-safe-left: calc(max(env(safe-area-inset-left, 0px), var(--tg-safe-area-inset-left, 0px)) + var(--tg-content-safe-area-inset-left, 0px));
  --app-safe-right: calc(max(env(safe-area-inset-right, 0px), var(--tg-safe-area-inset-right, 0px)) + var(--tg-content-safe-area-inset-right, 0px));

  color-scheme: light;
  font: -apple-system-body;
  --bg: #f2f2f7;
  --paper: #fff;
  --ink: #1c1c1e;
  --muted: #636366;
  --line: #d8d8dc;
  --fill: #e9e9ee;
  --accent: #0066cc;
  --soft: #e8f1fc;
  --green: #248138;
  --green-bg: #eaf6ed;
  --red: #c42b24;
  --red-bg: #fceceb;
  --glass: #ffffffdc;
  --glass-line: #ffffffd9;
  --radius: 18px;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23636366' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #000;
  --paper: #1c1c1e;
  --ink: #f5f5f7;
  --muted: #aeaeb2;
  --line: #38383a;
  --fill: #2c2c2e;
  --accent: #6aafff;
  --soft: #1c304a;
  --green: #6bd483;
  --green-bg: #193323;
  --red: #ff8a83;
  --red-bg: #3b2223;
  --glass: #242426ed;
  --glass-line: #ffffff21;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23aeaeb2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', sans-serif;
  font-size: 1.0625rem;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button, input, select { font: inherit; color: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button, a, select, summary { touch-action: manipulation; }
button { border: 0; background: none; cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
:is(button, a, select, input, summary):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
a { color: var(--accent); }
svg {
  width: 1.375rem; height: 1.375rem; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none;
}
h1, h2, h3, p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.2; }
h1 { font-size: 2.125rem; letter-spacing: -.035em; font-weight: 700; }
h2 { font-size: 1.375rem; letter-spacing: -.025em; font-weight: 700; }
h3 { font-size: 1.0625rem; letter-spacing: -.015em; font-weight: 600; }
.shell {
  max-width: 960px; margin: 0 auto;
  padding: var(--app-safe-top) max(20px, var(--app-safe-right)) calc(120px + var(--app-safe-bottom)) max(20px, var(--app-safe-left));
}
/* Fullscreen in Telegram: scrolled content slides under the status bar and the Close button, so cover that strip. */
body::before { content: ''; position: fixed; z-index: 20; top: 0; left: 0; right: 0; height: var(--app-safe-top); background: var(--glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); pointer-events: none; }
.ask-new { margin-top: 4px; }
.masthead { display: flex; justify-content: space-between; align-items: center; min-height: 64px; gap: 16px; margin-bottom: 20px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-size: 1.0625rem; font-weight: 600; letter-spacing: -.025em; min-height: 44px; min-width: 0; }
/* The bot's own picture (the Colosseum), round like its Telegram avatar. */
.brand-logo { flex: none; width: 32px; height: 32px; border-radius: 50%; box-shadow: 0 0 0 .5px #0000001a; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.language select { min-height: 44px; min-width: 64px; background: var(--fill); border: 0; border-radius: 24px; color: var(--accent); padding: 0 12px; font-size: .9375rem; font-weight: 600; }
.hero { margin-bottom: 24px; }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hero p { color: var(--muted); margin-top: 8px; max-width: 640px; font-size: 1.0625rem; }
.year-pill { color: var(--muted); font-size: .9375rem; }
.filters { background: var(--paper); border-radius: var(--radius); overflow: visible; }
.filter-field { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; position: relative; min-width: 0; }
.filter-field + .filter-field::before { content: ''; position: absolute; top: 0; left: 50px; right: 0; height: .5px; background: var(--line); }
.filter-field > svg { color: var(--accent); width: 22px; height: 22px; }
.filter-label { font-size: 1rem; white-space: nowrap; }
.filter-field select {
  flex: 1; min-width: 0; min-height: 48px; text-align: right; text-align-last: right;
  border: 0; background: transparent; color: var(--muted); font-size: .9375rem;
  padding: 0 0 0 8px; border-radius: 8px; cursor: pointer;
}
.overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 16px 0 28px; background: var(--paper); border-radius: var(--radius); padding: 18px 0; container-type: inline-size; }
.stat { padding: 0 16px; min-width: 0; position: relative; }
.stat + .stat { border-left: .5px solid var(--line); }
.stat-label { display: block; font-size: .8125rem; color: var(--muted); line-height: 1.25; min-height: 2.5em; overflow-wrap: anywhere; }
.stat strong { display: block; font-size: 1.875rem; letter-spacing: -.04em; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; margin: 6px 0 4px; }
.stat small { font-size: .75rem; color: var(--muted); }
.stat > svg { width: 16px; height: 16px; }
.approved-stat strong, .approved-stat > svg { color: var(--green); }
.denied-stat strong, .denied-stat > svg { color: var(--red); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 28px 0 12px; }
.section-head .small { font-size: .8125rem; color: var(--muted); text-align: right; }
.comparison { border-radius: var(--radius); background: var(--paper); padding: 12px 16px 4px; }
.comparison-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 10px; }
.comparison-top label { min-width: 0; max-width: 100%; }
.mini-select { min-height: 44px; border: 0; border-radius: 10px; color: var(--accent); background: var(--soft); font-size: .9375rem; font-weight: 500; padding: 0 10px; max-width: 100%; }
.comparison-grid { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: left; font-size: .9375rem; }
.comparison-grid th { font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
.comparison-grid thead th { font-size: .8125rem; padding: 8px 4px 10px; }
.comparison-grid th:first-child { width: 34%; padding-left: 0; }
.comparison-grid tbody :is(th, td) { padding: 15px 4px; border-top: .5px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.comparison-grid tbody th { font-size: .9375rem; padding-left: 0; }
.comparison-grid .metric-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.comparison-grid small { display: block; font-size: .75rem; color: var(--muted); font-weight: 400; margin-top: 4px; }
.comparison-note { font-size: .8125rem; color: var(--muted); line-height: 1.45; padding: 10px 4px 0; }
.methodology { margin-top: 18px; background: var(--paper); border-radius: 14px; }
.methodology summary { display: flex; align-items: center; gap: 10px; list-style: none; min-height: 50px; padding: 12px 16px; cursor: pointer; font-size: .9375rem; }
.methodology summary::-webkit-details-marker { display: none; }
.methodology summary > svg:first-child { color: var(--accent); width: 20px; height: 20px; }
.methodology summary > svg:last-child { margin-left: auto; width: 14px; height: 14px; color: var(--muted); }
.methodology[open] summary > svg:last-child { transform: rotate(90deg); }
.methodology > div { padding: 0 16px 12px; color: var(--muted); font-size: .9375rem; }
.methodology p + p { margin-top: 10px; }
.link-button { color: var(--accent); font-size: .9375rem; font-weight: 500; min-height: 44px; padding: 8px 0; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.link-button svg { width: 16px; height: 16px; }
.list-controls { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.segments { display: flex; gap: 2px; border-radius: 12px; padding: 3px; background: var(--fill); }
.segment { flex: 1; min-width: 0; min-height: 44px; padding: 7px 8px; border-radius: 9px; font-size: .9375rem; line-height: 1.2; color: var(--ink); overflow-wrap: anywhere; }
.segment[aria-pressed=true] { background: var(--paper); font-weight: 600; box-shadow: 0 1px 3px #0002; }
.search { display: block; position: relative; }
.search > svg { position: absolute; left: 12px; top: 12px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search input { min-height: 46px; width: 100%; border: 0; border-radius: 12px; background: var(--fill); padding: 10px 12px 10px 40px; font-size: 1rem; }
.search input::placeholder { color: var(--muted); opacity: 1; }
.case-grid { display: grid; grid-template-columns: 1fr; background: var(--paper); border-radius: var(--radius); }
.case { width: 100%; text-align: left; padding: 18px 16px; min-width: 0; position: relative; border-radius: 0; }
.case:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.case:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.case:only-child { border-radius: var(--radius); }
.case + .case::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--line); }
.case-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.outcome { display: inline-flex; align-items: center; gap: 4px; font-size: .8125rem; font-weight: 600; color: var(--green); background: var(--green-bg); border-radius: 7px; padding: 3px 7px; }
.outcome.denied { background: var(--red-bg); color: var(--red); }
.outcome svg { width: 13px; height: 13px; stroke-width: 2.1; }
.case-id { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.case h3 { font-size: 1.0625rem; line-height: 1.3; overflow-wrap: anywhere; }
.metadata { color: var(--muted); font-size: .875rem; margin-top: 4px; line-height: 1.4; }
.case-metrics { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: .875rem; font-variant-numeric: tabular-nums; }
.case-metrics:empty { display: none; }
.case-metrics span { display: inline-flex; align-items: center; gap: 6px; }
.case-metrics svg { width: 17px; height: 17px; color: var(--muted); }
.case-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: .8125rem; color: var(--muted); }
.case-bottom svg { width: 13px; height: 13px; }
.load-more { width: 100%; min-height: 50px; margin-top: 14px; background: var(--paper); color: var(--accent); border-radius: 14px; font-size: 1rem; font-weight: 500; padding: 12px 16px; }
.note { color: var(--muted); font-size: .8125rem; line-height: 1.5; margin-top: 18px; padding: 0 4px; }
.footnote { font-size: .75rem; color: var(--muted); text-align: center; margin-top: 36px; }
.dock {
  position: fixed; z-index: 10; bottom: calc(12px + var(--app-safe-bottom));
  left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 6px;
  width: min(400px, calc(100% - 32px)); border-radius: 30px;
  background: var(--glass); border: 1px solid var(--glass-line);
  box-shadow: 0 8px 32px #00000016, 0 0 0 .5px #00000008;
  backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6);
}
.dock a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; min-width: 0; padding: 5px 8px; border-radius: 24px; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.15; text-align: center; text-decoration: none; }
.dock a[aria-current=page] { background: var(--fill); color: var(--accent); font-weight: 600; }
.dock svg { width: 24px; height: 24px; }
.guide-grid { display: grid; grid-template-columns: 1fr; background: var(--paper); border-radius: var(--radius); }
.guide { display: flex; align-items: center; gap: 14px; text-align: left; padding: 18px 16px; min-height: 96px; min-width: 0; position: relative; }
.guide:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.guide:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.guide + .guide::before { content: ''; position: absolute; top: 0; left: 74px; right: 0; height: .5px; background: var(--line); }
.guide-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: #fff; background: #007aff; flex: none; }
.guide-dov .guide-icon { background: #5856d6; }
.guide-cimea .guide-icon { background: #af52de; }
.guide-apostille .guide-icon { background: #28824b; }
.guide-translations .guide-icon { background: #b86b13; }
.guide-steps .guide-icon { background: #5c707b; }
.guide-icon svg { width: 25px; height: 25px; }
.guide-copy { min-width: 0; flex: 1; }
.guide h2 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.015em; margin-bottom: 4px; }
.guide p { font-size: .9375rem; line-height: 1.35; color: var(--muted); }
.guide > .arrow { width: 14px; height: 14px; color: var(--muted); }
.source-callout { display: flex; gap: 12px; margin-top: 24px; padding: 0 4px; }
.source-callout > svg { color: var(--accent); margin-top: 2px; }
.source-callout h2 { font-size: .9375rem; margin-bottom: 6px; }
.source-callout p { font-size: .9375rem; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; color: var(--accent); text-decoration: none; font-size: 1.0625rem; margin: -10px 0 16px; }
.back svg { width: 20px; height: 20px; }
.article { max-width: 720px; margin: 0 auto; }
.article .hero h1 { font-size: 2.125rem; }
.article-pages { background: var(--paper); border-radius: var(--radius); padding: 24px; }
.article-page + .article-page { border-top: .5px solid var(--line); margin-top: 28px; padding-top: 28px; }
.article-page h2 { font-size: 1.25rem; line-height: 1.35; margin-bottom: 16px; }
.prose { white-space: pre-line; font-size: 1.0625rem; line-height: 1.65; overflow-wrap: anywhere; }
.prose b { font-weight: 600; }
.prose a { display: inline-block; min-height: 44px; padding: 10px 0; font-size: 1rem; line-height: 1.5; text-underline-offset: 3px; }
.article-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; margin-top: 24px; }
.primary { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; background: var(--accent); color: #fff; font-size: 1.0625rem; font-weight: 600; padding: 12px 20px; text-decoration: none; }
:root[data-theme=dark] .primary { color: #001b3b; }
.status-panel { background: var(--paper); border-radius: var(--radius); padding: 24px; }
.status-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.status-heading h2 { font-size: 1.375rem; }
.status-orb { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 6px var(--fill); }
.status-orb.on { background: var(--green); box-shadow: 0 0 0 6px var(--green-bg); }
.status-body { white-space: pre-line; line-height: 1.6; overflow-wrap: anywhere; }
.status-body pre { font-size: .875rem; white-space: pre; overflow-x: auto; padding: 16px; border-radius: 12px; background: var(--bg); }
.status-services { white-space: normal; margin: 24px 0; }
.status-services section + section { margin-top: 24px; }
.status-services h3 { font-size: .8125rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 8px; }
.status-services dl { margin: 0; }
.status-services dl > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; padding: 13px 0; border-bottom: .5px solid var(--line); }
.status-services dt { flex: 1; min-width: min(100%, 9rem); overflow-wrap: anywhere; font-size: 1rem; }
.status-services dd { margin: 0; font-size: .875rem; color: var(--muted); padding: 2px 8px; background: var(--fill); border-radius: 7px; overflow-wrap: anywhere; }
.status-meta { border-top: .5px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 12px; color: var(--muted); font-size: .8125rem; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); min-height: 50vh; }
.loading-dot { width: 20px; height: 20px; border: 2px solid var(--line); border-top-color: var(--muted); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 40px 20px; border-radius: var(--radius); background: var(--paper); }
.empty h2 { font-size: 1.375rem; }
.empty p { font-size: 1rem; max-width: 360px; margin: 10px auto 20px; color: var(--muted); }
dialog { width: min(640px, calc(100% - 32px)); max-height: calc(100dvh - 48px - var(--app-safe-top) - var(--app-safe-bottom)); border: 0; border-radius: 28px; padding: 0; color: var(--ink); background: var(--paper); box-shadow: 0 24px 100px #0004; overscroll-behavior: contain; }
dialog::backdrop { background: #0006; }
body:has(dialog[open]) { overflow: hidden; }
.dialog-inner { padding: 24px; }
.dialog-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.dialog-top h2 { font-size: 1.5rem; line-height: 1.25; margin-top: 12px; overflow-wrap: anywhere; }
.close { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none; background: var(--fill); color: var(--muted); }
.close svg { width: 20px; height: 20px; stroke-width: 2.2; }
.case-prose { border-top: .5px solid var(--line); padding-top: 20px; font-size: 1.0625rem; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; }
.dialog-note { border-top: .5px solid var(--line); padding-top: 16px; margin-top: 24px; color: var(--muted); font-size: .875rem; }
.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; }
[hidden] { display: none !important; }
/* Reflow the summary when text grows, rather than squeezing its columns. */
@container (width < 18rem) {
  .stat { grid-column: 1 / -1; padding: 16px; }
  .stat + .stat { border-left: 0; border-top: .5px solid var(--line); }
  .stat-label { min-height: 0; }
}
@media (min-width: 48rem) {
  .shell { padding-left: 40px; padding-right: 40px; }
  .masthead { min-height: 80px; margin-bottom: 32px; }
  .filters { display: grid; grid-template-columns: .8fr 1.2fr 1.2fr; padding: 4px 0; }
  .filter-field { display: grid; grid-template-columns: 22px 1fr; gap: 0 9px; padding: 8px 18px; }
  .filter-field + .filter-field::before { top: 12px; bottom: 12px; left: 0; width: .5px; height: auto; }
  .filter-field select { grid-column: 1 / -1; text-align: left; text-align-last: left; padding-left: 0; min-height: 44px; }
  .filter-label { font-size: .8125rem; color: var(--muted); }
  .stat { padding: 0 24px; }
  .stat-label { min-height: 1.25em; }
  .stat strong { font-size: 2.125rem; }
  .overview { padding: 24px 0; }
  .comparison { padding-left: 24px; padding-right: 24px; }
  .list-controls { flex-direction: row; align-items: center; }
  .search { flex: 1; }
  .segments { flex: 1; }
  .case { padding: 22px 24px; }
  .case + .case::before { left: 24px; }
  .case-bottom { position: absolute; right: 24px; bottom: 22px; gap: 20px; }
  .case-metrics { padding-right: 150px; }
  .guide { padding: 20px 24px; }
  .guide + .guide::before { left: 82px; }
}
@media (max-width: 23rem) {
  .shell { padding-left: 16px; padding-right: 16px; }
  .filter-field { gap: 8px; padding-left: 12px; padding-right: 12px; flex-wrap: wrap; }
  .filter-label { font-size: .9375rem; }
  .filter-field select { font-size: .875rem; flex-basis: 48%; }
  .stat { padding: 0 12px; }
  .comparison { padding-left: 12px; padding-right: 12px; }
  .comparison-grid { font-size: .875rem; }
  .comparison-grid tbody th { font-size: .875rem; }
  .guide { gap: 10px; padding-left: 12px; padding-right: 12px; }
  .guide-icon { width: 36px; height: 36px; border-radius: 10px; }
  .article-pages, .status-panel, .dialog-inner { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .dock { background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --muted: #414144; --line: #929298; }
  :root[data-theme=dark] { --muted: #d1d1d6; --line: #8e8e93; }
  .dock { background: var(--paper); border-color: var(--line); backdrop-filter: none; -webkit-backdrop-filter: none; }
  :is(.case-grid, .guide-grid, .overview, .comparison, .filters, .methodology) { outline: 1px solid var(--line); }
}
/* Reserve a separate trailing area for the chevron. Native browser arrows
   otherwise sit against right-aligned values and differ between platforms. */
:is(.language select, .filter-field select, .mini-select) {
  appearance: none;
  -webkit-appearance: none;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  padding-right: 36px;
}
.filter-field select {
  background-position: right center;
  padding-right: 24px;
}
@media (forced-colors: active) {
  :is(.language select, .filter-field select, .mini-select) { appearance: auto; -webkit-appearance: auto; background-image: none; }
  .dock { border: 1px solid ButtonText; }
  .segment[aria-pressed=true], .dock a[aria-current=page] { outline: 2px solid Highlight; }
}

/* Ask: the support assistant chat (ask.js). */
.ask-examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.ask-example { border: 0; border-radius: 18px; background: var(--soft); color: var(--accent); font: inherit; font-size: .9375rem; padding: 10px 14px; min-height: 44px; text-align: left; cursor: pointer; }
.ask-log { display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; }
.ask-msg { display: flex; flex-direction: column; max-width: 88%; }
.ask-msg.user { align-self: flex-end; align-items: flex-end; }
.ask-msg.bot { align-self: flex-start; }
.ask-bubble { border-radius: 18px; padding: 10px 14px; line-height: 1.45; font-size: 1rem; overflow-wrap: anywhere; }
.ask-msg.user .ask-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
:root[data-theme=dark] .ask-msg.user .ask-bubble { color: #001b3b; }
.ask-msg.bot .ask-bubble { background: var(--paper); color: var(--ink); border-bottom-left-radius: 6px; }
.ask-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ask-link { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 6px 12px; border-radius: 14px; background: var(--fill); color: var(--accent); font-size: .875rem; font-weight: 500; text-decoration: none; }
.ask-link svg { width: 14px; height: 14px; }
.ask-typing { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-style: italic; }
.ask-typing .dots { display: inline-flex; gap: 4px; }
.ask-typing .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: ask-dot 1.2s infinite ease-in-out; }
.ask-typing .dots i:nth-child(2) { animation-delay: .15s; }
.ask-typing .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ask-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .ask-typing .dots i { animation: none; opacity: .6; } }
.ask-composer { position: sticky; bottom: calc(84px + var(--app-safe-bottom)); display: flex; align-items: flex-end; gap: 8px; padding: 8px; border-radius: 24px; background: var(--paper); border: .5px solid var(--line); margin-top: 8px; cursor: text; }
.ask-composer textarea { flex: 1; resize: none; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1rem; padding: 10px 8px; min-height: 44px; max-height: 140px; outline: none; }
.ask-composer button { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; }
.ask-composer button:disabled { opacity: .45; cursor: default; }
.ask-composer button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ask-guest { background: var(--paper); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.ask-guest p { margin: 0 0 12px; color: var(--muted); }

/* Interview date row in the case filters: looks like the select rows, and the
   whole row opens the calendar (the button's ::after covers it; × sits above). */
.date-field { flex-wrap: wrap; row-gap: 0; padding-bottom: 4px; }
.date-field .filter-label { min-height: 48px; display: flex; align-items: center; }
/* Grows from its own width, so a value that doesn't fit beside a long label (ru) wraps to its own line. */
.date-trigger { flex: 1 0 auto; max-width: 100%; min-height: 40px; padding: 0 24px 0 8px; text-align: right; color: var(--muted); font-size: .9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--select-arrow) no-repeat right center / 12px 8px; }
.date-trigger::after { content: ''; position: absolute; inset: 0; }
.date-trigger.set { color: var(--accent); font-weight: 500; background-image: none; padding-right: 2px; }
.date-clear { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; margin-right: -12px; color: var(--muted); flex: none; }
.date-clear svg { width: 22px; height: 22px; padding: 5px; border-radius: 50%; background: var(--fill); stroke-width: 2.6; }

/* Interview-date calendar (calendar.js): a bottom sheet on phones, a card on wide screens.
   The dialog itself has no padding, so a click whose target is the dialog is the backdrop. */
dialog.sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 24px 24px 0 0; max-height: calc(100dvh - var(--app-safe-top) - 16px); overflow-y: auto; }
dialog.sheet[open] { animation: sheet-up .32s cubic-bezier(.2, .9, .3, 1); }
@keyframes sheet-up { from { transform: translateY(30%); opacity: 0; } }
.sheet-inner { max-width: 440px; margin: 0 auto; padding: 16px max(16px, var(--app-safe-right)) calc(16px + var(--app-safe-bottom)) max(16px, var(--app-safe-left)); }
.sheet-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-top h2 { font-size: 1.25rem; }
.cal-hint { color: var(--muted); font-size: .875rem; line-height: 1.4; margin: 4px 0 14px; }
.cal-month { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cal-month-title { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.cal-month-title strong { font-size: 1.0625rem; font-weight: 600; }
.cal-month-title small { color: var(--muted); font-size: .8125rem; }
.cal-arrow { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none; color: var(--accent); background: var(--fill); }
.cal-arrow svg { width: 18px; height: 18px; stroke-width: 2.4; }
#calPrev svg { transform: scaleX(-1); }
.cal-arrow:disabled { opacity: .35; }
/* Month chips: scroll sideways; the chosen month is centred after each render (calendar.js). */
.cal-strip { position: relative; display: flex; align-items: center; gap: 6px; margin: 4px -16px 8px; padding: 2px 16px; overflow-x: auto; scrollbar-width: none; }
.cal-strip::-webkit-scrollbar { display: none; }
.cal-chip { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 36px; padding: 0 12px; border-radius: 18px; background: var(--fill); color: var(--ink); font-size: .875rem; }
.cal-chip b { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-chip[aria-pressed=true] { background: var(--accent); color: #fff; font-weight: 600; }
.cal-chip[aria-pressed=true] b { color: inherit; }
:root[data-theme=dark] .cal-chip[aria-pressed=true] { color: #001b3b; }
.cal-chip-year { flex: none; padding-left: 6px; color: var(--muted); font-size: .75rem; font-weight: 600; }
.cal-chip-year:first-child { padding-left: 0; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-week span { padding: 4px 0; text-align: center; color: var(--muted); font-size: .75rem; overflow: hidden; }
.cal-grid { row-gap: 4px; touch-action: pan-y; }
.cal-grid.slide-next { animation: cal-next .2s ease-out; }
.cal-grid.slide-prev { animation: cal-prev .2s ease-out; }
@keyframes cal-next { from { opacity: .3; transform: translateX(16px); } }
@keyframes cal-prev { from { opacity: .3; transform: translateX(-16px); } }
.cal-day { position: relative; display: grid; place-items: center; height: 46px; padding: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-num { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-size: 1rem; }
.cal-day.has { color: var(--ink); font-weight: 600; }
.cal-day[aria-current=date] .cal-num { color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
/* The count badge sits on the circle's top-right corner, like an app-icon badge. */
.cal-badge { position: absolute; top: 0; left: calc(50% + 7px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .6875rem; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--paper); }
/* The range: a soft band between the ends, filled circles on the ends. */
.cal-day.in { background: var(--soft); }
.cal-day.in .cal-badge { box-shadow: 0 0 0 2px var(--soft); }
.cal-grid > .in:nth-child(7n + 1) { border-radius: 23px 0 0 23px; }
.cal-grid > .in:nth-child(7n) { border-radius: 0 23px 23px 0; }
.cal-day.band-start { background: linear-gradient(90deg, transparent 50%, var(--soft) 50%); }
.cal-day.band-end { background: linear-gradient(90deg, var(--soft) 50%, transparent 50%); }
.cal-day.sel .cal-num { background: var(--accent); color: #fff; box-shadow: none; }
.cal-day.sel .cal-badge { background: var(--paper); color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }
:root[data-theme=dark] :is(.cal-badge, .cal-day.sel .cal-num) { color: #001b3b; }
:root[data-theme=dark] .cal-day.sel .cal-badge { color: var(--accent); }
.cal-empty { padding: 24px 0; text-align: center; color: var(--muted); }
.cal-status { min-height: 1.45em; margin-top: 12px; text-align: center; color: var(--muted); font-size: .875rem; }
.cal-actions { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.cal-actions .primary { flex: 1; }
@media (min-width: 48rem) {
  dialog.sheet { width: 420px; margin: auto; border-radius: 28px; }
  dialog.sheet[open] { animation-name: sheet-in; }
  .sheet-inner { padding: 20px; }
  .filters { grid-template-columns: .8fr 1.1fr 1.1fr 1.3fr; }
  .date-field { grid-template-columns: 22px 1fr auto; padding-bottom: 8px; }
  .date-field .filter-label { min-height: 0; display: block; }
  .date-trigger { grid-column: 1 / 3; min-height: 44px; padding-left: 0; text-align: left; }
  .date-clear { grid-column: 3; grid-row: 2; margin-right: -8px; }
}
@keyframes sheet-in { from { transform: scale(.96); opacity: 0; } }

/* My documents (docs.js). */
.doc-card { background: var(--paper); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.doc-card h2 { font-size: 1.0625rem; margin: 0 0 8px; }
.doc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-top: .5px solid var(--line); }
.doc-row:first-of-type { border-top: 0; }
.doc-row select, .doc-row input[type=date], .doc-date input, .doc-num input, .doc-num select { min-height: 38px; border: 0; border-radius: 10px; background: var(--fill); color: var(--ink); font: inherit; font-size: .9375rem; padding: 4px 10px; }
.doc-toggle input { width: 22px; height: 22px; accent-color: var(--accent); }
.doc-progress { display: flex; align-items: center; gap: 12px; margin: 0 4px 14px; color: var(--muted); font-size: .875rem; }
.doc-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.doc-bar span { display: block; height: 100%; background: var(--green); border-radius: 4px; transition: width .3s; }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-item { border-top: .5px solid var(--line); padding: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.doc-item:first-child { border-top: 0; }
.doc-main { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.doc-text { flex: 1 1 180px; min-width: 0; }
.doc-text strong { display: block; font-size: .9375rem; }
.doc-text small { display: block; color: var(--muted); font-size: .8125rem; line-height: 1.35; margin-top: 2px; }
.doc-status { display: inline-flex; background: var(--fill); border-radius: 10px; padding: 2px; flex: none; }
.doc-status button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .8125rem; padding: 6px 9px; border-radius: 8px; min-height: 32px; cursor: pointer; }
.doc-status button[aria-pressed=true] { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px #0002; }
.status-have .doc-status button[aria-pressed=true] { color: var(--green); }
.status-progress .doc-status button[aria-pressed=true] { color: var(--accent); }
.doc-date { display: flex; align-items: center; gap: 8px; font-size: .8125rem; color: var(--muted); }
.doc-check { font-size: .8125rem; }
.doc-check.ok { color: var(--green); }
.doc-check.warn { color: var(--red); }
.doc-guide { align-self: flex-start; display: inline-flex; align-items: center; gap: 3px; font-size: .8125rem; text-decoration: none; }
.doc-guide svg { width: 12px; height: 12px; }
.doc-num { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; border-top: .5px solid var(--line); }
.doc-num:first-of-type { border-top: 0; }
.doc-num-input { display: flex; gap: 6px; }
.doc-num input { width: 120px; text-align: right; }
.doc-summary { font-weight: 600; margin: 4px 0; }
.doc-vs { color: var(--muted); font-size: .875rem; margin: 4px 0 10px; }
.doc-similar { display: flex; flex-direction: column; gap: 6px; }
.doc-case { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg); color: var(--ink); text-decoration: none; }
.doc-case-body { flex: 1; min-width: 0; }
.doc-case-body strong { display: block; font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-case-body small { color: var(--muted); font-size: .8125rem; }
.doc-case > svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.dock a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.doc-save { color: var(--muted); font-size: .8125rem; min-height: 1.2em; margin-top: 6px; }

/* Ask: the chats list */
.chat-new { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; }
.chat-new svg { width: 18px; height: 18px; }
.chat-list { display: flex; flex-direction: column; background: var(--paper); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.chat-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; color: var(--ink); text-decoration: none; border-bottom: .5px solid var(--line); }
.chat-row:last-child { border-bottom: 0; }
.chat-row:active { background: var(--fill); }
.chat-icon { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--soft); color: var(--accent); display: grid; place-items: center; }
.chat-icon svg { width: 20px; height: 20px; }
.chat-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-preview { color: var(--muted); font-size: .875rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chat-when { flex: none; align-self: flex-start; color: var(--muted); font-size: .8125rem; }
.chat-when .dots { display: inline-flex; gap: 3px; }
.chat-when .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: ask-dot 1.2s infinite ease-in-out; }
.chat-when .dots i:nth-child(2) { animation-delay: .15s; }
.chat-when .dots i:nth-child(3) { animation-delay: .3s; }

/* Ask: one chat, full screen (no tab bar, masthead or footer) */
body.chat-mode .dock, body.chat-mode .masthead, body.chat-mode .footnote { display: none; }
body.chat-mode .shell { padding-bottom: calc(96px + var(--app-safe-bottom)); }
.chat-bar { position: sticky; top: var(--app-safe-top); z-index: 15; display: grid; grid-template-columns: minmax(44px, auto) 1fr minmax(44px, auto); align-items: center; gap: 8px; min-height: 52px; margin: 0 -20px 12px; padding: 4px 8px; background: var(--bg); border-bottom: .5px solid var(--line); }
.chat-bar h1 { margin: 0; font-size: 1.0625rem; font-weight: 600; letter-spacing: -.015em; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 6px; color: var(--accent); text-decoration: none; font-size: 1.0625rem; }
.chat-back svg, .chat-remove svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-remove { justify-self: end; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--accent); display: grid; place-items: center; cursor: pointer; }
.chat-remove:disabled { opacity: .4; cursor: default; }
.chat-hint { color: var(--muted); margin: 8px 4px 16px; }
body.chat-mode .ask-composer { position: fixed; z-index: 15; left: max(12px, var(--app-safe-left)); right: max(12px, var(--app-safe-right)); bottom: calc(10px + var(--app-safe-bottom)); max-width: 936px; margin: 0 auto; box-shadow: 0 4px 24px #0002; }

/* ── AI assistant (Ask tab): its own look, so it reads as the app's premium part ──
   One identity: a violet → indigo → cyan "aurora", gradient orb avatar, hairline
   gradient edges, nested (shell + core) hero, pill CTA with its icon in its own
   circle, and spring-like motion. Motion is transform/opacity only and stops with
   reduced motion; no blur on scrolling content. */
:root {
  --ai-a: #8b5cf6; --ai-b: #6366f1; --ai-c: #06b6d4;
  --ai-text: #5b4ce0;                                         /* readable on white (≥ 4.5:1) */
  --ai-grad: linear-gradient(135deg, var(--ai-a), var(--ai-b) 50%, var(--ai-c));
  --ai-btn: linear-gradient(135deg, #7c3aed, #4f46e5 55%, #0891b2);  /* white text stays readable */
  --ai-edge: linear-gradient(135deg, #8b5cf670, #6366f126 45%, #06b6d470);
  --ai-tint: #8b5cf614; --ai-ring: #8b5cf633; --ai-glow: #6366f166;
  --ai-ease: cubic-bezier(.32, .72, 0, 1);
}
:root[data-theme=dark] {
  --ai-a: #a78bfa; --ai-b: #818cf8; --ai-c: #22d3ee;
  --ai-text: #b4a7ff;
  --ai-edge: linear-gradient(135deg, #a78bfa80, #818cf826 45%, #22d3ee70);
  --ai-tint: #a78bfa1c; --ai-ring: #a78bfa3d; --ai-glow: #818cf855;
}

/* Bottom bar: the Ask tab carries the gradient sparkle. */
.dock a.ai-tab[aria-current=page] { background: linear-gradient(135deg, #8b5cf61f, #06b6d41a); color: var(--ai-text); box-shadow: inset 0 0 0 .5px var(--ai-ring); }

/* Hero: an outer shell around an inner core with the aurora inside it. */
.ai-hero { margin: 4px 0 28px; padding: 6px; border-radius: 30px; background: var(--ai-tint); box-shadow: inset 0 0 0 .5px var(--ai-ring), 0 30px 60px -36px var(--ai-glow); animation: ai-rise .9s var(--ai-ease) both; }
.ai-hero-core { position: relative; isolation: isolate; overflow: hidden; border-radius: 24px; padding: 22px 20px 20px; background: var(--paper); box-shadow: inset 0 1px 0 #ffffff1a; }
.ai-hero-core::before {
  content: ''; position: absolute; z-index: -1; inset: -40% -30% auto -30%; height: 150%; pointer-events: none;
  background:
    radial-gradient(38% 34% at 22% 28%, #8b5cf633, transparent 70%),
    radial-gradient(34% 30% at 82% 22%, #06b6d42e, transparent 70%),
    radial-gradient(36% 30% at 62% 62%, #6366f126, transparent 70%);
  animation: ai-drift 16s var(--ai-ease) infinite alternate;
}
.ai-eyebrow { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 8px; border-radius: 999px; background: var(--ai-tint); color: var(--ai-text); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; box-shadow: inset 0 0 0 .5px var(--ai-ring); }
.ai-eyebrow svg { width: 15px; height: 15px; stroke-width: 1.6; }
.ai-title {
  margin-top: 14px; font-size: clamp(1.75rem, 7.4vw, 2.25rem); line-height: 1.12; letter-spacing: -.035em; font-weight: 750;
  background: linear-gradient(100deg, var(--ink) 0%, var(--ink) 38%, var(--ai-b) 78%, var(--ai-a)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ai-intro { color: var(--muted); margin-top: 10px; font-size: 1rem; max-width: 560px; }
.ai-trust { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 16px 0 0; padding: 0; color: var(--muted); font-size: .8125rem; font-weight: 500; }
.ai-trust li { display: inline-flex; align-items: center; gap: 6px; }
.ai-trust svg { width: 16px; height: 16px; color: var(--ai-text); stroke-width: 1.6; }
.ai-cta { display: inline-flex; align-items: center; gap: 14px; margin-top: 20px; min-height: 50px; padding: 6px 6px 6px 20px; border-radius: 999px; background: var(--ai-btn); color: #fff; font-weight: 600; font-size: 1rem; text-decoration: none; box-shadow: 0 12px 28px -12px #4f46e5b3, inset 0 1px 0 #ffffff45; transition: transform .5s var(--ai-ease), box-shadow .5s var(--ai-ease); }
.ai-cta-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #ffffff2e; box-shadow: inset 0 0 0 .5px #ffffff40; transition: transform .6s var(--ai-ease); }
.ai-cta-icon svg { width: 18px; height: 18px; stroke-width: 2.2; }
.ai-cta:active { transform: scale(.97); }
.ai-cta:hover .ai-cta-icon, .ai-cta:focus-visible .ai-cta-icon { transform: rotate(90deg) scale(1.05); }

.ai-section { font-size: .8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 4px 10px; }
.ai-section-note { color: var(--muted); margin: 0 4px 12px; font-size: .9375rem; }
.ai-kept { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: .8125rem; line-height: 1.45; margin: 16px 4px 0; }
.ai-kept svg { width: 15px; height: 15px; margin-top: 1px; stroke-width: 1.7; }

/* The assistant's avatar: a gradient orb with a sparkle. */
.ai-orb { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: radial-gradient(120% 120% at 28% 18%, #ffffff59, transparent 46%), var(--ai-btn); box-shadow: 0 6px 16px -7px #4f46e5cc, inset 0 0 0 .5px #ffffff40; }
.ai-orb svg { width: 19px; height: 19px; stroke-width: 1.7; }
.ai-orb-sm { width: 24px; height: 24px; } .ai-orb-sm svg { width: 13px; height: 13px; stroke-width: 2; }
.ai-orb-xs { width: 20px; height: 20px; box-shadow: none; } .ai-orb-xs svg { width: 11px; height: 11px; stroke-width: 2.1; }
.ai-orb-lg { width: 64px; height: 64px; box-shadow: 0 18px 40px -16px #4f46e5cc, inset 0 0 0 .5px #ffffff40; } .ai-orb-lg svg { width: 32px; height: 32px; stroke-width: 1.4; }
.ai-orb.is-thinking { animation: ai-breathe 1.8s var(--ai-ease) infinite; }

/* Chats list: orb icons. */
.chat-row .ai-orb { width: 38px; height: 38px; }
.chat-when .dots i { background: var(--ai-b); }

/* Chat page. */
.chat-bar h1 { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.chat-bar h1 > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px 8px 8px; animation: ai-rise .8s var(--ai-ease) both; }
.ai-empty .ai-title { margin-top: 18px; font-size: 1.75rem; }
.ai-empty p { color: var(--muted); margin-top: 8px; max-width: 420px; font-size: .9375rem; }
.ask-examples { display: grid; gap: 8px; margin: 16px 0; }
.ask-example { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 16px; background: var(--paper); color: var(--ink); font-size: .9375rem; text-align: left; box-shadow: inset 0 0 0 .5px var(--line); animation: ai-rise .7s var(--ai-ease) both; animation-delay: calc(var(--i, 0) * 80ms + 120ms); transition: transform .45s var(--ai-ease), box-shadow .45s var(--ai-ease); }
.ask-example svg { width: 18px; height: 18px; color: var(--ai-text); stroke-width: 1.7; }
.ask-example:active { transform: scale(.98); box-shadow: inset 0 0 0 1px var(--ai-ring); }
.ai-who { display: flex; align-items: center; gap: 8px; margin: 0 0 6px 2px; color: var(--muted); font-size: .8125rem; font-weight: 600; letter-spacing: -.005em; }
.ask-msg.ai-new { animation: ai-rise .7s var(--ai-ease) both; }
.ask-msg.bot .ask-bubble { background: linear-gradient(var(--paper), var(--paper)) padding-box, var(--ai-edge) border-box; border: 1px solid transparent; border-radius: 6px 20px 20px 20px; padding: 12px 15px; box-shadow: 0 14px 30px -22px var(--ai-glow); }
.ask-msg.user .ask-bubble, :root[data-theme=dark] .ask-msg.user .ask-bubble { background: var(--ai-btn); color: #fff; border-radius: 20px 20px 6px 20px; box-shadow: 0 10px 24px -16px #4f46e5cc; }
.ask-typing { font-style: normal; }
.ai-sources { margin: 12px -3px 0; padding: 10px 12px; border-radius: 14px; background: var(--ai-tint); box-shadow: inset 0 0 0 .5px var(--ai-ring); font-size: .875rem; }
.ai-sources-head { display: flex; align-items: center; gap: 6px; color: var(--ai-text); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.ai-sources-head svg { width: 15px; height: 15px; stroke-width: 1.8; }
.ai-sources ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; color: var(--ink); line-height: 1.4; }
.ai-disclaimer { margin-top: 10px; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.ai-disclaimer i { font-style: normal; }
.ai-shimmer { background: linear-gradient(90deg, var(--muted) 0%, var(--muted) 38%, var(--ai-a) 50%, var(--ai-c) 56%, var(--muted) 68%, var(--muted) 100%); background-size: 260% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ai-shimmer 2.4s cubic-bezier(.4, 0, .6, 1) infinite; }
.ask-link { background: var(--ai-tint); color: var(--ai-text); box-shadow: inset 0 0 0 .5px var(--ai-ring); }
.ask-composer { background: linear-gradient(var(--paper), var(--paper)) padding-box, var(--ai-edge) border-box; border: 1px solid transparent; transition: box-shadow .5s var(--ai-ease); }
.ask-composer:focus-within { box-shadow: 0 0 0 4px var(--ai-tint), 0 14px 32px -14px var(--ai-glow); }
.ask-composer button, :root[data-theme=dark] .ask-composer button { background: var(--ai-btn); color: #fff; box-shadow: 0 8px 18px -10px #4f46e5cc, inset 0 1px 0 #ffffff40; transition: transform .4s var(--ai-ease); }
.ask-composer button:active { transform: scale(.92); }
body.chat-mode .ask-composer:focus-within { box-shadow: 0 0 0 4px var(--ai-tint), 0 14px 32px -14px var(--ai-glow); }

.ai-settled :is(.ai-hero, .ai-empty, .ask-example) { animation: none; }
@keyframes ai-rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes ai-drift { from { transform: translate3d(-4%, -2%, 0) scale(1); } to { transform: translate3d(5%, 4%, 0) scale(1.12); } }
@keyframes ai-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes ai-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .ai-hero, .ai-hero-core::before, .ai-orb.is-thinking, .ai-empty, .ask-example, .ask-msg.ai-new { animation: none; }
  .ai-shimmer { animation: none; background: none; color: var(--muted); }
}
@media (forced-colors: active) {
  .ai-title, .ai-shimmer { background: none; color: CanvasText; }
  .ai-hero-core::before { display: none; }
}
