/* BioStudio AI — Word: tabbed Office ribbon + report authoring UI.
   The .office-rb-* block is app-neutral (driven by --office-rb-accent) so any
   Office-like app can adopt it; everything under .word-app is document-specific. */

/* ==========================================================================
   Shared ribbon
   ========================================================================== */

.office-rb {
  --office-rb-accent: #1b5bb0;
  --office-rb-accent-dark: #164a90;
  --office-rb-hover: #eaf0f9;
  --office-rb-hover-border: #c6d6ec;
  flex: 0 0 auto;
  color: #242832;
  background: #fff;
  border-bottom: 1px solid #cfd3db;
  box-shadow: 0 2px 5px rgba(25, 32, 45, 0.07);
  z-index: 3;
}

.office-rb-tabs {
  display: flex;
  align-items: center;
  height: 29px;
  min-height: 29px;
  padding: 0 10px;
  border-bottom: 1px solid #e4e6ea;
}

.office-rb-quick {
  display: flex;
  gap: 2px;
  margin-right: 8px;
  padding-right: 8px;
  border-right: 1px solid #e0e2e7;
}
.office-rb-quick-btn {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #555c68;
  font-size: 14px;
  cursor: pointer;
}
.office-rb-quick-btn:hover:not(:disabled) { background: #eceef2; color: #20242d; }
.office-rb-quick-btn:disabled { opacity: 0.32; cursor: default; }

.office-rb-tabset {
  display: flex;
  align-self: stretch;
  align-items: stretch;
  gap: 2px;
}
.office-rb-tab {
  position: relative;
  height: 28px;
  padding: 4px 11px 3px;
  border: 0;
  border-radius: 0;
  color: #565c68;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}
.office-rb-tab:hover { background: #f3f3f5; color: #20242d; }
.office-rb-tab.active { color: var(--office-rb-accent-dark); }
.office-rb-tab.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--office-rb-accent);
}
.office-rb-tab.contextual {
  color: #8a4b13;
  background: #fdf3e6;
  border-radius: 4px 4px 0 0;
}
.office-rb-tab.contextual.active { color: #8a4b13; }
.office-rb-tab.contextual.active::after { background: #c9761f; }

.office-rb-context {
  min-width: 0;
  margin-left: auto;
  padding-left: 18px;
  color: #3d424c;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.office-rb-context-label {
  margin-right: 7px;
  color: #9297a2;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.office-rb-body {
  display: flex;
  align-items: stretch;
  gap: 2px;
  min-height: 66px;
  padding: 4px 8px 2px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #fff;
  scrollbar-width: thin;
}
.office-rb-group {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2px;
  min-width: 90px;
  padding: 0 8px;
  border-right: 1px solid #e1e3e8;
}
.office-rb-group:first-child { padding-left: 0; }
.office-rb-group:last-child { border-right: 0; }
.office-rb-group.custom { min-width: 200px; }
.office-rb-group.wide { min-width: 280px; }
.office-rb-label {
  color: #8b909b;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.office-rb-items {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, 24px);
  grid-auto-columns: max-content;
  align-content: start;
  gap: 2px 4px;
}
.office-rb-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  min-width: 0;
  padding: 1px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #303540;
  background: transparent;
  font-size: 10.5px;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
}
.office-rb-btn:hover { background: var(--office-rb-hover); border-color: var(--office-rb-hover-border); }
.office-rb-btn.active {
  background: var(--office-rb-hover);
  border-color: var(--office-rb-accent);
  color: var(--office-rb-accent-dark);
}
.office-rb-btn.big {
  grid-row: span 2;
  width: 56px;
  height: 50px;
  padding: 3px;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 3px;
}
.office-rb-btn.big .office-rb-icon { font-size: 16px; }
.office-rb-btn.primary {
  color: #fff;
  background: var(--office-rb-accent);
  border-color: var(--office-rb-accent);
}
.office-rb-btn.primary:hover { background: var(--office-rb-accent-dark); border-color: var(--office-rb-accent-dark); }
.office-rb-btn.ai { color: #176d68; background: #e8f4f2; border-color: #cae5e1; }
.office-rb-btn.danger { color: #b3261e; }
.office-rb-btn.disabled { opacity: 0.42; cursor: default; }
.office-rb-btn.disabled:hover { background: transparent; border-color: transparent; }
.office-rb-icon { font-size: 12px; line-height: 1; }
.office-rb-caret { margin-left: 1px; font-size: 8px; opacity: 0.7; }
.office-rb-sep { width: 1px; margin: 2px 3px; background: #e1e3e8; }

.office-rb-select {
  height: 24px;
  padding: 0 4px;
  border: 1px solid #ccd0d8;
  border-radius: 5px;
  background: #fff;
  color: #242832;
  font-size: 11.5px;
}
.office-rb-color {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
}
.office-rb-color:hover { background: var(--office-rb-hover); border-color: var(--office-rb-hover-border); }
.office-rb-color-glyph { font-size: 11px; font-weight: 700; line-height: 1; }
.office-rb-color-bar { width: 16px; height: 4px; margin-top: 1px; border-radius: 1px; }
.office-rb-color-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* PowerPoint Studio keeps its orange accent on the shared chrome. */
.ps-office-ribbon { --office-rb-accent: #c05621; --office-rb-accent-dark: #9c4419; --office-rb-hover: #f5e9e5; --office-rb-hover-border: #ead0c8; }

/* ==========================================================================
   Word shell
   ========================================================================== */

.word-app { display: flex; flex-direction: column; min-height: 0; }
.word-main { position: relative; flex: 1 1 auto; display: flex; min-height: 0; }
.word-scroll { flex: 1 1 auto; overflow: auto; background: #7a7f87; padding: 22px 0 40px; }

.word-ribbon .w-ribbon-stack { display: flex; flex-direction: column; gap: 3px; }
.word-ribbon .w-ribbon-line { display: flex; align-items: center; gap: 3px; }
.word-ribbon .word-btn { height: 24px; min-width: 26px; padding: 0 6px; font-size: 12px; }
.w-ribbon-props { display: flex; flex-direction: column; gap: 4px; min-width: 240px; }

/* --- Page sheets ---------------------------------------------------------- */
/* The width is set inline from the live page setup; office.css's legacy
   `max-width: 96%` would shrink a Legal or landscape sheet below it. */
.word-doc-frame { position: relative; margin: 0 auto; max-width: none; }
.word-page-sheets { position: absolute; inset: 0; pointer-events: none; }
.word-page-sheet {
  position: absolute;
  left: 0;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}
.word-sheet-header, .word-sheet-footer {
  position: absolute;
  font-size: 9pt;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.word-sheet-header { padding-bottom: 3px; border-bottom: 1px solid #e3e5ea; }
.word-sheet-footer { padding-top: 3px; border-top: 1px solid #e3e5ea; }

.word-page {
  position: relative;
  margin: 0 auto;
  outline: none;
  background: transparent;
  color: #1b1b1f;
  font-family: Calibri, Arial, sans-serif;
  font-size: 11pt;
}
/* The grey band between sheets must bleed across the page padding, which
   tracks the margin preset (set as --w-margin-* by applyPageSetup). */
.word-page-gap {
  pointer-events: none;
  margin-left: calc(-1 * var(--w-margin-left, 96px));
  margin-right: calc(-1 * var(--w-margin-right, 96px));
}
.word-page > * { position: relative; }
.word-page p { margin: 0 0 var(--w-para-space, 10px); }
.word-page h1, .word-page h2, .word-page h3, .word-page h4 {
  color: var(--w-heading-color, #1b3a6b);
  font-family: var(--w-heading-font, inherit);
  font-weight: 600;
}
.word-page h1 { font-size: calc(20pt * var(--w-heading-scale, 1)); margin: 16px 0 10px; }
.word-page h2 { font-size: calc(16pt * var(--w-heading-scale, 1)); margin: 14px 0 8px; }
.word-page h3 { font-size: calc(13pt * var(--w-heading-scale, 1)); margin: 12px 0 6px; }
.word-page h4 { font-size: calc(12pt * var(--w-heading-scale, 1)); margin: 10px 0 5px; font-style: italic; }
.word-page img { max-width: 100%; height: auto; }
.word-page a { color: #1b5bb0; }
.word-page ul, .word-page ol { margin: 0 0 var(--w-para-space, 10px); padding-left: 26px; }

/* Heading numbering (presentational; becomes real OOXML numbering on export) */
.word-page.w-numbered-headings { counter-reset: wh1; }
.word-page.w-numbered-headings h1 { counter-increment: wh1; counter-reset: wh2; }
.word-page.w-numbered-headings h1::before { content: counter(wh1) "  "; }
.word-page.w-numbered-headings h2 { counter-increment: wh2; counter-reset: wh3; }
.word-page.w-numbered-headings h2::before { content: counter(wh1) "." counter(wh2) "  "; }
.word-page.w-numbered-headings h3 { counter-increment: wh3; }
.word-page.w-numbered-headings h3::before { content: counter(wh1) "." counter(wh2) "." counter(wh3) "  "; }
.word-page.w-numbered-headings .w-toc h1::before,
.word-page.w-numbered-headings .w-cover h1::before { content: none; }

/* --- Document objects ----------------------------------------------------- */
.w-style-title { font-size: 30pt !important; font-weight: 700; text-align: center; }
.w-style-subtitle { font-size: 14pt; color: #4b5563; text-align: center; }
.w-style-quote { margin: 10px 0; padding-left: 16px; border-left: 3px solid #1b5bb0; color: #374151; font-style: italic; }
.w-style-code { margin: 10px 0; padding: 8px 10px; background: #f4f5f7; border-radius: 4px; font-family: Consolas, monospace; font-size: 10pt; white-space: pre-wrap; }

.w-cover { padding: 150px 0 40px; text-align: center; }
.w-cover-meta { color: #6b7280; font-size: 11pt; }

.w-figure { margin: 14px 0; text-align: center; }
.w-figure img { max-width: 100%; }
.w-caption {
  margin: 6px 0 14px;
  color: #3d424c;
  font-size: 9.5pt;
  font-style: italic;
  text-align: center;
}
.w-caption-label { font-style: normal; font-weight: 700; }
.w-interpretation { color: #1f2937; }

.w-pagebreak {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  color: #9aa0a6;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  user-select: none;
}
.w-pagebreak::before, .w-pagebreak::after {
  content: "";
  flex: 1;
  border-top: 1px dashed #b9bec7;
}

.w-toc { margin: 12px 0 18px; user-select: none; }
.w-toc-title, .w-bib-title {
  margin: 0 0 10px;
  color: var(--w-heading-color, #1b3a6b);
  font-size: 20pt;
  font-weight: 600;
}
.w-toc-row { display: flex; align-items: baseline; gap: 6px; margin: 3px 0; font-size: 11pt; }
.w-toc-row.lvl2 { padding-left: 18px; font-size: 10.5pt; }
.w-toc-row.lvl3 { padding-left: 36px; font-size: 10pt; color: #4b5563; }
.w-toc-dots { flex: 1; border-bottom: 1px dotted #9aa0a6; transform: translateY(-3px); }
.w-toc-empty, .w-bib-empty { color: #9aa0a6; font-size: 10pt; font-style: italic; }

.w-bibliography { margin: 18px 0; user-select: none; }
.w-bib-item { margin: 0 0 7px; padding-left: 26px; text-indent: -26px; font-size: 10.5pt; }

.w-cite { color: #1b5bb0; cursor: default; }
.w-cite.superscript { vertical-align: super; font-size: 78%; }
.w-cite.broken, .w-xref.broken { color: #b3261e; text-decoration: underline wavy; }
.w-xref { color: #1b5bb0; text-decoration: none; cursor: pointer; }
.w-fnref { color: #1b5bb0; font-size: 78%; vertical-align: super; cursor: help; }

.word-page table { border-collapse: collapse; margin: 8px 0; font-size: 10.5pt; }
.word-page td, .word-page th { border: 1px solid #9aa0a6; padding: 4px 7px; vertical-align: top; }
.word-page td, .word-page th { position: relative; min-width: 44px; min-height: 24px; }
.word-page table:hover td, .word-page table:hover th { border-color: #6f86a8; }
body.w-table-resizing, body.w-table-resizing * { user-select: none !important; }
body.w-table-resizing-column, body.w-table-resizing-column * { cursor: col-resize !important; }
body.w-table-resizing-row, body.w-table-resizing-row * { cursor: row-resize !important; }
.word-page th { background: #1b5bb0; color: #fff; text-align: left; font-weight: 600; }
.w-tbl-plain td, .w-tbl-plain th { border-color: transparent; }
.w-tbl-plain th { background: transparent; color: inherit; border-bottom: 2px solid #1b1b1f; }
.w-tbl-lines td, .w-tbl-lines th { border-left: 0; border-right: 0; }
.w-tbl-lines th { background: transparent; color: inherit; border-bottom: 2px solid #374151; }
.w-tbl-banded tbody tr:nth-child(even) { background: #f4f6fa; }
.w-tbl-report th { background: #1b3a6b; }
.w-tbl-report tbody tr:nth-child(even) { background: #f6f8fb; }
.w-tbl-autofit { width: auto; }
.w-linked-table { max-width: 100%; overflow-x: auto; break-inside: avoid; page-break-inside: avoid; }
.w-linked-table > table { max-width: 100%; }
.word-page.w-show-gridlines td, .word-page.w-show-gridlines th { outline: 1px dashed rgba(27, 91, 176, 0.35); }

/* Consecutive pasted/project figures form a balanced two-up report gallery. */
.word-page .w-auto-figure {
  display: inline-flex;
  flex-direction: column;
  justify-content: flex-start;
  width: calc(50% - 8px);
  margin: 8px 12px 12px 0;
  vertical-align: top;
  break-inside: avoid;
  page-break-inside: avoid;
}
.word-page .w-auto-figure:nth-of-type(even) { margin-right: 0; }
.word-page .w-auto-figure img { width: 100%; max-height: 290px; object-fit: contain; }
.word-page .w-auto-figure .w-caption { margin-top: 5px; }

.word-page.w-show-marks p::after { content: "¶"; color: #b9bec7; margin-left: 2px; }

.w-comment-anchor { background: rgba(255, 214, 102, 0.38); border-bottom: 1px solid #e0a800; }
.w-comment-anchor.resolved { background: rgba(16, 124, 65, 0.12); border-bottom-color: #6ca88a; }
.w-comment-anchor.flash { animation: w-flash 1.1s ease; }
@keyframes w-flash { 0%, 100% { background: rgba(255, 214, 102, 0.38); } 40% { background: rgba(255, 175, 40, 0.85); } }

.word-page ins { text-decoration: underline; color: #0f766e; }
.word-page del { text-decoration: line-through; color: #b91c1c; opacity: 0.8; }
.word-page.w-tracking { caret-color: #0f766e; }

mark.w-find-hit { background: #ffe58a; color: inherit; padding: 0; }
mark.w-find-hit.current { background: #ff9e3d; }

/* --- Find & replace ------------------------------------------------------- */
.w-find-panel {
  position: absolute;
  top: 6px;
  right: 22px;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border: 1px solid #cfd3db;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(20, 26, 38, 0.22);
}
.w-find-row { display: flex; align-items: center; gap: 4px; }
.w-find-input {
  width: 190px;
  height: 26px;
  padding: 0 7px;
  border: 1px solid #ccd0d8;
  border-radius: 5px;
  font-size: 12px;
}
.w-find-btn, .w-find-toggle {
  height: 26px;
  min-width: 26px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #3d424c;
  font-size: 11px;
  cursor: pointer;
}
.w-find-btn:hover, .w-find-toggle:hover { background: #eef1f6; border-color: #d7dae0; }
.w-find-toggle.on { background: #e3edfa; border-color: #1b5bb0; color: #164a90; }
.w-find-btn.wide { padding: 0 10px; border-color: #d7dae0; }
.w-find-status { min-width: 74px; color: #6b7280; font-size: 11px; text-align: right; }

/* --- Side panes ----------------------------------------------------------- */
.word-pane-host { flex: 0 0 auto; width: 0; overflow: hidden; transition: width 0.12s ease; }
.word-pane-host.open { width: 300px; }
.w-pane {
  display: flex;
  flex-direction: column;
  width: 300px;
  height: 100%;
  background: #fbfbfc;
  border-left: 1px solid #d7dae0;
}
.w-pane-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px 7px 12px;
  border-bottom: 1px solid #e4e6ea;
  font-size: 12px;
}
.w-pane-x {
  width: 22px; height: 22px;
  border: 0; border-radius: 5px;
  background: transparent; color: #6b7280;
  font-size: 15px; cursor: pointer;
}
.w-pane-x:hover { background: #eceef2; }
.w-pane-body { flex: 1 1 auto; overflow: auto; padding: 10px 12px 16px; font-size: 12px; }
.w-pane-section-title {
  margin: 10px 0 6px;
  color: #8b909b;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.w-pane-empty { color: #9aa0a6; font-size: 11.5px; line-height: 1.5; }

.w-outline-row { padding: 4px 6px; border-radius: 5px; cursor: pointer; color: #303540; }
.w-outline-row:hover { background: #eef1f6; }
.w-outline-row.lvl2 { padding-left: 18px; color: #4b5563; }
.w-outline-row.lvl3 { padding-left: 30px; color: #6b7280; font-size: 11.5px; }
.w-outline-row.lvl4 { padding-left: 42px; color: #6b7280; font-size: 11px; }

.w-check-card { margin: 0 0 7px; padding: 8px 10px; border-radius: 7px; border-left: 3px solid #9aa0a6; background: #fff; }
.w-check-card p { margin: 3px 0 0; color: #4b5563; line-height: 1.45; }
.w-check-card.ok { border-left-color: #107c41; }
.w-check-card.info { border-left-color: #1b5bb0; }
.w-check-card.warning { border-left-color: #d97706; }
.w-check-card.bad { border-left-color: #b3261e; }

.w-suggestion {
  display: flex; flex-direction: column; gap: 2px;
  width: 100%; margin: 0 0 6px; padding: 8px 10px;
  border: 1px solid #d7dae0; border-radius: 7px;
  background: #fff; text-align: left; cursor: pointer;
}
.w-suggestion:hover { border-color: #1b5bb0; background: #f5f8fd; }
.w-suggestion span { color: #6b7280; font-size: 11px; }

.w-comment-card { margin: 0 0 8px; padding: 8px 10px; border: 1px solid #e4e6ea; border-radius: 7px; background: #fff; cursor: pointer; }
.w-comment-card:hover { border-color: #1b5bb0; }
.w-comment-card.resolved { opacity: 0.62; }
.w-comment-head { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; }
.w-comment-when { color: #9aa0a6; }
.w-comment-quote { margin: 4px 0; color: #6b7280; font-style: italic; font-size: 11px; }
.w-comment-body { margin: 3px 0 6px; line-height: 1.45; }
.w-comment-actions, .w-source-actions { display: flex; gap: 5px; }

.w-linked-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; padding: 7px 9px; border: 1px solid #e4e6ea; border-radius: 7px; background: #fff; }
.w-linked-app { display: block; color: #6b7280; font-size: 10.5px; }

.w-mini-btn {
  height: 22px; padding: 0 8px;
  border: 1px solid #d7dae0; border-radius: 5px;
  background: #fff; color: #3d424c;
  font-size: 11px; cursor: pointer;
}
.w-mini-btn:hover { background: #eef1f6; }
.w-mini-btn.danger { color: #b3261e; border-color: #eccac7; }

/* --- Modals --------------------------------------------------------------- */
.w-modal-overlay {
  position: fixed; inset: 0; z-index: 4000;
  display: grid; place-items: center;
  background: rgba(18, 22, 30, 0.42);
  backdrop-filter: blur(1.5px);
}
.w-modal {
  width: min(92vw, 520px);
  max-height: 86vh;
  display: flex; flex-direction: column;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(12, 16, 24, 0.36);
  overflow: hidden;
}
.w-modal-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid #eceef2; }
.w-modal-head h3 { margin: 0; font-size: 15px; }
.w-modal-head p { margin: 3px 0 0; color: #6b7280; font-size: 11.5px; line-height: 1.45; }
.w-modal-x { margin-left: auto; width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: #6b7280; font-size: 18px; cursor: pointer; }
.w-modal-x:hover { background: #eceef2; }
.w-modal-body { flex: 1 1 auto; overflow: auto; padding: 14px 16px; font-size: 12.5px; }
.w-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 11px 16px; border-top: 1px solid #eceef2; background: #fafbfc; }
.w-modal-btn {
  height: 30px; padding: 0 14px;
  border: 1px solid #d7dae0; border-radius: 6px;
  background: #fff; color: #303540;
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.w-modal-btn:hover { background: #f2f4f8; }
.w-modal-btn.primary { background: #1b5bb0; border-color: #1b5bb0; color: #fff; }
.w-modal-btn.primary:hover { background: #164a90; }
.w-modal-btn.danger { color: #b3261e; border-color: #eccac7; }

.w-form { display: flex; flex-direction: column; gap: 10px; }
.w-form-block { display: flex; flex-direction: column; gap: 9px; padding-bottom: 8px; }
.w-form-title { margin-top: 4px; color: #8b909b; font-size: 9px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.w-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 9px; }
.w-form-row { display: flex; align-items: flex-start; gap: 8px; }
.w-field { display: flex; flex-direction: column; gap: 3px; }
.w-field.inline { flex-direction: row; align-items: center; gap: 6px; }
.w-field.inline .w-input { flex: 1 1 auto; }
.w-field-label { color: #6b7280; font-size: 10.5px; font-weight: 600; }
.w-field-hint { color: #9aa0a6; font-size: 10px; }
.w-input {
  height: 28px; padding: 0 8px;
  border: 1px solid #ccd0d8; border-radius: 6px;
  background: #fff; color: #242832;
  font-size: 12px; font-family: inherit;
}
textarea.w-input { height: auto; padding: 6px 8px; resize: vertical; }
.w-paste { flex: 1 1 auto; }
.w-check { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.w-chip {
  height: 24px; padding: 0 10px;
  border: 1px solid #d7dae0; border-radius: 12px;
  background: #fff; color: #3d424c;
  font-size: 11px; cursor: pointer;
}
.w-chip:hover { border-color: #1b5bb0; background: #f5f8fd; }
.w-preset-row { display: flex; flex-wrap: wrap; gap: 6px; }

.w-template-grid, .w-style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.w-template-card, .w-style-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px; border: 1px solid #d7dae0; border-radius: 9px;
  background: #fff; text-align: left; cursor: pointer;
}
.w-template-card:hover, .w-style-card:hover { border-color: #1b5bb0; background: #f5f8fd; }
.w-template-card.active, .w-style-card.active { border-color: #1b5bb0; box-shadow: 0 0 0 2px rgba(27, 91, 176, 0.16); }
.w-template-thumb {
  display: grid; place-items: center;
  height: 64px; border-radius: 6px;
  background: linear-gradient(160deg, #eef2f8, #dde5f1);
  color: #1b3a6b; font-size: 22px; font-weight: 700;
}
.w-template-name, .w-style-name { font-size: 12px; font-weight: 650; }
.w-template-hint { color: #6b7280; font-size: 10.5px; line-height: 1.4; }
.w-style-preview {
  padding: 8px; border-radius: 6px; background: #f6f7f9;
  color: #1b3a6b; font-size: 13px;
}

.w-symbol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 5px; }
.w-symbol {
  height: 36px; border: 1px solid #e4e6ea; border-radius: 6px;
  background: #fff; font-size: 16px; cursor: pointer;
}
.w-symbol:hover { border-color: #1b5bb0; background: #f5f8fd; }

.w-source-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; max-height: 240px; overflow: auto; }
.w-source-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border: 1px solid #e4e6ea; border-radius: 7px; background: #fff;
}
.w-source-row.pick { cursor: pointer; text-align: left; width: 100%; }
.w-source-row.pick:hover { border-color: #1b5bb0; background: #f5f8fd; }
.w-source-text { flex: 1 1 auto; font-size: 11.5px; line-height: 1.45; }
.w-xref-kind {
  padding: 1px 7px; border-radius: 10px;
  background: #eef2f8; color: #1b3a6b;
  font-size: 9.5px; font-weight: 700; text-transform: uppercase;
}

.w-stat-grid { display: flex; flex-direction: column; gap: 2px; }
.w-stat-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 2px; border-bottom: 1px solid #f0f1f4; }

/* --- Status bar ----------------------------------------------------------- */
.word-status {
  display: flex; align-items: center; gap: 14px;
  padding: 0 12px;
  background: #1b5bb0; color: #eaf1fb;
  border-top: none; font-size: 11px;
}
.word-status .st-spacer { flex: 1 1 auto; }
.word-status-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46%; }
.word-zoom { display: flex; align-items: center; gap: 3px; }
.word-zoom-btn {
  width: 20px; height: 18px;
  border: 0; border-radius: 4px;
  background: rgba(255, 255, 255, 0.14); color: #fff;
  font-size: 12px; cursor: pointer;
}
.word-zoom-btn:hover { background: rgba(255, 255, 255, 0.28); }
.word-zoom-label { min-width: 38px; text-align: center; cursor: pointer; }

/* --- Materials modal reuse ------------------------------------------------ */
.w-materials-modal .hs-import-head h3 { font-size: 15px; }
