/* ==========================================================
   ANSWER DEV CSS — BASE / MAIN UI
   Source: former first inline <style> block, answer.html lines 14–752
   ========================================================== */

   html, body{
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    background: linear-gradient(
        to bottom,
        #1f3554 2%,   /* più chiaro del tuo #162640 */
        #2d4872 40%,  /* fascia centrale più morbida */
        #5476a0 100%  /* fondo più chiaro e coerente */
    );
    background-attachment: fixed;
}
#tire-header{
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}

#tire-logo{
    height: 60px;          /* adatta se serve */
}

.tire-titles h1{
    margin: 0;
    font-family: "Century Gothic", system-ui, -apple-system, sans-serif;
    font-size: 22px;
}

.tire-subtitle{
    margin: 4px 0 0;
    font-size: 16px;
    opacity: 0.85;
}

.tire-acronym-main{
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.9;
}
   .container{
  max-width: 1200px;
  width: min(1200px, calc(100% - 28px));
  margin: 12px auto 44px auto;
  border-radius: 18px;
  padding: 20px 22px 22px 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.30);
}

.site-hero{
  font-size: 16px;
  margin-top: 10px;
  opacity: 0.92;
  line-height: 1.35;
}

.site-micro{
  font-size: 12px;
  margin-top: 8px;
  opacity: 0.85;
}

/* =========================
   TIRE UI — BOX STRUTTURALI
   ========================= */



/* TEMP: hide AI Settings (beta profili via login applicativo) */
#ai-settings,
#ai-settings-compact{
  display: none !important;
}
/* ===== TIRE small buttons (mobile-friendly) ===== */

.tire-mini-btn{
  width: auto;
  padding: 5px 8px;
  font-size: 11px;
  line-height: 1.15;
  border-radius: 5px;
  border: 1px solid #858c9b;
  background: linear-gradient(to bottom, #d3d7df 0%, #b5bac6 100%);
  color: #1b2838;
  font-weight: 600;
  cursor: pointer;
}

.tire-mini-btn:active{
  transform: translateY(1px);
}

.site-titles{
  text-align: center;
}
/* Base “soft blue” per tutti i box */

/* Textareas: stesso mood (non bianco sparato) */
textarea{
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 12px;
  background: rgba(220,230,242,0.78);
  color: #1b2838;
  padding: 12px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
}
.site-title-row{
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =========================
   ANSWER LAYOUT: 2 COLONNE
   ========================= */

#answer-layout{
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: start;
  width: 100%;
  height: 100%;
  min-height: 0;
}

#answer-sidebar{
  height: 100%;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

/* Sidebar: card contenitore + area interna scrollabile */
#answer-sessions{
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.30);
  background: rgba(224, 209, 245, 0.272);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.05) inset;
  overflow: hidden;
}

#answer-sessions-scroll{
  height: 100%;
  overflow-y: auto;
  padding: 10px;
  padding-right: 6px;
}

.answer-session-row{
  cursor: default;
  user-select: text;
  -webkit-user-select: text;
  padding: 8px 10px;
  line-height: 1.15;
  margin-bottom: 6px;
  box-sizing: border-box;
}

.answer-session-id{
  font-size: 13px;
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: 3px;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}

.answer-session-date{
  font-size: 11px;
  line-height: 1;
  opacity: 0.68;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}

/* Mobile: una colonna */
@media (max-width: 980px){
  #answer-layout{
    grid-template-columns: 1fr;
  }

  #answer-sessions{
    max-height: 34vh;
  }

  #answer-sessions-scroll{
    height: 100%;
  }
}

/* =========================
   ANSWER MAIN: STACK FULL-WIDTH
   ========================= */

#answer-main{
  height: 100%;
  min-height: 0;
  min-width: 0;

  display: flex;
  flex-direction: column;

  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.12);

  backdrop-filter: blur(3px) saturate(115%);
  -webkit-backdrop-filter: blur(3px) saturate(115%);
}

#answer-chat{
  flex: 1 1 auto;
  min-height: 320px;
  overflow: auto;
  width: 100%;
  box-sizing: border-box;

  padding: 14px 16px 10px 16px;

  border: none;
  background: transparent;
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.answer-time-separator{
  display: block;
  text-align: right;
  font-size: 11px;
  opacity: 1.5;
  color: rgba(2, 4, 5, 0.91);
  font-variant-numeric: tabular-nums;

  margin: 12px 0 10px 0;
  padding-top: 5px;
  border-top: 1px solid rgba(27, 40, 56, 0.28);
}

