/* ==========================================================================
   SUPPLEMENT LOG
   Every colour goes through a Core role token. Nothing is written as a hex
   value, so a sixth theme cannot break this file quietly.
   ========================================================================== */

/* 19px bold so it qualifies as large text under WCAG (>=18.66px bold), which
   is what lets it keep the brand red on a tinted page: the pastel theme reads
   3.4:1 there, which passes the 3:1 large-text threshold and fails the 4.5:1
   body-text one. Shrink this below 18.66px and the heading stops being legible
   in that theme. */
.lds-h2 {
    font-family: var(--ldc-font-display);
    font-size: 19px;
    font-weight: 700;
    color: var(--ldc-red-ink);
    margin: 26px 0 10px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.lds-count {
    font-family: var(--ldc-font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--ldc-text-muted);
}
.lds-not-advice { margin-bottom: 18px; }

/* --- today ---------------------------------------------------------------- */
.lds-progress { margin-bottom: 14px; }
.lds-progress-bar {
    height: 10px;
    border-radius: 999px;
    background: var(--ldc-track);
    overflow: hidden;
}
.lds-progress-bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--ldc-teal);
    transition: width .25s ease;
}
.lds-progress-text {
    margin-top: 6px;
    font-family: var(--ldc-font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--ldc-text);
    font-variant-numeric: tabular-nums;
}
.lds-streak { font-weight: 500; color: var(--ldc-text-muted); }

.lds-slot { margin-top: 14px; }
.lds-slot-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ldc-text-muted);
    margin-bottom: 6px;
}

.lds-tick { margin: 0; }
.lds-tick-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    margin-bottom: 6px;
    border: 1px solid var(--ldc-border);
    border-radius: var(--ldc-radius-sm);
    background: var(--ldc-surface-soft);
    color: var(--ldc-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.lds-tick-box {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border: 2px solid var(--ldc-border-strong);
    border-radius: 7px;
    background: var(--ldc-card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    color: var(--ldc-on-accent);
}
.lds-tick.is-on .lds-tick-btn {
    background: var(--ldc-surface-ok);
    border-color: var(--ldc-ok);
}
.lds-tick.is-on .lds-tick-box {
    background: var(--ldc-ok);
    border-color: var(--ldc-ok);
}
.lds-tick-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lds-tick-dose {
    flex: 0 0 auto;
    font-size: 13px;
    color: var(--ldc-text-muted);
    font-variant-numeric: tabular-nums;
}
.lds-tick-all { margin-top: 12px; }

/* --- findings ------------------------------------------------------------- */
.lds-findings { display: grid; gap: 12px; }
.lds-finding { margin-bottom: 0; border-left: 5px solid var(--ldc-border-strong); }
.lds-finding.is-danger { border-left-color: var(--ldc-red); }
.lds-finding.is-warn   { border-left-color: var(--ldc-warn); }
.lds-finding.is-info   { border-left-color: var(--ldc-info); }

.lds-finding-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}
.lds-finding-icon { font-size: 20px; line-height: 1.2; flex: 0 0 auto; }
.lds-finding-sev {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ldc-text-muted);
}
.lds-finding.is-danger .lds-finding-sev { color: var(--ldc-red-ink); }
.lds-finding-title {
    display: block;
    font-family: var(--ldc-font-display);
    font-size: 15px;
    color: var(--ldc-text);
}
.lds-finding-num {
    display: inline-block;
    padding: 4px 10px;
    margin-bottom: 8px;
    border-radius: 999px;
    background: var(--ldc-surface-alert);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--ldc-text);
}
.lds-finding-msg { margin: 0 0 8px; font-size: 14px; line-height: 1.65; }
.lds-finding-fix {
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--ldc-radius-sm);
    background: var(--ldc-surface-cool);
    font-size: 14px;
    line-height: 1.65;
}
.lds-finding-fix strong { display: block; color: var(--ldc-text); margin-bottom: 2px; }

.lds-clean { display: flex; gap: 12px; align-items: flex-start; }
.lds-clean-icon { font-size: 22px; flex: 0 0 auto; }
.lds-clean p { margin: 4px 0 0; font-size: 13px; color: var(--ldc-text-muted); line-height: 1.65; }

.lds-drugs .ldc-card-title { font-size: 15px; }
.lds-drug-list { margin: 10px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.7; }
.lds-drug-list li { margin-bottom: 8px; }
.lds-drug-list strong { color: var(--ldc-red-ink); }

/* --- the regimen ---------------------------------------------------------- */
.lds-stack-card > .lds-stack-row + .lds-stack-row { border-top: 1px solid var(--ldc-border); }
.lds-stack-row > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    cursor: pointer;
    list-style: none;
    min-width: 0;
}
.lds-stack-row > summary::-webkit-details-marker { display: none; }
.lds-stack-slot { flex: 0 0 auto; }
.lds-stack-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lds-stack-dose {
    flex: 0 0 auto;
    font-size: 13px;
    color: var(--ldc-text-muted);
    font-variant-numeric: tabular-nums;
}
.lds-edit { margin-bottom: 8px; }
.lds-edit-actions { margin-top: 4px; }
.lds-remove-form { margin: 0 0 10px; }

