/* global.css */

/* =========================
   ROOT TOKENS & RESETS
   ========================= */
:root {
    /* Brand colours */
    --tf-color-primary: #0D1C2A;        /* Deep navy */
    --tf-color-primary-soft: #111827;
    --tf-color-accent: #4A6FA5;         /* Steel blue */
    --tf-color-accent-dark: #3A5C88;
    --tf-color-accent-light: #8FB3D9;

    /* Neutrals */
    --tf-color-bg: #0B1220;
    --tf-color-page: #F8FAFC;
    --tf-color-surface: #FFFFFF;
    --tf-color-surface-subtle: #F1F5F9;
    --tf-color-border-subtle: rgba(15, 23, 42, 0.06);
    --tf-color-border-strong: rgba(15, 23, 42, 0.12);
    --tf-color-text-main: #0F172A;
    --tf-color-text-muted: #6B7280;
    --tf-color-text-soft: #9CA3AF;

    /* Semantic */
    --tf-color-success: #16A34A;
    --tf-color-warning: #EA580C;
    --tf-color-danger: #DC2626;
    --tf-color-info: #0EA5E9;

    /* Shadows */
    --tf-shadow-soft: 0 2px 6px rgba(15, 23, 42, 0.08);
    --tf-shadow-medium: 0 4px 12px rgba(15, 23, 42, 0.12);

    /* Radius */
    --tf-radius-sm: 4px;
    --tf-radius-md: 6px;
    --tf-radius-lg: 10px;

    /* Spacing scale */
    --tf-space-xs: 8px;
    --tf-space-s: 16px;
    --tf-space-m: 24px;
    --tf-space-l: 40px;
    --tf-space-xl: 64px;
    --tf-space-xxl: 96px;

    /* Layout */
    --tf-page-width: 1280px;
    --tf-sidebar-width: 260px;
    --tf-topbar-height: 60px;

    /* Typography */
    --tf-font-body: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --tf-font-display: "Montserrat Alternates", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--tf-font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--tf-color-text-main);
    background: radial-gradient(circle at top left, #1E293B 0, #020617 40%, #020617 100%);
}

/* =========================
   GLOBAL LAYOUT
   ========================= */

.tf-body {
    min-height: 100vh;
}