.answer-inputbox{
  width: 100%;
  box-sizing: border-box;

  padding: 12px 16px 14px 16px;

  border: none;
  border-top: 1px solid rgba(255,255,255,0.14);
  background: transparent;
  border-radius: 0;

  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.answer-input{
  width: 100%;
  min-height: 104px;
  box-sizing: border-box;

  border: none;
  border-radius: 0;
  background: transparent;
  color: #1b2838;
  padding: 8px 6px 10px 6px;

  font-family: inherit;
  font-size: 13px;
  line-height: 1.35;
  resize: vertical;
  overflow-y: auto;
  -webkit-user-select: text;
  user-select: text;
  outline: none;
}

.answer-status{
  display: none;
}

.answer-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-top: 4px;
}

body{
  background:
  radial-gradient(
    900px 500px at 50% -10%,
    rgba(255,255,255,0.08),
    rgba(255,255,255,0.0) 70%
  ),
  radial-gradient(
    1200px 600px at 85% 100%,
    rgba(154,219,193,0.45),
    rgba(154,219,193,0.15) 40%,
    rgba(154,219,193,0.0) 70%
  ),
  linear-gradient(
    180deg,
    #3a2f73 0%,
    #54577e 55%,
    #6e8e8e 80%,
    #9adbc1 100%
  );
}
body::before{
  content:"";
  position: fixed;
  inset: 0;
  background: url("/img/tire-waves.svg?v=ripples3") center top / cover no-repeat;
  opacity: 0.85;                 /* leggermente meno forte */
  filter: brightness(1.6) contrast(1.2);  

  pointer-events: none;
  z-index: 0;
}

/* =========================
   SVG DUPLICATO DI TEST
   ========================= */

body{
  --waves2-x: -1400px;
  --waves2-y: 80px;
  --waves2-scale: 1.40;
  --waves2-opacity: 0.5;
  --waves2-rotate: 5deg;
}

body::after{
  content: "";
  position: fixed;
  left: 0;
  top: 0;

  width: 1600px;
  height: 900px;

  background: url("/img/tire-waves.svg?v=ripples7") no-repeat;
  background-size: 100% 100%;

  opacity: var(--waves2-opacity);
  pointer-events: none;
  z-index: 0;

transform:
  translate(var(--waves2-x), var(--waves2-y))
  scale(var(--waves2-scale))
  rotate(var(--waves2-rotate));

  transform-origin: center;
}

body{
  position: relative;
  min-height: 100vh;
}

.container{
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(2px) saturate(110%);
  -webkit-backdrop-filter: blur(2px) saturate(110%);
  height: calc(100vh - 220px);
  min-height: 520px;
  margin: 16px auto;
}

@media (max-width: 900px){
  .container{
    height: auto;
    min-height: 0;
    margin: 12px auto;
    padding: 14px 14px 16px 14px;
  }

  #answer-layout{
    grid-template-columns: 1fr;
    gap: 12px;
    height: auto;
    min-height: 0;
  }

  #answer-sidebar{
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  #answer-sessions{
    height: 28vh;
    max-height: 28vh;
    min-height: 120px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  #answer-sessions-scroll{
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  #answer-main{
    min-height: 0;
    height: auto;
  }

  #answer-chat{
    min-height: 220px;
    max-height: 48vh;
    overflow: auto;
    padding: 12px 12px 8px 12px;
  }

  .answer-inputbox{
    padding: 10px 12px 12px 12px;
  }

  .answer-input{
    min-height: 96px;
    padding: 8px 0 10px 0;
  }

  .answer-actions{
    gap: 8px;
  }

  #thl-summary-overlay{
    position: static;
    margin-top: 8px;
    max-height: none;
  }

  #thl-summary-content{
    max-height: 42vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* =========================
   THL / CURRENT CHAT SUMMARY
   ========================= */

#answer-sidebar{
  position: relative;
}

#thl-summary-wrap{
  position: relative;
  margin-bottom: 12px;
}

#thl-summary-toggle{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(171, 244, 226, 0.30);
  color: #1b2838;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-align: left;
  cursor: pointer;
}

