/* Polls (structured question types): the advisor's control, an advisor's given answer, and the results chart.
   Shared by the Frank site and Frank Management (served at /_content/Frank.Shared/interactions.css). Uses each
   site's colours where it has them (--brand, --line, --muted), with Frank's own as the fallback. */

.ix { --ix-brand: var(--brand, var(--green, #467e53)); --ix-line: var(--line, #e2e6e3); --ix-muted: var(--muted, #5f6368);
      --ix-soft: var(--brand-soft, #eef4ef); margin: 16px 0; padding: 14px 18px 16px; border: 1px solid var(--ix-line);
      border-left: 4px solid var(--ix-brand); border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); min-width: 0; }
.ix-kicker { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: .72rem; font-weight: 700; letter-spacing: .08em;
             text-transform: uppercase; color: var(--ix-brand); }
.ix-kicker-icon { width: 13px; height: 13px; fill: currentColor; }
.ix-instruction { margin: 0 0 12px; font-size: 1rem; font-weight: 600; color: var(--ink, #1d1d1f); }
.ix-errors { margin: 0 0 10px; padding: 8px 12px 8px 28px; border-radius: 8px; background: #fdecea; color: #b3261e; font-size: .9rem; }
.ix.has-errors { border-color: #e8a19b; }
.ix :focus-visible { outline: 3px solid rgba(70, 126, 83, .45); outline-offset: 2px; }

/* Choices: big targets for touch; one allowed = radio buttons */
.ix-options { display: grid; gap: 8px; }
.ix-option { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 12px; min-height: 44px; border: 1px solid var(--ix-line);
             border-radius: 8px; background: #fff; cursor: pointer; font-weight: 400; line-height: 1.4; }
.ix-option input { flex-shrink: 0; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ix-brand); }
.ix-option { transition: border-color .12s, background-color .12s, box-shadow .12s; }
.ix-option:hover { border-color: var(--ix-brand); background: #fafcfa; }
.ix-option:has(input:checked) { border-color: var(--ix-brand); background: var(--ix-soft); box-shadow: inset 0 0 0 1px var(--ix-brand); }
.ix-option:has(input:checked) > span { font-weight: 600; }
.ix-option:has(input:focus-visible) { outline: 3px solid rgba(70, 126, 83, .45); outline-offset: 2px; }
.ix-yesno { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ix-count { margin: 8px 0 0; font-size: .85rem; color: var(--ix-muted); }
.ix-count:empty { margin: 0; }
.ix-count.is-warning { color: #b3261e; }

/* Sliders */
.ix-slider { display: grid; gap: 6px; }
.ix-scale { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; color: #3c4043; }
.ix-scale > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ix-scale .ix-mid { text-align: center; }
.ix-scale .ix-right { text-align: right; }
.ix-number { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: .85rem; font-weight: 400; color: var(--ix-muted); }
.ix-number-field { display: inline-flex; align-items: center; gap: 6px; }
.ix-number input { width: 8.5em; padding: 7px 10px; font: inherit; font-size: 1rem; color: inherit; border: 1px solid #c9d0cb; border-radius: 8px; background: #fff; }
.ix-unit { font-weight: 600; color: #3c4043; }
.ix-js .ix-number.is-label-slider { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
/* the scale's labels sit under the track, where the handle points at them */
.ix-js .ix-slider .ix-range-holder { order: 1; }
.ix-js .ix-slider .ix-scale { order: 2; margin-top: -6px; }
.ix-js .ix-slider .ix-number { order: 3; }
.ix-js .ix-slider .ix-readout { order: 4; }
.ix-readout { margin: 2px 0 0; font-size: .9rem; color: var(--ix-muted); min-height: 1.3em; }
.ix-readout.is-set { font-weight: 600; color: var(--ix-brand); }

/* Likert scale: numbered points on a track (radio buttons underneath), the chosen one filled in the brand colour */
.ix-likert { display: grid; gap: 6px; }
.ix-likert-points { position: relative; display: flex; justify-content: space-between; gap: 4px; padding: 4px 0; }
.ix-likert-points::before { content: ''; position: absolute; left: 22px; right: 22px; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: #dfe4e0; }
.ix-point { position: relative; flex: 1 1 0; min-width: 0; display: grid; place-items: center; margin: 0; cursor: pointer; }
.ix-point input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ix-point-dot { display: grid; place-items: center; width: 100%; max-width: 44px; aspect-ratio: 1; border-radius: 50%; border: 2px solid #c9d0cb; background: #fff;
                color: #3c4043; font-weight: 700; font-size: .95rem; transition: background .12s, border-color .12s, transform .12s; }
.ix-point:hover .ix-point-dot { border-color: var(--ix-brand); }
.ix-point input:checked + .ix-point-dot { background: var(--ix-brand); border-color: var(--ix-brand); color: #fff; transform: scale(1.08); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.ix-point input:focus-visible + .ix-point-dot { outline: 3px solid rgba(70, 126, 83, .45); outline-offset: 2px; }
.ix-likert-labels { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; font-size: .85rem; color: #3c4043; }
.ix-likert-labels .ix-mid { text-align: center; }
.ix-likert-labels .ix-right { text-align: right; }
/* Narrow screens: the dots shrink to share the width (each point takes an equal part) */
@media (max-width: 520px) { .ix-point-dot { font-size: .8rem; } }
@media (prefers-reduced-motion: reduce) { .ix-point-dot { transition: none; } }

/* Ranking: plain place boxes without JavaScript; a reorderable list with it */
.ix-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ix-rank-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-height: 48px; border: 1px solid var(--ix-line); border-radius: 8px; background: #fff; touch-action: pan-y; }
.ix-rank-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ix-rank-select select { padding: 6px 8px; font: inherit; border: 1px solid #c9d0cb; border-radius: 8px; background: #fff; }
.ix-js .ix-rank-select { display: none; }
.ix-rank-num { flex-shrink: 0; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ix-soft); color: var(--ix-brand); font-weight: 700; }
.ix-rank.is-unconfirmed .ix-rank-num { background: none; border: 2px dashed #cfd6d1; }
.ix-rank-handle { flex-shrink: 0; width: 28px; height: 36px; border: 0; background: none; color: #9aa0a6; cursor: grab; font-size: 1.1rem; touch-action: none; }
.ix-rank-item.is-dragging { box-shadow: 0 6px 18px rgba(0, 0, 0, .15); border-color: var(--ix-brand); position: relative; z-index: 2; }
.ix-rank-moves { display: inline-flex; gap: 4px; }
.ix-rank-moves button, .ix-rank-confirm { min-width: 40px; height: 40px; border: 1px solid var(--ix-line); border-radius: 8px; background: #fff; color: #3c4043; font: 600 .95rem inherit; cursor: pointer; }
.ix-rank-moves button:hover, .ix-rank-confirm:hover { border-color: var(--ix-brand); color: var(--ix-brand); }
.ix-rank-moves button:disabled { opacity: .35; cursor: default; }
.ix-rank-moves button { display: inline-grid; place-items: center; padding: 0; }
.ix-rank-moves svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ix-rank-status { margin: 8px 0 0; font-size: .88rem; color: var(--ix-muted); }
.ix-rank-confirm { height: auto; padding: 8px 14px; margin-top: 8px; font-family: inherit; }

/* Unable to answer */
.ix-unable { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 0; padding-top: 10px; border-top: 1px dashed var(--ix-line); font-weight: 400; cursor: pointer; }
.ix-unable input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ix-brand); }
.ix-hint { color: var(--ix-muted); font-size: .85rem; }
.ix.is-unable .ix-body { opacity: .4; }

/* An advisor's given answer, shown with their written response */
.ix-given { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 4px; }
.ix-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft, #eef4ef);
           color: var(--brand, #3a6a45); font-size: .85rem; font-weight: 600; }
.ix-chip.is-unable { background: #f0f1f2; color: #5f6368; }
.ix-chip.is-value { font-size: .95rem; }
.ix-mini { display: inline-grid; gap: 2px; width: min(220px, 100%); }
.ix-mini-track { display: block; width: 100%; height: 12px; }
.ix-mini-line { stroke: #cfd6d1; stroke-width: 2; }
.ix-mini-dot { stroke: var(--brand, #467e53); stroke-width: 4; stroke-linecap: round; }
.ix-mini-labels { display: flex; justify-content: space-between; gap: 4px; font-size: .68rem; color: #5f6368; }
.ix-mini-labels span { max-width: 33%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ix-ranked { margin: 0; padding-left: 1.4em; font-size: .9rem; }
.ix-ranked li { margin: 1px 0; }

/* Results */
.ix-results { margin: 16px 0; padding: 14px 18px 16px; border: 1px solid var(--line, #e2e6e3); border-top: 3px solid var(--brand, #467e53);
               border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); }
.ix-results-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 12px; font-size: .9rem; color: #5f6368; }
.ix-results-head strong { color: var(--blue, #065fa0); font-family: var(--serif, Georgia, serif); font-weight: 400; font-size: 1.05rem; }
.ix-results-none { margin: 0; color: #5f6368; }
.ix-results-note { margin: 8px 0 0; font-size: .8rem; color: #5f6368; }
.ix-results-unable { margin: 8px 0 0; font-size: .85rem; font-weight: 600; color: #5f6368; }
.ix-bars { width: 100%; border-collapse: collapse; }
.ix-bars th, .ix-bars td { padding: 5px 0; vertical-align: middle; }
.ix-bar-label { width: 38%; padding-right: 12px !important; text-align: left; font-weight: 400; font-size: .9rem; overflow-wrap: anywhere; }
.ix-bar-cell { display: flex; align-items: center; gap: 8px; }
.ix-bar { flex: 1; height: 18px; min-width: 40px; }
.ix-bar-bg { fill: #eef1ef; }
.ix-bar-fill { fill: var(--brand, #467e53); opacity: .6; }
.ix-bar-fill.is-most { opacity: 1; }   /* the most chosen option (or options, when tied) */
.ix-bar-count { min-width: 2em; font-weight: 700; font-size: .9rem; text-align: right; }
@media (max-width: 520px) {
    .ix-bars tr { display: grid; grid-template-columns: 1fr; }
    .ix-bar-label { width: auto; padding-right: 0 !important; }
}
.ix-hist { display: grid; gap: 4px; }
.ix-hist-bars { width: 100%; height: 90px; }
.ix-hist-fill { fill: var(--brand, #467e53); opacity: .6; }
.ix-hist-fill.is-most { opacity: 1; }   /* the most common part of the scale */
.ix-hist-axis { stroke: #b8bfb9; stroke-width: 1; }
.ix-hist-counts { display: grid; font-size: .78rem; font-weight: 700; text-align: center; }
.ix-hist-ticks { font-weight: 400; color: #5f6368; }
.ix-cols-2 { grid-template-columns: repeat(2, 1fr); } .ix-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ix-cols-4 { grid-template-columns: repeat(4, 1fr); } .ix-cols-5 { grid-template-columns: repeat(5, 1fr); }
.ix-cols-6 { grid-template-columns: repeat(6, 1fr); } .ix-cols-7 { grid-template-columns: repeat(7, 1fr); }
.ix-cols-8 { grid-template-columns: repeat(8, 1fr); } .ix-cols-9 { grid-template-columns: repeat(9, 1fr); }
.ix-cols-10 { grid-template-columns: repeat(10, 1fr); } .ix-cols-11 { grid-template-columns: repeat(11, 1fr); }
.ix-cols-12 { grid-template-columns: repeat(12, 1fr); }
.ix-rank-table-wrap { overflow-x: auto; }
.ix-rank-table { border-collapse: collapse; font-size: .88rem; min-width: 100%; }
.ix-rank-table th, .ix-rank-table td { padding: 6px 8px; border-bottom: 1px solid #eef1ef; text-align: center; }
.ix-rank-table th[scope="row"] { text-align: left; font-weight: 400; overflow-wrap: anywhere; min-width: 8em; }
.ix-rank-table thead th { font-size: .78rem; color: #5f6368; font-weight: 600; }
.ix-rank-table .ix-first { font-weight: 700; }
.ix-rank-table .is-top { background: #fff4b3; }
.ix-rank-table .is-zero { color: #b8bfb9; }
.ix-rank-table .ix-mean { color: #5f6368; }

/* Frank Management's phone-width preview frame */
.ix-preview-phone { width: 375px; max-width: 100%; margin: 0 auto; padding: 16px; border: 10px solid #1f2a23; border-radius: 28px; background: #fbfbfb; }

@media print {
    .ix-results { break-inside: avoid; }
    .ix-bar-fill, .ix-hist-fill { fill: #467e53; }
}

/* The slider, drawn the same in every browser: a plain track (no coloured fill, so no position is implied) and a
   round handle, which isn't shown until the advisor has set a position */
.ix-range { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; margin: 4px 0; background: transparent; cursor: pointer; }
.ix-range::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: #dfe4e0; }
.ix-range::-moz-range-track { height: 8px; border-radius: 4px; background: #dfe4e0; }
/* a three-label slider: a mark at the middle label (the handle's centre is there at 50) */
.ix-labelslider .ix-range::-webkit-slider-runnable-track { background: linear-gradient(to right, transparent calc(50% - 1px), #a9b2ab calc(50% - 1px), #a9b2ab calc(50% + 1px), transparent calc(50% + 1px)), #dfe4e0; }
.ix-labelslider .ix-range::-moz-range-track { background: linear-gradient(to right, transparent calc(50% - 1px), #a9b2ab calc(50% - 1px), #a9b2ab calc(50% + 1px), transparent calc(50% + 1px)), #dfe4e0; }
.ix-range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%;
                                  background: var(--ix-brand); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.ix-range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--ix-brand); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.ix-range:focus-visible { outline: none; }
.ix-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(70, 126, 83, .45); }
.ix-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(70, 126, 83, .45); }
.ix-range.is-unset::-webkit-slider-thumb { opacity: 0; }
.ix-range.is-unset::-moz-range-thumb { opacity: 0; }
.ix-range.is-unset:focus-visible { outline: 3px solid rgba(70, 126, 83, .45); outline-offset: 2px; border-radius: 6px; }
.ix-rank-table thead th:first-child { text-align: left; }


/* Dark mode: both sites put data-theme="dark" (or "light") on <html> when the person has chosen; otherwise the
   computer's setting decides. Colours come from the site's own variables where it has them. */
:root[data-theme="dark"] .ix, :root[data-theme="dark"] .ix-results, :root[data-theme="dark"] .ix-option, :root[data-theme="dark"] .ix-rank-item, :root[data-theme="dark"] .ix-rank-moves button, :root[data-theme="dark"] .ix-rank-confirm, :root[data-theme="dark"] .ix-rank-select select, :root[data-theme="dark"] .ix-number input { background: var(--card, #1a201c); color: var(--ink, #e6ebe7); }
:root[data-theme="dark"] .ix-option:hover { background: var(--tint, #1e2521); }
:root[data-theme="dark"] .ix { --ix-soft: var(--green-soft, #1f2e24); }
:root[data-theme="dark"] .ix-errors { background: #3a1d1b; color: #f08a80; }
:root[data-theme="dark"] .ix.has-errors { border-color: #5c2a26; }
:root[data-theme="dark"] .ix-scale, :root[data-theme="dark"] .ix-unit, :root[data-theme="dark"] .ix-likert-labels, :root[data-theme="dark"] .ix-point-dot, :root[data-theme="dark"] .ix-rank-moves button, :root[data-theme="dark"] .ix-rank-confirm { color: #c9d1cb; }
:root[data-theme="dark"] .ix-number input, :root[data-theme="dark"] .ix-point-dot, :root[data-theme="dark"] .ix-rank-select select { border-color: #3d4842; }
:root[data-theme="dark"] .ix-point-dot { background: var(--card, #1a201c); }
:root[data-theme="dark"] .ix-rank.is-unconfirmed .ix-rank-num { border-color: #3d4842; }
:root[data-theme="dark"] .ix-rank-handle { color: #7d8781; }
:root[data-theme="dark"] .ix-chip { background: var(--green-soft, #1f2e24); color: #a9d6b4; }
:root[data-theme="dark"] .ix-chip.is-unable { background: #232a26; color: #a3ada6; }
:root[data-theme="dark"] .ix-mini-line { stroke: #3d4842; }
:root[data-theme="dark"] .ix-mini-labels, :root[data-theme="dark"] .ix-results-none, :root[data-theme="dark"] .ix-results-note, :root[data-theme="dark"] .ix-results-unable, :root[data-theme="dark"] .ix-hist-ticks, :root[data-theme="dark"] .ix-rank-table thead th, :root[data-theme="dark"] .ix-rank-table .ix-mean { color: #a3ada6; }
:root[data-theme="dark"] .ix-bar-bg { fill: #26302a; }
:root[data-theme="dark"] .ix-bar-fill, :root[data-theme="dark"] .ix-hist-fill { opacity: .85; }
:root[data-theme="dark"] .ix-hist-axis { stroke: #4a554e; }
:root[data-theme="dark"] .ix-rank-table th, :root[data-theme="dark"] .ix-rank-table td { border-bottom-color: #2d3631; }
:root[data-theme="dark"] .ix-rank-table .is-top { background: #3d3512; }
:root[data-theme="dark"] .ix-rank-table .is-zero { color: #5d6862; }
:root[data-theme="dark"] .ix-preview-phone { background: var(--bg, #121614); border-color: #0b0e0c; }
:root[data-theme="dark"] .ix-range::-webkit-slider-runnable-track { background: #2d3631; }
:root[data-theme="dark"] .ix-range::-moz-range-track { background: #2d3631; }
:root[data-theme="dark"] .ix-range::-webkit-slider-thumb { border-color: #1a201c; }
:root[data-theme="dark"] .ix-range::-moz-range-thumb { border-color: #1a201c; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .ix, :root:not([data-theme="light"]) .ix-results, :root:not([data-theme="light"]) .ix-option, :root:not([data-theme="light"]) .ix-rank-item, :root:not([data-theme="light"]) .ix-rank-moves button, :root:not([data-theme="light"]) .ix-rank-confirm, :root:not([data-theme="light"]) .ix-rank-select select, :root:not([data-theme="light"]) .ix-number input { background: var(--card, #1a201c); color: var(--ink, #e6ebe7); }
    :root:not([data-theme="light"]) .ix-option:hover { background: var(--tint, #1e2521); }
    :root:not([data-theme="light"]) .ix { --ix-soft: var(--green-soft, #1f2e24); }
    :root:not([data-theme="light"]) .ix-errors { background: #3a1d1b; color: #f08a80; }
    :root:not([data-theme="light"]) .ix.has-errors { border-color: #5c2a26; }
    :root:not([data-theme="light"]) .ix-scale, :root:not([data-theme="light"]) .ix-unit, :root:not([data-theme="light"]) .ix-likert-labels, :root:not([data-theme="light"]) .ix-point-dot, :root:not([data-theme="light"]) .ix-rank-moves button, :root:not([data-theme="light"]) .ix-rank-confirm { color: #c9d1cb; }
    :root:not([data-theme="light"]) .ix-number input, :root:not([data-theme="light"]) .ix-point-dot, :root:not([data-theme="light"]) .ix-rank-select select { border-color: #3d4842; }
    :root:not([data-theme="light"]) .ix-point-dot { background: var(--card, #1a201c); }
    :root:not([data-theme="light"]) .ix-rank.is-unconfirmed .ix-rank-num { border-color: #3d4842; }
    :root:not([data-theme="light"]) .ix-rank-handle { color: #7d8781; }
    :root:not([data-theme="light"]) .ix-chip { background: var(--green-soft, #1f2e24); color: #a9d6b4; }
    :root:not([data-theme="light"]) .ix-chip.is-unable { background: #232a26; color: #a3ada6; }
    :root:not([data-theme="light"]) .ix-mini-line { stroke: #3d4842; }
    :root:not([data-theme="light"]) .ix-mini-labels, :root:not([data-theme="light"]) .ix-results-none, :root:not([data-theme="light"]) .ix-results-note, :root:not([data-theme="light"]) .ix-results-unable, :root:not([data-theme="light"]) .ix-hist-ticks, :root:not([data-theme="light"]) .ix-rank-table thead th, :root:not([data-theme="light"]) .ix-rank-table .ix-mean { color: #a3ada6; }
    :root:not([data-theme="light"]) .ix-bar-bg { fill: #26302a; }
    :root:not([data-theme="light"]) .ix-bar-fill, :root:not([data-theme="light"]) .ix-hist-fill { opacity: .85; }
    :root:not([data-theme="light"]) .ix-hist-axis { stroke: #4a554e; }
    :root:not([data-theme="light"]) .ix-rank-table th, :root:not([data-theme="light"]) .ix-rank-table td { border-bottom-color: #2d3631; }
    :root:not([data-theme="light"]) .ix-rank-table .is-top { background: #3d3512; }
    :root:not([data-theme="light"]) .ix-rank-table .is-zero { color: #5d6862; }
    :root:not([data-theme="light"]) .ix-preview-phone { background: var(--bg, #121614); border-color: #0b0e0c; }
    :root:not([data-theme="light"]) .ix-range::-webkit-slider-runnable-track { background: #2d3631; }
    :root:not([data-theme="light"]) .ix-range::-moz-range-track { background: #2d3631; }
    :root:not([data-theme="light"]) .ix-range::-webkit-slider-thumb { border-color: #1a201c; }
    :root:not([data-theme="light"]) .ix-range::-moz-range-thumb { border-color: #1a201c; }
}
