* {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

:root {
    --tg-theme-bg-color: #000000;
    --tg-theme-text-color: #FFFFFF;
    --tg-theme-secondary-bg-color: #1C1C1D;
    --tg-theme-button-color: #3E88F7;
    --tg-theme-button-text-color: #FFFFFF;
    --tg-theme-subtitle-text-color: #98989E;
    --tg-theme-destructive-text-color: #EB5545;
    --tg-theme-section-bg-color: #2C2C2E;
    --tg-theme-accent-text-color: #3E88F7;
    --tg-theme-section-header-text-color: #8D8E93;
    --tg-theme-section-separator-color: #545458;
    --tg-theme-bottom-bar-bg-color: #1D1D1D;
    --tg-theme-hint-color: #98989E;
    --secondary-button-color: rgba(62, 136, 247, 0.1);
    --text-confirm-color: #30D158;
    --tertiary-fill-background: rgba(120, 120, 128, 0.24);
    --quaternary-fill-background: rgba(120, 120, 128, 0.18);
    --separator-non-opaque: rgba(84, 84, 88, 0.65);
    --segmented_control_active_background: #636366;
    --button-disabled-color: #3C3C3E;
    --text-disabled-color: #606060;
    --border-color: rgba(152, 152, 158, 0.4);
    --side-padding: 16px;
}

html, body {
    scroll-behavior: smooth;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

body {
    margin: 0;
    color: var(--tg-theme-text-color);
    -webkit-font-smoothing: antialiased;
    will-change: background-color;
    transition: background-color 200ms ease;
    font-family: -apple-system, system-ui, sans-serif;
    background: var(--tg-theme-bg-color);
}

body::-webkit-scrollbar, html::-webkit-scrollbar {
    display: none;
}

#root {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

.panel-header {
    position: relative;
    display: flex;
    height: 44px;
    flex-shrink: 0;
}

.panel-header .header-body {
    display: flex;
    flex: 1 0 0;
    align-self: stretch;
}

.panel-header .header-left {
    display: flex;
    align-items: center;
    flex: 1 0 0;
    align-self: stretch;
    padding: 0 16px;
    color: var(--tg-theme-accent-text-color);
    font-size: 17px;
    font-weight: 400;
}

.panel-header .header-right {
    display: flex;
    align-items: center;
    flex: 1 0 0;
    align-self: stretch;
    padding: 0 16px;
    justify-content: flex-end;
    color: var(--tg-theme-accent-text-color);
}

.panel-header .header-middle {
    position: absolute;
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
}

.close-button {
    background: none;
    border: none;
    color: var(--tg-theme-accent-text-color);
    font-size: 17px;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
}

.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px var(--side-padding);
}

.section-header {
    display: flex;
    gap: 4px;
    justify-content: space-between;
    padding: 10px 16px;
    color: var(--tg-theme-section-header-text-color);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: -0.08px;
}

.section-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.section-item {
    background: var(--tg-theme-section-bg-color);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 8px;
}

.section-item-header {
    font-size: 13px;
    color: var(--tg-theme-section-header-text-color);
    text-transform: uppercase;
    letter-spacing: -0.08px;
    margin-bottom: 12px;
    padding: 0;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
}

.toggle-label {
    font-size: 17px;
    color: var(--tg-theme-text-color);
    flex: 1;
}

.toggle-switch {
    width: 51px;
    height: 31px;
    border-radius: 16px;
    background: rgba(120, 120, 128, 0.32);
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.toggle-switch.active {
    background: var(--text-confirm-color);
}

.toggle-knob {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #ffffff;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-knob {
    transform: translateX(20px);
}

.prompt-container {
    margin-top: 12px;
}

.prompt-textarea {
    width: 100%;
    background: var(--tg-theme-secondary-bg-color);
    border: none;
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--tg-theme-text-color);
    font-size: 15px;
    font-family: -apple-system, system-ui, sans-serif;
    resize: vertical;
    min-height: 100px;
    outline: none;
}

.prompt-textarea::placeholder {
    color: var(--tg-theme-hint-color);
}

.button {
    position: relative;
    width: 100%;
    text-align: center;
    overflow: hidden;
    isolation: isolate;
    border: none;
    font-family: inherit;
    font-size: 17px;
    font-weight: 500;
    cursor: pointer;
    padding: 14px 16px;
    border-radius: 25px;
    margin-top: 12px;
    transition: opacity 0.2s;
}

.button.tinted {
    background-color: var(--secondary-button-color);
    color: var(--tg-theme-accent-text-color);
}

.button.filled {
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
}

.button:active {
    opacity: 0.8;
}

.button:disabled {
    background-color: var(--button-disabled-color);
    color: var(--text-disabled-color);
    cursor: not-allowed;
}

.status-badge {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(45, 45, 45, 0.8);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 100;
}

.status-badge.show {
    opacity: 1;
}

.status-badge.success {
    background: rgba(48, 209, 88, 0.9);
}

.status-badge.error {
    background: rgba(235, 85, 69, 0.9);
}
