/* TouchHub — GitHub-подобный .onion-хостинг кода (theater: look real, harmless) */

:root {
    --th-bg: #0b0f14;
    --th-panel: #10161d;
    --th-panel-2: #0d131a;
    --th-line: #1e2a36;
    --th-text: #cdd9e5;
    --th-muted: #768390;
    --th-accent: #6ea8fe;
    --th-accent-2: #3fb950;
    --th-warn: #d29922;
    --th-danger: #f85149;
}

/* Обёртка сайта внутри DarkNot (#browser-body) */
.th-page {
    display: flex;
    min-height: 520px;
    max-height: 100%;
    background: var(--th-bg);
    border: 1px solid var(--th-line);
    border-radius: 8px;
    overflow: hidden;
    color: var(--th-text);
    font-family: 'Ubuntu', system-ui, sans-serif;
    text-align: left;
}

.th-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--th-line);
    margin-bottom: 14px;
}
.th-toolbar__hint { color: var(--th-muted); font-size: 11.5px; }

.th-search {
    background: var(--th-panel);
    border: 1px solid var(--th-line);
    border-radius: 6px;
    color: var(--th-text);
    padding: 6px 10px;
    font-size: 12px;
    min-width: 220px;
}
.th-search:focus { outline: none; border-color: var(--th-accent); }

.th-body { flex: 1; display: flex; min-height: 0; }

