/* Tech Setup and account-menu controls loaded after the core theme. */
.ts-profile-feature-panel {
    padding: 26px;
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-xl);
    background: var(--ts-panel);
    color: var(--ts-text);
    box-shadow: var(--ts-shadow);
}

.ts-profile-feature-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 20px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--ts-border-soft);
}

.ts-profile-feature-heading span {
    color: var(--ts-accent);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
}

.ts-profile-feature-heading h3,
.ts-setup-photo-panel h4,
.techsteve-profile-details-card h5 {
    color: var(--ts-text) !important;
}

.ts-profile-feature-heading p,
.ts-setup-photo-panel p,
.techsteve-profile-details-card p {
    color: var(--ts-text-soft) !important;
}

.techsteve-profile-details-card {
    padding: 20px;
    border: 1px solid var(--ts-border-soft);
    border-radius: var(--ts-radius-lg);
    background: var(--ts-panel-soft);
}

.techsteve-profile-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.techsteve-profile-edit-button,
.ts-setup-album-form button,
.ts-setup-upload-form button,
.ts-setup-photo-grid button {
    appearance: none !important;
    min-height: 44px;
    padding: 10px 16px !important;
    border: 1px solid var(--ts-primary-light) !important;
    border-radius: 10px !important;
    background: linear-gradient(135deg, var(--ts-primary-dark), var(--ts-primary)) !important;
    color: #fff !important;
    font-weight: 750 !important;
    line-height: 1.2;
    box-shadow: 0 8px 20px rgba(22, 136, 255, .18);
}

.techsteve-profile-edit-button:hover,
.ts-setup-album-form button:hover,
.ts-setup-upload-form button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.ts-setup-photo-grid button {
    border-color: color-mix(in srgb, var(--ts-danger) 65%, transparent) !important;
    background: color-mix(in srgb, var(--ts-danger) 18%, var(--ts-panel-soft)) !important;
    color: #ffb6c0 !important;
    box-shadow: none;
}

.ts-setup-photo-panel {
    padding-top: 22px;
    margin-top: 24px;
    border-top: 1px solid var(--ts-border-soft);
}

.ts-setup-album-form {
    align-items: stretch;
}

.ts-setup-album-form input,
.ts-setup-upload-form input,
.ts-setup-upload-form select {
    appearance: none;
    min-width: 0;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid var(--ts-border) !important;
    border-radius: 11px !important;
    outline: 0;
    background: var(--ts-bg-elevated) !important;
    color: var(--ts-text) !important;
    box-shadow: none !important;
}

.ts-setup-album-form input::placeholder,
.ts-setup-upload-form input::placeholder {
    color: var(--ts-text-muted) !important;
    opacity: 1;
}

.ts-setup-album-form input:focus,
.ts-setup-upload-form input:focus,
.ts-setup-upload-form select:focus {
    border-color: var(--ts-primary-light) !important;
    box-shadow: 0 0 0 3px rgba(22, 136, 255, .15) !important;
}

.ts-setup-upload-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 12px;
    margin: 20px 0;
}

.ts-setup-dropzone {
    grid-column: 1 / -1;
    display: flex !important;
    min-height: 160px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    border: 2px dashed color-mix(in srgb, var(--ts-primary) 68%, var(--ts-border)) !important;
    border-radius: 15px;
    background: var(--ts-bg-elevated) !important;
    color: var(--ts-text-soft) !important;
    cursor: pointer;
    transition: var(--ts-transition);
}

.ts-setup-dropzone strong {
    color: var(--ts-text) !important;
}

.ts-setup-dropzone i {
    color: var(--ts-accent) !important;
    font-size: 34px;
}

.ts-setup-dropzone:hover,
.ts-setup-dropzone.is-dragging {
    border-color: var(--ts-accent) !important;
    background: var(--ts-panel-hover) !important;
}

.ts-setup-dropzone input[type="file"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none;
}

.ts-setup-photo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.ts-setup-photo-grid figure {
    margin: 0;
    padding: 11px;
    border: 1px solid var(--ts-border-soft);
    border-radius: 14px;
    background: var(--ts-bg-elevated);
}

