/*
 * Fast Transfer — front door (index.html) and the signed-in app shell
 * (dashboard.html). Builds on the tokens in style.css.
 */

/* ===================== FRONT DOOR ===================== */
.home .navbar { padding: 0 max(20px, calc((100vw - 1160px) / 2 + 20px)); }

.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--ft-line); }
/* A faint grid of 10 MB pieces behind the hero — the product's unit, not decoration. */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--ft-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--ft-line) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse 60% 70% at 78% 40%, #000 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 60% 70% at 78% 40%, #000 0%, transparent 70%);
    opacity: .6;
    pointer-events: none;
}
.hero-grid {
    position: relative;
    display: grid;
    gap: 40px;
    align-items: center;
    padding-top: 56px;
    padding-bottom: 64px;
}
@media (min-width: 960px) {
    .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: 64px; padding-top: 80px; padding-bottom: 88px; }
}
.hero-copy h1 {
    margin-top: 14px;
    font-size: clamp(2.7rem, 7vw, 4.6rem);
    font-weight: 900;
    line-height: .98;
    letter-spacing: -.045em;
}
.hl {
    background: linear-gradient(transparent 58%, var(--ft-signal) 58%, var(--ft-signal) 92%, transparent 92%);
    padding: 0 .06em;
    margin: 0 -.06em;
}
[data-theme='dark'] .hl { color: var(--ft-signal); background: none; }
.lede { margin-top: 20px; max-width: 520px; font-size: 1.12rem; line-height: 1.6; color: var(--ft-ink-2); }
.facts { list-style: none; margin-top: 28px; display: grid; gap: 10px; max-width: 420px; }
.facts li {
    display: flex; align-items: baseline; gap: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--ft-line-strong);
    color: var(--ft-ink-2);
    font-size: .95rem;
}
.fact-k { min-width: 68px; font-weight: 700; color: var(--ft-ink); font-size: .95rem; }

.composer { padding: 18px; box-shadow: var(--ft-shadow-3); }
.composer-head { display: flex; justify-content: space-between; align-items: center; margin: 2px 2px 14px; gap: 10px; }
.composer-host { font-size: 11px; color: var(--ft-subtle); }
.composer .upload-area { padding: 36px 20px; }
.composer .pending-uploads { margin-top: 14px; }

/* Register: counted totals */
.register { background: var(--ft-surface); border-bottom: 1px solid var(--ft-line); }
.register-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .register-grid { grid-template-columns: repeat(4, 1fr); } }
.register-cell { padding: 26px 12px; text-align: center; border-right: 1px solid var(--ft-line); }
.register-cell:last-child { border-right: 0; }
@media (max-width: 759px) { .register-cell:nth-child(2n) { border-right: 0; } .register-cell:nth-child(n+3) { border-top: 1px solid var(--ft-line); } }
.register-cell dd { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 600; letter-spacing: -.04em; color: var(--ft-ink); }
.register-cell dt { margin-top: 4px; }

/* Sections + the perforation divider (a transfer slip's tear line) */
.section { padding: 72px 0; }
.section-tight { padding: 8px 0 64px; }
.perf {
    height: 14px;
    margin-bottom: 36px;
    background:
        radial-gradient(circle at 7px 7px, var(--ft-ground) 6px, transparent 6.5px) left center / 14px 14px no-repeat,
        radial-gradient(circle at 7px 7px, var(--ft-ground) 6px, transparent 6.5px) right center / 14px 14px no-repeat,
        linear-gradient(90deg, var(--ft-line-strong) 50%, transparent 50%) center / 10px 1px repeat-x;
    position: relative;
}
.perf::before, .perf::after {
    content: ''; position: absolute; top: 0; width: 14px; height: 14px; border-radius: 50%;
    border: 1px solid var(--ft-line-strong);
}
.perf::before { left: 0; }
.perf::after { right: 0; }
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head h2 { margin-top: 10px; font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 900; letter-spacing: -.035em; line-height: 1.05; }
.section-lede { margin-top: 14px; color: var(--ft-ink-2); font-size: 1.05rem; }

