/* Smart Scholars — polish layer, 25 Sep 2026. The same file on every property, loaded after the site's
   own stylesheet. It uses the house tokens only (--ink, --ink-2, --card, --line, --saffron, --navy) plus
   transparent black/white overlays, so no colour and no typeface changes anywhere. */

/* ---- 1 · words and numbers read dark. Grey helper text used opacity or light greys in places; every
        helper line, note, table heading and caption now sits on the house ink tokens. */
.muted, .small.muted, small.muted, .note, .kpi-sub, td small, th small, .card p.small, .ts-tbl .note, .help, .hint-line,
.ss-map-head span, .ss-map-note, .ss-map-col li span { color: var(--ink-2, #4A3529); opacity: 1; }
table th, .tbl th, .dd-tbl th, .ts-tbl th, .doi-tbl th { color: var(--ink, #0A0908); }
.card .small.muted.kpi-label, .card .small.muted.label, .kpi .card > .small.muted:first-child { color: var(--ink-2, #4A3529); }
.badge { font-weight: 700; }
input::placeholder, textarea::placeholder { color: var(--ink-2, #4A3529); opacity: .75; }

/* ---- 2 · a count at the end of a button is an embossed pill (added by polish.js) */
.btn .nbadge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.75em; height: 1.75em; padding: 0 .5em; margin-left: .35em;
  border-radius: 999px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
  background: rgba(255,255,255,.24); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 1px 2px rgba(0,0,0,.28); }
.btn-outline .nbadge, .btn.btn-outline .nbadge, .fbar a .nbadge { background: rgba(10,9,8,.09); box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 1px 2px rgba(0,0,0,.14); }
.fbar a .nbadge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.75em; height: 1.75em; padding: 0 .5em; margin-left: .2em; border-radius: 999px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.fbar a.on .nbadge { background: rgba(255,255,255,.22); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 1px 2px rgba(0,0,0,.3); }

/* ---- 3 · the big number on a tile: embossed, and it counts up on arrival (polish.js) */
.kpi .card > strong, .stat > strong, .hero-stats strong, .tile-num { text-shadow: 0 1px 0 rgba(255,255,255,.75), 0 -1px 0 rgba(10,9,8,.12); }
.tile-num { font-size: 1.6rem; display: inline-block; font-variant-numeric: tabular-nums; }   /* the number on a GetIndexed / Journal Audit tile */
.ss-counting { transition: none; }
.ss-counted { animation: ss-settle .45s ease-out; }
@keyframes ss-settle { 0% { transform: scale(1.06); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .ss-counted { animation: none; } }

/* ---- 4 · the "what this does" dialog */
.ss-ask-back { position: fixed; inset: 0; z-index: 9998; background: rgba(10,9,8,.46); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ss-ask { width: 100%; max-width: 580px; background: var(--card, #FFF3E6); color: var(--ink, #0A0908); border: 1px solid var(--line, #E3BC9A); border-radius: 18px;
  padding: 22px 24px 18px; box-shadow: 0 24px 64px rgba(14,31,61,.38), inset 0 1px 0 #fff; font-family: var(--font); }
.ss-ask h3 { font-family: var(--display); font-size: 1.25rem; margin: 0 0 8px; letter-spacing: -.01em; }
.ss-ask p { margin: 0 0 8px; font-size: .92rem; line-height: 1.55; }
.ss-ask .ss-ask-what { background: #fff; border: 1px solid var(--line, #E3BC9A); border-radius: 12px; padding: 10px 14px; margin: 10px 0 6px; font-size: .9rem; line-height: 1.55;
  box-shadow: inset 0 1px 2px rgba(10,9,8,.06); }
.ss-ask .ss-ask-undo { color: var(--ink-2, #4A3529); font-size: .85rem; }
.ss-ask .ss-ask-btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
body.ss-ask-open { overflow: hidden; }

/* ---- 5 · a title= shown on keyboard focus */
.ss-tip { position: absolute; z-index: 9997; max-width: 320px; background: var(--ink, #0A0908); color: #fff; font-family: var(--font); font-size: .78rem; line-height: 1.45;
  padding: 7px 10px; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.25); pointer-events: none; }

/* ---- 6 · card carousel: three across, arrows, snap */
.ss-carousel { position: relative; padding: 0 44px; }
.ss-car-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 36px) / 3); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 12px 4px 16px; scrollbar-width: thin; scrollbar-color: var(--line, #E3BC9A) transparent; }
.ss-car-track::-webkit-scrollbar { height: 8px; } .ss-car-track::-webkit-scrollbar-thumb { background: var(--line, #E3BC9A); border-radius: 999px; }
.ss-car-item { scroll-snap-align: start; min-width: 0; display: flex; }
.ss-car-item > .card { flex: 1 1 auto; height: auto; min-height: 0; box-sizing: border-box; }   /* every card in the row is the same height */
.ss-car-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line, #E3BC9A);
  background: var(--card, #FFF3E6); color: var(--ink, #0A0908); font-family: var(--font); font-size: 1rem; font-weight: 700; cursor: pointer;
  box-shadow: inset 0 1px 0 #fff, 0 4px 12px rgba(14,31,61,.18); transition: transform .15s, box-shadow .15s; }
.ss-car-prev { left: 0; } .ss-car-next { right: 0; }
.ss-car-btn:hover:not(:disabled) { transform: translateY(-50%) scale(1.06); box-shadow: inset 0 1px 0 #fff, 0 8px 18px rgba(14,31,61,.24); }
.ss-car-btn:disabled { opacity: .35; cursor: default; }
@media (max-width: 900px) { .ss-car-track { grid-auto-columns: calc((100% - 18px) / 2); } }
@media (max-width: 600px) { .ss-car-track { grid-auto-columns: 88%; } .ss-carousel { padding: 0 34px; } .ss-car-btn { width: 32px; height: 32px; } }

/* ---- 7 · the same box for every card and table box: one radius, one border, one shadow */
.card, .tbl-wrap { border-radius: var(--radius, 14px); }
.tbl-wrap { border: 1px solid var(--line, #E3BC9A); background: #fff; box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgba(14,31,61,.06); }
.tbl-wrap table { margin: 0; }
.card .tbl-wrap { margin-top: 8px; }

/* ---- 7b · a button inside a table cell keeps its words on one line (the cell wraps between buttons instead);
        a page that wants a two-line button says so itself (.rv-tbl on the audit review) */
.tbl td .btn:not(.btn-block) { white-space: nowrap; }

/* ---- 8 · the "← Back" that every service page carries in its toolbar (added in PHP), one look */
.toolbar .btn-back { font-weight: 700; }

/* ---- 9 · names some pages used for the same three states, mapped onto the house tokens */
:root { --green: var(--ok); --amber: var(--warn); --red: var(--bad); --navy2: var(--navy-2, var(--navy)); }

/* ---- 10 · the logo: the mobile app's icon, the same on every header, footer, favicon and admin page */
img.brand-logo, .brand img { width: 40px; height: 40px; border-radius: 10px; background: none !important; border: 0 !important; padding: 0; display: block; object-fit: contain;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 4px 9px -3px rgba(90,45,15,.7); }
.site-footer img.brand-logo, .ftr img.brand-logo { width: 36px; height: 36px; border-radius: 9px; }

/* ---- 11 · a wide table on a phone (every table of four or more columns) or on a tablet (only one that does not
        fit its box): each row is a card, each cell carries its column heading (polish.js adds .ss-stack and
        data-label; a wider window removes them and the table is a table again) */
@media (max-width: 899px) {
  table.ss-stack, table.ss-stack tbody, table.ss-stack tr, table.ss-stack td { display: block; width: 100% !important; min-width: 0 !important; max-width: none !important; box-sizing: border-box; table-layout: auto; }
  table.ss-stack thead, table.ss-stack tr:has(> th):not(:has(> td)), table.ss-stack colgroup { display: none; }
  table.ss-stack tr { border: 1px solid var(--line, #E3BC9A); border-radius: 12px; margin: 0 0 10px; padding: 6px 12px; background: #fff;
    box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgba(14,31,61,.06); }
  table.ss-stack td { border: 0 !important; padding: 6px 0 !important; position: static !important; min-width: 0 !important; max-width: none !important; width: auto !important;
    display: flex; flex-wrap: wrap; gap: 3px 10px; align-items: baseline; text-align: left !important; white-space: normal; overflow-wrap: anywhere !important; }   /* !important: an admin table's own break-word (.adm-main .tbl td) outranked it, and a long web address ran out of the card (25 Sep 2026) */
  table.ss-stack td + td { border-top: 1px solid rgba(10,9,8,.06) !important; }
  table.ss-stack td::before { content: attr(data-label); flex: 0 0 auto; min-width: 82px; font-size: .64rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2, #4A3529); }
  table.ss-stack td[data-label=""]::before { display: none; }
  table.ss-stack td:empty, table.ss-stack td:not([data-label=""]):not(:has(*)):-moz-only-whitespace { display: none; }
  table.ss-stack td .btn { margin: 2px 4px 2px 0; white-space: normal; }
  table.ss-stack td > *, table.ss-stack td .acts, table.ss-stack td form { min-width: 0; max-width: 100%; flex-wrap: wrap; }
  table.ss-stack td input[type=checkbox] { width: 18px; height: 18px; }
  .tbl-wrap:has(> table.ss-stack) { overflow: visible; border: 0; background: none; box-shadow: none; }
}

/* ---- 12 · phones and tablets: nothing may be wider than the screen. On a phone Chrome widens the whole layout to
        the widest element and the WhatsApp / Ask AI buttons go off the right edge with it ("bots going to side").
        Every grid column may shrink below its content, long addresses and e-mails break, and the footer stacks. */
.grid-2 > *, .grid-3 > *, .grid-4 > *, .grid2 > *, .grid3 > *, .grid4 > *, .footer-grid > *, .kpi > *, .two > *, .hero-grid > * { min-width: 0; }
.footer-grid a, .footer-grid p, .footer-grid span, .footer-bottom span, .site-footer a, .ftr a { overflow-wrap: anywhere; }
pre, code, kbd { overflow-wrap: anywhere; white-space: pre-wrap; }
img, svg, video, iframe { max-width: 100%; }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr !important; gap: 22px; } }
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4, .grid2, .grid3, .grid4, .kpi, .two, .hero-grid, .ts-cols, .meta-grid, .tpl-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .meta-grid, .tpl-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
  .container, .wrap { padding-left: 16px; padding-right: 16px; }
  body { overflow-wrap: break-word; }
  .fbar, .toolbar { flex-wrap: wrap; }
  .ss-fab { right: 12px; bottom: 12px; }
  .card-head > *, .card-head { min-width: 0; }
  .card small, .card .small, .card .muted, .alert, .note { overflow-wrap: anywhere; }
  .fbar a, .fbar .btn { white-space: normal; }                                   /* a long filter label wraps instead of widening the page */
  .brand { flex: 1 1 auto; min-width: 0; white-space: normal; }                  /* the masthead wordmark and its line may wrap */
  .brand strong, .brand small { white-space: normal; }
  .report-head, .page-head .container > div { grid-template-columns: minmax(0, 1fr) !important; flex-wrap: wrap; }
  .kv, dl.kv { grid-template-columns: minmax(0, 1fr) !important; }               /* label above value */
  .kv dt { margin-top: 6px; }
  .kv dd, dd { overflow-wrap: anywhere; min-width: 0; }
}
@media (max-width: 900px) {
  a, .btn { overflow-wrap: anywhere; }                                            /* a web address in a link never runs off the screen */
  .btn { white-space: normal; }
  input, select, textarea { max-width: 100%; min-width: 0; box-sizing: border-box; }
  .toolbar, .actions, .btn-row { flex-wrap: wrap; }
}


/* 6  The eye on every password field (25 Sep 2026) — polish.js wraps the field and adds the button. */
.pw-wrap{position:relative;display:block}
.pw-wrap.pw-inline{display:inline-block}
.pw-wrap > input{padding-right:46px!important;width:100%}
.pw-wrap.pw-inline > input{width:auto}
.pw-eye{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:36px;height:36px;padding:0;margin:0;border:0;border-radius:8px;
  display:inline-flex;align-items:center;justify-content:center;background:transparent;color:#8B4513;cursor:pointer;box-shadow:none}
.pw-eye:hover{background:rgba(210,105,30,.12);color:#D2691E}
.pw-eye:focus-visible{outline:2px solid #14B8A6;outline-offset:1px}
.pw-eye[aria-pressed="true"]{color:#0A3A34}
