/* Tenshen Task detail — editorial column styles.
   Lifted from docs/mocks/task-detail.html. Consumes design tokens
   from tenshen-shell.css. Scoped under `.task` so generic class
   names (chip, rail, crow, etc.) don't collide with legacy
   beacon.css or other shell surfaces. */

/* Font-family tokens — lifted from the mock. Kept local to the
   editorial column; promote to tenshen-shell.css if adopted broadly. */
.task {
    --f-sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --f-serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
}

/* ============================================================
   Editorial task column
   ============================================================ */
.task {
    max-width: 1040px;
    margin: 0 auto;
    padding: 56px 56px 120px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    column-gap: 72px;
    font-family: var(--f-sans);
    color: var(--t-ink);
}
.task > .main { min-width: 0; }
.task > .margin { min-width: 0; position: sticky; top: 85px; align-self: start; }

/* ---- Head strip ---- */
.task-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--t-rule);
    margin-bottom: 36px;
    gap: 12px;
    flex-wrap: wrap;
}
.task-crumb {
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--t-mute);
    font-weight: 600;
}
.task-crumb a {
    color: var(--t-mute);
    text-decoration: none;
    border-bottom: 1px dotted var(--t-faint);
}
.task-crumb a:hover { color: var(--t-ink); border-bottom-style: solid; }
.task-crumb .sep { margin: 0 10px; color: var(--t-faint); letter-spacing: 0; }
.task-headmeta {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--t-faint);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}
.task-headmeta .dot { color: var(--t-faint); }

/* ---- Title + facts ---- */
.task-title {
    font-family: var(--f-sans);
    font-size: 40px;
    font-weight: 550;
    letter-spacing: -0.024em;
    line-height: 1.08;
    margin: 0 0 12px;
    color: var(--t-ink);
}
.task-facts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--t-mute);
    margin-bottom: 8px;
}
.task-facts .sep { color: var(--t-faint); }
.task-facts a {
    color: var(--t-ink);
    text-decoration: none;
    border-bottom: 1px dotted var(--t-faint);
}
.task-facts a:hover { border-bottom-style: solid; }
.task-facts strong { color: var(--t-ink); font-weight: 600; }

/* Pills */
.pri-pill, .status-pill, .fact-pill {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 2px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.6;
}
.pri-pill.p1 { background: var(--t-accent); color: #fff; }
.pri-pill.p2 { background: var(--t-accent-soft); color: var(--t-ink); }
.pri-pill.p3 { background: var(--t-soft-bg); color: var(--t-mute); }
.pri-pill.p4 { background: var(--t-soft-bg); color: var(--t-faint); }
.status-pill {
    background: var(--t-soft-bg);
    color: var(--t-mute);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.status-pill.is-in-progress { background: var(--t-accent-soft); color: var(--t-ink); }
.status-pill.is-done { background: var(--t-soft-bg); color: var(--t-faint); }
.status-pill.is-blocked {
    background: transparent;
    color: var(--t-warn);
    border: 1px solid rgba(184,134,11,0.3);
    font-weight: 700;
}

/* Overdue ribbon — tucked under the facts line */
.state-ribbon {
    margin-top: 6px;
    padding: 7px 12px;
    font-size: 12px;
    border-left: 2px solid var(--t-accent);
    background: var(--t-accent-whisper);
    color: var(--t-ink);
    font-family: var(--f-serif);
    font-style: italic;
    line-height: 1.5;
}
.state-ribbon a {
    color: var(--t-ink);
    font-family: var(--f-sans);
    font-style: normal;
    font-size: 11px;
    text-decoration: none;
    border-bottom: 1px dotted var(--t-faint);
    margin-left: 4px;
}
.state-ribbon a:hover { border-bottom-style: solid; }

/* Auto-rolled banner */
.ai-ribbon {
    margin-top: 20px;
    padding: 12px 16px;
    font-family: var(--f-serif);
    font-size: 14px;
    line-height: 1.55;
    border-left: 2px solid var(--t-accent);
    background: var(--t-accent-whisper);
    color: var(--t-ink);
}
.ai-ribbon strong { font-weight: 600; }
.ai-ribbon .sign {
    display: block;
    margin-top: 4px;
    font-family: var(--f-sans);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--t-mute);
    font-style: normal;
}
.ai-ribbon a {
    color: var(--t-ink);
    text-decoration: none;
    border-bottom: 1px dotted var(--t-accent);
    font-family: var(--f-sans);
    font-size: 12px;
}
.ai-ribbon a:hover { border-bottom-style: solid; }

/* ---- Synopsis — AI voice ---- */
.task-synopsis {
    margin: 28px 0 0;
    padding: 20px 24px;
    border-left: 2px solid var(--t-accent);
    background: var(--t-accent-whisper);
    font-family: var(--f-serif);
    font-size: 17px;
    line-height: 1.65;
    color: var(--t-ink);
    position: relative;
}
.task-synopsis p { margin: 0 0 0.8em; }
.task-synopsis p:last-child { margin-bottom: 0; }
.task-synopsis .syn-sign {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    font-family: var(--f-sans);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--t-mute);
    font-weight: 600;
}
.task-synopsis .syn-sign .hair {
    flex: 0 0 22px;
    height: 1px;
    background: var(--t-rule);
}
.task-synopsis .syn-sign .refresh {
    margin-left: auto;
    color: var(--t-faint);
    letter-spacing: 0.12em;
    font-weight: 500;
    cursor: pointer;
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 10px;
    text-transform: uppercase;
}
.task-synopsis .syn-sign .refresh:hover { color: var(--t-ink); }

