/* ===== overview_tab_html (HTML form, scoped) =====
   The form's rules (Anvil strips <style> from an HTML template). Loaded eagerly
   from anvil.yaml native_deps.head_html, which is also what styles the
   designer canvas.

   `.ov-root` is the wrapper around `#ov-shell` and
   `#ov-modal-backdrop`: two meaningful top-level nodes would leave Anvil's own
   wrapper as the form root. It is the form root, so its rule stays a bare
   class — the one selector that must outrank the scoped rules beneath it.
   Everything else is `:where(.ov-root)`-scoped, which adds zero specificity and
   so cannot change which rule wins.

   The root takes `position: relative` (guide: an HTML form root takes it).
   The wrapper carries NO display declaration: test_detail_html
   shows and hides this form with `visible`, and a `display: contents` root
   would be in a specificity race with whatever rule Anvil's visible=False
   uses. A plain block adds no box of its own — `.ov-shell` neither grows nor
   sets a height inside the mount panel's flex column. The root takes no
   min-height, height or overflow.

   No `.ov-*` class is declared anywhere else in the app and the form applies no
   `.px-*` class in static markup, so this sheet has no tie to audit against a
   sibling form or against the dependency's runtime theme injection. Every
   selector below is class-led, so none of them can lose to a bare element
   rule in theme.css on document order. */

.ov-root { position: relative; }

