:root {
  --bg-page: #f5f7fb;
  --bg-surface: #ffffff;
  --bg-subtle: #edf2f8;
  --bg-accent: #eaf2ff;
  --bg-analogy: #fdf8eb;
  --border-analogy: #f59e0b;
  --text-main: #0e1f30;
  --text-secondary: #354b62;
  --text-muted: #5a7086;
  --border-color: #d5e0ec;
  --brand-navy: #0f2942;
  --brand-blue: #1d4ed8;
  --brand-teal: #0f766e;
  --brand-emerald: #047857;
  --brand-amber: #b45309;
  --brand-purple: #6d28d9;
  --brand-red: #b91c1c;
  --chip-bg: #e7f0ff;
  --chip-border: #93c5fd;
  --chip-text: #1e3a8a;
  --shadow-soft: 0 4px 18px rgba(14, 31, 48, 0.06);
  --shadow-pop: 0 14px 36px rgba(14, 31, 48, 0.18);
  --radius-lg: 14px;
  --radius-md: 10px;
}

[data-theme="dark"] {
  --bg-page: #0b1522;
  --bg-surface: #122033;
  --bg-subtle: #182a42;
  --bg-accent: #173052;
  --bg-analogy: #262114;
  --border-analogy: #d97706;
  --text-main: #e6eef7;
  --text-secondary: #c1d2e4;
  --text-muted: #8ea6bf;
  --border-color: #273e59;
  --brand-navy: #93c5fd;
  --brand-blue: #60a5fa;
  --brand-teal: #2dd4bf;
  --brand-emerald: #34d399;
  --brand-amber: #fbbf24;
  --brand-purple: #c4b5fd;
  --brand-red: #f87171;
  --chip-bg: #1a3354;
  --chip-border: #3b82f6;
  --chip-text: #bfdbfe;
  --shadow-soft: 0 4px 18px rgba(14, 31, 48, 0.36);
  --shadow-pop: 0 14px 36px rgba(14, 31, 48, 0.58);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.66;
  scroll-behavior: smooth;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 1.2rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
}

.brand-group { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, #0f2942, #1d4ed8);
  color: #ffffff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9rem; flex-shrink: 0;
}
.brand-title { font-weight: 700; font-size: 0.94rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-subtitle { font-size: 0.75rem; color: var(--text-muted); display: block; }
.topbar-actions { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }

.escalada-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.77rem; font-weight: 700; padding: 0.3rem 0.72rem;
  border-radius: 999px; background: var(--bg-accent); color: var(--brand-blue);
  border: 1px solid var(--border-color);
}
.escalada-bar-track {
  width: 64px; height: 7px; border-radius: 99px;
  background: var(--border-color); overflow: hidden;
}
.escalada-bar-fill {
  height: 100%; width: 0%; background: var(--brand-emerald);
  transition: width 0.25s ease;
}

.app-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  max-width: 1460px;
  margin: 0 auto;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 57px;
  height: calc(100vh - 57px);
  overflow-y: auto;
  padding: 0.95rem 0.85rem 2.2rem;
  border-right: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.nav-group-label {
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
  margin: 0.9rem 0 0.3rem 0.45rem;
}

.nav-link {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 0.36rem 0.55rem; margin-bottom: 0.12rem; border-radius: 7px;
  color: var(--text-secondary); text-decoration: none; font-size: 0.81rem;
  line-height: 1.3; border-left: 3px solid transparent;
}
.nav-link:hover { background: var(--bg-subtle); color: var(--text-main); }
.nav-link.active { background: var(--bg-accent); color: var(--brand-blue); font-weight: 700; border-left-color: var(--brand-blue); }
.nav-check { font-size: 0.75rem; color: var(--brand-emerald); font-weight: 800; flex-shrink: 0; }

.main-area { min-width: 0; padding: 1.6rem clamp(1rem, 2.8vw, 2.5rem) 6.5rem; }
.content-measure { max-width: 960px; margin: 0 auto; }

.chapter-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 2.4vw, 2rem);
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-soft);
  scroll-margin-top: 72px;
}

.chapter-header, .unit-header { border-bottom: 2px solid var(--border-color); padding-bottom: 1rem; margin-bottom: 1.2rem; }
.unit-top-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.45rem; }
.chapter-kicker { display: inline-block; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-blue); margin-bottom: 0.3rem; }

