/* ==========================================================================
   The Tasting Card — Components/TastingCard/TastingCardSheet.razor (.tc-*)
   The app's review editor (card V3) as a sheet: look → nose → structure → judge, then the pass.
   Sits on .vb-sheet (css/site.css); the accent (--tc-accent) is the colour the taster saw, else
   the wine's. Review tokens (--wr-*, swatches) come from css/labels.css.
   ========================================================================== */
.tc-backdrop { z-index: 3100; }
.tc-sheet {
    max-width: 40rem;
    padding: 1.75rem 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    outline: none;
}
.tc-sheet button { font-family: inherit; }

/* Head: the wine you are tasting */
.tc-head { display: flex; align-items: center; gap: 0.875rem; padding-right: 3.25rem; }
.tc-stripe { flex: none; width: 5px; align-self: stretch; min-height: 2.5rem; border-radius: 3px; background: var(--tc-accent); transition: background 0.2s ease; }
.tc-wine { min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.tc-producer { font-size: 0.8125rem; color: var(--color-muted); }
.tc-wine b { font-size: 1.125rem; line-height: 1.3; font-weight: 650; color: var(--color-ink); }
.tc-vintage { font-size: 0.875rem; color: var(--color-body); font-variant-numeric: tabular-nums; }
.tc-close { top: 1.25rem; right: 1.25rem; }

.tc-vintage-edit { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.tc-field { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8125rem; color: var(--color-muted); }
.tc-field input {
    width: 7.5rem;
    font: inherit;
    font-size: 1rem;
    color: var(--color-ink);
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--color-field);
    border-radius: 12px;
    background: var(--color-card-bg);
}
.tc-field input:disabled { background: var(--color-stone); color: var(--color-muted); }
.tc-check { display: inline-flex; align-items: center; gap: 0.45rem; padding-bottom: 0.6rem; font-size: 0.9375rem; color: var(--color-ink); cursor: pointer; }
.tc-check input { width: 1.05rem; height: 1.05rem; accent-color: var(--color-brand); }

/* Strip: the four parts, page count, Quick | Full */
.tc-strip { display: flex; flex-direction: column; gap: 0.625rem; }
.tc-sections { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.5rem; }
.tc-sections li { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.tc-sec-name { font-size: 0.75rem; color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-sections li.is-on .tc-sec-name { color: var(--color-ink); font-weight: 650; }
.tc-sec-bar { height: 4px; border-radius: 2px; background: var(--color-line); overflow: hidden; }
.tc-sec-bar i { display: block; height: 100%; border-radius: 2px; background: var(--tc-accent); transition: width 0.25s ease; }
.tc-strip-row { display: flex; align-items: center; gap: 0.75rem; }
.tc-back {
    display: inline-flex; align-items: center; gap: 0.15rem;
    border: 0; background: none; padding: 0.25rem 0;
    font-size: 0.875rem; font-weight: 600; color: var(--color-brand); cursor: pointer;
}
.tc-back:disabled { color: var(--color-muted); opacity: 0.45; cursor: default; }
.tc-back-chev { display: inline-flex; transform: rotate(180deg); }
.tc-count { font-size: 0.8125rem; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.tc-depth { margin-left: auto; display: inline-flex; padding: 3px; border-radius: 999px; background: var(--color-stone); }
.tc-depth button {
    border: 0; background: none; cursor: pointer;
    padding: 0.35rem 0.85rem; border-radius: 999px;
    font-size: 0.8125rem; font-weight: 600; color: var(--color-body);
}
.tc-depth button.is-on { background: var(--color-card-bg); color: var(--color-ink); box-shadow: 0 1px 3px rgba(16, 24, 43, 0.12); }

/* A page of questions */
.tc-page { display: flex; flex-direction: column; gap: 0.25rem; }
.tc-kicker { margin: 0; font-size: 0.75rem; letter-spacing: 0.02em; color: var(--color-muted); }
.tc-page-title { margin: 0 0 0.75rem; font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.02em; font-weight: 650; color: var(--color-ink); outline: none; }
.tc-questions { display: flex; flex-direction: column; gap: 1.375rem; }
.tc-q { margin: 0; padding: 0; border: 0; min-width: 0; }
.tc-q-title { padding: 0; margin-bottom: 0.55rem; font-size: 0.9375rem; font-weight: 650; color: var(--color-ink); }
.tc-opts { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tc-opt {
    position: relative;
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--color-field);
    border-radius: 999px;
    background: var(--color-card-bg);
    font-size: 0.875rem; color: var(--color-ink);
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
}
.tc-opt:hover { border-color: var(--color-line-strong); }
.tc-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tc-opt.is-on { border-color: var(--tc-accent); background: color-mix(in srgb, var(--tc-accent) 12%, var(--color-card-bg)); font-weight: 600; }
.tc-opt:has(input:focus-visible) { outline: 2px solid var(--color-brand); outline-offset: 2px; }
.tc-opt .wr-swatch { width: 12px; height: 12px; border-radius: 50%; }
.tc-hint { margin: 0.45rem 0 0; font-size: 0.8125rem; line-height: 1.45; color: var(--color-body); min-height: 1.2em; }

/* BLIC sliders, 0–1 in tenths */
.tc-sliders { display: flex; flex-direction: column; gap: 1.375rem; }
.tc-slider { display: flex; flex-direction: column; gap: 0.4rem; }
.tc-slider-head { display: flex; align-items: baseline; justify-content: space-between; font-size: 0.9375rem; font-weight: 650; color: var(--color-ink); }
.tc-slider-head b { font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.tc-slider input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    margin: 0.5rem 0;
    border-radius: 4px;
    background: linear-gradient(to right, var(--tc-accent) 0 var(--tc-fill, 50%), var(--color-line) var(--tc-fill, 50%) 100%);
    cursor: pointer;
}
.tc-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--color-card-bg);
    border: 2px solid var(--tc-accent);
    box-shadow: 0 2px 6px rgba(16, 24, 43, 0.2);
}
.tc-slider input[type="range"]::-moz-range-thumb {
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--color-card-bg);
    border: 2px solid var(--tc-accent);
    box-shadow: 0 2px 6px rgba(16, 24, 43, 0.2);
}
.tc-slider input[type="range"]:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 4px; }
.tc-slider-ends { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.75rem; color: var(--color-muted); }
.tc-slider-ends span:last-child { text-align: right; }