#thl-summary-caret{
  flex: 0 0 auto;
  width: 16px;
  min-width: 16px;
  text-align: center;
}

#thl-summary-overlay{
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 20;

  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.22);

  background: rgba(205, 189, 251, 0.957);

  backdrop-filter: blur(3px) saturate(102%);
  -webkit-backdrop-filter: blur(3px) saturate(102%);

  box-shadow: 0 10px 22px rgba(0,0,0,0.18);

  padding: 12px;
}

#thl-summary-content{
  max-height: 260px;
  overflow: auto;
  white-space: normal;      
  font-size: 13px;
  line-height: 1.35;
  color: #1b2838;
}

/* root */

.thl-root{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.thl-empty{
  opacity: 0.75;
}

.thl-turn{
  font-size: 11px;
  opacity: 0.65;
  margin-bottom: 2px;
}

/* domain */

.thl-domain{
  margin-bottom: 8px;
  padding: 8px 10px;
  border-left: 3px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
}

.thl-domain-governance{
  border-left-color: rgba(210,120,120,0.75);
  background: rgba(210,120,120,0.04);
}

.thl-domain-head{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.thl-domain-title{
  font-weight: 700;
  font-size: 13px;
  line-height: 1.25;
}

.thl-range{
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 11px;
  opacity: 0.65;
  white-space: nowrap;
}

/* thread */

.thl-thread{
  margin-left: 8px;
  margin-bottom: 4px;
}

.thl-thread-toggle{
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  border: none;
  background: transparent;
  color: #1b2838;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.thl-thread-toggle:hover{
  opacity: 0.95;
}

.thl-caret{
  flex: 0 0 auto;
  width: 18px;
  min-width: 18px;
  font-size: 14px;
  line-height: 1.2;
  opacity: 0.85;
  text-align: center;
}

.thl-thread-title{
  font-weight: 600;
  line-height: 1.25;
}

.thl-thread-body{
  margin-top: 2px;
  margin-left: 26px;   /* rientro rispetto al caret */
}

/* nodes */

.thl-nodes{
  margin: 0;
  padding-left: 16px;
}

.thl-node{
  margin: 2px 0;
  line-height: 1.35;
}

.thl-node-empty{
  opacity: 0.65;
  font-style: italic;
}

.thl-node-accepted{
  color: #4b8f59;
}

.thl-node-rejected{
  color: #b85a5a;
}

.thl-status{
  margin-left: 6px;
  font-size: 11px;
  opacity: 0.7;
  font-weight: 400;
}

/* ===== Sidebar header compatto ===== */
.answer-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 8px;
}

.answer-panel-header .answer-panel-title {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
}

.answer-sort-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  opacity: 0.75;
}

.answer-sort-inline select {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.15);
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(2px);
}

.answer-actions{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.answer-actions-left{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.answer-actions-right{
  display: flex;
}

.answer-actions-right button{
  opacity: 0.7;
}

.answer-document-row{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 6px 0;
  font-size: 12px;
}

.answer-document-input{
  display: none;
}

.answer-document-status{
  opacity: 0.78;
  color: #1b2838;
  font-size: 10px;
  line-height: 1.15;
  vertical-align: middle;
}

.tire-label{
  font-weight: 600;
  letter-spacing: 0.7px;
}


/* ==========================================================
   ANSWER DEV CSS — HEADER / TOOLTIP / THL
   Source: former <style id="tire-header-css"> block, answer.html lines 869–1200
   ========================================================== */

  /* SOLO HEADER. NIENTE ALTRO. */

#site-header{
  padding: 14px 0;
  margin-bottom: 16px;

  /* vetro + diagonale: più chiaro in basso a destra */
  
  background:
radial-gradient(
  900px 260px at 50% -120px,
  rgba(255,255,255,0.22),
  rgba(255,255,255,0.10) 40%,
  rgba(255,255,255,0.02) 70%,
  rgba(255,255,255,0) 100%
);
  border-bottom: 1px solid rgba(255,255,255,0.16);

  /* glow più “freddo” e meno inchiostro */
  box-shadow:
    0 10px 24px rgba(93, 92, 92, 0.12),
    0 0 52px rgba(180, 220, 255, 0.22);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

#site-header-inner{
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: flex-start;  
  padding: 0 22px;          /* padding laterale del contenuto */
}

#site-logo{
  height: 60px;
  flex-shrink: 0;
}

