/* ==========================================================================
   TRINO — Mesa inteligente
   A interface herda a linguagem institucional do simulador: grafite, ouro,
   informação hierarquizada e uma decisão principal por tela.
   ========================================================================== */

.btn-trino-advisor {
  position: relative;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  padding: 0 15px !important;
  overflow: hidden;
  border: 1px solid rgba(231, 102, 41, .42) !important;
  border-radius: 8px !important;
  background:
    linear-gradient(180deg, rgba(231, 102, 41, .11), rgba(231, 102, 41, .035)),
    #f8fafc !important;
  color: #212529 !important;
  box-shadow: inset 0 1px 0 rgba(35, 30, 61, 0.0525);
  font-size: 11px !important;
  font-weight: 760 !important;
  letter-spacing: .02em;
  transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.btn-trino-advisor::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 28%, rgba(196, 84, 31, .13) 48%, transparent 68%);
  opacity: 0;
  transform: translateX(-35%);
  transition: opacity .2s ease, transform .35s ease;
}
.btn-trino-advisor:hover {
  border-color: rgba(231, 102, 41, .82) !important;
  background: linear-gradient(180deg, rgba(231, 102, 41, .16), rgba(231, 102, 41, .06)), #e9eff3 !important;
  box-shadow: 0 7px 24px rgba(35, 30, 61, 0.077), inset 0 1px 0 rgba(35, 30, 61, 0.06);
  transform: translateY(-1px);
}
.btn-trino-advisor:hover::after { opacity: 1; transform: translateX(35%); }

.trino-advisor-mark {
  --mark-size: 22px;
  position: relative;
  display: inline-grid;
  width: var(--mark-size);
  height: var(--mark-size);
  flex: 0 0 var(--mark-size);
  place-items: center;
}
.trino-bot-face {
  position: absolute;
  right: 9%;
  bottom: 8%;
  left: 9%;
  height: 63%;
  border: max(1px, calc(var(--mark-size) * .055)) solid #e76629;
  border-radius: 30% 30% 36% 36%;
  background: linear-gradient(145deg, #dd6831, #ae5329);
  box-shadow: inset 0 0 0 max(1px, calc(var(--mark-size) * .04)) rgba(229, 236, 241, .48), 0 3px 8px rgba(35, 30, 61, 0.098);
}
.trino-bot-antenna {
  position: absolute;
  top: 1%;
  left: 50%;
  width: max(1px, calc(var(--mark-size) * .055));
  height: 23%;
  background: #e76629;
  transform: translateX(-50%);
}
.trino-bot-antenna::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: calc(var(--mark-size) * .18);
  height: calc(var(--mark-size) * .18);
  border-radius: 50%;
  background: #e76427;
  box-shadow: 0 0 0 2px rgba(231, 102, 41, .15);
  transform: translate(-50%,-35%);
}
.trino-bot-eye {
  position: absolute;
  top: 34%;
  width: 14%;
  height: 18%;
  border-radius: 50%;
  background: #e8eef2;
  box-shadow: 0 0 0 max(1px, calc(var(--mark-size) * .025)) rgba(230, 100, 40, .35);
}
.trino-bot-eye.left { left: 24%; }
.trino-bot-eye.right { right: 24%; }
.trino-bot-mouth {
  position: absolute;
  right: 29%;
  bottom: 18%;
  left: 29%;
  height: max(1px, calc(var(--mark-size) * .045));
  border-radius: 99px;
  background: #eaf0f4;
}

.trino-advisor-overlay {
  position: fixed;
  z-index: 12000;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(226, 234, 239, .68);
  backdrop-filter: blur(5px);
  animation: trinoOverlayIn .18s ease both;
}
.trino-advisor-drawer {
  display: flex;
  width: min(580px, 96vw);
  min-width: 0;
  height: 100vh;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid rgba(231, 102, 41, .23);
  background:
    radial-gradient(760px 360px at 100% 0, rgba(231, 102, 41, .055), transparent 58%),
    #edf3f7;
  color: #212529;
  box-shadow: -30px 0 80px rgba(35, 30, 61, 0.168);
  animation: trinoDrawerIn .24s cubic-bezier(.2,.75,.2,1) both;
}

