/* ADINET AI chat widget. Colours come from the admin panel via --adc-color / --adc-on. */
.adc {
    --adc-color: #1a3464;
    --adc-on: #ffffff;
    --adc-bg: #ffffff;
    --adc-text: #1f2937;
    --adc-muted: #6b7280;
    --adc-line: #e5e7eb;
    --adc-soft: #f3f4f6;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.45;
    color: var(--adc-text);
}
.adc *, .adc *::before, .adc *::after { box-sizing: border-box; }

/* ── Floating bubble ─────────────────────────────────────────────── */
.adc--bubble { position: fixed; bottom: 18px; z-index: 1040; }
.adc--right { right: 18px; }
.adc--left { left: 18px; }

.adc-launcher {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 52px; min-width: 52px; padding: 0 18px; border: 0; border-radius: 26px;
    background: var(--adc-color); color: var(--adc-on);
    font: inherit; font-weight: 600; cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
    transition: transform .15s ease, box-shadow .15s ease;
}
.adc-launcher:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, .3); }
.adc--open .adc-launcher { display: none; }

.adc--bubble .adc-panel {
    position: absolute; bottom: 0; width: 380px; max-width: calc(100vw - 24px);
    height: min(600px, calc(100vh - 36px)); height: min(600px, calc(100dvh - 36px));
}
.adc--right .adc-panel { right: 0; }
.adc--left .adc-panel { left: 0; }

/* ── Panel (shared by bubble and page) ───────────────────────────── */
.adc-panel {
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--adc-bg); border: 1px solid var(--adc-line); border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .28);
}
.adc-panel[hidden] { display: none; }
.adc--page { max-width: 820px; margin: 0 auto; }
.adc--page .adc-panel { height: min(680px, calc(100vh - 220px)); min-height: 460px; box-shadow: 0 4px 18px rgba(0, 0, 0, .1); }

.adc-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 12px 14px; background: var(--adc-color); color: var(--adc-on);
}
.adc-title { margin: 0; font-size: 1.05rem; font-weight: 700; color: inherit; }
.adc-titlebox { display: flex; flex-direction: column; min-width: 0; }
.adc-preview { font-size: .68rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
.adc-tools { display: flex; gap: 2px; }
.adc-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
    border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer;
}
.adc-icon-btn:hover { background: rgba(255, 255, 255, .18); }
.adc-icon-btn svg { width: 20px; height: 20px; }

.adc-log { flex: 1 1 auto; overflow-y: auto; padding: 14px; background: var(--adc-soft); scroll-behavior: smooth; }
.adc-row { display: flex; margin-bottom: 10px; }
.adc-row--user { justify-content: flex-end; }
.adc-bubble {
    max-width: 88%; padding: 9px 12px; border-radius: 14px; background: var(--adc-bg);
    border: 1px solid var(--adc-line); word-wrap: break-word; overflow-wrap: anywhere;
}
.adc-row--user .adc-bubble { background: var(--adc-color); color: var(--adc-on); border-color: var(--adc-color); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.adc-row--bot .adc-bubble { border-bottom-left-radius: 4px; }
.adc-row--error .adc-bubble { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.adc-row--welcome .adc-bubble { background: var(--adc-bg); }

.adc-h { margin: .2em 0 .45em; font-weight: 700; font-size: 1.02em; color: var(--adc-color); }
.adc-tablewrap { margin: 0 0 .7em; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--adc-border, rgba(0,0,0,.12)); border-radius: 8px; }
.adc-table { width: 100%; border-collapse: collapse; font-size: .9em; }
.adc-table th, .adc-table td { padding: 6px 9px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--adc-border, rgba(0,0,0,.1)); }
.adc-table th { background: var(--adc-soft); font-weight: 700; white-space: nowrap; }
.adc-table tbody tr:last-child td { border-bottom: 0; }
.adc-p { margin: 0 0 .55em; }
.adc-p:last-child { margin-bottom: 0; }
.adc-list { margin: 0 0 .55em; padding-left: 1.25em; }
.adc-list li { margin-bottom: .25em; }
.adc-cite { font-weight: 700; font-size: .8em; vertical-align: super; text-decoration: none; color: var(--adc-color); padding: 0 1px; }
.adc-cite:hover, .adc-cite:focus-visible { text-decoration: underline; }

.adc-sources { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--adc-line); font-size: .86em; }
.adc-sources-title { font-weight: 700; color: var(--adc-muted); text-transform: uppercase; letter-spacing: .05em; font-size: .72rem; margin-bottom: 4px; }
.adc-sources-list { margin: 0; padding-left: 1.4em; }
.adc-sources-list a { color: var(--adc-color); }

.adc-dot { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: var(--adc-muted); animation: adc-bounce 1.1s infinite ease-in-out; }
.adc-dot:nth-child(2) { animation-delay: .15s; }
.adc-dot:nth-child(3) { animation-delay: .3s; }
.adc-wait { display: inline-block; color: var(--adc-muted); font-size: .95em; }
.adc-wait--swap { animation: adc-swap .45s ease-out; }
@keyframes adc-swap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes adc-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }

.adc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; background: var(--adc-soft); }
.adc-chips:empty { display: none; }
.adc-chip {
    padding: 6px 12px; border: 1px solid var(--adc-color); border-radius: 16px; background: var(--adc-bg);
    color: var(--adc-color); font: inherit; font-size: .88rem; cursor: pointer; text-align: left;
}
.adc-chip:hover { background: var(--adc-color); color: var(--adc-on); }