.task-updated {
    margin-top: 14px;
    font-size: 11px;
    color: var(--t-faint);
    letter-spacing: 0.02em;
}
.task-updated .dot { color: var(--t-faint); margin-right: 6px; }

/* ---- Inline action strip (below synopsis) ---- */
.act-strip {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 20px;
    padding: 12px 0;
    border-top: 1px solid var(--t-rule);
    border-bottom: 1px solid var(--t-rule);
}
.act {
    appearance: none;
    border: 1px solid var(--t-rule);
    background: transparent;
    color: var(--t-mute);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 3px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
    min-height: 32px;
    transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.act:hover { color: var(--t-ink); border-color: var(--t-ink); }
.act.is-primary {
    background: var(--t-ink);
    color: var(--t-on-ink);
    border-color: var(--t-ink);
}
.act.is-primary:hover { opacity: 0.9; color: var(--t-on-ink); }
.act.is-danger { color: var(--t-mute); border-style: dashed; }
.act.is-danger:hover { color: #a33a2d; border-color: #a33a2d; border-style: solid; }
.act-more {
    margin-left: auto;
    color: var(--t-faint);
}
.act-dot { color: var(--t-faint); font-size: 16px; line-height: 0.5; letter-spacing: 0.1em; }

/* ---- Description — user voice, editable in place ---- */
.desc {
    margin-top: 36px;
    font-family: var(--f-serif);
    font-size: 15px;
    line-height: 1.66;
    color: var(--t-ink);
    position: relative;
    cursor: text;
    border-left: 2px solid transparent;
    padding: 2px 0 2px 16px;
    margin-left: -18px;
    transition: border-color 140ms ease, background 140ms ease;
}
.desc:hover { border-left-color: var(--t-rule); background: rgba(21,24,26,0.015); }
.desc:hover .desc-edit { opacity: 1; }
.desc p { margin: 0 0 0.75em; }
.desc p:last-child { margin-bottom: 0; }
.desc.is-empty { color: var(--t-faint); font-style: italic; }
.desc-edit {
    position: absolute;
    top: 0;
    right: -2px;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--t-faint);
    opacity: 0;
    transition: opacity 140ms ease;
    pointer-events: none;
}

/* ---- Section heads ---- */
.section-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-top: 44px;
    margin-bottom: 14px;
}
.section-head.is-ai { color: var(--t-accent); }
.section-head .eyebrow {
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--t-ink);
    font-weight: 600;
    flex-shrink: 0;
}
.section-head.is-ai .eyebrow { color: var(--t-accent); }
.section-head .rule {
    flex: 1;
    height: 1px;
    background: var(--t-rule);
    align-self: center;
}
.section-head .count {
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--t-faint);
    font-weight: 500;
    flex-shrink: 0;
}
.section-head .section-act {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--t-faint);
    font-family: inherit;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
    transition: color 120ms ease;
}
.section-head .section-act:hover { color: var(--t-ink); }
.section-head.is-ai .section-act:hover { color: var(--t-accent); }

