/* Tenshen Briefing — Variant A typography & decision queue.
   Consumes design tokens from tenshen-shell.css. */

/* --------------------------------------------------------------------
   Container
   ------------------------------------------------------------------ */
.tn-briefing {
    background: var(--t-card);
    border: 1px solid var(--t-rule);
    border-radius: 4px;
    padding: 40px 56px 60px;
    max-width: 880px;
    margin: 0 auto 32px;
    box-sizing: border-box;
}

/* Header strip (eyebrow + date) */
.tn-briefing-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--t-rule);
    margin-bottom: 32px;
    gap: 12px;
    flex-wrap: wrap;
}
.tn-briefing-eyebrow {
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--t-mute);
    font-weight: 600;
}
.tn-briefing-date {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--t-faint);
    font-weight: 500;
}

/* Greeting */
.tn-briefing h1.tn-briefing-greeting {
    font-size: 44px;
    font-weight: 550;
    letter-spacing: -0.025em;
    line-height: 1.08;
    margin: 0 0 6px;
    color: var(--t-ink);
    font-family: "Inter", system-ui, sans-serif;
}
.tn-briefing-sub {
    font-size: 12px;
    color: var(--t-faint);
    margin-bottom: 32px;
    font-family: "Inter", system-ui, sans-serif;
}

/* Narrative (4 beats) */
.tn-briefing-narrative {
    font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
    font-size: 16px;
    line-height: 1.65;
    color: var(--t-ink);
}
.tn-briefing-beat { margin-bottom: 22px; }
.tn-briefing-beat-heading {
    font-family: "Inter", system-ui, sans-serif;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--t-faint);
    font-weight: 600;
    margin-bottom: 8px;
}
.tn-briefing-beat p {
    margin: 0 0 10px;
    text-wrap: pretty;
}
.tn-briefing-beat p:last-child { margin-bottom: 0; }

/* Render server-side markdown with the same serif body — the API
   returns a single <h2>/<p> structure. */
.tn-briefing-md {
    font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
    font-size: 16px;
    line-height: 1.65;
    color: var(--t-ink);
}
.tn-briefing-md h1,
.tn-briefing-md h2,
.tn-briefing-md h3 {
    font-family: "Inter", system-ui, sans-serif;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--t-faint);
    font-weight: 600;
    margin: 24px 0 8px;
    line-height: 1.2;
}
.tn-briefing-md h1:first-child,
.tn-briefing-md h2:first-child,
.tn-briefing-md h3:first-child { margin-top: 0; }
.tn-briefing-md p {
    margin: 0 0 12px;
    text-wrap: pretty;
}
.tn-briefing-md ul,
.tn-briefing-md ol {
    padding-left: 1.2em;
    margin: 0 0 12px;
}
.tn-briefing-md li { margin-bottom: 6px; }
.tn-briefing-md a {
    color: var(--t-ink);
    text-decoration: none;
    border-bottom: 1px dotted var(--t-faint);
}
.tn-briefing-md a:hover { border-bottom-style: solid; }
.tn-briefing-md strong { font-weight: 600; }
.tn-briefing-md em { font-style: italic; }

/* EntLink — inline typed reference (project / person / task / event). */
.tn-entlink {
    color: var(--t-ink);
    text-decoration: none;
    border-bottom: 1px dotted var(--t-faint);
    cursor: pointer;
    font-family: inherit;
    font-style: inherit;
    white-space: nowrap;
}
.tn-entlink:hover { border-bottom-style: solid; }
.tn-entlink::before {
    content: attr(data-sigil);
    font-size: 0.72em;
    color: var(--t-accent);
    margin-right: 3px;
    vertical-align: 0.08em;
    letter-spacing: 0;
    font-family: "Inter", system-ui, sans-serif;
}

/* --------------------------------------------------------------------
   Inline decision queue
   ------------------------------------------------------------------ */
.tn-decisions {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--t-rule);
}
.tn-decisions-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.tn-decisions-head-label {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--t-mute);
    font-weight: 600;
}
.tn-decisions-head-rule {
    flex: 1;
    height: 1px;
    background: var(--t-rule);
}
.tn-decisions-head-count {
    font-size: 10px;
    color: var(--t-faint);
}

