/* ==========================================================================
   iManage — Клиентски портал (Self Service) — ДЕМО
   Само допълнения върху styles.css на сайта: вход, регистрация, съветник.
   ========================================================================== */

.demo-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 0; background: var(--accent-500); color: var(--brand-950); text-align: center; font: 600 .82rem/1.2 var(--font-head); padding: 7px 12px; }
.demo-bar a { color: inherit; text-decoration: underline; margin: 0 6px; }

/* ---------- Вход: две половини ---------- */
.auth-split { display: grid; grid-template-columns: 1.15fr .85fr; min-height: calc(100vh - 140px); }
.auth-split__art { padding: clamp(40px, 6vw, 80px); display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.auth-split__art h1 { font-size: clamp(1.8rem, 2.9vw, 2.55rem); line-height: 1.08; margin: 0; }
.auth-split__art p { color: #b7cbe0; font-size: 1.08rem; max-width: 46ch; margin: 0; }
.auth-split__art img { max-width: 430px; width: 100%; margin-top: 10px; }
.auth-split__panel { background: #fff; display: flex; align-items: center; justify-content: center; padding: clamp(28px, 5vw, 64px); border-radius: 36px 0 0 36px; margin-left: -36px; box-shadow: -20px 0 60px rgba(7, 26, 51, .25); position: relative; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box__brand { text-align: center; margin-bottom: 26px; }
.auth-box__brand img { display: block; height: 40px; margin: 0 auto; }
.auth-box__brand span { display: block; margin-top: 8px; font: 700 1.05rem var(--font-head); color: var(--ink); }
.auth-box h2 { font-size: 1.7rem; margin: 0 0 18px; }
.auth-box .btn { width: 100%; justify-content: center; }
.btn--navy { --btn-bg: var(--brand-900); --btn-fg: var(--accent-500); border-color: var(--brand-900); }
.btn--navy:hover { background: var(--brand-800); border-color: var(--brand-800); color: var(--accent-500); }
.auth-links { display: flex; justify-content: space-between; font-size: .9rem; margin: -4px 0 18px; }
.auth-alt { text-align: center; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .95rem; color: var(--muted); }
.auth-alt a { font-weight: 700; }

/* ---------- Полета: парола, подсказки, отметки ---------- */
.pw { position: relative; }
.pw button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .8rem; font-weight: 600; }
.pw-meter { height: 5px; border-radius: 4px; background: var(--line); margin-top: 7px; overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; transition: width .25s var(--ease), background .25s; }
.field__hint { font-size: .8rem; color: var(--muted); margin-top: 5px; }
.field__err { font-size: .8rem; color: #b42318; margin-top: 5px; }
.field.is-ok input { border-color: #1a7f45; }
.tip { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-left: 5px; border-radius: 50%; background: var(--brand-100); color: var(--brand-700); font-size: .7rem; font-weight: 800; cursor: help; position: relative; vertical-align: 1px; }
.tip:hover::after { content: attr(data-tip); position: absolute; left: 50%; bottom: 140%; transform: translateX(-50%); width: 240px; background: var(--brand-950); color: #fff; font: 500 .8rem/1.4 var(--font-body); padding: 9px 11px; border-radius: 8px; z-index: 5; box-shadow: var(--shadow-md); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--ink-soft); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand-600); flex: none; }

/* ---------- Страница с карта (регистрация, потвърждение) ---------- */
.page-card { max-width: 640px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: clamp(24px, 4vw, 44px); }
.done { text-align: center; }
.done__icon { width: 76px; height: 76px; border-radius: 50%; background: #e6f6ed; color: #1a7f45; display: grid; place-items: center; margin: 0 auto 18px; font-size: 2.2rem; animation: pop .5s var(--ease); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Съветник ---------- */
.wiz > * { min-width: 0; }
.wiz { display: grid; grid-template-columns: 280px 1fr; gap: clamp(20px, 3vw, 40px); align-items: start; }
.steps { position: sticky; top: 90px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.steps__progress { font: 700 .85rem var(--font-head); color: var(--muted); margin-bottom: 8px; display: flex; justify-content: space-between; }
.steps__bar { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; margin-bottom: 14px; }
.steps__bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-600), var(--brand-400)); }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.steps li a, .steps li span.s { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--ink-soft); font-size: .92rem; text-decoration: none; }
.steps li a:hover { background: var(--bg-soft); }
.steps .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 .75rem var(--font-head); background: var(--bg-tint); color: var(--brand-700); flex: none; }
.steps .is-done .n { background: #1a7f45; color: #fff; }
.steps .is-active a { background: var(--brand-50); color: var(--brand-800); font-weight: 700; }
.steps .is-active .n { background: var(--brand-600); color: #fff; }
.steps .is-soon span.s { color: #9aa8b6; cursor: not-allowed; }
.steps .is-soon .n { background: #f0f2f5; color: #9aa8b6; }
.steps .soon { margin-left: auto; font-size: .68rem; font-weight: 700; background: #f0f2f5; color: #8593a3; padding: 2px 7px; border-radius: 20px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 34px); box-shadow: var(--shadow-sm); }
.panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.panel__head h1 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin: 0 0 6px; }
.panel__head p { margin: 0; color: var(--muted); }
.saved { font-size: .8rem; color: #1a7f45; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.saved::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #1a7f45; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.fieldset { border: 0; padding: 0; margin: 8px 0 0; }
.fieldset legend { font: 700 1rem var(--font-head); color: var(--ink); margin-bottom: 10px; padding: 0; }
.callout { display: flex; gap: 12px; background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 12px; padding: 14px 16px; font-size: .92rem; color: var(--ink-soft); }
.callout b { color: var(--ink); }
.callout--warn { background: #fff8eb; border-color: #fde4b2; }
.wiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- Документи ---------- */
.doc { border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 18px; display: grid; grid-template-columns: 52px 1fr auto; gap: 16px; align-items: center; transition: border-color .2s, background .2s; }
.doc + .doc { margin-top: 14px; }
.doc:hover { border-color: var(--brand-400); background: var(--brand-50); }
.doc__ic { width: 52px; height: 52px; border-radius: 12px; background: var(--brand-100); color: var(--brand-700); display: grid; place-items: center; font-size: 1.4rem; }
.doc h3 { font-size: 1.02rem; margin: 0 0 3px; }
.doc p { margin: 0; font-size: .86rem; color: var(--muted); }
.doc ul { margin: 6px 0 0; padding-left: 18px; font-size: .84rem; color: var(--ink-soft); }
.doc.is-up { border-style: solid; border-color: #b7e2c8; background: #f3fbf6; }
.doc.is-up .doc__ic { background: #e6f6ed; color: #1a7f45; }
.file { display: inline-flex; gap: 8px; align-items: center; font-size: .86rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; margin-top: 8px; }
.badge { display: inline-block; font: 700 .72rem var(--font-head); padding: 3px 9px; border-radius: 20px; }
.badge--req { background: #fdecec; color: #b42318; }
.badge--ok { background: #e6f6ed; color: #1a7f45; }

/* ---------- Статус ---------- */
.timeline { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; counter-reset: t; }
.timeline li { text-align: center; position: relative; font-size: .84rem; color: var(--muted); padding-top: 44px; }
.timeline li::before { counter-increment: t; content: counter(t); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-tint); color: var(--brand-700); font: 700 .9rem var(--font-head); z-index: 1; }
.timeline li::after { content: ''; position: absolute; top: 16px; left: -50%; width: 100%; height: 3px; background: var(--line); }
.timeline li:first-child::after { display: none; }
.timeline li.is-done::before { content: '✓'; background: #1a7f45; color: #fff; }
.timeline li.is-done::after, .timeline li.is-now::after { background: #1a7f45; }
.timeline li.is-now::before { background: var(--brand-600); color: #fff; box-shadow: 0 0 0 6px var(--brand-100); }
.timeline li b { display: block; color: var(--ink); font-family: var(--font-head); }
.note { border-left: 3px solid var(--accent-500); background: #fffaf0; border-radius: 0 10px 10px 0; padding: 12px 14px; font-size: .92rem; }
.note small { display: block; color: var(--muted); margin-top: 4px; }

@media (max-width: 960px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-split__panel { margin: -30px 0 0; border-radius: 28px 28px 0 0; box-shadow: 0 -20px 50px rgba(7, 26, 51, .2); }
    .auth-split__art img { display: none; }
    .wiz { grid-template-columns: minmax(0, 1fr); }
    .steps { position: static; }
    .steps ol { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
    .steps li a span.t, .steps li span.s span.t, .steps .soon { display: none; }
    .grid3, .grid4 { grid-template-columns: 1fr 1fr; }
    .doc { grid-template-columns: 44px 1fr; }
    .doc > :last-child { grid-column: 1 / -1; }
    .timeline { grid-template-columns: 1fr; }
    .timeline li { text-align: left; padding: 6px 0 6px 48px; }
    .timeline li::before { left: 0; transform: none; top: 2px; }
    .timeline li::after { display: none; }
}

@media (max-width: 600px) {
    .grid3, .form .row2 { grid-template-columns: 1fr; }
    .grid4 .field[style*="span"] { grid-column: 1 / -1 !important; }
    .panel__head { flex-direction: column; }
    .wiz-nav { flex-direction: column-reverse; }
    .wiz-nav .btn { width: 100%; justify-content: center; }
    .demo-bar a { margin: 0 3px; }
}

/* ---------- Реални страници (IMWEB-4) ---------- */
.ss-alert { margin: 0; padding: 11px 14px; border-radius: 10px; background: #fdecec; color: #b42318; font-size: .9rem; }
.ss-alert--info { background: var(--brand-50); color: var(--brand-800); }
.ss-user { font-size: .9rem; color: var(--muted); margin-right: 6px; }
/* IMWEB-92: с „Моите отворени регистрации“ лентата е по-дълга — името на потребителя отпада на по-тесни екрани (има го в таблото) */
.nav__cta:has(.nav__myapps) .ss-user { display: none; }
@media (max-width: 1100px) { .nav__cta:has(.nav__myapps) .btn { padding-inline: 12px; } }
.page-card[hidden], .ss-alert[hidden] { display: none; }
.saved.is-saving { color: var(--muted); }
.saved.is-saving::before { background: var(--accent-500); animation: blink .8s infinite alternate; }
@keyframes blink { to { opacity: .2; } }
.steps li[data-step] a { cursor: pointer; }
[data-panel][hidden] { display: none !important; }
.doc__progress { height: 6px; border-radius: 4px; background: var(--line); margin-top: 10px; overflow: hidden; }
.doc__progress i { display: block; height: 100%; width: 0; background: var(--brand-600); transition: width .2s; }
.doc .field__err[hidden], .doc__progress[hidden] { display: none; }
a.file { color: var(--ink); text-decoration: none; }
a.file:hover { border-color: var(--brand-400); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .95rem; }
.kv { width: 100%; border-collapse: collapse; font-size: .92rem; }
.kv th { text-align: left; font-weight: 600; color: var(--muted); width: 38%; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.kv td { padding: 7px 10px; border-bottom: 1px solid var(--line); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.verify-bar { background: #fff8eb; border-bottom: 1px solid #fde4b2; font-size: .92rem; }
.verify-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.verify-bar .wrap > span { flex: 1 1 420px; }
.verify-bar .btn { padding: 7px 14px; font-size: .85rem; }

/* ---------- Имоти и обекти (IMWEB-25/26) ---------- */
.tblwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.grid { display: table; gap: 0; width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
table.grid th { text-align: left; font: 600 .78rem var(--font-head); color: var(--muted); text-transform: uppercase; letter-spacing: .02em; padding: 9px 8px; background: var(--bg-soft); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid td { padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid td.n { color: var(--muted); width: 38px; text-align: right; padding-right: 10px; }
table.grid td.c { text-align: center; }
table.grid input:not([type=checkbox]), table.grid select { width: 100%; min-width: 0; padding: 7px 9px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; background: #fff; }
table.grid input.w-s { max-width: 80px; } table.grid input.w-m { max-width: 110px; }
table.grid input:focus, table.grid select:focus { outline: 0; border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-100); }
table.grid .is-err { border-color: #d92d20 !important; background: #fff5f5 !important; }
table.grid input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand-600); }
.gen { border: 1px dashed var(--brand-200); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; background: var(--brand-50); }
.gen summary { cursor: pointer; font: 700 .95rem var(--font-head); color: var(--brand-800); }
.gen__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 12px 0 6px; }
.gen__grid .field label { font-size: .8rem; }
.pipsum { margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; font-size: .92rem; }
.pipsum.is-ok { background: #e6f6ed; color: #1a7f45; } .pipsum.is-warn { background: #fff8eb; color: #93370d; }
h3.grp { font-size: 1rem; margin: 18px 0 8px; }
.problems { margin: 4px 0 0 22px; padding: 0; font-size: .85rem; color: #b42318; }
@media (max-width: 860px) { .gen__grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .gen__grid { grid-template-columns: repeat(2, 1fr); } }
#propBox.is-busy .tblwrap { opacity: .45; pointer-events: none; transition: opacity .2s; }
table.grid td.empty { text-align: center; color: var(--muted); padding: 18px; }
table.grid button.x { border: 0; background: none; color: #b42318; font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
table.grid button.x:hover { background: #fdecec; }
.addrow { margin-top: 10px; }
.callout--err { background: #fef3f2; border-color: #fecdca; }
.callout--ok { background: #ecfdf3; border-color: #abefc6; }
.xlsbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 14px; border: 1px dashed var(--line, #d0d5dd); border-radius: 10px; }
.xlsbar > span:first-child { flex: 1 1 320px; font-size: .92rem; color: var(--muted); }
.xlsbar label.btn { cursor: pointer; }
#xlsMsg .callout { margin-bottom: 12px; }
.xlsbar__btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 1В: входни такси, ел. плащане, потребители (IMWEB-37…40) ---------- */
.callout--info { margin-bottom: 14px; }
.guide { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 14px; }
.guide li { display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 7px; border-radius: 999px; background: #f2f4f7; color: var(--muted); font-size: .88rem; font-weight: 600; }
.guide li span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; font-size: .8rem; }
.guide li.is-now { background: var(--brand-100); color: var(--brand-800); box-shadow: 0 0 0 2px var(--brand-400) inset; }
.guide li.is-done { background: #e6f6ed; color: #1a7f45; }
.tiles { display: grid; gap: 12px; margin: 12px 0; }
.tiles--2 { grid-template-columns: repeat(2, 1fr); }
.tiles--3 { grid-template-columns: repeat(3, 1fr); }
.tile { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 16px 44px; border: 1.5px solid #b9d7f5; border-radius: 12px; background: #eef6fe; cursor: pointer; font-size: .9rem; color: var(--ink-soft); transition: background .15s, border-color .15s; }
.tile input { position: absolute; left: 16px; top: 18px; width: 18px; height: 18px; accent-color: #1a7f45; }
.tile b { font: 700 1rem var(--font-head); color: var(--brand-900, #0b2545); }
.tile:hover { border-color: var(--brand-400); }
.tile.is-on { background: #e8f8ee; border-color: #6fcf97; }
.tile:has(input:focus-visible) { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.check--box { margin: 16px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fcfcfd; }
.rowbtns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 10px; }
.rowbtns .addrow { margin-top: 0; }
.seg { display: inline-flex; border: 1.5px solid #b9d7f5; border-radius: 10px; overflow: hidden; }
.seg label { padding: 9px 22px; cursor: pointer; background: #eef6fe; font-weight: 600; font-size: .92rem; color: var(--ink-soft); }
.seg label + label { border-left: 1.5px solid #b9d7f5; }
.seg label.is-on { background: #e8f8ee; color: #1a7f45; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--brand-600); outline-offset: -3px; }
.form--epay { max-width: 640px; }
.form--epay .row2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.kpis > div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kpis b { display: block; font: 800 1.5rem var(--font-head); color: var(--brand-800); }
.kpis span { font-size: .82rem; color: var(--muted); }
.kpis .warn b { color: #b54708; }
.usersec + .usersec { margin-top: 26px; padding-top: 6px; border-top: 1px solid var(--line); }
.mu { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-top: 12px; }
.mu h4 { margin: 0 0 8px; font: 700 .95rem var(--font-head); color: var(--brand-800); }
.mu .field { margin: 0; }
.muted { color: #9aa8b6; }
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(11, 26, 51, .55); display: grid; place-items: center; padding: 16px; }
.modal__box { background: #fff; border-radius: 16px; width: min(1000px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px 24px; box-shadow: var(--shadow-md); }
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal__head h2 { margin: 0; font-size: 1.25rem; }
.modal__head .x { border: 0; background: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 8px; border-radius: 8px; }
.modal__foot { display: flex; justify-content: flex-end; margin-top: 16px; }
.grid--calc td, .grid--calc th { white-space: nowrap; }
.grid--calc small { display: block; color: var(--muted); font-size: .75rem; }
.grid--calc tfoot th { text-align: right; background: #f8fafc; }
.grid--calc tfoot th:last-child { text-align: left; }
/* сайтът има .grid { display: grid } — таблиците остават таблици (виж table.grid) */
#feeTable input.w-m { max-width: none; width: 92px; }
@media (max-width: 760px) {
    .tiles--2, .tiles--3, .kpis, .form--epay .row2 { grid-template-columns: 1fr; }
}

/* ---------- Плочка „месечен абонамент“ до прогреса ---------- */
.wiz__side { position: sticky; top: 90px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.wiz > * { min-width: 0; }
.wiz__side .steps li a, .wiz__side .steps li span.s { padding-top: 6px; padding-bottom: 6px; }
.wiz__side .steps { position: static; }
.subtile { display: grid; gap: 2px; padding: 14px 18px; border-radius: var(--radius); color: #fff; text-decoration: none;
    background: radial-gradient(420px 220px at 90% -20%, var(--brand-700), transparent 60%), linear-gradient(155deg, var(--brand-800), var(--brand-950));
    box-shadow: var(--shadow-md); transition: transform .15s; }
.subtile:hover { transform: translateY(-2px); }
.subtile[hidden] { display: none; }
.subtile__t { font: 600 .86rem/1.35 var(--font-body); color: rgba(255, 255, 255, .82); }
.subtile__sum { font: 800 2.1rem/1.1 var(--font-head); letter-spacing: -.01em; margin-top: 4px; }
.subtile__per { font-size: .8rem; color: rgba(255, 255, 255, .7); }
.subtile__vat { font: 700 .86rem var(--font-head); color: var(--accent-500); }   /* сумата с ДДС под сумата без ДДС */
.subtile__plan { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .18); font: 600 .8rem var(--font-head); color: #cfe0ff; }
/* на мобилен — лента над формата, залепена под хедъра на сайта */
@media (max-width: 960px) {
    .wiz__side { display: contents; }
    .subtile { position: sticky; top: 72px; z-index: 50; order: 2; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 12px; row-gap: 0;
        align-items: center; padding: 10px 14px; border-radius: 12px; }
    .subtile:hover { transform: none; }
    .wiz > .steps { order: 1; }
    .wiz > div:not(.wiz__side) { order: 3; }
    .subtile__t { grid-column: 1; grid-row: 1; font-size: .78rem; }
    .subtile__plan { grid-column: 1; grid-row: 2; margin: 0; padding: 0; border: 0; font-size: .74rem; }
    .subtile__sum { grid-column: 2; grid-row: 1 / 3; font-size: 1.55rem; margin: 0; white-space: nowrap; }
    .subtile__per { display: none; }
    .subtile__vat { grid-column: 1 / 3; grid-row: 3; font-size: .74rem; margin-top: 2px; }
    .subtile__plan::after { content: ' · без ДДС'; }
}

/* ---------- По-широк съветник: всички колони без хоризонтален скрол (от ~1280 px) ---------- */
.wrap.wiz { max-width: 1520px; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
.wiz .panel { padding: clamp(18px, 1.8vw, 30px); }
table.grid { min-width: 0; }
table.grid th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
table.grid th.nw { white-space: nowrap; }
table.grid td { padding: 5px 4px; }
table.grid input:not([type=checkbox]), table.grid select { padding: 7px 8px; font-size: .88rem; }
table.grid select { padding-right: 22px; }
table.grid td.c, table.grid th.c { width: 1%; text-align: center; }
/* изборите и телефонът — по съдържанието (не се режат); свиват се текстовите полета */
#peopleTable select, #peopleTable [data-f=PHONE] { font-size: .84rem; padding-left: 7px; padding-right: 20px; }
#peopleTable [data-f=TYPE] { min-width: 158px; }
#peopleTable [data-f=PERSONTYPE] { min-width: 128px; }
#peopleTable [data-f=PROPERTYID] { min-width: 84px; }
#peopleTable [data-f=PHONE] { min-width: 128px; padding-right: 7px; }
#peopleTable [data-f=EMAIL] { min-width: 110px; }
#peopleTable [data-f=FIRSTNAME], #peopleTable [data-f=LASTNAME], #peopleTable [data-f=ENTITYNAME], #peopleTable [data-f=EIK] { min-width: 80px; }
table.grid td.flags { white-space: nowrap; font-size: .8rem; color: var(--ink-soft); }
table.grid td.flags label { display: flex; align-items: center; gap: 6px; line-height: 1.5; cursor: pointer; }
table.grid td.flags input[type=checkbox] { width: 15px; height: 15px; }
#peopleTable [data-f=PROPERTYID], #animalsTable [data-f=PROPERTYID] { width: 88px; }
#animalsTable [data-f=ANIMALCOUNT] { width: 60px; }
#feeTable [data-f=AMOUNT] { width: 84px; }
#feeTable input.w-m { max-width: none; width: 84px; }
@media (max-width: 960px) {
    .wrap.wiz { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    table.grid { min-width: 720px; }   /* на телефон таблицата остава скролваща */
}
@media (min-width: 961px) and (max-width: 1400px) {
    .wrap.wiz { grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding-left: 16px; }
    .wiz .panel { padding: 16px; }
    #peopleTable [data-f=EMAIL] { min-width: 84px; }
    #peopleTable [data-f=FIRSTNAME], #peopleTable [data-f=LASTNAME], #peopleTable [data-f=ENTITYNAME], #peopleTable [data-f=EIK] { min-width: 66px; }
    .subtile__sum { font-size: 1.8rem; }
}
@media (min-width: 961px) {
    .wiz__side { max-height: calc(100vh - 104px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
    .wiz__side .steps { padding: 14px; }
    .wiz__side .steps li a, .wiz__side .steps li span.s { padding-top: 5px; padding-bottom: 5px; font-size: .87rem; line-height: 1.25; }
    .wiz__side .subtile__t { font-size: .8rem; }
}

/* ---------- Етикет „Свържете се с нас“ — само десктоп, залепен за десния край, по средата ---------- */
.helptab { display: none; }
@media (min-width: 961px) {
    .helptab { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 12px;
        padding: 16px 10px 18px; border-radius: 14px 0 0 14px; color: #fff; text-decoration: none;
        background: radial-gradient(160px 220px at 100% 0%, var(--brand-700), transparent 70%), linear-gradient(170deg, var(--brand-800), var(--brand-950));
        box-shadow: -4px 6px 22px rgba(7, 26, 51, .28); border: 1px solid rgba(255, 255, 255, .18); border-right: 0; transition: padding .2s, box-shadow .2s; }
    .helptab:hover, .helptab:focus-visible { padding-right: 16px; box-shadow: -6px 8px 28px rgba(7, 26, 51, .38); }
    .helptab:focus-visible { outline: 2px solid #ffd43b; outline-offset: 2px; }
    .helptab__text { writing-mode: vertical-rl; font: 600 .76rem/1.3 var(--font-body); letter-spacing: .02em; white-space: nowrap; text-align: center; color: rgba(255, 255, 255, .9); }
    /* място за етикета, когато няма свободно поле отдясно (екрани под ~1660 px) */
    .wrap.wiz { padding-right: max(22px, min(70px, calc(70px - (100vw - 1520px) / 2))); }
    .helptab__text b { display: block; font: 800 .95rem var(--font-head); color: #ffd43b; letter-spacing: .04em; margin-top: 4px; }
    .helptab__icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 212, 59, .14); color: #ffd43b; position: relative; }
    .helptab__icon svg { width: 19px; height: 19px; animation: helpRing 3.2s ease-in-out infinite; transform-origin: 50% 50%; }
    .helptab__icon::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #ffd43b; opacity: 0; animation: helpPulse 3.2s ease-out infinite; }
}
/* звъни: кратко потрепване на слушалката и вълна около нея, после пауза */
@keyframes helpRing {
    0%, 52%, 100% { transform: rotate(0); }
    4%, 12%, 20%, 28% { transform: rotate(-16deg); }
    8%, 16%, 24%, 32% { transform: rotate(16deg); }
    36% { transform: rotate(0); }
}
@keyframes helpPulse {
    0%, 30% { opacity: 0; transform: scale(1); }
    34% { opacity: .9; transform: scale(1); }
    60% { opacity: 0; transform: scale(1.6); }
    100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .helptab__icon svg, .helptab__icon::after { animation: none; } }
@media (min-width: 961px) and (max-width: 1300px) {
    .wiz .panel { padding: 14px; }
    #peopleTable select, #peopleTable [data-f=PHONE] { font-size: .8rem; }
    #peopleTable [data-f=TYPE] { min-width: 148px; }
    #peopleTable [data-f=PERSONTYPE] { min-width: 120px; }
    #peopleTable [data-f=PHONE] { min-width: 118px; }
}

/* ---------- Начално състояние (IMWEB-48) ---------- */
.form--money { display: grid; grid-template-columns: repeat(2, minmax(0, 280px)); gap: 16px; }
.money { position: relative; }
.money input { width: 100%; padding-right: 34px; text-align: right; font: 700 1.1rem var(--font-head); }
.money span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.upbox { margin: 10px 0 4px; padding: 12px 14px; border: 1px dashed var(--brand-200); border-radius: 12px; background: #fbfdff; }
.flist { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; font-size: .9rem; }
.flist:empty { display: none; }
.flist .x { border: 0; background: none; color: #b42318; font-size: 1.1rem; cursor: pointer; padding: 0 6px; }
.fbtn { cursor: pointer; }
.fbtn.is-busy { opacity: .55; pointer-events: none; }
.fbtn.is-busy::after { content: ' — качване…'; }
@media (max-width: 600px) { .form--money { grid-template-columns: 1fr; } .timeline { grid-auto-flow: row; } }

/* ---------- Адрес за договора (IMWEB-55) ---------- */
.dlv { margin-top: 22px; padding: 18px 20px; border: 1.5px solid var(--brand-200); border-radius: 14px; background: #f8fbff; }
.dlv .grp { margin-top: 0; }
.form--dlv { margin-top: 12px; max-width: 900px; }
.form--dlv .row2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; }
.form--dlv input.is-err { border-color: #d92d20; background: #fff5f5; }
@media (max-width: 600px) { .form--dlv .row2 { grid-template-columns: 1fr; } }

/* ---------- Потвърждение на началния баланс (Фаза 1Г) ---------- */
.confirm-card { margin: 0 0 22px; padding: 20px 22px; border: 1.5px solid var(--brand-200); border-radius: 14px; background: #f8fbff; }
.confirm-card h2 { margin: 0 0 6px; font-size: 1.2rem; }
.confirm-card .form--money { margin: 14px 0 6px; }

/* Икони — Bootstrap Icons, както в iM Manager: едноцветни, в синия цвят на системата (вместо цветни емоджи) */
.bi { line-height: 1; vertical-align: -.125em; }
.callout > span:first-child .bi { font-size: 1.15rem; color: var(--brand-600); }
.callout--warn > span:first-child .bi { color: #b54708; }
.callout--err > span:first-child .bi { color: #b42318; }
.callout--ok > span:first-child .bi { color: #1a7f45; }
.done__icon .bi { font-size: 2rem; }
.doc__ic .bi, .tile .bi { color: var(--brand-600); }
.tile .bi-exclamation-triangle { color: #b54708; }

/* Моите заявки — няколко сгради в един акаунт (IMWEB-83) */
.myapps { margin-bottom: 18px; }
.myapps__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.myapps__head h2 { font-size: 1.15rem; margin: 0; }
.myapps__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.myapps__item { display: flex; gap: 10px; align-items: flex-start; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; font: inherit; color: var(--ink); }
.myapps__item .bi { font-size: 1.4rem; color: var(--brand-600); margin-top: 2px; }
.myapps__item small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.myapps__item:hover { border-color: var(--brand-200); }
.myapps__item.is-on { border: 2px solid var(--brand-600); cursor: default; }

/* iManage AI — проверка на документите (IMAI-10) */
.ai-check { margin-top: 18px; }
.ai-check p { margin: 6px 0 0; }
.ai-check__list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.ai-check__item { display: grid; grid-template-columns: 22px 1fr; gap: 6px; align-items: start; }
.ai-check__ic { font-weight: 700; text-align: center; }
.ai-check__item--ok .ai-check__ic { color: #067647; }
.ai-check__item--warn .ai-check__ic { color: #b54708; }
.ai-check__item--fail .ai-check__ic { color: #b42318; }
.ai-check__doc { font-size: .8rem; color: var(--ink-soft); }
.ai-check__stale { font-weight: 600; color: #b54708; }
.ai-check__note { font-size: .8rem; color: var(--ink-soft); }
.ai-check__ok { margin-top: 10px; }
.ai-check__ok summary { cursor: pointer; font-weight: 600; color: #067647; }

/* ---------- iManage AI: чат „Попитай“ (IMAI-12) ---------- */
.aichat-fab { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border: 0; border-radius: 999px; background: var(--brand-900); color: var(--accent-500); font: 700 .95rem var(--font-head); box-shadow: var(--shadow-md); cursor: pointer; }
.aichat-fab:hover { background: var(--brand-800); }
.aichat-fab[aria-expanded="true"] { display: none; }
.aichat { position: fixed; right: 22px; bottom: 22px; z-index: 61; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 110px)); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg, 18px); box-shadow: 0 24px 70px rgba(7, 26, 51, .28); overflow: hidden; }
.aichat[hidden] { display: none; }
.aichat__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; background: var(--brand-900); color: #fff; }
.aichat__head b { display: block; font: 700 1rem var(--font-head); color: var(--accent-500); }
.aichat__head span { font-size: .78rem; color: #b7cbe0; }
.aichat__x { border: 0; background: none; color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.aichat__log { position: relative; flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg-tint, #f5f8fc); }
.aichat__msg { max-width: 88%; padding: 10px 12px; border-radius: 14px; font-size: .9rem; line-height: 1.45; color: var(--ink); background: #fff; border: 1px solid var(--line); overflow-wrap: anywhere; }
.aichat__msg p { margin: 0 0 6px; } .aichat__msg p:last-child { margin-bottom: 0; }
.aichat__msg ol, .aichat__msg ul { margin: 4px 0 6px; padding-left: 20px; } .aichat__msg li { margin: 2px 0; }
.aichat__msg--me { align-self: flex-end; background: var(--brand-600); border-color: var(--brand-600); color: #fff; border-bottom-right-radius: 4px; }
.aichat__msg--ai { align-self: flex-start; border-bottom-left-radius: 4px; }
.aichat__sys { align-self: center; max-width: 92%; text-align: center; font-size: .8rem; color: var(--ink-soft); background: var(--brand-50); border-radius: 10px; padding: 8px 10px; }
.aichat__src { margin-top: 8px; font-size: .78rem; color: var(--muted); } .aichat__src summary { cursor: pointer; } .aichat__src ul { margin: 4px 0 0; padding-left: 16px; }
.aichat__typing { display: inline-flex; gap: 4px; padding: 12px 14px; } .aichat__typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-400); animation: aichatDot 1.2s infinite ease-in-out; }
.aichat__typing span:nth-child(2) { animation-delay: .15s; } .aichat__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes aichatDot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.aichat__hints { display: flex; flex-wrap: wrap; gap: 6px; } .aichat__hint { border: 1px solid var(--brand-200, #cfdcec); background: #fff; color: var(--brand-800); border-radius: 999px; padding: 6px 11px; font-size: .8rem; cursor: pointer; text-align: left; }
.aichat__hint:hover { background: var(--brand-50); }
.aichat__form { border-top: 1px solid var(--line); padding: 10px 12px 8px; background: #fff; }
.aichat__form textarea { width: 100%; resize: none; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font: inherit; font-size: .9rem; }
.aichat__bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; } .aichat__bar .btn { margin-left: auto; padding: 8px 16px; }
.aichat__human { border: 0; background: none; color: var(--brand-700); font-size: .8rem; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0; }
.aichat__left { font-size: .75rem; color: var(--muted); }
.aichat__err { margin: 0 0 6px; font-size: .8rem; color: #b42318; }
.aichat__note { margin: 6px 0 0; font-size: .7rem; color: var(--muted); line-height: 1.35; }
@media (max-width: 560px) { .aichat { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; } .aichat-fab { right: 14px; bottom: 14px; } }

/* ---------- Вид на договора (Преглед и изпращане) ---------- */
.terms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0 8px; }
.term { display: block; position: relative; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px 14px 10px 40px; cursor: pointer; background: #fff; }
.term input { position: absolute; left: 14px; top: 16px; width: 17px; height: 17px; accent-color: var(--brand-600); }
.term b { font: 700 .98rem var(--font-head); color: var(--ink); }
.term ul { margin: 8px 0 0; padding-left: 16px; font-size: .82rem; color: var(--ink-soft); line-height: 1.4; } .term li { margin: 3px 0; }
.term.is-on { border-color: var(--brand-600); background: var(--brand-50); box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
@media (max-width: 900px) { .terms { grid-template-columns: 1fr; } }
