/*
 * TAG Legal Desk v2.1, wp6_askfred: Ask {ai}, the 20 second file and Teach me.
 * Only the desk's own tokens (styles/desk.css), so Light, Dark, Eucalypt, Harbour and High contrast all read the same
 * way the desk does. Glass through the desk's .g1 and .g2 recipes. Nothing animates here: the desk's own sheets and
 * popovers carry the motion, and reduced motion, the Motion setting and Calm already cover them. No inline styles.
 */

/* ---------------------------------------------------------------- D1 the drawer */

.v21af-drawer { display: grid; gap: 14px; align-content: start; min-height: 100%; }
.v21af-ctx { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--ink-2); font-size: .9375rem; line-height: 1.4; }
.v21af-ctx .v21af-mark, .v21af-ctx .ico { flex: none; color: var(--brand-text); margin-top: 1px; }
.v21af-log { display: grid; gap: 10px; min-width: 0; }
/* The sticky question box never hides the answer being read, and a scrolled answer starts clear of the top. */
.v21af-log > * { scroll-margin-top: 8px; scroll-margin-bottom: 176px; }
.v21af-log:empty { display: none; }
.v21af-q { justify-self: end; max-width: 88%; margin: 0; padding: 10px 14px; border-radius: 16px 16px 4px 16px; background: var(--brand-soft); color: var(--ink); font-weight: 600; font-size: .9375rem; line-height: 1.4; overflow-wrap: anywhere; }
.v21af-a { display: grid; gap: 8px; justify-items: start; max-width: 100%; min-width: 0; padding: 14px 16px; border-radius: 16px 16px 16px 4px; }
.v21af-who { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.v21af-line { margin: 0; font-size: .9375rem; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.v21af-wait { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 600; font-size: .875rem; }
.v21af-srcs { margin-top: 2px; }
.v21af-srcs .chip { max-width: 100%; }
/* 44 px targets (bible 5.4) for every control this package adds. */
.v21af-drawer .chip, .v21af-drawer .btn, .v21af-offer .btn, .v21af-lesson .btn { min-height: 44px; }
.v21af-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.v21af-from { margin: 0; font-size: .75rem; }
.v21af-sugg-h { margin: 0; }
.v21af-sugg-text { justify-self: stretch; padding: 10px 12px; border-radius: 12px; background: var(--solid); border: 1px solid var(--glass-rim); color: var(--ink); font-size: .9375rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.v21af-suggest .chip { cursor: pointer; }
.v21af-suggest .chip .lbl { white-space: normal; }

.v21af-box { position: sticky; bottom: 0; z-index: 1; display: grid; gap: 8px; padding: 12px; border-radius: 16px; }
.v21af-box-h { font-weight: 700; font-size: .875rem; }
.v21af-input { width: 100%; min-height: 44px; max-height: 96px; resize: none; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--edge-strong); background: var(--solid); color: var(--ink); font: inherit; font-size: .9375rem; line-height: 1.4; overflow-y: auto; box-sizing: border-box; }
.v21af-input:focus-visible { outline-offset: 0; }
.v21af-box-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.v21af-box-row .meta { flex: 1 1 180px; min-width: 0; }
.v21af-box-btns { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }

.job-top .v21af-fbtn[hidden] { display: none; }

/* ---------------------------------------------------------------- D4 the 20 second file */

.job-top .v21af-fbtn { flex: none; }
.pop.v21af-fc-pop { width: min(380px, calc(100vw - 24px)); }
.v21af-fc { display: grid; gap: 8px; }
.v21af-fc-h { margin: 0; font-size: 1rem; }
.v21af-fc .meta { margin: 0; }
.v21af-fc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.v21af-fc-list li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; align-items: start; font-size: .9375rem; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.v21af-fc-list li .ico { color: var(--brand-text); margin-top: 3px; }
.v21af-fc-list li.v21af-fc-hold { font-weight: 700; }
.v21af-fc-list li.v21af-fc-hold .ico { color: var(--warn); }

/* ---------------------------------------------------------------- D9 the lesson offer (a moment card) */

/* The core gives the glass host and its padding (.v21-moment); the offer adds none of its own. */
.v21af-offer { display: grid; gap: 10px; padding: 0; }
.v21af-offer-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.v21af-offer-words { min-width: 0; }
.v21af-offer-h { margin: 0; font-size: 1.0625rem; font-weight: 700; }
.v21af-offer-k { margin: 2px 0 0; color: var(--ink-2); font-size: .875rem; overflow-wrap: anywhere; }
.v21af-offer .meta { margin: 0; }
.v21af-offer-row { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- D9 the lesson */

.v21af-lesson { display: grid; gap: 14px; }
.v21af-lesson-top { display: flex; align-items: center; gap: 12px; }
.v21af-lesson-top p { margin: 0; }
.v21af-lesson-k { font-weight: 700; }
.v21af-lcard { display: grid; gap: 10px; padding: 16px; border-radius: 16px; }
.v21af-lcard h3 { margin: 0; font-size: 1rem; }
.v21af-lcard p { margin: 0; line-height: 1.5; color: var(--ink); }
.v21af-lesson-row { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.v21af-choices { display: grid; gap: 8px; }
.v21af-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; text-align: left; font: inherit; font-weight: 600; font-size: .9375rem; line-height: 1.35; color: var(--ink); cursor: pointer; }
.v21af-choice:hover:not([disabled]) { background: var(--glass-2); }
.v21af-choice[disabled] { cursor: default; color: var(--ink); opacity: 1; }
.v21af-choice.is-answer { box-shadow: inset 0 0 0 2px var(--ok); }
.v21af-choice.is-pick:not(.is-answer) { box-shadow: inset 0 0 0 2px var(--edge-strong); }
.v21af-choice-t { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.v21af-choice-m { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; color: var(--brand-text); }
.v21af-feedback { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--ink); line-height: 1.5; }

/* ---------------------------------------------------------------- D9 the field guide (Profile) */

.v21af-guide-n { margin: 0; font-weight: 700; font-size: .875rem; color: var(--ink-2); }
.v21af-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.v21af-tile-li { display: flex; min-width: 0; }
.v21af-tile { display: grid; align-content: start; justify-items: start; gap: 6px; width: 100%; min-width: 0; min-height: 124px; padding: 12px; border-radius: 16px; text-align: left; font: inherit; color: var(--ink); }
button.v21af-tile { cursor: pointer; }
button.v21af-tile:hover { background: var(--glass-2); }
.v21af-tile .nm { font-weight: 700; font-size: .875rem; line-height: 1.3; overflow-wrap: anywhere; }
.v21af-tile .st { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 600; color: var(--brand-text); }
.v21af-tile.is-unlit { border: 1px dashed var(--edge-strong); background: transparent; color: var(--ink-2); }
.v21af-tile.is-unlit .st { color: var(--ink-2); }
.v21af-glyph { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-text); flex: none; }
.v21af-glyph.is-unlit { background: transparent; border: 1px dashed var(--edge-strong); color: var(--ink-2); }
.v21af-plate { display: grid; place-items: center; width: 48px; height: 48px; flex: none; }
.v21af-plate.is-unlit svg { opacity: .35; filter: grayscale(1); }

/* ---------------------------------------------------------------- high contrast and forced colours */

:root[data-theme="high_contrast"] .v21af-q { background: #fff; border: 2px solid #000; }
:root[data-theme="high_contrast"] .v21af-tile.is-unlit, :root[data-theme="high_contrast"] .v21af-glyph.is-unlit { border: 2px dashed #000; }
:root[data-theme="high_contrast"] .v21af-choice.is-answer { box-shadow: none; outline: 3px solid #005A12; outline-offset: -3px; }
:root[data-theme="high_contrast"] .v21af-feedback, :root[data-theme="high_contrast"] .v21af-sugg-text { background: #fff; border: 2px solid #000; }
@media (forced-colors: active) {
  .v21af-q, .v21af-feedback, .v21af-sugg-text, .v21af-tile.is-unlit { border: 1px solid CanvasText; }
  .v21af-choice.is-answer, .v21af-choice.is-pick { outline: 2px solid CanvasText; outline-offset: -2px; }
}

/* ---------------------------------------------------------------- phone widths (390 px, no page scroll sideways) */

@media (max-width: 599px) {
  .v21af-q { max-width: 100%; }
  .v21af-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v21af-tile { min-height: 116px; padding: 10px; }
  .v21af-box { padding: 10px; }
  .v21af-box-btns { margin-left: 0; width: 100%; justify-content: flex-end; }
}