.tf-app-shell {
    display: grid;
    grid-template-columns: var(--tf-sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
    color: var(--tf-color-text-main);
}

/* SIDEBAR */

.tf-sidebar {
    background: #020617;
    color: #E5E7EB;
    padding: var(--tf-space-l) var(--tf-space-m);
    border-right: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    flex-direction: column;
    gap: var(--tf-space-l);
    position: sticky;
    top: 0;
    align-self: start;
    min-height: 100vh;
}

.tf-sidebar__brand {
    display: flex;
    align-items: center;
    gap: var(--tf-space-s);
}

.tf-logo-mark {
    width: 40px;
    height: auto;
    object-fit: contain;
}

.tf-logo-mark--small {
    width: 32px;
}

.tf-sidebar__brand-text {
    display: flex;
    flex-direction: column;
}

.tf-sidebar__brand-name {
    font-weight: 600;
    font-size: 16px;
}

.tf-sidebar__brand-tagline {
    font-size: 13px;
    color: #9CA3AF;
}

.tf-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tf-sidebar__link {
    padding: 8px 10px;
    border-radius: var(--tf-radius-md);
    color: #CBD5F5;
    text-decoration: none;
    font-size: 14px;
    display: block;
}

.tf-sidebar__link:hover {
    background-color: rgba(148, 163, 184, 0.16);
}

.tf-sidebar__link--active {
    background: linear-gradient(90deg, rgba(74,111,165,0.5), rgba(74,111,165,0.1));
    color: #E5E7EB;
}

.tf-sidebar__footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: var(--tf-space-m);
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

/* MAIN */

.tf-main {
    min-height: 100vh;
    background: var(--tf-color-page);
    padding-bottom: var(--tf-space-xxl);
}

/* TOPBAR */

.tf-topbar {
    height: var(--tf-topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--tf-space-xl);
    border-bottom: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(15, 23, 42, 0.97);
    color: #E5E7EB;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
}

.tf-topbar__breadcrumbs {
    font-size: 13px;
    color: #9CA3AF;
}

.tf-topbar__meta {
    display: flex;
    gap: 6px;
}

/* PILLS */

.tf-pill {
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid transparent;
}

.tf-pill--neutral {
    border-color: rgba(148, 163, 184, 0.6);
    color: #CBD5F5;
}

.tf-pill--accent {
    background: rgba(74,111,165,0.2);
    border-color: rgba(74,111,165,0.8);
    color: #E5E7EB;
}

/* =========================
   SECTION STRUCTURE
   ========================= */

.tf-section {
    max-width: var(--tf-page-width);
    margin: 0 auto;
    padding: var(--tf-space-xxl) var(--tf-space-xl) 0 var(--tf-space-xl);
}

.tf-section__header {
    margin-bottom: var(--tf-space-l);
}

/* PROSE (for markdown content) */

.tf-prose {
    max-width: 720px;
    line-height: 1.7;
    color: var(--tf-color-text-main);
}

.tf-prose h1 {
    font-family: var(--tf-font-display);
    font-size: 36px;
    line-height: 1.2;
    font-weight: 700;
    margin: 0 0 var(--tf-space-m);
    color: var(--tf-color-text-main);
}

.tf-prose h2 {
    font-size: 22px;
    line-height: 1.3;
    font-weight: 600;
    margin: var(--tf-space-l) 0 var(--tf-space-s);
    color: var(--tf-color-text-main);
}

.tf-prose p {
    margin: 0 0 var(--tf-space-s);
}

.tf-prose ul {
    margin: 0 0 var(--tf-space-s);
    padding-left: var(--tf-space-m);
}

.tf-prose li {
    margin-bottom: 6px;
}

.tf-prose a {
    color: var(--tf-color-accent);
    text-decoration: underline;
}

.tf-prose a:hover {
    color: var(--tf-color-accent-dark);
}

/* TYPOGRAPHY */

.tf-heading-1 {
    font-family: var(--tf-font-display);
    font-size: 48px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 var(--tf-space-s);
    color: var(--tf-color-text-main);
}

.tf-heading-2 {
    font-size: 36px;
    line-height: 1.2;
    font-weight: 600;
    margin: 0 0 var(--tf-space-s);
    color: var(--tf-color-text-main);
}

.tf-heading-2--light {
    color: #E5E7EB;
}

.tf-heading-3 {
    font-size: 28px;
    line-height: 1.25;
    font-weight: 600;
    margin: 0 0 var(--tf-space-s);
}

.tf-heading-4 {
    font-size: 22px;
    line-height: 1.3;
    font-weight: 500;
    margin: 0 0 6px;
}

.tf-heading-5 {
    font-size: 18px;
    line-height: 1.35;
    font-weight: 500;
    margin: 0 0 4px;
}

.tf-lede {
    font-size: 18px;
    line-height: 1.6;
    color: var(--tf-color-text-muted);
}

.tf-body-text {
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 8px;
}

.tf-body-text--muted {
    color: var(--tf-color-text-muted);
}

.tf-body-text--light {
    color: #E5E7EB;
}

.tf-body-text--small {
    font-size: 14px;
}

.tf-display-slogan {
    font-family: var(--tf-font-display);
    font-size: 52px;
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin: 0 0 var(--tf-space-s);
    color: var(--tf-color-primary);
}

.tf-text-accent {
    color: var(--tf-color-accent);
}

.tf-text-muted {
    color: var(--tf-color-text-muted);
}

/* EYEBROW */

.tf-eyebrow {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    color: var(--tf-color-text-soft);
    margin-bottom: var(--tf-space-xs);
}

.tf-eyebrow--light {
    color: #9CA3AF;
}

/* LISTS */

.tf-list {
    padding-left: 1.1em;
    margin: 0 0 var(--tf-space-s);
}

.tf-list li {
    margin-bottom: 4px;
}

.tf-list--compact li {
    margin-bottom: 2px;
}

.tf-list--numbered {
    list-style: decimal;
}

/* GRID */

.tf-grid {
    display: grid;
    gap: var(--tf-space-m);
}

.tf-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tf-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tf-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tf-grid--stretch > * {
    height: 100%;
}

.tf-grid--stack-mobile {
    /* modified in media queries */
}

/* CARDS */

.tf-card {
    background: var(--tf-color-surface);
    border-radius: var(--tf-radius-md);
    border: 1px solid var(--tf-color-border-subtle);
    padding: var(--tf-space-m);
    box-shadow: var(--tf-shadow-soft);
    transition: box-shadow 0.15s ease-out, transform 0.1s ease-out;
}

.tf-card--subtle {
    background: #F9FAFB;
    box-shadow: none;
}

.tf-card--highlight {
    background: #E5EDF9;
    border-color: rgba(59, 130, 246, 0.3);
}

.tf-card--hero {
    padding: var(--tf-space-l);
}

.tf-card--margin-top {
    margin-top: var(--tf-space-l);
}

.tf-card__note {
    margin-top: var(--tf-space-s);
    font-size: 14px;
}

/* Card hover (desktop) */
@media (hover: hover) and (pointer: fine) {
    .tf-card:hover {
        box-shadow: var(--tf-shadow-medium);
        transform: translateY(-1px);
    }
}

/* COLOUR CARDS */

.tf-color-card {
    display: flex;
    flex-direction: column;
    gap: var(--tf-space-s);
}

.tf-color-swatch {
    border-radius: var(--tf-radius-md);
    height: 90px;
    border: 1px solid var(--tf-color-border-subtle);
}

.tf-color-swatch--primary {
    background: var(--tf-color-primary);
}

.tf-color-swatch--accent {
    background: var(--tf-color-accent);
}

.tf-color-swatch--neutral {
    background: linear-gradient(90deg, #F1F5F9, #E5E7EB);
}

.tf-color-swatch--success {
    background: var(--tf-color-success);
}

.tf-color-swatch--warning {
    background: var(--tf-color-warning);
}

.tf-color-swatch--danger {
    background: var(--tf-color-danger);
}

.tf-color-swatch--info {
    background: var(--tf-color-info);
}

.tf-color-card__body {
    font-size: 14px;
}

/* TABS */

.tf-tabs {
    margin-top: var(--tf-space-m);
    padding-top: var(--tf-space-s);
    border-top: 1px solid var(--tf-color-border-subtle);
    /* Layout: labels on top row, panel full-width below */
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    column-gap: 4px;
    row-gap: 0;
}

.tf-tabs--margin-top {
    margin-top: var(--tf-space-l);
}

.tf-tabs--margin-top-small {
    margin-top: var(--tf-space-m);
}

.tf-tabs__title {
    margin-bottom: var(--tf-space-s);
}

.tf-tabs input[type="radio"] {
    display: none;
}

.tf-tab-label {
    display: inline-block;
    padding: 6px 12px;
    margin-right: 4px;
    margin-bottom: 0;
    border-radius: var(--tf-radius-md) var(--tf-radius-md) 0 0;
    background: #E5E7EB;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--tf-color-border-subtle);
    border-bottom: none;
    color: #374151;
}

.tf-tab-label--compact {
    padding: 4px 10px;
    font-size: 12px;
}

.tf-tab-panel {
    /* Panel should sit below all labels and span full width */
    order: 1;
    width: 100%;
    display: none;
    padding: var(--tf-space-s) var(--tf-space-m);
    border-radius: 0 var(--tf-radius-md) var(--tf-radius-md) var(--tf-radius-md);
    border: 1px solid var(--tf-color-border-subtle);
    background: #F9FAFB;
    margin-top: -1px;
}

/* Show panel of checked radio */
.tf-tabs input[type="radio"]:checked + .tf-tab-label {
    background: #FFFFFF;
    color: var(--tf-color-primary);
    border-bottom: 1px solid #FFFFFF;
}

.tf-tabs input[type="radio"]:checked + .tf-tab-label + .tf-tab-panel {
    display: block;
}

/* TYPE SAMPLES */

.tf-type-samples > div {
    margin-bottom: var(--tf-space-s);
}

.tf-type-samples__meta {
    font-size: 12px;
    color: var(--tf-color-text-soft);
}

/* SPACING SCALE DEMO */

.tf-spacing-scale {
    display: flex;
    flex-wrap: wrap;
    gap: var(--tf-space-s);
    margin-top: var(--tf-space-s);
}

.tf-spacing-scale__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 13px;
    color: var(--tf-color-text-muted);
}

.tf-spacing-scale__block {
    width: 40px;
    background: var(--tf-color-accent-light);
    border-radius: var(--tf-radius-sm);
    margin-bottom: 4px;
}

.tf-spacing-scale__block--xs { height: var(--tf-space-xs); }
.tf-spacing-scale__block--s { height: var(--tf-space-s); }
.tf-spacing-scale__block--m { height: var(--tf-space-m); }
.tf-spacing-scale__block--l { height: var(--tf-space-l); }
.tf-spacing-scale__block--xl { height: var(--tf-space-xl); }
.tf-spacing-scale__block--xxl { height: var(--tf-space-xxl); }

/* BUTTONS */

.tf-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--tf-space-s);
    align-items: center;
    margin-top: var(--tf-space-s);
}

