@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --tl-primary: #039be5;
    --tl-primary-shade: #177cc0;
    --tl-primary-dark: #046ed0;
    --tl-ink: #170f49;
    --tl-text: #252525;
    --tl-muted: #7a7a7a;
    --tl-border: #e7eaee;
    --tl-bg: #f4f7fb;
    --tl-surface: #ffffff;
    --tl-radius: 14px;
    --tl-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
    --tl-shadow-hover: 0 12px 30px rgba(3, 155, 229, .16);
    --tl-header-h: 64px;
    --tl-font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--tl-font);
    color: var(--tl-text);
    background: var(--tl-bg);
    padding-top: var(--tl-header-h);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--tl-primary-dark); text-decoration: none; }
a:hover { color: var(--tl-primary); }
img { max-width: 100%; height: auto; }
.clear { clear: both; }

/* ─── Header ─── */
.tl-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--tl-header-h);
    background: var(--tl-surface);
    border-bottom: 1px solid var(--tl-border);
    box-shadow: 0 1px 12px rgba(16, 24, 40, .05);
    z-index: 1000;
}

.tl-header-inner {
    max-width: 1180px;
    margin: 0 auto;
    height: 100%;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.tl-logo { display: inline-flex; align-items: center; }
.tl-logo img { max-height: 38px; width: auto; display: block; }
.tl-logo-text { font-size: 20px; font-weight: 700; color: var(--tl-ink); letter-spacing: -.02em; }

.tl-nav { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.tl-nav a {
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--tl-text);
    font-size: 14px;
    font-weight: 500;
}
.tl-nav a:hover { background: #eef6fd; color: var(--tl-primary-dark); }

.tl-header-search { margin-left: auto; flex: 1; max-width: 420px; }
.tl-header-search form { position: relative; display: block; }
.tl-header-search input {
    width: 100%;
    height: 42px;
    padding: 0 44px 0 16px;
    border: 1px solid var(--tl-border);
    border-radius: 24px;
    background: #f6f8fb;
    font-family: inherit;
    font-size: 14px;
    color: var(--tl-text);
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.tl-header-search input:focus {
    border-color: var(--tl-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(3, 155, 229, .14);
}
.tl-header-search button {
    position: absolute;
    right: 6px; top: 50%;
    transform: translateY(-50%);
    width: 32px; height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--tl-primary);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tl-burger {
    display: none;
    width: 40px; height: 40px;
    border: 1px solid var(--tl-border);
    border-radius: 10px;
    background: #fff;
    color: var(--tl-ink);
    font-size: 20px;
    cursor: pointer;
}

/* ─── Mobile drawer ─── */
.tl-drawer {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 0;
    overflow: hidden;
    background: var(--tl-ink);
    z-index: 1100;
    transition: width .25s ease;
    padding-top: 60px;
}
.tl-drawer a {
    display: block;
    padding: 13px 22px;
    color: #e8ecf4;
    font-size: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.tl-drawer a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.tl-drawer .tl-close {
    position: absolute;
    top: 14px; right: 18px;
    font-size: 26px;
    border: none;
    background: none;
    color: #fff;
    cursor: pointer;
}

/* ─── Layout ─── */
.tl-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px 18px 40px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 22px;
    align-items: start;
}
.tl-main { min-width: 0; }
.tl-side { position: sticky; top: calc(var(--tl-header-h) + 18px); }

/* ─── Hero / intro ─── */
.tl-hero {
    background: linear-gradient(135deg, #0288d1 0%, #039be5 60%, #29b6f6 100%);
    color: #fff;
    border-radius: var(--tl-radius);
    padding: 26px 26px;
    margin-bottom: 22px;
    box-shadow: var(--tl-shadow);
}
.tl-hero h1 { margin: 0 0 6px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.tl-hero h2 { margin: 0 0 10px; font-size: 15px; font-weight: 400; opacity: .92; }
.tl-hero p { margin: 0; font-size: 14px; opacity: .92; line-height: 1.7; }

/* ─── Section ─── */
.tl-section { margin-bottom: 26px; }
.tl-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.tl-section-head h1, .tl-section-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--tl-ink);
    position: relative;
    padding-left: 12px;
}
.tl-section-head h1::before,
.tl-section-head h2::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 18px;
    border-radius: 4px;
    background: var(--tl-primary);
}
.tl-section-head a { font-size: 13px; font-weight: 500; }

/* ─── App grid ─── */
.tl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}
.tl-card {
    background: var(--tl-surface);
    border: 1px solid var(--tl-border);
    border-radius: var(--tl-radius);
    padding: 16px 14px;
    text-align: center;
    box-shadow: var(--tl-shadow);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
    display: block;
}
.tl-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--tl-shadow-hover);
    border-color: #bfe6fb;
}
.tl-card-icon {
    width: 76px; height: 76px;
    margin: 0 auto 10px;
    border-radius: 18px;
    object-fit: cover;
    background: #f1f5f9;
    box-shadow: 0 4px 12px rgba(16, 24, 40, .12);
}
.tl-card-name {
    margin: 0 0 3px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tl-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tl-card-meta {
    margin: 0;
    font-size: 12px;
    color: var(--tl-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Category sidebar ─── */
.tl-side-box {
    background: var(--tl-surface);
    border: 1px solid var(--tl-border);
    border-radius: var(--tl-radius);
    box-shadow: var(--tl-shadow);
    overflow: hidden;
    margin-bottom: 18px;
}
.tl-side-box-title {
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--tl-primary);
}
.tl-side-box ul { list-style: none; margin: 0; padding: 6px 0; }
.tl-side-box li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--tl-text);
    font-size: 14px;
    border-bottom: 1px solid var(--tl-border);
}
.tl-side-box li:last-child a { border-bottom: none; }
.tl-side-box li a:hover { background: #f3f9fe; color: var(--tl-primary-dark); }

/* ─── Breadcrumb ─── */
.tl-breadcrumb {
    font-size: 13px;
    color: var(--tl-muted);
    margin-bottom: 16px;
}
.tl-breadcrumb a { color: var(--tl-primary-dark); }
.tl-breadcrumb span + span::before { content: '›'; margin: 0 8px; color: var(--tl-muted); }

/* ─── App detail ─── */
.tl-panel {
    background: var(--tl-surface);
    border: 1px solid var(--tl-border);
    border-radius: var(--tl-radius);
    box-shadow: var(--tl-shadow);
    padding: 22px;
    margin-bottom: 22px;
}
.tl-app-head { display: flex; align-items: center; gap: 18px; }
.tl-app-head img {
    width: 92px; height: 92px;
    border-radius: 20px;
    box-shadow: 0 6px 16px rgba(16, 24, 40, .16);
    flex-shrink: 0;
}
.tl-app-head h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; color: var(--tl-ink); }
.tl-app-head .tl-dev { margin: 0; font-size: 13px; color: var(--tl-muted); }

