/* StatisMed calculator widget, light design (v3, 7 Nov 2026). Colours are CSS variables, so each site can theme it. */
.sm-calc { --smc-ink: #14163F; --smc-text: #33365C; --smc-muted: #6A6D8C; --smc-accent: #4C20CB; --smc-accent-dark: #3A14A8;
  --smc-soft: #F3F0FE; --smc-line: #E4E2F1; --smc-bg: #FFFFFF; --smc-field: #FAFAFE; --smc-code-bg: #F7F7FC; --smc-radius: 16px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--smc-text); text-align: left; direction: ltr;
  font-size: 15px; line-height: 1.5; letter-spacing: 0; }
.sm-calc *, .sm-calc *::before, .sm-calc *::after { box-sizing: border-box; font-family: inherit; letter-spacing: inherit; }
.sm-calc h3, .sm-calc h4 { font-family: inherit; color: var(--smc-ink); margin: 0; letter-spacing: -.01em; text-transform: none; }
.sm-calc .smc-form { background: var(--smc-bg); border: 1px solid var(--smc-line); border-radius: var(--smc-radius); padding: 8px 24px 24px;
  box-shadow: 0 10px 30px rgba(20,22,63,.06); }
.sm-calc .smc-sec { padding: 20px 0; border-bottom: 1px solid var(--smc-line); }
.sm-calc .smc-sec:last-of-type { border-bottom: 0; }
.sm-calc .smc-step { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.sm-calc .smc-num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--smc-soft); color: var(--smc-accent);
  font-weight: 800; font-size: 14px; display: grid; place-items: center; }
.sm-calc .smc-step h3 { font-size: 17px; font-weight: 800; line-height: 28px; }
.sm-calc .smc-step p { margin: 2px 0 0; font-size: 14px; color: var(--smc-muted); }
.sm-calc .smc-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.sm-calc .smc-pills label { cursor: pointer; }
.sm-calc .smc-pills input { position: absolute; opacity: 0; pointer-events: none; }
.sm-calc .smc-pills span { display: inline-block; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--smc-line); background: #fff;
  font-size: 14.5px; font-weight: 600; color: var(--smc-ink); transition: background .15s, color .15s, border-color .15s; }
.sm-calc .smc-pills span:hover { border-color: var(--smc-accent); }
.sm-calc .smc-pills input:checked + span { background: var(--smc-accent); border-color: var(--smc-accent); color: #fff; }
.sm-calc .smc-pills input:focus-visible + span { outline: 2px solid var(--smc-accent); outline-offset: 2px; }
.sm-calc .smc-small span { padding: 7px 14px; font-size: 14px; }
.sm-calc .smc-hint { margin: 12px 0 0; font-size: 14px; color: var(--smc-muted); background: var(--smc-field); border-radius: 10px; padding: 8px 12px; }
.sm-calc .smc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.sm-calc .smc-grid > span { display: contents; }
.sm-calc [hidden] { display: none !important; }
.sm-calc .smc-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; color: var(--smc-ink); }
.sm-calc .smc-field small { font-size: 12.5px; font-weight: 500; color: var(--smc-muted); }
.sm-calc input[type=number], .sm-calc select { font-size: 16px; font-weight: 600; padding: 10px 12px; border: 1.5px solid #D9D7EA; border-radius: 10px;
  background: var(--smc-field); color: var(--smc-ink); width: 100%; height: auto; min-height: 44px; margin: 0; box-shadow: none; }