.tn-decision {
    position: relative;
    padding: 16px 0 16px 14px;
    border-bottom: 1px solid var(--t-rule);
    transition: opacity 180ms ease;
}
.tn-decision:last-child { border-bottom: 0; }
.tn-decision.is-resolved { opacity: 0.55; }

/* Priority as a 2px left-edge stripe. Copper reserves the highest
   priority; lower tiers step down through tokenized rule/faint so both
   themes render a visible stripe. */
.tn-decision::before {
    content: "";
    position: absolute;
    left: 0;
    top: var(--tn-decision-stripe-inset, 16px);
    bottom: var(--tn-decision-stripe-inset, 16px);
    width: 2px;
    background: var(--t-rule);
    border-radius: 1px;
}
.tn-decision[data-priority="P1"]::before { background: var(--t-accent); }
.tn-decision[data-priority="P2"]::before { background: var(--t-faint); }

.tn-decision-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
/* Priority as a tiny monospace eyebrow. The stripe carries the color. */
.tn-decision-pri {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--t-mute);
    text-transform: uppercase;
}
.tn-decision[data-priority="P1"] .tn-decision-pri { color: var(--t-accent); }
.tn-decision-src {
    font-size: 10px;
    color: var(--t-faint);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
}
.tn-decision-age {
    font-size: 10px;
    color: var(--t-faint);
}
.tn-decision-thread {
    margin-left: auto;
    font-size: 11px;
    color: var(--t-faint);
    text-decoration: none;
    font-family: "Inter", system-ui, sans-serif;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 500;
}
.tn-decision-thread:hover { color: var(--t-ink); }

.tn-decision-title {
    font-size: 15px;
    font-weight: 550;
    color: var(--t-ink);
    margin-bottom: 4px;
    font-family: "Inter", system-ui, sans-serif;
}
.tn-decision.is-resolved .tn-decision-title {
    text-decoration: line-through;
}
.tn-decision-ctx {
    font-size: 12px;
    color: var(--t-mute);
    line-height: 1.5;
    margin-bottom: 10px;
    font-family: "Inter", system-ui, sans-serif;
}

/* AI recommendation callout. Follows the canonical AI-ribbon grammar:
   whisper-tint background, 2px accent left rule, serif body, sans
   "— Tenshen" signature. Rendered only when the producer AI returned
   a rationale. */
.tn-decision-rec {
    padding: 10px 12px;
    margin: 0 0 12px;
    border-left: 2px solid var(--t-accent);
    background: var(--t-accent-whisper);
    font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
    font-size: 14px;
    font-style: italic;
    line-height: 1.5;
    color: var(--t-ink);
    text-wrap: pretty;
}
.tn-decision-rec-body { display: block; }
.tn-decision-rec-sig {
    display: block;
    margin-top: 6px;
    font-family: "Inter", system-ui, sans-serif;
    font-size: 11px;
    font-style: normal;
    font-weight: 500;
    color: var(--t-accent);
    letter-spacing: 0;
}

.tn-decision-choices {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.tn-decision-choice {
    appearance: none;
    font-family: "Inter", system-ui, sans-serif;
    font-size: 11px;
    padding: 5px 10px;
    border: 1px solid var(--t-rule);
    background: var(--t-card);
    color: var(--t-ink);
    border-radius: 2px;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.3;
}
.tn-decision-choice.is-recommended {
    border-color: var(--t-ink);
    background: var(--t-ink);
    color: var(--t-on-ink);
}
.tn-decision-choice:hover { border-color: var(--t-ink); }
.tn-decision-choice.is-recommended:hover {
    filter: brightness(0.92);
}

.tn-decision-resolution {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--t-accent);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.tn-decision-undo {
    appearance: none;
    background: transparent;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--t-faint);
    cursor: pointer;
    line-height: 1;
}
.tn-decision-undo:hover { color: var(--t-ink); }

/* Inline network/backend error surface. Intentionally chrome, not voice —
   sans, accent color, small and quiet. Distinct from .tn-decision-rec so
   a failed resolve doesn't look like another Tenshen note. */
