:root {
    --bg-color: #F2F2F4;
    --card-bg: #FFFFFF;
    --text-main: #000000;
    --text-gray: #6E6E73;
    --border-color: #C6C6C8;
    --accent-blue: #007AFF;
    --accent-red: #FF3B30;
    --accent-green: #34C759;
}

body.dark {
    --bg-color: #1C1C1E;
    --card-bg: #2C2C2E;
    --text-main: #FFFFFF;
    --text-gray: #8E8E93;
    --border-color: #48484A;
    --accent-blue: #0A84FF;
    --accent-red: #FF453A;
    --accent-green: #30D158;
}

* { 
    box-sizing: border-box; 
    -webkit-font-smoothing: antialiased; 
}

body, html {
    margin: 0; 
    padding: 0; 
    width: 100vw; 
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-color);
}

.face-view { 
    display: none; 
    width: 95%;      /* Оставляем маленький отступ */
    height: 90%;     /* Чтобы не упиралось в края прима */
    position: relative;
}
.face-view.active { 
    display: flex; 
}

.container { 
    width: 100%; 
    height: 100%; 
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* --- 1. ШАПКА И СЛАЙДЕРЫ --- */
.header-row { 
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 15%; /* Пропорциональная высота */
    margin-bottom: 5px;
}

.header { 
    font-weight: 800; 
    font-size: 26px; 
    color: var(--text-main);
    text-align: center;
    letter-spacing: -0.5px;
}

.control-group { 
    display: flex;
    flex-direction: column;
    width: 25%;
}
.control-group .label {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-gray);
    margin-bottom: 2px;
}
.control-group.right {
    align-items: flex-end;
}
.control-group.right .slider-row {
    flex-direction: row-reverse;
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.control-group input[type=range] { 
    flex-grow: 1;
    height: 10px; 
    accent-color: var(--accent-blue); 
    cursor: pointer;
}

.control-group .val-text { 
    color: var(--accent-blue); 
    font-weight: bold; 
    font-size: 16px;
    min-width: 45px;
}
.control-group.right .val-text { text-align: right; }

/* --- 2. ПОЛЕ ВВОДА --- */
.msg-row { 
    flex-grow: 1;
    width: 100%;
    height: 50%;
    margin-bottom: 8px;
}

textarea { 
    width: 100%; 
    height: 100%; 
    background: var(--card-bg); 
    border: 2px solid var(--border-color); 
    border-radius: 10px; 
    padding: 10px 14px; 
    font-size: 24px; 
    color: var(--text-main); 
    font-family: inherit;
    resize: none; outline: none; 
}

/* --- 3. КНОПКИ --- */
.btn-row { 
    display: flex;
    justify-content: space-between;
    gap: 10px;
    height: 22%; /* Фиксированная доля под кнопки */
}

.btn-row button { 
    flex: 1;
    height: 100%;
    font-weight: bold; 
    font-size: 20px; 
    color: var(--accent-blue); 
    background: var(--card-bg); 
    border: 2px solid var(--border-color); 
    border-radius: 10px;
    cursor: pointer; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-row button:active {
    background: var(--border-color);
}

.btn-row .b1.off { border-color: var(--accent-red); color: var(--accent-red); background: rgba(255, 59, 48, 0.06); }
.btn-row .b1.on { border-color: var(--accent-green); color: var(--accent-green); background: rgba(52, 199, 89, 0.06); }

/* --- 4. ЭКРАН МЕНЮ --- */
.menu-container { padding: 15px; display: flex; flex-direction: column; gap: 8px; height: 100%; justify-content: center; }
.section { background: var(--card-bg); border-radius: 10px; overflow: hidden; border: 2px solid var(--border-color); }
.block { display: flex; width: 100%; }
.block .btn { 
    flex: 1; display: flex; align-items: center; justify-content: center; background: transparent; border: none; 
    border-right: 2px solid var(--border-color); padding: 15px 5px; color: var(--text-main); 
    font-size: 18px; font-weight: bold; cursor: pointer;
}
.block .btn:last-child { border-right: none; }
.block .btn:active { background: var(--accent-blue); color: #fff; }
.block .btn-danger { color: var(--accent-red); }
.icon { margin-right: 6px; font-size: 20px; }

.title { font-weight: bold; margin-bottom: 5px; font-size: 22px; text-align: center; }
input[type=text] { 
    width: 100%; height: 45px; background: var(--card-bg); border: 2px solid var(--border-color); 
    border-radius: 8px; color: var(--text-main); padding: 0 15px; font-size: 20px; margin-bottom: 8px; outline: none; 
}
.btn-submit { 
    width: 100%; height: 45px; background: var(--accent-blue); color: white; border: none; 
    border-radius: 8px; font-weight: bold; font-size: 20px; cursor: pointer; margin-bottom: 5px;
}
.btn-back { background: var(--border-color); color: var(--text-main); }
