/* AIAsistentVS - citizen chat. Deployment colours measured from the character icon.
 * Built from the approved design mock v2 (Zaklad/1); contrast values measured there. */

:root {
  --navy:       #09173E;  /* headings, footer        17.45:1 on white */
  --blue:       #022880;  /* brand fill, citizen bubble; white on it 12.98:1 */
  --blue-mid:   #023DB3;  /* links                    9.05:1 */
  --bubble:     #0767E5;  /* primary action, focus;  white on it 5.15:1 */
  --glow:       #4FC8F8;  /* decorative only: halo */
  --glow-wash:  #E6F6FE;  /* tint for the info chip; navy on it 15.77:1 */
  --steel:      #CFCDD9;  /* hairlines (decorative) */
  --steel-line: #7A768C;  /* input borders: 4.38:1 on white (>= 3:1 non-text) */
  --steel-wash: #F4F4F5;  /* Kbelík's bubble */
  --paper:      #FFFFFF;  /* page ground */
  --ink:        #0E080A;  /* body text 19.85:1 */
  --ink-soft:   #57433E;  /* secondary text 9.22:1 */
  --red:        #D04B27;  /* crisis bar - decorative edge only */
  --red-text:   #B83E1E;  /* crisis heading on --red-wash 4.81:1 */
  --red-wash:   #FBEAE5;

  --display: "Montserrat", "Segoe UI", Arial, sans-serif;
  --body:    "Source Sans 3", "Segoe UI", Arial, sans-serif;

  --c-tl: 18px;  --c-br: 64px;     /* cards */
  --c-tl-sm: 9px; --c-br-sm: 24px; /* bubbles, chips */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.55;
}
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); color: var(--navy); line-height: 1.15; text-wrap: balance; margin: 0 0 .4em; }
h1 { font-size: 1.5rem; }
a { color: var(--blue-mid); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, .exchange:focus-visible {
  outline: 3px solid var(--bubble); outline-offset: 3px;
  box-shadow: 0 0 0 8px rgba(79, 200, 248, .35);
}
.exchange:focus { outline: none; }
/* on the blue header the ring is white (12.98:1 against --blue) */
.top a:focus-visible, .top button:focus-visible { outline-color: #fff; box-shadow: none; }
.nw { white-space: nowrap; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inline { display: inline; margin: 0; }

/* header */
.top { background: var(--blue); color: #fff; }
.top__in { max-width: 1180px; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; gap: .9rem; }
.brand { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; min-height: 44px; }
.brand img { display: block; width: 48px; height: 48px; }
.brand__name { font-family: var(--display); font-weight: 700; font-size: 1.35rem; letter-spacing: -.01em; }
.brand__tag { display: block; font-size: .9rem; opacity: .92; line-height: 1.2; }
.top__acct { margin-left: auto; display: flex; align-items: center; gap: .6rem; font-size: .95rem; }
.top__acct b { font-family: var(--display); font-weight: 600; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .55rem 1.25rem; border: 0; border-radius: 999px; cursor: pointer;
  font-family: var(--display); font-weight: 700; font-size: .95rem; text-decoration: none;
  background: var(--bubble); color: #fff;
}
.btn[disabled] { opacity: .6; cursor: progress; }
.btn--ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.85); }

/* layout */
.wrap { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1rem 2.5rem; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2rem; align-items: start; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.exchange { display: flex; flex-direction: column; gap: 1.1rem; }
.exchange:empty { display: none; }
.msg { display: flex; gap: .75rem; align-items: flex-start; }
.msg__av { flex: 0 0 auto; width: 40px; height: 40px; }
.msg--me { justify-content: flex-end; }
.bubble { max-width: 46rem; min-width: 0; padding: .85rem 1.1rem; border-radius: var(--c-tl-sm) var(--c-br-sm) var(--c-br-sm) var(--c-br-sm); overflow-wrap: anywhere; }
.bubble--k { background: var(--steel-wash); border: 1px solid var(--steel); border-top-left-radius: 0; }
.bubble--me { background: var(--blue); color: #fff; border-radius: var(--c-br-sm) 0 var(--c-br-sm) var(--c-br-sm); white-space: pre-line; }
.bubble p { margin: 0 0 .6rem; }
.bubble p:last-child { margin-bottom: 0; }

/* answers */
.ans h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--navy); margin: 1.05rem 0 .35rem; }
.ans h3:first-of-type { margin-top: .6rem; }
.ans ol, .ans ul { margin: 0 0 .4rem; padding-left: 1.3rem; }
.ans li { margin-bottom: .35rem; }
.ans ol.places { padding-left: 1.4rem; }
.ans ol.places > li { margin-bottom: .2rem; }
.lead { font-weight: 700; color: var(--navy); }
.notice { color: var(--ink-soft); font-size: .95rem; border-left: 4px solid var(--glow); padding-left: .6rem; }
.note { font-style: italic; }
.closing { font-weight: 600; color: var(--navy); margin-top: .8rem !important; }
.copy { background: #fff; border: 1px dashed var(--steel-line); border-radius: var(--c-tl-sm) 0 var(--c-br-sm) 0; padding: .6rem .8rem; white-space: pre-line; }
.place { background: #fff; border: 1px solid var(--steel); border-radius: var(--c-tl-sm) 0 var(--c-br-sm) 0; padding: .7rem .9rem; margin: .2rem 0 .5rem; }
.place b { font-family: var(--display); font-weight: 600; color: var(--navy); }
.place span { display: block; color: var(--ink-soft); }
.gap { color: var(--ink-soft); font-style: italic; }
.src { margin-top: .9rem; padding-top: .6rem; border-top: 1px solid var(--steel); font-size: .92rem; color: var(--ink-soft); }
.src ul { margin: .2rem 0 0; padding-left: 1.1rem; }
.src li { margin-bottom: 0; }
.src a, .place a { display: inline-flex; align-items: center; min-height: 44px; }
.src details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--blue-mid); }
.fresh { margin-top: .4rem; font-size: .88rem; color: var(--ink-soft); }
.draft {
  display: inline-block; font-family: var(--display); font-weight: 700; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  background: var(--glow-wash); color: var(--navy); padding: .2rem .55rem; border-radius: 999px; margin-bottom: .5rem;
}
.next { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1rem; border-radius: 999px; border: 2px solid var(--blue); background: #fff; color: var(--blue);
  font-family: var(--display); font-weight: 600; font-size: .9rem; cursor: pointer; text-align: left; text-decoration: none; line-height: 1.25;
}
.chip--on { background: var(--blue); color: #fff; }
.chip--link { border-style: dashed; }

/* crisis */
.krize {
  background: var(--red-wash); border-left: 6px solid var(--red);
  border-radius: 0 var(--c-br-sm) var(--c-br-sm) 0; padding: .9rem 1.1rem;
}
.krize h2 { color: var(--red-text); font-size: 1.1rem; margin-bottom: .35rem; }
.krize p { margin: 0 0 .3rem; }
.krize .num { font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: var(--ink); white-space: nowrap; }
.krize h2 .num { color: var(--ink); }

/* composer */
.ask { border: 2px solid var(--steel-line); border-radius: var(--c-tl) 0 var(--c-br-sm) 0; padding: .75rem; background: #fff; }
.ask label { font-family: var(--display); font-weight: 600; color: var(--navy); display: block; margin-bottom: .35rem; }
.ask textarea {
  width: 100%; min-height: 88px; resize: vertical; border: 0; font: inherit; color: var(--ink); background: transparent; padding: .25rem;
}
.ask .hint { margin: 0 0 .5rem; }
.ask__bar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; border-top: 1px solid var(--steel); padding-top: .6rem; }
.left { font-size: .95rem; color: var(--ink-soft); flex: 1 1 16rem; }
.left b { color: var(--navy); }
.ask__bar .btn { margin-left: auto; }
.btn svg { width: 18px; height: 18px; }
.pending { margin: .5rem 0 0; color: var(--ink-soft); font-size: .95rem; }

/* aside */
.side { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.side:empty { display: none; }
.card { border: 1px solid var(--steel); border-radius: var(--c-tl) 0 var(--c-br) 0; padding: 1.1rem 1.2rem 1.4rem; background: #fff; }
.card--wash { background: var(--steel-wash); }
.card--page { max-width: 34rem; }
.card h2 { font-size: 1.15rem; }
.field { margin-bottom: .8rem; }
.field label { display: block; font-weight: 600; margin-bottom: .25rem; }
.field input { width: 100%; min-height: 44px; padding: .5rem .7rem; font: inherit; border: 2px solid var(--steel-line); border-radius: 10px; color: var(--ink); }
.hint { font-size: .9rem; color: var(--ink-soft); margin: .25rem 0 0; }
.errors { border-left: 4px solid var(--red); background: var(--red-wash); padding: .5rem .8rem; margin-bottom: .8rem; color: var(--red-text); font-weight: 600; }
.errors p { margin: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.tabs { display: flex; gap: .4rem; margin-bottom: .9rem; flex-wrap: wrap; }
.chip:hover { text-decoration: underline; }

.foot { background: var(--navy); color: #fff; }
.foot__in { max-width: 1180px; margin: 0 auto; padding: 1.1rem 1rem; font-size: .92rem; }

@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; }
  .brand__tag { display: none; }
}
@media (max-width: 560px) {
  .top__acct .lbl { display: none; }
  .msg__av { width: 32px; height: 32px; }
  .bubble { padding: .75rem .85rem; }
}

/* ── search increment: HLEDANI, „ověřte" links, copy, votes, history ─────────────────────────── */
.btn--light { background: #fff; color: var(--blue); box-shadow: inset 0 0 0 2px var(--blue); }
.btn--light:hover { text-decoration: underline; }
.src__date { color: var(--ink-soft); font-size: .88rem; }
.finds { list-style: none; padding-left: 0 !important; margin: 0 0 .4rem; }
.find { margin-bottom: .8rem !important; }
.find__case { font-weight: 700; color: var(--navy); margin: 0 0 .2rem !important; }
.find__q { margin: 0; background: #fff; border-left: 4px solid var(--bubble); border-radius: 0 var(--c-tl-sm) var(--c-tl-sm) 0; padding: .55rem .8rem; }
.find__q p { margin: 0; }
.find__src { font-size: .9rem; color: var(--ink-soft); margin: .25rem 0 0 !important; }
.find__src a { display: inline-flex; align-items: center; min-height: 44px; }
.find__date { font-weight: 600; color: var(--ink-soft); }
.fresh-links { margin: 0 0 .6rem; padding-left: 1.2rem; }
.fresh-links a { display: inline-flex; align-items: center; min-height: 44px; }
.copybar { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }
.copybtn svg { width: 20px; height: 20px; }
.copy__done { color: var(--ink-soft); font-size: .92rem; font-weight: 600; }
.copy__fallback { width: 100%; font: inherit; font-size: .9rem; border: 2px solid var(--steel-line); border-radius: 10px; padding: .4rem; }
.vote { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; padding-top: .6rem; border-top: 1px solid var(--steel); }
.vote__q { font-size: .95rem; color: var(--ink-soft); margin-right: .2rem; }
.vote__done { font-weight: 600; color: var(--navy); }
.vote .chip[disabled] { opacity: .55; cursor: default; }
.top__hist .short { display: none; }
.hist-page { max-width: none; }
.hist { list-style: none; margin: .8rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.hist__item { position: relative; border: 1px solid var(--steel); border-radius: var(--c-tl-sm) 0 var(--c-br-sm) 0; background: #fff; }
.hist__det > summary {
  list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: baseline; gap: .75rem;
  padding: .7rem 3.6rem .7rem .9rem; border-radius: var(--c-tl-sm) 0 var(--c-br-sm) 0;
}
.hist__det > summary::-webkit-details-marker { display: none; }
.hist__det > summary::before { content: "▸"; color: var(--blue-mid); flex: 0 0 auto; font-size: .95rem; }
.hist__det[open] > summary::before { content: "▾"; }
.hist__det[open] > summary { border-bottom: 1px solid var(--steel); }
.hist__date { flex: 0 0 auto; font-size: .9rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.hist__q { font-weight: 600; color: var(--navy); min-width: 0; overflow-wrap: anywhere; }
.hist__ans { padding: .8rem .9rem 1rem; }
.hist__ans .msg { gap: .6rem; }
.hist__del { position: absolute; top: 0; right: 0; margin: 0; }
.bin {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-width: 44px; min-height: 44px;
  margin: .1rem; padding: 0 .55rem; border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft); cursor: pointer;
  font-family: var(--display); font-weight: 700; font-size: .85rem;
}
.bin:hover, .bin.armed { color: var(--red-text); text-decoration: underline; }
.bin.armed { background: var(--red-wash); box-shadow: inset 0 0 0 2px var(--red-text); }
.bin__txt:empty { display: none; }
.hist__clear { margin: .4rem 0 0; }
.hist__clear .btn { background: #fff; color: var(--red-text); box-shadow: inset 0 0 0 2px var(--red-text); }
.hist__clear .btn:hover { text-decoration: underline; }
.hist__pages { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: 1rem; color: var(--ink-soft); }
@media (max-width: 560px) {
  .top__hist .long { display: none; }
  .top__hist .short { display: inline; }
  .top__hist { padding: .55rem .9rem; }
  .hist__det > summary { flex-wrap: wrap; row-gap: .1rem; }
}
/* a link inside a sentence stays inline (the text after it must not wrap to its own line); vertical
   padding keeps the tap area near 44 px without moving the layout */
.find__src a, .ans--hledani .src a { display: inline; padding: .6rem 0; }
.hist__plain { white-space: pre-line; }
/* 0 AI answers left: the Send button turns grey but stays a working submit button (crisis help and
   prepared guides still go through); --ink-soft on --steel = 5.88:1 (test/refusal.test.js measures it) */
.btn.btn--spent { background: var(--steel); color: var(--ink-soft); }
.reset { flex: 1 1 100%; order: 3; font-size: .9rem; color: var(--ink-soft); }
/* rated vote: pressed state shown by the ✓ mark and the filled chip (not colour alone) */
.vote__btn[aria-pressed="true"] { font-weight: 700; }
.vote--hist { margin: 0 .9rem .9rem; }
/* sticky footer: at the bottom of the viewport on short pages, below the content on long ones */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body > .top, body > .foot { flex: 0 0 auto; }
body > main.wrap { flex: 1 0 auto; width: 100%; align-content: start; } /* rows stay packed at the top */
.vote__mark:not(:empty) { margin-right: .3em; }

/* ── public board „Ostatní se ptají" (Z2): header link, board, thread, publication line, history state ── */
.top__pub .short { display: none; }
.pub-page { max-width: none; }
.pub__notice { margin: .2rem 0 1rem; }
.pub__search label { font-family: var(--display); font-weight: 600; color: var(--navy); display: block; margin-bottom: .35rem; }
.pub__bar { display: flex; gap: .5rem; flex-wrap: wrap; }
.pub__bar input { flex: 1 1 14rem; min-width: 0; min-height: 44px; padding: .5rem .7rem; font: inherit; border: 2px solid var(--steel-line); border-radius: 10px; color: var(--ink); }
.pub__for { margin: 1rem 0 0; color: var(--ink-soft); }
.pub__for b { color: var(--navy); }
.pub__none { margin-top: 1rem; }
.pub { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.pub__item { border: 1px solid var(--steel); border-radius: var(--c-tl-sm) 0 var(--c-br-sm) 0; background: #fff; padding: .55rem .9rem .6rem; }
.pub__q { display: block; font-weight: 600; color: var(--navy); text-decoration: none; padding: .15rem 0; overflow-wrap: anywhere; min-height: 28px; }
.pub__q:hover { text-decoration: underline; color: var(--blue-mid); }
.pub__meta { display: block; font-size: .9rem; color: var(--ink-soft); }
.pub__turn { display: flex; flex-direction: column; gap: .6rem; padding-top: .4rem; border-top: 1px solid var(--steel); }
.pub__day { margin: 0; font-size: .9rem; color: var(--ink-soft); text-align: right; }
.pub__valid { margin: 0 0 0 52px; font-size: .92rem; color: var(--ink-soft); font-style: italic; }
.pubvote { margin: 0 0 0 52px; }
.pubvote__n { font-weight: 600; color: var(--navy); margin-right: .4rem; }
.pub__more .ask { margin-top: .4rem; }
.publine { margin: 0 0 0 52px; font-size: .95rem; color: var(--ink-soft); border-left: 4px solid var(--steel); padding-left: .6rem; }
.publine--on { border-left-color: var(--glow); }
.publine a { display: inline-block; padding: .55rem .2rem; font-weight: 600; }
.ask__public { margin: 0 0 .5rem; }
.hist__pub { flex: 0 0 auto; margin-left: auto; font-size: .82rem; font-family: var(--display); font-weight: 600; letter-spacing: .02em; color: var(--ink-soft); background: var(--steel-wash); border: 1px solid var(--steel); border-radius: 999px; padding: .1rem .6rem; white-space: nowrap; }
.hist__pub--on { color: var(--navy); background: var(--glow-wash); border-color: var(--glow); text-decoration: none; }
.hist__pub--on:hover { text-decoration: underline; }
.choice { margin: 1rem 0 0; }
.choice .hint { margin-top: .35rem; }
@media (max-width: 820px) {
  .top__acct .lbl { display: none; }
  .top__pub .long, .top__hist .long { display: none; }
  .top__pub .short, .top__hist .short { display: inline; }
  .top__acct { gap: .4rem; }
  .top__acct .btn { padding: .55rem .85rem; }
}
@media (max-width: 560px) {
  .pub__valid, .pubvote, .publine { margin-left: 0; }
  .top__name { display: none; }
}

/* ── account required (Z2 round 3): welcome page, support address ──────────────────────────────── */
.welcome { max-width: 46rem; }
.welcome__head { display: flex; align-items: center; gap: 1rem; margin-bottom: .6rem; }
.welcome__head h1 { margin: 0; font-size: 1.75rem; }
.welcome__av { width: 72px; height: 72px; flex: 0 0 auto; }
.welcome .lead { font-size: 1.1rem; }
.welcome__btns { margin: 1rem 0 .4rem; }
.support a, .errors__sup a { display: inline-block; padding: .5rem 0; font-weight: 600; }
.errors__sup { font-weight: 400; color: var(--ink); margin-top: .4rem !important; }
.foot__sup { white-space: nowrap; }
.foot__sup a { color: #fff; display: inline-block; padding: .5rem 0; }
.foot a:focus-visible { outline-color: #fff; box-shadow: none; }
.side .krize { margin: 0; }
/* round 4: the welcome card spans the column like the crisis box under it (coordinator, 1400 px render) */
.welcome { max-width: none; }
.notice--repeat { border-left-color: var(--bubble); }
