/* ================================================================
   AI PRÁVNÍK
   ================================================================ */
.ai-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ================================================================
   LANDING MODE — HERO
   ================================================================ */

.ai-hero {
    background: var( --color-primary );
    border-radius: 12px;
    padding: var( --space-3xl ) var( --space-xl ) var( --space-2xl );
    margin-bottom: var( --space-lg );
    text-align: center;
    color: white;
}

.ai-hero-icon {
    font-size: 48px;
    margin-bottom: var( --space-sm );
    line-height: 1;
}

.ai-hero h1 {
    font-family: var( --font-heading );
    font-size: 32px;
    color: white;
    margin-bottom: var( --space-sm );
    line-height: 1.3;
}

.ai-hero-subtitle {
    font-size: 17px;
    color: rgba( 255, 255, 255, 0.85 );
    margin: 0 auto var( --space-xl );
    max-width: 480px;
    line-height: 1.5;
}

/* Zelené fajfky v hero trust items */
.ai-check {
    color: #4CAF50;
    font-weight: 700;
}

/* ================================================================
   LANDING MODE — SROVNÁNÍ
   ================================================================ */

.ai-comparison {
    background: var( --color-bg-cream );
    border: 1px solid var( --color-border-gold );
    border-radius: 12px;
    padding: var( --space-xl );
    margin-bottom: var( --space-lg );
}

.ai-comparison-question {
    font-size: 15px;
    font-weight: 600;
    color: var( --color-primary );
    margin-bottom: var( --space-lg );
    padding-left: var( --space-lg );
    border-left: 3px solid var( --color-accent-gold );
    line-height: 1.5;
}

.ai-comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var( --space-lg );
    align-items: start;
}

/* Sloupec "běžná AI" — krátký, šedý, nevýrazný */
.ai-comp-bad {
    background: var( --color-bg-light-gray );
    border: 1px solid var( --color-border-light );
    border-radius: 10px;
    padding: var( --space-lg );
}

.ai-comp-bad h4 {
    font-size: 12px;
    font-weight: 600;
    color: var( --color-text-light );
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var( --space-sm );
}

.ai-comp-bad p {
    font-size: 14px;
    line-height: 1.6;
    color: var( --color-text-light );
    margin: 0;
}

/* Sloupec "AI právník" — dlouhý, strukturovaný, s fade */
.ai-comp-good {
    background: var( --color-bg-white );
    border: 1px solid var( --color-border-gold );
    border-radius: 10px;
    padding: var( --space-lg );
    box-shadow: 0 2px 8px rgba( 196, 162, 101, 0.1 );
    position: relative;
    overflow: hidden;
    max-height: 320px;
}

.ai-comp-good::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient( to bottom, transparent, var( --color-bg-white ) );
    pointer-events: none;
}

.ai-comp-good h4 {
    font-size: 12px;
    font-weight: 600;
    color: var( --color-accent-gold-dark );
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var( --space-sm );
}

.ai-comp-good p {
    font-size: 14px;
    line-height: 1.6;
    color: var( --color-text-dark );
    margin: 0 0 var( --space-sm );
}

.ai-comp-heading {
    font-size: 14px;
    font-weight: 700;
    color: var( --color-primary );
    margin: var( --space-md ) 0 var( --space-xs );
}

.ai-comp-heading:first-of-type {
    margin-top: 0;
}

.ai-comp-good ul {
    margin: var( --space-xs ) 0 var( --space-sm );
    padding-left: var( --space-lg );
}

.ai-comp-good li {
    font-size: 14px;
    line-height: 1.5;
    color: var( --color-text-dark );
    margin-bottom: 3px;
}

.ai-cite {
    color: var( --color-accent-gold );
    font-weight: 500;
}

.ai-comp-more {
    text-align: center;
    font-size: 12px;
    color: var( --color-text-light );
    margin-top: var( --space-md );
}

/* ================================================================
   CHAT AREA
   ================================================================ */

.ai-chat-area {
    background: var( --color-bg-white );
    border: 1px solid var( --color-border-light );
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba( 0, 0, 0, 0.06 );
    margin-bottom: var( --space-lg );
    overflow: hidden;
}

/* ================================================================
   TOOLBAR — skrytý v landing mode, viditelný v chat mode
   ================================================================ */

.ai-toolbar {
    display: none;
}

/* Conversations toolbar (landing mode) — skrytý, přístup k historii je přes toolbar v chat mode */
.ai-status {
    display: none;
}

.conversations-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var( --color-primary );
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
    font-weight: 500;
}

