/* ==========================================================================
   Metatron — AI automatizacija poslovanja
   Dizajn: plavo-bijeli editorial — bijela podloga, duboka navy tinta,
   kobaltni akcent, serifni display (Fraunces) + Hanken Grotesk.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --ice: #f2f6fb;          /* tint sekcije, AI oblačići */
  --ice-2: #e9f0f8;
  --card: #ffffff;
  --ink: #0d2742;          /* naslovi — duboka navy */
  --text: #32495f;
  --muted: #64788d;
  --muted-dark: #92a9c2;   /* sekundarni tekst na tamnom */
  --line: #d9e3ee;
  --line-soft: #e7eef6;
  --blue: #1a5cd8;         /* primarni akcent — kobalt */
  --blue-deep: #12448f;
  --blue-soft: #e3edfb;
  --sky: #8ab8f5;          /* akcent na tamnom */
  --navy: #0c2036;         /* tamne sekcije */
  --navy-2: #091829;       /* footer */
  --danger: #c23f4f;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(13, 39, 66, .05), 0 10px 28px rgba(13, 39, 66, .07);
  --shadow-deep: 0 30px 90px rgba(13, 39, 66, .18);
  --font: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --wrap: 1180px;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; color: var(--ink); }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }
h3, h4 { letter-spacing: -.015em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.ico { flex: none; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--blue); margin-bottom: 16px;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: currentColor; border-radius: 2px; }
.eyebrow--center { justify-content: center; }
.eyebrow--center::after { content: ""; width: 26px; height: 2px; background: currentColor; border-radius: 2px; }
.eyebrow--light { color: var(--sky); }

/* Naglašeni dio naslova — serifni kurziv u kobaltu */
.accent { display: block; font-style: italic; font-weight: 500; color: var(--blue); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-weight: 700; font-size: 16px; line-height: 1;
  padding: 14px 22px; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: background-color .2s, border-color .2s, color .2s, transform .2s, box-shadow .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--blue); color: #fff; box-shadow: 0 10px 24px rgba(26, 92, 216, .3); }
