/* =====================================================================
   SAFAR — نظام استطلاعات الرأي (pol-*)
   All colours come from the --home-* tokens (light fallbacks here; dark
   values from darkOverrid.css); the accent is the system colour var(--rz-primary).
   Logical properties only → RTL / LTR.
   ===================================================================== */

.pol-root {
    --pol-surface: var(--home-surface, #ffffff);
    --pol-surface-2: var(--home-surface-2, #f6f8fb);
    --pol-border: var(--home-border, #e3e8ef);
    --pol-text: var(--home-text, #1d2433);
    --pol-text-2: var(--home-text-2, #4a5568);
    --pol-muted: var(--home-text-muted, #5f6b7a);
    --pol-radius: 14px;
    color: var(--pol-text);
    max-width: 1240px;
    margin-inline: auto;
    padding: 18px 20px 40px;
    box-sizing: border-box;
}
.pol-root *, .pol-root *::before, .pol-root *::after { box-sizing: border-box; }
.pol-root a { color: var(--rz-primary); }
.pol-root h1, .pol-root h2, .pol-root h3 { color: var(--pol-text); margin: 0; }
.pol-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- module navigation ---------- */
.pol-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; margin-block-end: 16px;
    background: var(--pol-surface); border: 1px solid var(--pol-border); border-radius: 999px; box-shadow: var(--home-shadow, 0 1px 2px rgba(16,24,40,.06)); }
.pol-nav__brand { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; font-weight: 700; color: var(--pol-text); text-decoration: none; }
.pol-nav__brand i { color: var(--rz-primary); }
.pol-nav a.pol-nav__link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; color: var(--pol-text-2);
    text-decoration: none; font-size: .92rem; min-height: 38px; }
.pol-nav a.pol-nav__link:hover { background: var(--home-hover, rgba(15,23,42,.05)); color: var(--pol-text); }
.pol-nav a.pol-nav__link.is-active { background: color-mix(in srgb, var(--rz-primary) 12%, transparent); color: var(--rz-primary); font-weight: 600; }

/* ---------- page head ---------- */
.pol-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-block-end: 18px; }
.pol-head__icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem;
    background: color-mix(in srgb, var(--rz-primary) 12%, transparent); color: var(--rz-primary); flex: none; }
.pol-head__text { flex: 1 1 260px; min-width: 0; }
.pol-head__text h1 { font-size: 1.35rem; font-weight: 700; line-height: 1.3; }
.pol-head__text p { margin: 2px 0 0; color: var(--pol-muted); font-size: .92rem; }
.pol-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- buttons ---------- */
.pol-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px;
    border-radius: 10px; border: 1px solid var(--pol-border); background: var(--pol-surface); color: var(--pol-text);
    font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background-color .15s, border-color .15s, box-shadow .15s; }
.pol-btn:hover { background: var(--pol-surface-2); }
.pol-btn:focus-visible, .pol-choice:focus-within, .pol-tab:focus-visible, .pol-input:focus-visible, .pol-seg button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--rz-primary) 45%, transparent); outline-offset: 2px; }
.pol-btn.is-primary { background-color: var(--rz-primary); border-color: var(--rz-primary); color: var(--rz-on-primary); }
.pol-btn.is-primary:hover { filter: brightness(1.06); }
.pol-btn.is-danger { color: var(--home-danger-text, #b42318); border-color: color-mix(in srgb, var(--home-danger-text, #b42318) 35%, transparent); }
.pol-btn.is-ghost { background: transparent; border-color: transparent; color: var(--pol-text-2); }
.pol-btn.is-ghost:hover { background: var(--home-hover, rgba(15,23,42,.05)); }
.pol-btn.is-sm { min-height: 34px; padding: 5px 12px; font-size: .85rem; }
.pol-btn[disabled], .pol-btn.is-busy { opacity: .55; cursor: not-allowed; }
.pol-btn i { font-size: 1em; }

/* ---------- tabs / segments ---------- */
.pol-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--pol-surface-2); border: 1px solid var(--pol-border);
    overflow-x: auto; scrollbar-width: none; margin-block-end: 14px; }
.pol-tabs::-webkit-scrollbar { display: none; }
.pol-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; border: 0; border-radius: 9px;
    background: transparent; color: var(--pol-text-2); font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; }
