/* ==================================================================
   TrendTool AI — Design system
   Mobile first, mode sombre par défaut, aucune dépendance externe.
   ================================================================== */

:root {
    --bg:        #080a10;
    --bg-soft:   #0d1018;
    --surface:   #121620;
    --surface-2: #171c28;
    --surface-3: #1d2331;
    --border:    #232a3a;
    --border-2:  #2f384c;

    --text:      #eff1f7;
    --text-soft: #b6bccd;
    --muted:     #8b93a7;

    --primary:      #7c5cff;
    --primary-soft: #9b86ff;
    --primary-dim:  rgba(124, 92, 255, .14);
    --cyan:         #22d3ee;
    --cyan-dim:     rgba(34, 211, 238, .12);
    --success:      #34d399;
    --danger:       #fb7185;
    --warning:      #fbbf24;

    --radius-sm: 10px;
    --radius:    16px;
    --radius-lg: 22px;
    --shadow:    0 10px 40px rgba(0, 0, 0, .45);
    --shadow-sm: 0 4px 18px rgba(0, 0, 0, .35);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --header-h: 60px;
    --tabbar-h: 64px;

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(1000px 520px at 12% -8%, rgba(124, 92, 255, .22), transparent 65%),
        radial-gradient(760px 420px at 92% 4%, rgba(34, 211, 238, .14), transparent 68%);
    pointer-events: none;
    z-index: 0;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; color: var(--text-soft); }

::selection { background: var(--primary); color: #fff; }

/* ---------------------------------------------------------------- */
/*  Structure                                                        */
/* ---------------------------------------------------------------- */

.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 28px);
}

.wrap {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px;
}

.section { padding: 34px 0; }

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
}

.section-title { font-size: 1.25rem; margin: 0; }
.section-sub { color: var(--muted); font-size: .9rem; margin: 0; }

.source-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .74rem;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 11px;
}

/* ---------------------------------------------------------------- */
/*  En-tête                                                          */
/* ---------------------------------------------------------------- */

.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    padding-top: var(--safe-top);
    background: rgba(8, 10, 16, .82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.app-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: var(--header-h);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark {
    width: 32px; height: 32px;
    border-radius: 10px;
    display: grid; place-items: center;
    background: linear-gradient(140deg, var(--primary), var(--cyan));
    color: #fff; font-weight: 800; font-size: .85rem;
    box-shadow: 0 6px 18px rgba(124, 92, 255, .35);
}
.brand-name { font-size: 1rem; letter-spacing: -.01em; }

.nav-links { display: none; gap: 4px; }
.nav-link {
    padding: 8px 13px;
    border-radius: 999px;
    font-size: .88rem;
    color: var(--text-soft);
    transition: background .18s, color .18s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.is-active { background: var(--primary-dim); color: var(--primary-soft); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface-3);
    border: 1px solid var(--border-2);
    font-size: .8rem; font-weight: 700; color: var(--text);
}

/* ---------------------------------------------------------------- */
/*  Boutons                                                          */
/* ---------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 11px 18px;
    font-size: .92rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    background: var(--surface-2);
    color: var(--text);
    transition: transform .14s ease, background .18s, border-color .18s, opacity .18s;
    white-space: nowrap;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #5b7cff);
    color: #fff;
    box-shadow: 0 8px 26px rgba(124, 92, 255, .32);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-soft), #6f8dff); }
.btn-ghost { background: transparent; border-color: var(--border-2); color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-soft { background: var(--primary-dim); color: var(--primary-soft); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 13px; font-size: .82rem; }
.btn-danger { background: rgba(251, 113, 133, .14); color: #ffb3c0; }
.btn-icon { padding: 9px; width: 38px; height: 38px; }
.btn svg { width: 17px; height: 17px; flex: none; }

/* ---------------------------------------------------------------- */
/*  Barre de navigation basse                                        */
/* ---------------------------------------------------------------- */

.tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 2px;
    padding: 6px 6px calc(6px + var(--safe-bottom));
    background: rgba(11, 14, 21, .94);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
}
.tabbar-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    border-radius: 12px;
    color: var(--muted);
    font-size: .66rem;
    font-weight: 600;
    transition: color .18s, background .18s;
}
.tabbar-item svg { width: 21px; height: 21px; }
.tabbar-item.is-active { color: var(--primary-soft); background: var(--primary-dim); }

/* ---------------------------------------------------------------- */
/*  Hero                                                             */
/* ---------------------------------------------------------------- */

.hero { padding: 26px 0 8px; }
.hero-inner { display: grid; gap: 22px; }

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .74rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--cyan);
    background: var(--cyan-dim);
    border: 1px solid rgba(34, 211, 238, .25);
    border-radius: 999px; padding: 6px 12px;
}

