/* Bonjorno — АВИВИР parallel-import managers. Golos Text, bundled. */
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/golos-text-cyrillic-400-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/golos-text-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/golos-text-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, 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; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/golos-text-cyrillic-500-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/golos-text-latin-ext-500-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/golos-text-latin-500-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, 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; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/golos-text-cyrillic-600-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/golos-text-latin-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/golos-text-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, 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; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/golos-text-cyrillic-700-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/golos-text-latin-ext-700-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/golos-text-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, 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; }

/* Bonjorno — the bot, in a browser. A chat with the bot: its messages on the left,
   the manager's answers on the right, the bot's buttons under its messages and the
   bot keyboard at the bottom. Money is the one loud colour (magenta). */

:root {
  --wall: #d2ddca;
  --wall-img: url(wall-light.svg);
  --head: #ffffff;
  --in: #ffffff;
  --out: #dff3cb;
  --ink: #16212a;
  --muted: #687986;
  --line: #e1e7ea;
  --line-strong: #c3ced5;
  --accent: #2479c4;
  --accent-ink: #ffffff;
  --brand: #a01c5a;
  --brand-soft: #f8e7ef;
  --kb: rgba(255, 255, 255, .74);
  --kb-hover: rgba(255, 255, 255, .95);
  --kb-ink: #1d68ab;
  --dock: #ffffff;
  --dock-2: #eef1f4;
  --key: #ffffff;
  --field: #f2f5f7;
  --service: rgba(38, 62, 46, .42);
  --amber-ink: #7a4f00;
  --amber-soft: #fcf0d2;
  --ok-ink: #1e6b3a;
  --ok-soft: #e1f2e6;
  --danger: #a3241b;
  --danger-soft: #fbe7e5;
  --focus: #2c6fd1;
  --r: 16px;
  --r-small: 5px;
  --col: 820px;
  --font: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --wall: #0e1621;
    --wall-img: url(wall-dark.svg);
    --head: #17212b;
    --in: #182533;
    --out: #2b5278;
    --ink: #e8eef2;
    --muted: #8a9cab;
    --line: #243443;
    --line-strong: #34495b;
    --accent: #5aa7ec;
    --accent-ink: #0b1a28;
    --brand: #ec79a9;
    --brand-soft: #3a1b2a;
    --kb: rgba(24, 37, 51, .82);
    --kb-hover: rgba(36, 54, 72, .95);
    --kb-ink: #8cc4f5;
    --dock: #17212b;
    --dock-2: #111b25;
    --key: #22313f;
    --field: #22313f;
    --service: rgba(0, 0, 0, .38);
    --amber-ink: #f2c46b;
    --amber-soft: #3a2e12;
    --ok-ink: #8fd6a5;
    --ok-soft: #173225;
    --danger: #f08a80;
    --danger-soft: #3d1c19;
    --focus: #7fb0ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--wall); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--wall) var(--wall-img) repeat; background-size: 320px 320px;
  color: var(--ink);
  font: 400 16px/1.42 var(--font);
  font-feature-settings: "tnum" 1;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 600; }
