/* DuTAI – a DuTa-Fa arculatához illeszkedő, lebegő chat. */
.dutai-widget { position: fixed; right: 24px; bottom: 94px; z-index: 9000; font-family: inherit; color: #f8f3e9; }
.dutai-launcher { display: inline-flex; align-items: center; gap: 11px; min-height: 60px; max-width: min(300px, calc(100vw - 110px)); padding: 10px 17px 10px 12px; border: 1px solid rgba(230,185,105,.9); border-radius: 999px; background: linear-gradient(145deg,#392716,#17110c); color: #f5d69a; box-shadow: 0 8px 26px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.12); cursor: pointer; text-align: left; transition: transform .2s ease, box-shadow .2s ease; }
.dutai-launcher:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,.48), 0 0 0 4px rgba(218,174,97,.12); }
.dutai-launcher:focus-visible, .dutai-close:focus-visible, .dutai-compose button:focus-visible { outline: 3px solid #f4d18e; outline-offset: 3px; }
.dutai-launcher-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; background: rgba(223,177,95,.13); border: 1px solid rgba(223,177,95,.35); }
.dutai-launcher-icon svg, .dutai-avatar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.dutai-launcher-copy { display: grid; gap: 2px; }
.dutai-launcher-copy strong { font-size: .96rem; line-height: 1.1; letter-spacing: .03em; }
.dutai-launcher-copy small { font-size: .72rem; color: #e1d0b1; white-space: nowrap; }
.dutai-launcher-dot { width: 8px; height: 8px; flex: 0 0 8px; margin-left: 2px; border-radius: 50%; background: #8fc28b; box-shadow: 0 0 0 3px rgba(143,194,139,.13); }
.dutai-panel { box-sizing: border-box; padding: 0; margin: 0; position: absolute; right: 0; bottom: 76px; display: flex; flex-direction: column; width: min(390px, calc(100vw - 28px)); height: min(570px, calc(100dvh - 130px)); min-height: 360px; overflow: hidden; border: 1px solid rgba(211,170,101,.72); border-radius: 18px; background: #171513; box-shadow: 0 22px 70px rgba(0,0,0,.58); transform-origin: right bottom; animation: dutaiPanelIn .22s cubic-bezier(.2,.8,.2,1) both; }
.dutai-panel[hidden] { display: none; }
@keyframes dutaiPanelIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.dutai-panel > .dutai-header { box-sizing: border-box; flex: 0 0 auto; min-height: 76px; margin: 0; padding: 14px 15px; display: flex; align-items: center; gap: 11px; background: linear-gradient(120deg,#342417,#1c1712); border-bottom: 1px solid rgba(221,177,101,.25); }
.dutai-avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border: 1px solid rgba(224,177,93,.55); border-radius: 50%; color: #e9bd72; background: rgba(224,177,93,.1); }
.dutai-header-copy { display: grid; gap: 3px; flex: 1; min-width: 0; }
.dutai-header-copy strong { font-size: 1rem; color: #f4d08c; }
.dutai-header-copy small { color: #c9c1b4; font-size: .74rem; }
.dutai-close { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.2); border-radius: 9px; color: #f6e8ce; background: rgba(0,0,0,.2); font-size: 1.45rem; line-height: 1; cursor: pointer; }
.dutai-panel > .dutai-messages { box-sizing: border-box; display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; gap: 12px; overflow-y: auto; padding: 16px 13px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #8f6a39 #211d18; }
.dutai-message { box-sizing: border-box; max-width: 90%; padding: 11px 13px; border-radius: 14px; font-size: .9rem; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.dutai-message p { margin: 0; color: inherit; font: inherit; text-shadow: none; }
.dutai-message-title { align-self: flex-start; max-width: 94%; padding: 7px 11px; border: 1px solid rgba(213,177,116,.32); border-radius: 8px; background: rgba(212,177,111,.09); color: #f3cd87; font-weight: 800; font-size: .82rem; letter-spacing: .015em; }
.dutai-message-bot { align-self: flex-start; border: 1px solid rgba(213,177,116,.2); border-bottom-left-radius: 4px; background: #27231e; color: #f1eee7; }
.dutai-message-user { align-self: flex-end; border: 1px solid rgba(229,190,119,.5); border-bottom-right-radius: 4px; background: #62451f; color: #fff7e8; }
.dutai-source { display: inline-block; margin-top: 8px; color: #f2cd85; font-size: .78rem; text-decoration: underline; text-underline-offset: 3px; }
.dutai-typing { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; color: #d8c7a7; font-size: .8rem; padding: 8px 11px; border: 1px solid rgba(213,177,116,.16); border-radius: 10px; background: #27231e; }
.dutai-typing-dots { display: inline-flex; align-items: center; gap: 3px; }
.dutai-typing-dots i { display: block; width: 4px; height: 4px; border-radius: 50%; background: #e6bd79; animation: dutaiTypingDot 1s ease-in-out infinite; }
.dutai-typing-dots i:nth-child(2) { animation-delay: .14s; }
.dutai-typing-dots i:nth-child(3) { animation-delay: .28s; }
@keyframes dutaiTypingDot { 0%,60%,100% { opacity:.35; transform:translateY(0); } 30% { opacity:1; transform:translateY(-3px); } }
.dutai-panel > .dutai-compose { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; min-height: 66px; box-sizing: border-box; margin: 0; padding: 11px; border-top: 1px solid rgba(255,255,255,.1); background: #1d1a16; }
.dutai-compose textarea { display: block; flex: 1 1 auto; width: 0; height: 44px; min-height: 44px; max-height: 110px; box-sizing: border-box; margin: 0; resize: none; padding: 10px 12px; border: 1px solid rgba(222,188,128,.28); border-radius: 11px; background: #100f0d; color: #f8f3e9; font: inherit; font-size: .88rem; line-height: 1.4; }
.dutai-compose textarea::placeholder { color: #a9a094; }
.dutai-compose textarea:focus { outline: 2px solid rgba(224,177,93,.55); outline-offset: 1px; }
.dutai-compose button { display: grid; place-items: center; width: 44px; height: 44px; min-width: 44px; min-height: 44px; box-sizing: border-box; flex: 0 0 44px; margin: 0; padding: 0; flex: 0 0 42px; border: 1px solid #d7ad67; border-radius: 11px; background: #d4b16f; color: #1b1711; cursor: pointer; }
.dutai-compose button:disabled { opacity: .55; cursor: wait; }
.dutai-compose button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dutai-panel > .dutai-disclaimer { flex: 0 0 auto; box-sizing: border-box; margin: 0; padding: 0 13px 11px; background: #1d1a16; color: #aaa195; font-size: .68rem; line-height: 1.4; text-align: center; }
.dutai-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.cookie-settings-fab { position: fixed; right: 24px; bottom: 24px; z-index: 9000; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 58px; min-height: 58px; padding: 13px 17px; border: 1px solid rgba(236,194,112,.95); border-radius: 999px; background: linear-gradient(145deg,#302115,#17120d); color: #f4d18e; box-shadow: 0 8px 26px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.12); cursor: pointer; font: inherit; font-weight: 750; transition: transform .2s ease, box-shadow .2s ease; }
.cookie-settings-fab:hover { transform: translateY(-3px); box-shadow: 0 12px 34px rgba(0,0,0,.48), 0 0 0 4px rgba(212,177,111,.12); }
.cookie-settings-fab svg { display: block; width: 28px; height: 28px; flex: 0 0 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cookie-settings-fab svg circle { fill: currentColor; stroke: none; }
.cookie-settings-fab-label { white-space: nowrap; font-size: .88rem; }
.dutai-widget[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .dutai-launcher, .dutai-panel, .dutai-typing-dots i { animation: none; transition: none; } }

/* A weboldal globális section/header stílusai ne tolják el a chat tartalmát. */
.dutai-widget .dutai-panel,
.dutai-widget .dutai-panel[role="dialog"] {
  padding: 0;
  margin: 0;
}
.dutai-widget .dutai-panel > .dutai-header {
  flex-shrink: 0;
}
.dutai-widget .dutai-panel > .dutai-messages {
  flex: 1 1 0%;
  min-height: 0;
  padding-top: 14px;
  padding-bottom: 14px;
}
.dutai-widget .dutai-panel > .dutai-compose,
.dutai-widget .dutai-panel > .dutai-disclaimer {
  flex-shrink: 0;
}

/* Béta verziójelzés – a név mellett, jól olvasható zölddel. */
.dutai-beta-label {
  display: inline-block;
  margin-left: 4px;
  color: #91d39b;
  font-size: .72em;
  font-weight: 850;
  letter-spacing: .025em;
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(116, 205, 132, .13);
}
.dutai-header-copy .dutai-beta-label { font-size: .72em; }
.dutai-launcher-copy .dutai-beta-label { font-size: .7em; }
.dutai-disclaimer a { color: #e7c27d; text-decoration: underline; text-underline-offset: 2px; }


/* Desktop: a vezérlők alaphelyzetben kör alakúak, külön-külön hoverre nyílnak ki. */
@media (min-width: 768px) {
  .dutai-widget .dutai-launcher {
    box-sizing: border-box;
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    height: 60px;
    padding: 10px;
    gap: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: width .22s ease, max-width .22s ease, padding .22s ease, gap .22s ease, transform .2s ease, box-shadow .2s ease;
  }
  .dutai-widget .dutai-launcher .dutai-launcher-copy,
  .dutai-widget .dutai-launcher .dutai-launcher-dot {
    width: 0;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: width .18s ease, max-width .18s ease, opacity .14s ease;
  }
  .dutai-widget .dutai-launcher:hover,
  .dutai-widget.is-open .dutai-launcher {
    width: 300px;
    max-width: min(300px, calc(100vw - 110px));
    padding: 10px 17px 10px 12px;
    gap: 11px;
  }
  .dutai-widget .dutai-launcher:hover .dutai-launcher-copy,
  .dutai-widget.is-open .dutai-launcher .dutai-launcher-copy {
    width: auto;
    max-width: 230px;
    opacity: 1;
  }
  .dutai-widget .dutai-launcher:hover .dutai-launcher-dot,
  .dutai-widget.is-open .dutai-launcher .dutai-launcher-dot {
    width: 8px;
    max-width: 8px;
    opacity: 1;
  }
  .cookie-settings-fab {
    box-sizing: border-box;
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    height: 58px;
    padding: 13px;
    gap: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: width .22s ease, max-width .22s ease, gap .22s ease, padding .22s ease, transform .2s ease, box-shadow .2s ease;
  }
  .cookie-settings-fab-label {
    display: inline-block;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width .18s ease, opacity .14s ease;
  }
  .cookie-settings-fab:hover,
  body.cookie-consent-open .cookie-settings-fab {
    width: 205px;
    max-width: 205px;
    gap: 10px;
    padding: 13px 17px;
  }
  .cookie-settings-fab:hover .cookie-settings-fab-label,
  body.cookie-consent-open .cookie-settings-fab .cookie-settings-fab-label {
    max-width: 145px;
    opacity: 1;
  }
}

@media (max-width: 767px) {
  /* A két lebegő asztali vezérlő mobilon nem jelenik meg; a DuTAI a középső nav-elem. */
  .cookie-settings-fab { display: none; }
  .dutai-widget { position: static; right: auto; bottom: auto; z-index: auto; }
  .dutai-widget .dutai-panel {
    position: fixed;
    z-index: 1150;
    inset: var(--dutai-mobile-top, 96px) 0 var(--dutai-mobile-bottom, 70px) 0;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    transform-origin: center;
  }
  .dutai-widget .dutai-panel > .dutai-header { min-height: 52px; padding: 7px 10px; gap: 8px; }
  .dutai-widget .dutai-avatar { width: 32px; height: 32px; flex-basis: 32px; }
  .dutai-widget .dutai-avatar svg { width: 20px; height: 20px; }
  .dutai-widget .dutai-header-copy { gap: 1px; }
  .dutai-widget .dutai-header-copy strong { font-size: .82rem; }
  .dutai-widget .dutai-header-copy small { font-size: .62rem; }
  .dutai-widget .dutai-close { width: 30px; height: 30px; font-size: 1.2rem; }
  .dutai-widget .dutai-panel > .dutai-messages { gap: 7px; padding: 8px 9px; }
  .dutai-widget .dutai-message { max-width: 94%; padding: 7px 9px; border-radius: 10px; font-size: .76rem; line-height: 1.4; }
  .dutai-widget .dutai-message-title { font-size: .72rem; padding: 5px 8px; }
  .dutai-widget .dutai-typing { gap: 5px; padding: 6px 8px; font-size: .68rem; }
  .dutai-widget .dutai-source { margin-top: 5px; font-size: .68rem; }
  .dutai-widget .dutai-panel > .dutai-compose { min-height: 48px; gap: 6px; padding: 6px 8px; }
  .dutai-widget .dutai-compose textarea { height: 36px; min-height: 36px; max-height: 76px; padding: 7px 9px; border-radius: 8px; font-size: .76rem; }
  .dutai-widget .dutai-compose button { width: 36px; height: 36px; min-width: 36px; min-height: 36px; flex: 0 0 36px; border-radius: 8px; }
  .dutai-widget .dutai-compose button svg { width: 18px; height: 18px; }
  .dutai-widget .dutai-panel > .dutai-disclaimer { padding: 0 8px 6px; font-size: .57rem; line-height: 1.25; }
  .mobile-bottom-nav { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .dutai-mobile-launcher {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 52px;
    height: 100%;
    padding: 2px 1px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #f0d39c;
    box-shadow: none;
    overflow: visible;
    text-align: center;
  }
  .dutai-mobile-launcher:hover { transform: none; box-shadow: none; }
  .dutai-mobile-launcher .dutai-launcher-icon { width: 22px; height: 22px; flex-basis: 22px; border: 0; background: transparent; }
  .dutai-mobile-launcher .dutai-launcher-icon svg { width: 22px; height: 22px; }
  .dutai-mobile-launcher .dutai-launcher-copy { display: grid; width: auto; max-width: 100%; gap: 0; opacity: 1; overflow: visible; }
  .dutai-mobile-launcher .dutai-launcher-copy strong { font-size: .63rem; line-height: 1.05; letter-spacing: 0; }
  .dutai-mobile-launcher .dutai-launcher-copy .dutai-beta-label { font-size: .55em; margin-left: 1px; }
  .dutai-mobile-launcher .dutai-launcher-copy small,
  .dutai-mobile-launcher .dutai-launcher-dot { display: none; }
  body.dutai-mobile-open .homepage-main-content,
  body.dutai-mobile-open main,
  body.dutai-mobile-open footer,
  body.dutai-mobile-open #lightbox,
  body.dutai-mobile-open .cookie-consent-minimized { display: none; }
  body.dutai-mobile-open .site-header,
  body.dutai-mobile-open .mobile-bottom-nav { visibility: visible; }
}