/* ---- Checklist (Steps) ---- */
.clist { display: flex; flex-direction: column; }
.crow {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    column-gap: 12px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid var(--t-rule);
    position: relative;
}
.crow:last-of-type { border-bottom: 1px solid var(--t-rule); }
.crow:hover .actions-rail { opacity: 1; pointer-events: auto; }
.crow:hover .idle-status { opacity: 0; }
.crow.is-done .ctitle { color: var(--t-faint); text-decoration: line-through; }
.crow.is-muted { opacity: 0.5; }

.cbox {
    width: 16px; height: 16px;
    border: 1px solid var(--t-rule);
    border-radius: 3px;
    background: var(--t-card);
    cursor: pointer;
    position: relative;
    margin-top: 2px;
    flex-shrink: 0;
}
.cbox:hover { border-color: var(--t-ink); }
.crow.is-done .cbox {
    background: var(--t-ink);
    border-color: var(--t-ink);
}
.crow.is-done .cbox::after {
    content: "";
    position: absolute;
    top: 2px; left: 5px;
    width: 4px; height: 8px;
    border-right: 1.5px solid var(--t-on-ink);
    border-bottom: 1.5px solid var(--t-on-ink);
    transform: rotate(45deg);
}
.cbody { min-width: 0; }
.ctitle {
    font-size: 14px;
    color: var(--t-ink);
    font-weight: 450;
    line-height: 1.5;
}
.cbody .rel {
    display: block;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--t-faint);
    font-weight: 600;
    margin-bottom: 3px;
}
.cbody .rel.is-warn { color: var(--t-warn); }
.cbody .ai-hint {
    display: inline-block;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--t-accent);
    font-weight: 600;
    padding: 1px 5px;
    border: 1px solid var(--t-accent-soft);
    border-radius: 2px;
    margin-left: 6px;
    vertical-align: 1px;
}
.cbody .sub {
    display: block;
    margin-top: 2px;
    font-family: var(--f-serif);
    font-style: italic;
    font-size: 12px;
    color: var(--t-mute);
    line-height: 1.5;
}
.cbody .sub.is-warn { color: var(--t-warn); font-style: normal; }

.cmeta-right { justify-self: end; display: flex; align-items: center; gap: 8px; min-height: 22px; }
.idle-status {
    font-size: 11px;
    color: var(--t-faint);
    letter-spacing: 0.02em;
    transition: opacity 120ms ease;
}
.actions-rail {
    display: inline-flex;
    gap: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
}
.achip {
    appearance: none;
    border: 1px solid var(--t-rule);
    background: var(--t-card);
    color: var(--t-mute);
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 2px;
    cursor: pointer;
    line-height: 1.3;
}
.achip:hover { color: var(--t-ink); border-color: var(--t-ink); }
.achip.is-primary {
    background: var(--t-ink); color: var(--t-on-ink); border-color: var(--t-ink);
}
.achip.is-primary:hover { opacity: 0.88; color: var(--t-on-ink); }
.achip.is-x { padding: 2px 6px; color: var(--t-faint); font-size: 14px; line-height: 1; }

/* Add-step / add-link row */
.clist-add {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    column-gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--t-rule);
}
.clist-add .add-glyph { color: var(--t-faint); text-align: center; font-size: 16px; }
.clist-add-input {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 4px 0;
    font: inherit;
    font-size: 14px;
    color: var(--t-ink);
    width: 100%;
    outline: 0;
}
.clist-add-input::placeholder { color: var(--t-faint); }

