/* ==========================================================================
   GOALS
   Every colour goes through a Core role token; text uses the ink tokens, so
   a sixth theme cannot push anything under AA.
   ========================================================================== */

.ldg-h2 {
    font-family: var(--ldc-font-display);
    font-size: 19px;
    font-weight: 700;
    color: var(--ldc-red-ink);
    margin: 24px 0 10px;
}

/* --- the invitation, before any goal exists ------------------------------- */
.ldg-invite { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 0; }
.ldg-invite-icon { font-size: 24px; flex: 0 0 auto; line-height: 1.1; }
.ldg-invite strong { display: block; font-family: var(--ldc-font-display); font-size: 15px; }
.ldg-invite p { margin: 4px 0 10px; font-size: 13px; color: var(--ldc-text-muted); line-height: 1.6; }

/* --- one goal ------------------------------------------------------------- */
.ldg-card { margin-bottom: 0; }
.ldg-card > .ldg-goal + .ldg-goal { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--ldc-border); }

.ldg-goal-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.ldg-goal-icon { font-size: 17px; flex: 0 0 auto; }
.ldg-goal-name {
    font-family: var(--ldc-font-display);
    font-weight: 700;
    font-size: 15px;
    flex: 1 1 auto;
    min-width: 0;
}
.ldg-goal-state {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--ldc-surface-soft);
    color: var(--ldc-text);
    white-space: nowrap;
}
.ldg-goal.is-ok   .ldg-goal-state { background: var(--ldc-surface-ok); }
.ldg-goal.is-warn .ldg-goal-state { background: var(--ldc-surface-warn); }
.ldg-goal.is-info .ldg-goal-state { background: var(--ldc-surface-cool); }

.ldg-goal-figure { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.ldg-goal-pct {
    flex: 0 0 auto;
    font-family: var(--ldc-font-display);
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    color: var(--ldc-link);
    font-variant-numeric: tabular-nums;
}
.ldg-goal-pct span { font-size: 17px; margin-left: 1px; }
.ldg-goal.is-warn .ldg-goal-pct { color: var(--ldc-accent-ink); }
.ldg-goal-nums { flex: 1 1 auto; min-width: 0; }
.ldg-goal-line { font-size: 13px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.ldg-goal-left { color: var(--ldc-text-muted); }

/* --- the bar: fill is distance done, tick is time gone -------------------- */
.ldg-bar {
    position: relative;
    height: 12px;
    border-radius: 999px;
    background: var(--ldc-track);
    overflow: hidden;
}
.ldg-bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--ldc-teal);
    transition: width .3s ease;
}
.ldg-goal.is-warn .ldg-bar-fill { background: var(--ldc-orange); }
/* The tick is the only mark that can sit on top of the fill, so it is drawn in
   the page ground rather than a text colour -- it has to read against both the
   filled and the empty half of the bar. */
.ldg-bar-tick {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 3px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: var(--ldc-ink);
    opacity: .85;
}

.ldg-goal-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--ldc-text-muted);
    font-variant-numeric: tabular-nums;
}
.ldg-goal-note {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.65;
    color: var(--ldc-text-muted);
}
.ldg-goal-kind {
    padding: 10px 12px;
    border-radius: var(--ldc-radius-sm);
    background: var(--ldc-surface-soft);
    color: var(--ldc-text);
}
.ldg-goal-dates {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--ldc-border);
    font-size: 12px;
    color: var(--ldc-text-muted);
}
.ldg-remove-form { margin: 10px 0 0; }
.ldg-form-card .ldc-card-title { font-size: 15px; }
.ldg-now {
    margin: 0 0 10px;
    font-family: var(--ldc-font-display);
    font-size: 15px;
    font-weight: 700;
}

@media (max-width: 380px) {
    .ldg-goal-pct { font-size: 29px; }
    .ldg-goal-state { font-size: 11px; }
}