.conversations-toggle:hover {
    text-decoration: underline;
}

.dropdown-arrow {
    transition: transform 0.2s ease;
}

.conversations-toggle.open .dropdown-arrow {
    transform: rotate( 180deg );
}

.conversations-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var( --color-bg-white );
    border: 1px solid var( --color-border-light );
    border-top: none;
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba( 0, 0, 0, 0.1 );
}

.conversations-list.open {
    display: block;
}

.conversations-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var( --color-border-light );
    transition: background 0.15s ease;
}

.conversations-item:hover,
.conversations-item--active {
    background: var( --color-bg-cream );
}

.conversations-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var( --color-primary );
    margin-bottom: 2px;
}

.conversations-item-meta {
    font-size: 12px;
    color: var( --color-text-light );
}

.conversations-empty {
    padding: 16px;
    text-align: center;
    color: var( --color-text-light );
    font-size: 13px;
}

.conversations-new-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var( --color-border-light );
    border-radius: 6px;
    color: var( --color-primary );
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 10px;
    font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
    margin-left: auto;
}

.conversations-new-btn:hover {
    background: var( --color-primary );
    color: white;
    border-color: var( --color-primary );
}

/* ================================================================
   LANDING MODE — KATEGORIE
   ================================================================ */

.ai-categories {
    padding: var( --space-lg );
}

.ai-categories-label {
    font-family: var( --font-heading );
    font-size: 22px;
    font-weight: 700;
    color: var( --color-primary );
    margin-bottom: var( --space-md );
    text-align: center;
}

.ai-category-grid {
    display: grid;
    grid-template-columns: repeat( 3, 1fr );
    gap: var( --space-sm );
}

.ai-category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: var( --space-md ) var( --space-sm );
    background: var( --color-bg-white );
    border: 1px solid var( --color-border-light );
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    font-family: var( --font-body );
    font-size: 14px;
    font-weight: 500;
    color: var( --color-text-dark );
    text-align: center;
}

.ai-category-btn span {
    font-size: 28px;
    line-height: 1;
}

.ai-category-btn:hover {
    border-color: var( --color-accent-gold );
    background: var( --color-bg-warm-sand );
}

/* OR separator */
.ai-or-sep {
    display: flex;
    align-items: center;
    gap: var( --space-md );
    padding: 0 var( --space-lg );
    margin-bottom: var( --space-md );
}

.ai-or-sep::before,
.ai-or-sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var( --color-border-light );
}

.ai-or-sep span {
    font-size: 12px;
    color: var( --color-text-light );
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
    white-space: nowrap;
}

/* ================================================================
   MESSAGES AREA
   ================================================================ */

.ai-messages {
    padding: var( --space-xl );
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var( --space-md );
}

.ai-messages:not( :has( .ai-message ) ) {
    padding: 0;
    min-height: 0;
}

.ai-empty-hint {
    font-size: 13px;
    color: var( --color-text-light );
}

/* Chat messages (JS-created) */
.ai-message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.6;
}

.ai-message.user,
.ai-message.ai-message--user {
    align-self: flex-end;
    background: #4B6382;
    color: white;
    border-radius: 12px 12px 2px 12px;
}

.ai-message.assistant,
.ai-message.ai-message--assistant {
    align-self: flex-start;
    background: var( --color-bg-cream );
    color: var( --color-text-dark );
    border-radius: 2px 12px 12px 12px;
    border: 1px solid var( --color-border-light );
}