h1 { font-size: 19px; }
h2 { font-size: 17px; }
h3 { font-size: 15.5px; }
p { margin: 0; }
p + p { margin-top: 8px; }
ul, ol { margin: 6px 0 0; padding-left: 20px; }
li + li { margin-top: 4px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }
.code { letter-spacing: 0.02em; font-weight: 500; overflow-wrap: anywhere; }
.pre { white-space: pre-line; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---- chat header ---- */
.head {
  position: sticky; top: 0; z-index: 30;
  background: var(--head);
  box-shadow: 0 1px 0 var(--line), 0 2px 8px rgba(0, 0, 0, .05);
  padding-top: env(safe-area-inset-top);
}
.head-inner {
  max-width: var(--col); margin: 0 auto; min-height: 56px;
  display: flex; align-items: center; gap: 4px; padding: 0 6px;
}
.head-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%; color: var(--muted);
  background: none; border: 0; cursor: pointer; font: 600 18px/1 var(--font);
}
.head-btn:hover { background: var(--field); color: var(--ink); text-decoration: none; }
.peer { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; color: var(--ink); padding: 4px 6px; border-radius: 10px; }
.peer:hover { text-decoration: none; }
.peer.home-peer { padding-left: 10px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; font: 700 19px/1 var(--font);
}
.peer-text { display: flex; flex-direction: column; min-width: 0; }
.peer-text strong { font-size: 16.5px; font-weight: 600; line-height: 1.2; }
.peer-text small { font-size: 13.5px; color: var(--muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peer-text small.typing { color: var(--accent); }
.more { position: relative; }
.more summary { list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more-menu {
  position: absolute; right: 2px; top: calc(100% + 4px); z-index: 40;
  width: min(290px, calc(100vw - 24px)); padding: 6px;
  background: var(--in); border-radius: 12px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .22);
}
.more-menu a, .more-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px;
  font: 500 15px/1.3 var(--font); color: var(--ink); background: none; border: 0; text-align: left; cursor: pointer;
}
.more-menu a:hover, .more-menu button:hover { background: var(--field); text-decoration: none; }
.more-menu a[aria-current="page"] { color: var(--accent); }
.more-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.more-menu form { margin: 0; }
.ico { display: inline-block; width: 1.45em; text-align: center; flex: none; }

/* ---- chat column ---- */
main { flex: 1; width: 100%; }
.chat-col {
  max-width: var(--col); margin: 0 auto; padding: 14px 10px 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.msg { display: flex; flex-direction: column; max-width: min(88%, 560px); min-width: 0; }
.msg.in { align-self: flex-start; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.msg.out + .msg.in, .msg.in + .msg.out { margin-top: 6px; }
.msg.has-kb { width: min(100%, 540px); max-width: 100%; }
.msg.wide, .msg.wide.has-kb { align-self: stretch; width: auto; max-width: 100%; }
.bubble {
  background: var(--in); color: var(--ink);
  border-radius: var(--r) var(--r) var(--r) var(--r-small);
  padding: 8px 12px 9px; box-shadow: 0 1px 1.5px rgba(0, 0, 0, .13);
  overflow-wrap: anywhere; min-width: 0;
}
.msg.out .bubble { background: var(--out); border-radius: var(--r) var(--r) var(--r-small) var(--r); white-space: pre-line; }
.msg.wide .bubble { padding: 14px 16px 16px; }
.bubble + .bubble { margin-top: 6px; }
.bubble h1 { margin-bottom: 4px; }
.bubble h2 { margin-bottom: 6px; }
.bubble > h2:not(:first-child), .bubble > section + section, .bubble .block + .block { margin-top: 16px; }
.bubble .lead { color: var(--muted); font-size: 15px; }
.bubble .meta { margin-top: 6px; font-size: 13px; color: var(--muted); }
.sender { display: block; font-size: 14px; font-weight: 600; color: var(--brand); margin-bottom: 2px; }

/* Service line: what step this is, flash results. */
.service { align-self: center; text-align: center; margin: 4px 0; max-width: 92%; }
.service span {
  display: inline-block; padding: 4px 11px; border-radius: 13px;
  background: var(--service); color: #fff; font-size: 13.5px; font-weight: 500;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.service.ok span { background: color-mix(in srgb, var(--ok-ink) 78%, transparent); }
.service.warn span { background: color-mix(in srgb, #8a5a00 82%, transparent); }
.service.error span { background: color-mix(in srgb, #a3241b 85%, transparent); }

/* ---- inline keyboard under a bot message ---- */
.kb { display: grid; gap: 5px; margin-top: 5px; grid-template-columns: minmax(0, 1fr); }
.kb.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kb.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kb form { display: contents; }
.kb .k, .kb button.k {
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1px;
  min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 0;
  background: var(--kb); color: var(--kb-ink); text-align: center;
  font: 500 15px/1.25 var(--font); cursor: pointer;
  -webkit-backdrop-filter: blur(10px) saturate(1.3); backdrop-filter: blur(10px) saturate(1.3);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .08);
  overflow-wrap: anywhere;
}
.kb .k:hover { background: var(--kb-hover); text-decoration: none; }
.kb .k:active { transform: scale(.985); }
.kb .k small { font-size: 13px; font-weight: 400; color: var(--muted); }
.kb .k.row { align-items: stretch; text-align: left; padding: 10px 14px; }
.kb .k.row .k-line { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 12px; align-items: baseline; }
.kb .k.row .k-line strong { flex: 1 1 14em; min-width: 0; }
.kb .k.row strong { font-weight: 600; color: var(--ink); }
.kb .k.row .k-price { font-weight: 600; color: var(--brand); flex: 0 1 auto; }
.kb .k.wide-key { grid-column: 1 / -1; }
.kb .k.go { background: var(--accent); color: var(--accent-ink); }
.kb .k.go:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.kb .k.go small { color: inherit; opacity: .85; }
.kb .k.danger { color: var(--danger); }
.kb .k[disabled] { opacity: .55; cursor: progress; }
.kb .k.done-key { color: var(--ok-ink); cursor: default; }

/* ---- bottom dock: bot keyboard + message field ---- */
.dock {
  position: sticky; bottom: 0; z-index: 25;
  background: var(--dock); box-shadow: 0 -1px 0 var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.dock-inner { max-width: var(--col); margin: 0 auto; }
.composer { display: flex; align-items: flex-end; gap: 4px; padding: 6px 6px; margin: 0; }
.composer input[type=text], .composer input[type=search], .composer textarea {
  flex: 1; min-width: 0; min-height: 44px; max-height: 40vh; margin: 0;
  border: 0; border-radius: 22px; background: var(--field); color: var(--ink);
  padding: 11px 16px; font: 400 16px/1.38 var(--font); resize: none;
}
.composer textarea { height: 44px; overflow-y: auto; }
.composer input:focus, .composer textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 0; }
.composer input::placeholder, .composer textarea::placeholder { color: var(--muted); }
.send {
  width: 44px; height: 44px; border-radius: 50%; border: 0; flex: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink);
}
.send:hover { filter: brightness(1.07); }
.send svg.i { width: 22px; height: 22px; }
.send[disabled] { opacity: .5; }
.kb-toggle {
  width: 44px; height: 44px; border-radius: 50%; border: 0; flex: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; color: var(--muted);
}
.kb-toggle:hover, .kb-toggle[aria-expanded="true"] { color: var(--accent); background: var(--field); }
.reply-kb {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
  padding: 8px; background: var(--dock-2);
}
.reply-kb[hidden] { display: none; }
.reply-kb a {
  display: flex; align-items: center; justify-content: center; gap: 4px; text-align: center;
  min-height: 46px; padding: 8px 8px; border-radius: 9px;
  background: var(--key); color: var(--ink); font: 500 15px/1.2 var(--font);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .14);
}
.reply-kb a:hover { text-decoration: none; filter: brightness(.97); }
.reply-kb a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent), 0 1px 0 rgba(0, 0, 0, .14); }
.reply-kb .wide-key { grid-column: 1 / -1; }
.dock-note { padding: 10px 16px; font-size: 14px; color: var(--muted); text-align: center; }

/* ---- typing and arrival ---- */
.typing-dots { display: inline-flex; gap: 4px; padding: 6px 2px; }
.typing-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .4; animation: blink 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 30% { opacity: 1; transform: translateY(-2px); } 60% { opacity: .4; transform: none; } }
.arrive-in { animation: arrive-in .26s cubic-bezier(.2, .9, .3, 1.15) both; transform-origin: 0 100%; }
.arrive-out { animation: arrive-out .2s ease-out both; transform-origin: 100% 100%; }
@keyframes arrive-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes arrive-out { from { opacity: 0; transform: translateX(14px) scale(.97); } }
.pending { color: var(--muted); }
.pending::before {
  content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); margin-right: 9px; vertical-align: 1px; animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) {
  .arrive-in, .arrive-out, .typing-dots i, .pending::before { animation: none; }
}

/* ---- controls inside messages ---- */
.btn {
  white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--in); color: var(--ink);
  font: 500 15px/1.2 var(--font); cursor: pointer;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 5px; }