h1 { font-size: clamp(1.4rem, 2.3vw, 1.88rem); line-height: 1.25; margin: 0 0 0.7rem; }
h2 { font-size: 1.26rem; line-height: 1.32; margin: 0.25rem 0 0.55rem; }
h3 { font-size: 1.02rem; line-height: 1.35; margin: 0.75rem 0 0.4rem; }
p { margin: 0 0 0.85rem; }
.chapter-lead, .unit-one-line { font-size: 0.99rem; color: var(--text-secondary); margin: 0; }
.muted { color: var(--text-muted); font-size: 0.84rem; }

/* Stepper & Layers */
.layer-stepper { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.85rem; padding-top: 0.7rem; border-top: 1px dashed var(--border-color); }
.step-dot { font-size: 0.74rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px; background: var(--bg-subtle); color: var(--text-muted); border: 1px solid var(--border-color); }
.step-dot.active { background: var(--bg-accent); color: var(--brand-blue); border-color: var(--chip-border); }
.step-dot.done { background: rgba(4, 120, 87, 0.14); color: var(--brand-emerald); border-color: var(--brand-emerald); }
.step-arrow { color: var(--text-muted); font-size: 0.78rem; }

.layer-box { background: var(--bg-surface); border: 1px solid var(--border-color); border-left: 4px solid var(--brand-blue); border-radius: var(--radius-md); padding: 1rem 1.15rem; margin-bottom: 1rem; }
.layer-label-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.65rem; }
.layer-pill { display: inline-block; font-size: 0.73rem; font-weight: 800; padding: 0.18rem 0.58rem; border-radius: 999px; margin-right: 0.35rem; }
.pill-l1 { background: rgba(29, 78, 216, 0.13); color: var(--brand-blue); }
.pill-l2 { background: rgba(15, 118, 110, 0.14); color: var(--brand-teal); }
.pill-l3 { background: rgba(109, 40, 217, 0.13); color: var(--brand-purple); }
.pill-fin { background: rgba(4, 120, 87, 0.15); color: var(--brand-emerald); }

.analogy-box { background: var(--bg-analogy); border: 1px solid var(--border-color); border-left: 4px solid var(--border-analogy); border-radius: 9px; padding: 0.85rem 1rem; margin: 0.8rem 0; font-size: 0.95rem; }

.layer-acc, .ref-drawer { border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-subtle); margin: 0.95rem 0; overflow: hidden; }
.layer-summary, .ref-drawer summary { list-style: none; cursor: pointer; padding: 0.85rem 1.1rem; font-weight: 700; font-size: 0.94rem; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; background: var(--bg-subtle); }
.layer-summary::-webkit-details-marker, .ref-drawer summary::-webkit-details-marker { display: none; }
.layer-summary:hover { background: var(--bg-accent); }
.acc-chevron { font-size: 0.78rem; color: var(--brand-blue); font-weight: 700; white-space: nowrap; }
.layer-acc[open] > .layer-summary { border-bottom: 1px solid var(--border-color); background: var(--bg-surface); }
.layer-acc > .layer-content, .ref-drawer-body { padding: 1.05rem 1.15rem; background: var(--bg-surface); }
.sabatina-final-acc { border-color: var(--brand-emerald); }
.sabatina-final-summary { background: rgba(4, 120, 87, 0.08); }