/* Aromas: picked, tiers, clusters of chips */
.tc-aromas { display: flex; flex-direction: column; gap: 1rem; }
.tc-picked { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; min-height: 2.25rem; }
.tc-picked-empty { font-size: 0.875rem; color: var(--color-muted); }
.tc-picked-label { font-size: 0.75rem; color: var(--color-muted); margin-right: 0.25rem; font-variant-numeric: tabular-nums; }
.tc-tiers { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tc-tiers button {
    display: inline-flex; align-items: center; gap: 0.4rem;
    border: 1px solid var(--color-field); background: var(--color-card-bg);
    border-radius: 999px; padding: 0.45rem 0.9rem;
    font-size: 0.875rem; font-weight: 600; color: var(--color-body); cursor: pointer;
}
.tc-tiers button.is-on { border-color: var(--color-ink); color: var(--color-ink); background: var(--color-stone); }
.tc-tier-n {
    min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--tc-accent); color: #fff; font-size: 0.6875rem; font-weight: 700;
}
.tc-clusters { display: flex; flex-direction: column; gap: 1rem; max-height: 46vh; overflow: auto; padding-right: 0.25rem; }
.tc-cluster h3 { margin: 0 0 0.45rem; font-size: 0.8125rem; font-weight: 650; color: var(--color-muted); }
.tc-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tc-chip {
    border: 1px solid var(--color-field); background: var(--color-card-bg);
    border-radius: 999px; padding: 0.35rem 0.75rem;
    font-size: 0.8125rem; color: var(--color-ink); cursor: pointer;
}
.tc-chip:hover { border-color: var(--color-line-strong); }
.tc-chip.is-on { border-color: var(--tc-accent); background: color-mix(in srgb, var(--tc-accent) 14%, var(--color-card-bg)); font-weight: 600; }

