/* ============================================================
   Latch & Lantern :: CARD CUES (chunk 2)

   Loaded after polish.css. Everything here lives INSIDE an existing card; no selector
   moves, reorders, resizes or hides a card or its move / resize / minimise chrome. Every
   colour is a theme token (--toxic, --on-accent, --text, --text-dim, --overlay-*,
   --fp-member-*), so the playful and holiday skins keep their own identity: the radius
   comes from --radius-control (square on the hard skins, round on the soft ones).

   Sizes use max(.75rem, var(--fs-min, 12px)) for anything a person reads: the floor is
   12px with or without the polish layer's --fs-min token.
   ============================================================ */

/* ---- 1. The empty card that invites (item 2) ---- */
.fc-empty-invite {
    border: 1.5px dashed color-mix(in srgb, var(--text-dim) 60%, transparent);
    border-radius: var(--radius-card, 0);
    padding: 14px 14px 16px;
    margin: 2px 0 4px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}
.fc-empty-invite .fc-empty-text {
    margin: 0;
    color: var(--text);
    font-size: max(.875rem, var(--fs-min, 12px));
    line-height: 1.45;
    text-transform: none;
    letter-spacing: 0;
    font-family: inherit;
}
.fc-empty-pill {
    min-height: 44px;
    padding: 0 20px;
    border-radius: calc(var(--radius-control, 0px) * 4);
    background: var(--toxic);
    border: 1px solid var(--toxic);
    color: var(--on-accent);
    font-weight: 700;
    cursor: pointer;
    text-shadow: none;
    max-width: 100%;
}
.fc-empty-pill:hover { color: var(--on-accent); filter: brightness(1.08); }
.fc-empty-pill:focus-visible { outline: 2px solid var(--toxic); outline-offset: 3px; }
/* The row or box the card wraps its empty note in would nest a second box around ours. */
li:has(> .fc-empty-invite),
.recipe-item:has(> .fc-empty-invite) {
    background: none;
    border-color: transparent;
    box-shadow: none;
    padding: 0;
}
/* In the open card the add form is right there, so the invitation drops its pill. */
.section.expanded .fc-empty-pill { display: none; }

/* ---- 1b. The plain "Open to add..." line on a closed card (review batch 6, F1) ----
   A closed card is content only: the add forms moved into the opened card (.card-manage) and
   this one underlined line, no border, no fill, never form-looking, opens the card. Only
   --text-dim, --text and --toxic, so every skin keeps its own character. It is a real
   button with visible words. Two classes in the selector so the generic card-button look
   (app.css `.section-body button`, polish.css) cannot put a fill or border back on it. */
.section-body .fc-open-line,
.fc-open-line {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 6px;
    flex: none;
    margin: 4px 0 2px;
    padding: 4px 0;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font: inherit;
    font-size: max(.8rem, var(--fs-min, 12px));
    font-weight: 400;
    letter-spacing: .01em;
    text-transform: none;
    text-align: left;
    color: var(--text-dim);
    cursor: pointer;
    max-width: 100%;
    text-decoration: underline;
    text-decoration-color: currentColor;   /* WebView 106 has no color-mix(): the plain line */
    text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
    text-underline-offset: 3px;
}
.fc-open-line::after {
    content: "";
    flex: none;
    width: 6px;
    height: 6px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: rotate(45deg);
    margin-left: 1px;
}
.section-body .fc-open-line:hover,
.section-body .fc-open-line:focus-visible {
    background: none;
    border: 0;
    color: var(--text);
    text-decoration-color: currentColor;
}
.section-body .fc-open-line:focus-visible { outline: 2px solid var(--toxic); outline-offset: 3px; }
.fc-open-line[hidden],
.fc-open-line[data-demo-hidden] { display: none; }
/* In the open card the form is right there, so the line goes. */
.section.expanded .fc-open-line { display: none; }

/* ---- 2. Member dots (item 6) ---- */
.member-dot {
    flex: 0 0 auto;
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--member, var(--toxic));
    /* a ring from the skin's own ink, so a pale hue still reads on a light card */
    box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--text) 45%, transparent);
    align-self: center;
}

/* Chores: a person heading carries the dot and "n of m done". */
.chore-group-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: max(.75rem, var(--fs-min, 12px));
    font-weight: 700;
    /* A person's name, not a shout: the skin's own case and tracking (a hard skin keeps
       its capitals), sentence case on the soft ones. */
    text-transform: var(--case-heads, uppercase);
    letter-spacing: calc(var(--tracking-h2, 0px) * .4);
    color: var(--text-dim);
    padding: 8px 0 2px;
}
.chore-group-name { min-width: 0; overflow-wrap: anywhere; }
.chore-group-count {
    margin-left: auto;
    flex: 0 0 auto;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: none;
}
.chore-group-head.is-done .chore-group-count { color: var(--text); }

