/*
 * Stukwijs, the client screen. One stylesheet, system fonts, no external requests.
 *
 * A blue-grey ground with slow colour fields behind it; on it, frosted glass: the bar at the top,
 * the list of documents (tinted blue) and the conversation (near white). Each state says who acts:
 * orange for you, blue for the office, green for accepted, red when the office asked again.
 */
:root {
  --ground-1: #d3dce9; --ground-2: #bcc9db; --field-1: #8fb2f2; --field-2: #9ed3d6; --field-3: #c3cef0;
  --ink: #0e1b2e; --ink-2: #33415a; --muted: #56647b; --faint: #8593a8; --list-ink: #3e5580;
  --list-glass: rgba(212, 225, 248, .44); --pane-glass: rgba(255, 255, 255, .82); --bar-glass: rgba(255, 255, 255, .5);
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 96px);
  --edge: rgba(255, 255, 255, .78); --seam: rgba(14, 27, 46, .09); --well: rgba(14, 27, 46, .05); --well-2: rgba(14, 27, 46, .08);
  --blue: #2b62e8; --blue-2: #1e4fc7; --blue-soft: rgba(43, 98, 232, .12); --blue-ring: rgba(43, 98, 232, .32);
  --you: #e07035; --you-ink: #a8470f; --you-soft: rgba(224, 112, 53, .15);
  --done: #1d9a5f; --done-ink: #146b42; --done-soft: rgba(29, 154, 95, .14);
  --again: #d1363e; --again-ink: #b0262e; --again-soft: rgba(209, 54, 62, .12);
  --doubt-ink: #8f5200; --doubt-soft: #fff3df; --doubt-edge: #f1d6a8;
  --lawyer-bg: #fff4e8; --lawyer-edge: #f3dac0; --lawyer-ink: #93491a;
  --shadow: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 -1px 0 rgba(14, 27, 46, .04) inset, 0 12px 36px rgba(22, 42, 82, .12);
  --shadow-lift: 0 6px 18px rgba(22, 42, 82, .13);
  --r-xl: 24px; --r-l: 18px; --r-m: 13px;
  --glide: cubic-bezier(.16, 1, .3, 1); --ease: cubic-bezier(.22, .8, .3, 1);
  --font: -apple-system, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
  accent-color: var(--blue);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--ground-2); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(36% 40% at 16% 20%, var(--field-1) 0%, transparent 70%),
    radial-gradient(34% 40% at 84% 80%, var(--field-2) 0%, transparent 70%),
    radial-gradient(30% 36% at 72% 10%, var(--field-3) 0%, transparent 70%),
    linear-gradient(160deg, var(--ground-1), var(--ground-2));
  animation: drift 32s var(--ease) infinite alternate;
}
@keyframes drift { to { transform: translate(3%, -2%) rotate(2deg); } }
::selection { background: rgba(43, 98, 232, .22); }
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--blue-2); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
h1 { font-size: 1.45rem; line-height: 1.25; letter-spacing: -.01em; margin: 0 0 .4rem; text-wrap: balance; }
h2 { font-size: 1.05rem; margin: 1.6rem 0 .3rem; }
h3 { font-size: 1rem; margin: 0 0 .4rem; }
p { margin: 0 0 .8rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hint { color: var(--muted); font-size: .87rem; }
.error { background: var(--again-soft); color: var(--again-ink); padding: .6rem .85rem; border-radius: var(--r-m); }
* { scrollbar-width: thin; scrollbar-color: rgba(14, 27, 46, .2) transparent; }
textarea, input { caret-color: var(--blue); }

/* the glass */
.top, .docs, .pane, body.plain .card {
  -webkit-backdrop-filter: blur(26px) saturate(1.6); backdrop-filter: blur(26px) saturate(1.6);
  border: 1px solid var(--edge); box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------- frame */

.banner { background: rgba(255, 243, 223, .85); color: var(--doubt-ink); font-size: .8rem; padding: .3rem 1rem; text-align: center; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  min-height: 56px; margin: 12px 12px 0; padding: 8px 10px 8px 12px; border-radius: 20px; background: var(--sheen), var(--bar-glass); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; min-width: 0; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-docs ul { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .7rem; }
.demo-docs li { display: grid; gap: .1rem; }
.demo-start { max-width: 760px; margin-inline: auto; }
.demo-start h2 { font-size: 1.08rem; margin: 1.6rem 0 .5rem; }
.demo-start .demo-lead { font-size: 1.05rem; }
.demo-start ul, .demo-start ol { padding-left: 1.3rem; display: grid; gap: .45rem; }
.demo-steps > li > p { margin: .15rem 0 0; }
.demo-steps ul { margin-top: .4rem; gap: .25rem; }
.demo-notice { border: 1px solid var(--doubt-edge); border-radius: var(--r-m); padding: .2rem 1.1rem .5rem; margin: 1.2rem 0; background: var(--doubt-soft); color: var(--ink); }
.demo-notice h2 { margin-top: .8rem; }
.banner a { color: inherit; font-weight: 650; }
.brand-name .firm { color: var(--muted); font-weight: 450; font-size: .86rem; margin-left: 4px; }
.mark { width: 34px; height: 34px; flex-shrink: 0; border-radius: 11px; background: var(--blue); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; box-shadow: var(--shadow-lift); }
.top-actions { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.seg { display: inline-flex; background: var(--well-2); border-radius: 999px; padding: 3px; }
.seg a, .seg-on { padding: 4px 11px; border-radius: 999px; font-size: 13px; text-decoration: none; color: var(--ink-2); transition: background .2s var(--ease); }
.seg a:hover { background: rgba(255, 255, 255, .55); color: var(--ink); }
.seg-on { background: #fff; color: var(--ink); font-weight: 650; box-shadow: 0 1px 4px rgba(14, 27, 46, .14); }
.ghost { background: none; border: 0; font: inherit; color: var(--ink-2); padding: 7px 12px; border-radius: 12px; cursor: pointer; transition: background .2s var(--ease); }
.ghost:hover { background: var(--well-2); color: var(--ink); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #ffb37a, #e07035); color: #fff; font-weight: 650; font-size: 13px; }
button.link { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; text-decoration: underline; cursor: pointer; }
form.inline { display: inline; }
.contact span { user-select: all; }

body.plain main { max-width: 820px; margin: 0 auto; padding: 1.4rem 1rem 2rem; }
.foot { max-width: 820px; margin: 0 auto; padding: 1rem 1rem 2.5rem; color: var(--ink-2); font-size: .9rem; }
.foot p { margin: 0 0 .25rem; }
.card { background: var(--pane-glass); border-radius: var(--r-xl); padding: 1.5rem; }
.narrow { max-width: 30rem; margin: 2rem auto; }
.cases { list-style: none; padding: 0; display: grid; gap: .5rem; }

.btn { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: 0 16px; border-radius: 13px;
  border: 1px solid var(--seam); color: var(--ink); background: #fff; text-decoration: none;
  font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer;
  transition: transform .18s var(--glide), background .2s var(--ease), box-shadow .2s var(--ease); }
.btn:hover { background: #f3f6fc; color: var(--ink); }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: var(--shadow-lift); }
.btn.primary:hover { background: var(--blue-2); }
.btn .host, .link-ext .host { font-size: .78rem; font-weight: 400; opacity: .75; }
button[disabled] { opacity: .6; cursor: progress; }

.stack { display: grid; gap: .45rem; max-width: 34rem; }
.stack label { font-weight: 600; margin-top: .4rem; }
.stack .hint { margin: 0; }
.stack button { justify-self: start; margin-top: .6rem; }
input[type=text], input[type=email], .stack textarea { width: 100%; font: inherit; padding: .65rem .8rem; border: 1px solid var(--seam);
  border-radius: var(--r-m); background: #fff; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
input[type=text]:focus, input[type=email]:focus, .stack textarea:focus { outline: none; border-color: var(--blue-ring); box-shadow: 0 0 0 4px var(--blue-soft); }

/* ---------------------------------------------------------------- the signed-in screen */

body.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.shell-main { flex: 1; min-height: 0; min-width: 0; display: flex; padding: 12px; }
.shell { flex: 1; min-height: 0; min-width: 0; display: flex; gap: 12px; width: 100%; }

/* the list: blue glass */
.docs { width: 340px; flex-shrink: 0; display: flex; overflow: hidden; padding: 10px 5px 10px 0; border-radius: var(--r-xl); background: var(--sheen), var(--list-glass); }
/* The list scrolls inside, set in from the rounded corners so the scrollbar stays clear of them. */
.docs-scroll { flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; padding: 6px 7px 10px 12px; }
.docs .doc-sub, .docs .section, .case-head .hint, .nav-foot { color: var(--list-ink); }
.case-head { display: flex; gap: 14px; align-items: center; padding: 2px 8px 14px; }
.ring { width: 52px; height: 52px; flex-shrink: 0; }
.ring circle { fill: none; stroke-width: 6; }
.ring-track { stroke: rgba(14, 27, 46, .1); }
.ring-val { stroke: var(--done); stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; }
.ring text { font-size: 13px; font-weight: 700; fill: var(--ink); font-variant-numeric: tabular-nums; }
.case-text { min-width: 0; }
.case-name { font-size: 1.05rem; font-weight: 700; line-height: 1.25; margin: 0; overflow-wrap: anywhere; }
.case-line { margin: 0; font-size: 13px; font-weight: 600; color: var(--you-ink); }
.case-head .hint { margin: 0; font-size: 12.5px; }
.section { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--muted); margin: 0; padding: 14px 10px 6px; }
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.doc { position: relative; display: flex; align-items: center; gap: 11px; min-height: 58px; padding: 8px 10px; border-radius: 16px;
  color: var(--ink); text-decoration: none; transition: background .2s var(--ease), transform .15s var(--glide); }
.doc:hover { background: rgba(255, 255, 255, .42); color: var(--ink); }
.doc:active { transform: scale(.985); }
.doc[aria-current] { background: rgba(255, 255, 255, .94); box-shadow: var(--shadow-lift); view-transition-name: current-doc; }
.ico { width: 34px; height: 34px; flex-shrink: 0; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; }
.doc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc-title { font-weight: 600; font-size: 14px; line-height: 1.3; }
.doc-sub { font-size: 12.5px; color: var(--muted); }
.doc-for { align-self: flex-start; max-width: 100%; margin-top: 3px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: var(--well-2);
  border-radius: 999px; padding: 1px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-todo .ico, .doc-held .ico { background: var(--you-soft); color: var(--you); }
.doc-rejected .ico { background: var(--again-soft); color: var(--again); }
.doc-rejected .doc-sub { color: var(--again-ink); }
.doc-held .doc-sub { color: var(--you-ink); }
.doc-received .ico, .doc-office .ico, .doc-general .ico { background: var(--blue-soft); color: var(--blue); }
.doc-accepted .ico { background: var(--done-soft); color: var(--done); }
.doc-accepted .doc-title { color: var(--ink-2); font-weight: 550; }
.doc-later .ico { background: var(--well); color: var(--faint); }
.doc-later .doc-title { color: var(--ink-2); font-weight: 550; }
.doc-replied { align-self: flex-start; margin-top: 3px; font-size: 11.5px; font-weight: 650; color: var(--lawyer-ink); background: var(--lawyer-bg); border-radius: 999px; padding: 1px 8px; }
.ping { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: var(--again); animation: ping 2.4s var(--ease) infinite; }
.doc-held .ping { background: var(--you); }
@keyframes ping { 0%, 55%, 100% { transform: scale(1); } 25% { transform: scale(1.55); } }
details.done > summary { list-style: none; cursor: pointer; border-radius: 10px; }
details.done > summary::-webkit-details-marker { display: none; }
details.done > summary:hover { color: var(--ink); }
.chev { display: inline-flex; transition: transform .3s var(--glide); }
details.done[open] .chev { transform: rotate(90deg); }
details.done[open] > .doc-list { animation: unfold .35s var(--ease); }
@keyframes unfold { from { opacity: 0; transform: translateY(-6px); } }
.nav-foot { margin-top: 22px; padding: 14px 10px 0; border-top: 1px solid var(--seam); font-size: 13px; }
.nav-foot p { margin: 0 0 .2rem; }
.ai-switch { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--seam); }
.ai-switch button.link { font-size: 13px; }

/* the conversation: near-white glass */
.pane { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; border-radius: var(--r-xl); background: var(--pane-glass); overflow: hidden; }
.pane-head { flex-shrink: 0; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 16px 28px 14px; border-bottom: 1px solid var(--seam); }
.pane-title { flex: 1; min-width: 0; }
.pane-head h1 { font-size: 21px; margin: 0; }
.pane-sub { font-size: 13px; color: var(--muted); margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.tag-plain { background: var(--well-2); color: var(--ink-2); font-weight: 500; }
.tag-todo, .tag-held { background: var(--you-soft); color: var(--you-ink); }
.tag-rejected { background: var(--again-soft); color: var(--again-ink); }
.tag-received, .tag-office { background: var(--blue-soft); color: var(--blue-2); }
.tag-accepted { background: var(--done-soft); color: var(--done-ink); }
.tag-later { background: var(--well-2); color: var(--ink-2); }
.back { display: none; width: 44px; height: 44px; margin-left: -12px; border-radius: 50%; align-items: center; justify-content: center; color: var(--ink); }
.back:hover { background: var(--well-2); color: var(--ink); }

.thread { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 28px 34px; scroll-padding: 16px; }
.msgs { list-style: none; margin: 0 auto; padding: 0; max-width: 860px; display: flex; flex-direction: column; gap: 10px; }
.msgs > li { scroll-margin: 16px; }
/* Only what just arrived rises in: the client's words, the dots, and the answer to them. */
.msgs > .arrive, .msgs > .sending, .msgs > .typing { animation: rise .45s var(--glide) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.msg { max-width: 74%; padding: 10px 14px; border-radius: 18px; }
.msg .text { white-space: pre-line; overflow-wrap: anywhere; margin: 0; }
.msg.guide { align-self: flex-start; background: var(--well); border-bottom-left-radius: 6px; }
.msg.client { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.msg.client .sent { display: flex; justify-content: flex-end; align-items: center; gap: 3px; margin: 2px 0 0; font-size: 11px; color: rgba(255, 255, 255, .78); }
.msg.client .sent svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.msg.from-lawyer { align-self: flex-start; background: var(--lawyer-bg); border: 1px solid var(--lawyer-edge); border-bottom-left-radius: 6px; }
.msg.from-lawyer .who { margin: 0; font-weight: 650; font-size: .85rem; color: var(--lawyer-ink); }
.msg.from-lawyer .hint { margin: 0; font-size: .8rem; }
.msg > * + * { margin-top: .5rem; }
.refs { margin: 0; padding-left: 1.1rem; font-size: .93rem; }
.refs li { margin-bottom: .15rem; }
.lawyer { background: var(--lawyer-bg); border-radius: var(--r-m); padding: .6rem .75rem; font-size: .92rem; }
.lawyer p { margin: 0 0 .2rem; }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 13px 15px; border-radius: 18px; border-bottom-left-radius: 6px; background: var(--well); }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: bob 1.1s var(--ease) infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bob { 30% { transform: translateY(-4px); background: var(--blue); } 60% { transform: none; } }

.intro-card, .steps-card, .letter-card { align-self: flex-start; width: 100%; max-width: 640px; background: rgba(255, 255, 255, .7);
  border: 1px solid var(--seam); border-radius: var(--r-l); padding: 16px 18px; }
.letter-card > .hint:first-child { font-size: 12px; margin: 0 0 4px; }
.letter-card textarea.letter { font-family: inherit; font-size: 14px; line-height: 1.55; resize: vertical; }
.letter-card .actions { margin: 0; }
.reply-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.intro-card dl { margin: 0; display: grid; gap: 10px; }
.intro-card dl > div + div { padding-top: 10px; border-top: 1px solid var(--seam); }
.intro-card dt { font-size: 12px; font-weight: 650; color: var(--muted); margin-bottom: 1px; }
.intro-card dd { margin: 0; color: var(--ink-2); font-size: 14.5px; max-width: 62ch; }
.looks { margin-top: 10px; font-size: 14px; }
.looks summary { cursor: pointer; color: var(--blue); font-weight: 600; width: max-content; max-width: 100%; }
.looks p { margin: 6px 0 0; color: var(--ink-2); }
.intro-card > p:last-child { margin: 10px 0 0; font-size: 12px; }
.card-title { font-weight: 650; margin: 0 0 6px; }
.steps { margin: 0 0 8px; padding-left: 20px; color: var(--ink-2); }
.steps li { margin-bottom: 6px; }
.facts { margin: 0 0 8px; display: grid; gap: .25rem; font-size: 13px; color: var(--muted); }
.facts div { display: grid; grid-template-columns: 8.5rem 1fr; gap: .6rem; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }
.steps-card > p:last-child { margin: 0; }

.contacts { align-self: flex-start; width: 100%; max-width: 440px; }
.contacts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.contact-card { display: flex; gap: 12px; background: rgba(255, 255, 255, .78); border: 1px solid var(--seam); border-radius: var(--r-l); padding: 14px 16px;
  transition: transform .22s var(--glide), box-shadow .2s var(--ease); }
.contact-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.contact-card .ico { width: 36px; height: 36px; border-radius: 11px; background: var(--blue-soft); color: var(--blue); }
.contact-card > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.contact-card p { margin: 0 0 2px; }
.contact-card a { font-weight: 500; }
.contact-name { font-weight: 650; }
.checked { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px !important; font-size: 12px;
  color: var(--done-ink); background: var(--done-soft); border-radius: 999px; padding: 3px 10px; }

.file { align-self: flex-end; display: flex; gap: 10px; max-width: 74%; background: #fff; border: 1px solid var(--seam); border-radius: 16px;
  padding: 9px 14px 9px 9px; box-shadow: 0 4px 14px rgba(22, 42, 82, .06); }
.file .ico { width: 34px; height: 40px; border-radius: 9px; background: #fde9e9; color: #c2333b; }
.file p { margin: 0; }
.file-name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.upload-state { display: block; font-size: 13px; margin-top: 2px; }
.upload-state.checking { color: var(--muted); }
.upload-state.checking::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 6px; vertical-align: -1px;
  border: 2px solid var(--blue-ring); border-top-color: var(--blue); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.upload-state.ok { color: var(--done-ink); }
.upload-state.refused { color: var(--again-ink); }
.upload-state.doubt { color: var(--doubt-ink); font-weight: 600; }
.upload-state.gone { color: var(--muted); }

.doubt-card { align-self: flex-start; max-width: 640px; border-radius: var(--r-l); padding: 14px 16px; background: linear-gradient(180deg, #fff8ec, var(--doubt-soft));
  border: 1px solid var(--doubt-edge); }
.doubt-title { display: flex; gap: 8px; align-items: center; font-weight: 650; margin: 0 0 6px; color: var(--ink); }
.doubt-title svg { color: var(--you); flex-shrink: 0; }
.doubt-card > p { color: var(--ink-2); margin-bottom: 6px; }
.doubt-card .actions { margin-top: 10px; }

.note { align-self: center; text-align: center; font-size: 13px; border-radius: 14px; padding: 6px 14px; max-width: 90%; }
.note-ok { background: var(--done-soft); color: var(--done-ink); }
.note-info { background: var(--blue-soft); color: var(--blue-2); }
.note-plain { background: var(--well); color: var(--ink-2); }
.note-warn { background: var(--doubt-soft); color: var(--doubt-ink); }
.lawyer-note { align-self: stretch; background: var(--again-soft); color: var(--ink); border-radius: var(--r-l); padding: 12px 16px; max-width: 640px; }
.lawyer-note p { margin: 0 0 .2rem; }
.lawyer-note .text { white-space: pre-line; overflow-wrap: anywhere; }

/* The composer floats: the thread runs on under its glass capsule. */
.composer { position: relative; z-index: 2; flex-shrink: 0; margin-top: -24px; padding: 4px 22px 12px; pointer-events: none; }
.composer > * { pointer-events: auto; }
.composer > * { max-width: 860px; margin-left: auto; margin-right: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 10px; }
.chip-form { display: contents; }
.chip { display: inline-flex; align-items: center; min-height: 38px; padding: 0 15px; border-radius: 999px;
  border: 1px solid var(--blue-ring); background: rgba(255, 255, 255, .85); color: var(--blue-2);
  font: inherit; font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer;
  transition: transform .18s var(--glide), background .2s var(--ease); }
.chip:hover { background: #fff; color: var(--blue-2); transform: translateY(-1px); }
.chip:active { transform: scale(.95); }
.composer .error { margin-bottom: 8px; }
.compose-row { display: flex; align-items: flex-end; gap: 6px; background: var(--sheen), rgba(255, 255, 255, .72); border: 1px solid var(--edge); border-radius: 24px; padding: 5px 5px 5px 6px;
  -webkit-backdrop-filter: blur(20px) saturate(1.7); backdrop-filter: blur(20px) saturate(1.7);
  box-shadow: 0 1px 0 #fff inset, 0 10px 30px rgba(22, 42, 82, .14); transition: border-color .25s var(--ease), box-shadow .25s var(--ease); }
.compose-row:focus-within { border-color: var(--blue-ring); box-shadow: 0 1px 0 #fff inset, 0 0 0 4px var(--blue-soft), 0 10px 30px rgba(22, 42, 82, .14); }
.compose-row[aria-busy=true] { opacity: .85; }
.attach { position: relative; display: flex; align-items: center; gap: 2px; }
.icon-btn { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; color: var(--muted); background: var(--well); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform .2s var(--glide), background .2s var(--ease); }
.icon-btn:hover { background: var(--well-2); color: var(--ink); transform: scale(1.06); }
.icon-btn:active { transform: scale(.92); }
.sr-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.sr-file:focus-visible + .icon-btn { outline: 2px solid var(--blue); outline-offset: 1px; }
.upload-go { margin: 0 4px; }
.js .upload-go { display: none; }
.ask { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 6px; }
.ask textarea { flex: 1; min-width: 0; border: 0; outline: none; resize: none; padding: 9px 6px; font: inherit;
  color: var(--ink); background: transparent; max-height: 160px; }
.ask textarea::placeholder { color: var(--muted); }
.send { width: 40px; height: 40px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--blue); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-lift);
  transition: transform .2s var(--glide), background .2s var(--ease); }
.send:hover { background: var(--blue-2); transform: scale(1.06); }
.send:active { transform: scale(.92); }
.files-only { flex: 1; margin: 0; padding: 0 8px; align-self: center; }
.compose-hint { font-size: 12px; color: var(--muted); margin: 6px 4px 0; }
.compose-hint button.link { pointer-events: auto; margin-left: 4px; font-size: 12px; font-weight: 600; }
.upload-about { flex-shrink: 0; font-size: 12px; color: var(--muted); padding: 0 30px 12px; margin: 0; }
details.upload-about summary { cursor: pointer; width: max-content; max-width: 100%; }
details.upload-about p { max-width: 70ch; margin: .3rem 0 0; }

/* a file dragged over the page */
.drop { position: absolute; inset: 10px; z-index: 5; border-radius: 20px; border: 2px dashed var(--blue-ring); background: rgba(232, 240, 255, .78);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: grid; place-items: center; text-align: center; color: var(--blue-2);
  font-weight: 650; opacity: 0; pointer-events: none; transform: scale(.98); transition: opacity .25s var(--ease), transform .35s var(--glide); }
.drop.on { opacity: 1; transform: none; }
.drop svg { width: 40px; height: 40px; display: block; margin: 0 auto 8px; animation: lift 1.4s var(--ease) infinite alternate; }
.drop p { margin: 0 0 4px; }
@keyframes lift { to { transform: translateY(-6px); } }

.sheet { max-width: 640px; margin: 0 auto; }
.note-inline { background: var(--blue-soft); color: var(--blue-2); border-radius: var(--r-m); padding: .55rem .8rem; font-size: .92rem; }
textarea.letter { width: 100%; font: .9rem/1.5 ui-monospace, Consolas, monospace; padding: .7rem; border: 1px solid var(--seam);
  border-radius: var(--r-m); margin-bottom: .6rem; color: var(--ink); background: rgba(255, 255, 255, .8); }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* moving between documents: the highlighted row travels */
::view-transition-group(current-doc) { animation-duration: .38s; animation-timing-function: var(--glide); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }

/* ---------------------------------------------------------------- phone: one column at a time */

@media (max-width: 760px) {
  .top { margin: 8px 8px 0; padding: 6px 8px; min-height: 50px; flex-wrap: nowrap; gap: 8px; }
  .top-actions { flex-shrink: 0; gap: 4px; }
  .ghost { padding: 6px 8px; }
  .top .avatar { display: none; }
  .pane-head h1 { font-size: 18px; }
  .shell-main { padding: 8px; }
  .docs { width: 100%; }
  .docs-scroll { padding: 4px 3px 10px 8px; }
  .shell[data-view=list] .pane { display: none; }
  .shell[data-view=chat] .docs { display: none; }
  .back { display: inline-flex; }
  .pane-head { padding: 10px 14px; }
  /* Title, then one row of tags that scrolls sideways: the head stays two lines. */
  .tags { flex-wrap: nowrap; overflow-x: auto; margin-right: -14px; padding-right: 14px; scrollbar-width: none; }
  .tag { flex-shrink: 0; white-space: nowrap; }
  .thread { padding: 14px 14px 8px; }
  .composer { padding: 4px 10px 10px; }
  /* One row of quick replies that scrolls sideways, so the conversation keeps the room. */
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -10px; padding: 6px 10px 10px; scrollbar-width: none; }
  .chips .chip { flex-shrink: 0; white-space: nowrap; }
  .upload-about { padding: 0 14px 10px; }
  .msg, .file { max-width: 88%; }
  .facts div { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .top, .docs, .pane, body.plain .card, .compose-row { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .compose-row { background: #fff; }
  .top { background: #f4f7fc; } .docs { background: #dfe8f7; } .pane, .card { background: #fff; }
}
@media (forced-colors: active) {
  .doc[aria-current] { outline: 2px solid CanvasText; }
}