.ai-message.ai-message--error {
    align-self: center;
    background: var( --color-error-bg, #fff5f5 );
    color: var( --color-error, #c0392b );
    border: 1px solid var( --color-error, #c0392b );
    max-width: 100%;
    font-size: 14px;
}

/* JS hook: .ai-no-followup — querySelector selektor v ai.js (disable input when follow-up not supported). No styles needed. */

.ai-message.ai-message--info {
    align-self: center;
    background: var( --color-bg-cream );
    color: var( --color-text-medium );
    border: 1px solid var( --color-border-light );
    max-width: 100%;
    font-size: 14px;
    font-style: italic;
}

.ai-message-bubble {
    word-break: break-word;
}

/* Nadpisy vygenerované z markdown uvnitř AI odpovědi — menší než globální h1-h3 */
.ai-message-bubble h1,
.ai-message-bubble h2,
.ai-message-bubble h3,
.ai-message-bubble h4 {
    font-size: 1em;
    font-weight: 700;
    margin: 1em 0 0.3em;
    line-height: 1.4;
    color: var( --color-text-dark );
    letter-spacing: 0;
    text-transform: none;
}
.ai-message-bubble h1 { font-size: 1.05em; }
.ai-message-bubble h2 { font-size: 1em; }
.ai-message-bubble h3,
.ai-message-bubble h4 { font-size: 0.95em; color: var( --color-text-medium ); }

.ai-message--streaming .ai-message-bubble {
    opacity: 0.85;
}

/* .ai-message--done — JS state marker, no visual style (class added programmatically) */

/* Progress indicator */
.ai-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var( --color-text-light );
}

.ai-progress-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var( --color-border-light );
    border-top-color: var( --color-accent-gold );
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.ai-progress-step {
    color: var( --color-text-light );
    font-size: 14px;
}

@keyframes spin {
    to { transform: rotate( 360deg ); }
}

/* Paywall */
.ai-paywall {
    background: var( --color-bg-cream );
    border: 1px solid var( --color-border-gold );
    border-radius: 8px;
    padding: var( --space-md );
    margin-top: var( --space-md );
    text-align: center;
}

.ai-paywall-lock {
    font-size: 24px;
    margin-bottom: 8px;
}

.ai-paywall-teasers {
    list-style: none;
    padding: 0;
    margin: var( --space-md ) auto;
    text-align: left;
    width: fit-content;
}

.ai-paywall-teasers li {
    padding: 3px 0;
    font-size: 14px;
    color: var( --color-text-medium );
}

.ai-teaser-icon {
    display: inline-block;
    width: 24px;
    text-align: center;
    font-size: 16px;
}

.ai-teaser-icon.ai-teaser-paragraph {
    color: var( --color-accent-gold );
    font-weight: 700;
    font-size: 18px;
}

.ai-paywall-summary {
    color: var( --color-text-medium );
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: var( --space-md );
    text-align: left;
}

.ai-paywall-summary::before,
.ai-paywall-preview::before,
.ai-streaming-analysis::before {
    content: attr( data-label );
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var( --color-accent-gold );
    margin-bottom: 6px;
}

.ai-streaming-analysis {
    text-align: left;
}

.ai-paywall-preview {
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
    text-align: left;
}

.ai-paywall-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient( to bottom, transparent, var( --color-bg-cream ) );
    pointer-events: none;
}

.ai-paywall-content-wrap {
    display: none;
}

.ai-paywall-btn {
    background: var( --color-accent-gold );
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-family: var( --font-body );
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ai-paywall-btn:hover {
    background: var( --color-accent-gold-dark );
}

/* ================================================================
   INPUT AREA
   ================================================================ */

.ai-input-area {
    padding: var( --space-md ) var( --space-lg );
    border-top: 1px solid var( --color-border-light );
}

.ai-input-row {
    display: flex;
    gap: var( --space-sm );
    align-items: flex-end;
}

.ai-input {
    flex: 1;
    padding: 14px 18px;
    font-family: var( --font-body );
    font-size: 15px;
    border: 1px solid var( --color-border-light );
    border-radius: 8px;
    resize: vertical;
    min-height: 140px;
    max-height: 300px;
    background: var( --color-bg-white );
    color: var( --color-text-dark );
    transition: border-color 0.2s ease;
    line-height: 1.5;
}

.ai-input:focus {
    outline: none;
    border-color: var( --color-accent-gold );
    box-shadow: 0 0 0 3px rgba( 196, 162, 101, 0.12 );
}

.ai-input::placeholder {
    color: var( --color-text-light );
}

.ai-input:disabled {
    background: var( --color-bg-cream );
    color: var( --color-text-light );
    cursor: not-allowed;
}

.ai-send-btn {
    padding: 14px 28px;
    background: var( --color-accent-gold );
    color: white;
    border: none;
    border-radius: 8px;
    font-family: var( --font-body );
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
    align-self: flex-end;
    height: 56px;
}

.ai-send-btn:hover {
    background: var( --color-accent-gold-dark );
}

.ai-send-btn:disabled {
    background: var( --color-border-light );
    color: var( --color-text-light );
    cursor: not-allowed;
}

.ai-input-hint {
    font-size: 12px;
    color: var( --color-text-light );
    margin-top: 6px;
}

.ai-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.ai-faq-footer-link {
    font-size: 12px;
    color: var( --color-text-light );
    text-decoration: underline;
    white-space: nowrap;
    margin-top: 6px;
}

.ai-faq-footer-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    color: var( --color-text-light );
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
}

.ai-faq-footer-link:hover,
.ai-faq-footer-btn:hover {
    color: var( --color-primary );
}

/* Law reference citations (linkifyLawReferences in ai.js) */
.citation {
    color: var( --color-accent-gold );
    text-decoration: underline;
    text-decoration-style: dotted;
    font-weight: 500;
}

.citation:hover {
    color: var( --color-primary );
}

/* ================================================================
   STICKY CTA (locked state, místo textarea)
   ================================================================ */

.ai-sticky-cta {
    flex-shrink: 0;
    border-top: 1px solid var( --color-border-gold );
    background: var( --color-bg-cream );
    padding: var( --space-md ) 20px;
}

.ai-sticky-cta-inner {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: var( --space-lg );
}

.ai-sticky-cta-text {
    flex: 1;
}

.ai-sticky-cta-text strong {
    display: block;
    font-size: 15px;
    color: var( --color-primary );
    margin-bottom: 2px;
}

.ai-sticky-cta-text span {
    font-size: 13px;
    color: var( --color-text-medium );
}

.ai-sticky-cta .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ================================================================
   PAYMENT CONFIRMATION MODAL
   ================================================================ */

.payment-confirmation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1100;
    align-items: center;
    justify-content: center;
}

