/* ── busca.css — Busca Greco-Latina ─────────────────────────────────────── */

:root {
  --busca-bg:      #f8f7f4;
  --busca-border:  #d6cfc4;
  --busca-panel:   #ffffff;
  --busca-accent:  #5c3a1e;
  --busca-hl:      #ffe08a;
  --busca-match:   #fff3cd;
  --tab-h:         38px;
  --panel-radius:  6px;
}

.busca-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  overflow: hidden;
  padding: 0;
}

/* ── tabs ────────────────────────────────────────────────────────────────── */

.busca-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 12px 0;
  background: var(--busca-bg);
  border-bottom: 2px solid var(--busca-border);
  flex-shrink: 0;
}

.btab {
  height: var(--tab-h);
  padding: 0 16px;
  border: 1px solid var(--busca-border);
  border-bottom: none;
  border-radius: 5px 5px 0 0;
  background: #ede9e3;
  color: #5a4a38;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btab:hover   { background: #ddd8cf; }
.btab.active  { background: var(--busca-panel); color: var(--busca-accent); font-weight: 600; }

.btab-content { display: none; flex: 1; overflow: hidden; }
.btab-content.active { display: flex; flex-direction: column; overflow: hidden; }

/* ── search bar ──────────────────────────────────────────────────────────── */

.busca-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  background: #faf9f7;
  border-bottom: 1px solid var(--busca-border);
  flex-shrink: 0;
}
.busca-bar input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #c4b9aa;
  border-radius: 4px;
  font-size: 0.93rem;
  font-family: 'Source Serif 4', serif;
}
.busca-bar button,
.busca-bar select {
  height: 32px;
  padding: 0 12px;
  border: 1px solid #c4b9aa;
  border-radius: 4px;
  font-size: 0.85rem;
  background: #f0ece5;
  cursor: pointer;
}
.busca-bar button:hover { background: #e4ded4; }
.busca-bar button:disabled { opacity: 0.45; cursor: default; }

/* ── search options ──────────────────────────────────────────────────────── */

.busca-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  padding: 5px 10px;
  font-size: 0.83rem;
  background: #faf9f7;
  border-bottom: 1px solid var(--busca-border);
  flex-shrink: 0;
}
.busca-opts label { display: flex; align-items: center; gap: 4px; }
.busca-opts .sep  { width: 1px; height: 18px; background: var(--busca-border); margin: 0 4px; }
.corpus-grp       { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── two-panel split ─────────────────────────────────────────────────────── */

.busca-split {
  display: flex;
  gap: 0;
  flex: 1;
  overflow: hidden;
  border-top: none;
}

.obras-panel {
  width: 240px;
  min-width: 160px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--busca-border);
  background: #faf8f5;
  overflow: hidden;
}
.obras-panel .panel-title {
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #7a6550;
  border-bottom: 1px solid var(--busca-border);
  flex-shrink: 0;
}
#works-list {
  list-style: none;
  margin: 0; padding: 0;
  overflow-y: auto;
  flex: 1;
}
#works-list li {
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  border-bottom: 1px solid #edeae4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #4a3a2a;
}
#works-list li:hover  { background: #eee8df; }
#works-list li.active { background: var(--busca-accent); color: #fff; }
#works-list li.loading { color: #999; font-style: italic; }

.results-panel {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-family: 'Source Serif 4', monospace;
  background: var(--busca-panel);
}