.adc-captcha-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.adc-captcha-q { font-weight: 700; }
.adc-captcha-form .adc-input { width: 90px; flex: 0 0 auto; }

.adc-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--adc-line); background: var(--adc-bg); position: relative; }
.adc-input {
    flex: 1 1 auto; min-width: 0; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px;
    font: inherit; color: var(--adc-text); background: #fff;
}
.adc-input:disabled { background: var(--adc-soft); }
.adc-send {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 auto;
    border: 0; border-radius: 10px; background: var(--adc-color); color: var(--adc-on); cursor: pointer;
}
.adc-send:disabled { opacity: .55; cursor: not-allowed; }
.adc-send svg { width: 20px; height: 20px; }
.adc-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.adc-quota { padding-bottom: 0; font-weight: 600; }
.adc-note { margin: 0; padding: 6px 14px 10px; font-size: .75rem; color: var(--adc-muted); background: var(--adc-bg); }

.adc button:focus-visible, .adc a:focus-visible, .adc input:focus-visible {
    outline: 3px solid #f59e0b; outline-offset: 2px;
}

/* ── Phones: the bubble opens as a full-screen sheet ─────────────── */
@media (max-width: 575.98px) {
    .adc--bubble .adc-panel {
        position: fixed; inset: 0; width: 100vw; max-width: none; height: 100vh; height: 100dvh; border-radius: 0; border: 0;
    }
}
@media (max-width: 767.98px) {
    .adc--hide-mobile.adc--bubble { display: none; }
    .adc--page .adc-panel { height: calc(100vh - 200px); height: calc(100dvh - 200px); min-height: 420px; }
}
@media (prefers-reduced-motion: reduce) {
    .adc-launcher, .adc-dot, .adc-wait--swap { transition: none; animation: none; }
    .adc-log { scroll-behavior: auto; }
}
@media print { .adc--bubble { display: none; } }

/* ── /ask page: chat + "how to ask" side panel ─────────────────────────── */
.adc-askgrid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.adc-askgrid .adc--page { max-width: none; }
.adc-side { background: var(--adc-soft, #f4f6fb); border: 1px solid rgba(0, 0, 0, .09); border-radius: 14px; font-size: .92rem; color: #1f2937; overflow: hidden; }
.adc-side-toggle { display: flex; align-items: center; width: 100%; padding: 12px 14px; border: 0; background: transparent; font-weight: 700; font-size: 1rem; color: inherit; text-align: left; cursor: pointer; }
.adc-side-toggle[aria-expanded="true"] .adc-side-chev { transform: rotate(180deg); }
.adc-side-body { display: none; padding: 0 14px 14px; }
.adc-side-body.is-open { display: block; }
.adc-side-title { display: none; margin: 0 0 .5rem; font-size: 1.05rem; font-weight: 700; }
.adc-side-intro { margin: 0 0 .8rem; }
.adc-side-h { margin: .9rem 0 .4rem; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; }
.adc-side-examples { display: flex; flex-direction: column; gap: 6px; }
.adc-side-q { text-align: left; padding: 8px 10px; border: 1px solid rgba(0, 0, 0, .14); border-radius: 10px; background: #fff; font-size: .9rem; color: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.adc-side-q:hover, .adc-side-q:focus-visible { border-color: #1A3464; background: #eef3fb; outline: none; }
.adc-side-tips { margin: 0; padding-left: 1.15em; }
.adc-side-tips li { margin-bottom: .3em; }
.adc-side-compare { margin-top: .9rem; display: flex; flex-direction: column; gap: 6px; }
.adc-side-good, .adc-side-bad { display: flex; align-items: flex-start; padding: 7px 10px; border-radius: 10px; font-size: .88rem; }
.adc-side-good { background: #e8f6ee; color: #14532d; }
.adc-side-bad { background: #fdecec; color: #7f1d1d; }
.adc-side-good i, .adc-side-bad i { margin-top: .15em; }
.adc-side-know { margin: .9rem 0 0; color: #4b5563; }
.adc-side-footer { margin: .7rem 0 0; padding-top: .7rem; border-top: 1px solid rgba(0, 0, 0, .1); }
.adc-side a { color: #1A3464; }
.adc-askgrid--m-hidden .adc-side { display: none; }

@media (min-width: 992px) {
    .adc-askgrid { grid-template-columns: var(--adc-cols); }
    .adc-askgrid--left { grid-template-columns: var(--adc-cols-l); }
    .adc-askgrid--left .adc-askgrid-chat { order: 2; }
    .adc-askgrid--left .adc-side { order: 1; }
    .adc-askgrid--m-hidden .adc-side { display: block; }
    .adc-askgrid .adc--page .adc-panel { height: max(460px, var(--adc-page-h)); }
    .adc-side { position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow-y: auto; }
    .adc-side-toggle { display: none; }
    .adc-side-body { display: block; padding-top: 14px; }
    .adc-side-title { display: block; }
}
@media (max-width: 991.98px) {
    .adc-askgrid-chat { order: 1; }
    .adc-side { order: 2; }
}
@media (prefers-reduced-motion: reduce) { .adc-side-q { transition: none; } }