.tf-btn {
    font-family: var(--tf-font-body);
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--tf-radius-md);
    padding: 12px 22px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.08s ease;
}

.tf-btn-primary {
    background: var(--tf-color-accent);
    color: #FFFFFF;
    box-shadow: var(--tf-shadow-soft);
}

.tf-btn-primary:hover {
    background: var(--tf-color-accent-dark);
    box-shadow: var(--tf-shadow-medium);
    transform: translateY(-1px);
}

.tf-btn-secondary {
    background: transparent;
    color: var(--tf-color-accent);
    border: 1px solid var(--tf-color-accent);
}

.tf-btn-secondary:hover {
    background: rgba(74,111,165,0.08);
}

.tf-btn-secondary--small {
    padding: 8px 14px;
    font-size: 13px;
}

.tf-btn-tertiary {
    background: transparent;
    color: var(--tf-color-accent);
    border: none;
    padding: 10px 6px;
}

.tf-btn-tertiary--light {
    color: #E5E7EB;
}

/* Active / pressed state */
.tf-btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.35);
}

.tf-btn-primary:active {
    background: var(--tf-color-accent-dark);
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.35);
}

.tf-btn-secondary:active {
    background: rgba(74,111,165,0.15);
    transform: translateY(1px) scale(0.98);
}