.result-block  { margin-bottom: 12px; }
.result-header { font-size: 0.75rem; font-weight: 600; color: #7a6550; margin-bottom: 3px; }
.result-line   { white-space: pre-wrap; line-height: 1.55; color: #3a2a1a; padding: 1px 0; }
.match-line    { background: var(--busca-match); border-left: 3px solid #c8a000; padding-left: 5px; }
.result-sep    { color: #ccc; margin: 4px 0; }
.hl            { background: var(--busca-hl); border-radius: 2px; font-weight: 700; }

/* ── translation panel ───────────────────────────────────────────────────── */

.trans-panel {
  flex-shrink: 0;
  border-top: 2px solid var(--busca-border);
  background: #faf8f5;
}
.trans-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  align-items: center;
  padding: 6px 10px;
  font-size: 0.82rem;
}
.trans-tools button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #c4b9aa;
  border-radius: 4px;
  font-size: 0.82rem;
  background: #f0ece5;
  cursor: pointer;
  white-space: nowrap;
}
.trans-tools button:hover    { background: #e4ded4; }
.trans-tools button:disabled { opacity: 0.45; cursor: default; }
.trans-tools label { display: flex; align-items: center; gap: 4px; }
.trans-tools select { height: 28px; padding: 0 6px; border: 1px solid #c4b9aa; border-radius: 4px; font-size: 0.82rem; }
.trans-tools .sep { width: 1px; height: 18px; background: var(--busca-border); }

.trans-output {
  min-height: 60px;
  max-height: 180px;
  overflow-y: auto;
  padding: 6px 10px;
  font-size: 0.85rem;
  white-space: pre-wrap;
  border-top: 1px solid var(--busca-border);
  color: #2a1a0a;
  background: #fffdf8;
}

/* ── Online Texts (Perseus / Sefaria) ────────────────────────────────────── */

.perc-split {
  display: flex;
  flex: 1;
  overflow: hidden;
  gap: 0;
}

.perc-left {
  width: 260px;
  min-width: 180px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--busca-border);
  background: #faf8f5;
  overflow: hidden;
  padding: 6px 0 0;
}
.perc-lang-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 4px 8px 6px;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--busca-border);
  flex-shrink: 0;
}
.perc-lang-row label { display: flex; align-items: center; gap: 4px; }
.perc-lang-row select { height: 28px; padding: 0 6px; font-size: 0.82rem; border: 1px solid #c4b9aa; border-radius: 4px; }
.perc-lang-row button { height: 28px; padding: 0 8px; border: 1px solid #c4b9aa; border-radius: 4px; background: #f0ece5; cursor: pointer; }

#perc-filter {
  margin: 6px 8px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #c4b9aa;
  border-radius: 4px;
  font-size: 0.83rem;
  flex-shrink: 0;
}

.perc-works-list {
  list-style: none;
  margin: 0; padding: 0;
  overflow-y: auto;
  flex: 1;
}
.perc-works-list li {
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  border-bottom: 1px solid #edeae4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #4a3a2a;
}
.perc-works-list li:hover  { background: #eee8df; }
.perc-works-list li.active { background: var(--busca-accent); color: #fff; }
.perc-works-list li.loading { color: #999; font-style: italic; }

.perc-status {
  padding: 4px 8px;
  font-size: 0.78rem;
  color: #7a6550;
  flex-shrink: 0;
  border-top: 1px solid var(--busca-border);
  min-height: 24px;
}

.perc-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--busca-panel);
}

.perc-obra-sel {
  padding: 6px 10px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--busca-border);
  background: #faf8f5;
  flex-shrink: 0;
  color: #3a2a1a;
}

.perc-ref-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--busca-border);
  flex-shrink: 0;
  background: #faf8f5;
}
.perc-ref-row select { height: 28px; padding: 0 6px; font-size: 0.82rem; border: 1px solid #c4b9aa; border-radius: 4px; }

.perc-texto {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px;
  font-family: 'GFS Didot', 'Source Serif 4', serif;
  font-size: 1.05rem;
  line-height: 1.7;
  white-space: pre-wrap;
  color: #1a0a00;
}
.perc-texto[data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: #bbb;
  font-style: italic;
  font-size: 0.88rem;
  font-family: 'Source Serif 4', serif;
}
.perc-texto.rtl { direction: rtl; font-family: 'Noto Serif Hebrew', serif; }

.perc-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border-top: 1px solid var(--busca-border);
  background: #faf8f5;
  flex-shrink: 0;
}
.perc-btn-row button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #c4b9aa;
  border-radius: 4px;
  font-size: 0.82rem;
  background: #f0ece5;
  cursor: pointer;
  white-space: nowrap;
}
.perc-btn-row button:hover    { background: #e4ded4; }
.perc-btn-row button:disabled { opacity: 0.45; cursor: default; }
.perc-btn-row .perc-status    { padding: 0 4px; border: none; }

.perc-pron-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 4px 8px 6px;
  background: #f5f2ed;
  border-top: 1px dashed var(--busca-border);
  font-size: 0.82rem;
}
.perc-pron-row select {
  height: 26px;
  font-size: 0.82rem;
  border: 1px solid #c4b9aa;
  border-radius: 4px;
  padding: 0 4px;
  background: #fff;
}
.perc-pron-row button {
  height: 26px;
  padding: 0 8px;
  border: 1px solid #c4b9aa;
  border-radius: 4px;
  font-size: 0.82rem;
  background: #f0ece5;
  cursor: pointer;
}
.perc-pron-row label { display: flex; align-items: center; gap: 4px; }

