/* "Documents" pages of the Katinar workspace. Tokens and type follow the Katinar site. */
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/plex-sans-400-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/plex-sans-400-cyrillic.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+2116; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/plex-sans-600-latin.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/plex-sans-600-cyrillic.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+2116; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plex-mono-500-latin.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plex-mono-500-cyrillic.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+2116; }
@font-face { font-family: "Sofia Sans Condensed"; src: url("fonts/sofia-condensed-800-latin.woff2") format("woff2"); font-weight: 800; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Sofia Sans Condensed"; src: url("fonts/sofia-condensed-800-cyrillic.woff2") format("woff2"); font-weight: 800; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+2116; }

:root {
  color-scheme: light;
  --font-display: "Sofia Sans Condensed", "Arial Narrow", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f2f4f6; --ink: #0e2238; --ink-2: #4a5568;
  --line: #d9dee3; --line-strong: #6a7179; --accent: #ff5b14; --accent-ink: #0e2238; --accent-soft: #ffeee5;
  --link: #0e2238; --focus: #0e2238; --ok: #1c6b45; --warn: #8a4b00; --bad: #a3271a;
  --navy: #0e2238; --on-navy: #f5f6f2; --on-navy-2: #b8c7d9;
}
/* One white look for every visitor, as on the site (founder, 25 November 2026). No dark mode and no navy band. */
* { box-sizing: border-box; }
html { font-family: var(--font-body); font-size: 100%; line-height: 1.5; background: var(--bg); color: var(--ink); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--link); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem 1rem; z-index: 9; }
[hidden] { display: none !important; }

/* Header: white, closed by an ink rule. */
.bar { background: var(--bg); color: var(--ink); border-bottom: 2px solid var(--ink); display: flex; align-items: center; gap: 1rem; padding: .625rem clamp(1rem, 3vw, 2rem); flex-wrap: wrap; }
.bar a { color: var(--ink); }
.bar :focus-visible { outline-color: var(--focus); }
.brand { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; font-weight: 600; font-size: 1.125rem; }
.sheet { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); border-left: 1px solid var(--line-strong); padding-left: 1rem; }
.bar__admin { display: flex; gap: 1.25rem; font-size: .9375rem; margin-left: 1rem; }
.bar__admin a { text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
.bar__admin a[aria-current="page"] { border-bottom-color: var(--accent); }
.bar__nav { margin-left: auto; display: flex; align-items: center; gap: 1rem; font-size: .9375rem; }
.who { font-family: var(--font-mono); font-size: .75rem; color: var(--ink-2); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang { background: none; border: 1px solid var(--line-strong); color: var(--ink); font: 500 .75rem var(--font-mono); padding: .25rem .5rem; cursor: pointer; }

.shell { flex: 1; display: grid; grid-template-columns: minmax(15rem, 19rem) minmax(0, 1fr); }
.rail { border-right: 1px solid var(--line); padding: 1.5rem 0 2rem; background: var(--surface); }
.rail summary { list-style: none; padding: 0 1.25rem .75rem; cursor: default; }
.rail summary::-webkit-details-marker { display: none; }
.label { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.index a { display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: baseline; padding: .5rem 1.25rem; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); border-left: 4px solid transparent; }
.index a:hover { background: var(--surface-2); }
.index a[aria-current="true"] { border-left-color: var(--accent); background: var(--surface-2); font-weight: 600; }
.index .n { font-family: var(--font-mono); font-size: .75rem; color: var(--ink-2); }
.index .d2 { padding-left: 2.25rem; } .index .d3 { padding-left: 3.25rem; } .index .d4 { padding-left: 4.25rem; }
.rail .btn, .rail .hint { margin: 1rem 1.25rem 0; }
.hint { color: var(--ink-2); font-size: .9375rem; max-width: 60ch; }

main { padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 4rem; min-width: 0; }
main:focus { outline: none; }
.crumbs { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .04em; color: var(--ink-2); margin: 0 0 .5rem; }
.crumbs a { color: var(--ink-2); }
h1 { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); line-height: 1; margin: 0 0 1.25rem; overflow-wrap: anywhere; }
h2 { font-family: var(--font-mono); font-weight: 500; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin: 2.5rem 0 .75rem; }
.tools { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1.25rem; }
.btn { font: 600 .9375rem var(--font-body); padding: .625rem 1rem; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); cursor: pointer; border-radius: 2px; text-decoration: none; display: inline-block; }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--line { background: transparent; color: var(--ink); }
.btn--small { padding: .25rem .625rem; font-size: .8125rem; }
.btn:disabled { opacity: .5; cursor: default; }

