/* Policies & Handbooks (#/policies, #/policy, #/policy_admin, #/policy_edit, #/policy_compare, #/policy_report) */
.pol { display: flex; flex-direction: column; gap: 14px; }   /* owner 11/14: full width like every page */
.pol-view, .pol-edit { max-width: 980px; }   /* reading / writing one policy keeps a readable line length */
.pol .section { margin: 6px 0 0; }
.pol .card { margin: 0; }
.pol-note { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--blue-soft); color: var(--blue); font-size: var(--fs-sm); font-weight: 600; line-height: 1.45; }
.pol-note.amber { background: var(--amber-soft); color: var(--amber); }
.pol-note .ico { flex: none; margin-top: 1px; }

/* list */
.pol-seg { max-width: 460px; }
.pol-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pol-dot { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--coral-strong); color: #fff; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.pol-due, .pol-done, .pol-admin-strip { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.pol-due { background: var(--coral-soft); border-color: transparent; }
.pol-due b, .pol-done b, .pol-admin-strip b { display: block; color: var(--text); }
.pol-due small, .pol-done small, .pol-admin-strip small { display: block; color: var(--text-2); font-size: var(--fs-xs); margin-top: 2px; line-height: 1.4; }
.pol-due-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--coral-strong); }
.pol-done .pol-due-ic { background: var(--blue-soft); color: var(--blue); }
.pol-due-ic.amber { background: var(--amber-soft); color: var(--amber); }
.pol-admin-strip > span:first-child { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--ink); color: #fff; }
.pol-admin-strip > div { flex: 1; min-width: 0; }
.pol-list { display: flex; flex-direction: column; gap: 10px; }
.pol-card { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; color: var(--text); transition: transform .15s, box-shadow .15s; }
.pol-card:active { transform: scale(.99); }
.pol-card.is-due { box-shadow: inset 4px 0 0 var(--coral-strong); }
.pol-card-ic { width: 44px; height: 44px; flex: none; border-radius: 13px; display: grid; place-items: center; background: var(--blue-soft); color: var(--ink); }
:root[data-theme="dark"] .pol-card-ic { color: var(--blue); }
.pol-card-ic.lg { width: 54px; height: 54px; border-radius: 16px; }
.pol-card-ic.lg .ico { width: 26px; height: 26px; }
.pol-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pol-card-main > b { font-family: var(--font-display); font-size: var(--fs-lg); line-height: 1.25; color: var(--text); }
.pol-card-main > small { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.45; }
.pol-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 4px; }
.pol-card-meta .pill { display: inline-flex; align-items: center; gap: 4px; }
.pol-chev { color: var(--faint); align-self: center; flex: none; }

/* viewer */
.pol-head { display: flex; gap: 14px; align-items: flex-start; padding: 16px; flex-wrap: wrap; }
.pol-head-main { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 8px; }
.pol-head-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pol-head-pills .pill { display: inline-flex; align-items: center; gap: 4px; }
.pol-sum { margin: 0; color: var(--text-2); line-height: 1.5; }
.pol-head-admin { display: flex; gap: 8px; flex-wrap: wrap; }
.pol-prev-title { margin: 0; font-family: var(--font-display); color: var(--text); font-size: var(--fs-xl); }
.pol-doc { padding: 22px 22px 26px; }
.pol-doc.prose { color: var(--text); font-size: 16.5px; }
.pol-doc.prose h2 { font-family: var(--font-display); color: var(--ink); padding-top: 14px; border-top: 1px solid var(--line); }
:root[data-theme="dark"] .pol-doc.prose h2 { color: var(--text); }
.pol-doc.prose h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.pol-doc.prose blockquote { margin: 12px 0; padding: 6px 16px; border-left: 4px solid var(--ink); background: var(--surface-2, var(--surface-3)); border-radius: 0 12px 12px 0; }
.pol-changed { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; background: var(--amber-soft); border-color: transparent; }
.pol-changed-top { display: flex; gap: 12px; align-items: flex-start; }
.pol-changed-top b { display: block; color: var(--text); }
.pol-changed-top small { display: block; color: var(--text-2); margin-top: 3px; line-height: 1.45; }
.pol-changed .pol-due-ic { background: var(--surface); }
.pol-changed > .btn { align-self: flex-start; }
.pol-diff-wrap { background: var(--surface); border-radius: 14px; padding: 12px 14px; }
.pol-hist summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--text); padding: 14px 16px; list-style: none; }
.pol-hist summary::-webkit-details-marker { display: none; }
.pol-hist ol { margin: 0; padding: 0 16px 14px 36px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.45; }
.pol-hist li b { color: var(--text); }