/* The ledger: a dark band in both themes */
.ledger {
    background: var(--ft-band);
    color: var(--ft-band-text);
    border-radius: var(--ft-r-xl);
    padding: 20px;
    box-shadow: var(--ft-shadow-3);
}
.ledger-top { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--ft-band-muted); margin-bottom: 14px; flex-wrap: wrap; }
.ledger-top span:first-child { color: var(--ft-band-text); }
.ledger-grid { display: grid; grid-template-columns: repeat(48, 1fr); gap: 3px; }
@media (max-width: 640px) { .ledger-grid { grid-template-columns: repeat(24, 1fr); gap: 2px; } }
.piece { aspect-ratio: 1; border-radius: 2px; background: var(--ft-band-line); transition: background .25s; }
.piece.done { background: var(--ft-signal); }
.piece.fly { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ft-signal); animation: ft-blink .7s ease-in-out infinite alternate; }
.piece.hold { background: transparent; box-shadow: inset 0 0 0 1.5px #E6B54B; }
@keyframes ft-blink { from { opacity: .35; } to { opacity: 1; } }
.ledger-legend { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 12px; color: var(--ft-band-muted); }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.lg-done { background: var(--ft-signal); }
.lg-fly { box-shadow: inset 0 0 0 1.5px var(--ft-signal); }
.lg-wait { background: var(--ft-band-line); }
.ledger-state { margin-left: auto; color: var(--ft-band-text); font-size: 12px; }
.ledger-state.is-warn { color: #E6B54B; }
.ledger-state.is-ok { color: var(--ft-signal); }

.pillars { display: grid; gap: 14px; margin-top: 18px; }
@media (min-width: 860px) { .pillars { grid-template-columns: repeat(3, 1fr); } }
.pillar { background: var(--ft-surface); border: 1px solid var(--ft-line); border-radius: var(--ft-r-lg); padding: 22px; }
.pillar-n { font-size: 12px; color: var(--ft-subtle); }
.pillar h3 { margin-top: 10px; font-size: 1.05rem; font-weight: 800; letter-spacing: -.015em; }
.pillar p { margin-top: 8px; color: var(--ft-muted); font-size: .93rem; }

.steps { display: grid; gap: 28px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step h3 { margin-top: 8px; font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.step p { margin-top: 6px; color: var(--ft-muted); }

.plans { display: grid; gap: 16px; }
@media (min-width: 760px) { .plans { grid-template-columns: 1fr 1fr; } }
.plan { padding: 26px; display: flex; flex-direction: column; }
.plan-strong { border-color: var(--ft-ink); box-shadow: inset 0 0 0 1px var(--ft-ink), var(--ft-shadow-2); }
[data-theme='dark'] .plan-strong { border-color: var(--ft-signal); box-shadow: inset 0 0 0 1px var(--ft-signal); }
.plan-size { margin: 10px 0 18px; font-size: 2.6rem; font-weight: 700; letter-spacing: -.05em; line-height: 1; }
.ticks { list-style: none; display: grid; gap: 10px; margin-bottom: 24px; flex: 1; }
.ticks li { display: flex; gap: 10px; align-items: baseline; color: var(--ft-ink-2); }
.ticks li::before { content: ''; flex-shrink: 0; width: 10px; height: 10px; border-radius: 2px; background: var(--ft-signal); box-shadow: inset 0 0 0 1px rgba(19,22,20,.2); transform: translateY(1px); }
.plan .btn-primary, .plan .btn-secondary { align-self: flex-start; }

.dev { background: var(--ft-band); color: var(--ft-band-text); padding: 64px 0; }
.dev-grid { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .dev-grid { grid-template-columns: 1fr 1fr; gap: 56px; } }
.dev h2 { margin-top: 10px; font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 900; letter-spacing: -.03em; line-height: 1.1; }
.dev p { margin-top: 12px; color: var(--ft-band-muted); }
.tag-band { color: var(--ft-signal); }
.code {
    background: #0B0D0C;
    border: 1px solid var(--ft-band-line);
    border-radius: var(--ft-r-lg);
    padding: 18px 20px;
    font-size: 13px;
    line-height: 1.7;
    color: #DCE3D8;
    overflow-x: auto;
    white-space: pre;
}
.code .c { color: #7C877F; }

.site-foot { border-top: 1px solid var(--ft-line); padding: 32px 0 40px; }
.foot-grid { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.foot-brand { font-weight: 800; }
.foot-sub { font-size: .85rem; color: var(--ft-muted); }
.foot-links { display: flex; gap: 20px; flex-wrap: wrap; font-size: .9rem; }
.foot-links a { color: var(--ft-ink-2); text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }

@media (max-width: 760px) { .hide-sm { display: none; } }
@media (max-width: 420px) { .hide-xs { display: none; } }

/* ===================== APP SHELL ===================== */
.app { background: var(--ft-ground); }
.app-header {
    position: sticky; top: 0; z-index: 40;
    height: var(--ft-header-h);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 0 16px 0 18px;
    background: var(--ft-surface);
    border-bottom: 1px solid var(--ft-line);
}
.app-header-right { display: flex; align-items: center; gap: 8px; }
.app-body { display: flex; }
.side {
    position: sticky; top: var(--ft-header-h);
    height: calc(100vh - var(--ft-header-h));
    width: var(--ft-side-w);
    flex-shrink: 0;
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 14px 12px;
    background: var(--ft-surface);
    border-right: 1px solid var(--ft-line);
}
@media (min-width: 768px) { .side { display: flex; } }
.side-label { margin: 14px 10px 6px; }
.side-label:first-child { margin-top: 2px; }
.nav-item {
    display: flex; align-items: center; gap: 11px;
    width: 100%;
    padding: 9px 10px;
    border: 0; background: transparent;
    border-radius: var(--ft-r-md);
    font-size: .92rem; font-weight: 600;
    color: var(--ft-ink-2);
    text-decoration: none; text-align: left;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-item:hover { background: var(--ft-wash); color: var(--ft-ink); }
.nav-item.active { background: var(--ft-band); color: var(--ft-band-text); }
.nav-item.active svg { color: var(--ft-signal); }
.nav-count { margin-left: auto; font-family: var(--ft-mono); font-size: 11px; color: var(--ft-subtle); }
.nav-item.active .nav-count { color: var(--ft-band-muted); }
.side-foot { margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid var(--ft-line); }
.quota-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--ft-muted); margin-bottom: 6px; }
.quota-row .mono { color: var(--ft-ink); font-size: 11px; }

.main { flex: 1; min-width: 0; padding: 28px 16px calc(var(--ft-bottom-h) + 32px); }
@media (min-width: 768px) { .main { padding: 32px 36px 48px; } }
.main-inner { max-width: 1080px; margin: 0 auto; }

.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 900; letter-spacing: -.035em; line-height: 1.1; }
.page-head p { color: var(--ft-muted); margin-top: 4px; }

.overview { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
@media (min-width: 1000px) { .overview { grid-template-columns: repeat(4, 1fr); } }
.metric { background: var(--ft-surface); border: 1px solid var(--ft-line); border-radius: var(--ft-r-lg); padding: 16px 18px; }
.metric-v { margin-top: 8px; font-family: var(--ft-mono); font-size: 1.55rem; font-weight: 600; letter-spacing: -.04em; line-height: 1.1; }
.metric-s { margin-top: 2px; font-size: .8rem; color: var(--ft-muted); }
.metric-v .skeleton { display: inline-block; width: 70%; height: 1.2em; }

.send-grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1100px) { .send-grid { grid-template-columns: minmax(0, 1fr) 360px; } }
.panel { background: var(--ft-surface); border: 1px solid var(--ft-line); border-radius: var(--ft-r-xl); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--ft-line); }
.panel-head h2 { font-size: 1rem; font-weight: 800; letter-spacing: -.01em; }
.panel-body { padding: 18px; }
.link-btn { border: 0; background: none; color: var(--ft-signal-ink); font-weight: 700; font-size: .85rem; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

.recent { list-style: none; }
.recent li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--ft-line); }
.recent li:last-child { border-bottom: 0; }
.recent-empty { padding: 28px 18px; text-align: center; color: var(--ft-muted); font-size: .9rem; }

/* File type chip: the extension, set in mono on the band */
.ftype {
    width: 40px; height: 40px; flex-shrink: 0;
    border-radius: 9px;
    display: grid; place-items: center;
    background: var(--ft-wash);
    color: var(--ft-ink-2);
    font-family: var(--ft-mono); font-size: 10px; font-weight: 700; letter-spacing: .02em;
    text-transform: uppercase;
}
.ftype[data-kind='video'] { background: var(--ft-band); color: var(--ft-signal); }
.ftype[data-kind='archive'] { background: var(--ft-signal); color: var(--ft-on-signal); }
.ftype[data-kind='image'] { background: color-mix(in srgb, var(--ft-signal) 30%, var(--ft-wash)); color: var(--ft-ink); }
.fname { min-width: 0; flex: 1; }
.fname strong { display: block; font-size: .92rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fname span { font-family: var(--ft-mono); font-size: 11.5px; color: var(--ft-muted); }

/* Files table */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--ft-line); }
.search { position: relative; flex: 1; max-width: 360px; min-width: 200px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ft-subtle); pointer-events: none; }
.search .input { padding-left: 36px; }
.toolbar-meta { font-family: var(--ft-mono); font-size: 12px; color: var(--ft-muted); }
.ftable { width: 100%; border-collapse: collapse; }
.ftable th {
    text-align: left; padding: 10px 18px;
    font-family: var(--ft-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--ft-subtle);
    background: var(--ft-surface-2);
    border-bottom: 1px solid var(--ft-line);
    white-space: nowrap;
}
.ftable td { padding: 12px 18px; border-bottom: 1px solid var(--ft-line); vertical-align: middle; font-size: .9rem; }
.ftable tr:last-child td { border-bottom: 0; }
.ftable tbody tr:hover { background: var(--ft-surface-2); }
.ftable .num { font-family: var(--ft-mono); font-size: 12.5px; color: var(--ft-ink-2); white-space: nowrap; }
.ftable .cell-file { display: flex; align-items: center; gap: 12px; min-width: 0; max-width: 420px; }
.ftable .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.chip { display: inline-block; font-family: var(--ft-mono); font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.chip-ok { background: var(--ft-wash); color: var(--ft-ink-2); }
.chip-warn { background: var(--ft-warn-wash); color: var(--ft-warn); }
.chip-gone { background: var(--ft-danger-wash); color: var(--ft-danger); }
.icon-act {
    width: 32px; height: 32px; display: inline-grid; place-items: center;
    border-radius: 8px; border: 1px solid var(--ft-line); background: var(--ft-surface);
    color: var(--ft-ink-2); cursor: pointer; text-decoration: none;
}
.icon-act:hover { background: var(--ft-wash); color: var(--ft-ink); }
.icon-act.danger:hover { background: var(--ft-danger-wash); color: var(--ft-danger); border-color: transparent; }
.icon-act svg { width: 16px; height: 16px; }
.table-wrap { overflow-x: auto; }
.table-note { padding: 12px 18px; font-size: .8rem; color: var(--ft-subtle); border-top: 1px solid var(--ft-line); }
@media (max-width: 760px) {
    .ftable thead { display: none; }
    .ftable, .ftable tbody, .ftable tr, .ftable td { display: block; width: 100%; }
    .ftable tr { padding: 12px 16px; border-bottom: 1px solid var(--ft-line); display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; }
    .ftable td { padding: 0; border: 0; }
    .ftable td.c-file { grid-column: 1 / -1; }
    .ftable td.c-up { display: none; }
    .ftable td.c-meta { grid-column: 1; }
    .ftable td.c-act { grid-column: 2; grid-row: 2 / span 2; align-self: center; }
}
.mob-meta { display: none; }
@media (max-width: 760px) { .mob-meta { display: inline; } .desk-only { display: none !important; } }

.empty-panel { padding: 56px 24px; text-align: center; }
.empty-panel .upload-glyph { margin-bottom: 14px; }
.empty-panel h3 { font-size: 1.1rem; font-weight: 800; }
.empty-panel p { color: var(--ft-muted); margin: 6px 0 18px; }

/* Account menu */
.menu { position: relative; }
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    border: 0; cursor: pointer;
    background: var(--ft-band); color: var(--ft-signal);
    font-family: var(--ft-mono); font-weight: 700; font-size: 13px;
}
.menu-pop {
    position: absolute; right: 0; top: 46px; width: 248px;
    background: var(--ft-surface); border: 1px solid var(--ft-line); border-radius: var(--ft-r-lg);
    box-shadow: var(--ft-shadow-3); padding: 6px; z-index: 60;
}
.menu-who { padding: 10px 10px 12px; border-bottom: 1px solid var(--ft-line); margin-bottom: 6px; }
.menu-who strong { display: block; font-size: .92rem; overflow-wrap: anywhere; }
.menu-who span { font-family: var(--ft-mono); font-size: 11.5px; color: var(--ft-muted); overflow-wrap: anywhere; }
.menu-pop a, .menu-pop button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 10px; border: 0; background: none; border-radius: 8px;
    font-size: .9rem; font-weight: 600; color: var(--ft-ink-2); text-decoration: none; text-align: left; cursor: pointer;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--ft-wash); color: var(--ft-ink); }