/* ---- Linked work: contains (sub-tasks) + links ---- */
.linked-group + .linked-group { margin-top: 22px; }
.linked-group-label {
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--t-mute);
    font-weight: 600;
    font-family: var(--f-sans);
    margin: 4px 0 6px;
}
.crow .entlink {
    color: var(--t-ink);
    text-decoration: none;
    border-bottom: 1px dotted var(--t-faint);
    font-weight: 500;
}
.crow .entlink:hover { border-bottom-style: solid; }
.chev { color: var(--t-faint); grid-column: auto; align-self: center; }

/* Linked add — typeahead + NL */
.linked-add {
    padding: 12px 0;
    border-bottom: 1px solid var(--t-rule);
}
.linked-add-row {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    column-gap: 12px;
    align-items: center;
    position: relative;
}
.linked-add-row .add-glyph { color: var(--t-faint); text-align: center; font-size: 16px; }
.linked-add-results {
    position: absolute;
    top: 100%;
    left: 32px;
    right: 0;
    margin-top: 6px;
    background: var(--t-card);
    border: 1px solid var(--t-rule);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    z-index: 5;
}
.linked-add-result {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--t-ink);
    cursor: pointer;
    border-bottom: 1px solid var(--t-rule);
}
.linked-add-result:last-child { border-bottom: 0; }
.linked-add-result:hover { background: var(--t-hover-bg); }
.linked-add-result small {
    color: var(--t-faint);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
    align-self: center;
}
.linked-add-form {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--t-rail-soft);
    border: 1px solid var(--t-rule);
    border-radius: 4px;
}
.linked-add-target {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: var(--t-soft-bg);
    border-radius: 3px;
    font-size: 12px;
    color: var(--t-ink);
    font-weight: 500;
}
.linked-add-clear { border: 0; background: transparent; color: var(--t-faint); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.linked-add-textarea {
    width: 100%;
    min-height: 52px;
    padding: 8px 10px;
    margin-top: 8px;
    background: var(--t-card);
    border: 1px solid var(--t-rule);
    border-radius: 3px;
    font: inherit;
    font-family: var(--f-serif);
    font-size: 13px;
    color: var(--t-ink);
    resize: vertical;
    outline: 0;
}
.linked-add-textarea:focus { border-color: var(--t-accent); }
.linked-add-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.linked-add-fallback {
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--t-faint);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}
.linked-add-fallback:hover { color: var(--t-ink); }
.linked-add-select {
    font: inherit;
    font-size: 11px;
    padding: 3px 6px;
    border: 1px solid var(--t-rule);
    border-radius: 3px;
    background: var(--t-card);
    color: var(--t-ink);
}

/* ---- AI Suggested Next Steps ---- */
.ai-suggest {
    margin-top: 8px;
    border-left: 2px solid var(--t-accent);
    background: var(--t-accent-whisper);
    padding: 6px 0 8px;
}
.ai-suggest-row {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    column-gap: 12px;
    align-items: center;
    padding: 8px 18px 8px 16px;
    border-bottom: 1px dashed rgba(181,107,63,0.2);
    font-family: var(--f-serif);
    font-size: 14px;
    line-height: 1.5;
}
.ai-suggest-row:last-child { border-bottom: 0; }
.ai-suggest-glyph {
    color: var(--t-accent);
    font-size: 12px;
    text-align: center;
}
.ai-suggest-text { color: var(--t-ink); }
.ai-suggest-row:hover .ai-suggest-actions { opacity: 1; pointer-events: auto; }
.ai-suggest-actions {
    display: inline-flex;
    gap: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
}