/* acknowledge */
.pol-ack { padding: 18px; display: flex; flex-direction: column; gap: 12px; border: 2px solid var(--ink); }
.pol-ack h3 { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--text); font-family: var(--font-display); }
.pol-ack .field { margin: 0; }
.pol-check { align-items: flex-start; font-weight: 500; line-height: 1.45; color: var(--text); }
.pol-check input { margin-top: 1px; flex: none; }
.pol-ack.is-done, .pol-ack.is-info { flex-direction: row; align-items: center; gap: 12px; border: 0; }
.pol-ack.is-done { background: var(--blue-soft); }
.pol-ack.is-done .pol-due-ic { background: var(--surface); color: var(--blue); }
.pol-ack.is-info .pol-due-ic { background: var(--surface-3); color: var(--text-2); }
.pol-ack.is-done b, .pol-ack.is-info b { display: block; color: var(--text); }
.pol-ack.is-done small, .pol-ack.is-info small { display: block; color: var(--text-2); font-size: var(--fs-xs); margin-top: 2px; }

/* attachments */
.pol-files { display: flex; flex-direction: column; gap: 8px; }
.pol-file { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 6px 4px 4px; }
.pol-file-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 8px 10px; color: var(--text); border-radius: 10px; }
.pol-file-main:hover { background: var(--surface-3); }
.pol-file-ic { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--coral-soft); color: var(--coral-strong); }
.pol-file-ic.doc, .pol-file-ic.docx, .pol-file-ic.rtf, .pol-file-ic.txt { background: var(--blue-soft); color: var(--blue); }
.pol-file-ic.xls, .pol-file-ic.xlsx, .pol-file-ic.csv { background: var(--violet-soft); color: var(--violet); }
.pol-file-ic.png, .pol-file-ic.jpg, .pol-file-ic.jpeg, .pol-file-ic.gif, .pol-file-ic.webp, .pol-file-ic.heic { background: var(--gold-soft); color: var(--amber); }
.pol-file-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pol-file-txt b { font-size: var(--fs-sm); }
.pol-file-txt small { color: var(--muted); font-size: var(--fs-xs); }
.pol-file-go { color: var(--faint); flex: none; }