.menu-pop .menu-danger { color: var(--ft-danger); }
.menu-pop .menu-danger:hover { background: var(--ft-danger-wash); color: var(--ft-danger); }
.menu-sep { height: 1px; background: var(--ft-line); margin: 6px 0; }

/* Bottom bar on phones */
.bottom-nav {
    position: fixed; inset: auto 0 0 0; z-index: 40;
    height: var(--ft-bottom-h);
    display: flex;
    background: var(--ft-surface);
    border-top: 1px solid var(--ft-line);
    padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 768px) { .bottom-nav { display: none; } }
.bottom-nav .tab-btn, .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; cursor: pointer;
    font-size: 11px; font-weight: 700; color: var(--ft-muted); text-decoration: none;
}
.bottom-nav svg { width: 21px; height: 21px; }
.bottom-nav .active { color: var(--ft-ink); }
.bottom-nav .active svg { color: var(--ft-signal-ink); }

/* ===================== SHARED APP PIECES (admin, developers) ===================== */
@media (min-width: 1000px) { .overview-5 { grid-template-columns: repeat(4, 1fr); } }

/* Segmented control */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--ft-wash); border-radius: var(--ft-r-md); max-width: 100%; overflow-x: auto; }
.seg-btn {
    border: 0; background: transparent; cursor: pointer; white-space: nowrap;
    padding: 7px 14px; border-radius: 8px;
    font-size: .88rem; font-weight: 700; color: var(--ft-muted);
}
.seg-btn:hover { color: var(--ft-ink); }
.seg-btn.active { background: var(--ft-surface); color: var(--ft-ink); box-shadow: var(--ft-shadow-1); }
.seg-n { font-size: 11px; color: var(--ft-subtle); margin-left: 4px; }
.seg-page { margin-bottom: 20px; }