:where(.ov-root) .ov-shell {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  color: #1e293b;
  background: #f8fafc;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
:where(.ov-root) .ov-h2 { font-size: 1.4rem; font-weight: 700; margin: 0 0 10px; }
:where(.ov-root) .ov-h2 .ov-subnote { font-size: 0.85rem; color: #64748b; font-weight: 400; margin-left: 8px; }
:where(.ov-root) .ov-h3 { font-size: 1.05rem; font-weight: 700; margin: 18px 0 8px; color: #334155; }
:where(.ov-root) .ov-h3 .ov-count { font-size: 0.7rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .1em; margin-left: 6px; }

/* state chip — temporary inline render until shared_html/status_chip_html lands */
:where(.ov-root) .ov-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
:where(.ov-root) .ov-chip.draft { background: #fef3c7; color: #92400e; }
:where(.ov-root) .ov-chip.published { background: #dcfce7; color: #166534; }
:where(.ov-root) .ov-chip.archived { background: #e2e8f0; color: #475569; }
:where(.ov-root) .ov-chip.required { background: #fee2e2; color: #991b1b; }
:where(.ov-root) .ov-chip.optional { background: #e0f2fe; color: #075985; }

/* metadata stat strip */
:where(.ov-root) .ov-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-top: 6px; }
:where(.ov-root) .ov-stat { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; }
:where(.ov-root) .ov-stat-label { font-size: 0.7rem; color: #64748b; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
:where(.ov-root) .ov-stat-value { font-size: 1.15rem; font-weight: 700; color: #0f172a; margin-top: 4px; word-break: break-word; }
:where(.ov-root) .ov-stat-value small { font-size: 0.75rem; color: #64748b; font-weight: 500; margin-left: 2px; }
:where(.ov-root) .ov-stat-value.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }
:where(.ov-root) .ov-stat-value.muted-italic { color: #94a3b8; font-style: italic; font-size: 0.95rem; font-weight: 500; }

:where(.ov-root) .ov-desc { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; line-height: 1.55; color: #334155; }
:where(.ov-root) .ov-desc.empty { color: #94a3b8; font-style: italic; }

/* materials list */
:where(.ov-root) .ov-mat-list { display: flex; flex-direction: column; gap: 8px; }
:where(.ov-root) .ov-mat-row { display: flex; align-items: center; gap: 12px; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 14px; }
:where(.ov-root) .ov-mat-kind { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.7rem; color: #64748b; text-transform: uppercase; letter-spacing: .08em; min-width: 90px; }
:where(.ov-root) .ov-mat-title { flex: 1; font-weight: 600; color: #0f172a; }
:where(.ov-root) .ov-mat-open { padding: 5px 12px; border: 1px solid #cbd5e1; border-radius: 6px; background: #ffffff; cursor: pointer; font-size: 0.85rem; color: #334155; }
:where(.ov-root) .ov-mat-open:hover { border-color: #94a3b8; background: #f1f5f9; }
:where(.ov-root) .ov-mat-empty { color: #94a3b8; font-style: italic; padding: 8px 0; }

/* questions collapsed list */
:where(.ov-root) .ov-q-list { padding-left: 22px; line-height: 1.65; color: #334155; }
:where(.ov-root) .ov-q-list li { margin-bottom: 4px; }
:where(.ov-root) .ov-q-type { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.65rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .1em; margin-left: 4px; }
:where(.ov-root) .ov-q-aside { font-size: 0.78rem; color: #64748b; margin-top: 6px; }

/* version history panel */
:where(.ov-root) .ov-vh { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 0; margin-top: 4px; }
:where(.ov-root) .ov-vh > summary {
  cursor: pointer; padding: 12px 14px; font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em; color: #334155;
  list-style: none; user-select: none;
}
:where(.ov-root) .ov-vh > summary::marker { display: none; }
:where(.ov-root) .ov-vh > summary::-webkit-details-marker { display: none; }
:where(.ov-root) .ov-vh > summary::before { content: "▸ "; color: #94a3b8; }
:where(.ov-root) .ov-vh[open] > summary::before { content: "▾ "; color: #475569; }
:where(.ov-root) .ov-vh-body { padding: 0 14px 14px 14px; }
:where(.ov-root) .ov-vh-loading { color: #64748b; font-size: 0.85rem; padding: 6px 0; }
:where(.ov-root) .ov-vh-error { color: #991b1b; font-size: 0.85rem; padding: 6px 0; }
:where(.ov-root) .ov-vh-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
:where(.ov-root) .ov-vh-table th, :where(.ov-root) .ov-vh-table td { padding: 8px 10px; text-align: left; font-size: 0.85rem; border-bottom: 1px solid #f1f5f9; }
:where(.ov-root) .ov-vh-table th { font-size: 0.7rem; color: #64748b; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
:where(.ov-root) .ov-vh-table tbody tr { cursor: pointer; }
:where(.ov-root) .ov-vh-table tbody tr:hover { background: #f8fafc; }
:where(.ov-root) .ov-vh-table td.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; color: #475569; }
:where(.ov-root) .ov-vh-badge-current { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: #e0f2fe; color: #075985; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
:where(.ov-root) .ov-vh-aside { font-size: 0.78rem; color: #94a3b8; margin-top: 10px; line-height: 1.5; }
:where(.ov-root) .ov-vh-snapshot-btn { padding: 4px 10px; border: 1px solid #cbd5e1; border-radius: 6px; background: #ffffff; cursor: pointer; font-size: 0.78rem; color: #334155; }
:where(.ov-root) .ov-vh-snapshot-btn:hover { border-color: #94a3b8; background: #f1f5f9; }

/* snapshot modal */
:where(.ov-root) .ov-modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 9000; padding: 40px 16px; overflow-y: auto;
}
:where(.ov-root) .ov-modal-backdrop.open { display: flex; }
:where(.ov-root) .ov-modal {
  background: #ffffff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  width: min(880px, 100%); max-height: 90vh; overflow-y: auto;
}
:where(.ov-root) .ov-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid #e2e8f0;
  position: sticky; top: 0; background: #ffffff; z-index: 1;
}
:where(.ov-root) .ov-modal-title { font-size: 1.05rem; font-weight: 700; color: #0f172a; margin: 0; }
:where(.ov-root) .ov-modal-title small { font-size: 0.78rem; color: #64748b; font-weight: 500; margin-left: 8px; }
:where(.ov-root) .ov-modal-close {
  padding: 6px 12px; border: 1px solid #cbd5e1; border-radius: 6px;
  background: #ffffff; cursor: pointer; font-size: 0.85rem; color: #334155;
}
:where(.ov-root) .ov-modal-close:hover { background: #f1f5f9; border-color: #94a3b8; }
:where(.ov-root) .ov-modal-body { padding: 18px 20px; }
:where(.ov-root) .ov-modal-loading { text-align: center; color: #64748b; font-size: 0.9rem; padding: 30px 0; }
:where(.ov-root) .ov-modal-error { text-align: center; color: #991b1b; font-size: 0.9rem; padding: 30px 0; }