/* ---- Context rail ---- */
.rail {
    display: grid;
    grid-template-columns: 96px 1fr;
    row-gap: 14px;
    column-gap: 16px;
    margin-top: 10px;
    font-size: 12px;
}
.rail-k {
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--t-faint);
    font-weight: 600;
    line-height: 1.7;
    padding-top: 2px;
}
.rail-v {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    align-items: center;
    min-width: 0;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 2px;
    background: var(--t-soft-bg);
    color: var(--t-ink);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    line-height: 1.5;
    border: 1px solid transparent;
    position: relative;
    cursor: default;
}
.chip:hover .chip-x { opacity: 1; }
.chip-x {
    font-size: 12px;
    line-height: 1;
    color: var(--t-faint);
    cursor: pointer;
    opacity: 0;
    transition: opacity 120ms ease;
    padding: 0;
    border: 0;
    background: transparent;
    margin-left: 2px;
}
.chip-x:hover { color: var(--t-ink); }
a.chip,
.chip:has(> a) {
    cursor: pointer;
    border-bottom-style: dotted !important;
    border-bottom-width: 0 !important;
}
a.chip:hover,
.chip:has(> a):hover { background: var(--t-hover-bg); border-color: var(--t-rule); }
.chip > a { color: inherit; text-decoration: none; font: inherit; }
.chip.is-tag { background: transparent; color: var(--t-mute); border: 1px solid var(--t-rule); }
.chip.is-tag:hover { color: var(--t-ink); border-color: var(--t-ink); }
.chip.is-ai-suggest {
    background: var(--t-accent-whisper);
    border: 1px dashed var(--t-accent-soft);
    color: var(--t-accent);
    padding: 3px 9px;
}
.chip.is-reminder { background: transparent; border: 1px solid var(--t-rule); color: var(--t-ink); }

.rail-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px;
    font-size: 12px;
    color: var(--t-faint);
    background: transparent;
    border: 1px dashed var(--t-rule);
    border-radius: 2px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
}
.rail-add:hover { color: var(--t-ink); border-color: var(--t-ink); border-style: solid; }
.rail-suggest {
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--t-accent);
    border: 0;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    padding: 2px 4px;
    font-family: inherit;
}
.rail-suggest:hover { text-decoration: underline; }

/* Reminder composer */
.rail-reminder-form {
    width: 100%;
    margin-top: 6px;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 6px;
}
.rail-reminder-form input[type="datetime-local"],
.rail-reminder-form input[type="text"] {
    font: inherit;
    font-size: 12px;
    padding: 5px 8px;
    border: 1px solid var(--t-rule);
    border-radius: 3px;
    background: var(--t-card);
    color: var(--t-ink);
    outline: 0;
}
.rail-reminder-form input:focus { border-color: var(--t-accent); }

/* ---- NOTES — quick composer up top, full history at the bottom ----

   The quick composer is a collapsed one-line affordance placed right
   below the action strip so a note is always in the first viewport.
   Clicking expands it in place into the full composer; pressing Esc
   or blurring-with-empty collapses it back. New notes are appended to
   the .hist list at the bottom of the page. */

.note-quick {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
    padding: 12px 16px;
    border: 1px solid var(--t-rule);
    border-left: 3px solid var(--t-ink);
    border-radius: 3px;
    background: var(--t-card);
    color: var(--t-mute);
    font-size: 13px;
    font-family: var(--f-serif);
    font-style: italic;
    cursor: text;
    box-shadow: var(--t-shadow-sm);
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
    min-height: 44px;
}
.note-quick:hover {
    border-color: var(--t-ink);
    border-left-color: var(--t-ink);
    color: var(--t-ink);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.note-quick-glyph { color: var(--t-ink); font-family: var(--f-sans); font-style: normal; font-size: 15px; flex-shrink: 0; font-weight: 600; }
.note-quick-label { flex: 1; line-height: 1.3; }
.note-quick-kbd {
    font-family: "JetBrains Mono", "SF Mono", monospace;
    font-size: 10px;
    font-style: normal;
    padding: 3px 7px;
    border: 1px solid var(--t-rule);
    border-radius: 2px;
    background: var(--t-surf);
    color: var(--t-mute);
    letter-spacing: 0;
    font-weight: 500;
}

.hist-head { margin-top: 56px; }

.note-composer {
    margin: 22px 0 0;
    padding: 16px 20px 14px;
    background: var(--t-card);
    border: 1px solid var(--t-rule);
    border-left: 2px solid var(--t-ink);
    border-radius: 3px;
    transition: border-left-color 140ms ease;
}
.note-composer:focus-within { border-left-color: var(--t-accent); }
.note-composer-title {
    display: none;
    width: 100%;
    padding: 0 0 6px;
    border: 0;
    border-bottom: 1px solid var(--t-rule);
    background: transparent;
    font-family: var(--f-sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--t-ink);
    outline: 0;
    margin-bottom: 10px;
}
.note-composer.is-focused .note-composer-title { display: block; }
.note-composer-body {
    width: 100%;
    min-height: 54px;
    padding: 0;
    border: 0;
    background: transparent;
    resize: none;
    font-family: var(--f-serif);
    font-size: 15px;
    line-height: 1.6;
    color: var(--t-ink);
    outline: 0;
}
.note-composer-body::placeholder { color: var(--t-faint); font-style: italic; }
.note-composer-bar {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--t-rule);
}
.note-composer.is-focused .note-composer-bar { display: flex; }
.note-composer-hint {
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--t-faint);
    font-weight: 500;
}
.note-composer-hint kbd {
    font-family: "JetBrains Mono", "SF Mono", monospace;
    font-size: 10px;
    padding: 1px 4px;
    background: var(--t-soft-bg);
    border-radius: 2px;
    margin: 0 1px;
}
.note-composer-actions { display: flex; gap: 8px; }