.tl-meta-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.tl-meta-table th, .tl-meta-table td {
    text-align: left;
    padding: 9px 12px;
    font-size: 14px;
    border-bottom: 1px solid var(--tl-border);
}
.tl-meta-table th { color: var(--tl-muted); font-weight: 500; width: 38%; }
.tl-meta-table td { color: var(--tl-text); font-weight: 500; }

.tl-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.tl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    color: #fff;
    text-align: center;
    min-height: 52px;
}
.tl-btn-primary { background: var(--tl-primary); }
.tl-btn-primary:hover { background: var(--tl-primary-shade); color: #fff; }
.tl-btn-tg { background: #29a9eb; }
.tl-btn-tg:hover { background: #1e93d0; color: #fff; }
.tl-btn-block { display: flex; width: 100%; grid-column: 1 / -1; }

.tl-shots { display: flex; gap: 10px; overflow-x: auto; margin: 18px 0; padding-bottom: 6px; }
.tl-shots img { height: 200px; border-radius: 12px; flex-shrink: 0; box-shadow: var(--tl-shadow); }

.tl-content { font-size: 15px; color: #333; line-height: 1.8; }
.tl-content h2, .tl-content h3 { color: var(--tl-ink); margin: 22px 0 10px; }
.tl-content img { border-radius: 10px; }
.tl-content ul { padding-left: 20px; }

/* ─── Download page ─── */
.tl-download { text-align: center; padding: 30px 22px; }
.tl-download h1 { font-size: 22px; color: var(--tl-ink); margin: 0 0 8px; }
.tl-download .tl-meta { color: var(--tl-muted); margin-bottom: 22px; }

/* ─── Notice / 404 ─── */
.tl-notice { color: var(--tl-muted); font-size: 14px; padding: 14px 0; }
.tl-404 { text-align: center; padding: 50px 20px; }
.tl-404 .tl-code { font-size: 76px; font-weight: 700; color: var(--tl-primary); line-height: 1; }

/* ─── Ratings & reviews ─── */
.tl-rating-summary {
    display: flex;
    gap: 26px;
    align-items: center;
    flex-wrap: wrap;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--tl-border);
    margin-bottom: 8px;
}
.tl-rating-score { text-align: center; min-width: 110px; }
.tl-rating-score .tl-score-num { font-size: 46px; font-weight: 700; color: var(--tl-ink); line-height: 1; }
.tl-rating-score .tl-score-count { font-size: 12px; color: var(--tl-muted); margin-top: 6px; }
.tl-stars { color: #f5a623; letter-spacing: 2px; font-size: 18px; }
.tl-stars .tl-star-off { color: #d9dee5; }
.tl-bars { flex: 1; min-width: 220px; }
.tl-bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--tl-muted); margin: 4px 0; }
.tl-bar-row .tl-bar-label { width: 12px; text-align: right; }
.tl-bar { flex: 1; height: 8px; background: #eef2f6; border-radius: 6px; overflow: hidden; }
.tl-bar > span { display: block; height: 100%; background: var(--tl-primary); border-radius: 6px; }

.tl-comments { margin-top: 8px; }
.tl-comment { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--tl-border); }
.tl-comment:last-child { border-bottom: none; }
.tl-comment-avatar img { width: 46px; height: 46px; border-radius: 50%; display: block; background: #eef2f6; }
.tl-comment-body { flex: 1; min-width: 0; }
.tl-comment-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tl-comment-author { font-weight: 600; color: var(--tl-ink); font-size: 14px; }
.tl-comment-date { font-size: 12px; color: var(--tl-muted); }
.tl-comment-text { font-size: 14px; color: #444; margin-top: 4px; line-height: 1.7; }
.tl-comment-text p { margin: 0 0 6px; }
.tl-no-comments { color: var(--tl-muted); font-size: 14px; padding: 10px 0; }

/* ─── Review form (cosmetic) ─── */
.tl-review-form { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--tl-border); }
.tl-review-form h3 { margin: 0 0 14px; font-size: 16px; color: var(--tl-ink); font-weight: 600; }
.tl-form-row { margin-bottom: 14px; }
.tl-form-row label { display: block; font-size: 13px; font-weight: 500; color: var(--tl-text); margin-bottom: 6px; }
.tl-form-row select,
.tl-form-row input[type="text"],
.tl-form-row textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--tl-border);
    border-radius: 10px;
    background: #f8fafc;
    font-family: inherit;
    font-size: 14px;
    color: var(--tl-text);
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.tl-form-row select:focus,
.tl-form-row input[type="text"]:focus,
.tl-form-row textarea:focus {
    border-color: var(--tl-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(3, 155, 229, .14);
}
.tl-form-row textarea { resize: vertical; min-height: 96px; }
.tl-form-grid { display: grid; grid-template-columns: 200px 1fr; gap: 14px; }
.tl-review-form .tl-btn-primary { display: inline-flex; border: none; cursor: pointer; }
@media (max-width: 600px) {
    .tl-form-grid { grid-template-columns: 1fr; }
}

/* ─── Footer ─── */
.tl-footer {
    background: #0f1b2d;
    color: #aab6c6;
    padding: 30px 18px 22px;
    margin-top: 20px;
}
.tl-footer-inner { max-width: 1180px; margin: 0 auto; }
.tl-footer-links { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 14px; }
.tl-footer-links a { color: #cdd6e2; font-size: 14px; }
.tl-footer-links a:hover { color: #fff; }
.tl-footer-copy { font-size: 13px; color: #7d8da1; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 14px; }
.tl-footer-copy b { color: #fff; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .tl-container { grid-template-columns: 1fr; }
    .tl-side { position: static; }
    .tl-nav { display: none; }
}
@media (max-width: 600px) {
    .tl-burger { display: inline-flex; }
    .tl-header-search { max-width: none; }
    .tl-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
    .tl-card-icon { width: 64px; height: 64px; }
    .tl-app-head img { width: 72px; height: 72px; }
    .tl-actions { grid-template-columns: 1fr; }
    .tl-shots img { height: 150px; }
}