input[type=text], input[type=password], input[type=search], input[type=date], input[type=number], input[type=file], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--in); color: var(--ink); font: 400 16px/1.4 var(--font);
}
input[type=file] { padding: 8px; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.field { margin-bottom: 14px; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr 2fr; gap: 0 14px; }
.grid-3-even { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 14px; }
.cell-input { min-height: 34px !important; padding: 4px 8px !important; width: 90px !important; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.inline-form .field { margin: 0; flex: 1 1 180px; }
.qty-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-weight: 500; margin: 8px 0 0; }
.qty-line input { width: 100px; min-height: 38px; }
.manual { margin-top: 5px; background: var(--kb); border-radius: 10px; padding: 0 12px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.manual summary { cursor: pointer; font-weight: 500; color: var(--kb-ink); padding: 11px 0; text-align: center; list-style: none; }
.manual summary::-webkit-details-marker { display: none; }
.manual[open] { padding-bottom: 12px; }
.manual-fields { display: grid; grid-template-columns: 1fr 90px 90px; gap: 8px; margin-bottom: 10px; }
.manual-fields label { margin: 0; }
.manual-fields input { margin-top: 4px; }
.manual-fields .span { grid-column: 1 / -1; }
.notice { border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; }
.notice.ok { background: var(--ok-soft); color: var(--ok-ink); }
.notice.warn { background: var(--amber-soft); color: var(--amber-ink); }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.tag { display: inline-block; font-size: 13px; font-weight: 500; padding: 2px 8px; border-radius: 6px; background: var(--field); color: var(--muted); }
.tag.amber { background: var(--amber-soft); color: var(--amber-ink); }
.tag.accent { background: var(--brand-soft); color: var(--brand); }
.tag.ok { background: var(--ok-soft); color: var(--ok-ink); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---- data inside messages ---- */
.facts { margin: 10px 0 0; }
.facts > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 14px; padding-top: 1px; }
.facts dd { margin: 0; }
.table-wrap { overflow-x: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-wrap table { min-width: 560px; }
th, td { overflow-wrap: normal; word-break: normal; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 13px; background: var(--in); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.optional td { color: var(--muted); }
.report { white-space: pre-wrap; margin: 8px 0 0; font: 400 14.5px/1.5 var(--font); }
.stat-line { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 8px; }
.stat-line div { font-size: 14px; color: var(--muted); }
.stat-line b { display: block; font-size: 21px; color: var(--ink); font-weight: 600; }
.password-reveal { font-size: 20px; font-weight: 600; letter-spacing: 0.04em; user-select: all; }

/* The one loud element: the price. */
.card-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; margin-top: 12px; }
.card-grid > * { min-width: 0; }
.slip { background: var(--brand-soft); border-radius: 12px; padding: 14px 16px 16px; }
.slip-label { font-size: 13.5px; color: var(--muted); }
.slip-value { font-size: 27px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; margin: 4px 0 2px; color: var(--brand); }
.slip-value.quiet { font-size: 18px; font-weight: 600; color: var(--ink); }
.slip-notes { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.slip-cut { border: 0; border-top: 1.5px dashed color-mix(in srgb, var(--brand) 35%, transparent); margin: 14px 0; }
.slip-estimate { font-size: 19px; font-weight: 600; color: var(--ink); }
.slip-formula { font-size: 13px; color: var(--muted); margin-top: 6px; white-space: pre-line; }
.slip .actions .btn { flex: 1; }
.slip-file { margin-top: 8px; overflow-wrap: anywhere; }
.age { margin-top: 12px; padding: 9px 11px; border-radius: 9px; background: var(--amber-soft); color: var(--amber-ink); font-size: 14px; }
.config { color: var(--muted); }
.sales { margin: 6px 0 0; }
.notes { margin: 6px 0 0; }
.brief-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 22px; margin-top: 10px; }
.brief-grid h3 { margin-bottom: 2px; }
.contact { padding-top: 10px; border-top: 1px solid var(--line); margin-top: 10px; }
.contact:first-of-type { border-top: 0; margin-top: 4px; padding-top: 0; }
.contact h3 { margin-bottom: 6px; }
.contact dl { margin: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 12px; font-size: 15px; }
.contact dt { color: var(--muted); font-size: 14px; }
.contact dd { margin: 0; overflow-wrap: anywhere; }
.contact .src { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* ---- consumables results ---- */
.result-head h2 { font-size: 16px; }
.offer { padding: 10px 0 0; margin-top: 10px; border-top: 1px solid var(--line); }
.offer.miss { color: var(--muted); font-size: 14px; padding-top: 6px; margin-top: 6px; }
.offer-title { font-weight: 600; }
.offer-price { font-weight: 600; margin-top: 3px; color: var(--brand); }
.offer dl { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 3px 12px; margin: 6px 0 0; font-size: 14px; }
.offer dt { color: var(--muted); }
.offer dd { margin: 0; overflow-wrap: anywhere; }
.ai-head { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.result .pending { margin-top: 8px; }

/* ---- documents: guide, admin ---- */
.doc .bubble { padding: 18px 20px 20px; border-radius: 14px; }
.doc h1 { font-size: 22px; margin-bottom: 8px; }
.doc h2 { font-size: 18px; margin: 0 0 8px; }
.doc section { margin-top: 26px; scroll-margin-top: 72px; }
.doc p, .doc ol, .doc ul { margin: 0 0 10px; }
.doc .lead { font-size: 16.5px; color: var(--ink); margin: 6px 0 14px; }
.toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toc a { padding: 5px 0; }
.defs { margin: 0 0 10px; }
.defs dt { font-weight: 600; margin-top: 10px; }
.defs dd { margin: 2px 0 0; }
.note { background: var(--field); border-left: 3px solid var(--line-strong); padding: 9px 12px; border-radius: 0 9px 9px 0; font-size: 15px; }
.formula { background: var(--brand-soft); padding: 10px 14px; border-radius: 9px; font-weight: 500; }
.sebes-params { margin-top: 10px; }

/* ---- login ---- */
.login-col { max-width: 440px; margin: 0 auto; padding: 9vh 14px 30px; display: flex; flex-direction: column; gap: 10px; }
.login-peer { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-peer .avatar { width: 54px; height: 54px; font-size: 25px; }
.login-peer strong { display: block; font-size: 21px; }
.login-peer small { color: var(--muted); font-size: 14.5px; }

@media (min-width: 700px) {
  .chat-col { padding: 18px 16px 24px; gap: 9px; }
  .msg { max-width: min(80%, 560px); }
  .reply-kb { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 10px; }
}
@media (max-width: 760px) {
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .card-grid > .slip { order: -1; }
}
@media (max-width: 560px) {
  .facts > div { grid-template-columns: 1fr; gap: 1px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .offer dl, .contact dl { grid-template-columns: 1fr; gap: 0 12px; }
  .offer dd, .contact dd { margin-bottom: 4px; }
  .manual-fields { grid-template-columns: 1fr 1fr; }
  .manual-fields label:first-child { grid-column: 1 / -1; }
  .slip-value { font-size: 24px; }
  .doc .bubble { padding: 14px 14px 16px; }
}

/* ---- small pieces used by the templates (no inline styles: the CSP forbids them) ---- */
.results { display: flex; flex-direction: column; gap: 8px; }
.results:empty { display: none; }
.msg[id] { scroll-margin-top: 72px; }
.form-body { margin-top: 12px; }
.section-tight { margin-top: 10px; }
.slip-gap { margin-top: 12px; }
.card-title { font-size: 20px; margin: 8px 0 4px; }
.report-title { margin-top: 18px; }
.howto { margin-top: 8px; }
.howto summary { cursor: pointer; color: var(--accent); }
.wide-btn { width: 100%; min-height: 46px; }
.contact-msg h3 { margin-bottom: 6px; }
.contact-dl { margin: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 12px; font-size: 15px; }
.contact-dl dt { color: var(--muted); font-size: 14px; }
.contact-dl dd { margin: 0; overflow-wrap: anywhere; }
.ai-slot { margin-top: 12px; }
.msg > form:not(.kb) { display: flex; flex-direction: column; min-width: 0; }
.msg.has-kb > .bubble, .msg.has-kb > form > .bubble { width: 100%; }
.guide section:first-of-type { margin-top: 18px; }
.guide .steps-list li { margin-bottom: 4px; }
.lines { margin: 10px 0 0; padding-left: 22px; }
.lines li + li { margin-top: 10px; }
.line-head { font-weight: 500; }
@media (max-width: 560px) {
  .contact-dl { grid-template-columns: 82px minmax(0, 1fr); gap: 3px 10px; }
}
#chat:focus { outline: none; }

/* A short note after an action (saved, added to the deal): floats above the message field. */
.toast { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 35; margin: 0; width: max-content; max-width: calc(100% - 32px); transition: opacity .4s ease, transform .4s ease; }
.toast span { padding: 8px 14px; font-size: 14.5px; box-shadow: 0 4px 16px rgba(0, 0, 0, .18); }
.toast.gone { opacity: 0; transform: translate(-50%, 8px); pointer-events: none; }