.payment-confirmation-modal.modal--open {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba( 0, 0, 0, 0.5 );
}

.modal-content {
    position: relative;
    background: var( --color-bg-white );
    width: 90%;
    max-width: 520px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba( 0, 0, 0, 0.18 );
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: var( --space-lg ) var( --space-xl );
    border-bottom: 1px solid var( --color-border-light );
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: var( --font-heading );
    font-size: 20px;
    color: var( --color-primary );
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var( --color-text-light );
    padding: 8px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var( --color-primary );
}

.modal-body {
    padding: var( --space-xl );
}

.payment-info {
    text-align: center;
}

.payment-info .payment-icon {
    margin-bottom: var( --space-lg );
}

.payment-info h4 {
    font-family: var( --font-heading );
    font-size: 20px;
    color: var( --color-primary );
    margin-bottom: var( --space-md );
}

.payment-info p {
    color: var( --color-text-medium );
    line-height: 1.6;
    margin-bottom: var( --space-md );
}

.payment-details {
    background: var( --color-bg-cream );
    padding: var( --space-lg );
    border-radius: 8px;
    margin: var( --space-lg ) 0;
    border: 1px solid var( --color-border-gold );
}

.price-display {
    margin-bottom: 8px;
}

.price-amount {
    font-family: var( --font-heading );
    font-size: 36px;
    font-weight: 700;
    color: var( --color-primary );
}

.price-currency {
    font-family: var( --font-heading );
    font-size: 20px;
    color: var( --color-primary );
    margin-left: 4px;
}

.price-description {
    color: var( --color-text-light );
    font-size: 14px;
    margin: 0;
}

.payment-actions {
    display: flex;
    gap: var( --space-md );
    justify-content: center;
    margin-top: var( --space-lg );
}

/* ================================================================
   EMPTY STATE — GUIDED FLOW
   ================================================================ */

#guidedFlow {
    width: 100%;
}

/* Guided breadcrumb — odsazení a flex layout */
#guidedBreadcrumb {
    display: flex;
    align-items: center;
    gap: var( --space-sm );
    margin-bottom: var( --space-sm );
    padding: var( --space-lg );
}

#guidedSubcategories {
    padding: 0 var( --space-lg ) var( --space-lg );
}

#guidedBreadcrumb .back_link {
    margin-bottom: 0;
}

/* Breadcrumb icon (emoji kategorie) */
.ai-breadcrumb-icon {
    font-size: 20px;
}

/* ================================================================
   FAQ MODAL
   ================================================================ */

/* .ai-faq-dialog rozšiřuje .dialog — bez duplikace, jen specifické přepisy */
.ai-faq-dialog h3 {
    margin-bottom: var( --space-lg );
}

/* ================================================================
   CHAT MODE — body.ai-chat-mode
   ================================================================ */

body.ai-chat-mode {
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

body.ai-chat-mode > .container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: none;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

body.ai-chat-mode .header {
    flex-shrink: 0;
    border-bottom: 1px solid var( --color-border-light );
}

body.ai-chat-mode .footer,
body.ai-chat-mode > .copyright {
    display: none;
}

body.ai-chat-mode .question-page {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

body.ai-chat-mode .ai-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Skrýt landing sekce v chat mode */
body.ai-chat-mode .ai-hero,
body.ai-chat-mode .ai-comparison,
body.ai-chat-mode .ai-categories,
body.ai-chat-mode .ai-or-sep,
body.ai-chat-mode .ai-status,
body.ai-chat-mode #infoSection,
body.ai-chat-mode #faqSection,
body.ai-chat-mode #guidedFlow {
    display: none;
}

/* Výjimka: v chat mode při prázdném novém dotazu zobrazit kategorie a guided flow */
body.ai-chat-mode.ai-chat-mode--empty .ai-categories,
body.ai-chat-mode.ai-chat-mode--empty #guidedFlow {
    display: block;
}