.trino-advisor-head {
  position: relative;
  flex: 0 0 auto;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(35, 30, 61, 0.1125);
  background: rgba(231, 237, 242, .92);
  backdrop-filter: blur(18px);
}
.trino-advisor-identity,
.trino-advisor-head-actions,
.trino-advisor-composition-title,
.trino-advisor-library-item {
  display: flex;
  align-items: center;
}
.trino-advisor-identity { gap: 10px; padding-right: 160px; }
.trino-advisor-identity strong {
  display: block;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .22em;
  line-height: 1;
}
.trino-advisor-identity > div > span {
  display: block;
  margin-top: 5px;
  color: #626972;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.trino-advisor-head-actions {
  position: absolute;
  top: 14px;
  right: 16px;
  gap: 8px;
}
.trino-advisor-new-chat,
.trino-advisor-close {
  min-height: 31px;
  border: 1px solid rgba(35, 30, 61, 0.15);
  border-radius: 7px;
  background: transparent;
  color: #4a4f5a;
  font: inherit;
  font-size: 9.5px;
  cursor: pointer;
}
.trino-advisor-new-chat { padding: 0 10px; }
.trino-advisor-new-chat:hover,
.trino-advisor-close:hover { border-color: rgba(231, 102, 41, .42); color: #c4541f; background: rgba(231, 102, 41, .05); }
.trino-advisor-close { width: 31px; padding: 0; font-size: 20px; line-height: 1; }
.trino-advisor-local {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #626972;
  font-size: 8.5px;
  letter-spacing: .03em;
}
.trino-advisor-local i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2b835a;
  box-shadow: 0 0 0 3px rgba(43, 131, 90, .09);
}
.trino-advisor-connected {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #626972;
  font-size: 8.5px;
}
.trino-advisor-connected i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2b835a;
  box-shadow: 0 0 0 3px rgba(43, 131, 90, .09);
}
.trino-advisor-tabs { display: flex; gap: 20px; margin-top: 17px; }
.trino-advisor-tabs button {
  position: relative;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #68707a;
  font: inherit;
  font-size: 9.5px;
  font-weight: 650;
  cursor: pointer;
}
.trino-advisor-tabs button.active { color: #282b31; }
.trino-advisor-tabs button.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: #e76629;
}

.trino-advisor-chat {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}
.trino-advisor-messages {
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 26px 24px 18px;
  scrollbar-color: #f9fbfc transparent;
  scrollbar-width: thin;
}
.trino-advisor-chat.is-empty .trino-advisor-messages {
  flex: 0 1 auto;
  padding-bottom: 8px;
}
.trino-advisor-chat.is-empty .trino-advisor-composer {
  margin-top: 0;
}
.trino-advisor-messages::-webkit-scrollbar { width: 7px; }
.trino-advisor-messages::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 99px; background: #f9fbfc; background-clip: padding-box; }

.trino-advisor-welcome {
  max-width: 480px;
  margin: 0 auto 16px;
  text-align: center;
}
.trino-advisor-welcome-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.trino-advisor-orbit {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(231, 102, 41, .28);
  border-radius: 50%;
  background: rgba(231, 102, 41, .025);
  box-shadow: inset 0 0 0 7px rgba(231, 102, 41, .018);
}
.trino-advisor-eyebrow {
  color: #e76629;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .17em;
}
.trino-advisor-welcome h3 {
  max-width: 430px;
  margin: 11px auto 0;
  color: #b45a2e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.025em;
  line-height: 1.16;
}
.trino-advisor-welcome p {
  max-width: 430px;
  margin: 6px auto 8px;
  color: #505662;
  font-size: 11.5px;
  line-height: 1.55;
}
.trino-advisor-context-line {
  display: flex;
  justify-content: center;
  gap: 0;
  color: #767d88;
  font-size: 8.5px;
}