/* Drop zone: a dashed sheet edge. */
.drop { border: 1px dashed var(--line-strong); padding: 1rem 1.25rem; display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; background: var(--surface); }
.drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop p { margin: 0; color: var(--ink-2); font-size: .9375rem; }

/* Ruled schedule of files. */
.schedule { width: 100%; border-collapse: collapse; border-top: 2px solid var(--ink); }
.schedule th { text-align: left; font: 500 .75rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); padding: .5rem .75rem .5rem 0; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.schedule td { padding: .75rem .75rem .75rem 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.schedule td.name { font-weight: 600; overflow-wrap: anywhere; min-width: 12rem; }
.schedule .meta { font-family: var(--font-mono); font-size: .8125rem; color: var(--ink-2); white-space: nowrap; }
.schedule .note { display: block; font-weight: 400; font-size: .875rem; color: var(--bad); margin-top: .25rem; }
.pill { font: 500 .75rem var(--font-mono); letter-spacing: .04em; text-transform: uppercase; padding: .125rem .5rem; border: 1px solid currentColor; white-space: nowrap; }
.pill--ready { color: var(--ok); } .pill--wait { color: var(--warn); } .pill--failed { color: var(--bad); }
.tag { display: inline-block; margin-left: .5rem; font: 500 .6875rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--line-strong); padding: 0 .375rem; vertical-align: middle; }
.sub { display: block; font: 400 .75rem var(--font-mono); color: var(--ink-2); }
.rows--3 li { grid-template-columns: 1fr auto auto; }
.empty { border-top: 2px solid var(--ink); padding: 1.5rem 0; color: var(--ink-2); }

/* Access records. */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); max-width: 46rem; }
.rows li { display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: baseline; padding: .625rem 0; border-bottom: 1px solid var(--line); }
.rows .sub { display: block; font-family: var(--font-mono); font-size: .75rem; color: var(--ink-2); }
form.inline { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin-top: 1rem; max-width: 46rem; }
label { display: grid; gap: .25rem; align-content: start; font-size: .875rem; color: var(--ink-2); }
select, input[type="text"], input[type="email"], input[type="password"] { font: 400 1rem var(--font-body); padding: .5rem .625rem; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 2px; min-width: 12rem; }

/* Document view: the original next to the text that was read. */
.doc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.pane { border-top: 2px solid var(--ink); padding-top: .75rem; min-width: 0; }
.pane h2 { margin-top: 0; }
.pane iframe { width: 100%; height: 72vh; border: 1px solid var(--line); background: var(--surface); }
.read { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9375rem; line-height: 1.6; background: var(--surface); border: 1px solid var(--line); padding: 1rem 1.25rem; margin: 0; max-height: 72vh; overflow: auto; font-family: var(--font-body); }
.pane img.scan { max-width: 100%; height: auto; border: 1px solid var(--line); display: block; }
.notice { margin: 0 0 .75rem; padding: .625rem .875rem; border-left: 4px solid var(--warn); background: var(--surface-2); font-size: .9375rem; }
.notice--low { border-left-color: var(--bad); }
.pager { display: flex; gap: .75rem; align-items: center; margin-bottom: .75rem; font-family: var(--font-mono); font-size: .8125rem; }