/* Toolbar viditelný v chat mode */
body.ai-chat-mode .ai-toolbar {
    display: block;
    flex-shrink: 0;
    background: var( --color-bg-cream );
    border-bottom: 1px solid var( --color-border-light );
}

.ai-toolbar-inner {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    gap: var( --space-sm );
    font-size: 13px;
    max-width: 820px;
    margin: 0 auto;
}

.ai-toolbar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var( --color-primary );
    font-size: 14px;
}

.ai-toolbar-title span {
    font-size: 18px;
}

.ai-toolbar-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var( --space-sm );
}

.ai-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid var( --color-border-light );
    border-radius: 6px;
    color: var( --color-primary );
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 10px;
    font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ai-toolbar-btn:hover {
    background: var( --color-primary );
    color: white;
    border-color: var( --color-primary );
}

.ai-toolbar-conversations {
    position: relative;
}

.ai-toolbar-dropdown {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var( --color-primary );
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
}

.ai-toolbar-dropdown:hover {
    color: var( --color-accent-gold );
}

.ai-toolbar-dropdown svg {
    margin-left: 2px;
}

.ai-toolbar-arrow {
    font-size: 10px;
}

/* Conversations list když je v toolbaru (chat mode) */
.ai-toolbar-conversations .conversations-list {
    top: calc( 100% + 4px );
    left: auto;
    right: 0;
    min-width: 240px;
    border-top: 1px solid var( --color-border-light );
    border-radius: 0 0 8px 8px;
}

/* Chat area v chat mode — zabere vše */
body.ai-chat-mode .ai-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    overflow: hidden;
}

/* Messages v chat mode — jediný scrollbar */
body.ai-chat-mode .ai-messages {
    flex: 1;
    height: 0;
    overflow-y: auto;
    max-height: none;
    min-height: 0;
    padding: var( --space-lg ) 20px;
}

/* Input area v chat mode — kratší textarea */
body.ai-chat-mode .ai-input-area {
    flex-shrink: 0;
    border-top: 1px solid var( --color-border-light );
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    padding: var( --space-md ) 20px var( --space-lg );
    background: var( --color-bg-white );
}

body.ai-chat-mode .ai-input {
    min-height: 48px;
    max-height: 200px;
    resize: none;
    padding: 12px 16px;
}

body.ai-chat-mode .ai-send-btn {
    padding: 12px 24px;
    height: 48px;
    align-self: auto;
}

/* ================================================================
   BACKWARD COMPAT — V.pravnik-online (uses old header layout)
   ================================================================ */

.ai-header {
    background: var( --color-primary );
    border-radius: 12px;
    padding: var( --space-xl );
    margin-bottom: var( --space-lg );
    color: white;
}

.ai-logo {
    display: flex;
    align-items: flex-start;
    gap: var( --space-md );
}

.ai-scales-icon {
    font-size: 36px;
    flex-shrink: 0;
    line-height: 1;
}

.ai-title-group h1 {
    font-family: var( --font-heading );
    font-size: 26px;
    color: white;
    margin-bottom: 4px;
}

.ai-subtitle {
    font-size: 14px;
    color: rgba( 255, 255, 255, 0.75 );
    margin: 0;
}

.ai-subtitle a {
    color: var( --color-accent-gold );
    text-decoration: underline;
}

/* ================================================================
   RESPONSIVE — MOBILE
   ================================================================ */

@media ( max-width: 767px ) {
    .ai-hero {
        padding: var( --space-2xl ) var( --space-md ) var( --space-xl );
    }

    .ai-hero h1 {
        font-size: 26px;
    }

    .ai-comparison-grid {
        grid-template-columns: 1fr;
    }

    .ai-category-grid {
        grid-template-columns: repeat( 2, 1fr );
    }

    .ai-sticky-cta-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: var( --space-sm );
    }

    .ai-toolbar-title {
        display: none;
    }
}

/* ================================================================
   RESPONSIVE — DESKTOP (1024px+)
   ================================================================ */

@media ( min-width: 1024px ) {
    .ai-container {
        padding: 0;
    }
}