/* JusTutor Confidence Calibration, Hypercorrection & Hint Ladder */
.sabatina-box { background: var(--bg-subtle); border: 1px solid var(--border-color); border-left: 4px solid var(--brand-amber); border-radius: var(--radius-md); padding: 1rem 1.15rem; margin: 1rem 0; }
.sabatina-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.65rem; }
.conf-group { display: inline-flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.conf-btn { padding: 0.2rem 0.55rem; border-radius: 999px; border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-secondary); font-size: 0.75rem; font-weight: 700; cursor: pointer; }
.conf-btn.active { background: var(--brand-blue); color: #ffffff; border-color: var(--brand-blue); }

.hyper-alert {
  margin-top: 0.55rem; padding: 0.7rem 0.9rem; border-radius: 8px;
  background: rgba(185, 28, 28, 0.11); border-left: 4px solid var(--brand-red);
  font-size: 0.87rem;
}

.hints-box {
  margin-top: 0.5rem; padding: 0.7rem 0.9rem; border-radius: 8px;
  background: var(--bg-analogy); border-left: 4px solid var(--brand-amber);
  font-size: 0.88rem; display: grid; gap: 0.35rem;
}

.open-practice-box { margin-top: 0.9rem; padding-top: 0.85rem; border-top: 1px dashed var(--border-color); display: flex; flex-direction: column; gap: 0.5rem; }
.open-label { font-size: 0.9rem; line-height: 1.45; display: block; }
.rubric-reveal { margin-top: 0.5rem; padding: 0.75rem 0.95rem; border-radius: 8px; background: var(--bg-surface); border-left: 4px solid var(--brand-emerald); font-size: 0.9rem; }
.haiku-feedback { margin-top: 0.5rem; padding: 0.85rem 1rem; border-radius: 8px; background: var(--bg-surface); border: 1px solid var(--chip-border); border-left: 4px solid var(--brand-purple); font-size: 0.9rem; white-space: pre-wrap; }
.jev-score-strip { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.55rem; padding-bottom: 0.45rem; border-bottom: 1px dashed var(--border-color); white-space: normal; }
.next-unit-bar { margin-top: 1.15rem; padding-top: 0.9rem; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; }

/* Siglas, Badges, Tables, Simulators */
.sigla-chip, .demo-pill { appearance: none; display: inline; padding: 0.03rem 0.34rem; margin: 0 0.03rem; border-radius: 5px; background: var(--chip-bg); border: 1px dashed var(--chip-border); color: var(--chip-text); font-family: inherit; font-size: 0.93em; font-weight: 600; cursor: pointer; }
.sigla-chip:hover, .sigla-chip:focus-visible { background: var(--brand-blue); color: #ffffff; border-style: solid; outline: none; }
.math-chip, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86em; padding: 0.1rem 0.42rem; border-radius: 5px; background: var(--bg-subtle); border: 1px solid var(--border-color); }

.badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 0.18rem 0.55rem; border-radius: 999px; }
.badge-navy { background: var(--bg-accent); color: var(--brand-blue); border: 1px solid var(--chip-border); }
.badge-teal { background: rgba(15, 118, 110, 0.14); color: var(--brand-teal); }
.badge-emerald { background: rgba(4, 120, 87, 0.14); color: var(--brand-emerald); }
.badge-amber { background: rgba(180, 83, 9, 0.15); color: var(--brand-amber); }
.badge-purple { background: rgba(109, 40, 217, 0.14); color: var(--brand-purple); }

.button-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.btn-primary, .btn-secondary, .btn-amber, .btn-haiku, .btn-ghost { padding: 0.48rem 0.85rem; border-radius: 8px; font-weight: 700; font-size: 0.82rem; cursor: pointer; border: 1px solid transparent; font-family: inherit; line-height: 1.3; }
.btn-primary { background: var(--brand-blue); color: #ffffff; }
.btn-secondary { background: var(--bg-surface); color: var(--text-main); border-color: var(--border-color); }
.btn-amber { background: var(--brand-amber); color: #ffffff; }
.btn-haiku { background: var(--brand-purple); color: #ffffff; }
.btn-ghost { background: transparent; color: var(--brand-blue); border-color: var(--border-color); padding: 0.28rem 0.6rem; font-size: 0.76rem; }

.exec-textarea, .exec-input { width: 100%; padding: 0.6rem 0.78rem; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-main); font-family: inherit; font-size: 0.91rem; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 0.85rem; margin: 1.1rem 0; }
.kpi-card, .info-card, .step-card, .sim-card, .dict-card { background: var(--bg-subtle); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 0.95rem 1.05rem; }
.kpi-label { display: block; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.kpi-value { display: block; font-size: 1.2rem; font-weight: 800; color: var(--brand-blue); margin: 0.18rem 0; }
.kpi-sub { display: block; font-size: 0.8rem; color: var(--text-secondary); line-height: 1.38; }
.two-col-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.95rem; margin: 0.85rem 0; }
.three-col-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 0.85rem; margin: 0.85rem 0; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.85rem; margin: 0.85rem 0; }
.step-num { display: inline-block; font-size: 0.72rem; font-weight: 800; padding: 0.14rem 0.5rem; border-radius: 999px; background: var(--brand-blue); color: #ffffff; margin-bottom: 0.3rem; }
.accent-blue { border-top: 4px solid var(--brand-blue); }
.accent-emerald { border-top: 4px solid var(--brand-emerald); }
.accent-amber { border-top: 4px solid var(--brand-amber); }
.accent-red { border-top: 4px solid var(--brand-red); }
.callout { border-radius: var(--radius-md); padding: 0.95rem 1.1rem; margin: 1rem 0; border: 1px solid var(--border-color); background: var(--bg-accent); }
.callout-emerald { border-left: 5px solid var(--brand-emerald); }
.callout-title { font-weight: 800; font-size: 0.94rem; margin-bottom: 0.35rem; }
.clean-list, .numbered-clean { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.clean-list li, .numbered-clean li { margin-bottom: 0.42rem; font-size: 0.93rem; }

.table-scroll-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border-color); border-radius: var(--radius-md); margin: 0.85rem 0 1.1rem; background: var(--bg-surface); }
.exec-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 600px; }
.exec-table th, .exec-table td { padding: 0.62rem 0.78rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border-color); }
.exec-table th { background: var(--bg-subtle); font-weight: 700; font-size: 0.79rem; text-transform: uppercase; color: var(--text-secondary); }
.exec-table .sticky-col { position: sticky; left: 0; background: var(--bg-surface); z-index: 2; border-right: 1px solid var(--border-color); }
.exec-table thead .sticky-col { background: var(--bg-subtle); z-index: 3; }

