/*
 * Shared editorial shell wrapper for FCT tool/app pages.
 * These routes keep their richer app-specific interactions while
 * adopting the editorial nav, page chrome, and card language.
 */

.ffn-tool-page {
    position: relative;
    z-index: 1;
}

.ffn-tool-page .ffn-pilot-shell {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ffn-tool-page .tp-fab {
    z-index: 45;
}

.ffn-tool-page--news .news-wire-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0;
    border-top: 1px solid var(--ffn-ed-border);
    border-bottom: 1px solid var(--ffn-ed-border);
    color: var(--ffn-ed-text-soft);
    font-family: var(--ffn-ed-font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    line-height: 1.45;
    text-transform: uppercase;
}

.ffn-tool-page--news .news-wire-status a,
.ffn-tool-page--news .news-wire-actions a {
    color: var(--ffn-ed-accent);
    text-decoration: none;
}

.ffn-tool-page--news .news-wire-status a:hover,
.ffn-tool-page--news .news-wire-status a:focus-visible,
.ffn-tool-page--news .news-wire-actions a:hover,
.ffn-tool-page--news .news-wire-actions a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 0.22em;
}

.ffn-tool-page--news .news-wire-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(11rem, 15rem);
    gap: 0.75rem;
    margin-top: 1rem;
}

.ffn-tool-page--news .news-wire-input,
.ffn-tool-page--news .news-wire-select {
    width: 100%;
    min-height: 2.8rem;
    padding: 0.68rem 0.8rem;
    border: 1px solid var(--ffn-ed-border);
    border-radius: 0.4rem;
    background: var(--ffn-ed-surface-strong);
    color: var(--ffn-ed-text);
    font: 600 0.86rem/1.25 var(--ffn-ed-font-sans);
}

.ffn-tool-page--news .news-wire-input::placeholder {
    color: var(--ffn-ed-text-soft);
}

.ffn-tool-page--news .news-wire-input:focus,
.ffn-tool-page--news .news-wire-select:focus {
    border-color: var(--ffn-ed-accent);
    outline: 2px solid var(--ffn-ed-accent-soft);
    outline-offset: 1px;
}

.ffn-tool-page--news .news-results-meta {
    margin: 0.65rem 0 0;
    color: var(--ffn-ed-text-soft);
    font-family: var(--ffn-ed-font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.4;
    text-transform: uppercase;
}

/* The wire sits on its own solid panel so stories read against a calm
   surface instead of the field texture behind the page. The panel is capped
   to the story column so it does not leave an empty half on wide screens. */
.ffn-tool-page--news .ffn-pilot-section {
    max-width: 62rem;
    padding: clamp(1.15rem, 2.5vw, 1.8rem) clamp(1.15rem, 2.8vw, 2rem) clamp(1.35rem, 3vw, 2.1rem);
    border: 1px solid var(--ffn-ed-border);
    border-radius: var(--ffn-ed-radius-card);
    background: var(--ffn-ed-surface);
}

.ffn-tool-page--news .news-wire-list {
    margin-top: 1.25rem;
}

/* The timecode spine: each story hangs off a continuous vertical wire,
   pinned by a node colored to its alert type, with the relative time
   stamped large in mono in the left rail. Chronology is the structure. */
.ffn-tool-page--news .news-wire-item {
    --wire-tone: var(--ffn-ed-accent);
    position: relative;
    display: grid;
    grid-template-columns: 5.75rem minmax(0, 1fr);
    gap: 0 1.5rem;
    padding: 1.35rem 0 1.5rem;
}

.ffn-tool-page--news .news-wire-item.type-breaking {
    --wire-tone: #b42318;
}

.ffn-tool-page--news .news-wire-item.type-watch {
    --wire-tone: #a15c00;
}

.ffn-tool-page--news .news-wire-item.type-analysis {
    --wire-tone: #087f52;
}

html[data-theme="dark"] .ffn-tool-page--news .news-wire-item.type-breaking {
    --wire-tone: #ff7b72;
}

html[data-theme="dark"] .ffn-tool-page--news .news-wire-item.type-watch {
    --wire-tone: #f6bd60;
}

html[data-theme="dark"] .ffn-tool-page--news .news-wire-item.type-analysis {
    --wire-tone: #65d6a4;
}

/* The wire itself */
.ffn-tool-page--news .news-wire-item::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 5.75rem;
    width: 1px;
    background: var(--ffn-ed-border);
}

.ffn-tool-page--news .news-wire-item:first-child::before {
    top: 1.75rem;
}

.ffn-tool-page--news .news-wire-item:last-child::before {
    bottom: auto;
    height: 1.75rem;
}

/* The node */
.ffn-tool-page--news .news-wire-item::after {
    content: "";
    position: absolute;
    top: 1.52rem;
    left: calc(5.75rem - 0.26rem);
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--wire-tone);
    box-shadow: 0 0 0 4px var(--ffn-ed-surface-strong);
}

.ffn-tool-page--news .news-wire-rail {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
    padding-right: 1.1rem;
    padding-top: 0.35rem;
    text-align: right;
}