/* SELECTS (single + multi) */
.tf-form__select {
    border-radius: var(--tf-radius-md);
    border: 1px solid var(--tf-color-border-subtle);
    padding: 10px 32px 10px 12px;
    font-family: var(--tf-font-body);
    font-size: 14px;
    background: #FFFFFF;
    line-height: 1.4;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
            linear-gradient(45deg, #6B7280 50%, transparent 50%),
            linear-gradient(-45deg, #6B7280 50%, transparent 50%);
    background-position:
            calc(100% - 14px) 55%,
            calc(100% - 9px) 55%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.tf-form__select--multiple {
    padding-right: 12px;
    min-height: 120px;
}

.tf-form__select:focus-visible {
    outline: none;
    border-color: var(--tf-color-accent);
    box-shadow: 0 0 0 1px rgba(74,111,165,0.3);
}

/* RADIO GROUPS */
.tf-radio-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.tf-radio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--tf-color-text-main);
    cursor: pointer;
}

.tf-radio__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tf-radio__control {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 1px solid var(--tf-color-border-subtle);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    box-shadow: 0 0 0 0 transparent;
    transition: border-color 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}

.tf-radio__control::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--tf-color-accent);
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.tf-radio__input:checked + .tf-radio__control {
    border-color: var(--tf-color-accent);
    background: #FFFFFF;
}

.tf-radio__input:checked + .tf-radio__control::after {
    opacity: 1;
    transform: scale(1);
}

.tf-radio__input:focus-visible + .tf-radio__control {
    box-shadow: 0 0 0 2px rgba(74,111,165,0.5);
}

/* VALIDATION STATES */
.tf-form__input--invalid,
.tf-form__select--invalid,
.tf-form__textarea--invalid {
    border-color: var(--tf-color-danger);
    box-shadow: 0 0 0 1px rgba(220,38,38,0.2);
}

.tf-form__error {
    margin-top: 4px;
    font-size: 12px;
    color: var(--tf-color-danger);
}

/* Product claim annotation (CI-visible, user-invisible) */
.tf-copy-claim {
    /* Intentionally no visual styling. Used by CI to identify relevant content */
}

/* HERO */

.tf-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: var(--tf-space-l);
    align-items: center;
}

.tf-hero__note {
    margin-top: 10px;
    font-size: 14px;
}

.tf-hero__visual {
    display: flex;
    justify-content: flex-end;
}

/* DASHBOARD CARD / STATS */

.tf-dashboard-card {
    background: #020617;
    border-radius: var(--tf-radius-lg);
    padding: var(--tf-space-m);
    color: #E5E7EB;
    min-width: 280px;
    max-width: 360px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.5);
}

.tf-dashboard-card--compact {
    min-width: 260px;
    max-width: 320px;
}

.tf-dashboard-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--tf-space-s);
}

.tf-dashboard-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tf-tag {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.6);
}

.tf-tag--neutral {
    background: rgba(15, 23, 42, 0.4);
}

.tf-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.3);
    padding: 6px 0;
}

.tf-stat-row__label {
    color: #9CA3AF;
}

.tf-stat-row__value {
    font-weight: 600;
}

.tf-stat-row__value--good {
    color: #4ADE80;
}

/* FEATURE STEPS */

.tf-feature-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--tf-space-m);
    margin-top: var(--tf-space-m);
}

.tf-feature-step {
    border-radius: var(--tf-radius-md);
    border: 1px solid var(--tf-color-border-subtle);
    padding: var(--tf-space-m);
    background: var(--tf-color-surface-subtle);
    position: relative;
}

.tf-feature-step__badge {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--tf-color-accent);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    position: absolute;
    top: 14px;
    right: 14px;
}

/* TESTIMONIALS */

.tf-testimonial {
    background: #0F172A;
    color: #E5E7EB;
    border-radius: var(--tf-radius-md);
    padding: var(--tf-space-m);
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.7);
}

.tf-testimonial__stat {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #A5B4FC;
}

.tf-testimonial__quote {
    font-size: 15px;
    margin: 0 0 8px;
}