.sm-calc input[type=number]:focus, .sm-calc select:focus { outline: none; border-color: var(--smc-accent); box-shadow: 0 0 0 4px rgba(76,32,203,.12); background: #fff; }
.sm-calc .smc-go { display: block; width: 100%; margin-top: 8px; font-size: 16.5px; font-weight: 800; color: #fff; background: var(--smc-accent);
  border: 0; border-radius: 12px; padding: 14px 26px; cursor: pointer; transition: background .15s; text-transform: none; }
.sm-calc .smc-go:hover { background: var(--smc-accent-dark); } .sm-calc .smc-go:disabled { opacity: .6; cursor: wait; }
.sm-calc .smc-out { margin-top: 20px; scroll-margin-top: 100px; }
.sm-calc .smc-out:empty { display: none; }
.sm-calc .smc-wait { display: flex; align-items: center; gap: 10px; color: var(--smc-muted); font-weight: 600; }
.sm-calc .smc-wait span { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--smc-line); border-top-color: var(--smc-accent); animation: smc-spin .8s linear infinite; }
@keyframes smc-spin { to { transform: rotate(360deg); } }
.sm-calc .smc-err { color: #A1291C; font-weight: 700; background: #FDECEA; padding: 12px 16px; border-radius: 12px; margin: 0; }
.sm-calc .smc-result { background: linear-gradient(135deg, #FFFFFF, var(--smc-soft)); border: 1px solid var(--smc-line); border-left: 5px solid var(--smc-accent);
  border-radius: var(--smc-radius); padding: 20px 24px; }
.sm-calc .smc-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--smc-accent); }
.sm-calc .smc-big b { display: block; font-size: 46px; line-height: 1.05; font-weight: 900; letter-spacing: -.02em; color: var(--smc-ink); margin-top: 4px; }
.sm-calc .smc-big span { display: block; margin-top: 4px; font-size: 15.5px; font-weight: 600; color: var(--smc-text); }
.sm-calc .smc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sm-calc .smc-chips span { background: #fff; border: 1px solid var(--smc-line); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; color: var(--smc-text); }
.sm-calc .smc-chips b { color: var(--smc-accent); }
.sm-calc .smc-card { margin-top: 14px; border: 1px solid var(--smc-line); border-radius: var(--smc-radius); overflow: hidden; background: #fff; }
.sm-calc .smc-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--smc-line); flex-wrap: wrap; }
.sm-calc .smc-head h4 { font-size: 15px; font-weight: 800; }
.sm-calc .smc-head small { color: var(--smc-muted); font-size: 12.5px; }
.sm-calc .smc-head button { margin-left: auto; font-size: 13.5px; font-weight: 700; color: var(--smc-accent); background: var(--smc-soft); border: 0;
  border-radius: 8px; padding: 7px 12px; cursor: pointer; text-transform: none; }