.pol-tab.is-active { background: var(--pol-surface); color: var(--pol-text); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.pol-badge { min-width: 22px; padding: 1px 7px; border-radius: 999px; font-size: .75rem; line-height: 18px; text-align: center;
    background: var(--home-chip, #eef2f7); color: var(--pol-text-2); }
.pol-tab.is-active .pol-badge, .pol-badge.is-accent { background: var(--rz-primary); color: var(--rz-on-primary); }

.pol-seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.pol-seg button { min-height: 40px; padding: 7px 14px; border-radius: 10px; border: 1px solid var(--pol-border); background: var(--pol-surface);
    color: var(--pol-text-2); font: inherit; font-size: .9rem; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.pol-seg button.is-on { border-color: var(--rz-primary); background: color-mix(in srgb, var(--rz-primary) 12%, transparent); color: var(--rz-primary); font-weight: 600; }
.pol-seg button i { font-size: 1.05em; }

/* ---------- toolbar ---------- */
.pol-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-block-end: 14px; }
.pol-search { position: relative; flex: 1 1 260px; }
.pol-search i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--pol-muted); }
.pol-search .pol-input { padding-inline-start: 36px; }
.pol-input, .pol-select, .pol-textarea { width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--pol-border);
    background: var(--pol-surface); color: var(--pol-text); font: inherit; font-size: .95rem; }
.pol-textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
.pol-input::placeholder, .pol-textarea::placeholder { color: var(--pol-muted); opacity: 1; }
.pol-select { width: auto; min-width: 150px; }
.pol-input[type="datetime-local"], .pol-input[type="date"] { color-scheme: light dark; }

/* ---------- cards ---------- */
.pol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.pol-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--pol-radius);
    background: var(--pol-surface); border: 1px solid var(--pol-border); box-shadow: var(--home-shadow, 0 1px 2px rgba(16,24,40,.06));
    color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.pol-card:hover { border-color: color-mix(in srgb, var(--rz-primary) 45%, var(--pol-border)); box-shadow: 0 6px 18px rgba(16,24,40,.08); }
.pol-card.is-todo::before { content: ""; position: absolute; inset-block: 14px; inset-inline-start: 0; width: 4px; border-radius: 0 4px 4px 0;
    background: var(--rz-primary); }
.pol-card__top { display: flex; align-items: flex-start; gap: 10px; }
.pol-card__title { flex: 1; min-width: 0; font-weight: 700; font-size: 1.02rem; line-height: 1.45; overflow-wrap: anywhere; }
.pol-card__q { color: var(--pol-text-2); font-size: .92rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pol-card__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--pol-muted); font-size: .82rem; }
.pol-card__meta span { display: inline-flex; align-items: center; gap: 5px; }
.pol-card__foot { display: flex; align-items: center; gap: 10px; margin-block-start: auto; }
.pol-card__foot .pol-progress { flex: 1; }

