/* JE LA PECHE — tokens and working components from CF DS/DESIGN.md.
   Montserrat is self-hosted under SIL OFL; Aeroport is deliberately not bundled. */
@font-face {
  font-family: Montserrat;
  src: url('/api/ui/assets/Montserrat-cyrillic.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Montserrat;
  src: url('/api/ui/assets/Montserrat-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  color-scheme: light;
  --primary: #131417;
  --ink: #1D232E;
  --paper: #FFFFFF;
  --accent-blue: #759AC4;
  --accent-blue-deep: #6489B3;
  --accent-blue-text: #476C96;
  --gray: #99999B;
  --gray-text: #5A6068;
  --silver: #C9CED1;
  --frost: #EEF0F2;
  --press: #E4E7EA;
  --hairline-dark: #39414E;
  --primary-pressed: #0C0D0F;
  --success: #6FA287;
  --success-text: #47695A;
  --success-soft: #EAF2EE;
  --warning: #C9A15E;
  --warning-text: #75592B;
  --warning-soft: #F7F1E5;
  --error: #BF6B6B;
  --error-text: #A14E4E;
  --error-soft: #F7EAEA;
  --info-soft: #EAF1F8;
  --font-ui: Montserrat, -apple-system, system-ui, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
  --focus-ring: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent-blue-text);
  --focus-ring-dark: 0 0 0 2px var(--primary), 0 0 0 4px var(--accent-blue);
  --ease: cubic-bezier(.2, 0, 0, 1);
}
* { box-sizing: border-box; }
body { margin: 0; font: 400 15px/1.5 var(--font-ui); color: var(--ink); background: var(--frost); }
button, input, select, textarea { font: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 11px 16px; border: 1px solid var(--silver); border-radius: 4px;
  background: var(--paper); color: var(--ink); cursor: pointer;
  font-size: 13px; font-weight: 600; line-height: 1.4; text-align: center; text-decoration: none;
  transition: background 120ms var(--ease), border-color 120ms var(--ease);
}
button:hover:not(:disabled), .button:hover { background: var(--frost); }
button:active:not(:disabled), .button:active { background: var(--press); }
button:disabled { color: var(--gray-text); background: var(--frost); cursor: default; }
.primary, .button.primary { background: var(--primary); border-color: var(--primary); color: var(--paper); }
.primary:hover:not(:disabled), .button.primary:hover { background: var(--ink); border-color: var(--ink); }
.primary:active:not(:disabled), .button.primary:active { background: var(--primary-pressed); }
.primary:disabled { color: var(--gray-text); background: var(--silver); border-color: var(--silver); }
.quiet { background: transparent; border-color: transparent; }
a { color: var(--accent-blue-text); text-underline-offset: 3px; }
a:hover { text-decoration: none; }
:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--focus-ring); }
h1, h2, h3, p { margin: 0 0 12px; }
h1 { font-size: 32px; font-weight: 600; line-height: 1.2; letter-spacing: -.6px; }
h2 { font-size: 24px; font-weight: 600; line-height: 1.3; letter-spacing: -.3px; }
h3 { font-size: 17px; font-weight: 600; line-height: 1.35; }
p, li { overflow-wrap: anywhere; }
small, .small { font-size: 13px; line-height: 1.45; }
.muted, small { color: var(--gray-text); }
.blue-word { color: var(--accent-blue-deep); }
label { display: grid; gap: 6px; margin-bottom: 16px; font-size: 13px; font-weight: 600; line-height: 1.45; }
input, select, textarea {
  width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--silver); border-radius: 6px; background: var(--paper); color: var(--ink);
  font-size: 15px; font-weight: 400; line-height: 1.5;
}
input::placeholder, textarea::placeholder { color: var(--gray-text); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--ink); }
input:disabled, select:disabled, textarea:disabled { background: var(--frost); color: var(--gray-text); }
input[type=number] { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
input[type=file] { padding: 8px; font-size: 12px; }
input::file-selector-button { padding: 5px 8px; margin-right: 8px; border: 0; border-radius: 4px; background: var(--frost); color: var(--ink); font: inherit; cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 18px; min-width: 18px; min-height: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
textarea { resize: vertical; min-height: 96px; }
fieldset { min-width: 0; margin: 16px 0; padding: 16px; border: 1px solid var(--silver); border-radius: 6px; }
legend { padding: 0 6px; font-weight: 600; font-size: 13px; }
summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-size: 14px; font-weight: 600; }
summary::marker { color: var(--gray-text); }
details > :last-child { margin-bottom: 0; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-heading h2, .section-heading h3 { margin: 0; }
.app-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100dvh; }
.app-rail {
  position: sticky; top: 0; align-self: start; height: 100dvh; overflow-y: auto;
  padding: 28px 20px 20px; background: var(--primary); color: var(--paper);
}
.app-rail :focus-visible { box-shadow: var(--focus-ring-dark); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--paper); text-decoration: none; }
.brand img { flex-shrink: 0; }
.brand > span { font-size: 14px; font-weight: 600; letter-spacing: .7px; white-space: nowrap; }
.brand small { display: block; margin-top: 4px; color: var(--silver); font-size: 11px; font-weight: 400; letter-spacing: 0; }
.rail-nav { display: grid; gap: 8px; margin: 40px -8px 24px; }
.rail-nav a { padding: 12px; color: var(--silver); font-size: 13px; text-decoration: none; }
.rail-nav a:hover { color: var(--paper); background: var(--hairline-dark); }
.rail-nav [aria-current] { border-left: 2px solid var(--accent-blue); color: var(--paper); font-weight: 600; }
.rail-note { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--hairline-dark); color: var(--silver); font-size: 12px; }
.page-heading { margin-bottom: 32px; }
.page-heading p { margin-bottom: 0; color: var(--gray-text); max-width: 58ch; }
.entry-main { width: 100%; max-width: 1152px; padding: 56px 48px; }
.entry-panel { padding: 24px; border: 1px solid var(--silver); border-radius: 8px; background: var(--paper); }
.entry-panel p { max-width: 66ch; }
.login-panel { max-width: 600px; }
.session-account { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.session-account .status { flex-basis: 100%; margin: 0; }
.login-panel .button-row { margin-top: 20px; }
.login-panel .primary { margin: 8px 0 4px; }
.login-panel .status { margin-bottom: 0; }
.login-alternative { margin-top: 20px; padding-top: 4px; border-top: 1px solid var(--silver); }
.login-alternative p { margin: 12px 0; }
.labels-entry { display: flex; align-items: flex-start; flex-direction: column; gap: 8px; border-top: 3px solid var(--accent-blue); }
.labels-entry p { color: var(--gray-text); }
.signing-workspace { margin-top: 48px; scroll-margin-top: 24px; }
.signing-heading p { margin: 8px 0 0; }
.signing-workspace .entry-panel { margin-top: 16px; }
.status { margin-top: 12px; white-space: pre-wrap; font-size: 14px; overflow-wrap: anywhere; }
.ok { color: var(--success-text); }
.bad { color: var(--error-text); }
.table-scroll { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.5; }
th, td { border-bottom: 1px solid var(--silver); padding: 12px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
th { background: var(--frost); font-weight: 600; }
tbody tr:nth-child(even) { background: var(--frost); }
tbody tr:hover { background: var(--info-soft); }
.skip { position: fixed; top: 12px; left: 16px; z-index: 500; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border-radius: 4px; background: var(--paper); color: var(--ink); }
.skip:focus { width: auto; height: auto; padding: 12px 16px; overflow: visible; clip-path: none; }
.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; }
@media (max-width: 991px) {
  .entry-main { padding: 40px 28px; }
}
@media (max-width: 767px) {
  .app-shell { display: block; }
  .app-rail { position: static; height: auto; padding: 16px 20px; overflow: visible; }
  .brand img { width: 32px; height: 32px; }
  .entry-rail .rail-nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 16px -8px 0; }
  .entry-rail .rail-nav a { padding: 8px 10px; }
  .entry-rail .rail-note { display: none; }
  .entry-main { padding: 32px 20px; }
  .page-heading { margin-bottom: 24px; }
  h1 { font-size: 27px; }
  h2 { font-size: 21px; }
  .entry-panel { padding: 20px; }
  .labels-entry .button { width: 100%; }
  .signing-workspace { margin-top: 32px; }
  .button-row > button { flex: 1 1 auto; }
  th, td { padding: 10px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
/* Browser-bound Telegram confirmation. */
.remember-login { display: flex; align-items: flex-start; gap: .5rem; margin: 1rem 0; }
.remember-login input { width: auto; margin-top: .2rem; flex: 0 0 auto; }
#bot-login-code { font-variant-numeric: tabular-nums; letter-spacing: .12em; }