/* Chips */
.chip-ink { background: var(--ft-band); color: var(--ft-band-text); }
.chip-signal { background: var(--ft-signal); color: var(--ft-on-signal); }
.chip-plain { background: var(--ft-wash); color: var(--ft-ink-2); }
.scope-chip { font-family: var(--ft-mono); font-size: 11px; padding: 2px 6px; border-radius: 5px; background: var(--ft-wash); color: var(--ft-ink-2); white-space: nowrap; display: inline-block; margin: 1px 0; }
.ftype-person { border-radius: 50%; background: var(--ft-band); color: var(--ft-signal); font-size: 11px; }
.you { font-family: var(--ft-mono); font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 99px; background: var(--ft-signal); color: var(--ft-on-signal); vertical-align: 2px; }
.owner { font-size: .88rem; }
.owner .sub { display: block; font-family: var(--ft-mono); font-size: 11px; color: var(--ft-muted); }
.muted { color: var(--ft-muted); }
.alert-error { margin-bottom: 14px; }

/* Dialogs */
.dialog-overlay {
    position: fixed; inset: 0; z-index: 90;
    background: var(--ft-scrim);
    display: grid; place-items: center;
    padding: 16px;
    animation: ft-fade .15s ease-out;
}
@keyframes ft-fade { from { opacity: 0; } }
.dialog {
    width: 100%; max-width: 420px; max-height: calc(100vh - 32px); overflow-y: auto;
    background: var(--ft-surface); border: 1px solid var(--ft-line); border-radius: var(--ft-r-xl);
    padding: 24px; box-shadow: var(--ft-shadow-3);
    animation: ft-rise .2s var(--ft-ease);
}
.dialog-wide { max-width: 560px; }
.dialog h2 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; }
.dialog > p { margin-top: 6px; color: var(--ft-muted); font-size: .92rem; }
.dialog .field-label { margin: 16px 0 6px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.dialog-row { display: flex; gap: 8px; margin: 12px 0 4px; }
.btn-danger-solid {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 16px; border-radius: var(--ft-r-md); border: 0; cursor: pointer;
    background: var(--ft-danger-fill); color: #fff; font-size: .9rem; font-weight: 700;
}
.btn-danger-solid:hover { filter: brightness(1.08); }
select.input { appearance: auto; }

/* Scope picker */
.scopes { display: grid; gap: 6px; }
.scope {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 10px 12px; border: 1px solid var(--ft-line); border-radius: var(--ft-r-md);
    cursor: pointer; transition: border-color var(--transition), background var(--transition);
}
.scope:hover { border-color: var(--ft-line-strong); }
.scope:has(input:checked) { border-color: var(--ft-ink-2); background: var(--ft-surface-2); }
.scope input { margin-top: 3px; accent-color: var(--ft-ink); width: 16px; height: 16px; flex-shrink: 0; }
[data-theme="dark"] .scope input { accent-color: var(--ft-signal); }
.scope code { font-family: var(--ft-mono); font-size: .85rem; font-weight: 600; }
.scope small { display: block; color: var(--ft-muted); font-size: .82rem; }
.scope-all { border-style: dashed; }
.token-reveal {
    margin-top: 14px; padding: 14px; border-radius: var(--ft-r-md);
    background: var(--ft-band); color: var(--ft-signal);
    font-size: .9rem; word-break: break-all; user-select: all;
}

/* Developer intro steps */
.dev-intro { display: grid; gap: 10px; margin-bottom: 18px; }
@media (min-width: 900px) { .dev-intro { grid-template-columns: repeat(3, 1fr); } }
.dev-step { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--ft-line); border-radius: var(--ft-r-lg); background: var(--ft-surface); }
.dev-step > span { width: 26px; height: 26px; flex-shrink: 0; border-radius: 7px; display: grid; place-items: center; background: var(--ft-signal); color: var(--ft-on-signal); font-size: 12px; font-weight: 700; }
.dev-step p { font-size: .9rem; color: var(--ft-ink-2); }
.dev-step strong { color: var(--ft-ink); }
code { font-family: var(--ft-mono); font-size: .86em; }
p code, li code, td code, .callout code, .dev-step code { background: var(--ft-wash); padding: 1px 5px; border-radius: 4px; }