.pol-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600;
    white-space: nowrap; background: var(--home-chip, #eef2f7); color: var(--pol-text-2); }
.pol-chip.is-open { background: color-mix(in srgb, var(--home-success-text, #1e7b4a) 13%, transparent); color: var(--home-success-text, #1e7b4a); }
.pol-chip.is-scheduled { background: color-mix(in srgb, var(--home-info-text, #0b6aa2) 13%, transparent); color: var(--home-info-text, #0b6aa2); }
.pol-chip.is-closed, .pol-chip.is-archived { background: var(--home-chip, #eef2f7); color: var(--pol-text-2); }
.pol-chip.is-cancelled, .pol-chip.is-suspended { background: color-mix(in srgb, var(--home-danger-text, #b42318) 12%, transparent); color: var(--home-danger-text, #b42318); }
.pol-chip.is-draft { background: color-mix(in srgb, var(--home-warning-text, #9a5b00) 13%, transparent); color: var(--home-warning-text, #9a5b00); }
.pol-chip.is-secret { background: color-mix(in srgb, #6f42c1 12%, transparent); color: var(--home-tone-purple, #6f42c1); }
.pol-chip.is-voted { background: color-mix(in srgb, var(--rz-primary) 12%, transparent); color: var(--rz-primary); }

.pol-progress { height: 8px; border-radius: 999px; background: var(--pol-surface-2); overflow: hidden; border: 1px solid var(--pol-border); }
.pol-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--rz-primary); }
.pol-progress-label { font-size: .8rem; color: var(--pol-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- states ---------- */
.pol-empty { display: grid; place-items: center; gap: 8px; padding: 42px 16px; text-align: center; color: var(--pol-muted);
    border: 1px dashed var(--pol-border); border-radius: var(--pol-radius); background: var(--pol-surface); }
.pol-empty i { font-size: 2rem; color: var(--rz-primary); opacity: .8; }
.pol-empty strong { color: var(--pol-text); font-size: 1.02rem; }
.pol-skel { height: 132px; border-radius: var(--pol-radius); background: linear-gradient(90deg, var(--pol-surface-2), var(--pol-surface), var(--pol-surface-2));
    background-size: 200% 100%; animation: pol-shimmer 1.2s infinite linear; border: 1px solid var(--pol-border); }
@keyframes pol-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.pol-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: .92rem; line-height: 1.6;
    background: var(--pol-surface-2); border: 1px solid var(--pol-border); color: var(--pol-text-2); margin-block-end: 12px; }
.pol-alert i { margin-block-start: 3px; }
.pol-alert.is-info { border-color: color-mix(in srgb, var(--home-info-text, #0b6aa2) 30%, transparent); }
.pol-alert.is-info i { color: var(--home-info-text, #0b6aa2); }
.pol-alert.is-warn { border-color: color-mix(in srgb, var(--home-warning-text, #9a5b00) 35%, transparent); }
.pol-alert.is-warn i { color: var(--home-warning-text, #9a5b00); }
.pol-alert.is-danger { border-color: color-mix(in srgb, var(--home-danger-text, #b42318) 35%, transparent); }
.pol-alert.is-danger i { color: var(--home-danger-text, #b42318); }
.pol-alert.is-success { border-color: color-mix(in srgb, var(--home-success-text, #1e7b4a) 35%, transparent); }
.pol-alert.is-success i { color: var(--home-success-text, #1e7b4a); }
.pol-more { display: flex; justify-content: center; margin-block-start: 16px; }

/* ---------- panels / layout ---------- */
.pol-panel { background: var(--pol-surface); border: 1px solid var(--pol-border); border-radius: var(--pol-radius); padding: 16px;
    box-shadow: var(--home-shadow, 0 1px 2px rgba(16,24,40,.06)); }
.pol-panel + .pol-panel { margin-block-start: 14px; }
.pol-panel__head { display: flex; align-items: center; gap: 10px; margin-block-end: 12px; }
.pol-panel__head h2 { font-size: 1.02rem; font-weight: 700; flex: 1; }
.pol-panel__head i.pol-panel__icon { color: var(--rz-primary); }
.pol-panel__hint { color: var(--pol-muted); font-size: .84rem; }
.pol-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.pol-split > aside { position: sticky; top: 12px; }
.pol-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* ---------- form ---------- */
.pol-field { display: flex; flex-direction: column; gap: 6px; margin-block-end: 14px; }
.pol-field > label, .pol-field > .pol-label { font-weight: 600; font-size: .9rem; color: var(--pol-text); }
.pol-req { color: var(--home-danger-text, #b42318); margin-inline-start: 3px; }
.pol-help { color: var(--pol-muted); font-size: .82rem; line-height: 1.5; }
.pol-error { color: var(--home-danger-text, #b42318); font-size: .82rem; }
.pol-opt-row { display: flex; align-items: center; gap: 8px; margin-block-end: 8px; }
.pol-opt-row__n { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; font-size: .82rem; font-weight: 700;
    background: var(--pol-surface-2); color: var(--pol-text-2); border: 1px solid var(--pol-border); }
.pol-opt-row .pol-input { flex: 1; }
.pol-icon-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; border: 1px solid transparent;
    background: transparent; color: var(--pol-muted); cursor: pointer; font-size: 1rem; }
.pol-icon-btn:hover:not([disabled]) { background: var(--home-hover, rgba(15,23,42,.05)); color: var(--pol-text); }
.pol-icon-btn[disabled] { opacity: .35; cursor: not-allowed; }
.pol-check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--pol-border);
    background: var(--pol-surface); cursor: pointer; margin-block-end: 8px; min-height: 44px; }
.pol-check input { width: 18px; height: 18px; margin-block-start: 2px; accent-color: var(--rz-primary); flex: none; }
.pol-check strong { display: block; font-size: .92rem; }
.pol-check small { color: var(--pol-muted); font-size: .8rem; }
.pol-form-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding-block-start: 6px; }

/* audience picker */
.pol-picker { border: 1px solid var(--pol-border); border-radius: 12px; overflow: hidden; }
.pol-picker__search { padding: 8px; border-block-end: 1px solid var(--pol-border); background: var(--pol-surface-2); }
.pol-picker__list { max-height: 300px; overflow-y: auto; }
.pol-picker__row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-height: 44px; cursor: pointer; border-block-end: 1px solid var(--pol-border); }
.pol-picker__row:last-child { border-block-end: 0; }
.pol-picker__row:hover { background: var(--home-hover, rgba(15,23,42,.04)); }
.pol-picker__row input { width: 18px; height: 18px; accent-color: var(--rz-primary); flex: none; }
.pol-picker__row small { color: var(--pol-muted); margin-inline-start: auto; font-size: .78rem; white-space: nowrap; }
.pol-picker__row.is-on { background: color-mix(in srgb, var(--rz-primary) 12%, transparent); }
.pol-tokens { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 8px; }
.pol-token { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; font-size: .84rem;
    background: color-mix(in srgb, var(--rz-primary) 12%, transparent); color: var(--rz-primary); }
.pol-token button { border: 0; background: transparent; color: inherit; cursor: pointer; width: 26px; height: 26px; border-radius: 50%; }
.pol-token button:hover { background: color-mix(in srgb, var(--rz-primary) 15%, transparent); }
.pol-count-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; font-weight: 600;
    background: color-mix(in srgb, var(--rz-primary) 12%, transparent); color: var(--rz-primary); }

/* preview */
.pol-preview { border-radius: 18px; border: 1px solid var(--pol-border); background: var(--pol-surface-2); padding: 14px; }
.pol-preview__label { font-size: .78rem; font-weight: 700; letter-spacing: .02em; color: var(--pol-muted); margin-block-end: 8px; display: flex; gap: 6px; align-items: center; }
.pol-preview .pol-ballot { background: var(--pol-surface); }

/* ---------- ballot (vote) ---------- */
.pol-ballot { border: 1px solid var(--pol-border); border-radius: var(--pol-radius); background: var(--pol-surface); padding: 16px; }
.pol-ballot__q { font-size: 1.08rem; font-weight: 700; line-height: 1.55; margin-block-end: 4px; overflow-wrap: anywhere; }
.pol-ballot__desc { color: var(--pol-text-2); font-size: .92rem; line-height: 1.7; margin-block-end: 10px; white-space: pre-line; }
.pol-ballot__rule { display: flex; flex-wrap: wrap; gap: 6px; margin-block-end: 12px; }
.pol-choices { display: flex; flex-direction: column; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.pol-choice { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 10px 14px; border-radius: 12px;
    border: 1.5px solid var(--pol-border); background: var(--pol-surface); cursor: pointer; transition: border-color .15s, background-color .15s; }
.pol-choice:hover { border-color: color-mix(in srgb, var(--rz-primary) 50%, var(--pol-border)); }
.pol-choice input { width: 20px; height: 20px; accent-color: var(--rz-primary); flex: none; margin: 0; }
.pol-choice span { flex: 1; line-height: 1.5; overflow-wrap: anywhere; }
.pol-choice.is-on { border-color: var(--rz-primary); background: color-mix(in srgb, var(--rz-primary) 12%, transparent); }
.pol-choice.is-disabled { cursor: default; opacity: .75; }
.pol-ballot__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-block-start: 14px; }
.pol-ballot__actions .pol-help { flex: 1 1 200px; }
.pol-voted { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; margin-block-end: 12px;
    background: color-mix(in srgb, var(--rz-primary) 12%, transparent); color: var(--rz-primary); font-weight: 600; font-size: .92rem; }

/* ---------- results ---------- */
.pol-results { display: flex; flex-direction: column; gap: 12px; }
.pol-result__top { display: flex; align-items: baseline; gap: 10px; margin-block-end: 6px; }
.pol-result__text { flex: 1; min-width: 0; font-weight: 600; font-size: .94rem; overflow-wrap: anywhere; }
.pol-result__text i { color: var(--rz-primary); margin-inline-end: 4px; }
.pol-result__val { font-variant-numeric: tabular-nums; color: var(--pol-text-2); font-size: .88rem; white-space: nowrap; }
.pol-result__val b { color: var(--pol-text); font-size: .98rem; }
.pol-result__bar { height: 12px; border-radius: 999px; background: var(--pol-surface-2); border: 1px solid var(--pol-border); overflow: hidden; }
.pol-result__bar span { display: block; height: 100%; border-radius: inherit; background: color-mix(in srgb, var(--rz-primary) 55%, transparent);
    transition: width .5s ease; }
.pol-result.is-top .pol-result__bar span { background: var(--rz-primary); }
.pol-result.is-mine .pol-result__text::after { content: attr(data-mine); margin-inline-start: 8px; font-size: .74rem; font-weight: 700;
    padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--rz-primary) 12%, transparent); color: var(--rz-primary); }
.pol-results__foot { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--pol-muted); font-size: .82rem; padding-block-start: 6px;
    border-block-start: 1px dashed var(--pol-border); }

/* ---------- KPIs + charts ---------- */
.pol-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; margin-block-end: 16px; }
.pol-kpi { padding: 14px; border-radius: var(--pol-radius); background: var(--pol-surface); border: 1px solid var(--pol-border);
    display: flex; flex-direction: column; gap: 4px; }
.pol-kpi__label { color: var(--pol-muted); font-size: .82rem; display: flex; align-items: center; gap: 6px; }
.pol-kpi__label i { color: var(--rz-primary); }
.pol-kpi__value { font-size: 1.6rem; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.pol-kpi__sub { color: var(--pol-muted); font-size: .78rem; }
.pol-charts { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px; margin-block-end: 14px; }
.pol-donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pol-donut svg { width: 150px; height: 150px; flex: none; }
.pol-donut__center { font-size: 22px; font-weight: 800; fill: var(--pol-text); }
.pol-donut__sub { font-size: 10px; fill: var(--pol-muted); }
.pol-legend { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; min-width: 140px; }
.pol-legend span { display: flex; align-items: center; gap: 8px; }
.pol-legend i.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.pol-legend b { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.pol-months { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-block-start: 10px; overflow-x: auto; }
.pol-month { flex: 1 0 34px; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.pol-month__bars { display: flex; align-items: flex-end; gap: 3px; height: 100%; width: 100%; justify-content: center; }
.pol-month__bars span { width: 40%; max-width: 16px; border-radius: 4px 4px 0 0; min-height: 2px; }
.pol-month__bars span.is-polls { background: var(--rz-primary); }
.pol-month__bars span.is-votes { background: var(--home-tone-amber, #d08a1c); }
.pol-month small { font-size: .7rem; color: var(--pol-muted); white-space: nowrap; }
.pol-list { display: flex; flex-direction: column; }
.pol-list__row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-block-end: 1px solid var(--pol-border); color: inherit; text-decoration: none; min-height: 44px; }
.pol-list__row:last-child { border-block-end: 0; }
.pol-list__row:hover .pol-list__title { color: var(--rz-primary); }
.pol-list__title { flex: 1; min-width: 0; font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pol-list__val { font-size: .82rem; color: var(--pol-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.pol-table-wrap { overflow-x: auto; border: 1px solid var(--pol-border); border-radius: 12px; }
.pol-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.pol-table th, .pol-table td { padding: 10px 12px; text-align: start; border-block-end: 1px solid var(--pol-border); vertical-align: middle; }
.pol-table th { background: var(--pol-surface-2); color: var(--pol-text-2); font-weight: 700; font-size: .8rem; white-space: nowrap; }
.pol-table tr:last-child td { border-block-end: 0; }
.pol-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* detail page */
.pol-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.pol-fact { display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.pol-fact small { color: var(--pol-muted); font-size: .78rem; }
.pol-actions-col { display: flex; flex-direction: column; gap: 8px; }
.pol-actions-col .pol-btn { justify-content: flex-start; }
.pol-timeline { list-style: none; margin: 0; padding: 0; }
.pol-timeline li { position: relative; padding-inline-start: 22px; padding-block: 6px 10px; font-size: .86rem; }
.pol-timeline li::before { content: ""; position: absolute; inset-inline-start: 5px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--rz-primary); }
.pol-timeline li::after { content: ""; position: absolute; inset-inline-start: 8px; top: 22px; bottom: -4px; width: 2px; background: var(--pol-border); }
.pol-timeline li:last-child::after { display: none; }
.pol-timeline small { display: block; color: var(--pol-muted); }

/* modal (reason / extend) */
.pol-modal { position: fixed; inset: 0; z-index: 1300; display: grid; place-items: center; padding: 16px; background: var(--home-scrim, rgba(15,23,42,.45)); }
.pol-modal__box { width: min(480px, 100%); background: var(--pol-surface); color: var(--pol-text); border-radius: 16px; padding: 18px;
    border: 1px solid var(--pol-border); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.pol-modal__box h3 { font-size: 1.05rem; margin-block-end: 8px; }

/* ---------- home widget ---------- */
.pol-hw {
    --pol-surface: var(--home-surface, #fff); --pol-surface-2: var(--home-surface-2, #f6f8fb); --pol-border: var(--home-border, #e3e8ef);
    --pol-text: var(--home-text, #1d2433); --pol-text-2: var(--home-text-2, #4a5568); --pol-muted: var(--home-text-muted, #5f6b7a);
    --pol-radius: 14px; color: var(--pol-text);
    background: var(--pol-surface); border: 1px solid var(--pol-border); border-radius: 16px; padding: 14px; margin-block: 12px;
    box-shadow: var(--home-shadow, 0 1px 2px rgba(16,24,40,.06)); }
.pol-hw__head { display: flex; align-items: center; gap: 10px; margin-block-end: 10px; }
.pol-hw__icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--rz-primary) 12%, transparent); color: var(--rz-primary); flex: none; }
.pol-hw__title { flex: 1; min-width: 0; }
.pol-hw__title strong { display: block; font-size: .98rem; }
.pol-hw__title small { color: var(--pol-muted); font-size: .78rem; }
.pol-hw__q { font-weight: 700; font-size: .95rem; line-height: 1.55; margin-block: 2px 4px; overflow-wrap: anywhere; }
.pol-hw__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-block-end: 10px; }
.pol-hw__meta[hidden] { display: none; }
.pol-hw .pol-choice { min-height: 44px; padding: 8px 12px; font-size: .9rem; }
.pol-hw .pol-results { gap: 9px; }
.pol-hw .pol-result__text { font-size: .86rem; }
.pol-hw__more { display: flex; flex-direction: column; margin-block-start: 10px; border-block-start: 1px solid var(--pol-border); }
.pol-hw__foot { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 12px; }
.pol-hw__foot .pol-btn { flex: 1 1 auto; }
.pol-hw--mobile { margin: 14px 16px; border-radius: 18px; }

/* ---------- mobile ---------- */
@media (max-width: 1024px) {
    .pol-split { grid-template-columns: minmax(0, 1fr); }
    .pol-split > aside { position: static; }
    .pol-charts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
    .pol-root { padding: 12px 14px 96px; }
    .pol-nav { display: none; }
    .pol-head { gap: 10px; }
    .pol-head__icon { width: 42px; height: 42px; }
    .pol-head.is-mobile-hidden { display: none; }
    .pol-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .pol-cols, .pol-facts { grid-template-columns: minmax(0, 1fr); }
    .pol-btn { min-height: 44px; }
    .pol-tab { min-height: 44px; }
    .pol-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pol-kpi__value { font-size: 1.35rem; }
    .pol-toolbar .pol-select { flex: 1 1 140px; }
    .pol-sticky { position: sticky; bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); z-index: 5; padding: 10px; margin-inline: -4px;
        background: color-mix(in srgb, var(--pol-surface) 92%, transparent); backdrop-filter: blur(8px);
        border: 1px solid var(--pol-border); border-radius: 14px; box-shadow: 0 8px 24px rgba(16,24,40,.12); }
    .pol-sticky .pol-btn { flex: 1; }
    .pol-modal { place-items: end center; padding: 0; }
    .pol-modal__box { border-radius: 18px 18px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
    .pol-skel { animation: none; }
    .pol-btn, .pol-card, .pol-choice, .pol-result__bar span { transition: none; }
}

@media print {
    .pol-nav, .pol-head__actions, .pol-toolbar, .pol-tabs, .pol-no-print, .pol-hw__foot { display: none !important; }
    .pol-root { max-width: none; padding: 0; color: #000; }
    .pol-panel, .pol-card, .pol-kpi { box-shadow: none; break-inside: avoid; border-color: #bbb; background: #fff; }
}
