/* ============================================================
   THE FIELD APP'S HELP (lane HP, 2026-10-13) - the field manual,
   drawn in the app's own job-ticket look.

   GLOBAL ON PURPOSE: the manual's words arrive as HTML rendered by
   Riproka.Shared.Help.HelpMarkdown, which scoped CSS cannot reach.
   The colours are this app's own palette (app.css :root) - the
   field app is not on rk-tokens.css yet (DesignSystemTests'
   UnthemedForkedProjects), so this file speaks its language.
   ============================================================ */

/* ---------------------------------------------------------- the "?" chip */

.tb-chip--help {
    min-width: 30px;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    padding: 1px 8px;
}

.tb-chip--help-on {
    background: var(--accent);
    border-color: var(--accent);
}

/* On the bare run layout there is no bar to sit in, so the "?" floats top right. */
.tb-helpfloat {
    position: fixed;
    top: calc(8px + env(safe-area-inset-top));
    right: 8px;
    z-index: 55;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--paper);
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    line-height: 1;
    box-shadow: 2px 2px 0 rgba(22, 35, 45, 0.3);
    cursor: pointer;
}

/* ---------------------------------------------------------- the sheet */

.tb-helpsheet {
    position: fixed;
    inset: 0;
    z-index: 61;
    display: flex;
    flex-direction: column;
    max-width: 560px;
    margin: 0 auto;
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 0 40px rgba(22, 35, 45, 0.35);
}

.tb-helpsheet__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px 16px;
    background: var(--ink);
    color: var(--paper);
    border-bottom: 3px solid var(--accent);
}

.tb-helpsheet__id {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.tb-helpsheet__kicker {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.2em;
    color: rgba(243, 239, 230, 0.7);
}

.tb-helpsheet__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tb-helpsheet__close {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    background: transparent;
    color: var(--paper);
    border: 1px solid rgba(243, 239, 230, 0.4);
    font-size: 20px;
    cursor: pointer;
}

.tb-helpsheet__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 16px 24px;
}

.tb-helpsheet__foot {
    display: flex;
    gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--card);
    border-top: 2px solid var(--line-hard);
}

.tb-helpsheet__foot .tb-btn {
    margin: 0;
    text-decoration: none;
}

.tb-helpsheet__piece + .tb-helpsheet__piece {
    margin-top: 22px;
    padding-top: 14px;
    border-top: 2px dashed var(--line-hard);
}

.tb-helpsheet__more {
    display: inline-block;
    margin-top: 6px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-deep);
}

.tb-helpsheet__note {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--ink-soft);
}

/* ---------------------------------------------------------- the words */

.tb-help-prose {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    overflow-wrap: break-word;
}

.tb-help-prose h1,
.tb-help-prose h2,
.tb-help-prose h3,
.tb-help-prose h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.02em;
    margin: 20px 0 8px;
    scroll-margin-top: 80px;
}

.tb-help-prose h2 {
    font-size: 24px;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--line-hard);
}

.tb-help-prose h3 {
    font-size: 20px;
}

.tb-help-prose h4 {
    font-size: 17px;
}

.tb-help-prose > :first-child {
    margin-top: 0;
}

.tb-help-prose p,
.tb-help-prose ul,
.tb-help-prose ol {
    margin: 0 0 12px;
}

.tb-help-prose ul,
.tb-help-prose ol {
    padding-left: 22px;
}

.tb-help-prose li + li {
    margin-top: 4px;
}

.tb-help-prose a {
    color: var(--accent-deep);
    text-decoration: underline;
}

.tb-help-prose code {
    font-family: var(--font-mono);
    font-size: 14px;
    background: var(--card);
    border: 1px solid var(--line);
    padding: 0 4px;
}

.tb-help-prose hr {
    border: 0;
    border-top: 2px dashed var(--line);
    margin: 18px 0;
}

.tb-help-prose .help-code {
    padding: 10px;
    background: var(--card);
    border: 1px solid var(--line-hard);
    overflow-x: auto;
    font-size: 13px;
}

.tb-help-prose .help-code code {
    border: 0;
    background: transparent;
    padding: 0;
}

.tb-help-prose .help-table {
    overflow-x: auto;
    margin: 0 0 14px;
}

.tb-help-prose table {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
}

.tb-help-prose th {
    font-family: var(--font-display);
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: left;
    color: var(--steel);
    border-bottom: 2px solid var(--line-hard);
    padding: 6px;
}

.tb-help-prose td {
    border-bottom: 1px solid var(--line);
    padding: 6px;
    vertical-align: top;
}

.tb-help-prose .help-figure {
    margin: 10px 0 18px;
}

.tb-help-prose .help-figure img,
.tb-help-prose .help-inline-img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1.5px solid var(--line-hard);
    box-shadow: 4px 4px 0 rgba(22, 35, 45, 0.12);
    background: var(--card);
}

.tb-help-prose figcaption {
    margin-top: 6px;
    font-size: 14px;
    color: var(--steel);
}

.tb-help-prose blockquote {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-left: 5px solid var(--steel);
    background: var(--card);
}

.tb-help-prose blockquote > :last-child {
    margin-bottom: 0;
}

.tb-help-prose .help-callout--ok {
    border-left-color: var(--ok);
    background: var(--ok-soft);
}

.tb-help-prose .help-callout--warn {
    border-left-color: var(--accent);
    background: var(--accent-soft);
}