/* Docs */
.docs { display: grid; gap: 28px; align-items: start; }
@media (min-width: 1000px) { .docs { grid-template-columns: 200px minmax(0, 1fr); } }
.toc { display: none; }
@media (min-width: 1000px) {
    .toc { display: flex; flex-direction: column; gap: 1px; position: sticky; top: calc(var(--ft-header-h) + 20px); max-height: calc(100vh - var(--ft-header-h) - 40px); overflow-y: auto; }
}
.toc .tag { margin: 14px 0 6px 10px; }
.toc .tag:first-child { margin-top: 0; }
.toc a { padding: 5px 10px; border-radius: 7px; font-size: .86rem; color: var(--ft-ink-2); text-decoration: none; }
.toc a:hover { background: var(--ft-wash); color: var(--ft-ink); }
.doc { min-width: 0; max-width: 820px; }
.doc-sec { padding: 26px 0; border-bottom: 1px solid var(--ft-line); scroll-margin-top: calc(var(--ft-header-h) + 16px); }
.doc-sec:first-child { padding-top: 0; }
.doc-sec:last-child { border-bottom: 0; }
.doc-sec h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.025em; margin-bottom: 8px; }
.doc-sec p { color: var(--ft-ink-2); margin: 8px 0; }
.doc-sec a { color: var(--ft-signal-ink); font-weight: 600; }
.doc-list { margin: 10px 0 0 18px; display: grid; gap: 6px; color: var(--ft-ink-2); }
.callout { margin: 14px 0; padding: 12px 14px; border-radius: var(--ft-r-md); border-left: 3px solid var(--ft-ink); background: var(--ft-surface); font-size: .9rem; color: var(--ft-ink-2); }
[data-theme="dark"] .callout { border-left-color: var(--ft-signal); }
.callout-warn { border-left-color: var(--ft-warn) !important; background: var(--ft-warn-wash); color: var(--ft-ink); }
.ep-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.method { font-family: var(--ft-mono); font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 5px; letter-spacing: .03em; }
.m-get { background: color-mix(in srgb, #2F7DE1 16%, transparent); color: #2A6FC9; }
.m-post { background: var(--ft-signal); color: var(--ft-on-signal); }
.m-patch { background: var(--ft-warn-wash); color: var(--ft-warn); }
.m-del { background: var(--ft-danger-wash); color: var(--ft-danger); }
[data-theme="dark"] .m-get { color: #7FB3F5; }
.ep-path { font-family: var(--ft-mono); font-size: .92rem; font-weight: 600; color: var(--ft-ink); margin-right: 4px; overflow-wrap: anywhere; }
.endpoint h2 { font-size: 1.15rem; }
.req { font-family: var(--ft-mono); font-size: 10px; color: var(--ft-danger); margin-left: 4px; }
.ptable { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .88rem; }
.ptable th { text-align: left; font-family: var(--ft-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ft-subtle); padding: 8px 12px; border-bottom: 1px solid var(--ft-line); }
.ptable td { padding: 9px 12px; border-bottom: 1px solid var(--ft-line); vertical-align: top; color: var(--ft-ink-2); }
.ptable td:first-child { white-space: nowrap; }
.ptable tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) { .ptable td:first-child { white-space: normal; } }

.code-block { margin: 12px 0; border: 1px solid var(--ft-band-line); border-radius: var(--ft-r-md); overflow: hidden; background: #0B0D0C; }
.code-bar { display: flex; justify-content: space-between; align-items: center; padding: 7px 12px; border-bottom: 1px solid var(--ft-band-line); background: var(--ft-band); font-family: var(--ft-mono); font-size: 11px; color: var(--ft-band-muted); }
.copy-code { border: 0; background: none; cursor: pointer; font-family: var(--ft-mono); font-size: 11px; font-weight: 600; color: var(--ft-signal); padding: 2px 4px; }
.code-block pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-family: var(--ft-mono); font-size: 12.5px; line-height: 1.65; color: #DCE3D8; }
.code-block pre code { font-size: inherit; background: none; padding: 0; }
.code-block pre a { color: var(--ft-signal); }
.code-tabs { margin: 12px 0; }
.code-tabs .code-block { margin-top: 0; border-top-left-radius: 0; }
.code-tab-bar { display: flex; gap: 2px; }
.code-tab-bar button {
    border: 1px solid var(--ft-band-line); border-bottom: 0; cursor: pointer;
    padding: 6px 12px; border-radius: 8px 8px 0 0;
    background: var(--ft-wash); color: var(--ft-ink-2); font-size: .8rem; font-weight: 700;
}
.code-tab-bar button.active { background: var(--ft-band); color: var(--ft-signal); }
.flow { list-style: none; display: grid; gap: 16px; margin-top: 14px; }
.flow > li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; color: var(--ft-ink-2); }
.flow-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ft-band); color: var(--ft-signal); font-size: 12px; font-weight: 700; }
.flow strong { color: var(--ft-ink); }
.progress-page .inprogress-list { margin-top: 0; }
.dev-step code { white-space: normal; word-break: break-all; }

/* In progress groups */
.ip-group { margin-bottom: 28px; }
.ip-group-head { margin-bottom: 12px; }
.ip-group-head h2 { font-size: 1.05rem; font-weight: 800; letter-spacing: -.015em; }
.ip-group-head h2 .mono { font-size: .8rem; color: var(--ft-subtle); font-weight: 600; margin-left: 4px; }
.ip-group-head p { color: var(--ft-muted); font-size: .88rem; margin-top: 2px; }
.ip-note { font-size: .86rem; color: var(--ft-ink-2); margin: -4px 0 12px; }
.ip-note-bad { color: var(--ft-danger); }
.inprogress-card.ip-failed { border-left: 3px solid var(--ft-danger); }
.inprogress-card.ip-finishing, .inprogress-card.ip-paused { border-left: 3px solid var(--ft-warn); }
.inprogress-card.ip-uploading { border-left: 3px solid var(--ft-signal); }
.inprogress-card.ip-done { border-left: 3px solid var(--ft-line-strong); }
.progress-fill.is-live { animation: ft-live 1.2s linear infinite; }
@keyframes ft-live { 50% { opacity: .75; } }
.progress-page .overview { margin-bottom: 26px; }