.svg-diagram-box { background: var(--bg-subtle); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 0.7rem; margin: 0.9rem 0; overflow-x: auto; }
.inline-svg { width: 100%; min-width: 620px; height: auto; display: block; color: var(--text-main); }

.quiz-opt { display: block; width: 100%; text-align: left; padding: 0.56rem 0.78rem; margin: 0.36rem 0; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-main); cursor: pointer; font-size: 0.89rem; font-family: inherit; }
.quiz-opt:hover { border-color: var(--brand-blue); }
.quiz-opt.correct { border-color: var(--brand-emerald); background: rgba(4, 120, 87, 0.14); font-weight: 700; }
.quiz-opt.wrong { border-color: var(--brand-red); background: rgba(185, 28, 28, 0.13); }
.quiz-exp { margin-top: 0.5rem; padding: 0.6rem 0.82rem; border-radius: 8px; background: var(--bg-surface); border-left: 4px solid var(--brand-blue); font-size: 0.87rem; }

.sim-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 1.05rem; }
.full-span { grid-column: 1 / -1; }
.three-sliders, .three-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.85rem; }
.slider-group { margin: 0.6rem 0; }
.slider-group label { display: block; font-size: 0.86rem; margin-bottom: 0.2rem; }
input[type="range"] { width: 100%; accent-color: var(--brand-blue); cursor: pointer; }
.sim-results { margin-top: 0.8rem; padding-top: 0.75rem; border-top: 1px solid var(--border-color); display: grid; gap: 0.5rem; }
.sim-metric { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 8px; padding: 0.55rem 0.75rem; display: flex; flex-direction: column; }
.sim-metric span { font-size: 0.75rem; color: var(--text-muted); }
.sim-metric strong { font-size: 0.96rem; }
.highlight-metric { border-left: 4px solid var(--brand-blue); }

.orange-widget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 0.5rem; margin: 0.8rem 0; }
.orange-btn { text-align: left; padding: 0.5rem 0.6rem; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-main); cursor: pointer; font-size: 0.8rem; }
.orange-btn.active, .orange-btn:hover { border-color: var(--brand-blue); background: var(--bg-accent); }
.orange-detail-box { background: var(--bg-surface); border: 1px solid var(--border-color); border-left: 4px solid var(--brand-teal); border-radius: 8px; padding: 0.9rem 1rem; }

.dict-controls { display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 0.7rem; }
.cat-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cat-btn { padding: 0.32rem 0.68rem; border-radius: 999px; border: 1px solid var(--border-color); background: var(--bg-subtle); color: var(--text-secondary); font-size: 0.79rem; font-weight: 600; cursor: pointer; }
.cat-btn.active { background: var(--brand-blue); color: #ffffff; border-color: var(--brand-blue); }
.dict-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.8rem; }
.dict-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-bottom: 0.2rem; }
.dict-term { font-weight: 800; font-size: 1rem; color: var(--brand-blue); }
.dict-full { font-size: 0.79rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 0.4rem; }
.dict-body { font-size: 0.86rem; margin-bottom: 0.35rem; }
.dict-case { font-size: 0.81rem; color: var(--text-muted); border-top: 1px dashed var(--border-color); padding-top: 0.3rem; }