.trino-advisor-block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px;
}
.trino-advisor-block-title strong { color: #3e424b; font-size: 9px; font-weight: 700; }
.trino-advisor-block-title span { color: #767d88; font-size: 8px; }
.trino-advisor-quick-start { max-width: 480px; margin: 0 auto; }
.trino-advisor-suggestions { display: grid; gap: 7px; }
.trino-advisor-suggestions button {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 18px;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(35, 30, 61, 0.1275);
  border-radius: 8px;
  background: rgba(35, 30, 61, 0.0255);
  color: #2d3037;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.trino-advisor-suggestions button:hover {
  border-color: rgba(231, 102, 41, .42);
  background: rgba(231, 102, 41, .045);
  transform: translateX(2px);
}
.trino-advisor-suggestions button > span {
  color: #e76629;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.trino-advisor-suggestions button > i { color: #e76629; font-size: 14px; font-style: normal; text-align: right; }

.trino-advisor-briefing {
  max-width: 480px;
  margin: 9px auto 0;
  overflow: hidden;
  border: 1px solid rgba(35, 30, 61, 0.105);
  border-radius: 8px;
  background: rgba(35, 30, 61, 0.018);
}
.trino-advisor-briefing > summary {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  color: #4b505b;
  cursor: pointer;
  list-style: none;
}
.trino-advisor-briefing > summary::-webkit-details-marker { display: none; }
.trino-advisor-briefing-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(231, 102, 41, .26);
  border-radius: 5px;
  color: #e76629;
  font-size: 7px;
}
.trino-advisor-briefing summary strong { display: block; font-size: 9.5px; }
.trino-advisor-briefing summary small { display: block; margin-top: 2px; color: #767d88; font-size: 8px; }
.trino-advisor-briefing-time { color: #767d88; font-size: 8px; }
.trino-advisor-briefing-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 10px;
  padding: 12px;
  border-top: 1px solid rgba(35, 30, 61, 0.105);
}
.trino-advisor-field { display: block; min-width: 0; }
.trino-advisor-field.full,
.trino-advisor-briefing-footer.full { grid-column: 1 / -1; }
.trino-advisor-field > span {
  display: block;
  margin-bottom: 5px;
  color: #68707a;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.trino-advisor-field input,
.trino-advisor-field select {
  width: 100%;
  min-height: 35px;
  box-sizing: border-box;
  border: 1px solid rgba(35, 30, 61, 0.15);
  border-radius: 6px;
  outline: 0;
  background: #e8eef2;
  color: #32363d;
  font: inherit;
  font-size: 10px;
}
.trino-advisor-field input { padding: 7px 9px; }
.trino-advisor-field select { padding: 6px 8px; }
.trino-advisor-field input:focus,
.trino-advisor-field select:focus { border-color: rgba(231, 102, 41, .65); box-shadow: 0 0 0 3px rgba(231, 102, 41, .07); }
.trino-advisor-field input[aria-invalid="true"] { border-color: #636a74; }
.trino-advisor-briefing-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.trino-advisor-briefing-status { color: #aa293b; font-size: 8.5px; }
.trino-advisor-briefing-footer .btn { min-height: 34px; font-size: 9px; }

.trino-advisor-message { max-width: 100%; }
.trino-advisor-user {
  width: max-content;
  max-width: min(440px, 88%);
  margin: 0 0 13px auto;
  padding: 10px 13px;
  border: 1px solid rgba(231, 102, 41, .22);
  border-radius: 10px 10px 2px 10px;
  background: rgba(231, 102, 41, .065);
  color: #34373f;
  font-size: 10.5px;
  line-height: 1.45;
}
.trino-advisor-answer { margin: 0 0 20px; }
.trino-advisor-answer-body {
  overflow: hidden;
  border: 1px solid rgba(35, 30, 61, 0.135);
  border-radius: 11px;
  background:
    linear-gradient(180deg, rgba(35, 30, 61, 0.036), transparent 34%),
    #ffffff;
  box-shadow: 0 16px 38px rgba(35, 30, 61, 0.063);
}
.trino-advisor-answer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 0;
}
.trino-advisor-decision-label { display: inline-flex; align-items: center; gap: 7px; color: #e76629; font-size: 7.5px; font-weight: 850; letter-spacing: .14em; }
.trino-advisor-status-dot { width: 6px; height: 6px; border-radius: 50%; background: #2b835a; box-shadow: 0 0 0 3px rgba(43, 131, 90, .08); }
.trino-advisor-status-dot.attention { background: #e76427; box-shadow: 0 0 0 3px rgba(231, 100, 39, .08); }
.trino-advisor-confidence {
  padding: 4px 7px;
  border: 1px solid rgba(35, 30, 61, 0.12);
  border-radius: 99px;
  color: #626972;
  font-size: 7.5px;
}
.trino-advisor-confidence.confidence-high { border-color: rgba(43, 131, 90, .20); color: #2b825a; }
.trino-advisor-verdict {
  margin: 10px 16px 0;
  color: #272a30;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -.015em;
  line-height: 1.3;
}
.trino-advisor-highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 1px;
  margin: 15px 16px 0;
  overflow: hidden;
  border: 1px solid rgba(35, 30, 61, 0.1125);
  border-radius: 8px;
  background: rgba(35, 30, 61, 0.1125);
}
.trino-advisor-highlights > div { min-width: 0; padding: 10px; background: #e8eef2; }
.trino-advisor-highlights span { display: block; color: #6b737d; font-size: 7px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.trino-advisor-highlights strong { display: block; overflow: hidden; margin-top: 4px; color: #33373e; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.trino-advisor-highlights .tone-green strong { color: #2b835a; }
.trino-advisor-highlights .tone-gold strong { color: #c4541f; }
.trino-advisor-highlights .tone-amber strong { color: #e76427; }
.trino-advisor-rationale {
  margin: 14px 16px 0;
  color: #4f5560;
  font-size: 10.5px;
  line-height: 1.55;
}

.trino-advisor-compositions { margin: 15px 16px 0; }
.trino-advisor-composition {
  padding: 12px;
  border: 1px solid rgba(35, 30, 61, 0.12);
  border-radius: 8px;
  background: rgba(35, 30, 61, 0.018);
}
.trino-advisor-composition.featured {
  border-color: rgba(231, 102, 41, .34);
  background: linear-gradient(135deg, rgba(231, 102, 41, .075), rgba(231, 102, 41, .018) 55%);
}
.trino-advisor-composition.approximate { border-color: rgba(194, 126, 24, .34); background: rgba(194, 126, 24, .045); }
.trino-advisor-composition.approximate .trino-advisor-best-badge { background: rgba(194, 126, 24, .12); color: #82530d; }
.trino-advisor-composition-title { gap: 9px; }
.trino-advisor-composition-title > div { min-width: 0; flex: 1; }
.trino-advisor-composition-title strong { display: block; color: #292c32; font-size: 10.5px; }
.trino-advisor-composition-title span:not(.trino-advisor-rank):not(.trino-advisor-best-badge) { display: block; overflow: hidden; margin-top: 2px; color: #68707a; font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.trino-advisor-rank { display: grid; width: 25px; height: 25px; flex: 0 0 25px; place-items: center; border: 1px solid rgba(231, 102, 41, .28); border-radius: 50%; color: #e76629; font-size: 7px; font-weight: 800; }
.trino-advisor-best-badge { padding: 4px 7px; border-radius: 99px; background: rgba(43, 131, 90, .08); color: #494f5a; font-size: 7px; font-weight: 750; }
.trino-advisor-composition-key { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.trino-advisor-composition-key span { display: block; color: #78818c; font-size: 7px; text-transform: uppercase; }
.trino-advisor-composition-key strong { display: block; margin-top: 3px; color: #3a3f47; font-size: 9px; font-weight: 700; }
.trino-advisor-composition-meta {
  margin: 8px 0 0;
  color: #6d7580;
  font-size: 8.5px;
  line-height: 1.4;
}
.trino-advisor-composition-warning {
  margin: 8px 0 0;
  padding: 8px 9px;
  border-left: 2px solid #c27e18;
  border-radius: 4px;
  background: rgba(194, 126, 24, .08);
  color: #744b0d;
  font-size: 8.5px;
  line-height: 1.45;
}
.trino-advisor-composition-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid rgba(35,30,61,.10);
  border-radius: 7px;
  background: rgba(35,30,61,.10);
}
.trino-advisor-composition-values > span { min-width: 0; padding: 8px; background: #fff; }
.trino-advisor-composition-values small { display: block; color: #7a818b; font-size: 6.8px; text-transform: uppercase; }
.trino-advisor-composition-values strong { display: block; overflow: hidden; margin-top: 3px; color: #30343b; font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.trino-advisor-apply {
  display: flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 0 12px;
  border: 1px solid #e76629;
  border-radius: 7px;
  background: #e76629;
  color: #e7edf2;
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}
.trino-advisor-apply:hover { background: #e1662d; }
.trino-advisor-alternatives { margin-top: 8px; }
.trino-advisor-alternatives > summary,
.trino-advisor-use-alt {
  color: #69707b;
  font-size: 8.5px;
  cursor: pointer;
}
.trino-advisor-alternatives > summary { padding: 7px 0; }
.trino-advisor-alternatives .trino-advisor-composition { margin-top: 7px; }
.trino-advisor-use-alt { margin-top: 9px; padding: 0; border: 0; background: transparent; }
.trino-advisor-use-alt:hover { color: #c4541f; }

.trino-advisor-answer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 14px 16px 0;
  padding-top: 11px;
  border-top: 1px solid rgba(35, 30, 61, 0.0975);
}
.trino-advisor-analysis { display: contents; }
.trino-advisor-analysis > summary {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(35, 30, 61, 0.135);
  border-radius: 6px;
  color: #626972;
  font-size: 8px;
  cursor: pointer;
  list-style: none;
}
.trino-advisor-analysis > summary::-webkit-details-marker { display: none; }
.trino-advisor-analysis > summary:hover { border-color: rgba(231, 102, 41, .34); color: #c4541f; }
.trino-advisor-analysis[open] {
  display: block;
  width: 100%;
}
.trino-advisor-analysis[open] > summary { width: max-content; }
.trino-advisor-analysis-list {
  margin: 5px 0 0;
  padding-left: 18px;
  color: #626972;
  font-size: 8.5px;
  line-height: 1.55;
}
.trino-advisor-analysis .trino-advisor-evidence { margin-right: 0; margin-left: 0; }
.trino-advisor-analysis .trino-advisor-disclaimer { margin-right: 0; margin-left: 0; }
.trino-advisor-copy,
.trino-advisor-followup > summary {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(35, 30, 61, 0.135);
  border-radius: 6px;
  background: transparent;
  color: #626972;
  font: inherit;
  font-size: 8px;
  cursor: pointer;
}
.trino-advisor-copy:hover,
.trino-advisor-followup > summary:hover { border-color: rgba(231, 102, 41, .34); color: #c4541f; }
.trino-advisor-copy.success { border-color: rgba(43, 131, 90, .32); color: #2b835a; }
.trino-advisor-followup { display: contents; }
.trino-advisor-followup > summary { list-style: none; }
.trino-advisor-followup > summary::-webkit-details-marker { display: none; }
.trino-advisor-followup ul {
  width: 100%;
  margin: 6px 0 0;
  padding: 9px 10px 9px 25px;
  border-radius: 6px;
  background: #e8eef2;
  color: #626972;
  font-size: 8.5px;
  line-height: 1.55;
}
.trino-advisor-source-count { margin-left: auto; color: #7e8691; font-size: 7.5px; }
.trino-advisor-detail,
.trino-advisor-evidence {
  margin: 10px 16px 0;
  border-top: 1px solid rgba(35, 30, 61, 0.0825);
}
.trino-advisor-detail > summary,
.trino-advisor-evidence > summary {
  padding: 10px 0 0;
  color: #6b737d;
  font-size: 8.5px;
  cursor: pointer;
}
.trino-advisor-section { padding-top: 10px; }
.trino-advisor-section h4 { margin: 0 0 5px; color: #3d424b; font-size: 9px; }
.trino-advisor-section p { margin: 0; color: #626972; font-size: 9.5px; line-height: 1.5; white-space: pre-line; }
.trino-advisor-section.tone-warning { padding-left: 9px; border-left: 2px solid rgba(231, 100, 39, .55); }
.trino-advisor-section.tone-positive { padding-left: 9px; border-left: 2px solid rgba(43, 131, 90, .50); }
.trino-advisor-evidence-list { display: grid; gap: 6px; padding-top: 8px; }
.trino-advisor-source { padding: 8px 9px; border: 1px solid rgba(35, 30, 61, 0.09); border-radius: 6px; background: #e8eef2; }
.trino-advisor-source strong { display: block; color: #3e434c; font-size: 8.5px; }
.trino-advisor-source span { display: block; margin-top: 2px; color: #b55d35; font-size: 7.5px; }
.trino-advisor-source p { margin: 4px 0 0; color: #767f8b; font-size: 8px; line-height: 1.4; }
.trino-advisor-source a {
  display: inline-block;
  margin-top: 6px;
  color: #e76629;
  font-size: 8px;
  font-weight: 650;
  text-decoration: none;
}
.trino-advisor-source a:hover { color: #e76427; text-decoration: underline; }
.trino-advisor-disclaimer { margin: 11px 16px 14px; color: #858d97; font-size: 7px; line-height: 1.4; }

.trino-advisor-thinking {
  display: flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  padding: 11px 13px;
  border: 1px solid rgba(231, 102, 41, .18);
  border-radius: 8px;
  background: rgba(231, 102, 41, .035);
  color: #676f79;
  font-size: 9px;
}
.trino-advisor-thinking .trino-advisor-mark { animation: trinoAdvisorPulse 1.1s ease-in-out infinite; }

.trino-advisor-composer {
  flex: 0 0 auto;
  margin: 0 18px 18px;
  padding: 11px 11px 9px;
  border: 1px solid rgba(35, 30, 61, 0.165);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 -14px 40px rgba(35, 30, 61, 0.063), 0 12px 34px rgba(35, 30, 61, 0.077);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.trino-advisor-composer:focus-within { border-color: rgba(231, 102, 41, .58); box-shadow: 0 0 0 3px rgba(231, 102, 41, .055), 0 14px 36px rgba(35, 30, 61, 0.0875); }
.trino-advisor-composer textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  max-height: 120px;
  box-sizing: border-box;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #2c2f36;
  font: inherit;
  font-size: 11px;
  line-height: 1.45;
}
.trino-advisor-composer textarea::placeholder { color: #7c8490; }
.trino-advisor-composer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 5px; }
.trino-advisor-composer-row > span { color: #747d89; font-size: 7.5px; }
.trino-advisor-send {
  display: inline-flex;
  min-width: 88px;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 11px;
  border: 1px solid #e76629;
  border-radius: 7px;
  background: #e76629;
  color: #e7edf2;
  font: inherit;
  font-size: 9px;
  font-weight: 850;
  cursor: pointer;
}
.trino-advisor-send:hover { background: #c4541f; }
.trino-advisor-send:disabled { opacity: .55; cursor: wait; }

.trino-advisor-sources {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 26px 24px;
}
.trino-advisor-source-hero {
  padding: 23px;
  border: 1px solid rgba(231, 102, 41, .22);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(231, 102, 41, .06), rgba(231, 102, 41, .012));
  text-align: center;
}
.trino-advisor-source-icon { display: grid; width: 36px; height: 36px; margin: 0 auto 11px; place-items: center; border: 1px solid rgba(231, 102, 41, .28); border-radius: 50%; color: #e76629; font-size: 18px; }
.trino-advisor-source-hero h3,
.trino-advisor-library h3 { margin: 0 0 6px; color: #2c2f35; font-family: Georgia, "Times New Roman", serif; font-size: 16px; font-weight: 500; }
.trino-advisor-source-hero p { max-width: 430px; margin: 0 auto 13px; color: #686f7a; font-size: 10px; line-height: 1.5; }
.trino-advisor-source-hero .btn { min-height: 35px; font-size: 9px; }
.trino-advisor-source-limits { display: block; margin-top: 9px; color: #747d89; font-size: 7.5px; }
.trino-advisor-source-status { min-height: 14px; margin-top: 8px; color: #6f7782; font-size: 8.5px; }
.trino-advisor-source-status.success { color: #2b835a; }
.trino-advisor-source-status.error { color: #aa293b; }
.trino-advisor-library { margin-top: 20px; }
.trino-advisor-library-item {
  gap: 10px;
  margin-top: 7px;
  padding: 10px;
  border: 1px solid rgba(35, 30, 61, 0.1125);
  border-radius: 8px;
  background: #ffffff;
}
.trino-advisor-library-item > div:nth-child(2) { min-width: 0; flex: 1; }
.trino-advisor-library-item strong { display: block; overflow: hidden; color: #3a3f47; font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.trino-advisor-library-item span { display: block; margin-top: 2px; color: #6b737d; font-size: 8px; }
.trino-advisor-library-badge { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid rgba(231, 102, 41, .22); border-radius: 6px; color: #e76629; font-size: 7px; font-weight: 850; }
.trino-advisor-library-state { color: #2b835a !important; font-weight: 750; }
.trino-advisor-remove-source { border: 0; background: transparent; color: #68707a; font: inherit; font-size: 8px; cursor: pointer; }
.trino-advisor-remove-source:hover { color: #aa293b; }
.trino-advisor-empty-library { color: #6b737d; font-size: 9px; }
.trino-advisor-security-card { margin-top: 15px; padding: 12px; border-left: 2px solid rgba(43, 131, 90, .38); background: rgba(43, 131, 90, .035); }
.trino-advisor-security-card strong { color: #484d58; font-size: 9px; }
.trino-advisor-security-card p { margin: 4px 0 0; color: #707884; font-size: 8.5px; line-height: 1.45; }

@keyframes trinoOverlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes trinoDrawerIn { from { opacity: .4; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes trinoAdvisorPulse { 50% { opacity: .45; transform: scale(.94); } }

@media (max-width: 700px) {
  .trino-advisor-drawer { width: 100vw; }
  .trino-advisor-head { padding-right: 14px; padding-left: 14px; }
  .trino-advisor-identity { padding-right: 170px; }
  .trino-advisor-local { display: none; }
  .trino-advisor-messages,
  .trino-advisor-sources { padding: 20px 14px 14px; }
  .trino-advisor-welcome h3 { font-size: 24px; }
  .trino-advisor-suggestions button { grid-template-columns: 1fr 16px; }
  .trino-advisor-composer { margin: 0 10px 10px; }
  .trino-advisor-highlights,
  .trino-advisor-composition-key { grid-template-columns: 1fr 1fr; }
  .trino-advisor-field.full,
  .trino-advisor-briefing-footer.full { grid-column: auto; }
  .trino-advisor-briefing-form { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .trino-advisor-overlay,
  .trino-advisor-drawer,
  .trino-advisor-thinking .trino-advisor-mark,
  .btn-trino-advisor::after { animation: none !important; transition: none !important; }
}

/* Pedido interpretado (validação da consulta pelo usuário) */
.trino-advisor-interpreted {
  margin: 4px 0 10px;
  border: 1px solid rgba(231, 102, 41, 0.25);
  border-radius: 10px;
  background: rgba(231, 102, 41, 0.05);
  padding: 6px 10px;
}
.trino-advisor-interpreted summary {
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold, #e76629);
}
.trino-advisor-interp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 14px;
  margin: 8px 0;
}
.trino-advisor-interp-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.trino-advisor-interp-row span { opacity: 0.75; }
.trino-advisor-edit-criteria {
  font-size: 11px;
  background: transparent;
  border: 1px solid rgba(35, 30, 61, 0.375);
  color: inherit;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
}
.trino-advisor-edit-criteria:hover { border-color: var(--gold, #e76629); }
@media (max-width: 560px) {
  .trino-advisor-interp-grid { grid-template-columns: 1fr; }
}

/* Pedido estruturado — fluxo principal do robô. */
.trino-structured-workspace {
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 24px;
  scrollbar-width: thin;
}
.trino-structured-results { min-height: 12px; margin: 14px 18px 0; }
.trino-structured-results .trino-advisor-answer { margin-bottom: 0; }
.trino-structured-request {
  margin: 14px 18px 0;
  padding: 15px;
  border: 1px solid rgba(231, 102, 41, .24);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(231, 102, 41, .075), rgba(255,255,255,.96) 42%);
  box-shadow: 0 10px 28px rgba(35, 30, 61, .055);
}
.trino-structured-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.trino-structured-head span { color: #d45b23; font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.trino-structured-head h3 { margin: 3px 0 0; color: #292d35; font: 500 17px/1.2 Georgia, serif; }
.trino-structured-head > small { color: #747b86; font-size: 8px; white-space: nowrap; }
.trino-structured-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.trino-structured-field { display: grid; gap: 5px; min-width: 0; }
.trino-structured-field > span { display: flex; justify-content: space-between; gap: 8px; color: #414750; font-size: 9px; font-weight: 750; }
.trino-structured-field > span small { color: #8a9099; font-size: 7px; font-weight: 600; }
.trino-structured-field input,
.trino-structured-field select {
  box-sizing: border-box; width: 100%; min-height: 35px; padding: 7px 9px;
  border: 1px solid rgba(35, 30, 61, .18); border-radius: 8px; background: #fff;
  color: #30343c; font: 600 10px/1.2 inherit; outline: 0;
}
.trino-structured-field input:focus,
.trino-structured-field select:focus { border-color: rgba(231, 102, 41, .72); box-shadow: 0 0 0 3px rgba(231, 102, 41, .09); }
.trino-structured-entry { display: grid; grid-template-columns: auto 1fr; gap: 5px; }
.trino-structured-toggle { display: flex; padding: 3px; border-radius: 8px; background: #eceef2; }
.trino-structured-toggle button { min-width: 31px; border: 0; border-radius: 6px; background: transparent; color: #737a85; font: 800 9px inherit; cursor: pointer; }
.trino-structured-toggle button.active { background: #fff; color: #d45b23; box-shadow: 0 1px 5px rgba(35,30,61,.12); }
.trino-structured-admins { margin-top: 10px; border: 1px solid rgba(35, 30, 61, .12); border-radius: 8px; background: rgba(255,255,255,.7); }
.trino-structured-admins summary { padding: 9px 10px; color: #59606b; font-size: 9px; cursor: pointer; }
.trino-structured-chips { display: flex; flex-wrap: wrap; gap: 5px; max-height: 112px; overflow: auto; padding: 0 9px 9px; }
.trino-structured-chip { position: relative; cursor: pointer; }
.trino-structured-chip input { position: absolute; opacity: 0; pointer-events: none; }
.trino-structured-chip span { display: block; padding: 5px 8px; border: 1px solid rgba(35,30,61,.14); border-radius: 999px; background: #fff; color: #555d68; font-size: 8px; }
.trino-structured-chip input:checked + span { border-color: #d45b23; background: #d45b23; color: #fff; }
.trino-structured-error { min-height: 13px; margin-top: 5px; color: #aa293b; font-size: 8px; }
.trino-structured-submit { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 38px; padding: 0 13px; border: 0; border-radius: 8px; background: #d45b23; color: #fff; font: 850 9px inherit; letter-spacing: .03em; cursor: pointer; }
.trino-structured-submit:hover { background: #ba4c1a; }
.trino-structured-thinking { animation: trinoStructuredGlow 1.3s ease-in-out infinite; }
@keyframes trinoStructuredGlow { 50% { border-color: rgba(231,102,41,.55); background: rgba(231,102,41,.08); } }

@media (max-width: 560px) {
  .trino-structured-request { margin: 10px 10px 0; }
  .trino-structured-results { margin: 10px 10px 0; }
  .trino-structured-grid { grid-template-columns: 1fr; }
  .trino-advisor-composition-values { grid-template-columns: 1fr 1fr; }
}