.ts-setup-photo-grid img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    object-fit: cover;
}

.ts-setup-photo-grid figcaption {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 2px;
    color: var(--ts-text-soft);
}

.ts-theme-chooser {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.ts-account-menu .ts-theme-chooser button {
    appearance: none !important;
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 6px !important;
    border: 1px solid var(--ts-border) !important;
    border-radius: 9px !important;
    background: var(--ts-panel-hover) !important;
    color: var(--ts-text-soft) !important;
    font-size: 12px;
    font-weight: 700;
    box-shadow: none !important;
}

.ts-account-menu .ts-theme-chooser button.active,
.ts-account-menu .ts-theme-chooser button:hover {
    border-color: var(--ts-primary-light) !important;
    background: linear-gradient(135deg, var(--ts-primary-dark), var(--ts-primary)) !important;
    color: #fff !important;
}

html.light-mode body .techsteve-profile-details-card,
html.light-mode body .ts-setup-photo-grid figure {
    border-color: rgba(22, 136, 255, .18) !important;
    background: #f4f7fb !important;
    color: #101828 !important;
}

html.light-mode body .ts-setup-dropzone,
html.light-mode body .ts-setup-album-form input,
html.light-mode body .ts-setup-upload-form input,
html.light-mode body .ts-setup-upload-form select {
    background: #f7faff !important;
    color: #101828 !important;
}

html.light-mode body .ts-setup-dropzone strong {
    color: #101828 !important;
}

html.light-mode body .ts-setup-dropzone span,
html.light-mode body .ts-setup-photo-grid figcaption {
    color: #475467 !important;
}

html.light-mode body .ts-account-menu .ts-theme-chooser button:not(.active) {
    background: #edf3fa !important;
    color: #344054 !important;
}

html:not(.light-mode) body .ts-setup-dropzone,
html:not(.light-mode) body .ts-setup-album-form input,
html:not(.light-mode) body .ts-setup-upload-form input,
html:not(.light-mode) body .ts-setup-upload-form select {
    background: #09111f !important;
    color: #f5f9ff !important;
}

html:not(.light-mode) body .ts-setup-dropzone strong {
    color: #f5f9ff !important;
}

html:not(.light-mode) body .ts-setup-dropzone span {
    color: #c2d0e4 !important;
}

@media (max-width: 800px) {
    .ts-profile-feature-panel {
        padding: 18px;
    }

    .ts-profile-feature-heading,
    .techsteve-profile-details-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .ts-setup-album-form,
    .ts-setup-upload-form {
        display: grid !important;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .ts-setup-photo-grid {
        grid-template-columns: 1fr;
    }
}

/* Community home: preserve the Create Story artwork and make the feed useful at a glance. */
.timeline-carousel .ts-create-story-card {
    display: block !important;
    width: 178px !important;
    height: 148px !important;
    min-height: 148px !important;
    overflow: hidden;
    border: 1px solid var(--ts-border);
    border-radius: 18px !important;
    background: linear-gradient(145deg, #0d294d, #071529) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
}

.timeline-carousel .ts-create-story-card .story-create-item {
    width: 100%;
    height: 100% !important;
    border-radius: 0 !important;
    background-color: transparent;
    background-position: center 42% !important;
    background-repeat: no-repeat !important;
    background-size: 82px 82px !important;
}

.timeline-carousel .ts-create-story-card .story-shadow {
    background: linear-gradient(180deg, transparent 40%, rgba(3, 10, 21, .94) 100%) !important;
}

.timeline-carousel .ts-create-story-card .ct-story {
    inset: auto 0 0 0 !important;
    display: flex !important;
    width: 100% !important;
    min-height: 48px;
    justify-content: center;
    gap: 9px;
    padding: 11px 12px !important;
    transform: none !important;
    color: #fff !important;
}

.timeline-carousel .ts-create-story-card .ct-story span {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--ts-primary);
    color: #fff;
}

.timeline-carousel .ts-create-story-card .ct-story p {
    margin: 0 !important;
    color: #fff !important;
    font-size: 13px;
    font-weight: 800;
}

.ts-community-discover {
    overflow: hidden;
    border: 1px solid var(--ts-border);
    border-radius: 20px;
    background:
        radial-gradient(circle at 93% 5%, rgba(44, 176, 255, .17), transparent 32%),
        linear-gradient(145deg, var(--ts-panel), var(--ts-bg-elevated));
    box-shadow: 0 16px 42px rgba(0, 0, 0, .16);
}

.ts-community-discover-copy {
    padding: 22px 24px 15px;
}

.ts-community-kicker {
    color: var(--ts-primary-light);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .11em;
}

.ts-community-discover h2 {
    margin: 5px 0 4px;
    color: var(--ts-text);
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 800;
}

.ts-community-discover-copy p {
    margin: 0;
    color: var(--ts-text-soft);
    font-size: 14px;
}

.ts-community-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 18px 18px;
}

.ts-community-action {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--ts-border-soft);
    border-radius: 14px;
    background: rgba(7, 22, 41, .55);
    color: var(--ts-text) !important;
    text-decoration: none !important;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.ts-community-action:hover {
    transform: translateY(-2px);
    border-color: var(--ts-primary);
    background: var(--ts-panel-hover);
}

.ts-community-action-icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--ts-primary-dark), var(--ts-primary));
    color: #fff;
    box-shadow: 0 8px 18px rgba(22, 136, 255, .22);
}