.site-titles{
  flex: 1 1 auto;
  min-width: 0;
  text-align:left;
}

.site-main-title{
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.9px;
  line-height: 1.25;
}

.site-subtitle{
  margin: 4px 0 0;
  font-size: 10px;
  letter-spacing: 0.6px;
  opacity: 0.9;
}

#auth-bar{
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

#tire-login-status{
  display: block;
  font-family: "Century Gothic", "Gill Sans", system-ui, -apple-system,
             BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #dfeaf6;
  opacity: 0.9;
  white-space: nowrap;
}

#tire-logout{
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 12px;
  color: #dfeaf6;
  opacity: 0.75;
  font-family: "Century Gothic", "Gill Sans", system-ui, -apple-system,
             BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: none;
}

#tire-logout:hover{
  text-decoration: underline;
}

/* font + colore morbido per tutta la testata */
#site-header,
#site-header *{
  font-family: "Century Gothic", "Gill Sans", system-ui, -apple-system,
               BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #c4d3dd;
}

/* =========================
   HEADER HELP TOOLTIP
   ========================= */

#header-actions{
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 70;
}

#help-wrap{
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 71;
}

.top-icon{
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.07);
  color: #eef3fb;
  font-family: "Times New Roman", Georgia, serif !important;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

#help-tooltip{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;

  width: 420px;
  max-width: min(420px, 82vw);
  max-height: min(70vh, 520px);
  overflow-y: auto;

  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(80,100,130,0.22);
  background: rgba(232, 241, 250, 0.97);
  color: #1b2838;

  box-shadow: 0 16px 36px rgba(0,0,0,0.18);

  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;

  pointer-events: auto;
}

#help-tooltip .help-title{
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  margin-bottom: 8px;
  color: #162640;
  font-size: 14px;
  line-height: 1.3;
}

#help-tooltip .help-body{
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 1.35;
  color: #1b2838;
  white-space: pre-line;
}

#help-tooltip::before{
  content: "";
  position: absolute;
  top: -8px;
  right: 16px;
  width: 14px;
  height: 14px;
  background: rgba(232, 241, 250, 0.97);
  border-left: 1px solid rgba(80,100,130,0.22);
  border-top: 1px solid rgba(80,100,130,0.22);
  transform: rotate(45deg);
}

#help-wrap:hover #help-tooltip,
#help-wrap:focus-within #help-tooltip,
#help-wrap.is-open #help-tooltip{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* =========================
   Tooltip in primo piano
   ========================= */

#site-header{
  position: relative;
  z-index: 60;
  overflow: visible;
}

#site-header-inner{
  position: relative;
  z-index: 61;
  overflow: visible;
}

#header-actions{
  position: relative;
  z-index: 70;
}

#help-wrap{
  position: relative;
  z-index: 71;
}

#help-tooltip{
  z-index: 80;
}

/* =========================
   THL — GERARCHIA VISIVA
   ========================= */

/* DOMAIN */
.thl-domain{
  margin-bottom: 12px;
  padding: 10px 12px;
  border-left: 3px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
}

.thl-domain-title{
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
  opacity: 0.95;
}

/* THREAD */
.thl-thread{
  margin-left: 10px;
}

.thl-thread-toggle{
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.9;
  padding: 3px 0;
}

.thl-thread-toggle:hover{
  opacity: 1;
}

/* CARET */
.thl-caret{
  flex: 0 0 auto;
  width: 18px;
  min-width: 18px;
  font-size: 18px;
  line-height: 1.2;
  opacity: 0.85;
  text-align: center;
}

/* NODES */
.thl-thread-body{
  margin-left: 16px;
  margin-top: 4px;
}

.thl-nodes{
  margin: 0;
  padding-left: 14px;
}

.thl-node{
  font-size: 12px;
  line-height: 1.4;
  margin: 3px 0;
  opacity: 0.85;
}

.thl-domain-head{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.thl-range{
  margin-left: auto;
  font-size: 11px;
  opacity: 0.65;
  white-space: nowrap;
}

.thl-domain-governance{
  border-left-color: rgba(255,120,120,0.6);
  background: rgba(255,120,120,0.04);
}