/* ── Linha de controlo de tradução ──────────────────────────────────────────── */
.trans-ctrl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 5px 8px;
  background: #f0ece5;
  border-top: 1px solid var(--busca-border);
  flex-shrink: 0;
}
.trans-ctrl-row select {
  height: 28px;
  font-size: 0.82rem;
  border: 1px solid #c4b9aa;
  border-radius: 4px;
  padding: 0 6px;
  background: #fff;
  max-width: 220px;
}
.trans-ctrl-row button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #c4b9aa;
  border-radius: 4px;
  font-size: 0.82rem;
  background: #e8e2d8;
  cursor: pointer;
  white-space: nowrap;
}
.trans-ctrl-row button:hover    { background: #ddd7cc; }
.trans-ctrl-row button:disabled { opacity: 0.45; cursor: default; }
#btn-perc-traduzir { font-weight: 600; background: #d8e8d4; border-color: #aac4a5; }
#btn-perc-traduzir:hover    { background: #c8dcc4; }
#btn-perc-traduzir:disabled { background: #e8e2d8; border-color: #c4b9aa; }
#btn-parar-trad { background: #f4dada; border-color: #d4a0a0; color: #8a1a1a; font-weight: 600; }
#btn-parar-trad:hover:not(:disabled) { background: #ecc8c8; }
#btn-parar-trad:disabled { background: #e8e2d8; border-color: #c4b9aa; color: inherit; }
#btn-trans-key { padding: 0 8px; font-size: 1rem; }

/* ── interlinear output ─────────────────────────────────────────────────────── */
.interlinear-out {
  padding: 8px 10px;
  font-size: 0.83rem;
  border-top: 1px solid var(--busca-border);
  background: #fffdf8;
  flex-shrink: 0;
  max-height: 220px;
  overflow-y: auto;
}
.interlinear-table { border-collapse: collapse; width: 100%; }
.interlinear-table td {
  padding: 3px 8px 3px 0;
  vertical-align: top;
  border-bottom: 1px dotted #e0d8cc;
}
.interlinear-table td:first-child { font-weight: 600; color: #4a3000; min-width: 120px; }
.interlinear-table td:last-child  { color: #3a3030; }

/* ── dialog-note ─────────────────────────────────────────────────────────────── */
.dialog-note { font-size: 0.78rem !important; color: #888 !important; margin-top: -4px !important; }

.perc-trans-output {
  max-height: 160px;
  overflow-y: auto;
  padding: 6px 10px;
  font-size: 0.85rem;
  white-space: pre-wrap;
  border-top: 1px solid var(--busca-border);
  color: #2a1a0a;
  background: #fffdf8;
  flex-shrink: 0;
}

.perc-footer {
  padding: 4px 10px;
  font-size: 0.75rem;
  color: #999;
  border-top: 1px solid var(--busca-border);
  background: #faf8f5;
  flex-shrink: 0;
}

/* ── CDLI ────────────────────────────────────────────────────────────────── */

.cdli-header {
  padding: 10px 14px 6px;
  border-bottom: 1px solid var(--busca-border);
  flex-shrink: 0;
  background: #faf8f5;
}
.cdli-title {
  font-size: 1.0rem;
  font-weight: 600;
  color: var(--busca-accent);
  margin: 0 0 2px;
}
.cdli-sub {
  font-size: 0.82rem;
  color: #7a6550;
  margin: 0;
}

.cdli-split {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.cdli-list-panel {
  width: 260px;
  min-width: 180px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--busca-border);
  background: #faf8f5;
  overflow: hidden;
}
.cdli-list-panel .panel-title {
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #7a6550;
  border-bottom: 1px solid var(--busca-border);
  flex-shrink: 0;
}
#cdli-list {
  list-style: none;
  margin: 0; padding: 0;
  overflow-y: auto;
  flex: 1;
}
#cdli-list li {
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  border-bottom: 1px solid #edeae4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #4a3a2a;
}
#cdli-list li:hover  { background: #eee8df; }
#cdli-list li.active { background: var(--busca-accent); color: #fff; }
#cdli-list li.loading { color: #999; font-style: italic; }

.cdli-detail-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--busca-panel);
  padding: 0;
}