/* Note entries */
.hist { display: flex; flex-direction: column; }
.hist-entry {
    padding: 18px 0 20px;
    border-bottom: 1px solid var(--t-rule);
    position: relative;
}
.hist-entry:last-child { border-bottom: 0; }
.hist-entry:hover .hist-actions { opacity: 1; }
.hist-when {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--t-faint);
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.hist-when .author { color: var(--t-mute); letter-spacing: 0.04em; text-transform: none; font-weight: 500; }
.hist-when .author-ai {
    color: var(--t-accent);
    letter-spacing: 0.14em;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
}
.hist-title {
    font-family: var(--f-sans);
    font-size: 15px;
    font-weight: 600;
    color: var(--t-ink);
    line-height: 1.35;
    margin-bottom: 6px;
}
.hist-body {
    font-family: var(--f-serif);
    font-size: 15px;
    line-height: 1.62;
    color: var(--t-ink);
}
.hist-body p { margin: 0 0 0.7em; }
.hist-body p:last-child { margin-bottom: 0; }
.hist-body.is-collapsed {
    max-height: 3.2em;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
            mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
    cursor: pointer;
}
.hist-expand {
    display: inline-block;
    margin-top: 6px;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--t-faint);
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    border: 0;
    padding: 0;
    font-family: inherit;
}
.hist-expand:hover { color: var(--t-ink); }
.hist-actions {
    position: absolute;
    top: 18px;
    right: 0;
    display: inline-flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 140ms ease;
}
.hist-entry.is-ai {
    background: var(--t-accent-whisper);
    border-left: 2px solid var(--t-accent);
    padding-left: 16px;
    margin-left: -18px;
}
.hist-entry.is-ai .hist-title { font-family: var(--f-serif); font-style: italic; font-weight: 500; }

/* Signoff */
.task-signoff {
    margin-top: 64px;
    padding-top: 18px;
    border-top: 1px solid var(--t-rule);
    font-family: var(--f-serif);
    font-style: italic;
    font-size: 12px;
    color: var(--t-faint);
    text-align: center;
    letter-spacing: 0.04em;
}

/* ---- Responsive: rail flows into column at ≤960px ---- */
@media (max-width: 960px) {
    .task {
        grid-template-columns: 1fr;
        column-gap: 0;
        padding: 40px 32px 100px;
    }
    .task > .margin { position: static; }
    .rail-context-section { margin-top: 40px; }
}
@media (max-width: 640px) {
    .task { padding: 24px 18px 80px; }
    .task-title { font-size: 28px; }
    .task-synopsis { padding: 16px 18px; font-size: 15px; }
    .note-composer { padding: 16px 18px; }
    .rail { grid-template-columns: 1fr; row-gap: 4px; }
    .rail-k { padding-top: 10px; }
    .act-strip { gap: 4px; }
    .act { font-size: 11px; padding: 6px 8px; }
    .act-more { margin-left: 0; }
    /* Mobile tap targets */
    .cbox { width: 22px; height: 22px; }
    .achip { padding: 6px 10px; font-size: 12px; }
}