.hero h1 {
    font-size: 2.1rem;
    margin: 14px 0 10px;
    letter-spacing: -.03em;
}
.hero h1 .grad {
    background: linear-gradient(120deg, var(--primary-soft), var(--cyan));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-sub { font-size: 1rem; color: var(--text-soft); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.hero-visual {
    background: linear-gradient(180deg, var(--surface), var(--bg-soft));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow);
}
.demo-line { display: flex; align-items: center; gap: 10px; font-size: .84rem; color: var(--text-soft); }
.demo-line + .demo-line { margin-top: 11px; }
.demo-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--primary); flex: none;
    box-shadow: 0 0 0 4px var(--primary-dim);
}
.demo-dot.c2 { background: var(--cyan); box-shadow: 0 0 0 4px var(--cyan-dim); }
.demo-dot.c3 { background: var(--success); box-shadow: 0 0 0 4px rgba(52, 211, 153, .14); }
.demo-bar {
    height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 14px;
}
.demo-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--cyan)); width: 0; animation: grow 2.4s ease forwards; }
@keyframes grow { from { width: 6%; } to { width: 78%; } }

.hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.hero-stat {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 12px;
}
.hero-stat b { display: block; font-size: 1.15rem; }
.hero-stat span { font-size: .72rem; color: var(--muted); }

/* ---------------------------------------------------------------- */
/*  Recherche                                                        */
/* ---------------------------------------------------------------- */

.search-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}
.search-row { display: flex; flex-wrap: wrap; gap: 10px; }
.search-field {
    flex: 1 1 220px;
    display: flex; align-items: center; gap: 9px;
    background: var(--bg-soft);
    border: 1px solid var(--border-2);
    border-radius: 999px;
    padding: 4px 6px 4px 15px;
}
.search-field svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search-field input {
    flex: 1; min-width: 0;
    background: transparent; border: 0; outline: none;
    color: var(--text); font-size: .95rem; font-family: inherit;
    padding: 11px 0;
}
.search-field input::placeholder { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.chip {
    border: 1px solid var(--border-2);
    background: var(--surface-2);
    color: var(--text-soft);
    border-radius: 999px;
    padding: 7px 13px;
    font-size: .8rem;
    cursor: pointer;
    font-family: inherit;
    transition: all .16s;
}
.chip:hover { border-color: var(--primary); color: var(--text); }
.chip.is-active { background: var(--primary-dim); border-color: rgba(124, 92, 255, .5); color: var(--primary-soft); }

/* ---------------------------------------------------------------- */
/*  Cartes de tendance                                               */
/* ---------------------------------------------------------------- */

.trending-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }

.trend-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 11px;
    transition: transform .18s, border-color .18s, box-shadow .18s;
}
.trend-card:hover { transform: translateY(-3px); border-color: var(--border-2); box-shadow: var(--shadow-sm); }