.tn-decision-error {
    margin-top: 10px;
    font-family: "Inter", system-ui, sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--t-accent);
    line-height: 1.4;
}

/* Signoff */
.tn-briefing-signoff {
    margin-top: 48px;
    padding-top: 18px;
    border-top: 1px solid var(--t-rule);
    font-size: 12px;
    color: var(--t-faint);
    font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
    font-style: italic;
}

/* --------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media (max-width: 1024px) {
    .tn-briefing { padding: 28px 24px 40px; max-width: 640px; }
    .tn-briefing h1.tn-briefing-greeting { font-size: 36px; }
    .tn-briefing-narrative,
    .tn-briefing-md { font-size: 16px; }
}
@media (max-width: 640px) {
    .tn-briefing {
        padding: 20px 18px 32px;
        border: 0;
        border-radius: 0;
        margin-bottom: 16px;
    }
    .tn-briefing h1.tn-briefing-greeting { font-size: 28px; }
    .tn-briefing-narrative,
    .tn-briefing-md { font-size: 15px; }
    .tn-briefing-head { margin-bottom: 22px; }
    .tn-briefing-sub { margin-bottom: 22px; }
    .tn-decisions { margin-top: 28px; padding-top: 16px; }
    .tn-decision { padding: 14px 0 14px 12px; --tn-decision-stripe-inset: 14px; }
    .tn-decision-title { font-size: 14px; }
    .tn-briefing-signoff { margin-top: 30px; }
}

/* ── /decide full-page list ─────────────────────────────────────── */
/* Layout (max-width, padding, margin) comes from .tn-page .tn-page--narrow
   in tenshen-shell.css. This class only adds decide-page-specific rhythm. */
.tn-decide-page { padding-bottom: 60px; }
.tn-decide-filters { margin-bottom: 24px; }
.tn-decide-filter-form {
    display: flex;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
}
.tn-decide-filter-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: "Inter", system-ui, sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--t-faint);
}
.tn-decide-filter-form select {
    appearance: none;
    -webkit-appearance: none;
    padding: 6px 28px 6px 10px;
    border: 1px solid var(--t-rule);
    background-color: var(--t-card);
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                      linear-gradient(-45deg, transparent 50%, currentColor 50%);
    background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
    border-radius: 3px;
    color: var(--t-ink);
    font-family: "Inter", system-ui, sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    line-height: 1.3;
}
.tn-decide-filter-form select:hover { border-color: var(--t-ink); }
.tn-decide-filter-form select:focus-visible {
    outline: none;
    border-color: var(--t-accent);
    box-shadow: 0 0 0 2px var(--t-accent-whisper);
}

/* Full-page cards mirror the Tenshen design reference's DecisionCard:
   serif ink context, slightly larger title, 20px vertical padding.
   Inline (briefing / dock) cards keep the sans-serif muted treatment. */
.tn-decide-fullpage .tn-decision {
    padding: 20px 0 20px 16px;
    --tn-decision-stripe-inset: 20px;
}
.tn-decide-fullpage .tn-decision-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.tn-decide-fullpage .tn-decision-ctx {
    font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
    font-size: 14px;
    color: var(--t-ink);
    line-height: 1.55;
    text-wrap: pretty;
}

.tn-decide-empty {
    padding: 48px 0 24px;
    font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
    font-style: italic;
    font-size: 14px;
    line-height: 1.55;
    color: var(--t-faint);
    text-wrap: pretty;
}
.tn-decide-signoff {
    margin-top: 48px;
    padding-top: 18px;
    border-top: 1px solid var(--t-rule);
    font-size: 12px;
    color: var(--t-faint);
    font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
    font-style: italic;
    line-height: 1.55;
    text-wrap: pretty;
}

@media (max-width: 640px) {
    .tn-decide-fullpage .tn-decision {
        padding: 16px 0 16px 14px;
        --tn-decision-stripe-inset: 16px;
    }
    .tn-decide-fullpage .tn-decision-title { font-size: 15px; }
    .tn-decide-fullpage .tn-decision-ctx { font-size: 14px; }
}