.btn--primary:hover { background: var(--blue-deep); }
.btn--ghost { color: var(--ink); border-color: var(--ink); background: transparent; }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--lg { padding: 17px 28px; font-size: 17px; }
.btn--sm { padding: 10px 18px; font-size: 15px; box-shadow: none; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .7; cursor: progress; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar__in { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand__mark { display: block; flex: none; color: var(--ink); }
.logo-mark { display: block; height: 40px; width: auto; }
.brand__name { display: flex; flex-direction: column; font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.1; }
.brand__name small { font-family: var(--font); font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: .02em; margin-top: 2px; }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a:not(.btn) { color: var(--text); font-size: 15px; font-weight: 600; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.nav a:not(.btn):hover { color: var(--blue); border-color: var(--blue); }
.nav-toggle { display: none; }

/* ---------- Hero: centrirano, demo ispod ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1000px 520px at 50% -18%, var(--ice-2) 0%, transparent 65%),
    var(--bg);
  padding: 56px 0 80px;
}
/* Tekst lijevo, živi razgovor desno */
.hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(38px, 4.3vw, 58px); }
.hero__lead { margin-top: 24px; font-size: 19px; line-height: 1.65; max-width: 540px; color: var(--muted); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero__cta .btn--lg { padding: 16px 22px; font-size: 16px; }   /* oba gumba u istom redu uz chat desno */
@media (max-width: 1240px) { .hero__cta .btn--lg { padding: 15px 18px; font-size: 15.5px; gap: 8px; } }
.hero__demo { position: relative; min-width: 0; }
.hero__demo .chat__body { max-height: 650px; overflow-y: auto; scrollbar-width: thin; }   /* cijeli primjer vidljiv odmah, do zadnje poruke asistenta */
.hero__note { margin-top: 14px; text-align: center; font-size: 12.5px; color: var(--muted); }

/* ---------- Chat (hero + praksa) ---------- */
.chat {
  background: var(--card); color: var(--text); border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-deep);
  overflow: hidden;
}
.chat__bar {
  display: flex; align-items: center; gap: 7px; padding: 14px 18px;
  background: var(--ice); border-bottom: 1px solid var(--line-soft);
}
.chat__bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.chat__title { margin-left: 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.chat__title .ico { color: var(--blue); }
.chat__body { display: flex; flex-direction: column; gap: 14px; padding: 22px 20px; }

.msg { max-width: 88%; font-size: 15px; line-height: 1.5; }
.msg__who { display: block; font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.msg__text { padding: 12px 15px; border-radius: 16px; }
.msg--user { align-self: flex-end; }
.msg--user .msg__who { text-align: right; }
.msg--user .msg__text { background: var(--blue); color: #fff; border-bottom-right-radius: 5px; }
.msg--ai .msg__text { background: var(--ice); border: 1px solid var(--line-soft); border-bottom-left-radius: 5px; }
.msg--ai .msg__who { color: var(--blue); }
.msg--action { align-self: center; max-width: 94%; text-align: center; }
.msg--action .msg__who { color: var(--blue-deep); }
.msg--action .msg__text {
  background: var(--blue-soft); color: var(--blue-deep); border: 1px dashed var(--sky);
  font-weight: 500; font-size: 14.5px;
}
.msg__list { margin-top: 8px; border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; background: var(--card); }
.msg__list li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: baseline; padding: 9px 14px; font-size: 14px; }
.msg__list li + li { border-top: 1px solid var(--line-soft); }
.msg__list b { color: var(--ink); }
.msg__list em { font-style: normal; font-size: 12.5px; color: var(--muted); min-width: 82px; text-align: right; }
.msg__more { font-size: 13px; color: var(--muted); padding: 7px 4px 0; }
.msg__btn {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 10px;
  padding: 9px 16px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 14px; font-weight: 700;
}

/* Animacija ulaska poruka (samo transform + opacity) */
.js [data-animate-chat] .msg { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.js [data-animate-chat] .msg.is-in { opacity: 1; transform: none; }

/* ---------- Načela: traka s razdjelnicima ---------- */
.principles { background: var(--ice); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 56px 0; }
.principles__grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.principle { padding: 0 36px; }
.principle:first-child { padding-left: 0; }
.principle + .principle { border-left: 1px solid var(--line); }
.principle__ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); margin-bottom: 16px; }
.principle h3 { font-size: 17px; margin-bottom: 8px; }
.principle p { font-size: 15px; line-height: 1.55; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 110px 0; }
.section--tint { background: var(--ice); }
.section__head { max-width: 760px; margin-bottom: 52px; }
.section__head--center { margin-left: auto; margin-right: auto; text-align: center; }
.section h2, .flow-band h2 { font-size: clamp(32px, 3.8vw, 46px); }
.section__lead { margin-top: 18px; font-size: 18.5px; color: var(--muted); }

/* ---------- Usluge: vertikalna navigacija + panel ---------- */
.svc { display: grid; grid-template-columns: 330px 1fr; gap: 48px; align-items: start; }
.svc-nav { position: sticky; top: 96px; display: grid; gap: 6px; }
.svc-tab {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  text-align: left; font: inherit; color: var(--text); cursor: pointer;
  padding: 15px 18px; background: transparent; border: 1px solid transparent; border-radius: var(--radius);
  transition: background-color .2s, border-color .2s, color .2s;
}
.svc-tab:hover { background: var(--ice); }
.svc-tab:focus-visible { outline: 3px solid rgba(26, 92, 216, .4); outline-offset: 2px; }
.svc-tab__num { font-family: var(--font-display); font-style: italic; font-size: 17px; font-weight: 500; color: var(--muted-dark); transition: color .2s; }
.svc-tab__title { font-weight: 700; font-size: 15.5px; line-height: 1.3; }
.svc-tab__arrow { color: var(--blue); opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .2s; }
.svc-tab.is-active { background: var(--blue-soft); border-color: var(--blue); color: var(--ink); }
.svc-tab.is-active .svc-tab__num { color: var(--blue); }
.svc-tab.is-active .svc-tab__arrow { opacity: 1; transform: none; }

.svc-panel {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 28px 44px;
  transition: grid-template-columns .45s cubic-bezier(.2, .7, .2, 1);
  padding: 40px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.svc-panel + .svc-panel { margin-top: 26px; }
.js .svc-panel:not(.is-active) { display: none; }
.js .svc-panel + .svc-panel { margin-top: 0; }
.js .svc-panel.is-active { animation: panelIn .35s ease both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.svc-panel__head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.svc-panel__ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--blue); color: #fff; flex: none; }
.svc-panel h3 { font-family: var(--font-display); font-weight: 600; font-size: 26px; }
.svc-panel__short { margin-top: 4px; font-size: 14.5px; color: var(--muted); }
.svc-panel__lead { font-size: 17px; color: var(--text); line-height: 1.7; }

.ticks { display: grid; gap: 10px; margin-top: 22px; }
.ticks li { display: flex; gap: 11px; align-items: flex-start; font-size: 16px; line-height: 1.5; }
.ticks .ico { color: var(--blue); margin-top: 2px; }
.ticks--light li { color: #d9e4f1; }
.ticks--light .ico { color: var(--sky); }

.control {
  display: flex; gap: 11px; align-items: flex-start; margin-top: 26px; padding: 14px 16px;
  background: var(--blue-soft); border-radius: 12px; font-size: 15px; line-height: 1.5; color: var(--blue-deep);
}
.control .ico { color: var(--blue); margin-top: 2px; }

/* Chat uz rutinu u fokusu: desna strana se glatko širi na ~60 % (tranzicija stupaca grida; tekst se prelama, pa transform/scale ne dolazi u obzir) */
.svc-panel.is-chat-wide { grid-template-columns: minmax(0, 0.68fr) minmax(0, 1fr); }
/* Primjer ispod opisa — zadani raspored rutina (content/services.php → layout; 'side' = primjer desno): jedan stupac, chat se ne širi */
.svc-panel--stack, .svc-panel--stack.is-chat-wide { grid-template-columns: minmax(0, 1fr); }
.svc-panel--stack .practice__shrink { display: none; }
.practice__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.practice__shrink {
  display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--muted); cursor: pointer;
}
.practice__shrink:hover { color: var(--blue); border-color: var(--blue); }

.practice { height: 100%; padding: 24px; background: var(--ice); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.practice__label, .prompts__label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--blue);
}
.practice__label::before, .prompts__label::before { content: ""; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
.practice h4 { font-family: var(--font-display); font-weight: 600; font-size: 20px; margin: 8px 0 18px; }
.practice__chat { display: flex; flex-direction: column; gap: 12px; }
.practice__how { display: grid; gap: 10px; counter-reset: how; }
.practice__how li { counter-increment: how; display: flex; align-items: flex-start; gap: 12px; font-size: 15.5px; line-height: 1.5; color: var(--text); }
.practice__how li::before {
  content: counter(how); flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-top: -1px;
  border-radius: 50%; background: var(--blue); color: #fff; font-size: 13px; font-weight: 700;
}
.practice .msg { max-width: 94%; }
.practice .msg--ai .msg__text { background: var(--card); }

.svc-panel__prompts { grid-column: 1 / -1; padding-top: 26px; border-top: 1px solid var(--line-soft); }

/* Listanje rutina na dnu panela (index.php → svc-pager, assets/js/main.js): lijevo kratko „Prethodna rutina", desno
   naziv sljedeće u JEDNOM retku s „…" (puni naziv u title) — obje kartice uvijek u istom redu, i na mobitelu */
.svc-pager { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: stretch; gap: 10px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.svc-pager__link {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card); color: var(--ink); font-weight: 700; font-size: 14px; line-height: 1.35;
  transition: border-color .15s, color .15s;
}
.svc-pager__link > span { min-width: 0; }
.svc-pager__link small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.svc-pager__link b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-pager__link .ico { flex: none; color: var(--blue); }
.svc-pager__link--prev { flex: none; white-space: nowrap; }
.svc-pager__link--prev .ico { transform: rotate(180deg); }
.svc-pager__link--next { flex: 0 1 auto; margin-left: auto; text-align: right; }
.svc-pager__link:hover { border-color: var(--blue); color: var(--blue); }
@media (max-width: 640px) { .svc-pager__link { padding: 9px 12px; font-size: 13.5px; } }
.prompts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.prompts li {
  padding: 9px 16px; border-radius: 999px; background: var(--ice); border: 1px solid var(--line); color: var(--blue-deep);
  font-size: 14.5px; font-weight: 500; line-height: 1.4; font-style: italic;
}

/* ---------- Primjer: tamna traka s vremenskom crtom ---------- */
.flow-band { padding: 110px 0; background: radial-gradient(900px 480px at 50% -16%, #16395f 0%, transparent 62%), var(--navy); }
.flow-band h2 { color: #fff; }
.flow { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 36px; margin-top: 10px; }
.flow::before {
  content: ""; position: absolute; top: 25px; left: 26px; right: 26px; height: 2px;
  background: rgba(138, 184, 245, .25);
}
.flow__step { position: relative; }
.flow__num {
  position: relative; z-index: 1;
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--navy); border: 2px solid var(--sky); color: var(--sky);
  font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 22px;
}
.flow__label { margin: 18px 0 8px; font-weight: 700; color: #fff; font-size: 17px; }
.flow__text { font-size: 15px; color: var(--muted-dark); line-height: 1.6; }
.flow__step--final .flow__num { background: var(--blue); border-color: var(--blue); color: #fff; }
.flow__step--final .flow__label { color: var(--sky); }

/* ---------- Suradnja: sticky uvod + vertikalni timeline ---------- */
.process { display: grid; grid-template-columns: 1fr 1.05fr; gap: 72px; align-items: start; }
.process__intro { position: sticky; top: 110px; }
.process__intro .btn { margin-top: 32px; }
.process__note { margin-top: 28px; padding-left: 16px; border-left: 3px solid var(--blue); color: var(--muted); font-size: 15.5px; }
.steps { position: relative; display: grid; gap: 36px; }
.steps::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 23px; width: 2px; background: var(--line); }
.steps li { position: relative; display: flex; gap: 24px; }
.steps__num {
  position: relative; z-index: 1; flex: none;
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--blue); color: var(--blue);
  font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 21px;
}
.steps h3 { font-size: 19px; margin: 10px 0 6px; }
.steps p { color: var(--muted); font-size: 15.5px; }

/* ---------- FAQ: dvije kolone ---------- */
.faq { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.faq__item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.faq__item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 20px 22px; cursor: pointer; list-style: none; font-weight: 700; font-size: 16.5px; color: var(--ink);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__plus { position: relative; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--blue-soft); }
.faq__plus::before, .faq__plus::after { content: ""; position: absolute; left: 6px; right: 6px; top: 10px; height: 2px; background: var(--blue); border-radius: 2px; transition: transform .25s; }
.faq__plus::after { transform: rotate(90deg); }
.faq__item[open] .faq__plus::after { transform: rotate(0deg); }
.faq__item p { padding: 0 22px 20px; color: var(--muted); font-size: 15.5px; }

/* ---------- CTA + forma ---------- */
.cta {
  padding: 110px 0;
  background: radial-gradient(900px 500px at 8% 0%, #16395f 0%, transparent 60%), var(--navy);
  color: #c3d2e2;
}
.cta__in { display: grid; grid-template-columns: 1fr 1.05fr; gap: 72px; align-items: start; }
.cta h2 { color: #fff; font-size: clamp(32px, 3.8vw, 46px); }
.cta__copy > p { margin-top: 18px; font-size: 18px; color: var(--muted-dark); }
.cta__copy .ticks { margin-top: 28px; }
.cta__direct { display: grid; gap: 10px; margin-top: 40px; padding-top: 28px; border-top: 1px solid rgba(255, 255, 255, .12); }
.cta__direct p { color: #fff; font-weight: 700; }
.cta__direct a { display: inline-flex; align-items: center; gap: 10px; color: #cfdded; font-size: 17px; width: fit-content; }
.cta__direct a:hover { color: #fff; }
.cta__direct .ico { color: var(--sky); }
.cta__direct small { color: var(--muted-dark); font-size: 14px; }

.form {
  display: grid; gap: 18px; padding: 36px; background: var(--card); color: var(--text);
  border-radius: var(--radius-lg); box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
}
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 7px; min-width: 0; border: 0; margin: 0; padding: 0; }
.field > span, .field legend { font-size: 14.5px; font-weight: 700; color: var(--ink); padding: 0; }
.field i { font-style: normal; color: var(--danger); }
.field legend small { font-weight: 400; color: var(--muted); }
.field__hint { font-size: 13.5px; color: var(--muted); margin-top: -3px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--text);
  padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 104px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(26, 92, 216, .14); }
.field .is-invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(194, 63, 79, .12); }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 4px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; line-height: 1.4; cursor: pointer; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line-soft); transition: border-color .2s, background-color .2s; }
.check:hover { border-color: var(--blue); }
.check input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--blue); flex: none; }
.check:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__legal { font-size: 13px; color: var(--muted); text-align: center; }
.form__status { display: flex; gap: 12px; align-items: flex-start; padding: 15px 16px; border-radius: 12px; font-size: 15px; line-height: 1.5; }
.form__status--success { background: var(--blue-soft); color: var(--blue-deep); border-left: 4px solid var(--blue); }
.form__status--success .ico { color: var(--blue); }
.form__status--error { background: #f9e5e6; color: #7e2531; border-left: 4px solid var(--danger); }
.form__status--error .ico { color: var(--danger); }
.form.is-sent .form__row, .form.is-sent > .field, .form.is-sent > button, .form.is-sent .form__legal { display: none; }

/* ---------- Živi alat u rutini (npr. Scanio) ---------- */
.live {
  margin-top: 22px; padding: 20px 22px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--navy) 0%, #16395f 100%); color: #c9d7e6;
}
.live__label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--sky); }
.live__dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 0 4px rgba(61, 220, 151, .2); }
.live h4 { margin: 10px 0 8px; color: #fff; font-size: 19px; line-height: 1.3; }
.live p:not(.live__label) { font-size: 15px; line-height: 1.55; }
.live .btn { margin-top: 16px; }
.live .btn .ico:last-child { opacity: .8; }

/* ---------- Prijedlozi pitanja ispod chata ---------- */
.ai-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.ai-suggest span { font-weight: 700; }
.ai-suggest button {
  font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); color: var(--blue-deep); transition: border-color .2s, background-color .2s;
}
.ai-suggest button:hover { border-color: var(--blue); background: var(--blue-soft); }

/* ---------- Graf u chatu (assets/js/chart.js, Apache ECharts) ---------- */
.ai-chart { margin-top: 8px; padding: 12px 12px 10px; background: var(--card); border: 1px solid var(--line-soft); border-radius: 12px; }
.ai-chart__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ai-chart__title { font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 1.35; }
.ai-chart__tools { flex: none; display: flex; align-items: center; gap: 6px; }
.ai-chart__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 26px; font: inherit; font-size: 12px; font-weight: 600; padding: 3px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer;
  transition: color .2s, border-color .2s, background-color .2s;
}
.ai-chart__btn:hover { color: var(--blue); border-color: var(--blue); background: var(--blue-soft); }
.ai-chart__btn:focus-visible { outline: 3px solid rgba(26, 92, 216, .4); outline-offset: 2px; }
.ai-chart__btn--icon { width: 28px; padding: 0; border-radius: 8px; }
.ai-chart__btn--primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.ai-chart__btn--primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }
.ai-chart__btn:disabled { opacity: .6; cursor: progress; }
.ai-chart__plot { position: relative; height: 280px; margin-top: 8px; }
.ai-chart__note { margin-top: 6px; font-size: 11px; color: var(--muted); line-height: 1.4; }
.ai-chart__table { margin-top: 8px; max-height: 260px; overflow: auto; border-top: 1px solid var(--line-soft); }
.ai-chart__table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ai-chart__table th { position: sticky; top: 0; background: var(--card); text-align: left; padding: 6px 6px; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); }
.ai-chart__table td { padding: 4px 6px; border-bottom: 1px solid var(--line-soft); }
.ai-chart__table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.msg .ai-chart { max-width: 100%; }
.msg--ai:has(.ai-chart) { max-width: 100%; width: 100%; }
.ai-chart--big { padding: 16px 18px 12px; border-color: var(--line); }
.ai-chart--big .ai-chart__title { font-size: 16px; }
.ai-chart--big .ai-chart__plot { height: min(58vh, 520px); min-height: 300px; }
.ai-chart--big .ai-chart__note { font-size: 12px; }
.ai-chart--big .ai-chart__btn { min-height: 30px; font-size: 13px; padding: 4px 12px; }
.ai-chart--big.has-table .ai-chart__plot { height: min(38vh, 360px); min-height: 240px; }
.ai-chart--big .ai-chart__table { max-height: none; overflow: visible; margin-top: 12px; }
.ai-chart--big .ai-chart__table table { font-size: 13px; }