/* --- the catalogue -------------------------------------------------------- */
.lds-browse-hint { margin: -4px 0 12px; }

/* The search box is the way into a list of 74 entries, so it is sized like the
   thing it is -- a primary control -- rather than like an ordinary form field.
   The magnifier is a background image rather than an icon element so that the
   input stays a plain input: no wrapper to break, nothing to knock out of
   alignment when the browser draws its own clear button. */
.lds-search { margin-bottom: 16px; }
.lds-search input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    height: 54px;
    padding: 0 44px 0 46px;
    border-radius: 999px;
    border: 2px solid var(--ldc-border-strong);
    background-color: var(--ldc-card-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a6a56' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 15px center;
    background-size: 21px 21px;
    font-size: 16px;
    font-weight: 500;
    color: var(--ldc-text);
}
.lds-search input::placeholder { color: var(--ldc-text-muted); font-weight: 400; }
.lds-search input:focus {
    outline: none;
    border-color: var(--ldc-teal);
    box-shadow: 0 0 0 4px var(--ldc-surface-cool);
}
@media (max-width: 380px) {
    .lds-search input { height: 50px; padding: 0 38px 0 42px; background-position: 13px center; }
}
.lds-noresult {
    margin: 0 0 14px;
    padding: 14px;
    border-radius: var(--ldc-radius-sm);
    background: var(--ldc-surface-soft);
    color: var(--ldc-text-muted);
    text-align: center;
}
.lds-group-head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--ldc-font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--ldc-text-soft);
    margin: 18px 0 8px;
}
.lds-group-card > .lds-item + .lds-item { border-top: 1px solid var(--ldc-border); }
.lds-item > summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 11px 0;
    cursor: pointer;
    list-style: none;
    min-width: 0;
}
.lds-item > summary::-webkit-details-marker { display: none; }
.lds-item > summary::before {
    content: "▸";
    flex: 0 0 auto;
    color: var(--ldc-accent-ink);
    font-size: 12px;
}
.lds-item[open] > summary::before { content: "▾"; }
.lds-item-name { font-weight: 600; }
.lds-item-also {
    font-size: 12px;
    color: var(--ldc-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.lds-add { margin: 10px 0 14px; }

/* --- one supplement's six answers ----------------------------------------- */
.lds-detail { padding: 4px 0 10px; }
.lds-field { margin-bottom: 12px; }
.lds-field-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 3px;
}
.lds-field-icon { font-size: 14px; }
.lds-field-label {
    font-family: var(--ldc-font-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--ldc-text-soft);
}
.lds-field p { margin: 0; font-size: 14px; line-height: 1.7; }
.lds-cap { color: var(--ldc-text-muted); font-size: 13px !important; margin-top: 3px !important; }

/* The badge text is the thing that has to be readable, so it uses colours that
   clear 4.5:1 on their own tint in every theme -- the meaning is carried by the
   background. --ldc-teal on --ldc-surface-cool measured 3:1 in the dark themes,
   which is why "moderate" uses the body colour rather than the accent. */
.lds-ev {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}
.lds-ev-strong   { background: var(--ldc-surface-ok);    color: var(--ldc-ok); }
.lds-ev-moderate { background: var(--ldc-surface-cool);  color: var(--ldc-text); }
.lds-ev-weak     { background: var(--ldc-surface-warn);  color: var(--ldc-text); }
.lds-ev-none     { background: var(--ldc-surface-soft);  color: var(--ldc-text-muted); }

.lds-note {
    margin-top: 10px;
    padding: 11px 13px;
    border-radius: var(--ldc-radius-sm);
    font-size: 13px;
    line-height: 1.7;
    background: var(--ldc-surface-soft);
}
.lds-note strong { display: block; margin-bottom: 2px; }
.lds-note-time { background: var(--ldc-surface-cool); }
.lds-note-time strong { color: var(--ldc-text); }
.lds-note-care { background: var(--ldc-surface-warn); }
.lds-note-care strong { color: var(--ldc-text); }
.lds-note-drug { background: var(--ldc-surface-alert); }
.lds-note-drug strong { color: var(--ldc-red-ink); }

/* --- dashboard card ------------------------------------------------------- */
.lds-dash-list { margin-top: 10px; }
.lds-dash-done {
    margin-top: 10px;
    padding: 12px;
    border-radius: var(--ldc-radius-sm);
    background: var(--ldc-surface-ok);
    color: var(--ldc-ok);
    font-weight: 700;
    text-align: center;
}
.lds-dash-more {
    font-size: 13px;
    color: var(--ldc-text-muted);
    text-align: center;
    padding-top: 4px;
}

@media (max-width: 420px) {
    .lds-tick-dose { font-size: 12px; }
    .lds-finding-title { font-size: 14px; }
}
