/* ============================================================
   docximport.css — Word (.docx) → page import modal
   Ships its own overlay (.docx-layer) since the importer builds
   and tears down its modal on document.body directly.
   ============================================================ */

.docx-layer {
  position: fixed; inset: 0; z-index: 240;
  background: rgba(10, 11, 26, 0.6);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 90px;
}

.docx-modal { width: 640px; max-width: calc(100vw - 40px); max-height: 82vh; }
.docx-body {
  padding: 18px 22px 8px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px; min-height: 0;
}

/* ---- dropzone (step 1) ---- */
.docx-drop {
  border: 1.5px dashed var(--border-strong); border-radius: 14px;
  padding: 30px 20px; text-align: center; cursor: pointer;
  background: var(--bg-callout);
  transition: border-color 0.14s, background 0.14s;
}
.docx-drop:hover { border-color: var(--accent-soft); }
.docx-drop.over { border-color: var(--accent); background: rgba(91, 91, 214, 0.06); }
.docx-drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.docx-drop.busy { opacity: 0.7; cursor: progress; }
.docx-drop-icon { color: var(--text-faint); margin-bottom: 8px; }
.docx-drop-title { font-size: 15px; color: var(--text); font-weight: 600; }
.docx-drop-title b { color: var(--accent); }
:root[data-theme="dark"] .docx-drop-title b { color: var(--accent-soft); }
.docx-drop-sub { font-size: 12.5px; color: var(--text-faint); margin-top: 5px; }
.docx-hint {
  font-size: 12.5px; line-height: 1.55; color: var(--text-light);
  background: var(--bg-code); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
}

/* ---- preview (step 2) ---- */
.docx-file-row {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--text-light);
  background: var(--bg-callout); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px;
}
.docx-file-ic { color: var(--accent); display: inline-flex; }
:root[data-theme="dark"] .docx-file-ic { color: var(--accent-soft); }
.docx-file-name {
  font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.docx-title-row { display: flex; flex-direction: column; gap: 6px; }
.docx-title-label {
  font-size: 11px; font-weight: 600; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.7px;
}
.docx-title { font-family: var(--font-display); font-weight: 600; }

.docx-summary {
  font-size: 12.5px; color: var(--text-faint);
  font-family: var(--font-mono);
}

.docx-outline {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 6px; max-height: 300px; overflow-y: auto;
  background: var(--bg-input);
  display: flex; flex-direction: column; gap: 1px;
}
.docx-outline-empty {
  font-size: 13px; color: var(--text-faint); text-align: center; padding: 18px 8px;
}
.docx-outline-row {
  display: flex; align-items: baseline; gap: 9px;
  padding: 4px 8px; border-radius: 7px;
  font-size: 13px; color: var(--text-light);
  line-height: 1.4;
}
.docx-outline-row:hover { background: var(--bg-callout); }
.docx-outline-tag {
  flex: 0 0 auto; min-width: 24px; text-align: center;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  color: var(--text-faint);
  border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 4px; align-self: center;
}
.docx-outline-text {
  flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* heading rows read as headings; deeper levels indent + soften */
.docx-kind-h1 .docx-outline-text { font-weight: 700; color: var(--text); font-size: 13.5px; }
.docx-kind-h2 .docx-outline-text { font-weight: 600; color: var(--text); padding-left: 12px; }
.docx-kind-h3 .docx-outline-text { font-weight: 600; color: var(--text-light); padding-left: 24px; }
.docx-kind-h1 .docx-outline-tag,
.docx-kind-h2 .docx-outline-tag,
.docx-kind-h3 .docx-outline-tag { color: var(--accent); border-color: var(--accent-soft); }
:root[data-theme="dark"] .docx-kind-h1 .docx-outline-tag,
:root[data-theme="dark"] .docx-kind-h2 .docx-outline-tag,
:root[data-theme="dark"] .docx-kind-h3 .docx-outline-tag { color: var(--accent-soft); }
.docx-kind-divider .docx-outline-text,
.docx-kind-code .docx-outline-text { color: var(--text-faint); font-family: var(--font-mono); font-size: 12px; }

/* ---- footer ---- */
.docx-foot {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--border);
}
.docx-back {
  padding: 8px 15px; font-size: 13.5px; font-family: var(--font);
  color: var(--text-light); background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: var(--radius-ctl);
  cursor: pointer;
}
.docx-back:hover { background: var(--bg-callout); }
.docx-back:disabled { opacity: 0.5; cursor: default; }
.docx-import:disabled { opacity: 0.5; cursor: default; box-shadow: none; }

@media (max-width: 620px) {
  .docx-layer { padding-top: 54px; }
  .docx-modal { width: calc(100vw - 20px); max-height: 88vh; }
  .docx-drop { padding: 24px 14px; }
}
