:root{--forest:#202b24;--forest-deep:#18221c;--gold:#bca477;--paper:#f7f8f5;--ink:#29332c;--line:#e4e8e1;--sans:"DM Sans",Arial,sans-serif;--serif:"Libre Baskerville",Georgia,serif}
*{box-sizing:border-box}html,body{min-height:100%}body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--sans);-webkit-font-smoothing:antialiased}
button,textarea,input,select{font:inherit}button{cursor:pointer}[hidden]{display:none!important}
.app-layout{min-height:100vh;display:flex}
.sidebar{width:278px;flex:0 0 278px;min-height:100vh;padding:25px 18px 18px;display:flex;flex-direction:column;background:var(--forest);color:#eef1eb}
.sidebar-brand{display:flex;align-items:center;gap:12px;padding:0 7px 29px;color:#fff;text-decoration:none}.brand-crest{width:35px;height:47px;object-fit:contain}.sidebar-brand span{display:flex;flex-direction:column;gap:5px}.sidebar-brand strong{font-size:12px;letter-spacing:1.55px}.sidebar-brand small{color:#b7c0b5;font-size:10px;letter-spacing:1.3px}
.new-chat-button{width:100%;min-height:48px;display:flex;align-items:center;gap:11px;padding:0 14px;border:1px solid #526052;border-radius:9px;background:#2b392f;color:#fff;text-align:left;font-size:14px;font-weight:600;transition:background .2s}.new-chat-button:hover{background:#354639}.new-chat-button .new-chat-icon{font-size:22px;color:#d2c09a;line-height:1}
.sidebar-section-label{margin:31px 8px 12px;color:#aab4a8;font-size:10px;font-weight:700;letter-spacing:1.25px}.conversation-history{display:flex;flex-direction:column;gap:5px;overflow-y:auto}.history-empty{margin:3px 8px;color:#aab4a8;font-size:12px;line-height:1.6}.history-row{display:flex;align-items:center;gap:3px;min-width:0;border-radius:7px}.history-row:hover{background:#344339}.history-item{flex:1;min-width:0;padding:11px 7px 11px 10px;overflow:hidden;border:0;border-radius:7px;background:transparent;color:#e5eae3;text-align:left;font-size:13px;white-space:nowrap;text-overflow:ellipsis;transition:background .2s}.history-item:hover,.history-item.active{background:#344339}.history-actions{display:flex;flex:0 0 auto;gap:1px;padding-right:4px}.history-action{width:27px;height:29px;display:grid;place-items:center;border:0;border-radius:5px;background:transparent;color:#c5cec2;font-size:16px;line-height:1}.history-action:hover{background:#526052;color:#fff}.history-action.delete:hover{background:#713f3b;color:#fff}.history-action:disabled{opacity:.35;cursor:not-allowed}.history-rename-editor{display:flex;flex-wrap:wrap;gap:5px;padding:7px;background:#344339;border-radius:7px}.history-rename-input{width:100%;min-width:0;padding:8px 9px;border:1px solid #879487;border-radius:5px;outline:none;background:#f8faf7;color:#202820;font-size:12px}.history-rename-input:focus{border-color:#d2c09a;box-shadow:0 0 0 2px #d2c09a33}.history-rename-save,.history-rename-cancel{flex:1;padding:6px 7px;border:1px solid #667466;border-radius:5px;background:#26352b;color:#f4f6f1;font-size:11px}.history-rename-save{background:#d2c09a;border-color:#d2c09a;color:#26352b;font-weight:700}.history-rename-save:hover{background:#e1d1ae}.history-rename-cancel:hover{background:#526052}
.sidebar-bottom{margin-top:auto;padding-top:20px}.sidebar-note{padding:12px 8px 17px;color:#b6c0b4;font-size:11px;line-height:1.5}.sidebar-note span{color:#d0bd91;margin-right:6px}.sidebar-admin{width:100%;min-height:44px;display:flex;align-items:center;gap:10px;padding:0 10px;border:1px solid #526052;border-radius:8px;background:transparent;color:#f0f2ed;font-size:13px;text-align:left}.sidebar-admin:hover{background:#2b392f}.admin-icon,.admin-arrow{color:#d2c09a}.admin-arrow{margin-left:auto}.sidebar-version{padding:17px 8px 0;color:#89968a;font-size:9px;letter-spacing:1.1px}
.workspace{min-width:0;min-height:100vh;flex:1;display:flex;flex-direction:column;background:#fbfcfa}.workspace-header{height:76px;flex:0 0 76px;display:flex;align-items:center;justify-content:space-between;padding:0 clamp(25px,5vw,70px);border-bottom:1px solid var(--line);background:rgba(255,255,255,.88)}.workspace-heading{display:flex;flex-direction:column;gap:4px}.workspace-kicker{color:#899486;font-size:9px;font-weight:700;letter-spacing:1.4px}.workspace-heading strong{color:var(--forest);font-size:14px;font-weight:600}.header-status{display:flex;align-items:center;gap:8px;color:#7d877d;font-size:12px}.header-status span{width:7px;height:7px;border-radius:50%;background:#78936e;box-shadow:0 0 0 3px #edf3e9}.mobile-menu-button{display:none;border:0;background:transparent;color:var(--forest);font-size:21px}
.chat-area{width:min(920px,calc(100% - 56px));flex:1;min-height:280px;margin:0 auto;padding:45px 0 28px;display:flex;flex-direction:column}.welcome-screen{width:100%;margin:auto 0;padding:18px 0 38px;text-align:center}.welcome-emblem{width:66px;height:66px;margin:0 auto 23px;display:grid;place-items:center;border:1px solid #e2e7dd;border-radius:20px;background:#fff;box-shadow:0 7px 24px rgba(31,47,34,.06)}.welcome-emblem img{width:31px;height:43px;object-fit:contain}.welcome-screen .eyebrow{justify-content:center;color:#87927e;font-size:10px;letter-spacing:1.5px}.welcome-screen h1{margin:17px 0 12px;color:var(--forest);font:400 clamp(34px,4vw,48px)/1.25 var(--serif);letter-spacing:-1.6px}.welcome-screen h1 em{color:#839071;font-weight:400}.welcome-description{max-width:540px;margin:0 auto;color:#7b847b;font-size:15px;line-height:1.8}
.starter-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:39px auto 0;max-width:790px;text-align:left}.starter-card{position:relative;min-height:122px;padding:17px;display:flex;flex-direction:column;align-items:flex-start;gap:8px;border:1px solid #e4e8e0;border-radius:11px;background:#fff;color:var(--ink);text-align:left;box-shadow:0 3px 12px rgba(30,45,33,.025);transition:transform .2s,border-color .2s,box-shadow .2s}.starter-card:hover{transform:translateY(-2px);border-color:#c8d1c2;box-shadow:0 9px 22px rgba(30,45,33,.07)}.starter-icon{color:#a18d64;font:11px var(--serif)}.starter-card strong{color:#344238;font-size:14px}.starter-card small{color:#899187;font-size:11px;line-height:1.45}.starter-arrow{position:absolute;top:14px;right:15px;color:#a18d64;font-size:15px}
.conversation-output{width:100%;padding:4px 0 24px}.conversation-turn{padding:0 0 30px;margin:0 0 28px;border-bottom:1px solid var(--line)}.user-message{width:fit-content;max-width:82%;margin:0 0 25px auto;padding:14px 18px;border:1px solid #e6e9e2;border-radius:15px 15px 4px 15px;background:#f0f3ed;color:#303c33;font-size:15px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}.assistant-line{display:flex;align-items:center;gap:11px;margin-bottom:12px;color:#354438;font-size:13px;font-weight:700}.assistant-avatar{width:29px;height:29px;display:grid;place-items:center;border:1px solid #e2e8dd;border-radius:9px;background:#fff;color:#687b60;font-size:15px}.answer-text{margin:0 0 15px 40px;color:#354037;font-size:15px;line-height:1.85;white-space:pre-wrap;overflow-wrap:anywhere}.sources-panel{margin:16px 0 0 40px;padding:14px 16px;border:1px solid #e6e9e2;border-radius:9px;background:#fff}.sources-panel h3{margin:0 0 10px;color:#52614f;font-size:12px}.sources-panel ul{margin:0;padding-left:18px;color:#687267;font-size:12px;line-height:1.8}.sources-panel a{color:#526b56;text-decoration:underline;text-underline-offset:2px}.no-sources{margin:0 0 0 40px;color:#8b9289;font-size:12px}.answer-caution{margin:17px 0 0 40px;color:#8b9188;font-size:11px;line-height:1.6}.loading-message,.error-message{padding:15px 18px;border-radius:9px;background:#f1f4ee;color:#667361;font-size:14px;line-height:1.7}.error-message{background:#fbefed;color:#8a3d35}.conversation-actions{display:flex;justify-content:flex-start;margin:12px 0 0 40px}.conversation-actions button{border:1px solid #dfe5db;border-radius:7px;background:#fff;color:#52614f;padding:9px 12px;font-size:12px}
.composer-wrap{width:min(920px,calc(100% - 56px));margin:0 auto;padding:0 0 17px}.composer{padding:13px 14px 11px 19px;border:1px solid #dfe5dc;border-radius:14px;background:#fff;box-shadow:0 7px 28px rgba(31,47,34,.07);transition:border-color .2s,box-shadow .2s}.composer:focus-within{border-color:#a6b39d;box-shadow:0 0 0 3px rgba(119,132,95,.09),0 7px 28px rgba(31,47,34,.06)}.composer textarea{width:100%;min-height:43px;max-height:160px;resize:vertical;border:0;outline:0;background:transparent;color:var(--ink);font:15px/1.7 var(--sans)}.composer textarea::placeholder{color:#9aa197}.composer-bottom{display:flex;align-items:center;justify-content:space-between;gap:15px}.privacy-note{color:#929a90;font-size:11px}.privacy-note span{color:#9c8b67;margin-right:5px}.send-button{min-width:43px;min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:9px;border:0;border-radius:9px;background:var(--forest);color:#fff;padding:0 14px;font-size:13px;font-weight:600;transition:background .2s}.send-button:hover{background:#344b39}.send-button:disabled{opacity:.55;cursor:wait}.send-button span[aria-hidden="true"]{color:#d7c69f;font-size:19px;line-height:1}.composer-disclaimer{margin:10px 0 0;color:#9aa197;font-size:10px;text-align:center}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.mobile-sidebar-backdrop{display:none}.site-header,.consult-home,.topics-section,.site-footer{display:none!important}
@media(max-width:900px){.sidebar{width:245px;flex-basis:245px}.starter-grid{gap:9px}.starter-card{padding:14px}}
@media(max-width:700px){.sidebar{position:fixed;z-index:40;inset:0 auto 0 0;width:min(290px,86vw);min-height:100dvh;transform:translateX(-105%);transition:transform .25s ease;box-shadow:15px 0 45px rgba(0,0,0,.18)}body.sidebar-open .sidebar{transform:translateX(0)}.mobile-sidebar-backdrop{position:fixed;z-index:35;inset:0;background:rgba(10,17,12,.48)}body.sidebar-open .mobile-sidebar-backdrop{display:block}.workspace{min-height:100dvh}.workspace-header{height:64px;flex-basis:64px;padding:0 16px;gap:12px}.mobile-menu-button{display:block}.workspace-heading strong{font-size:13px}.header-status{font-size:10px}.chat-area{width:calc(100% - 30px);padding:27px 0 16px}.welcome-screen{padding:15px 0 24px}.welcome-emblem{width:57px;height:57px;margin-bottom:18px;border-radius:17px}.welcome-emblem img{width:27px;height:38px}.welcome-screen h1{font-size:34px}.welcome-description{font-size:13px;line-height:1.7}.starter-grid{grid-template-columns:1fr;margin-top:25px}.starter-card{min-height:78px;padding:12px 15px 12px 48px;gap:4px}.starter-icon{position:absolute;left:15px;top:17px}.starter-card strong{font-size:13px}.starter-card small{font-size:10px}.composer-wrap{width:calc(100% - 24px);padding-bottom:10px}.composer{padding:11px 11px 9px 14px;border-radius:12px}.composer textarea{font-size:14px;min-height:40px}.privacy-note{max-width:70%;font-size:10px;line-height:1.4}.send-button{min-height:38px}.send-label{display:none}.composer-disclaimer{font-size:9px;line-height:1.5}.user-message{max-width:92%;font-size:14px}.answer-text{margin-left:0;font-size:14px}.sources-panel,.no-sources,.answer-caution,.conversation-actions{margin-left:0}.conversation-turn{padding-bottom:22px;margin-bottom:20px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important}}
/* Área administrativa conectada ao Supabase */

.admin-modal-wide{width:min(760px,100%);max-height:90vh;overflow-y:auto;text-align:left;padding:38px 34px 30px}
.admin-modal-wide>.eyebrow,.admin-modal-wide h2{text-align:center;justify-content:center}
.admin-form,.document-form{display:flex;flex-direction:column;gap:10px}
.admin-form p{margin:0 0 8px;text-align:center}
.admin-form label,.document-form label{font-size:14px;font-weight:700;color:#394639;margin-top:5px}
.admin-form input,.document-form input,.document-form select,.document-form textarea,.admin-document-controls select{width:100%;min-height:46px;border:1px solid #dfe3d9;background:#fbfcf9;padding:10px 12px;font:16px var(--sans);color:var(--ink);border-radius:2px}
.admin-form input:focus,.document-form input:focus,.document-form select:focus,.document-form textarea:focus{outline:3px solid rgba(119,132,95,.18);border-color:#899775}
.admin-form .send-button,.document-form .send-button{margin-top:12px;justify-content:center}
.admin-dashboard-top{display:flex;align-items:center;justify-content:space-between;gap:15px;border-bottom:1px solid var(--line);padding:5px 0 15px;margin-bottom:20px}
.admin-dashboard-top p{font-weight:700;color:var(--forest);margin:0}
.admin-secondary,.admin-delete{border:1px solid #dfe1d8;background:#fff;padding:9px 13px;color:var(--forest);font:600 13px var(--sans);cursor:pointer}
.document-form{background:#f8f9f5;border:1px solid var(--line);padding:20px;margin-bottom:24px}
.document-form h3,.admin-documents h3{font:700 17px var(--sans);color:var(--forest);margin:0 0 8px}
.admin-fields-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.admin-fields-grid>div{display:flex;flex-direction:column;gap:8px}
.document-form textarea{resize:vertical;min-height:75px}
.document-form input[type=file]{background:#fff}
.admin-documents{padding-bottom:10px}
.admin-document-item{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:14px 0;border-bottom:1px solid var(--line)}
.admin-document-details{display:flex;flex-direction:column;gap:5px;min-width:0}
.admin-document-details strong{font-size:14px;color:var(--forest);overflow-wrap:anywhere}
.admin-document-details span{font-size:12px;color:#777f73;overflow-wrap:anywhere}
.admin-document-controls{display:flex;align-items:center;gap:8px;flex-shrink:0}
.admin-document-controls select{width:auto;min-height:40px;font-size:13px}
.admin-delete{color:#9a3f36;border-color:#ead8d5}
.admin-feedback{padding:13px 15px;margin-top:16px;background:#f1f0e8;border-left:4px solid var(--gold);font-size:14px;line-height:1.6;color:#555d50}
.admin-feedback[data-type=error]{background:#fbefed;border-color:#b94d43;color:#7d302a}
.admin-feedback[data-type=success]{background:#edf4ec;border-color:#63865e;color:#355b32}
.admin-feedback[hidden]{display:none}
[hidden]{display:none!important}
.admin-form[hidden],#adminDashboard[hidden]{display:none!important}
@media(max-width:600px){
 .admin-modal-wide{padding:34px 18px 22px;max-height:94vh}
 .admin-fields-grid{grid-template-columns:1fr}
 .admin-document-item{align-items:stretch;flex-direction:column}
 .admin-document-controls{width:100%;flex-wrap:wrap}
 .admin-document-controls select{flex:1}
 .admin-delete{min-height:40px}
 .document-form{padding:15px}
}


/* ==========================================
   CORREÇÕES DE ACESSIBILIDADE E ÁREA ADMINISTRATIVA
   ========================================== */
:root {
  --sans: "Inter", Arial, sans-serif;
  --serif: "Inter", Arial, sans-serif;
  --ink: #202a23;
  --paper: #f7f8f6;
  --line: #d9dfd8;
}

/* Tipografia mais legível e com contraste reforçado */
html {
  font-size: 16px;
}

body,
button,
input,
select,
textarea {
  font-family: var(--sans);
}

body {
  color: #202a23;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.workspace-heading strong,
.answer-text,
.user-message,
.composer textarea {
  color: #202a23;
}

.welcome-description,
.starter-card small,
.header-status,
.privacy-note,
.composer-disclaimer,
.answer-caution {
  color: #59645b;
}

.workspace-kicker,
.welcome-screen .eyebrow {
  color: #596b58;
}

.sidebar-section-label,
.history-empty,
.sidebar-note {
  color: #d0d8cf;
}

.sidebar-version {
  color: #b7c1b6;
}

.starter-card small {
  font-size: 12px;
}

.answer-text,
.user-message,
.composer textarea {
  font-size: 16px;
  line-height: 1.75;
}

.sources-panel ul {
  color: #424d44;
  font-size: 13px;
  line-height: 1.8;
}

.sources-panel h3 {
  color: #344b38;
  font-size: 13px;
}

.privacy-note,
.composer-disclaimer {
  font-size: 12px;
}

/* Janela administrativa: sempre sobre a página, sem empurrar o layout */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(12, 20, 15, 0.68);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.modal-backdrop[hidden] {
  display: none !important;
}

.admin-modal {
  position: relative;
  width: min(760px, 100%);
  max-height: min(90vh, 900px);
  max-height: min(90dvh, 900px);
  overflow-x: hidden;
  overflow-y: auto;
  margin: auto;
  padding: 38px 34px 30px;
  border: 1px solid #dce2da;
  border-radius: 16px;
  background: #fff;
  color: #202a23;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  text-align: left;
}

.admin-modal-wide {
  width: min(900px, 100%);
  max-height: min(92vh, 940px);
  max-height: min(92dvh, 940px);
}

.admin-modal h2 {
  margin: 8px 0 24px;
  color: #202a23;
  font-family: var(--sans);
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.25;
  font-weight: 700;
}

.admin-modal .eyebrow {
  color: #596b58;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

.modal-close {
  position: sticky;
  top: 0;
  z-index: 2;
  float: right;
  width: 40px;
  height: 40px;
  margin: -18px -14px 0 12px;
  border: 1px solid #dce2da;
  border-radius: 10px;
  background: #fff;
  color: #344238;
  font-size: 27px;
  line-height: 1;
}

.modal-close:hover {
  background: #f0f3ee;
}

.admin-form,
.document-form {
  gap: 12px;
}

.admin-form p {
  color: #4b574d;
  font-size: 15px;
  line-height: 1.6;
}

.admin-form label,
.document-form label {
  color: #26352a;
  font-size: 14px;
  font-weight: 700;
}

.admin-form input,
.document-form input,
.document-form select,
.document-form textarea,
.admin-document-controls select {
  min-height: 48px;
  border: 1px solid #cbd4ca;
  border-radius: 8px;
  background: #fff;
  color: #202a23;
  font-family: var(--sans);
  font-size: 16px;
}

.admin-form input:focus,
.document-form input:focus,
.document-form select:focus,
.document-form textarea:focus {
  outline: 3px solid rgba(75, 105, 76, 0.18);
  border-color: #58745a;
}

.document-form {
  padding: 22px;
  border-radius: 12px;
  background: #f7f9f6;
}

.document-form h3,
.admin-documents h3 {
  color: #26382b;
  font-size: 18px;
  line-height: 1.4;
}

.admin-dashboard-top p {
  color: #26382b;
  font-size: 16px;
}

.admin-document-details strong {
  color: #26382b;
  font-size: 15px;
  line-height: 1.45;
}

.admin-document-details span {
  color: #566258;
  font-size: 13px;
  line-height: 1.5;
}

.admin-secondary,
.admin-delete,
.admin-document-controls select {
  min-height: 42px;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 14px;
}

.admin-feedback {
  color: #354238;
  font-size: 14px;
  line-height: 1.65;
  border-radius: 8px;
}

@media (max-width: 700px) {
  .modal-backdrop {
    place-items: start center;
    padding: 12px;
  }

  .admin-modal,
  .admin-modal-wide {
    width: 100%;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 28px 18px 22px;
    border-radius: 13px;
  }

  .modal-close {
    margin: -12px -7px 0 10px;
  }

  .admin-fields-grid {
    grid-template-columns: 1fr;
  }

  .admin-document-item {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-document-controls {
    width: 100%;
    flex-wrap: wrap;
  }

  .admin-document-controls select {
    flex: 1 1 100%;
  }
}


/* Identidade PRM, brasão do Exército e seletor de tema */
.sidebar-brand .brand-crest {
  width: 48px;
  height: 66px;
  object-fit: contain;
  flex: 0 0 auto;
}
.welcome-emblem {
  width: 112px;
  height: 142px;
  margin: 0 auto 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.welcome-emblem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.army-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 8px 8px;
  margin-top: 12px;
  border-top: 1px solid #526052;
  color: #eef1eb;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
}
.army-brand img {
  width: 36px;
  height: 42px;
  object-fit: contain;
}
.header-tools {
  display: flex;
  align-items: center;
  gap: 22px;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid #d6ded4;
  border-radius: 999px;
  background: #f4f7f2;
  color: #405343;
  cursor: pointer;
}
.theme-toggle .theme-sun,
.theme-toggle .theme-moon {
  font-size: 17px;
  line-height: 1;
}
.theme-switch {
  width: 38px;
  height: 21px;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #cbd5c8;
}
.theme-switch span {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0003;
  transition: transform .2s ease;
}
html[data-theme="dark"] .theme-switch { background: #526d55; }
html[data-theme="dark"] .theme-switch span { transform: translateX(17px); }
.conversation-actions { display: none !important; }

/* Paleta escura aplicada à interface inteira, sem afetar os dados */
html[data-theme="dark"] body,
html[data-theme="dark"] .workspace { background: #151d18; color: #e7ece6; }
html[data-theme="dark"] .workspace-header {
  background: #1c2820;
  border-color: #354238;
}
html[data-theme="dark"] .workspace-heading strong,
html[data-theme="dark"] .welcome-screen h1,
html[data-theme="dark"] .assistant-line { color: #e8eee7; }
html[data-theme="dark"] .workspace-kicker,
html[data-theme="dark"] .header-status,
html[data-theme="dark"] .welcome-description,
html[data-theme="dark"] .welcome-screen .eyebrow { color: #b4c0b4; }
html[data-theme="dark"] .starter-card,
html[data-theme="dark"] .composer,
html[data-theme="dark"] .sources-panel,
html[data-theme="dark"] .assistant-avatar {
  background: #202c24;
  border-color: #3b4a3e;
  color: #e8eee7;
}
html[data-theme="dark"] .starter-card strong,
html[data-theme="dark"] .answer-text,
html[data-theme="dark"] .sources-panel ul,
html[data-theme="dark"] .sources-panel h3 { color: #e0e8df; }
html[data-theme="dark"] .starter-card small,
html[data-theme="dark"] .privacy-note,
html[data-theme="dark"] .composer-disclaimer,
html[data-theme="dark"] .answer-caution { color: #aeb9ae; }
html[data-theme="dark"] .user-message {
  background: #2b3a30;
  border-color: #405244;
  color: #f0f3ef;
}
html[data-theme="dark"] .composer textarea { color: #f0f3ef; }
html[data-theme="dark"] .composer textarea::placeholder { color: #aab5aa; }
html[data-theme="dark"] .conversation-turn { border-color: #354238; }
html[data-theme="dark"] .theme-toggle {
  background: #26382c;
  border-color: #526d55;
  color: #f0f4ee;
}
html[data-theme="dark"] .mobile-menu-button { color: #e8eee7; }
html[data-theme="dark"] .loading-message {
  background: #26362b;
  color: #dbe5d9;
}
html[data-theme="dark"] .error-message {
  background: #472b29;
  color: #ffdcd7;
}
html[data-theme="dark"] .admin-modal {
  background: #1d2921;
  border-color: #405044;
  color: #e8eee7;
}
html[data-theme="dark"] .admin-modal h2,
html[data-theme="dark"] .admin-form label,
html[data-theme="dark"] .document-form label,
html[data-theme="dark"] .admin-dashboard-top p,
html[data-theme="dark"] .admin-document-details strong,
html[data-theme="dark"] .document-form h3,
html[data-theme="dark"] .admin-documents h3 { color: #e8eee7; }
html[data-theme="dark"] .admin-form p,
html[data-theme="dark"] .admin-document-details span { color: #b7c3b8; }
html[data-theme="dark"] .document-form {
  background: #243229;
  border-color: #405044;
}
html[data-theme="dark"] .admin-form input,
html[data-theme="dark"] .document-form input,
html[data-theme="dark"] .document-form select,
html[data-theme="dark"] .document-form textarea,
html[data-theme="dark"] .admin-document-controls select {
  background: #17221b;
  border-color: #526354;
  color: #f0f4ef;
}
html[data-theme="dark"] .admin-secondary,
html[data-theme="dark"] .admin-delete,
html[data-theme="dark"] .modal-close {
  background: #26362b;
  border-color: #526354;
  color: #e8eee7;
}
html[data-theme="dark"] .admin-feedback {
  background: #30372a;
  color: #e8eee7;
}
@media (max-width: 700px) {
  .header-tools { gap: 9px; }
  .header-status { display: none; }
  .welcome-emblem { width: 88px; height: 112px; }
  .sidebar-brand .brand-crest { width: 43px; height: 59px; }
}


/* Layout fixo: a rolagem acontece apenas dentro da conversa */
html, body {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.app-layout {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.sidebar {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  flex: 0 0 278px;
}
.conversation-history {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.workspace {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.workspace-header {
  flex: 0 0 76px;
}
.chat-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-top: 30px;
  padding-bottom: 24px;
}
.composer-wrap {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  width: min(920px,calc(100% - 56px));
  margin: 0 auto;
  padding: 10px 0 max(17px, env(safe-area-inset-bottom));
  background: var(--paper, #fbfcfa);
}
html[data-theme="dark"] .composer-wrap {
  background: #151d18;
}
.welcome-screen {
  flex: 0 0 auto;
}
.welcome-screen[hidden] { display:none !important; }
.conversation-output {
  flex: 0 0 auto;
}
/* Preserva as cores originais do brasão do PRM sobre o fundo verde */
.brand-crest,
.welcome-emblem img {
  mix-blend-mode: normal;
  opacity: 1;
  background: transparent !important;
}
.army-brand img {
  width: 36px;
  height: 42px;
  object-fit: contain;
}
@media (max-width:700px) {
  .sidebar {
    height: 100dvh;
    min-height: 0;
  }
  .workspace {
    height: 100dvh;
    min-height: 0;
  }
  .workspace-header { flex-basis:64px; }
  .chat-area {
    width: calc(100% - 30px);
    min-height: 0;
    padding-top: 18px;
    padding-bottom: 12px;
  }
  .composer-wrap {
    width: calc(100% - 24px);
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}

/* Contraste consistente do tema escuro em todas as áreas de conteúdo */
html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #151d18;
  --ink: #e7ece6;
  --line: #354238;
}
html[data-theme="dark"] body,
html[data-theme="dark"] .app-layout,
html[data-theme="dark"] .workspace,
html[data-theme="dark"] .chat-area { background:#151d18; color:#e7ece6; }
html[data-theme="dark"] .workspace-header {
  background:#1c2820;
  border-color:#354238;
}
html[data-theme="dark"] .workspace-heading strong,
html[data-theme="dark"] .welcome-screen h1,
html[data-theme="dark"] .starter-card strong,
html[data-theme="dark"] .answer-text,
html[data-theme="dark"] .sources-panel h3,
html[data-theme="dark"] .sources-panel ul { color:#e7ece6; }
html[data-theme="dark"] .welcome-description,
html[data-theme="dark"] .workspace-kicker,
html[data-theme="dark"] .header-status,
html[data-theme="dark"] .starter-card small,
html[data-theme="dark"] .privacy-note,
html[data-theme="dark"] .composer-disclaimer { color:#b6c2b7; }
html[data-theme="dark"] .starter-card,
html[data-theme="dark"] .composer,
html[data-theme="dark"] .sources-panel {
  background:#202c24;
  color:#e7ece6;
  border-color:#3b4a3e;
}
html[data-theme="dark"] .composer textarea { color:#f2f5f1; }
html[data-theme="dark"] .composer textarea::placeholder { color:#aab7ab; }
html[data-theme="dark"] .user-message {
  background:#2b3a30;
  color:#f0f3ef;
  border-color:#405244;
}
html[data-theme="dark"] .conversation-turn { border-color:#354238; }
html[data-theme="dark"] .welcome-emblem { background:transparent; border:0; box-shadow:none; }
html[data-theme="dark"] .admin-modal {
  background:#1d2921;
  color:#e7ece6;
  border-color:#405044;
}
html[data-theme="dark"] .admin-modal h2,
html[data-theme="dark"] .admin-form label,
html[data-theme="dark"] .document-form label,
html[data-theme="dark"] .admin-document-details strong { color:#e7ece6; }
html[data-theme="dark"] .admin-form input,
html[data-theme="dark"] .document-form input,
html[data-theme="dark"] .document-form select,
html[data-theme="dark"] .document-form textarea,
html[data-theme="dark"] .admin-document-controls select {
  background:#17221b;
  color:#f0f4ef;
  border-color:#526354;
}
html[data-theme="dark"] .document-form { background:#243229; }
html[data-theme="dark"] .theme-toggle { background:#26382c; color:#f0f4ee; border-color:#526d55; }



/* Crédito de desenvolvimento na barra lateral */
.creator-credit {
  margin: 14px 8px 0;
  padding: 12px 0 2px;
  border-top: 1px solid #526052;
  color: #cbd5c8;
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: .1px;
}


/* Indicador do tempo gasto para gerar cada resposta */
.response-time {
  margin: 10px 0 0;
  color: #778278;
  font-size: 12px;
  line-height: 1.5;
}
html[data-theme="dark"] .response-time {
  color: #aab7ab;
}


/* Central de apoio — painel lateral desktop */
.workspace { position: relative; }
.support-panel {
  display: none;
}
@media (min-width: 1350px) {
  .support-panel {
    position: absolute;
    top: 98px;
    right: 28px;
    bottom: 118px;
    width: 270px;
    display: flex;
    flex-direction: column;
    gap: 13px;
    overflow-y: auto;
    padding: 4px 3px 12px;
    scrollbar-width: thin;
    scrollbar-color: #cbd3c8 transparent;
  }
  .chat-area,
  .composer-wrap {
    width: min(920px, calc(100% - 350px));
    margin-left: clamp(28px, 4vw, 62px);
    margin-right: 0;
  }
  .chat-area {
    padding-top: 30px;
  }
}
.support-panel-heading {
  padding: 4px 3px 5px;
}
.support-eyebrow {
  color: #8b967f;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
}
.support-panel-heading h2 {
  margin: 7px 0 5px;
  color: #2b3b2e;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
}
.support-panel-heading p {
  margin: 0;
  color: #788276;
  font-size: 11px;
  line-height: 1.6;
}
.support-card {
  padding: 15px 14px;
  border: 1px solid #e1e7df;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(31,47,34,.035);
}
.support-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}
.support-card-title h3 {
  margin: 0;
  color: #354438;
  font-size: 12px;
  font-weight: 700;
}
.support-icon {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eff3ec;
  color: #71836b;
  font-size: 15px;
  font-weight: 700;
}
.support-prompt {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 2px;
  border: 0;
  border-top: 1px solid #edf0eb;
  background: transparent;
  color: #59665a;
  text-align: left;
  font-size: 11px;
  line-height: 1.4;
  transition: color .15s, padding .15s;
}
.support-prompt-pending,
.support-prompt-pending:hover {
  padding-left: 2px;
  color: #788278;
  cursor: not-allowed;
  opacity: .78;
}
.support-prompt-pending .pending-label {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid #e4e8e1;
  border-radius: 999px;
  background: #f4f6f2;
  color: #7a8578;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .02em;
}
html[data-theme="dark"] .support-prompt-pending .pending-label {
  border-color: #465047;
  background: #303a31;
  color: #c0c9bd;
}
.support-prompt span:last-child {
  color: #a28e63;
  font-size: 14px;
}
.support-prompt:hover {
  padding-left: 5px;
  color: #263d2c;
}
.support-card > p {
  margin: 0;
  color: #737e73;
  font-size: 11px;
  line-height: 1.7;
}
.support-team-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.support-team-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 0;
  border-top: 1px solid #edf0eb;
  font-size: 11px;
  line-height: 1.4;
}
.support-team-list li:first-child {
  border-top: 0;
  padding-top: 0;
}
.support-team-list strong {
  color: #465548;
  font-weight: 700;
}
.support-team-list span {
  color: #7a857a;
  font-size: 10px;
}
html[data-theme="dark"] .support-team-list li {
  border-color: #354238;
}
html[data-theme="dark"] .support-team-list strong {
  color: #e1e9df;
}
html[data-theme="dark"] .support-team-list span {
  color: #b3beb3;
}
.support-attention {
  background: #fbfaf6;
  border-color: #e9e3d4;
}
.support-attention .support-icon {
  background: #f3efe4;
  color: #9a8355;
}
.support-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 8px 3px 0;
  color: #899487;
  font-size: 10px;
}
.support-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7e9a72;
  box-shadow: 0 0 0 3px #edf3e9;
}
html[data-theme="dark"] .support-panel-heading h2 { color: #e7ece6; }
html[data-theme="dark"] .support-panel-heading p,
html[data-theme="dark"] .support-card > p,
html[data-theme="dark"] .support-footer { color: #b3beb3; }
html[data-theme="dark"] .support-card {
  background: #202c24;
  border-color: #3b4a3e;
  box-shadow: none;
}
html[data-theme="dark"] .support-card-title h3 { color: #e1e9df; }
html[data-theme="dark"] .support-icon { background: #2c3d30; color: #bdcbb8; }
html[data-theme="dark"] .support-prompt {
  border-color: #354238;
  color: #c1cdc0;
}
html[data-theme="dark"] .support-prompt:hover { color: #fff; }
html[data-theme="dark"] .support-attention {
  background: #2c2b22;
  border-color: #514b36;
}
html[data-theme="dark"] .support-attention .support-icon {
  background: #403a29;
  color: #d7c18e;
}
@media (max-width: 700px) {
  .support-panel { display: none !important; }
}


/* Ajuste estrutural da Central de Apoio: colunas independentes, sem sobreposição */
@media (min-width: 1350px) {
  .workspace {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px;
    grid-template-rows: 76px minmax(0, 1fr) auto;
    column-gap: 24px;
    padding: 0 28px 0 30px;
    overflow: hidden;
  }
  .workspace-header {
    grid-column: 1 / -1;
    grid-row: 1;
    margin: 0 -28px 0 -30px;
    min-width: 0;
  }
  .chat-area {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 26px 0 20px;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .composer-wrap {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 10px 0 max(17px, env(safe-area-inset-bottom));
  }
  .support-panel {
    position: static;
    grid-column: 2;
    grid-row: 2 / 4;
    align-self: stretch;
    width: 100%;
    min-width: 0;
    height: auto;
    max-height: none;
    margin: 0;
    padding: 24px 0 18px;
    overflow-y: auto;
    overflow-x: hidden;
  }
}

/* Oculta apenas o desenho das barras; a rolagem continua disponível quando necessária */
.conversation-history,
.chat-area,
.support-panel,
.admin-modal,
.modal-backdrop {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.conversation-history::-webkit-scrollbar,
.chat-area::-webkit-scrollbar,
.support-panel::-webkit-scrollbar,
.admin-modal::-webkit-scrollbar,
.modal-backdrop::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}


/* Central de Apoio: equipe por função, biblioteca e comunicados */
.team-group { padding-top: 9px; margin-top: 8px; border-top: 1px solid #edf0eb; }
.team-group:first-of-type { padding-top: 0; margin-top: 0; border-top: 0; }
.team-group-label { display:block; margin-bottom:5px; color:#8b967f; font-size:9px; font-weight:800; letter-spacing:1px; }
.team-member { display:flex; flex-direction:column; gap:2px; padding:5px 0; font-size:11px; line-height:1.4; }
.team-member strong { color:#465548; font-weight:700; }
.team-member span { color:#7a857a; font-size:10px; }
.team-chief { padding:8px 9px; border-radius:8px; background:#f4f6f1; }
.library-count { display:flex; align-items:baseline; gap:8px; padding:3px 0 12px; }
.library-count strong { color:#344b38; font-size:27px; line-height:1; font-weight:800; }
.library-count span { color:#737e73; font-size:10px; }
.recent-documents { padding-top:9px; border-top:1px solid #edf0eb; }
.recent-documents ul { margin:0; padding:0; list-style:none; }
.recent-documents li { display:flex; flex-direction:column; gap:2px; padding:7px 0; border-top:1px solid #f0f2ee; color:#465548; font-size:10px; line-height:1.4; }
.recent-documents li:first-child { border-top:0; }
.recent-documents li strong { font-weight:650; }
.recent-documents li span { color:#899487; font-size:9px; }
.public-notices-list > p { margin:0; color:#737e73; font-size:11px; line-height:1.6; }
.public-notice { position:relative; padding:9px 9px 9px 11px; margin-top:8px; border-left:3px solid #8a9b80; border-radius:5px; background:#f5f7f3; }
.public-notice[data-priority="important"] { border-left-color:#b28c45; background:#faf7ef; }
.public-notice[data-priority="urgent"] { border-left-color:#b85b50; background:#fbf2f0; }
.public-notice > strong { display:block; margin-bottom:4px; color:#354438; font-size:11px; }
.public-notice p { margin:0 0 6px; color:#626e63; font-size:10px; line-height:1.55; white-space:pre-wrap; }
.notice-priority { color:#8b967f; font-size:8px; font-weight:800; letter-spacing:.8px; }
.notice-form { margin:12px 0 18px; }
.notice-form-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.notice-form-actions .send-button { width:auto; }
.admin-notices-manager > h3 { margin-top:26px; }
.admin-notices-manager #adminNoticeList { display:grid; gap:10px; }
html[data-theme="dark"] .team-group { border-color:#354238; }
html[data-theme="dark"] .team-group-label { color:#aab8a6; }
html[data-theme="dark"] .team-member strong,
html[data-theme="dark"] .recent-documents li { color:#e1e9df; }
html[data-theme="dark"] .team-member span,
html[data-theme="dark"] .library-count span,
html[data-theme="dark"] .recent-documents li span { color:#b3beb3; }
html[data-theme="dark"] .team-chief { background:#2c3a2e; }
html[data-theme="dark"] .library-count strong { color:#e1e9df; }
html[data-theme="dark"] .recent-documents,
html[data-theme="dark"] .recent-documents li { border-color:#354238; }
html[data-theme="dark"] .public-notice { background:#26362b; border-left-color:#8da785; }
html[data-theme="dark"] .public-notice[data-priority="important"] { background:#3b3525; border-left-color:#c5a35f; }
html[data-theme="dark"] .public-notice[data-priority="urgent"] { background:#422b29; border-left-color:#c9786d; }
html[data-theme="dark"] .public-notice > strong { color:#e7ece6; }
html[data-theme="dark"] .public-notice p { color:#c2cdc2; }


/* Menu lateral retrátil em telas maiores */
@media (min-width: 701px) {
  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    margin-right: 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--forest);
    cursor: pointer;
    transition: background .2s, border-color .2s;
  }
  .mobile-menu-button:hover { background: #f0f3ed; border-color: #cbd4c8; }
  .workspace-header { justify-content: flex-start; }
  .workspace-heading { flex: 1; }
  .sidebar { transition: width .25s ease, flex-basis .25s ease, padding .25s ease; overflow-x: hidden; }
  /* Como no ChatGPT: a barra desaparece por completo e o conteúdo ocupa o espaço. */
  body.sidebar-collapsed .sidebar {
    width: 0;
    min-width: 0;
    flex: 0 0 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    visibility: hidden;
  }
  body.sidebar-collapsed .workspace {
    min-width: 0;
    flex: 1 1 100%;
  }
  body.sidebar-collapsed .mobile-menu-button {
    margin-right: 15px;
  }
}
@media (max-width: 700px) {
  .mobile-menu-button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: 0 0 36px; }
}
html[data-theme="dark"] .mobile-menu-button { color: #e1e9df; border-color: #39483d; }
html[data-theme="dark"] .mobile-menu-button:hover { background: #26352b; border-color: #536453; }


/* Botão de navegação à esquerda, no padrão do ChatGPT */
.workspace-header > .mobile-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  margin: 0 12px 0 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #899486;
  cursor: pointer;
  opacity: .82;
  transition: background .2s, color .2s, opacity .2s;
}
.workspace-header > .mobile-menu-button:hover {
  background: rgba(120, 137, 117, .10);
  color: var(--forest);
  opacity: 1;
}
html[data-theme="dark"] .workspace-header > .mobile-menu-button {
  color: #aab8a6;
  border: 0;
}
html[data-theme="dark"] .workspace-header > .mobile-menu-button:hover {
  background: rgba(190, 205, 185, .10);
  color: #e1e9df;
}


/* Entrada de perguntas por voz */
.composer-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}
.voice-button {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfe5dc;
  border-radius: 9px;
  background: #f7f9f5;
  color: #526b55;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}
.voice-button:hover {
  background: #edf3e9;
  border-color: #b9c8b4;
  color: #294b32;
}
.voice-button.is-recording {
  background: #f8e9e6;
  border-color: #d98b80;
  color: #a43f35;
  box-shadow: 0 0 0 4px rgba(190, 83, 70, .12);
  animation: voice-pulse 1.5s ease-in-out infinite;
}
@keyframes voice-pulse {
  50% { box-shadow: 0 0 0 7px rgba(190, 83, 70, .05); }
}
.voice-status {
  margin: 8px 4px 0;
  color: #71806f;
  font-size: 11px;
  line-height: 1.5;
}
.voice-status-error { color: #a34c42; }
html[data-theme="dark"] .voice-button {
  background: #26362b;
  border-color: #465849;
  color: #c5d3c0;
}
html[data-theme="dark"] .voice-button:hover {
  background: #304332;
  border-color: #60765f;
  color: #f0f4ee;
}
html[data-theme="dark"] .voice-button.is-recording {
  background: #482d2b;
  border-color: #a85d55;
  color: #ffd9d3;
}
html[data-theme="dark"] .voice-status { color: #b4c3b1; }
html[data-theme="dark"] .voice-status-error { color: #f0a69d; }
@media (max-width: 700px) {
  .composer-bottom { gap: 8px; }
  .privacy-note { max-width: 52%; line-height: 1.4; }
  .composer-actions { gap: 7px; }
  .voice-button { width: 39px; height: 39px; }
}


/* Central de apoio acessível em celulares e tablets */
.support-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #dfe5dc;
  border-radius: 9px;
  background: #fff;
  color: #526b55;
  font: 600 11px/1 var(--sans);
  cursor: pointer;
  white-space: nowrap;
}
.support-toggle:hover {
  background: #f1f5ef;
  border-color: #bdcbb8;
}
.support-backdrop { display: none; }

@media (max-width: 1349px) {
  .support-toggle { display: inline-flex; }
}
@media (max-width: 700px) {
  .workspace-header { gap: 8px; }
  .workspace-heading { min-width: 0; flex: 1 1 auto; }
  .workspace-heading strong { font-size: 12px; }
  .header-tools { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
  .support-toggle {
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 9px;
  }
  .support-toggle span { display: none; }
  .support-panel {
    display: none !important;
    position: fixed;
    z-index: 61;
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: min(390px, calc(100vw - 24px));
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
    min-height: 0;
    margin: 0;
    padding: 18px 14px 24px;
    flex-direction: column;
    align-items: stretch;
    gap: 13px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    border: 1px solid #dfe5dc;
    border-radius: 16px;
    background: #f8faf7;
    box-shadow: 0 18px 55px rgba(0,0,0,.22);
    overscroll-behavior: contain;
  }
  .support-panel > * {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
  }
  body.support-open .support-panel { display: flex !important; }
  .support-backdrop {
    display: none;
    position: fixed;
    z-index: 60;
    inset: 0;
    background: rgba(10, 17, 12, .52);
  }
  body.support-open .support-backdrop { display: block; }
  html[data-theme="dark"] .support-panel {
    background: #17221b;
    border-color: #3b4a3e;
  }
  html[data-theme="dark"] .support-toggle {
    background: #26362b;
    border-color: #465849;
    color: #d5e0d1;
  }
}


/* No celular, simplifica a tela inicial removendo os cartões de sugestões. */
@media (max-width: 700px) {
  .starter-grid { display: none !important; }
}


/* Botão de retorno da Central de Apoio no celular */
.support-back-button { display: none; }
@media (max-width: 700px) {
  .support-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    gap: 8px;
    min-height: 40px;
    margin: 0 0 12px;
    padding: 0 12px;
    border: 1px solid #dfe5dc;
    border-radius: 9px;
    background: #fff;
    color: #405844;
    font: 600 13px/1 var(--sans);
    cursor: pointer;
  }
  .support-back-button span { font-size: 20px; line-height: 1; }
  .support-back-button:active { background: #edf2eb; }
  html[data-theme="dark"] .support-back-button {
    background: #26362b;
    border-color: #465849;
    color: #e0e8dc;
  }
}


/* ==========================================
   REFINAMENTO VISUAL — INTERFACE MAIS CLEAN
   Tema escuro em grafite com nuance verde-sálvia
   ========================================== */

/* Reduz ruído visual também no tema claro */
.sidebar {
  border-right: 1px solid rgba(120, 140, 124, .12);
}
.workspace-header {
  box-shadow: none;
}
.starter-card,
.composer,
.sources-panel,
.support-card {
  box-shadow: none;
}
.starter-card {
  border-radius: 12px;
}
.starter-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(30, 45, 33, .045);
}
.composer {
  border-radius: 16px;
}
.support-panel {
  gap: 11px;
}
.support-card {
  border-radius: 13px;
}

/* Tema escuro: tons menos saturados e menor contraste agressivo */
html[data-theme="dark"] {
  color-scheme: dark;
  --forest: #273633;
  --forest-deep: #202d2b;
  --paper: #202b2a;
  --ink: #e1e9e5;
  --line: #354441;
}
html[data-theme="dark"] body,
html[data-theme="dark"] .app-layout,
html[data-theme="dark"] .workspace,
html[data-theme="dark"] .chat-area {
  background: #202b2a;
  color: #e1e9e5;
}
html[data-theme="dark"] .sidebar {
  background: #24322f;
  border-right-color: #344440;
  color: #e1e9e5;
}
html[data-theme="dark"] .sidebar-brand strong,
html[data-theme="dark"] .workspace-heading strong,
html[data-theme="dark"] .welcome-screen h1,
html[data-theme="dark"] .assistant-line {
  color: #e5ece8;
}
html[data-theme="dark"] .sidebar-brand small,
html[data-theme="dark"] .sidebar-section-label,
html[data-theme="dark"] .history-empty,
html[data-theme="dark"] .sidebar-note,
html[data-theme="dark"] .sidebar-version {
  color: #aab9b2;
}
html[data-theme="dark"] .new-chat-button,
html[data-theme="dark"] .sidebar-admin {
  background: #2b3a36;
  border-color: #40534b;
  color: #e5ece8;
}
html[data-theme="dark"] .new-chat-button:hover,
html[data-theme="dark"] .sidebar-admin:hover,
html[data-theme="dark"] .history-row:hover,
html[data-theme="dark"] .history-item:hover,
html[data-theme="dark"] .history-item.active {
  background: #344640;
}
html[data-theme="dark"] .history-item {
  color: #d5e0da;
}
html[data-theme="dark"] .history-action {
  color: #b9c8c0;
}
html[data-theme="dark"] .workspace-header {
  background: #24312f;
  border-bottom-color: #354541;
}
html[data-theme="dark"] .workspace-kicker,
html[data-theme="dark"] .header-status,
html[data-theme="dark"] .welcome-description,
html[data-theme="dark"] .welcome-screen .eyebrow {
  color: #aebdb5;
}
html[data-theme="dark"] .welcome-screen h1 em {
  color: #a9bba9;
}
html[data-theme="dark"] .welcome-emblem {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
html[data-theme="dark"] .starter-card,
html[data-theme="dark"] .composer,
html[data-theme="dark"] .sources-panel,
html[data-theme="dark"] .assistant-avatar {
  background: #293735;
  border-color: #3b4c46;
  color: #e1e9e5;
  box-shadow: none;
}
html[data-theme="dark"] .starter-card:hover {
  background: #30403b;
  border-color: #50645a;
  box-shadow: none;
}
html[data-theme="dark"] .starter-card strong,
html[data-theme="dark"] .answer-text,
html[data-theme="dark"] .sources-panel h3,
html[data-theme="dark"] .sources-panel ul {
  color: #dce6e0;
}
html[data-theme="dark"] .starter-card small,
html[data-theme="dark"] .privacy-note,
html[data-theme="dark"] .composer-disclaimer,
html[data-theme="dark"] .answer-caution {
  color: #aab9b1;
}
html[data-theme="dark"] .starter-icon,
html[data-theme="dark"] .starter-arrow {
  color: #aebda7;
}
html[data-theme="dark"] .user-message {
  background: #30403b;
  border-color: #40534b;
  color: #e3ebe6;
}
html[data-theme="dark"] .composer {
  border-color: #40534b;
}
html[data-theme="dark"] .composer:focus-within {
  border-color: #829b89;
  box-shadow: 0 0 0 2px rgba(151, 177, 157, .10);
}
html[data-theme="dark"] .composer textarea {
  color: #e7eee9;
}
html[data-theme="dark"] .composer textarea::placeholder {
  color: #9eafa5;
}
html[data-theme="dark"] .send-button {
  background: #789080;
  color: #17231e;
}
html[data-theme="dark"] .send-button:hover {
  background: #8da596;
}
html[data-theme="dark"] .send-button span[aria-hidden="true"] {
  color: #24332c;
}
html[data-theme="dark"] .conversation-turn {
  border-color: #354541;
}
html[data-theme="dark"] .conversation-actions button {
  background: #293735;
  border-color: #40534b;
  color: #d5e0da;
}
html[data-theme="dark"] .loading-message {
  background: #293735;
  color: #bdcbc2;
}
html[data-theme="dark"] .error-message {
  background: #3b302f;
  color: #edc1ba;
}
html[data-theme="dark"] .theme-toggle {
  background: #2b3b36;
  border-color: #506258;
  color: #e3ebe6;
}
html[data-theme="dark"] .support-panel {
  background: #24322f;
  border-color: #3a4b45;
}
html[data-theme="dark"] .support-panel-heading h2,
html[data-theme="dark"] .support-card-title h3,
html[data-theme="dark"] .support-card > strong {
  color: #e1e9e5;
}
html[data-theme="dark"] .support-panel-heading p,
html[data-theme="dark"] .support-card > p,
html[data-theme="dark"] .support-footer {
  color: #aebdb5;
}
html[data-theme="dark"] .support-card {
  background: #293835;
  border-color: #3b4c46;
  box-shadow: none;
}
html[data-theme="dark"] .support-icon {
  background: #354840;
  color: #bdcdbf;
}
html[data-theme="dark"] .support-prompt {
  color: #c5d3ca;
  border-color: #3b4c46;
}
html[data-theme="dark"] .support-prompt:hover {
  background: #30423b;
  color: #edf3ef;
}
html[data-theme="dark"] .support-attention {
  background: #38382f;
  border-color: #555344;
}
html[data-theme="dark"] .support-attention .support-icon {
  background: #484536;
  color: #d5c99e;
}
html[data-theme="dark"] .team-group,
html[data-theme="dark"] .recent-documents,
html[data-theme="dark"] .recent-documents li {
  border-color: #3b4c46;
}
html[data-theme="dark"] .team-member strong,
html[data-theme="dark"] .recent-documents li,
html[data-theme="dark"] .public-notice > strong {
  color: #dce6e0;
}
html[data-theme="dark"] .team-member span,
html[data-theme="dark"] .team-group-label,
html[data-theme="dark"] .library-count span,
html[data-theme="dark"] .recent-documents li span,
html[data-theme="dark"] .public-notices-list > p {
  color: #aebdb5;
}
html[data-theme="dark"] .team-chief,
html[data-theme="dark"] .public-notice {
  background: #2d3d37;
}
html[data-theme="dark"] .public-notice[data-priority="important"] {
  background: #3a392f;
}
html[data-theme="dark"] .public-notice[data-priority="urgent"] {
  background: #3c3231;
}
html[data-theme="dark"] .public-notice p {
  color: #c5d1ca;
}
html[data-theme="dark"] .voice-button,
html[data-theme="dark"] .support-toggle,
html[data-theme="dark"] .support-back-button {
  background: #2d3d37;
  border-color: #46594f;
  color: #d2dfd6;
}
html[data-theme="dark"] .voice-button:hover,
html[data-theme="dark"] .support-toggle:hover,
html[data-theme="dark"] .support-back-button:hover {
  background: #384a41;
  border-color: #60776a;
  color: #f0f4f1;
}
html[data-theme="dark"] .voice-button.is-recording {
  background: #493533;
  border-color: #a66f67;
  color: #f2d8d3;
}
html[data-theme="dark"] .voice-status {
  color: #aebdb5;
}
html[data-theme="dark"] .workspace-header > .mobile-menu-button {
  color: #b4c5bb;
}
html[data-theme="dark"] .workspace-header > .mobile-menu-button:hover {
  background: #30403b;
  color: #edf3ef;
}
html[data-theme="dark"] .support-backdrop {
  background: rgba(8, 15, 13, .58);
}
@media (max-width: 700px) {
  html[data-theme="dark"] .support-panel {
    background: #24322f;
    border-color: #3a4b45;
  }
}


/* Ajuste fino: unifica os tons do tema escuro para evitar painéis destoantes */
html[data-theme="dark"] {
  --dark-bg: #202925;
  --dark-surface: #252f2a;
  --dark-card: #29342e;
  --dark-border: #35423a;
  --dark-text: #e2e9e4;
  --dark-muted: #aebbb2;
}
html[data-theme="dark"] body,
html[data-theme="dark"] .app-layout,
html[data-theme="dark"] .workspace,
html[data-theme="dark"] .chat-area {
  background: var(--dark-bg) !important;
  color: var(--dark-text);
}
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .workspace-header,
html[data-theme="dark"] .support-panel {
  background: var(--dark-surface) !important;
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] .new-chat-button,
html[data-theme="dark"] .sidebar-admin,
html[data-theme="dark"] .starter-card,
html[data-theme="dark"] .composer,
html[data-theme="dark"] .sources-panel,
html[data-theme="dark"] .assistant-avatar,
html[data-theme="dark"] .support-card,
html[data-theme="dark"] .voice-button,
html[data-theme="dark"] .support-toggle,
html[data-theme="dark"] .support-back-button,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .conversation-actions button {
  background: var(--dark-card) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text);
  box-shadow: none !important;
}
html[data-theme="dark"] .history-row:hover,
html[data-theme="dark"] .history-item:hover,
html[data-theme="dark"] .history-item.active,
html[data-theme="dark"] .new-chat-button:hover,
html[data-theme="dark"] .sidebar-admin:hover,
html[data-theme="dark"] .starter-card:hover,
html[data-theme="dark"] .voice-button:hover,
html[data-theme="dark"] .support-toggle:hover,
html[data-theme="dark"] .support-back-button:hover {
  background: #303b34 !important;
}
html[data-theme="dark"] .user-message,
html[data-theme="dark"] .team-chief,
html[data-theme="dark"] .public-notice {
  background: #2b3730 !important;
  border-color: var(--dark-border);
  color: var(--dark-text);
}
html[data-theme="dark"] .public-notice[data-priority="important"] {
  background: #35372e !important;
}
html[data-theme="dark"] .public-notice[data-priority="urgent"] {
  background: #3a302e !important;
}
html[data-theme="dark"] .workspace-heading strong,
html[data-theme="dark"] .welcome-screen h1,
html[data-theme="dark"] .assistant-line,
html[data-theme="dark"] .starter-card strong,
html[data-theme="dark"] .answer-text,
html[data-theme="dark"] .sources-panel h3,
html[data-theme="dark"] .sources-panel ul,
html[data-theme="dark"] .support-panel-heading h2,
html[data-theme="dark"] .support-card-title h3,
html[data-theme="dark"] .team-member strong,
html[data-theme="dark"] .recent-documents li,
html[data-theme="dark"] .public-notice > strong {
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .workspace-kicker,
html[data-theme="dark"] .header-status,
html[data-theme="dark"] .welcome-description,
html[data-theme="dark"] .welcome-screen .eyebrow,
html[data-theme="dark"] .starter-card small,
html[data-theme="dark"] .privacy-note,
html[data-theme="dark"] .composer-disclaimer,
html[data-theme="dark"] .answer-caution,
html[data-theme="dark"] .support-panel-heading p,
html[data-theme="dark"] .support-card > p,
html[data-theme="dark"] .support-footer,
html[data-theme="dark"] .team-member span,
html[data-theme="dark"] .team-group-label,
html[data-theme="dark"] .recent-documents li span,
html[data-theme="dark"] .public-notice p {
  color: var(--dark-muted) !important;
}
html[data-theme="dark"] .conversation-turn,
html[data-theme="dark"] .team-group,
html[data-theme="dark"] .recent-documents,
html[data-theme="dark"] .recent-documents li {
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] .composer {
  border-color: #3a4940 !important;
}
html[data-theme="dark"] .composer:focus-within {
  border-color: #718879 !important;
  box-shadow: 0 0 0 2px rgba(139, 165, 145, .10) !important;
}
html[data-theme="dark"] .send-button {
  background: #819889 !important;
  color: #1e2923 !important;
}
html[data-theme="dark"] .send-button:hover {
  background: #91a798 !important;
}
html[data-theme="dark"] .welcome-emblem {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}


/* Integra o campo de pergunta e a Central ao próprio fundo no tema escuro */
html[data-theme="dark"] .composer,
html[data-theme="dark"] .support-panel {
  background: var(--dark-bg, #202925) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .composer:focus-within {
  background: var(--dark-bg, #202925) !important;
  border-color: #46554b !important;
  box-shadow: 0 0 0 1px rgba(160, 180, 164, .10) !important;
}
html[data-theme="dark"] .support-card {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .composer textarea {
  background: transparent !important;
}
html[data-theme="dark"] .support-panel {
  outline: none !important;
}


/* Remove a faixa de fundo atrás do campo de pergunta no tema escuro */
html[data-theme="dark"] .composer-wrap {
  background: var(--dark-bg, #202925) !important;
  box-shadow: none !important;
}


/* Contorno sutil e permanente no campo de pergunta */
html[data-theme="dark"] .composer {
  border: 1px solid #52645a !important;
  border-radius: 16px;
}
html[data-theme="dark"] .composer:focus-within {
  border-color: #8da596 !important;
  box-shadow: 0 0 0 2px rgba(141, 165, 150, .14) !important;
}


/* Remove os cartões de perguntas sugeridas em todas as telas */
.starter-grid {
  display: none !important;
}


/* Central de Apoio com acabamento semelhante à barra lateral */
@media (min-width: 701px) {
  .support-panel {
    padding: 16px 13px 18px !important;
    border: 1px solid #dce3d9;
    border-radius: 14px;
    background: #f1f4ef;
  }
}
html[data-theme="dark"] .support-panel {
  background: #26332e !important;
  border: 1px solid #46564c !important;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12) !important;
}
html[data-theme="dark"] .support-card {
  background: #2b3932 !important;
  border: 1px solid #435249 !important;
  border-radius: 10px;
}
@media (max-width: 700px) {
  html[data-theme="dark"] .support-panel {
    background: #26332e !important;
    border: 1px solid #46564c !important;
    border-radius: 16px;
  }
}


/* Central de Apoio: painel lateral destacado, no mesmo padrão estrutural da sidebar */
.support-panel {
  padding: 16px 13px 18px !important;
  border: 1px solid #d5ded4 !important;
  border-radius: 14px !important;
  background: #eef2ec !important;
  box-shadow: 0 5px 18px rgba(28, 43, 32, .06) !important;
}
.support-panel .support-card {
  background: #f8faf7 !important;
  border: 1px solid #dce4da !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .support-panel {
  background: #293731 !important;
  border: 1px solid #536258 !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .16) !important;
}
html[data-theme="dark"] .support-panel .support-card {
  background: #303e36 !important;
  border: 1px solid #4a5b50 !important;
}


/* Histórico central de consultas — painel administrativo */
.admin-history-section {
  margin: 28px 0 32px;
  padding: 20px;
  border: 1px solid #dfe5dc;
  border-radius: 12px;
  background: #fbfcfa;
}
.admin-history-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.admin-history-title h3 {
  margin: 0 0 5px;
}
.admin-history-title p,
.admin-history-loaded {
  margin: 0;
  color: #687469;
  font-size: 12px;
  line-height: 1.6;
}
.admin-history-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 14px 0;
  color: #647064;
  font-size: 12px;
}
.admin-history-count strong {
  color: #314a36;
  font-size: 24px;
}
.admin-history-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 170px) minmax(130px, 170px);
  gap: 10px;
  margin: 15px 0 10px;
}
.admin-history-filters > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-history-filters label {
  color: #435344;
  font-size: 12px;
  font-weight: 700;
}
.admin-history-filters input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #d5ddd3;
  border-radius: 8px;
  background: #fff;
  color: #27352b;
  font: 13px var(--sans);
}
.admin-history-filters input:focus {
  outline: 3px solid rgba(119, 132, 95, .15);
  border-color: #899775;
}
.admin-history-loaded {
  margin: 10px 0 12px;
}
.admin-consultation-item {
  padding: 15px 0;
  border-top: 1px solid #e4e9e2;
}
.admin-consultation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  margin-bottom: 8px;
  color: #788478;
  font-size: 11px;
}
.admin-consultation-question {
  margin: 0 0 10px;
  color: #29382d;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.admin-consultation-answer {
  padding: 10px 12px;
  border: 1px solid #e1e7df;
  border-radius: 8px;
  background: #fff;
}
.admin-consultation-answer summary {
  color: #526b55;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.admin-consultation-answer p {
  margin: 12px 0 2px;
  color: #3f4b41;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.history-empty-state {
  margin: 12px 0;
  color: #738071;
  font-size: 13px;
}
html[data-theme="dark"] .admin-history-section {
  border-color: #3b4b42;
  background: #24312c;
}
html[data-theme="dark"] .admin-history-title p,
html[data-theme="dark"] .admin-history-loaded,
html[data-theme="dark"] .admin-history-count,
html[data-theme="dark"] .admin-consultation-meta,
html[data-theme="dark"] .history-empty-state {
  color: #aebbb2;
}
html[data-theme="dark"] .admin-history-count strong,
html[data-theme="dark"] .admin-consultation-question {
  color: #e2e9e4;
}
html[data-theme="dark"] .admin-history-filters label {
  color: #d1ddd4;
}
html[data-theme="dark"] .admin-history-filters input,
html[data-theme="dark"] .admin-consultation-answer {
  border-color: #43544a;
  background: #293831;
  color: #e2e9e4;
}
html[data-theme="dark"] .admin-consultation-answer summary {
  color: #bfd0c2;
}
html[data-theme="dark"] .admin-consultation-answer p {
  color: #d4dfd7;
}
@media (max-width: 700px) {
  .admin-history-section { padding: 15px; }
  .admin-history-title { align-items: flex-start; }
  .admin-history-filters { grid-template-columns: 1fr 1fr; }
  .admin-history-search { grid-column: 1 / -1; }
}


/* Tela inicial de identificação do secretário */
.identity-gate[hidden] { display: none !important; }
.identity-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(28, 39, 32, .72);
  backdrop-filter: blur(7px);
}
.identity-card {
  width: min(100%, 440px);
  padding: 32px;
  border: 1px solid #dce5dc;
  border-radius: 18px;
  background: #f8faf7;
  box-shadow: 0 22px 70px rgba(0,0,0,.20);
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.identity-crest { width: 58px; height: 58px; object-fit: contain; align-self: center; margin-bottom: 2px; }
.identity-eyebrow { margin: 0; text-align: center; color: #718477; font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.identity-card h1 { margin: 0 0 2px; text-align: center; color: #29382f; font-size: 23px; }
.identity-description { margin: 0 0 10px; text-align: center; color: #68766c; font-size: 13px; line-height: 1.6; }
.identity-card label { color: #405247; font-size: 12px; font-weight: 700; }
.identity-card input { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid #d2ddd3; border-radius: 9px; background: #fff; color: #26362c; font: 14px var(--sans); }
.identity-card input:focus { outline: 3px solid rgba(119, 145, 125, .16); border-color: #829b89; }
.identity-privacy { margin: 5px 0; color: #78857b; font-size: 11px; line-height: 1.55; }
.identity-card button { min-height: 46px; margin-top: 3px; border: 0; border-radius: 9px; background: #526f5b; color: #fff; font: 700 13px var(--sans); cursor: pointer; }
.identity-card button:hover { background: #435f4c; }
body.identity-required { overflow: hidden; }
html[data-theme="dark"] .identity-card { background: #26332d; border-color: #46564b; }
html[data-theme="dark"] .identity-card h1 { color: #e2e9e4; }
html[data-theme="dark"] .identity-description,
html[data-theme="dark"] .identity-privacy { color: #aebbb2; }
html[data-theme="dark"] .identity-card label { color: #d3ded5; }
html[data-theme="dark"] .identity-card input { background: #202b25; border-color: #46564b; color: #e2e9e4; }
@media (max-width: 480px) { .identity-card { padding: 25px 21px; } }


/* Painel administrativo organizado por atalhos */
.admin-menu-intro{margin:0 0 16px;color:#647064;font-size:14px}
.admin-action-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.admin-action-card{display:flex;flex-direction:column;align-items:flex-start;gap:8px;min-height:132px;padding:20px;text-align:left;border:1px solid #dce4d9;border-radius:12px;background:#f8faf7;color:#26352a;cursor:pointer;transition:border-color .18s,background .18s,transform .18s}
.admin-action-card:hover{border-color:#879b83;background:#f1f5ef;transform:translateY(-1px)}
.admin-action-card:focus-visible,.admin-back-button:focus-visible{outline:3px solid rgba(75,105,76,.24);outline-offset:2px}
.admin-action-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:9px;background:#e8eee6;color:#486448;font-size:20px}
.admin-action-card strong{font-size:15px;color:#26352a}
.admin-action-card small{font-size:12px;line-height:1.45;color:#69756a}
.admin-view-panel{min-width:0}
.admin-back-button{display:inline-flex;align-items:center;gap:7px;margin:0 0 18px;padding:9px 12px;border:1px solid #dce4d9;border-radius:8px;background:#fff;color:#486448;font:600 13px var(--sans);cursor:pointer}
.admin-view-panel .document-form{margin-bottom:0}
.admin-view-panel>.admin-documents{padding:0 0 8px}
.admin-view-panel>.admin-documents.admin-notices-manager{padding:18px;background:#f8faf7;border:1px solid #e1e7de;border-radius:10px}
@media(max-width:600px){.admin-action-grid{grid-template-columns:1fr}.admin-action-card{min-height:112px;padding:16px}.admin-view-panel>.admin-documents.admin-notices-manager{padding:13px}}


/* Correção completa do tema escuro no painel administrativo */
html[data-theme="dark"] .admin-modal {
  background: #202925 !important;
  border-color: #35423a !important;
  color: #e2e9e4 !important;
}
html[data-theme="dark"] .admin-dashboard-top,
html[data-theme="dark"] .admin-document-item,
html[data-theme="dark"] .admin-history-title {
  border-color: #35423a !important;
}
html[data-theme="dark"] .admin-dashboard-top p,
html[data-theme="dark"] .admin-modal h2,
html[data-theme="dark"] .admin-modal h3,
html[data-theme="dark"] .admin-view-panel h3,
html[data-theme="dark"] .admin-action-card strong,
html[data-theme="dark"] .admin-document-details strong,
html[data-theme="dark"] .admin-history-title h3,
html[data-theme="dark"] .admin-consultation-question {
  color: #e2e9e4 !important;
}
html[data-theme="dark"] .admin-menu-intro,
html[data-theme="dark"] .admin-history-title p,
html[data-theme="dark"] .admin-history-loaded,
html[data-theme="dark"] .admin-document-details span,
html[data-theme="dark"] .admin-consultation-meta {
  color: #aebbb2 !important;
}
html[data-theme="dark"] .admin-action-card,
html[data-theme="dark"] .admin-view-panel > .admin-documents.admin-notices-manager,
html[data-theme="dark"] .admin-view-panel .document-form,
html[data-theme="dark"] .admin-history-section,
html[data-theme="dark"] .admin-consultation-answer,
html[data-theme="dark"] .admin-feedback {
  background: #252f2a !important;
  border-color: #35423a !important;
  color: #e2e9e4 !important;
}
html[data-theme="dark"] .admin-action-card:hover {
  background: #2d3a32 !important;
  border-color: #657b68 !important;
}
html[data-theme="dark"] .admin-action-icon {
  background: #34443a !important;
  color: #c5d4c4 !important;
}
html[data-theme="dark"] .admin-action-card small {
  color: #aebbb2 !important;
}
html[data-theme="dark"] .admin-back-button,
html[data-theme="dark"] .admin-secondary,
html[data-theme="dark"] .admin-delete,
html[data-theme="dark"] .modal-close {
  background: #29352e !important;
  border-color: #46564b !important;
  color: #e2e9e4 !important;
}
html[data-theme="dark"] .admin-back-button:hover,
html[data-theme="dark"] .admin-secondary:hover,
html[data-theme="dark"] .modal-close:hover {
  background: #35443a !important;
}
html[data-theme="dark"] .admin-form input,
html[data-theme="dark"] .document-form input,
html[data-theme="dark"] .document-form select,
html[data-theme="dark"] .document-form textarea,
html[data-theme="dark"] .admin-document-controls select,
html[data-theme="dark"] .admin-history-filters input {
  background: #1c2520 !important;
  border-color: #46564b !important;
  color: #e2e9e4 !important;
  color-scheme: dark;
}
html[data-theme="dark"] .admin-form input::placeholder,
html[data-theme="dark"] .document-form input::placeholder,
html[data-theme="dark"] .document-form textarea::placeholder,
html[data-theme="dark"] .admin-history-filters input::placeholder {
  color: #91a095 !important;
}
html[data-theme="dark"] .admin-form label,
html[data-theme="dark"] .document-form label,
html[data-theme="dark"] .admin-history-filters label {
  color: #d2ddd3 !important;
}
html[data-theme="dark"] .document-form h3,
html[data-theme="dark"] .admin-documents h3 {
  color: #e2e9e4 !important;
}
html[data-theme="dark"] .admin-history-count {
  background: #29352e !important;
  border-color: #35423a !important;
  color: #c4d0c6 !important;
}
html[data-theme="dark"] .admin-consultation-answer summary,
html[data-theme="dark"] .admin-consultation-answer p {
  color: #d2ddd3 !important;
}
html[data-theme="dark"] .admin-feedback[data-type="error"] {
  background: #422b29 !important;
  color: #f0c1ba !important;
}
html[data-theme="dark"] .admin-feedback[data-type="success"] {
  background: #293d30 !important;
  color: #c7dfc7 !important;
}
html[data-theme="dark"] .admin-notices-manager #adminNoticeList > *,
html[data-theme="dark"] #adminNoticeList .admin-notice-item,
html[data-theme="dark"] #adminNoticeList .notice-item {
  background: #29352e !important;
  border-color: #46564b !important;
  color: #e2e9e4 !important;
}
html[data-theme="dark"] #adminNoticeList strong,
html[data-theme="dark"] #adminNoticeList p,
html[data-theme="dark"] #adminNoticeList span {
  color: #d2ddd3;
}
@media (max-width: 600px) {
  html[data-theme="dark"] .admin-action-card { background: #252f2a !important; }
}

/* Identificação do responsável nos avisos */
.public-notice-author {
  display: block;
  margin: 6px 0 8px;
  color: #687568;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
}
html[data-theme="dark"] .public-notice-author {
  color: #b7c7b7 !important;
}

/* Abas para separar consultas à IA de mensagens filtradas */
.admin-history-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0 12px}
.admin-history-tab{min-height:38px;padding:8px 13px;border:1px solid #d8e1d6;border-radius:8px;background:#f6f8f5;color:#526354;font:600 12px var(--sans);cursor:pointer}
.admin-history-tab:hover{background:#edf2eb}
.admin-history-tab.active{border-color:#718a73;background:#e7eee5;color:#314a36}
html[data-theme="dark"] .admin-history-tab{border-color:#46564b;background:#29352e;color:#c4d0c6}
html[data-theme="dark"] .admin-history-tab.active{border-color:#829987;background:#35483b;color:#e2e9e4}
@media(max-width:520px){.admin-history-tabs{display:grid;grid-template-columns:1fr}}