.studio-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.7rem; padding: 0.75rem 1rem; background: var(--bg-subtle); border-radius: var(--radius-md); border: 1px solid var(--border-color); margin-bottom: 0.9rem; }
.flashcard-box { background: var(--bg-subtle); border: 2px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.3rem; min-height: 195px; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; margin: 0.7rem 0; }
.fc-meta { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }
.fc-front { font-size: 1.08rem; font-weight: 700; margin: 0.85rem 0; }
.fc-back { font-size: 0.95rem; color: var(--text-secondary); background: var(--bg-surface); border-left: 4px solid var(--brand-emerald); padding: 0.8rem 0.95rem; border-radius: 8px; margin: 0.5rem 0; }
.fc-hint { font-size: 0.77rem; color: var(--text-muted); }
.fc-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.sigla-popover { position: fixed; z-index: 200; width: min(370px, calc(100vw - 24px)); background: var(--bg-surface); border: 1px solid var(--brand-blue); border-radius: 12px; padding: 0.9rem 1rem; box-shadow: var(--shadow-pop); }
.modal-backdrop { position: fixed; inset: 0; z-index: 220; background: rgba(14, 31, 48, 0.58); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 1rem 1rem; }
.modal-panel { width: min(680px, 100%); max-height: 84vh; display: flex; flex-direction: column; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.15rem; box-shadow: var(--shadow-pop); }
.modal-results { overflow-y: auto; margin-top: 0.7rem; display: grid; gap: 0.55rem; }

/* ==================== AGENTE DE AUXÍLIO IN-APP (PADRÃO PRUMO / TUTOR) ==================== */
.prumo-dock {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  width: min(320px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  transition: width 0.18s ease, box-shadow 0.18s ease;
}

.prumo-dock.prumo-dock--expandido {
  width: min(480px, calc(100vw - 24px));
}

.prumo-dock.prumo-dock--recolhido .prumo-dock__body,
.prumo-dock.prumo-dock--recolhido .prumo-dock__fechar {
  display: none !important;
}

.prumo-dock__card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--brand-blue);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow-pop);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  gap: 8px;
  max-height: min(76vh, 620px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.prumo-dock__card::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.prumo-dock__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.prumo-dock__title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.prumo-dock__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand-emerald);
  flex-shrink: 0;
}

.prumo-dock__title {
  font-size: 0.84rem;
  line-height: 1.25;
  color: var(--text-main);
}

.prumo-dock__body,
.prumo-dock__resposta,
.prumo-dock__sugestoes,
.prumo-dock__sugestoes-lista {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  gap: 6px;
}

.prumo-dock__resposta {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 9px 11px;
}

.prumo-dock__eco {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--brand-blue);
  margin: 0;
}

.prumo-dock__resposta-texto {
  font-size: 0.86rem;
  line-height: 1.5;
  margin: 0;
  overflow: visible;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.prumo-dock__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.prumo-dock__sugestoes-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prumo-dock .chip {
  display: inline-block;
  text-align: left;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  font-family: inherit;
}

.prumo-dock .chip:hover {
  border-color: var(--brand-blue);
  background: var(--bg-accent);
  color: var(--brand-blue);
}

.prumo-dock__resposta-rodape {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px dashed var(--border-color);
}

.prumo-dock__acoes-voz { display: flex; gap: 6px; }
.prumo-dock__meta { font-size: 0.72rem; color: var(--text-muted); }

.prumo-dock__composer {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.prumo-dock__input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 0.83rem;
  font-family: inherit;
}

.prumo-dock__composer-actions { display: flex; gap: 4px; flex-shrink: 0; }
.btn--compacto { padding: 5px 9px; border-radius: 7px; font-size: 0.8rem; font-weight: 700; cursor: pointer; border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-main); }
.btn--primario { background: var(--brand-blue); color: #ffffff; border-color: var(--brand-blue); }

.hidden { display: none !important; }
.mobile-nav-btn { display: none; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 55px; width: min(300px, 86vw); z-index: 150; transform: translateX(-105%); transition: transform 0.2s ease; box-shadow: var(--shadow-pop); }
  .sidebar.open { transform: translateX(0); }
  .mobile-nav-btn { display: inline-block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .topbar, .sidebar, .prumo-dock, .sigla-popover, .modal-backdrop, .fc-controls, .studio-toolbar { display: none !important; }
  .app-shell { display: block; }
  details.layer-acc { display: block; }
}