/* Left nav */
.th-nav {
    width: 210px;
    flex: 0 0 210px;
    background: var(--th-panel-2);
    border-right: 1px solid var(--th-line);
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: auto;
}
.th-nav__title { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--th-muted); margin: 12px 8px 6px; }
.th-nav__item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 9px; border-radius: 6px;
    color: var(--th-text); font-size: 12.5px;
    background: transparent; border: 0; cursor: pointer; text-align: left; width: 100%;
}
.th-nav__item:hover { background: rgba(110, 168, 254, .1); }
.th-nav__item.is-active { background: rgba(110, 168, 254, .16); color: #fff; }
.th-nav__count { margin-left: auto; font-size: 10.5px; color: var(--th-muted); }

/* Main pane */
.th-main { flex: 1; min-width: 0; overflow: auto; padding: 18px 22px; }

.th-hero {
    border: 1px solid var(--th-line);
    border-radius: 8px;
    padding: 16px 18px;
    background: linear-gradient(120deg, rgba(110,168,254,.12), rgba(112,72,232,.08));
    margin-bottom: 16px;
}
.th-hero h2 { margin: 0 0 6px; font-size: 17px; }
.th-hero p { margin: 0; color: var(--th-muted); font-size: 12.5px; line-height: 1.45; }

.th-sec-title { font-size: 13px; margin: 18px 0 10px; display: flex; align-items: center; gap: 8px; color: #fff; }
.th-sec-title span { color: var(--th-muted); font-size: 11px; font-weight: 400; }

/* Repo cards */
.th-repos { display: flex; flex-direction: column; gap: 10px; }
.th-repo {
    border: 1px solid var(--th-line);
    border-radius: 8px;
    background: var(--th-panel);
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color .12s, background .12s;
}
.th-repo:hover { border-color: var(--th-accent); background: #121a24; }
.th-repo__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.th-repo__name { font-size: 14px; font-weight: 700; color: var(--th-accent); }
.th-repo__owner { color: var(--th-muted); font-size: 12px; }
.th-repo__desc { color: var(--th-muted); font-size: 12.5px; margin: 6px 0 8px; line-height: 1.4; }
.th-repo__meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--th-muted); }
.th-repo__meta b { color: var(--th-text); }
.th-repo__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.th-tag {
    font-size: 10.5px; padding: 2px 8px; border-radius: 20px;
    background: rgba(110, 168, 254, .14); color: #a9c7ff;
    border: 1px solid rgba(110, 168, 254, .25);
}
.th-tag--core { background: rgba(63, 185, 80, .14); color: #7ee787; border-color: rgba(63, 185, 80, .3); }
.th-tag--lang { background: rgba(210, 153, 34, .12); color: #e3b341; border-color: rgba(210, 153, 34, .25); }

.th-badge-installed {
    font-size: 10px; padding: 2px 7px; border-radius: 4px;
    background: rgba(63, 185, 80, .16); color: #7ee787; border: 1px solid rgba(63, 185, 80, .35);
}


/* Repo detail */
.th-detail__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.th-detail__title { font-size: 18px; font-weight: 700; }
.th-detail__title span { color: var(--th-muted); font-weight: 400; }
.th-btn {
    border: 1px solid var(--th-line);
    background: #21262d;
    color: var(--th-text);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
}
.th-btn:hover { background: #30363d; }
.th-btn--primary { background: #238636; border-color: #2ea043; color: #fff; }
.th-btn--primary:hover { background: #2ea043; }
.th-btn--danger { color: var(--th-danger); border-color: rgba(248, 81, 73, .4); }
.th-btn--ghost { background: transparent; }
.th-btn.is-disabled { opacity: .55; pointer-events: none; }

.th-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--th-line); margin: 14px 0 0; }
.th-tab {
    padding: 8px 12px; font-size: 12.5px; color: var(--th-muted);
    background: transparent; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
}
.th-tab.is-active { color: #fff; border-bottom-color: #f78166; }
.th-tab:hover { color: var(--th-text); }

.th-panelbox {
    border: 1px solid var(--th-line);
    border-radius: 8px;
    margin-top: 14px;
    overflow: hidden;
}
.th-panelbox__head {
    padding: 8px 12px; background: var(--th-panel-2);
    border-bottom: 1px solid var(--th-line);
    font-size: 11.5px; color: var(--th-muted);
    display: flex; justify-content: space-between; align-items: center;
}
.th-readme {
    padding: 14px 16px;
    font-family: 'Ubuntu Mono', ui-monospace, monospace;
    font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; color: var(--th-text);
    max-height: 360px; overflow: auto;
}
.th-readme .c-comment { color: var(--th-muted); }
.th-readme .c-key { color: #ff7b72; }
.th-readme .c-str { color: #a5d6ff; }
.th-readme .c-sim { color: var(--th-warn); }

.th-files { font-size: 12.5px; }
.th-file { display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-top: 1px solid var(--th-line); }
.th-file:first-child { border-top: 0; }
.th-file__name { flex: 1; color: var(--th-accent); }
.th-file__msg { color: var(--th-muted); flex: 2; }
.th-file__size { color: var(--th-muted); font-size: 11px; }

.th-release { padding: 10px 14px; border-top: 1px solid var(--th-line); }
.th-release:first-child { border-top: 0; }
.th-release__ver { font-weight: 700; color: var(--th-accent-2); }

.th-note {
    margin-top: 14px; padding: 10px 12px;
    border: 1px dashed var(--th-line); border-left: 3px solid var(--th-warn);
    border-radius: 6px; font-size: 11.5px; color: var(--th-muted); line-height: 1.5;
}

.th-empty { color: var(--th-muted); font-size: 13px; padding: 30px 0; text-align: center; }

/* Modal confirm */
.th-modal {
    position: absolute; inset: 0; background: rgba(1, 4, 9, .72);
    display: none; align-items: center; justify-content: center; z-index: 5;
}
.th-modal.is-open { display: flex; }
.th-modal__box {
    width: min(420px, 90%); background: var(--th-panel);
    border: 1px solid var(--th-line); border-radius: 10px; padding: 18px 20px;
}
.th-modal__box h3 { margin: 0 0 8px; font-size: 15px; }
.th-modal__box p { margin: 0 0 14px; color: var(--th-muted); font-size: 12.5px; line-height: 1.5; }
.th-modal__actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 820px) {
    .th-nav { width: 150px; flex-basis: 150px; }
    .th-search { min-width: 130px; }
}

/* ── Панель загрузок TouchHub (в ОС) ── */
.th-dl {
    position: fixed; right: 18px; bottom: 18px; width: min(370px, 92vw);
    background: var(--th-bg); border: 1px solid var(--th-line); border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .6); z-index: 99990; display: none;
    color: var(--th-text); font-family: 'Ubuntu', system-ui, sans-serif; overflow: hidden;
}
.th-dl.is-open { display: block; }
.th-dl__head { padding: 8px 12px; background: #010409; border-bottom: 1px solid var(--th-line); font-size: 12px; font-weight: 700; }
.th-dl__list { display: flex; flex-direction: column; }
.th-dl__row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--th-line); }
.th-dl__row:first-child { border-top: 0; }
.th-dl__row.is-done .th-dl__bar > i { background: var(--th-accent-2); }
.th-dl__icon { font-size: 18px; }
.th-dl__body { flex: 1; min-width: 0; }
.th-dl__name { font-size: 12px; font-weight: 600; }
.th-dl__ver { color: var(--th-muted); font-weight: 400; }
.th-dl__bar { height: 6px; margin: 5px 0; background: rgba(255, 255, 255, .08); border-radius: 3px; overflow: hidden; }
.th-dl__bar > i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--th-accent), #7048e8); transition: width .12s linear; }
.th-dl__meta { font-size: 10.5px; color: var(--th-muted); }
.th-dl__pct { font-size: 11px; color: var(--th-accent); font-variant-numeric: tabular-nums; }

/* ── Визард распаковки архива ── */
.th-extract .th-extract__body { display: flex; flex-direction: column; gap: 8px; overflow: auto; }
.th-extract__file { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--th-line); border-radius: 8px; background: var(--th-panel); }
.th-extract__icon { font-size: 22px; }
.th-extract__name { font-weight: 700; font-size: 13px; }
.th-extract__label { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--th-muted); margin-top: 4px; }
.th-extract__vols { display: flex; flex-wrap: wrap; gap: 6px; }
.th-extract__path { display: flex; align-items: center; gap: 8px; }
.th-extract__path-text { flex: 1; font-family: 'Ubuntu Mono', ui-monospace, monospace; font-size: 12px; color: var(--th-accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-extract__dirs { display: flex; flex-direction: column; gap: 4px; max-height: 140px; overflow: auto; border: 1px solid var(--th-line); border-radius: 8px; padding: 6px; background: var(--th-panel-2); }
.th-dirrow { text-align: left; background: transparent; border: 0; color: var(--th-text); padding: 5px 7px; border-radius: 5px; cursor: pointer; font-size: 12.5px; }
.th-dirrow:hover { background: rgba(110, 168, 254, .12); }
.th-extract__hint { font-size: 11.5px; color: var(--th-muted); line-height: 1.5; }
.th-extract__actions { display: flex; gap: 8px; margin-top: auto; }
.th-extract .th-muted { color: var(--th-muted); font-size: 12px; }
.th-badge-arch { background: rgba(210, 153, 34, .16); color: #e3b341; border-color: rgba(210, 153, 34, .4); }