.tc-foot { position: sticky; bottom: -1.75rem; padding: 0.75rem 0 0; margin-top: auto; background: linear-gradient(to bottom, transparent, var(--color-card-bg) 35%); }

/* The pass: what you answered, the verdict, a note, Save */
.tc-pass { display: flex; flex-direction: column; gap: 1rem; }
.tc-pass-head .tc-kicker { outline: none; }
.tc-pass-rows { margin: 0; display: flex; flex-direction: column; border-top: 1px solid var(--color-line); }
.tc-pass-row { display: grid; grid-template-columns: 7rem 1fr; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--color-line); }
.tc-pass-row dt { font-size: 0.8125rem; color: var(--color-muted); }
.tc-pass-row dd { margin: 0; font-size: 0.9375rem; color: var(--color-ink); }
.tc-verdict {
    display: flex; flex-direction: column; gap: 0.3rem;
    padding: 1rem 1.125rem; border-radius: 18px;
    background: color-mix(in srgb, var(--tc-accent) 9%, var(--color-card-bg));
    border: 1px solid color-mix(in srgb, var(--tc-accent) 35%, var(--color-card-bg));
}
.tc-quality { font-size: 1.75rem; line-height: 1.15; font-weight: 700; color: var(--color-ink); letter-spacing: -0.02em; }
.tc-parts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; margin-top: 0.5rem; }
.tc-parts span { display: flex; flex-direction: column; gap: 0.1rem; }
.tc-parts small { font-size: 0.6875rem; color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-parts b { font-size: 1.0625rem; font-variant-numeric: tabular-nums; color: var(--color-ink); }
.tc-note { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.8125rem; color: var(--color-muted); }
.tc-note textarea {
    font: inherit; font-size: 0.9375rem; line-height: 1.5; color: var(--color-ink);
    padding: 0.75rem 0.875rem; border: 1px solid var(--color-field); border-radius: 14px;
    background: var(--color-card-bg); resize: vertical; min-height: 5.5rem;
}
.tc-error { margin: 0; font-size: 0.875rem; font-weight: 600; color: var(--color-wine); }
.tc-change { align-self: center; border: 0; background: none; padding: 0.35rem; font-size: 0.875rem; font-weight: 600; color: var(--color-brand); cursor: pointer; }

.tc-toast {
    position: sticky; bottom: 0.5rem; align-self: center;
    padding: 0.55rem 1rem; border-radius: 999px;
    background: var(--color-ink); color: #fff; font-size: 0.8125rem; font-weight: 600;
    animation: vbFade 0.16s ease both;
}

/* Review row actions (Edit / Delete on your own reviews) */
.wr-action-btn {
    display: inline-flex; align-items: center; gap: 4px;
    border: 0; background: none; padding: 0; cursor: pointer;
    font: inherit; font-size: 13px; font-weight: 700; color: var(--wr-action);
}
.wr-action-btn:hover { text-decoration: underline; }
.wr-action-btn--quiet { color: var(--wr-muted); font-weight: 600; }
.wr-tasted-at { margin: -4px 0 0; font-size: 12.5px; font-weight: 700; color: var(--wr-muted); }
/* The desktop wine page's Reviews sheet: actions sit flush under the review (no fold-row indent). */
.wr-actions.wdk-rev-actions { padding-left: 0; margin-top: 0.5rem; }
.wr-write { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0.25rem 0 0.75rem; }

@media (max-width: 640px) {
    .tc-sheet { padding: 1.5rem 1.25rem 1.25rem; gap: 1rem; }
    .tc-page-title { font-size: 1.3125rem; }
    .tc-clusters { max-height: none; }
    .tc-pass-row { grid-template-columns: 5.5rem 1fr; }
    .tc-quality { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
    .tc-stripe, .tc-sec-bar i { transition: none; }
}