.sm-calc .smc-head button:hover { background: #E7E1FC; }
.sm-calc .smc-sentence { margin: 0; padding: 14px 16px; font-size: 15px; line-height: 1.6; color: var(--smc-ink); }
.sm-calc pre { margin: 0; padding: 16px 18px; overflow: auto; max-height: 440px; background: var(--smc-code-bg); color: #24264A;
  font: 13.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important; white-space: pre !important; word-break: normal; overflow-wrap: normal; border: 0; border-radius: 0; }
.sm-calc pre code { display: block; white-space: pre !important; background: none !important; padding: 0 !important; margin: 0; border: 0; color: inherit; font: inherit !important; }
.sm-calc pre .c { color: #8B8FA8; font-style: italic; } .sm-calc pre .s { color: #B4540A; } .sm-calc pre .k { color: #A0258F; font-weight: 600; }
.sm-calc pre .f { color: var(--smc-accent); font-weight: 600; } .sm-calc pre .n { color: #0A7D4F; }
.sm-calc details summary { cursor: pointer; padding: 11px 16px; font-size: 14px; font-weight: 700; color: var(--smc-accent); border-top: 1px solid var(--smc-line); }
.sm-calc pre.smc-o { background: #fff; color: #33365C; max-height: 280px; border-top: 1px solid var(--smc-line); }
.sm-calc .smc-cta { display: inline-flex; margin-top: 16px; font-weight: 700; color: var(--smc-accent); text-decoration: none; font-size: 15px; }
.sm-calc .smc-cta:hover { text-decoration: underline; }
@media (max-width: 560px) { .sm-calc .smc-form { padding: 4px 16px 18px; } .sm-calc .smc-big b { font-size: 38px; } .sm-calc .smc-result { padding: 16px 18px; } }

/* Collapsible R code (v4) */
.sm-calc .smc-code > summary { list-style: none; }
.sm-calc .smc-code > summary::-webkit-details-marker { display: none; }
.sm-calc .smc-codebar { display: flex; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer; background: linear-gradient(90deg, var(--smc-soft), #fff);
  transition: background .2s; border: 0; }
.sm-calc .smc-codebar:hover { background: linear-gradient(90deg, #ECE6FD, #fff); }
.sm-calc .smc-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; background: #fff; border: 1px solid var(--smc-line); display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(76,32,203,.12); animation: smc-float 2.6s ease-in-out infinite; }
.sm-calc .smc-ico svg { width: 22px; height: 22px; fill: none; stroke: var(--smc-accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sm-calc .smc-ico .smc-slash { stroke-dasharray: 16; animation: smc-draw 2.6s ease-in-out infinite; }
@keyframes smc-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes smc-draw { 0% { stroke-dashoffset: 16; } 35%, 75% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -16; } }
.sm-calc .smc-codetxt { display: flex; flex-direction: column; }
.sm-calc .smc-codetxt b { font-size: 15.5px; font-weight: 800; color: var(--smc-ink); }
.sm-calc .smc-codetxt small { font-size: 13px; color: var(--smc-muted); }
.sm-calc .smc-chev { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 1px solid var(--smc-line); position: relative; flex: none; }
.sm-calc .smc-chev::before { content: ""; position: absolute; left: 10px; top: 9px; width: 8px; height: 8px; border-right: 2.2px solid var(--smc-accent);
  border-bottom: 2.2px solid var(--smc-accent); transform: rotate(45deg); transition: transform .25s, top .25s; }
.sm-calc .smc-code[open] .smc-chev::before { transform: rotate(-135deg); top: 12px; }
.sm-calc .smc-code[open] .smc-codebar b::after { content: " (hide)"; font-weight: 600; color: var(--smc-muted); }
.sm-calc .smc-code[open] .smc-codebar b { font-size: 0; } .sm-calc .smc-code[open] .smc-codebar b::before { content: "The R code used"; font-size: 15.5px; }
.sm-calc .smc-code[open] .smc-codebar b::after { font-size: 13.5px; }
.sm-calc .smc-code[open] .smc-ico { animation: none; }
.sm-calc .smc-code > .smc-head { border-top: 1px solid var(--smc-line); }
.sm-calc .smc-code[open] > pre { animation: smc-open .3s ease; }
@keyframes smc-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sm-calc .smc-ico, .sm-calc .smc-ico .smc-slash, .sm-calc .smc-code[open] > pre { animation: none; } }
/* Code bar v5: distinct purple gradient bar (7 Nov 2026) */
.sm-calc .smc-code { border: 0; box-shadow: 0 10px 28px rgba(76,32,203,.18); }
.sm-calc .smc-codebar { background: linear-gradient(115deg, #4C20CB 0%, #6A3BEF 55%, #3FB8E6 130%); padding: 16px 20px; }
.sm-calc .smc-codebar:hover { background: linear-gradient(115deg, #4318B8 0%, #6233E6 55%, #36ABD9 130%); }
.sm-calc .smc-codebar .smc-ico { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.32); box-shadow: 0 6px 16px rgba(20,10,80,.25); }
.sm-calc .smc-codebar .smc-ico svg { stroke: #fff; }
.sm-calc .smc-codebar .smc-ico .smc-slash { stroke: #9FF0FF; }
.sm-calc .smc-codetxt b, .sm-calc .smc-code[open] .smc-codebar b::before { color: #fff; }
.sm-calc .smc-codetxt small, .sm-calc .smc-code[open] .smc-codebar b::after { color: rgba(255,255,255,.82); }
.sm-calc .smc-chev { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.4); }
.sm-calc .smc-chev::before { border-color: #fff; }
.sm-calc .smc-code > .smc-head, .sm-calc .smc-code > pre, .sm-calc .smc-code > details { background-clip: padding-box; }
.sm-calc .smc-code > .smc-head { background: #fff; border-top: 0; }
.sm-calc .smc-code[open] { border: 1px solid var(--smc-line); }