.tf-testimonial__meta {
    font-size: 13px;
    color: #9CA3AF;
}

/* FORMS */

.tf-form {
    display: flex;
    flex-direction: column;
    gap: var(--tf-space-m);
    margin-top: var(--tf-space-s);
}

.tf-form__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--tf-space-m);
}

.tf-form__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tf-form__label {
    font-size: 14px;
    font-weight: 500;
    color: var(--tf-color-text-main);
}

.tf-form__input,
.tf-form__textarea {
    border-radius: var(--tf-radius-md);
    border: 1px solid var(--tf-color-border-subtle);
    padding: 10px 12px;
    font-family: var(--tf-font-body);
    font-size: 14px;
    background: #FFFFFF;
}

.tf-form__input:focus,
.tf-form__textarea:focus {
    outline: none;
    border-color: var(--tf-color-accent);
    box-shadow: 0 0 0 1px rgba(74,111,165,0.3);
}

.tf-form__helper {
    font-size: 12px;
    color: var(--tf-color-text-soft);
}

.tf-form__actions {
    display: flex;
    align-items: center;
    gap: var(--tf-space-s);
}

.tf-form__hint {
    font-size: 13px;
    color: var(--tf-color-text-muted);
}

.tf-form__array-item {
    display: flex;
    align-items: center;
    gap: var(--tf-space-xs);
    margin-bottom: var(--tf-space-xs);
}

.tf-form__array-item .tf-form__input {
    flex: 1;
}

/* TABLES */

.tf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: var(--tf-space-s);
}

.tf-table th,
.tf-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--tf-color-border-subtle);
    text-align: left;
}

.tf-table thead th {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: var(--tf-color-text-soft);
    background: #EFF4FB;
}

.tf-table tbody tr:nth-child(even) {
    background: #F9FAFB;
}

.tf-table--compact th,
.tf-table--compact td {
    padding: 6px 10px;
}

/* ALERTS */

.tf-alert {
    border-radius: var(--tf-radius-md);
    padding: var(--tf-space-s) var(--tf-space-m);
    border: 1px solid var(--tf-color-border-subtle);
    background: #F9FAFB;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.tf-alert--info {
    border-color: rgba(14,165,233,0.4);
    background: #ECFEFF;
}

.tf-alert--success {
    border-color: rgba(22,163,74,0.4);
    background: #ECFDF3;
}

.tf-alert--warning {
    border-color: rgba(234,88,12,0.4);
    background: #FFF7ED;
}

.tf-alert--error {
    border-color: rgba(220,38,38,0.4);
    background: #FEF2F2;
}

/* PILLARS */

.tf-pillars {
    padding: var(--tf-space-m);
    border-radius: var(--tf-radius-md);
    background: #F9FAFB;
    border: 1px solid var(--tf-color-border-subtle);
}

/* EXAMPLE HOMEPAGE SURFACE */

.tf-hero-surface {
    border-radius: var(--tf-radius-lg);
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.6);
    background: radial-gradient(circle at top left, #1E293B 0, #020617 40%, #020617 100%);
    color: #E5E7EB;
    padding: var(--tf-space-m);
    display: flex;
    flex-direction: column;
    gap: var(--tf-space-m);
}

.tf-hero-surface__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}

.tf-hero-surface__nav-links {
    font-size: 13px;
    color: #9CA3AF;
}

.tf-hero-surface__hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: var(--tf-space-m);
    align-items: center;
}

.tf-hero-surface__hero-text {
    max-width: 520px;
}

.tf-hero-surface__hero-side {
    display: flex;
    justify-content: flex-end;
}

/* MOBILE DEVICE FRAME */

.tf-device-frame-mobile {
    width: 260px;
    border-radius: 26px;
    border: 2px solid #CBD5F5;
    padding: var(--tf-space-s);
    background: #0B1120;
    display: flex;
    flex-direction: column;
    gap: var(--tf-space-s);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.8);
}

.tf-device-frame-mobile__bar {
    width: 80px;
    height: 4px;
    border-radius: 999px;
    background: #1E293B;
    margin: 0 auto;
}

.tf-device-frame-mobile__section {
    background: #020617;
    border-radius: 18px;
    padding: 10px;
    border: 1px solid #1E293B;
}

.tf-device-frame-mobile__section--hero {
    padding-bottom: 16px;
}

.tf-device-frame-mobile__pill {
    width: 70px;
    height: 10px;
    border-radius: 999px;
    background: #1D4ED8;
    margin-bottom: 10px;
}

.tf-device-frame-mobile__line {
    height: 7px;
    border-radius: 999px;
    background: #111827;
    margin-bottom: 6px;
}

.tf-device-frame-mobile__line--headline {
    width: 80%;
}