.cdli-detalhe-titulo {
  padding: 8px 12px 4px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--busca-accent);
  border-bottom: 1px solid var(--busca-border);
  background: #faf8f5;
  flex-shrink: 0;
}

.cdli-detalhe-meta {
  padding: 4px 12px;
  font-size: 0.78rem;
  color: #7a6550;
  border-bottom: 1px solid var(--busca-border);
  background: #faf8f5;
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 12px;
}
.cdli-detalhe-meta span { white-space: nowrap; }

.cdli-atf {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  font-family: monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  color: #1a0a00;
  margin: 0;
  background: #fffdf8;
  word-break: break-all;
}

/* ── Recursos (museus e bases de dados) ───────────────────────────────────── */

.recursos-grid {
  flex: 1;
  overflow-y: auto;
  padding: 10px 20px 20px;
}

.recursos-secao {
  margin-bottom: 24px;
}
.recursos-secao h2 {
  font-size: 1.0rem;
  font-weight: 700;
  color: var(--busca-accent);
  border-bottom: 2px solid var(--busca-border);
  padding-bottom: 4px;
  margin: 10px 0 6px;
}
.recursos-secao h3 {
  font-size: 0.87rem;
  font-weight: 600;
  color: #5a4030;
  margin: 10px 0 4px;
}
.recursos-lista {
  list-style: disc;
  padding-left: 22px;
  margin: 0 0 6px;
}
.recursos-lista li {
  font-size: 0.84rem;
  line-height: 1.6;
  color: #3a2a1a;
  margin-bottom: 2px;
}
.recursos-lista a { color: var(--busca-accent); }
.recursos-lista a:hover { text-decoration: underline; }

/* ── status bar ──────────────────────────────────────────────────────────── */