.ts-action-qa .ts-community-action-icon { background: linear-gradient(135deg, #6348e8, #9a68ff); }
.ts-action-reels .ts-community-action-icon { background: linear-gradient(135deg, #df3159, #ff6a75); }
.ts-action-setup .ts-community-action-icon { background: linear-gradient(135deg, #078a8d, #16c5bb); }

.ts-community-action strong,
.ts-community-action small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ts-community-action strong { color: var(--ts-text); font-size: 13px; }
.ts-community-action small { margin-top: 2px; color: var(--ts-text-soft); font-size: 11px; }
.ts-community-action-arrow { color: var(--ts-text-muted); }

.ts-community-latest {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px 18px;
    border-top: 1px solid var(--ts-border-soft);
    color: var(--ts-text) !important;
    text-decoration: none !important;
}

.ts-community-latest:hover { background: var(--ts-panel-hover); }

.ts-community-latest-image {
    display: grid;
    width: 112px;
    aspect-ratio: 16 / 9;
    place-items: center;
    overflow: hidden;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--ts-primary-dark), var(--ts-primary));
    background-position: center;
    background-size: cover;
    color: #fff;
}

.ts-community-latest-copy,
.ts-community-latest-copy small,
.ts-community-latest-copy strong,
.ts-community-latest-copy span { display: block; min-width: 0; }
.ts-community-latest-copy small { color: var(--ts-primary-light); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.ts-community-latest-copy strong { margin-top: 2px; overflow: hidden; color: var(--ts-text); text-overflow: ellipsis; white-space: nowrap; }
.ts-community-latest-copy span { margin-top: 2px; color: var(--ts-text-soft); font-size: 11px; }
.ts-community-latest-button { color: var(--ts-primary-light); font-size: 12px; font-weight: 800; white-space: nowrap; }

html.light-mode body .ts-community-discover {
    background: radial-gradient(circle at 93% 5%, rgba(22, 136, 255, .13), transparent 32%), #fff;
}

html.light-mode body .ts-community-action {
    background: #f5f8fc;
}

@media (max-width: 720px) {
    .timeline-carousel .ts-create-story-card {
        width: 154px !important;
        height: 136px !important;
        min-height: 136px !important;
    }

    .ts-community-actions { grid-template-columns: 1fr; }
    .ts-community-latest { grid-template-columns: 88px minmax(0, 1fr); }
    .ts-community-latest-image { width: 88px; }
    .ts-community-latest-button { display: none; }
}