.tf-device-frame-mobile__line--subline {
    width: 65%;
}

.tf-device-frame-mobile__line--short {
    width: 45%;
}

.tf-device-frame-mobile__button {
    border-radius: 999px;
    height: 20px;
    margin-top: 6px;
}

.tf-device-frame-mobile__button--primary {
    background: #1D4ED8;
}

.tf-device-frame-mobile__button--secondary {
    background: transparent;
    border: 1px solid #1D4ED8;
}

.tf-device-frame-mobile__card {
    height: 28px;
    border-radius: 10px;
    background: #020617;
    border: 1px solid #1F2937;
    margin-bottom: 8px;
}

/* DRAG AND DROP */

.tf-draggable {
    cursor: move;
    transition: opacity 0.15s ease, background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    border-radius: var(--tf-radius-md);
    padding: var(--tf-space-s);
    background: var(--tf-color-surface-subtle);
    border: 1px solid transparent;
}

.tf-draggable:hover {
    background: #E5E7EB;
    border-color: var(--tf-color-border-subtle);
}

.tf-dragging {
    opacity: 0.4;
    background: var(--tf-color-accent-light);
    border-color: var(--tf-color-accent);
    box-shadow: 0 4px 12px rgba(74, 111, 165, 0.3);
    transform: scale(1.02);
}

.tf-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: move;
    color: var(--tf-color-text-soft);
    user-select: none;
}

.tf-drag-handle:hover {
    color: var(--tf-color-accent);
}

.tf-drag-handle__icon {
    font-size: 18px;
    line-height: 1;
    letter-spacing: -2px;
}

.tf-grid--3.tf-grid--drag {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: var(--tf-space-s);
}

/* DOCUMENT LIST */

.tf-document-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tf-document-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tf-space-s);
    margin-bottom: var(--tf-space-xs);
}

.tf-document-list-header .tf-form__label {
    margin-bottom: 0;
}

.tf-document-row {
    user-select: none;
}

.tf-document-row--selected {
    background: rgba(74, 111, 165, 0.15);
    border-color: var(--tf-color-accent);
}

.tf-document-row--selected:hover {
    background: rgba(74, 111, 165, 0.2);
}

.tf-document-info {
    min-width: 0;
}

.tf-document-title {
    cursor: pointer;
    border-radius: var(--tf-radius-sm);
    padding: 2px 4px;
    margin: -2px -4px;
    transition: background-color 0.15s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tf-document-title:hover {
    background: rgba(74, 111, 165, 0.1);
}

.tf-document-title-input {
    font-family: var(--tf-font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--tf-color-text-main);
    background: var(--tf-color-surface);
    border: 1px solid var(--tf-color-accent);
    border-radius: var(--tf-radius-sm);
    padding: 2px 6px;
    width: 100%;
    outline: none;
}

.tf-document-title-input:focus {
    box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.3);
}

.tf-document-meta {
    display: flex;
    align-items: center;
    gap: var(--tf-space-xs);
}

.tf-document-date {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 6px;
}

.tf-document-date-input {
    font-family: var(--tf-font-body);
    font-size: 13px;
    width: 90px;
    padding: 4px 8px;
    border: 1px solid var(--tf-color-border-subtle);
    border-radius: var(--tf-radius-sm) 0 0 var(--tf-radius-sm);
    background: var(--tf-color-surface);
    color: var(--tf-color-text-main);
}

.tf-document-date-input:focus {
    outline: none;
    border-color: var(--tf-color-accent);
    box-shadow: 0 0 0 1px rgba(74,111,165,0.3);
    z-index: 1;
    position: relative;
}

.tf-document-date-input::placeholder {
    color: var(--tf-color-text-soft);
}