.busca-statusbar {
  height: 24px;
  line-height: 24px;
  padding: 0 10px;
  font-size: 0.78rem;
  color: #7a6550;
  background: #ede9e3;
  border-top: 1px solid var(--busca-border);
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.busca-warn {
  padding: 8px 12px;
  font-size: 0.85rem;
  color: #8b4513;
  background: #fff3cd;
  border: 1px solid #f0c040;
  border-radius: 4px;
  margin: 8px;
}

/* ── dialogs ─────────────────────────────────────────────────────────────── */

.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dialog-box {
  background: #fff;
  border-radius: 8px;
  padding: 20px 24px;
  min-width: 300px;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.dialog-box h3 { margin: 0 0 8px; font-size: 1rem; }
.dialog-box p  { margin: 0 0 10px; font-size: 0.85rem; color: #666; }
.dialog-box input { height: 32px; padding: 0 8px; font-size: 0.9rem; box-sizing: border-box; border: 1px solid #c4b9aa; border-radius: 4px; }
.dialog-btns {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}
.dialog-btns button {
  height: 32px;
  padding: 0 16px;
  border: 1px solid #c4b9aa;
  border-radius: 4px;
  font-size: 0.85rem;
  background: #f0ece5;
  cursor: pointer;
}
.dialog-btns button:hover { background: #e4ded4; }

/* ── CDLI obras notáveis ──────────────────────────────────────────────────── */
.cdli-obras-bar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 10px;
  background: #faf8f5;
  border-bottom: 1px solid var(--busca-border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.cdli-obras-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #7a6550;
  white-space: nowrap;
  margin-top: 3px;
}
.cdli-obras-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
}
.cdli-obra-btn {
  height: 24px;
  padding: 0 10px;
  border: 1px solid #c0a888;
  border-radius: 12px;
  background: #ede5d8;
  color: #5a3a1a;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s;
}
.cdli-obra-btn:hover { background: #d4c4a8; }
.cdli-obra-btn.loading { opacity: 0.5; font-style: italic; }

/* ── btn-like (link styled as button) ────────────────────────────────────── */
.btn-like {
  display: inline-block;
  height: 28px;
  line-height: 28px;
  padding: 0 10px;
  border: 1px solid #c4b9aa;
  border-radius: 4px;
  font-size: 0.82rem;
  background: #f0ece5;
  color: #3a2a1a;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-like:hover { background: #e4ded4; }

/* ── Painel Morfológico ──────────────────────────────────────────────────── */

.btn-morph-toggle         { background: #e8e4f0 !important; color: #5a3a7a !important; }
.btn-morph-toggle.active  { background: #5a3a7a !important; color: #fff    !important; }

/* ── Painel de Histórico ─────────────────────────────────────────────────── */
.hist-panel {
  border-top: 2px solid #a0b4c8;
  background: #f5f8fc;
  flex-shrink: 0;
  max-height: 340px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #2a4a6a;
  color: #e8f0f8;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.hist-titulo { font-weight: 600; }
.hist-header-btns { display: flex; gap: 6px; align-items: center; }
.hist-export-btn {
  font-size: 0.78rem;
  color: #c8e0f8;
  text-decoration: none;
  padding: 2px 6px;
  border: 1px solid #5a80a8;
  border-radius: 3px;
}
.hist-export-btn:hover { background: #3a6a9a; }
.hist-close {
  background: none; border: none; color: #e8f0f8;
  cursor: pointer; font-size: 1rem; padding: 0 4px;
}
.hist-lista {
  overflow-y: auto;
  flex: 1;
  padding: 4px 6px;
}
.hist-vazio { color: #888; font-size: 0.85rem; padding: 8px; text-align: center; }
.hist-entrada {
  border: 1px solid #c8d8e8;
  border-radius: 5px;
  margin: 4px 0;
  background: #fff;
  font-size: 0.82rem;
  overflow: hidden;
}
.hist-entrada-topo {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  cursor: pointer;
  background: #eef3f8;
  border-bottom: 1px solid #d0dce8;
}
.hist-entrada-topo:hover { background: #dde8f4; }
.hist-meta  { font-size: 0.75rem; color: #607080; white-space: nowrap; }
.hist-obra  { font-weight: 600; color: #2a3a5a; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-motor-badge {
  font-size: 0.7rem; padding: 1px 5px;
  border-radius: 3px; background: #d0e4f4; color: #2a4a6a;
  white-space: nowrap;
}
.hist-apagar {
  background: none; border: none; cursor: pointer;
  color: #c04040; font-size: 0.9rem; padding: 0 2px;
  flex-shrink: 0;
}
.hist-apagar:hover { color: #900; }
.hist-entrada-corpo { display: none; padding: 6px 10px; }
.hist-entrada.aberto .hist-entrada-corpo { display: block; }
.hist-original {
  color: #4a3010; font-style: italic;
  border-left: 3px solid #c8a870;
  padding-left: 8px; margin-bottom: 6px;
  white-space: pre-wrap; max-height: 80px; overflow-y: auto;
}
.hist-traducao {
  color: #1a3a1a;
  border-left: 3px solid #80b080;
  padding-left: 8px;
  white-space: pre-wrap; max-height: 100px; overflow-y: auto;
}
.hist-paginacao {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 5px; border-top: 1px solid #c8d8e8;
  font-size: 0.82rem; flex-shrink: 0;
}
.hist-paginacao button {
  border: 1px solid #a0b8cc; border-radius: 3px;
  background: #e8f0f8; padding: 2px 8px; cursor: pointer;
}
.hist-paginacao button:disabled { opacity: 0.4; cursor: default; }

/* btn-hist-toggle shares btn-morph-toggle base style */
#btn-perc-hist { background: #d4e8f4; border-color: #7aaac4; }
#btn-perc-hist.active { background: #2a4a6a !important; color: #fff !important; }

.morph-panel {
  border-top: 2px solid #c8c0d8;
  background: #fdfcff;
  padding: 10px 12px;
  flex-shrink: 0;
  max-height: 340px;
  overflow-y: auto;
}

.morph-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.morph-titulo {
  font-size: 0.82rem;
  font-weight: 600;
  color: #5a3a7a;
}
.morph-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: #aaa;
  padding: 0 4px;
  line-height: 1;
}
.morph-close:hover { color: #555; }

.morph-search-row {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.morph-search-row input {
  flex: 1;
  min-width: 120px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #c4b9d8;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: 'Source Serif 4', serif;
}
.morph-search-row select,
.morph-search-row button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #c4b9d8;
  border-radius: 4px;
  font-size: 0.82rem;
  background: #f0eaf8;
  cursor: pointer;
  white-space: nowrap;
}
.morph-search-row button:hover { background: #e4d8f0; }

/* resultados */
.morph-resultado { font-size: 0.83rem; line-height: 1.5; }
.morph-loading   { color: #7a6a9a; font-style: italic; }
.morph-hint      { color: #aaa;    font-style: italic; }
.morph-erro      { color: #c0392b; }
.morph-vazio     { color: #888; }

.morph-palavra-titulo {
  font-size: 1.05rem;
  font-weight: 700;
  color: #4a2a6a;
  font-family: 'Source Serif 4', serif;
  margin-bottom: 8px;
}

.morph-entrada {
  border: 1px solid #e0d8ec;
  border-radius: 5px;
  padding: 8px 10px;
  margin-bottom: 7px;
  background: #fff;
}

.morph-lemma { margin-bottom: 5px; }
.morph-lemma-form {
  font-size: 0.98rem;
  font-weight: 600;
  font-family: 'Source Serif 4', serif;
  color: #2a1a4a;
}
.morph-pofs-badge {
  font-size: 0.73rem;
  background: #ede8f8;
  color: #5a3a7a;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 5px;
}

.morph-formas { display: flex; flex-direction: column; gap: 4px; }
.morph-forma-linha {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.morph-forma-word {
  font-family: 'Source Serif 4', serif;
  font-size: 0.88rem;
  min-width: 55px;
  color: #2a1a4a;
}

/* tags por categoria gramatical */
.morph-tag {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  cursor: default;
}
.morph-tag-pofs  { background: #ede8f8; color: #5a3a7a; }
.morph-tag-case  { background: #e4f0e8; color: #2a6a3a; }
.morph-tag-num   { background: #f0ece4; color: #6a5a2a; }
.morph-tag-gend  { background: #e4eef8; color: #2a4a7a; }
.morph-tag-tense { background: #f8e8e4; color: #7a2a2a; }
.morph-tag-mood  { background: #e8f8e4; color: #2a6a2a; }
.morph-tag-voice { background: #f8eee4; color: #7a4a2a; }
.morph-tag-pers  { background: #eae4f8; color: #4a2a7a; }
.morph-tag-decl  { background: #e4f8f8; color: #2a6a6a; }
.morph-tag-conj  { background: #f8e4f8; color: #6a2a6a; }

/* entrada de dicionário */
.morph-dict {
  margin-top: 8px;
  padding: 8px 10px;
  background: #f8f6ff;
  border-radius: 4px;
  border-left: 3px solid #8a6aaa;
  font-size: 0.8rem;
}
.morph-dict-name     { font-weight: 600; color: #5a3a7a; }
.morph-dict-headword { font-weight: 600; }
.morph-dict-entry    { color: #444; line-height: 1.6; }