/* Meals: today wears the accent as a tint, not only a ▸ and bold. */
.meals-week .meal-day.is-today {
    background: rgba(var(--toxic-rgb), .12);
    border-radius: var(--radius-control, 0);
    box-shadow: inset 0 0 0 1px rgba(var(--toxic-rgb), .32);
    padding: 0 8px 4px;
    margin: 2px 0;
}

/* Kudos: the person thanked is the headline of the line. */
.kudos-for { font-weight: 700; color: var(--text); }
.kudos-meta { font-size: max(.75rem, var(--fs-min, 12px)); color: var(--text-dim); margin-top: 2px; }

/* Polls: your own vote is a filled check, a tinted option and a bolder border. */
.poll-option.is-mine {
    border-color: var(--toxic);
    box-shadow: inset 0 0 0 1px var(--toxic);
}
.poll-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    color: var(--text-dim);
    font-size: max(.75rem, var(--fs-min, 12px));
}
.poll-check {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25em;
    height: 1.25em;
    margin-right: .5em;
    border-radius: 50%;
    background: var(--toxic);
    color: var(--on-accent);
    font-size: max(.75rem, var(--fs-min, 12px));
    line-height: 1;
}
.poll-option-label { position: relative; min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; }

/* ---- 3. Connected Families (item 5) ---- */
/* The order is the DOM's: families, latest message, composer, status, older mail. */
.kin-family { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; }
.kin-latest { margin: 8px 0 4px; }
.kin-quote {
    margin: 0;
    padding: 12px 14px;
    border-radius: min(var(--radius-card, 0px), 8px);
    /* Flat tint and a hairline, a short accent rule on the left: no wash. */
    background: color-mix(in srgb, var(--toxic) 7%, var(--bg-panel));
    border: 1px solid var(--line);
    border-left: 3px solid color-mix(in srgb, var(--toxic) 55%, transparent);
}
.kin-quote .kin-meta { margin-bottom: 4px; }
.kin-quote .kin-body { font-size: max(1rem, var(--fs-min, 12px)); line-height: 1.4; }
.kin-meta { font-size: max(.75rem, var(--fs-min, 12px)); color: var(--text-dim); }
.kin-body { margin-top: 2px; overflow-wrap: anywhere; }
.kin-family-name { font-weight: 600; }
.kin-family-rel { font-size: max(.75rem, var(--fs-min, 12px)); color: var(--text-dim); }
.kin-branch { font-size: max(.75rem, var(--fs-min, 12px)); color: var(--text-dim); padding: 6px 0; }
.kin-branch-btn { border: none; background: transparent; color: inherit; cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.kin-status { font-size: max(.75rem, var(--fs-min, 12px)); min-height: 1em; opacity: 0; }
.kin-status.has-text { opacity: .85; }
.kin-status.is-error { color: var(--danger, #c25450); }
.kin-composer-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.kin-composer-row .kin-say { flex: 1 1 8rem; min-width: 0; }
.kin-item { padding: 6px 0; border-top: 1px solid var(--overlay-1, rgba(255, 255, 255, .06)); }
.kin-photo-item { max-width: 100%; border-radius: 8px; margin-top: 4px; display: block; }

/* ---- 4. Dashboard (item 4) ---- */
.dashboard-stat .stat-empty {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    margin: 4px 0 10px;
}
.dashboard-stat .stat-sub { color: var(--text-dim); font-size: max(.8rem, var(--fs-min, 12px)); margin-bottom: 10px; }

/* ---- 5. Small hit areas (extras) ---- */
html .section .grocery-add-btn,
html .section .kudos-add-btn,
html .section .meals-nav-btn {
    min-width: 32px;
    min-height: 32px;
}
html .section .meals-nav-btn { padding: 0 10px; }

/* ---- 6. A card's title says it opens the card ---- */
@media (hover: hover) {
    .section:not(.expanded) h2 .card-open { position: relative; }
    .section:not(.expanded) h2 .card-open::after {
        content: "";
        position: absolute;
        left: calc(100% + 8px);
        top: 50%;
        width: .85em;
        height: .85em;
        margin-top: -.425em;
        background: currentColor;
        opacity: 0;
        transition: opacity .15s ease;
        pointer-events: none;
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M9 21H3v-6'/%3E%3Cpath d='M21 3l-7 7'/%3E%3Cpath d='M3 21l7-7'/%3E%3C/svg%3E") center / contain no-repeat;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M9 21H3v-6'/%3E%3Cpath d='M21 3l-7 7'/%3E%3Cpath d='M3 21l7-7'/%3E%3C/svg%3E") center / contain no-repeat;
    }
    .section:not(.expanded) h2:hover .card-open::after,
    .section:not(.expanded) h2 .card-open:focus-visible::after { opacity: .75; }
}
@media (hover: none) {
    .section:not(.expanded) h2 .card-open:focus-visible::after { content: none; }
}