.tf-document-date-picker {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.tf-document-date-btn {
    font-size: 14px;
    padding: 4px 8px;
    border: 1px solid var(--tf-color-border-subtle);
    border-left: none;
    border-radius: 0 var(--tf-radius-sm) var(--tf-radius-sm) 0;
    background: var(--tf-color-surface-subtle);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tf-document-date-btn:hover {
    background: #E5E7EB;
}

.tf-document-date-btn:focus {
    outline: none;
    border-color: var(--tf-color-accent);
    box-shadow: 0 0 0 1px rgba(74,111,165,0.3);
}

.tf-file-count-badge {
    display: inline-flex;
    align-items: center;
    background: var(--tf-color-accent);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
}

.tf-btn--small {
    padding: 6px 12px;
    font-size: 13px;
}

.tf-document-actions {
    display: flex;
    gap: var(--tf-space-xs);
    justify-content: flex-end;
}

/* FILE SUB-LIST */

.tf-file-sublist {
    list-style: none;
    margin: var(--tf-space-s) 0 0 40px;
    padding: 0;
    border-left: 2px solid var(--tf-color-border-strong);
}

.tf-file-sublist__item {
    display: flex;
    align-items: center;
    gap: var(--tf-space-xs);
    padding: var(--tf-space-xs) var(--tf-space-s);
    font-size: 13px;
    color: var(--tf-color-text-main);
    background: var(--tf-color-surface);
    border-bottom: 1px solid var(--tf-color-border-subtle);
}

.tf-file-sublist__item:last-child {
    border-bottom: none;
}

.tf-file-sublist__index {
    color: var(--tf-color-text-soft);
    min-width: 20px;
}

.tf-file-sublist__name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tf-file-sublist__size {
    color: var(--tf-color-text-muted);
    font-size: 12px;
}

/* MISC TEXT / UTILITIES */

.tf-text-center {
    text-align: center;
}

.tf-align-center {
    text-align: center;
}

.tf-align-right {
    text-align: right;
}

.tf-margin-top-s {
    margin-top: var(--tf-space-s);
}

.tf-margin-top-m {
    margin-top: var(--tf-space-m);
}

.tf-margin-top-l {
    margin-top: var(--tf-space-l);
}

/* FOCUS STYLES (ACCESSIBILITY) */

.tf-btn:focus-visible,
.tf-sidebar__link:focus-visible,
.tf-tab-label:focus-visible,
.tf-form__input:focus-visible,
.tf-form__textarea:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(74,111,165,0.5);
    border-color: var(--tf-color-accent);
}

/* RESPONSIVE BREAKPOINTS */

@media (max-width: 1024px) {
    .tf-app-shell {
        grid-template-columns: 1fr;
    }

    .tf-sidebar {
        position: relative;
        min-height: auto;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: var(--tf-space-m);
    }

    .tf-sidebar__nav {
        flex-direction: row;
        flex-wrap: wrap;
        max-width: 540px;
    }

    .tf-main {
        padding-top: 0;
    }

    .tf-section {
        padding: var(--tf-space-xl) var(--tf-space-l) 0 var(--tf-space-l);
    }

    .tf-hero,
    .tf-hero-surface__hero {
        grid-template-columns: 1fr;
    }

    .tf-hero__visual,
    .tf-hero-surface__hero-side {
        justify-content: flex-start;
    }

    .tf-feature-steps {
        grid-template-columns: 1fr 1fr;
    }

    .tf-form__row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tf-section {
        padding: var(--tf-space-xl) var(--tf-space-m) 0 var(--tf-space-m);
    }

    .tf-heading-1 {
        font-size: 32px;
        line-height: 1.25;
    }

    .tf-heading-2 {
        font-size: 28px;
    }

    .tf-heading-3 {
        font-size: 22px;
    }

    .tf-lede {
        font-size: 17px;
    }

    .tf-display-slogan {
        font-size: 34px;
    }

    .tf-grid--2,
    .tf-grid--3,
    .tf-grid--4 {
        grid-template-columns: 1fr;
    }

    .tf-grid--stack-mobile {
        grid-template-columns: 1fr;
    }

    .tf-feature-steps {
        grid-template-columns: 1fr;
    }

    .tf-sidebar {
        display: none; /* Replace with mobile nav / drawer when integrating into production */
    }

    .tf-app-shell {
        grid-template-columns: 1fr;
    }

    .tf-topbar {
        padding: 0 var(--tf-space-m);
    }

    .tf-button-row {
        flex-direction: column;
        align-items: stretch;
    }

    .tf-btn,
    .tf-btn-primary,
    .tf-btn-secondary,
    .tf-btn-tertiary {
        width: 100%;
        justify-content: center;
    }

    .tf-dashboard-card,
    .tf-dashboard-card--compact {
        max-width: 100%;
    }
}

/* TUTORIAL OVERLAY */

.tf-tutorial {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
}

.tf-tutorial__overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: auto;
}

.tf-tutorial__highlight {
    position: absolute;
    background: transparent;
    border-radius: var(--tf-radius-md);
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.7);
    z-index: 1;
    pointer-events: none;
    transition: all 0.3s ease;
}

.tf-tutorial__bubble {
    position: absolute;
    width: 320px;
    background: #0F172A;
    border-radius: var(--tf-radius-lg);
    padding: var(--tf-space-m);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(148, 163, 184, 0.3);
    z-index: 2;
    pointer-events: auto;
    animation: tf-tutorial-fade-in 0.3s ease;
}

@keyframes tf-tutorial-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Speech bubble arrows - arrow points toward the target element */
.tf-tutorial__bubble::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #0F172A;
    transform: rotate(45deg);
}