/* ---------- PDF dokument u chatu (assets/js/doc.js, pdfmake) ---------- */
.ai-doc { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 8px; padding: 12px; background: var(--card); border: 1px solid var(--line-soft); border-radius: 12px; }
.ai-doc__ico { flex: none; display: grid; place-items: center; width: 44px; height: 52px; border-radius: 6px 14px 6px 6px; background: var(--blue-soft); color: var(--blue); }
.ai-doc__info { flex: 1 1 160px; min-width: 0; }
.ai-doc__title { font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 1.35; overflow-wrap: anywhere; }
.ai-doc__meta { margin-top: 2px; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.ai-doc__tools { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.ai-doc__err { flex-basis: 100%; font-size: 12px; color: var(--danger); }
.msg--ai:has(.ai-doc) { max-width: 100%; width: 100%; }
.ai-doc--big { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; padding: 0; border-color: var(--line); overflow: hidden; }
.ai-doc__head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.ai-doc--big .ai-doc__ico { width: 38px; height: 44px; }
.ai-doc--big .ai-chart__btn { min-height: 30px; font-size: 13px; padding: 4px 12px; }
.ai-doc__frame { position: relative; height: min(72vh, 860px); min-height: 360px; background: #e9eef4; }
.ai-doc__frame--wide { height: min(62vh, 640px); }
.ai-doc__frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.ai-doc__wait { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: var(--muted); }
.ai-doc__alt { display: grid; place-items: center; align-content: center; gap: 14px; height: 100%; padding: 20px; text-align: center; font-size: 14px; }

/* ---------- Veliki prikaz grafa (popup): glava i podnožje fiksni, skrola samo sadržaj ---------- */
.has-modal { overflow: hidden; }
.chart-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; }
.chart-modal__shadow { position: absolute; inset: 0; background: rgba(9, 24, 41, .55); backdrop-filter: blur(3px); }
.chart-modal__box {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  width: min(1120px, 100%); max-height: min(920px, calc(100vh - 48px));
  background: var(--card); border-radius: var(--radius-lg); box-shadow: 0 40px 120px rgba(9, 24, 41, .35);
}
.chart-modal.is-in .chart-modal__shadow { animation: modalFade .25s ease both; }
.chart-modal.is-in .chart-modal__box { animation: modalIn .32s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes modalFade { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.chart-modal__head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px 14px 22px; background: var(--ice); border-bottom: 1px solid var(--line-soft);
}
.chart-modal__head h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: 0; }
.chart-modal__head h3 .ico { color: var(--blue); }
.chart-modal__head h3 span { display: inline-flex; align-items: center; gap: 8px; }
.chart-modal__close { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.chart-modal__close:hover { background: var(--ice-2); color: var(--ink); }
.chart-modal__body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; }
.chart-modal__body .msg { max-width: 82%; }
.chart-modal__body .ai-chart { margin-top: 0; }
.chart-modal__prev { font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.chart-modal__foot { flex: none; padding: 12px 22px 16px; border-top: 1px solid var(--line-soft); }

/* Dokument: podijeljeni prikaz — lijevo PDF po cijeloj visini, desno razgovor i polje za nastavak */
.chart-modal--doc { padding: 16px; }
.chart-modal--doc .chart-modal__box {
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 30vw, 420px); grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1560px, 100%); height: calc(100vh - 32px); max-height: none;
}
.chart-modal--doc .chart-modal__head { grid-column: 1 / -1; }
.chart-modal--doc .chart-modal__body { grid-column: 1; grid-row: 2 / 4; padding: 0; overflow: hidden; display: flex; }
.chart-modal--doc .chart-modal__thread { grid-column: 2; grid-row: 2; }
.chart-modal--doc .chart-modal__foot { grid-column: 2; grid-row: 3; border-left: 1px solid var(--line-soft); padding: 12px 16px 14px; }
.chart-modal--doc .ai-doc--big { flex: 1 1 auto; margin: 0; border: 0; border-radius: 0; min-height: 0; }
.chart-modal--doc .ai-doc__frame { flex: 1 1 auto; height: auto; min-height: 0; }
.chart-modal__thread {
  min-height: 0; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px;
  padding: 16px; background: var(--ice); border-left: 1px solid var(--line-soft);
}
.chart-modal__thread .msg { max-width: 94%; font-size: 14.5px; }
.chart-modal__thread .msg--action { max-width: 100%; }
.chart-modal__docref {
  display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 8px; padding: 8px 10px; text-align: left;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--blue-deep); background: #fff; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.chart-modal__docref .ico { color: var(--blue); }
.chart-modal__docref:hover { border-color: var(--blue); background: var(--blue-soft); }
.chart-modal__docref.is-active { border-color: var(--blue); box-shadow: inset 3px 0 0 var(--blue); }
@media (max-width: 860px) {
  .chart-modal--doc { padding: 0; }
  .chart-modal--doc .chart-modal__box { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto; height: 100%; border-radius: 0; }
  .chart-modal--doc .chart-modal__body { grid-row: 2; }
  .chart-modal--doc .chart-modal__thread { grid-column: 1; grid-row: 3; max-height: 30vh; border-left: 0; border-top: 1px solid var(--line-soft); }
  .chart-modal--doc .chart-modal__foot { grid-column: 1; grid-row: 4; border-left: 0; }
}
/* ---------- Pravna stranica (politika privatnosti) ---------- */
.legal { padding: 64px 0 96px; background: radial-gradient(900px 420px at 50% -20%, var(--ice-2) 0%, transparent 65%), var(--bg); }
.legal__in { max-width: 780px; }
.legal h1 { font-size: clamp(34px, 4vw, 48px); }
.legal__date { margin-top: 10px; font-size: 14px; color: var(--muted); }
.legal__intro { margin-top: 22px; font-size: 18px; line-height: 1.65; color: var(--text); }
.legal__toc { margin: 32px 0 8px; padding: 20px 24px; background: var(--ice); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.legal__toc ol { list-style: decimal; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; }
.legal__sec { margin-top: 40px; scroll-margin-top: 96px; }
.legal__sec h2 { font-size: 24px; margin-bottom: 14px; }
.legal__sec h2 span { color: var(--blue); font-style: italic; }
.legal__sec p, .legal__sec li { font-size: 16.5px; line-height: 1.7; }
.legal__sec p + p, .legal__sec ul + p, .legal__sec p + ul { margin-top: 12px; }
.legal__sec ul { list-style: disc; padding-left: 22px; display: grid; gap: 6px; }
.legal__back { margin-top: 48px; }

/* ---------- Footer ---------- */
.footer { background: var(--navy-2); color: var(--muted-dark); padding: 64px 0 0; font-size: 15px; }
.footer a { color: #c3d2e2; }
.footer a:hover { color: #fff; }
.footer .brand { color: #fff; }
.footer .brand__name small { color: var(--muted-dark); }
.brand--footer .brand__mark { color: #fff; }
.brand--footer .logo-mark { height: 36px; }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1.3fr 1.1fr; gap: 40px; }
.footer__lead { margin-top: 18px; max-width: 340px; font-size: 14.5px; line-height: 1.6; }
.footer__company { margin-top: 18px; font-style: normal; font-size: 14px; line-height: 1.6; }
.footer__company b { color: #e3ebf4; font-weight: 700; }
.footer__h { font-family: var(--font); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--sky); margin-bottom: 16px; }
.footer__col ul { display: grid; gap: 10px; font-size: 14.5px; line-height: 1.4; }
.footer__col a { display: inline-flex; align-items: center; gap: 8px; }
.footer__col .ico { color: var(--sky); }
.footer__muted { color: var(--muted-dark); }
.footer__bottom {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-top: 48px; padding-top: 22px; padding-bottom: 96px;
  border-top: 1px solid rgba(255, 255, 255, .08); font-size: 13px;
}
.footer__bottom p:first-child { margin-right: auto; }

/* ---------- AI asistent: polje za unos (hero, uz primjere, plutajući) ---------- */
.chat__foot { padding: 0 20px 18px; }
.ai-input {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; column-gap: 6px;
  padding: 6px 6px 6px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  transition: border-color .2s, box-shadow .2s;
}
.ai-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(26, 92, 216, .12); }
.ai-input textarea {
  min-width: 0; resize: none; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 15px; line-height: 1.45; color: var(--ink); padding: 8px 0; max-height: 160px;
}
.ai-input textarea::placeholder { color: var(--muted); }
.ai-input__btn {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 0; cursor: pointer; transition: background-color .2s, color .2s, transform .2s;
}
.ai-input__btn:active { transform: scale(.95); }
.ai-input__btn:focus-visible { outline: 3px solid rgba(26, 92, 216, .4); outline-offset: 2px; }
.ai-input__mic { background: var(--blue-soft); color: var(--blue); }
.ai-input__mic:hover { background: var(--ice-2); }
.ai-input__mic .ico + .ico { display: none; }                         /* stop ikona samo dok snima */
.ai-input.is-rec .ai-input__mic { background: var(--danger); color: #fff; animation: recPulse 1.4s ease-in-out infinite; }
.ai-input.is-rec .ai-input__mic .ico:first-child { display: none; }
.ai-input.is-rec .ai-input__mic .ico + .ico { display: block; }
.ai-input.is-stt .ai-input__mic { opacity: .5; cursor: progress; }
@keyframes recPulse { 50% { box-shadow: 0 0 0 6px rgba(194, 63, 79, .18); } }
.ai-input__send { background: var(--blue); color: #fff; }
.ai-input__send:hover { background: var(--blue-deep); }
.ai-input.is-busy .ai-input__send { opacity: .55; cursor: progress; }
.ai-input__status { grid-column: 1 / -1; margin: 2px 0 4px; padding-right: 10px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.ai-input__status.is-rec { color: var(--danger); font-weight: 600; }
.ai-input__status.is-ok { color: var(--blue-deep); }
.ai-input__status.is-warn, .ai-input__status.is-error { color: #7e2531; }
.practice .ai-input { margin-top: 18px; }
.ai-input--nomic { grid-template-columns: minmax(0, 1fr) auto; }

/* ---------- Glasovni prečaci: opis tipki u primjeru (assets/js/voice.js) ---------- */
.voice { margin-top: 18px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.voice__intro { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.voice__keys { display: grid; gap: 8px; margin-top: 10px; }
.voice__key { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.voice__combo { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.voice__combo i { font-style: normal; }
.keys { display: inline-flex; align-items: center; gap: 4px; margin: 0 1px; vertical-align: 1px; white-space: nowrap; }
.keys i { font-style: normal; font-size: 13px; color: var(--muted); }
.keys kbd { min-width: 26px; padding: 0 7px; font-size: 12.5px; }
kbd {
  display: inline-grid; place-items: center; min-width: 30px; padding: 2px 8px; font: 700 13px/1.5 var(--font); color: var(--ink);
  background: var(--ice); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px;
}
.voice__label { flex: 1 1 140px; font-size: 14.5px; color: var(--text); }
.voice__more {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--blue); cursor: pointer; transition: border-color .2s, background-color .2s;
}
.voice__more:hover { border-color: var(--blue); background: var(--blue-soft); }
.voice__try { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13.5px; color: var(--muted); }

/* Traka sa stanjem snimanja prečacem (dolje na sredini, iznad dijaloga) */
.voice-pill {
  position: fixed; left: 50%; bottom: 22px; z-index: 120; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 9px 10px 9px 16px;
  background: var(--navy); color: #fff; border-radius: 999px; box-shadow: 0 14px 40px rgba(9, 24, 41, .3);
  font-size: 14px; line-height: 1.35; animation: modalIn .25s ease both;
}
.voice-pill__dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--sky); }
.voice-pill[data-phase="rec"] .voice-pill__dot { background: #ff5a6a; animation: recPulse 1.4s ease-in-out infinite; }
.voice-pill[data-phase="stt"] .voice-pill__dot { background: transparent; border: 2px solid var(--sky); border-right-color: transparent; animation: spin .8s linear infinite; }
.voice-pill.is-ok .voice-pill__dot { background: #59d48b; }
.voice-pill.is-warn .voice-pill__dot, .voice-pill.is-error .voice-pill__dot { background: #ffb547; }
@keyframes spin { to { transform: rotate(360deg); } }
.voice-pill__btn, .voice-pill__x { flex: none; border: 0; cursor: pointer; font: inherit; }
.voice-pill__btn { display: none; padding: 5px 12px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; }
.voice-pill[data-phase="rec"] .voice-pill__btn { display: block; }
.voice-pill__x { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: transparent; color: var(--muted-dark); font-size: 18px; }
.voice-pill__x:hover { color: #fff; }
.voice-pill[data-phase="rec"] .voice-pill__x, .voice-pill[data-phase="stt"] .voice-pill__x { display: none; }

/* ---------- Dijalozi (assets/js/dialog.js, normativ ui--dialozi): glava i podnožje fiksni, skrola samo sadržaj ---------- */
.has-dialog { overflow: hidden; }
.dlg { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; }
.dlg__shadow { position: absolute; inset: 0; background: rgba(9, 24, 41, .5); backdrop-filter: blur(2px); animation: modalFade .2s ease both; }
.dlg__box {
  position: relative; display: flex; flex-direction: column; overflow: hidden; width: min(520px, 100%); max-height: calc(100vh - 48px);
  background: var(--card); border-radius: var(--radius-lg); border-top: 4px solid var(--dlg-accent); box-shadow: 0 40px 120px rgba(9, 24, 41, .35);
  animation: modalIn .28s cubic-bezier(.2, .7, .2, 1) both;
}
.dlg--wide .dlg__box { width: min(760px, 100%); }
.dlg--info { --dlg-accent: var(--blue); --dlg-tint: var(--blue-soft); }
.dlg--success { --dlg-accent: #1f8a55; --dlg-tint: #e1f4ea; }
.dlg--warning { --dlg-accent: #c77d0a; --dlg-tint: #fdf1dc; }
.dlg--error { --dlg-accent: var(--danger); --dlg-tint: #fbe5e8; }
.dlg__head { flex: none; display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 20px; border-bottom: 1px solid var(--line-soft); }
.dlg__ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--dlg-tint); color: var(--dlg-accent); }
.dlg__head h3 { flex: 1 1 auto; font-size: 16.5px; font-weight: 700; letter-spacing: 0; }
.dlg__x { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.dlg__x:hover { background: var(--ice-2); color: var(--ink); }
.dlg__body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 18px 22px; font-size: 15.5px; }
.dlg__p + .dlg__p { margin-top: 12px; }
.dlg__input {
  display: block; width: 100%; margin-top: 12px; padding: 10px 12px; font: inherit; font-size: 15px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); resize: vertical;
}
.dlg__input:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(26, 92, 216, .12); }
.dlg__foot { flex: none; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 12px 18px 14px; border-top: 1px solid var(--line-soft); }
.dlg__foot .dlg__start { margin-right: auto; }

/* Prozor za poliranje diktiranog teksta (sadržaj dijaloga, predložak u index.php) */
.polish { display: grid; gap: 16px; }
.polish__field { display: grid; gap: 6px; }
.polish__field > span, .polish__field > label, .polish__top > label, .polish__label { font-size: 13px; font-weight: 700; color: var(--ink); }
.polish__field small { font-size: 13px; color: var(--muted); }
.polish__field textarea, .polish__field input {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 15px; line-height: 1.5; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); resize: vertical;
}
.polish__field textarea:focus, .polish__field input:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(26, 92, 216, .12); }
.polish__field--out textarea { background: var(--ice); }
.polish__area { position: relative; }
.polish__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.polish__mom { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.polish__mom:hover, .polish__mom[aria-expanded="true"] { border-color: var(--line); background: var(--ice); color: var(--ink); }

/* MOM (More Options meni) — na body, iznad dijaloga */
.mom {
  position: fixed; z-index: 130; min-width: 210px; padding: 6px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 18px 50px rgba(9, 24, 41, .22); animation: modalFade .15s ease both;
}
.mom__item {
  display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: transparent;
  font: inherit; font-size: 14.5px; text-align: left; color: var(--ink); cursor: pointer;
}
.mom__item:hover:not([disabled]), .mom__item:focus-visible { background: var(--ice); outline: 0; }
.mom__item[disabled] { color: var(--muted-dark); cursor: default; }

/* Popis autosave spremanja prozora za poliranje */
.asave { display: grid; gap: 12px; }
.asave__note { font-size: 14px; color: var(--muted); }
.asave__row { display: grid; gap: 6px; justify-items: start; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--ice); }
.asave__head { font-size: 12.5px; font-weight: 700; color: var(--blue-deep); }
.asave__btns { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: 2px; }   /* oba gumba iste širine */
.asave__btn {
  padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--ink); cursor: pointer; transition: border-color .2s, background-color .2s;
}
.asave__btn:hover { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-deep); }
.asave__text { font-size: 14.5px; color: var(--ink); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.polish__area textarea { display: block; padding-bottom: 42px; }
.polish__copy {
  position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--blue); cursor: pointer; transition: border-color .2s, background-color .2s;
}
.polish__copy:hover { border-color: var(--blue); background: var(--blue-soft); }
.dlg__check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.dlg__check input { width: 17px; height: 17px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.dlg__foot { align-items: center; }
.polish__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.polish__chip {
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  font: inherit; font-size: 14px; color: var(--text); cursor: pointer; transition: border-color .2s, background-color .2s;
}
.polish__chip:hover { border-color: var(--blue); }
.polish__chip.is-on { border-color: var(--blue); background: var(--blue); color: #fff; font-weight: 600; }
.polish__chip--add { border-style: dashed; color: var(--blue); }
.polish__desc { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.polish__new { display: grid; gap: 12px; padding: 14px 16px; background: var(--ice); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.polish__new-btns { display: flex; justify-content: flex-end; gap: 8px; }
.polish__err { font-size: 13.5px; color: #7e2531; }
.polish__go { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.polish__go .btn { gap: 8px; }
.polish__status { font-size: 13.5px; color: var(--muted); }
.polish__status.is-ok { color: var(--blue-deep); }
.polish__status.is-error { color: #7e2531; }
.polish__status.is-warn { color: #8a5a00; font-weight: 600; }
@media (max-width: 640px) {
  .dlg { padding: 12px; }
  .dlg__body { padding: 16px; }
  .voice-pill { bottom: 14px; font-size: 13px; }
}

/* Granica između ilustrativnog primjera i stvarnog razgovora */
.ai-sep { display: flex; align-items: center; gap: 12px; margin: 6px 0 2px; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.ai-sep::before, .ai-sep::after { content: ""; flex: 1; height: 1px; background: var(--sky); }
.msg--live .msg__text { white-space: pre-line; }
.msg--error .msg__text { background: #fbeff0; border-color: #f0d0d4; color: #7e2531; }
.ai-typing .msg__text { display: inline-flex; gap: 5px; padding: 15px 16px; }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-dark); animation: typing 1.2s infinite ease-in-out; }
.ai-typing i:nth-child(2) { animation-delay: .15s; }
.ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* Kad razgovor krene, log ima svoju visinu i skrola (primjer ostaje gore) */
.is-live [data-ai-log] { max-height: 560px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.practice.is-live .practice__chat { max-height: 520px; padding-right: 4px; }
/* Dodirni ekran: chat u stranici ne smije „zarobiti" prst. Kad se njegov sadržaj doskrola do kraja, nastavlja se skrolati
   stranica (bez contain), a chat je niži od ekrana, pa iznad/ispod njega uvijek ostaje dio stranice za povlačenje.
   Plutajući chat i prozori (grafovi, dijalozi) prekrivaju stranicu, pa ondje contain ostaje. */
@media (hover: none) and (pointer: coarse), (max-width: 760px) {
  .is-live [data-ai-log], .hero__demo .chat__body { overscroll-behavior: auto; max-height: 58vh; max-height: 58svh; }
  .practice.is-live .practice__chat { max-height: 55vh; max-height: 55svh; }
}

/* Polje za e-mail koje asistent ponudi */
.ai-lead { display: grid; gap: 10px; margin-top: 8px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.ai-lead__row { display: grid; gap: 4px; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.ai-lead__row small { font-weight: 400; color: var(--muted); }
.ai-lead input:not(.hp) { width: 100%; font: inherit; font-size: 15px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); }
.ai-lead input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 92, 216, .14); }
.ai-lead .btn { justify-self: start; }
.ai-lead__err { font-size: 13px; color: #7e2531; }
.ai-lead__ok { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--blue-soft); color: var(--blue-deep); font-weight: 600; font-size: 14px; }

/* Plutajući chat dolje desno */
.ai-float { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.ai-float__btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 20px 14px 16px; border: 0; border-radius: 999px;
  background: var(--blue); color: #fff; font: inherit; font-weight: 700; font-size: 15.5px; cursor: pointer;
  box-shadow: 0 14px 34px rgba(26, 92, 216, .38); transition: background-color .2s, transform .2s;
}
.ai-float__btn:hover { background: var(--blue-deep); }
.ai-float__btn:focus-visible { outline: 3px solid rgba(26, 92, 216, .45); outline-offset: 3px; }
.ai-float.is-open .ai-float__btn span { display: none; }
.ai-float.is-open .ai-float__btn { padding: 14px; }
.ai-float__panel {
  width: min(400px, calc(100vw - 40px)); height: min(600px, calc(100vh - 120px));
  display: flex; flex-direction: column;
}
.ai-float__panel[hidden] { display: none; }
.ai-float__panel .chat__bar { justify-content: space-between; }
.ai-float__panel .chat__title { margin-left: 0; }
.ai-float__close { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.ai-float__close:hover { background: var(--ice-2); color: var(--ink); }
.ai-float__panel .chat__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px; }
.ai-float__panel .chat__foot { padding: 0 14px 12px; }
.ai-float__panel .msg { max-width: 92%; }

.dev-links { display: flex; gap: 16px; }
.footer .dev-link { font-size: 12.5px; color: var(--muted-dark); border-bottom: 1px dashed currentColor; }
.footer .dev-link:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero__grid { grid-template-columns: 1fr; gap: 44px; }
  .hero__copy { max-width: 720px; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .svc-panel.is-chat-wide { grid-template-columns: 1fr; }
  .practice__shrink { display: none; }
  .svc { grid-template-columns: 1fr; gap: 24px; }
  .svc-nav {
    position: static; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px;
    scrollbar-width: thin;
  }
  .svc-tab { flex: none; grid-template-columns: auto auto; padding: 11px 16px; border: 1px solid var(--line); }
  .svc-tab__arrow { display: none; }
  .svc-panel { grid-template-columns: 1fr; padding: 32px; }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .flow::before { display: none; }
  .process, .cta__in { grid-template-columns: 1fr; gap: 48px; }
  .process__intro { position: static; }
  .faq { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: grid; gap: 5px; place-content: center; width: 44px; height: 44px; padding: 0;
    background: transparent; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  }
  .nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .25s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav {
    position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 20px; background: var(--bg); border-bottom: 1px solid var(--line);
    opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .2s, transform .2s;
  }
  .nav.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line-soft); font-size: 17px; }
  .nav .btn { margin-top: 16px; padding: 14px; }
  .principles__grid { grid-template-columns: 1fr; gap: 28px; }
  .principle { padding: 0; }
  .principle + .principle { border-left: 0; border-top: 1px solid var(--line); padding-top: 28px; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .hero { padding: 52px 0 64px; }
  .hero__lead { font-size: 17px; }
  .hero__cta .btn { width: 100%; }
  .footer__grid { grid-template-columns: 1fr; gap: 32px; }
  .brand__name small { display: none; }
  .section, .cta, .flow-band { padding: 76px 0; }
  .section__head { margin-bottom: 36px; }
  .svc-panel { padding: 24px 18px; }
  .svc-panel h3 { font-size: 22px; }
  .practice { padding: 18px 14px; }
  .flow { grid-template-columns: 1fr; gap: 28px; }
  .form { padding: 24px 18px; }
  .form__row, .checks { grid-template-columns: 1fr; }
  .msg__list li { grid-template-columns: 1fr auto; }
  .msg__list em { display: none; }
  .chat__body { padding: 18px 14px; }
  .chat__foot { padding: 0 12px 14px; }
  .chat { box-shadow: var(--shadow); }
  .ai-float { right: 12px; bottom: 12px; }
  .ai-float__btn { padding: 13px 16px 13px 14px; font-size: 14.5px; }
  /* Na mobitelu je otvoreni chat preko cijelog ekrana */
  .ai-float.is-open { inset: 0; right: 0; bottom: 0; gap: 0; }
  .ai-float.is-open .ai-float__panel { width: 100%; height: 100%; border-radius: 0; border: 0; }
  .ai-float.is-open .ai-float__btn { display: none; }
  /* Veliki prikaz grafa preko cijelog ekrana */
  .chart-modal { padding: 0; }
  .chart-modal__box { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .chart-modal__body { padding: 16px 14px; }
  .chart-modal__body .msg { max-width: 92%; }
  .chart-modal__foot { padding: 10px 12px 12px; }
  .ai-chart--big { padding: 12px 10px 10px; }
  .ai-chart--big .ai-chart__plot { height: 52vh; min-height: 260px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-animate-chat] .msg { opacity: 1; transform: none; }
}