.ffn-tool-page--news .news-wire-stamp {
    color: var(--ffn-ed-text);
    font-family: var(--ffn-ed-font-mono);
    font-size: clamp(1.05rem, 2vw, 1.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    white-space: nowrap;
}

.ffn-tool-page--news .news-wire-stamp-unit {
    color: var(--ffn-ed-text-soft);
    font-family: var(--ffn-ed-font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.2;
}

.ffn-tool-page--news .news-wire-content {
    min-width: 0;
}

.ffn-tool-page--news .news-wire-meta-time {
    display: none;
}

.ffn-tool-page--news .news-wire-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.55rem;
    color: var(--ffn-ed-text-soft);
    font-family: var(--ffn-ed-font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    line-height: 1.45;
    text-transform: uppercase;
}

.ffn-tool-page--news .news-wire-meta > span:not(:first-child)::before {
    content: "/";
    margin-right: 0.55rem;
    color: var(--ffn-ed-border-strong);
}

.ffn-tool-page--news .news-wire-type {
    font-weight: 800;
}

.ffn-tool-page--news .news-wire-type.type-breaking {
    color: #b42318;
}

.ffn-tool-page--news .news-wire-type.type-watch {
    color: #a15c00;
}

.ffn-tool-page--news .news-wire-type.type-analysis {
    color: #087f52;
}

html[data-theme="dark"] .ffn-tool-page--news .news-wire-type.type-breaking {
    color: #ff7b72;
}

html[data-theme="dark"] .ffn-tool-page--news .news-wire-type.type-watch {
    color: #f6bd60;
}

html[data-theme="dark"] .ffn-tool-page--news .news-wire-type.type-analysis {
    color: #65d6a4;
}

.ffn-tool-page--news .news-wire-headline {
    max-width: 34ch;
    margin: 0.42rem 0 0;
    text-wrap: balance;
    color: var(--ffn-ed-text);
    font-family: var(--ffn-ed-font-sans);
    font-size: clamp(1.25rem, 2.4vw, 1.7rem);
    font-weight: 850;
    letter-spacing: -0.03em;
    line-height: 1.1;
    transition: color 0.16s ease;
}

.ffn-tool-page--news .news-wire-item:hover .news-wire-headline {
    color: var(--ffn-ed-accent);
}

.ffn-tool-page--news .news-wire-body {
    max-width: 70ch;
    margin: 0.55rem 0 0;
    color: var(--ffn-ed-text-muted);
    font-size: 0.94rem;
    line-height: 1.55;
}

.ffn-tool-page--news .news-wire-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    margin-top: 0.7rem;
    font-family: var(--ffn-ed-font-mono);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.065em;
    line-height: 1.4;
    text-transform: uppercase;
}

.ffn-tool-page--news .news-empty {
    padding: 1.5rem 0;
    border-top: 1px solid var(--ffn-ed-border);
    color: var(--ffn-ed-text-muted);
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.55;
}

.ffn-tool-page--news .news-empty.news-empty-error {
    color: #b42318;
}

html[data-theme="dark"] .ffn-tool-page--news .news-empty.news-empty-error {
    color: #ff7b72;
}

.ffn-tool-page--draft #draft-main {
    font-family: var(--ffn-ed-font-sans);
    padding-top: 0 !important;
    background: transparent;
    min-height: auto;
}

.ffn-tool-page--draft .draft-hero {
    border-radius: var(--ffn-ed-radius-card);
    overflow: hidden;
}

.ffn-tool-page--draft .draft-stats {
    position: relative;
    z-index: 3;
}

.ffn-tool-page--draft .draft-controls,
.ffn-tool-page--draft .draft-panel {
}

.ffn-tool-page--depth #depth-chart-main {
    padding-top: 0 !important;
    min-height: auto;
    background: transparent;
}

.ffn-tool-page--depth .dc-hero {
    border-radius: var(--ffn-ed-radius-card);
    overflow: hidden;
}

.ffn-tool-page--depth .dc-shell {
    max-width: none;
    padding: 0;
}

.ffn-tool-page--depth .dc-team-picker,
.ffn-tool-page--depth .dc-chart-shell {
}

.ffn-tool-page--draft-kit .draft-kit-page {
    padding-bottom: 2rem;
}

.ffn-tool-page--draft-kit .draft-hero {
    margin: 0 0 3rem;
    border-radius: var(--ffn-ed-radius-card);
    overflow: hidden;
}

.ffn-tool-page--academy #academy-main {
    min-height: auto;
    background: transparent;
}

.ffn-tool-page--academy .ac-hero {
    border-radius: var(--ffn-ed-radius-card);
    overflow: hidden;
}

@media (max-width: 768px) {
    .ffn-tool-page--news .news-wire-controls {
        grid-template-columns: minmax(0, 1fr);
    }

    .ffn-tool-page--news .news-wire-status {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .ffn-tool-page--news .news-wire-headline {
        max-width: none;
        font-size: clamp(1.15rem, 5.6vw, 1.42rem);
    }

    /* Collapse the spine on small screens: time returns to the meta row */
    .ffn-tool-page--news .news-wire-item {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding: 1.15rem 0 1.25rem 0.9rem;
        border-top: 1px solid var(--ffn-ed-border);
        box-shadow: inset 3px 0 0 var(--wire-tone);
    }

    .ffn-tool-page--news .news-wire-item::before,
    .ffn-tool-page--news .news-wire-item::after,
    .ffn-tool-page--news .news-wire-rail {
        display: none;
    }

    .ffn-tool-page--news .news-wire-meta-time {
        display: inline;
    }

    .ffn-tool-page--news .news-wire-list {
        border-bottom: 1px solid var(--ffn-ed-border);
    }

    .ffn-tool-page--depth .dc-shell {
        margin-top: -40px;
    }

    .ffn-tool-page--draft-kit .draft-hero {
        margin-bottom: 2rem;
    }

    .ffn-tool-page--academy .ac-track-shell {
        padding-left: 0;
        padding-right: 0;
    }
}

.ffn-tool-page--news .news-wire-item.type-update {
    --wire-tone: #52607a;
}

html[data-theme="dark"] .ffn-tool-page--news .news-wire-item.type-update {
    --wire-tone: #9fb0c9;
}

.ffn-tool-page--news .news-wire-type.type-update {
    color: #52607a;
}

html[data-theme="dark"] .ffn-tool-page--news .news-wire-type.type-update {
    color: #9fb0c9;
}