.num { text-align: right; }
.invoice { margin-top: 2.5rem; border-top: 2px solid var(--ink); padding-top: .25rem; }
.invoice h2 { margin-top: .75rem; }
.fields { display: grid; align-items: start; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem 1.5rem; margin: 1rem 0 1.5rem; }
.fields input { min-width: 0; width: 100%; font-family: var(--font-mono); font-size: .9375rem; }
.fields input:disabled { background: var(--surface-2); }
.fields .is-flagged input { border-color: var(--bad); border-width: 2px; }
.err { color: var(--bad); font-size: .8125rem; display: grid; gap: .375rem; justify-items: start; }
.errs { color: var(--bad); font-size: .9375rem; padding-left: 1.25rem; }
.notice--ok { border-left-color: var(--ok); }
.lines { max-width: 46rem; border-top-width: 1px; margin-bottom: 1rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0; margin: 1.5rem 0; border-top: 2px solid var(--ink); border-left: 1px solid var(--line); }
.fact { padding: .625rem .875rem .75rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fact dt { font: 500 .6875rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.fact dd { margin: .25rem 0 0; font: 500 1.0625rem var(--font-mono); overflow-wrap: anywhere; }
.fact--bad dd { color: var(--bad); } .fact--ok dd { color: var(--ok); }
.is-done td { color: var(--ink-2); } .is-done .name a { color: var(--ink-2); }
.late { color: var(--bad); font-weight: 600; }
.checks { display: grid; gap: .5rem; max-width: 34rem; margin-top: .75rem; }
.checks .btn { justify-self: start; margin-top: .5rem; }
.check { display: flex; gap: .625rem; align-items: center; color: var(--ink); font-size: .9375rem; }
.check input { width: 1.125rem; height: 1.125rem; accent-color: var(--ink); }
.draft { display: grid; gap: 1rem; max-width: 46rem; margin: 1.5rem 0; }
.draft input, .draft textarea, .draft select { width: 100%; min-width: 0; }
textarea { font: 400 1rem var(--font-body); padding: .5rem .625rem; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 2px; resize: vertical; }
.draft .btn { justify-self: start; }
.draft-result { max-width: 46rem; }
.errs .warn { color: var(--bad); } .errs li { color: var(--ink-2); }
.inline .grow { flex: 1 1 18rem; } .inline .grow input { width: 100%; }
.status { position: fixed; right: 1rem; bottom: 1rem; max-width: min(28rem, calc(100vw - 2rem)); }
.status p { margin: .5rem 0 0; padding: .75rem 1rem; background: var(--navy); color: var(--on-navy); border-left: 4px solid var(--accent); font-size: .9375rem; }
.status p.bad { border-left-color: #ff9a8c; }

@media (max-width: 52rem) {
  .bar__admin { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .shell { grid-template-columns: 1fr; }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); padding: .75rem 0 1rem; }
  .rail summary { cursor: pointer; padding-bottom: .5rem; } .rail summary::after { content: " ▾"; color: var(--ink-2); }
  .doc { grid-template-columns: 1fr; }
  .sheet { display: none; }
  .schedule thead { position: absolute; left: -999px; }
  .schedule tr { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
  .schedule td { border: 0; padding: 0; } .schedule td.name { grid-column: 1 / -1; min-width: 0; }
  .rows li { grid-template-columns: 1fr auto; }
}
@media (prefers-reduced-motion: no-preference) { .index a, .btn { transition: background-color .12s; } }

/* Seats and invitations (People): the registration link must show in full width. */
.seats .draft-result .inline { align-items: stretch; }
.seats #inv-link { flex: 1 1 28rem; min-width: 0; font-family: var(--mono, ui-monospace, monospace); }
.seats h3 { margin-top: 1.5rem; }

/* Memory page: a fact with up to three actions; a fact after its end date is shown weaker. */
.rows--4 li { grid-template-columns: 1fr auto auto auto; }
.rows li.is-done > span:first-child { color: var(--ink-2); text-decoration: line-through; text-decoration-thickness: 1px; }
main h3 { margin: 1.25rem 0 .25rem; }

/* A chat of the team, read in the "Documents" pages. */
.thread { max-width: 46rem; display: grid; gap: 1rem; margin-top: 1.25rem; }
.msg { border-left: 2px solid var(--line-strong); padding: .25rem 0 .25rem 1rem; }
.msg--own { border-left-color: var(--accent, #ff5b14); }
.msg .label { margin: 0 0 .25rem; }
.msg__text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* The description of a client. */
.about textarea { width: 100%; max-width: 46rem; font: inherit; padding: .625rem .75rem; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 2px; }

/* Upload of a directory: the summary, the progress and the results. */
.upload-panel { position: fixed; right: 1rem; bottom: 1rem; z-index: 20; width: min(34rem, calc(100vw - 2rem)); max-height: 70vh; overflow: auto;
  border: 2px solid var(--ink); padding: 1rem 1.25rem; background: var(--surface); color: var(--ink); }
.upload-panel h2 { margin-top: 0; }
.upload-panel progress { width: 100%; height: .5rem; }
.upload-panel ul.plain { list-style: none; margin: .5rem 0; padding: 0; font-size: .875rem; max-height: 14rem; overflow: auto; }
.upload-panel .bad { color: var(--bad, #a4262c); }
.drop .btn + .btn { margin-left: .5rem; }

/* Types of documents: the views of a folder, and the type on the document page. */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0 .5rem; }
.chip { border: 1px solid var(--line-strong); padding: .25rem .75rem; text-decoration: none; color: var(--ink); font-size: .875rem; border-radius: 2px; background: var(--surface); }
.chip:hover { background: var(--surface-2); }
.chip.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip__n { font-family: var(--font-mono); }
.chip__check { font-family: var(--font-mono); font-size: .75rem; }
.doc-type { margin: .25rem 0 1rem; }
.doc-type select { margin-left: .25rem; }

/* The client portal, the firm's side. */
.requests { list-style: none; margin: 0 0 2rem; padding: 0; border-top: 2px solid var(--ink); max-width: 52rem; }
.requests .request { display: grid; gap: .75rem; padding: 1rem 0 1.25rem; border-bottom: 1px solid var(--line); }
.requests select { max-width: 28rem; }
.tick { display: flex; gap: .625rem; align-items: flex-start; color: var(--ink); max-width: 60ch; }
.tick input { margin-top: .25rem; flex: none; }

/* The chat as a pane of these pages: folders | page | chat. The chat software runs in the frame, with its own narrow layout. */
.chat-toggle { font: 600 .9375rem var(--font-body); background: transparent; border: 1px solid var(--ink); color: var(--ink); padding: .25rem .875rem; cursor: pointer; border-radius: 2px; }
.chat-toggle[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
body { --chat-w: min(var(--chat-w-set, 27rem), 60vw); }
.chat { position: sticky; top: var(--bar-h, 3.4rem); height: calc(100vh - var(--bar-h, 3.4rem)); height: calc(100dvh - var(--bar-h, 3.4rem)); align-self: start;
  display: flex; flex-direction: column; min-width: 0; background: var(--bg); border-left: 2px solid var(--ink); }
.chat__head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem .75rem; border-bottom: 1px solid var(--line); }
.chat__title { margin: 0 auto 0 0; min-width: 0; font: 500 .75rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat__title b { font-weight: 500; color: var(--ink); }
.chat__title b:not(:empty)::before { content: " · "; color: var(--ink-2); }
.chat__offer { margin: 0; padding: .5rem .75rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; font-size: .875rem; background: var(--accent-soft); border-bottom: 1px solid var(--line); }
.chat iframe { flex: 1; min-height: 0; width: 100%; border: 0; background: var(--bg); }
.chat__grip { position: absolute; left: -5px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 2; touch-action: none; }
.chat__grip:hover, .chat__grip:focus-visible, .is-dragging .chat__grip { background: var(--accent); outline: none; }
.is-dragging { cursor: col-resize; user-select: none; }
.is-dragging iframe { pointer-events: none; }
body.has-chat .bar { position: sticky; top: 0; z-index: 10; }

@media (min-width: 56.01rem) {
  body.has-chat .shell { grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr) var(--chat-w); }
  body.has-chat .status, body.has-chat .upload-panel { right: calc(var(--chat-w) + 1rem); max-width: min(28rem, calc(100vw - var(--chat-w) - 2rem)); }
}
/* A middle screen with the pane: the folder list is a block above the page, as on a phone. */
@media (min-width: 56.01rem) and (max-width: 80rem) {
  body.has-chat .shell { grid-template-columns: minmax(0, 1fr) var(--chat-w); grid-template-rows: auto 1fr; }
  body.has-chat .rail { grid-column: 1; grid-row: 1; border-right: 0; border-bottom: 1px solid var(--line); padding: .75rem 0 1rem; }
  body.has-chat .rail summary { cursor: pointer; padding-bottom: .5rem; } body.has-chat .rail summary::after { content: " ▾"; color: var(--ink-2); }
  body.has-chat main { grid-column: 1; grid-row: 2; }
  body.has-chat .chat { grid-column: 2; grid-row: 1 / span 2; }
}
/* A small screen: the pane covers the screen. */
@media (max-width: 56rem) {
  .chat { position: fixed; inset: 0; height: auto; z-index: 30; border-left: 0; }
  .chat__grip { display: none; }
  body.has-chat { overflow: hidden; }
}

/* The page area follows its own width, not the width of the window: with the pane open it is narrow on a wide screen. */
main { container: page / inline-size; }
@container page (max-width: 45rem) {
  .doc { grid-template-columns: 1fr; }
  .schedule thead { position: absolute; left: -999px; }
  .schedule tr { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
  .schedule td { border: 0; padding: 0; } .schedule td.name { grid-column: 1 / -1; min-width: 0; }
  .rows li { grid-template-columns: 1fr auto; }
}