.trend-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.trend-cat {
    font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: var(--primary-soft); background: var(--primary-dim);
    border-radius: 999px; padding: 4px 9px;
}
.trend-title { font-size: 1.02rem; font-weight: 650; margin: 0; }
.trend-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: .76rem; color: var(--muted); }
.trend-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: .72rem; font-weight: 700;
    border-radius: 999px; padding: 3px 9px;
}
.badge-up { background: rgba(52, 211, 153, .14); color: #6ee7b7; }
.badge-down { background: rgba(251, 113, 133, .14); color: #ffa9b8; }
.badge-flat { background: var(--surface-3); color: var(--muted); }
.badge-status { background: var(--surface-3); color: var(--text-soft); }
.badge-status.is-open { background: rgba(52, 211, 153, .14); color: #6ee7b7; }
.badge-status.is-suspended { background: rgba(251, 113, 133, .14); color: #ffa9b8; }
.badge-status.is-pro { background: var(--cyan-dim); color: var(--cyan); }

.spark { display: block; width: 100%; height: 34px; }
.spark path { fill: none; stroke: var(--primary-soft); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

/* ---------------------------------------------------------------- */
/*  Panneaux / résultats                                             */
/* ---------------------------------------------------------------- */

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.panel + .panel { margin-top: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0; font-weight: 700; }

.result-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.result-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px; }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.result-head h3 { margin: 0; font-size: .95rem; }
.result-text { margin: 0; color: var(--text-soft); font-size: .92rem; white-space: pre-wrap; }

.copy-btn {
    border: 1px solid var(--border-2);
    background: var(--surface-2);
    color: var(--text-soft);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: .74rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all .16s;
    flex: none;
}
.copy-btn:hover { border-color: var(--primary); color: var(--text); }
.copy-btn.is-done { background: rgba(52, 211, 153, .16); border-color: transparent; color: #6ee7b7; }
.copy-btn svg { width: 14px; height: 14px; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 11px;
    font-size: .78rem;
    color: var(--text-soft);
    cursor: pointer;
}
.tag:hover { border-color: var(--primary); color: var(--text); }

.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: 0; }
.kv-key { color: var(--muted); font-size: .84rem; }
.kv-val { font-weight: 650; font-size: .9rem; }

.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
.bar-label { font-size: .84rem; color: var(--text-soft); }
.bar-val { font-size: .82rem; font-weight: 700; color: var(--cyan); }
.bar-track { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--cyan)); }

.score-ring { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ring {
    width: 108px; height: 108px; flex: none; border-radius: 50%;
    display: grid; place-items: center;
    background: conic-gradient(var(--primary) calc(var(--p, 0) * 1%), var(--surface-3) 0);
    position: relative;
}
.ring::after {
    content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface);
}
.ring b { position: relative; z-index: 1; font-size: 1.5rem; }
.ring small { position: relative; z-index: 1; display: block; font-size: .64rem; color: var(--muted); text-align: center; }

.chart-box { position: relative; height: 200px; }
.chart-box canvas { display: block; }

/* ---------------------------------------------------------------- */
/*  Formulaires                                                      */
/* ---------------------------------------------------------------- */

.form-grid { display: grid; grid-template-columns: 1fr; gap: 13px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
    width: 100%;
    background: var(--bg-soft);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    color: var(--text);
    font-size: .92rem;
    font-family: inherit;
    outline: none;
    transition: border-color .16s, box-shadow .16s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.field-hint { font-size: .76rem; color: var(--muted); }

.timecode { font-family: var(--mono); font-size: .82rem; }

/* ---------------------------------------------------------------- */
/*  Tarifs                                                           */
/* ---------------------------------------------------------------- */

.pricing-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.price-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.price-card.is-featured { border-color: rgba(124, 92, 255, .55); box-shadow: 0 18px 50px rgba(124, 92, 255, .18); position: relative; }
.price-card.is-featured::after {
    content: "Recommandé";
    position: absolute; top: -12px; left: 18px;
    background: linear-gradient(135deg, var(--primary), var(--cyan));
    color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .05em;
    padding: 5px 11px; border-radius: 999px;
}
.price-value { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; }
.price-value small { font-size: .82rem; font-weight: 500; color: var(--muted); }
.price-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.price-features li { display: flex; align-items: flex-start; gap: 9px; font-size: .88rem; color: var(--text-soft); }
.price-features svg { width: 16px; height: 16px; color: var(--success); flex: none; margin-top: 3px; }

/* ---------------------------------------------------------------- */
/*  Comptes                                                          */
/* ---------------------------------------------------------------- */

.auth-wrap { max-width: 440px; margin: 26px auto; padding: 0 18px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 18px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.4rem; }
.auth-alt { text-align: center; font-size: .88rem; color: var(--muted); margin-top: 16px; }
.auth-alt a { color: var(--primary-soft); font-weight: 600; }

.alert {
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    font-size: .86rem;
    margin-bottom: 13px;
    border: 1px solid transparent;
}
.alert-error { background: rgba(251, 113, 133, .12); color: #ffb3c0; border-color: rgba(251, 113, 133, .3); }
.alert-info { background: var(--cyan-dim); color: #9beaf7; border-color: rgba(34, 211, 238, .28); }
.alert-success { background: rgba(52, 211, 153, .12); color: #86efac; border-color: rgba(52, 211, 153, .3); }

/* ---------------------------------------------------------------- */
/*  Dashboard utilisateur / admin                                    */
/* ---------------------------------------------------------------- */

.dash-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.metric-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.metric-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px; }
.metric-card b { display: block; font-size: 1.4rem; letter-spacing: -.02em; }
.metric-card span { font-size: .74rem; color: var(--muted); }
.metric-card .ic { color: var(--primary-soft); margin-bottom: 6px; }
.metric-card .ic svg { width: 19px; height: 19px; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 3px; margin-bottom: 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
    border: 1px solid var(--border-2);
    background: var(--surface-2);
    color: var(--text-soft);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}
.tab.is-active { background: var(--primary-dim); border-color: rgba(124, 92, 255, .5); color: var(--primary-soft); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .85rem; min-width: 540px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: var(--surface-2); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.wrap-cell { white-space: normal; max-width: 260px; }

.list { display: grid; gap: 9px; }
.list-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px 13px;
}
.list-item .li-main { min-width: 0; }
.list-item b { display: block; font-size: .92rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item span { font-size: .76rem; color: var(--muted); }

.empty { text-align: center; padding: 30px 18px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--border-2); margin: 0 auto 10px; }
.empty b { display: block; color: var(--text-soft); margin-bottom: 4px; }

.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-3) 37%, var(--surface) 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: var(--radius); height: 96px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------------------------------------------------------- */
/*  Administration — écran de mot de passe                           */
/* ---------------------------------------------------------------- */

.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 18px; }
.gate-card { max-width: 420px; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 20px; box-shadow: var(--shadow); }
.gate-card .brand { margin-bottom: 16px; }

.admin-header { background: rgba(8, 10, 16, .85); }
.admin-pill {
    font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--cyan); background: var(--cyan-dim); border-radius: 999px; padding: 4px 9px;
}

/* ---------------------------------------------------------------- */
/*  Toasts / modales                                                 */
/* ---------------------------------------------------------------- */

.toast-wrap {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px);
    z-index: 90;
    display: grid;
    gap: 8px;
    width: calc(100% - 32px);
    max-width: 420px;
    pointer-events: none;
}
.toast {
    background: var(--surface-3);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: .88rem;
    box-shadow: var(--shadow);
    animation: toastIn .22s ease;
}
.toast.ok { border-color: rgba(52, 211, 153, .45); }
.toast.err { border-color: rgba(251, 113, 133, .45); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.modal-backdrop {
    position: fixed; inset: 0; z-index: 80;
    background: rgba(4, 6, 10, .72);
    backdrop-filter: blur(4px);
    display: grid; place-items: center;
    padding: 18px;
}
.modal {
    width: 100%; max-width: 460px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    padding: 20px 18px;
    box-shadow: var(--shadow);
    max-height: 86vh;
    overflow-y: auto;
}
.modal-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.store-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.store-chip {
    flex: 1 1 130px;
    display: flex; align-items: center; gap: 9px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 11px 12px; font-size: .82rem;
}
.store-chip svg { width: 22px; height: 22px; flex: none; }

/* ---------------------------------------------------------------- */
/*  Footer                                                           */
/* ---------------------------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 26px 0 12px;
    margin-top: 24px;
    font-size: .84rem;
    color: var(--muted);
}
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.footer-col h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); margin-bottom: 9px; }
.footer-col a { display: block; padding: 4px 0; color: var(--muted); }
.footer-col a:hover { color: var(--primary-soft); }
.footer-bottom { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); font-size: .76rem; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }

/* ---------------------------------------------------------------- */
/*  Animations légères                                               */
/* ---------------------------------------------------------------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

.fade-in { animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
    .reveal { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- */
/*  Tablette / bureau                                                */
/* ---------------------------------------------------------------- */

@media (min-width: 640px) {
    .trending-grid { grid-template-columns: repeat(2, 1fr); }
    .metric-cards { grid-template-columns: repeat(4, 1fr); }
    .result-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid .field-full { grid-column: 1 / -1; }
    .hero-stats { grid-template-columns: repeat(4, 1fr); }
    .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
    h1 { font-size: 2.1rem; }
    .hero h1 { font-size: 2.6rem; }
}

@media (min-width: 900px) {
    .nav-links { display: flex; }
    .tabbar { display: none; }
    .page { padding-bottom: 40px; }
    .trending-grid { grid-template-columns: repeat(3, 1fr); }
    .pricing-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-inner { grid-template-columns: 1.1fr .9fr; align-items: center; }
    .dash-grid { grid-template-columns: 2fr 1fr; }
    .dash-grid .dash-full { grid-column: 1 / -1; }
    .toast-wrap { left: auto; right: 22px; transform: none; bottom: 22px; }
    .auth-wrap { margin: 46px auto; }
    .section { padding: 46px 0; }
}

@media (min-width: 1180px) {
    .price-card { padding: 26px 22px; }
}

/* ---------------------------------------------------------------- */
/*  Studio vidéo                                                     */
/* ---------------------------------------------------------------- */

#vText {
    min-height: 180px;
    resize: vertical;
    line-height: 1.55;
    font-size: .95rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .84rem;
}
.table th, .table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.table thead th {
    color: var(--muted);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
    white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(255, 255, 255, .02); }

.bar-fill { transition: width .4s ease; }

#vPlayer { aspect-ratio: 9 / 16; }

@media (max-width: 640px) {
    .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
    .table th:nth-child(4), .table td:nth-child(4) { display: none; }
    .table th, .table td { padding: 9px 10px; }
}

/* Bouton Studio mis en avant dans la barre basse */
.tabbar-item.is-feature:not(.is-active) {
    color: var(--primary-soft);
}
.tabbar-item.is-feature svg {
    filter: drop-shadow(0 0 6px rgba(124, 92, 255, .5));
}

/* Cartes de vidéos (espace membre) */
.video-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.video-card { display: grid; gap: 10px; }
.video-thumb {
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: 300px;
    object-fit: cover;
    border-radius: 12px;
    background: #000;
    display: block;
}
@media (min-width: 640px) {
    .video-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
    .video-grid { grid-template-columns: repeat(3, 1fr); }
}