.tb-help-prose .help-callout--stop {
    border-left-color: var(--danger);
    background: var(--danger-soft);
}

.tb-help-mark {
    background: var(--accent-soft);
    color: var(--ink);
    font-weight: 600;
    border-bottom: 2px solid var(--accent);
}

/* ---------------------------------------------------------- the assistant (2026-10-16) */

/* ASK and THIS SCREEN under the sheet's head (docs/claude/COPILOT.md 2.2), and the conversation in the
   ASK tab: the person's words on the accent wash, the answer on the card, proposals as cards with big
   CONFIRM / DECLINE targets, the composer at the foot. The app's own variables, as the rest of this file. */

.tb-helpsheet__tabs {
    margin: 0;
    padding: 8px 16px;
    background: var(--card);
    border-bottom: 2px solid var(--line-hard);
}

.tb-helpsheet__body--ask {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.tb-cp {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.tb-cp > .tb-helpsheet__note {
    padding: 14px 16px 0;
}

.tb-cp__offline {
    margin: 12px 16px 0;
    padding: 12px 14px;
    background: var(--danger-soft);
    color: var(--danger-ink);
    border-left: 6px solid var(--danger);
    font-size: 16px;
    line-height: 1.45;
}

.tb-cp__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--ink-soft);
    border-bottom: 1px solid var(--line);
}

.tb-cp__new {
    min-height: 40px;
    padding: 0 12px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.1em;
    color: var(--accent-deep);
    background: transparent;
    border: 2px solid var(--accent-deep);
    cursor: pointer;
}

.tb-cp__new:disabled {
    opacity: 0.5;
}

.tb-cp__log {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px 16px;
}

.tb-cp__earlier {
    align-self: center;
    min-height: 40px;
    padding: 0 12px;
    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--line-hard);
}

.tb-cp__you {
    align-self: flex-end;
    max-width: 88%;
    margin: 0;
    padding: 10px 12px;
    background: var(--accent-soft);
    color: var(--ink);
    border: 1px solid var(--line-hard);
    font-size: 16px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.tb-cp__action {
    align-self: center;
    margin: 0;
    padding: 4px 10px;
    font-size: 14px;
    color: var(--ink-soft);
    border: 1px dashed var(--line-hard);
}

.tb-cp__ai {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tb-cp__answer {
    padding: 10px 12px;
    background: var(--card);
    border: 1px solid var(--line-hard);
    border-left: 6px solid var(--steel);
    overflow-wrap: anywhere;
}

.tb-cp__answer > :first-child {
    margin-top: 0;
}

.tb-cp__answer > :last-child {
    margin-bottom: 0;
}

.tb-cp__working {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--steel);
}

.tb-cp__progress {
    margin: 0;
    font-size: 14px;
    color: var(--ink-soft);
}

.tb-cp__problem,
.tb-cp__notice {
    margin: 0;
    padding: 10px 12px;
    background: var(--danger-soft);
    color: var(--danger-ink);
    font-size: 15px;
}

.tb-cp__notice {
    margin: 0 16px 8px;
}

.tb-cp__link {
    margin: 0;
    flex: 0 0 auto;
    min-height: 44px;
    font-size: 14px;
    text-decoration: none;
    white-space: normal;
}

.tb-cp__card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: var(--card);
    border: 3px solid var(--accent);
}

.tb-cp__card--danger {
    border-color: var(--danger);
    background: var(--danger-soft);
}

.tb-cp__card-kicker {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.14em;
    color: var(--accent-deep);
}

.tb-cp__card--danger .tb-cp__card-kicker,
.tb-cp__card--danger .tb-cp__card-prompt {
    color: var(--danger-ink);
}

.tb-cp__card-label {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    color: var(--ink);
}

.tb-cp__card-summary,
.tb-cp__card-prompt,
.tb-cp__card-state {
    margin: 0;
    font-size: 16px;
    line-height: 1.45;
    color: var(--ink);
}

.tb-cp__card-prompt {
    font-weight: 600;
    border-left: 4px solid currentColor;
    padding-left: 10px;
}

.tb-cp__acts {
    display: flex;
    gap: 10px;
}

.tb-cp__acts .tb-btn {
    margin: 0;
}

/* OFFLINE ASK (2026-10-26): the field manual's best sections for a question asked with no signal -
   labelled as the MANUAL, never the assistant. Each hit is the help page's own hit card. */
.tb-cp__manual {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
}

.tb-cp__manual-kicker {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.14em;
    color: var(--accent-deep);
}

.tb-cp__manual-hit {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--ink);
    text-decoration: none;
}

.tb-cp__manual-where {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.14em;
    color: var(--steel);
}

.tb-cp__manual-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 21px;
    line-height: 1.15;
}

.tb-cp__manual-snippet {
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink-soft);
}

.tb-cp__composer {
    display: flex;
    gap: 10px;
    align-items: stretch;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--card);
    border-top: 2px solid var(--line-hard);
}

.tb-cp__input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 56px;
    padding: 8px 10px;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--ink);
    background: var(--paper);
    border: 2px solid var(--line-hard);
    resize: vertical;
}

.tb-cp__input:disabled {
    opacity: 0.6;
}

.tb-cp__send {
    flex: 0 0 auto;
    margin: 0;
    width: auto;
    padding: 0 18px;
}