/* compare */
.pol-diff { padding: 14px 16px; line-height: 1.6; font-size: 15px; color: var(--text-2); }
.pol-diff-sheet { border: 1px solid var(--line); border-radius: 14px; max-height: 46vh; overflow: auto; margin-bottom: 14px; }
.pol-diff-sum { font-weight: 700; color: var(--text); margin-bottom: 6px; }
.pd-row { position: relative; padding: 2px 0 2px 28px; }
.pd-row p, .pd-row h3, .pd-row h4 { margin: 4px 0; }
.pd-row h3, .pd-row h4 { color: var(--text); font-family: var(--font-display); }
.pd-row .pd-li::before { content: "•"; margin-right: 8px; color: var(--muted); }
.pd-eq { opacity: .75; }
.pd-mark { position: absolute; left: 2px; top: 7px; width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; }
.pd-add .pd-mark { background: var(--blue-soft); color: var(--blue); }
.pd-del .pd-mark { background: var(--coral-soft); color: var(--coral-strong); }
.pd-chg .pd-mark { background: var(--amber-soft); color: var(--amber); }
.pol-diff ins, .pd-legend ins { background: var(--blue-soft); color: var(--blue); text-decoration: none; border-radius: 4px; padding: 0 2px; box-shadow: inset 0 -2px 0 var(--blue); }
.pol-diff del, .pd-legend del { background: var(--coral-soft); color: var(--coral-strong); border-radius: 4px; padding: 0 2px; text-decoration: line-through; }
.pd-skip { display: flex; align-items: center; gap: 6px; margin: 8px 0 8px 28px; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
.pd-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: var(--fs-xs); margin: 4px 2px 10px; }
.pol-pub-sum { padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.pol-pub-sum b { color: var(--text); }
.pol-pub-sum small { color: var(--muted); font-size: var(--fs-xs); }
.pol-cmp-pick { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; padding: 14px 16px; }
.pol-cmp-pick .field { margin: 0; }
.pol-cmp-arrow { padding-bottom: 14px; color: var(--muted); }

/* admin list */
.pol-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pol-kpi { padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.pol-kpi small { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .02em; }
.pol-kpi b { font-family: var(--font-display); font-size: 28px; color: var(--text); line-height: 1.1; }
.pol-adm-actions { flex-wrap: wrap; }
.pol-chips { flex-wrap: wrap; }
.pol-acard { display: flex; flex-wrap: wrap; gap: 0; padding: 0; overflow: hidden; }
.pol-acard-main { display: flex; gap: 14px; padding: 14px 16px; flex: 1 1 320px; min-width: 0; color: var(--text); }
.pol-acard-stats { flex: 0 1 260px; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 12px 16px; background: var(--surface-3); color: var(--text); }
.pol-acard-num { display: flex; align-items: baseline; gap: 6px; }
.pol-acard-num b { font-family: var(--font-display); font-size: 22px; }
.pol-acard-num span { color: var(--text-2); font-size: var(--fs-sm); }
.pol-acard-stats small { display: flex; align-items: center; gap: 4px; }
.pol-prog { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.pol-prog span { display: block; height: 100%; border-radius: inherit; background: var(--ink); }
:root[data-theme="dark"] .pol-prog span { background: var(--blue); }

/* editor */
.pol-form { padding: 16px; }
.pol-form .field:last-child { margin-bottom: 0; }
.pol-title-in { font-size: 18px; font-weight: 700; }
.pol-row2 { align-items: start; }
.pol-switch-row { display: flex; align-items: center; gap: 12px; min-height: 50px; }
.pol-switch-row small, .pol-switch-row span > small { display: block; color: var(--text-2); font-size: var(--fs-xs); line-height: 1.4; }
.pol-switch-row b { display: block; color: var(--text); }
.pol-editor-card { padding: 0; overflow: visible; min-height: 200px; }
.pol-editor-card .tox-tinymce { border: 0 !important; border-radius: var(--r-card) !important; overflow: visible !important; }
/* 11/21/2026: the editor grows with the text and its toolbar stays pinned to the top of the page's scroller while you
   write a long policy (no overflow:hidden between the toolbar and .page-scroll, or sticky stops working). */
.pol-editor-card .tox .tox-editor-container { overflow: visible !important; }
.pol-editor-card .tox .tox-editor-header { position: sticky !important; top: 0; z-index: 6; background: var(--surface);
  border-radius: var(--r-card) var(--r-card) 0 0; box-shadow: 0 1px 0 var(--line), 0 6px 14px rgba(27, 33, 89, .08); }
.pol-editor-card .tox .tox-edit-area { border-radius: 0 0 var(--r-card) var(--r-card); overflow: hidden; }
.pol-editor-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 260px; color: var(--muted); }
.pol-edfail { display: flex; align-items: center; gap: 12px; padding: 18px; color: var(--text); flex-wrap: wrap; justify-content: center; text-align: left; }
.pol-edfail b { display: block; }
.pol-edfail small { display: block; color: var(--text-2); }
.pol-attach { margin-top: 10px; cursor: pointer; }
.pol-vrow .row-icon { font-family: var(--font-display); font-weight: 800; font-size: 15px; }
.pol-vnote { white-space: normal !important; }
.pol-vbtns { display: flex; gap: 2px; flex: none; }
.pol-danger { display: flex; flex-wrap: wrap; gap: 8px; }
.pol-bar { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 5; display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; padding: 10px; border-radius: 18px;
  background: var(--surface); box-shadow: 0 10px 30px rgba(27, 33, 89, .18), 0 0 0 1px var(--line); margin-top: 4px; }
.pol-bar .btn { padding: 0 10px; }
.pol-sheet-note { margin: 0 4px 12px; line-height: 1.5; }
.pol-reack { padding: 12px 14px; }
.pol-pub p { line-height: 1.5; color: var(--text); }
.row.is-busy { opacity: .5; pointer-events: none; }

/* report */
.pol-rep-hero { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; padding: 18px; }
.pol-ring { --p: 0; width: 132px; height: 132px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--ink) calc(var(--p) * 1%), var(--line-2) 0); }
:root[data-theme="dark"] .pol-ring { background: conic-gradient(var(--blue) calc(var(--p) * 1%), var(--line-2) 0); }
.pol-ring > span { width: 104px; height: 104px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pol-ring b { font-family: var(--font-display); font-size: 30px; color: var(--text); line-height: 1; }
.pol-ring small { color: var(--muted); font-size: 11px; font-weight: 700; margin-top: 4px; }
.pol-rep-kpis { flex: 1; min-width: 240px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pol-rep-kpis > div { background: var(--surface-3); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; }
.pol-rep-kpis b { font-family: var(--font-display); font-size: 24px; color: var(--text); }
.pol-rep-kpis small { color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; }
.pol-rep-out { flex-basis: 100%; display: flex; align-items: center; gap: 6px; color: var(--amber); font-weight: 600; }
.pol-days { padding: 14px 16px; }
.pol-days-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.pol-days-h b { color: var(--text); }
.pol-bars { display: flex; align-items: flex-end; gap: 4px; height: 64px; }
.pol-bars span { flex: 1; max-width: 26px; height: 100%; display: flex; align-items: flex-end; }
.pol-bars i { display: block; width: 100%; height: max(4px, var(--h)); border-radius: 5px 5px 2px 2px; background: var(--ink); }
:root[data-theme="dark"] .pol-bars i { background: var(--blue); }
.pol-rep-actions { flex-wrap: wrap; }
.pol-search { max-width: 420px; }
.pol-people .row-sub { white-space: normal; }
.pol-people .pill { flex: none; }

@media (max-width: 600px) {
  .pol-kpis { gap: 8px; }
  .pol-kpi { padding: 12px 10px; }
  .pol-kpi b { font-size: 22px; }
  .pol-doc { padding: 16px 16px 20px; }
  .pol-cmp-pick { grid-template-columns: 1fr; }
  .pol-cmp-arrow { display: none; }
  .pol-bar { grid-template-columns: 1fr 1fr; }
  .pol-bar [data-publish] { grid-column: 1 / -1; }
  .pol-acard-stats { flex-basis: 100%; }
  .pol-row2 { grid-template-columns: 1fr; gap: 0; }
  .pol-people .pill { font-size: 10.5px; }
}
@media print {
  .pol-bar, .pol-ack form, .pol-admin-strip, .pol-head-admin { display: none !important; }
}

/* Home: Policies tile + "needs your acknowledgment" banner */
.hm-tile.blue .hm-tile-ic { background: var(--blue-soft); color: var(--blue); }
.hm-pol { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-top: 14px; color: var(--text); background: var(--coral-soft); border-color: transparent; }
.hm-pol > span:nth-child(2) { flex: 1; min-width: 0; }
.hm-pol b { display: block; }
.hm-pol small { display: block; color: var(--text-2); font-size: var(--fs-xs); margin-top: 2px; }
.hm-pol-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--coral-strong); }
.pol-form .segmented button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

/* Table engine HTML fields upgraded to the full editor (engine/fields.js + core/editor.js) */
.fe-rte.is-tiny { border: 0; border-radius: var(--r-input); }
.fe-rte.is-tiny > .fe-rte-bar, .fe-rte.is-tiny > .fe-rte-body { display: none !important; }
.fe-rte.is-tiny .tox-tinymce { border: 1.5px solid var(--line-2) !important; border-radius: var(--r-input) !important; }
.tox .tox-toolbar__group { padding: 0 4px !important; }
/* News: admin Edit on each post */
.hx-by-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px 12px; }
.hx-by-row .hx-by { padding: 0; }
.hx-edit { height: 32px; }
/* Separator (owner 11/16): editor "Horizontal Line" button */
.pol-doc.prose hr { border: 0; border-top: 2px solid var(--line-2, var(--line)); margin: 26px 0; }