/* Bubble is below target, arrow at top pointing up */
.tf-tutorial__bubble--top::before {
    top: -8px;
    left: 50%;
    margin-left: -8px;
    box-shadow: -2px -2px 4px rgba(15, 23, 42, 0.08);
}

/* Bubble is above target, arrow at bottom pointing down */
.tf-tutorial__bubble--bottom::before {
    bottom: -8px;
    left: 50%;
    margin-left: -8px;
    box-shadow: 2px 2px 4px rgba(15, 23, 42, 0.08);
}

/* Bubble is to the right of target, arrow on left pointing left */
.tf-tutorial__bubble--left::before {
    left: -8px;
    top: 50%;
    margin-top: -8px;
    box-shadow: -2px 2px 4px rgba(15, 23, 42, 0.08);
}

/* Bubble is to the left of target, arrow on right pointing right */
.tf-tutorial__bubble--right::before {
    right: -8px;
    top: 50%;
    margin-top: -8px;
    box-shadow: 2px -2px 4px rgba(15, 23, 42, 0.08);
}

.tf-tutorial__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--tf-space-s);
}

.tf-tutorial__step-indicator {
    font-size: 12px;
    font-weight: 600;
    color: #A5B4FC;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tf-tutorial__skip {
    font-size: 12px;
    color: #9CA3AF;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--tf-radius-sm);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.tf-tutorial__skip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #E5E7EB;
}

.tf-tutorial__title {
    font-family: var(--tf-font-heading);
    font-size: 18px;
    font-weight: 700;
    color: #F1F5F9;
    margin: 0 0 var(--tf-space-xs) 0;
}

.tf-tutorial__content {
    font-size: 14px;
    line-height: 1.6;
    color: #CBD5E1;
    margin: 0 0 var(--tf-space-m) 0;
}

.tf-tutorial__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--tf-space-xs);
}

/* Ensure highlighted elements appear above overlay */
[data-tutorial-active="true"] {
    position: relative;
    z-index: 10000;
}

/* CARD HEADER */

.tf-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--tf-space-m);
    margin-bottom: var(--tf-space-s);
}

.tf-card__header > div:first-child {
    flex: 1;
}

.tf-card__header .tf-heading-2 {
    margin-bottom: var(--tf-space-xs);
}

/* BUTTON WITH ICON */

.tf-btn--with-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tf-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--tf-color-accent);
    color: white;
    font-size: 12px;
    font-weight: 700;
}

/* MODAL */

.tf-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tf-modal {
    background: var(--tf-color-surface);
    border-radius: var(--tf-radius-lg);
    padding: var(--tf-space-l);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    z-index: 9999;
}

.tf-modal__header {
    position: relative;
    margin-bottom: var(--tf-space-m);
}

.tf-modal__close {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--tf-color-text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.tf-modal__close:hover {
    color: var(--tf-color-text-main);
}

.tf-modal__title {
    font-size: 24px;
    font-weight: 600;
    color: var(--tf-color-text-main);
    margin: 0 0 var(--tf-space-xs);
}

.tf-modal__description {
    font-size: 14px;
    color: var(--tf-color-text-muted);
    margin: 0;
}

.tf-modal__body {
    margin-bottom: var(--tf-space-m);
}

.tf-modal__footer {
    display: flex;
    flex-direction: column;
    gap: var(--tf-space-s);
}

.tf-modal__footer .tf-btn {
    width: 100%;
}

.tf-modal__disclaimer {
    font-size: 12px;
    color: var(--tf-color-text-soft);
    background: var(--tf-color-surface-subtle);
    padding: var(--tf-space-s);
    border-radius: var(--tf-radius-md);
    margin-top: var(--tf-space-m);
}

/* TOOLTIP */

.tf-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tf-tooltip__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--tf-color-accent-light);
    color: var(--tf-color-accent);
    font-size: 11px;
    font-weight: 700;
    cursor: help;
    border: none;
    padding: 0;
}

.tf-tooltip__content {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #0F172A;
    color: #E5E7EB;
    padding: var(--tf-space-xs) var(--tf-space-s);
    border-radius: var(--tf-radius-md);
    font-size: 12px;
    max-width: 240px;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 10000;
}

.tf-tooltip__content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #0F172A;
}

.tf-tooltip:hover .tf-tooltip__content,
.tf-tooltip:focus-within .tf-tooltip__content {
    opacity: 1;
    visibility: visible;
}

/* RADIO GROUP */

.tf-radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--tf-space-xs);
}

.tf-radio-option {
    display: flex;
    align-items: center;
    gap: var(--tf-space-xs);
}

.tf-radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--tf-color-accent);
    cursor: pointer;
}

.tf-radio-option label {
    font-size: 14px;
    color: var(--tf-color-text-main);
    cursor: pointer;
}
