@charset "UTF-8";
/* ================================================================ */
/* Object-history timeline (#133) — HistoryTimelineAdminMixin        */
/* Rendered on the standard object-history page for any admin using  */
/* the mixin, so selectors are scoped to the .th-history container   */
/* (NOT a body class). Custom CSS is the sanctioned dark-mode escape  */
/* hatch (docs/system/design/dark-mode.md): colours come from the    */
/* complete --t-* semantic tokens (which flip with .dark on their    */
/* own); the --color-* ramp vars are full rgb(...) values here, so   */
/* they're used PLAIN (never wrapped in rgb()/rgba()).               */
/* ================================================================ */

.th-history {
    max-width: 880px;
}

/* When the timeline is injected into the peek drawer: a touch wider than the
   default 460px record drawer since a timeline reads better with room, and the
   inner content spans the drawer body full-width. */
.th-drawer--wide {
    width: 620px;
}
.th-drawer-body .th-history {
    max-width: none;
}
.th-peek-loading {
    font-size: 12.5px;
    color: var(--color-base-400);
    padding: 8px 0;
}
.th-history-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 24px;
}
.th-history-title {
    font-family: var(--font-display, inherit);
    font-size: 20px;
    font-weight: 600;
    color: var(--t-ink);
    margin: 0;
}
.th-history-object {
    font-size: 13px;
    color: var(--color-base-400);
}

.th-history-eyebrow {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-base-500);
    margin-bottom: 12px;
}
.th-history-eyebrow--timeline {
    margin-top: 32px;
}

/* Milestone stamps — the reclaimed audit table, as a hairline-split grid */
.th-history-stamps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1px;
    background: var(--t-border-hairline);
    border: 1px solid var(--t-border-hairline);
    border-radius: 10px;
    overflow: hidden;
}
.th-history .th-stamp {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 11px 14px;
    background: var(--t-surface);
}
.th-history .th-stamp-label {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--color-base-400);
}
.th-history .th-stamp-when {
    font-size: 13px;
    font-weight: 500;
    color: var(--t-ink);
    font-variant-numeric: tabular-nums;
}
.th-history .th-stamp-actor {
    font-size: 11px;
    color: var(--color-base-400);
}
.th-history .th-stamp--empty .th-stamp-when {
    color: var(--t-disabled);
    font-weight: 400;
}
.th-history-note {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--t-warn) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--t-warn) 40%, transparent);
    font-size: 12.5px;
    color: var(--t-ink);
}

/* Filter chips */
.th-history-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.th-history .th-hchip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 12px;
    border: 1px solid var(--t-border-hairline);
    border-radius: 999px;
    background: var(--t-surface);
    font-size: 12px;
    font-weight: 500;
    color: var(--color-base-500);
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease, background-color 0.12s ease;
}
.th-history .th-hchip:hover {
    border-color: var(--t-disabled);
    color: var(--t-ink);
}
.th-history .th-hchip.is-active {
    border-color: var(--t-primary);
    background: color-mix(in srgb, var(--t-primary) 10%, transparent);
    color: var(--t-primary);
}
.th-history .th-hchip-count {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--color-base-400);
}
.th-history .th-hchip.is-active .th-hchip-count {
    color: var(--t-primary);
}
.th-history .th-hchip.is-empty {
    opacity: 0.5;
}

/* Timeline — vertical rail with a node per event */
.th-history .th-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}
.th-history .th-timeline-item {
    display: flex;
    gap: 14px;
    position: relative;
    padding-bottom: 18px;
}
/* Connector rail behind the node icons — hidden on the last row */
.th-history .th-timeline-item::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 30px;
    bottom: -3px;
    width: 2px;
    background: var(--t-border-hairline);
}
.th-history .th-timeline-item:last-child::before {
    display: none;
}
.th-history .th-timeline-rail {
    flex: 0 0 auto;
    z-index: 1;
}
.th-history .th-timeline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 33px;
    height: 33px;
    border-radius: 50%;
    background: var(--t-surface);
    border: 1px solid var(--t-border-hairline);
    color: var(--color-base-400);
    font-size: 18px;
}
/* Category accents on the node — three distinct hues so the eye sorts events   */
/* at a glance: lifecycle transitions (the hero "progress" events) take the     */
/* green --t-success, edits the steel --t-info, recommendations the gold        */
/* --t-warn. All three are complete semantic tokens that flip with .dark.       */
.th-history .th-timeline-item--lifecycle .th-timeline-icon {
    color: var(--t-success);
    border-color: color-mix(in srgb, var(--t-success) 50%, transparent);
}
.th-history .th-timeline-item--recommendation .th-timeline-icon {
    color: var(--t-warn);
    border-color: color-mix(in srgb, var(--t-warn) 45%, transparent);
}
.th-history .th-timeline-item--edit .th-timeline-icon {
    color: var(--t-info);
    border-color: color-mix(in srgb, var(--t-info) 45%, transparent);
}
.th-history .th-timeline-card {
    flex: 1 1 auto;
    padding-top: 5px;
    min-width: 0;
}
.th-history .th-timeline-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}
.th-history .th-timeline-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--t-ink);
}
.th-history .th-timeline-when {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--color-base-400);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.th-history .th-timeline-badge {
    display: inline-flex;
    align-items: center;
    height: 17px;
    padding: 0 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--t-info) 12%, transparent);
    color: var(--t-info);
    font-family: var(--font-mono);
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.th-history .th-timeline-detail {
    margin-top: 3px;
    font-size: 12.5px;
    color: var(--color-base-500);
    /* Providers may put one change per line (e.g. per operation/material); honour
       the newlines while still collapsing incidental whitespace. */
    white-space: pre-line;
}
.th-history .th-timeline-reason {
    margin-top: 5px;
    padding-left: 10px;
    border-left: 2px solid var(--t-border-bright);
    font-size: 12.5px;
    font-style: italic;
    color: var(--color-base-500);
}
.th-history .th-timeline-actor {
    margin-top: 4px;
    font-size: 11px;
    color: var(--color-base-400);
}
.th-history-empty {
    padding: 16px;
    border: 1px dashed var(--t-border-bright);
    border-radius: 10px;
    font-size: 12.5px;
    color: var(--color-base-400);
}
