:root {
    --bg-primary: #e8ecf1;
    --bg-secondary: #e8ecf1;
    --bg-card: #ebeff4;
    --accent: #4f6ef6;
    --accent-hover: #3d5bd9;
    --accent-light: #eef1fd;
    --danger: #e04a5a;
    --danger-light: #fdecee;
    --success: #3cab6d;
    --success-light: #edf7f1;
    --warning: #e8963a;
    --warning-light: #fef5eb;
    --text-primary: #1a1f36;
    --text-secondary: #7c8294;
    --text-tertiary: #a8aebb;
    --shadow-outer: 3px 3px 7px rgba(166, 175, 189, 0.35), -2px -2px 5px rgba(255, 255, 255, 0.8);
    --shadow-inner: inset 2px 2px 5px rgba(166, 175, 189, 0.3), inset -1px -1px 3px rgba(255, 255, 255, 0.7);
    --shadow-button: 2px 2px 5px rgba(166, 175, 189, 0.3), -1px -1px 3px rgba(255, 255, 255, 0.9);
    --shadow-button-pressed: inset 2px 2px 4px rgba(166, 175, 189, 0.25), inset -1px -1px 2px rgba(255, 255, 255, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 16px;
}

.container {
    max-width: 480px;
    margin: 0 auto;
}

/* Заголовок */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    margin-bottom: 16px;
    gap: 12px;
}

.header-center {
    text-align: center;
    flex: 1;
    min-width: 0;
}

.header-center h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.3px;
}

.header .subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 2px;
}

/* Кнопка назад */
.nav-back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: var(--shadow-outer);
}

.nav-back-btn:active {
    box-shadow: var(--shadow-inner);
    transform: scale(0.96);
    color: var(--accent);
}

/* Аватар */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-outer);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Вкладки */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    background: var(--bg-card);
    border-radius: 50px;
    padding: 4px;
    position: relative;
    isolation: isolate;
    box-shadow: var(--shadow-inner);
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.25s ease;
    position: relative;
    z-index: 2;
    white-space: nowrap;
    text-align: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.tab-btn.active {
    color: #fff;
}

/* Ползунок */
.tabs::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--accent);
    border-radius: 50px;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

.tabs.active-right::after {
    transform: translateX(100%);
}

/* Сетка проектов */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    user-select: none;
    -webkit-user-select: none;
}

/* Карточки проектов */
.project-card {
    background: var(--bg-card);
    border-radius: 18px;
    padding: 18px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 115px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: var(--shadow-outer);
}

.project-card:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-inner);
}

.project-card-title {
    font-size: 14px;
    font-weight: 600;
    word-break: break-word;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.project-card-info {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

.project-card-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
}

.badge-active {
    background: var(--accent-light);
    color: var(--accent);
    animation: pulse 2s infinite;
}

.badge-timer {
    background: var(--warning-light);
    color: var(--warning);
}

.project-drag-handle {
    display: inline;
    color: var(--text-tertiary);
    font-size: 20px;
    cursor: grab;
    opacity: 0.5;
    user-select: none;
    letter-spacing: 2px;
    margin-right: 4px;
    vertical-align: middle;
    line-height: 1;
}

.project-drag-handle:active {
    cursor: grabbing;
}

.project-card-menu {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.project-card-menu:active {
    background: var(--bg-primary);
    box-shadow: var(--shadow-inner);
}

/* Карточка папки */
.folder-card {
    background: var(--accent-light);
}

.folder-card:active {
    background: #e0e5fa;
    transform: scale(0.97);
}

.folder-card .project-card-title {
    font-size: 15px;
    color: var(--accent);
}

.folder-card .project-card-info {
    color: var(--accent);
    opacity: 0.7;
}

.folder-card .project-card-menu {
    color: var(--accent);
    opacity: 0.6;
}

.folder-card .project-card-menu:active {
    background: rgba(79, 110, 246, 0.1);
}

/* Кнопка создать проект */
.create-project-card {
    background: transparent;
    border: 2px dashed var(--text-tertiary);
    border-radius: 18px;
    padding: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 115px;
    transition: all 0.2s;
    opacity: 0.6;
}

.create-project-card:active {
    transform: scale(0.97);
    border-color: var(--accent);
    opacity: 1;
}

.create-project-card .plus-icon {
    font-size: 32px;
    color: var(--text-tertiary);
    text-align: center;
}

.create-project-card .plus-text {
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: center;
    margin-top: 4px;
}

/* Отступ между заголовком проекта и списком процедур */
#projectDetailScreen h2 {
    margin-bottom: 10px;
}

/* Карточки (общие) */
.card {
    background: var(--bg-card);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 10px;
    border: none;
    box-shadow: var(--shadow-outer);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Кнопки */
.btn {
    display: block;
    width: 100%;
    padding: 15px 20px;
    margin: 0;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    letter-spacing: -0.2px;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 2px 3px 6px rgba(79, 110, 246, 0.25);
}

.btn-primary:active {
    background: var(--accent-hover);
    box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.15);
    transform: scale(0.98);
}

.btn-danger {
    background: var(--danger-light);
    color: var(--danger);
    font-weight: 600;
    box-shadow: var(--shadow-inner);
}

.btn-danger:active {
    background: #f5d5d9;
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.1);
    transform: scale(0.98);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 2px 3px 6px rgba(60, 171, 109, 0.25);
}

.btn-outline {
    background: var(--bg-card);
    color: var(--text-secondary);
    box-shadow: var(--shadow-button);
}

.btn-outline:active {
    box-shadow: var(--shadow-button-pressed);
    transform: scale(0.98);
    color: var(--accent);
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    display: inline-block;
    width: auto;
}

/* Кнопка добавить (внизу списка) */
.add-btn-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    margin-top: 12px;
    background: transparent;
    border: 2px dashed var(--text-tertiary);
    border-radius: 14px;
    color: var(--text-tertiary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
    opacity: 0.7;
}

.add-btn-bottom:active {
    transform: scale(0.98);
    border-color: var(--accent);
    color: var(--accent);
    opacity: 1;
}

/* Список процедур */
.procedures-list {
    list-style: none;
}

/* Разворачиваемая процедура */
.procedure-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 14px;
    margin-bottom: 8px;
    background: var(--bg-card);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    box-shadow: var(--shadow-outer);
}

.procedure-item:active {
    box-shadow: var(--shadow-inner);
}

.procedure-main {
    display: flex;
    align-items: center;
    width: 100%;
}

.procedure-drag-handle {
    margin-right: 10px;
    color: var(--text-tertiary);
    font-size: 18px;
    cursor: grab;
    flex-shrink: 0;
}

.procedure-content {
    flex: 1;
    min-width: 0;
}

.procedure-name {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-primary);
}

.procedure-details {
    display: none;
    width: 100%;
    padding: 12px 0 0 0;
    border-top: 1px solid rgba(0,0,0,0.05);
    margin-top: 10px;
}

.procedure-item.expanded .procedure-details {
    display: block;
}

.procedure-expand-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-tertiary);
    margin-left: 8px;
    transition: transform 0.2s;
}

.procedure-item.expanded .procedure-expand-btn {
    transform: rotate(90deg);
}

.procedure-details-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.procedure-detail-desc {
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.procedure-detail-desc.collapsed {
    max-height: 36px;
    overflow: hidden;
    position: relative;
    display: block;
}

.procedure-detail-desc.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 18px;
    background: linear-gradient(to bottom, transparent, var(--bg-card));
    pointer-events: none;
}

.procedure-detail-desc.expanded {
    max-height: 2000px;
}

.description-toggle-btn-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 2px 0 0 0;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.description-toggle-btn-inline svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.description-toggle-btn-inline.expanded svg {
    transform: rotate(180deg);
}

.procedure-details-timer {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.procedure-timer-badge-large {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

.procedure-comment {
    width: 100%;
    margin-top: 10px;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    transition: all 0.2s;
    line-height: 1.5;
    box-shadow: var(--shadow-inner);
}

.procedure-comment:focus {
    outline: none;
    box-shadow: inset 3px 3px 6px rgba(166, 175, 189, 0.2), inset -1px -1px 3px rgba(255, 255, 255, 0.6);
}

.procedure-comment::placeholder {
    color: var(--text-tertiary);
}

/* Кнопка меню на строке процедуры */
.procedure-menu-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-tertiary);
    margin-left: 4px;
}

.procedure-menu-btn:active {
    background: var(--bg-primary);
    box-shadow: var(--shadow-inner);
}

/* Всплывающее меню */
.popup-menu {
    position: fixed;
    z-index: 10000;
    background: var(--bg-card);
    border: none;
    border-radius: 14px;
    padding: 6px;
    min-width: 170px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.popup-menu-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.15s;
}

.popup-menu-item:active {
    background: var(--accent-light);
    color: var(--accent);
}

.popup-menu-item.danger {
    color: var(--danger);
}

.popup-menu-item.danger:active {
    background: var(--danger-light);
}

/* Формы */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: -0.2px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.2s;
    box-shadow: var(--shadow-inner);
}

.form-input:focus {
    outline: none;
    box-shadow: inset 3px 3px 6px rgba(166, 175, 189, 0.2), inset -1px -1px 3px rgba(255, 255, 255, 0.6);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    transition: all 0.2s;
    line-height: 1.5;
    box-shadow: var(--shadow-inner);
}

.form-textarea:focus {
    outline: none;
    box-shadow: inset 3px 3px 6px rgba(166, 175, 189, 0.2), inset -1px -1px 3px rgba(255, 255, 255, 0.6);
}

.form-textarea::placeholder {
    color: var(--text-tertiary);
}

/* Сетка таймера */
.timer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.timer-grid .form-group {
    margin-bottom: 0;
}

.timer-grid .form-input {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
}

/* Таймер */
.timer-display {
    text-align: center;
    font-size: 48px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    color: var(--accent);
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 16px;
    margin: 0;
    border: none;
    box-shadow: var(--shadow-inner);
}

/* Кнопки таймера */
.timer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.btn-timer-action {
    margin: 0;
    padding: 14px 12px;
    font-size: 15px;
}

/* Сообщения */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

/* Скрытие */
.hidden {
    display: none !important;
}

/* Кнопка запуска таймера в списке процедур */
.procedure-timer-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    margin-left: 8px;
    transition: all 0.2s;
    box-shadow: 1px 2px 4px rgba(79, 110, 246, 0.3);
}

.procedure-timer-btn:active {
    transform: scale(0.9);
    box-shadow: var(--shadow-inner);
}

.procedure-timer-btn.running {
    background: var(--success);
    box-shadow: 1px 2px 4px rgba(60, 171, 109, 0.3);
    animation: pulse 2s infinite;
}

.procedure-timer-btn.inactive {
    background: var(--bg-primary);
    color: var(--text-tertiary);
    box-shadow: var(--shadow-button);
}

.pin-icon {
    font-size: 12px;
    margin-right: 2px;
    vertical-align: middle;
}

/* Экран процедуры */
#procedureDetailScreen {
    padding-bottom: 80px;
}

#procedureDetailScreen h2 {
    margin-bottom: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.procedure-scrollable {
    padding-bottom: 16px;
}

/* Заголовок процедуры */
.procedure-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.procedure-header h2 {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 22px;
    font-weight: 700;
}

.procedure-header-menu {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    line-height: 1;
}

.procedure-header-menu:active {
    background: var(--bg-primary);
    box-shadow: var(--shadow-inner);
}

/* Нижняя панель навигации */
.procedure-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 16px;
    user-select: none;
    background: rgba(232, 236, 241, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(0,0,0,0.05);
    z-index: 10;
}

/* Дорожная карта процедур */
.procedure-roadmap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex: 1;
    min-width: 0;
    overflow: visible;
    position: relative;
    padding: 8px 8px;
}

.roadmap-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card);
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-outer);
}

.roadmap-dot.active {
    background: var(--accent);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 2px 2px 6px rgba(79, 110, 246, 0.3);
}

.roadmap-dot.passed {
    background: var(--success-light);
    color: var(--success);
    box-shadow: var(--shadow-inner);
}

.roadmap-connector {
    width: 20px;
    height: 2px;
    background: var(--text-tertiary);
    opacity: 0.3;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.roadmap-connector.passed {
    background: var(--success);
    opacity: 0.6;
}

.roadmap-ellipsis {
    color: var(--text-tertiary);
    font-size: 14px;
    padding: 0 4px;
    flex-shrink: 0;
}

/* Кнопки навигации */
.nav-arrow-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: var(--shadow-outer);
}

.nav-arrow-btn:active {
    box-shadow: var(--shadow-inner);
    transform: scale(0.94);
    color: var(--accent);
}

.nav-arrow-btn:disabled {
    opacity: 0.3;
    cursor: default;
    transform: none;
}

/* Приветственный экран */
.welcome-container {
    text-align: center;
    padding: 40px 20px;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

.welcome-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.welcome-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 0 32px 0;
}

.welcome-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
    text-align: left;
}

.welcome-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 16px;
    border: none;
    box-shadow: var(--shadow-outer);
}

.welcome-feature-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.welcome-feature-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.welcome-feature-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.welcome-footer {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 16px;
    opacity: 0.7;
}

/* Сворачиваемое описание */
.description-wrapper {
    position: relative;
}

.procedure-description {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0;
    transition: max-height 0.3s ease;
    overflow: hidden;
}

.procedure-description.collapsed {
    max-height: 72px;
    position: relative;
}

.procedure-description.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: linear-gradient(to bottom, transparent, var(--bg-card));
    pointer-events: none;
}

.procedure-description.expanded {
    max-height: 2000px;
}

.description-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 6px 0 0 0;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s;
}

.description-toggle-btn:active {
    color: var(--accent);
}

.description-toggle-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.description-toggle-btn.expanded svg {
    transform: rotate(180deg);
}

/* Карточка комментария */
#commentCard {
    margin-top: 10px;
    margin-bottom: 10px;
}

/* ==================== МОДАЛЬНОЕ ОКНО (общий стиль) ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-sheet {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
}

.modal-title {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.modal-input {
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 15px;
    margin-bottom: 16px;
    box-sizing: border-box;
    outline: none;
    box-shadow: var(--shadow-inner);
    font-family: inherit;
    transition: box-shadow 0.2s;
}

.modal-input:focus {
    box-shadow: inset 3px 3px 6px rgba(166, 175, 189, 0.25), inset -1px -1px 3px rgba(255, 255, 255, 0.7);
}

.modal-textarea {
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 15px;
    resize: vertical;
    box-sizing: border-box;
    outline: none;
    box-shadow: var(--shadow-inner);
    font-family: inherit;
    line-height: 1.5;
    margin-bottom: 20px;
    transition: box-shadow 0.2s;
}

.modal-textarea:focus {
    box-shadow: inset 3px 3px 6px rgba(166, 175, 189, 0.25), inset -1px -1px 3px rgba(255, 255, 255, 0.7);
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.modal-btn-cancel {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-outer);
}

.modal-btn-cancel:active {
    box-shadow: var(--shadow-inner);
    transform: scale(0.97);
}

.modal-btn-save {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 2px 3px 6px rgba(79, 110, 246, 0.25);
}

.modal-btn-save:active {
    box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.15);
    transform: scale(0.97);
}

/* ==================== НИЖНИЙ ЛИСТ (менеджер папок) ==================== */
.sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.sheet-panel {
    background: var(--bg-card);
    border-radius: 20px 20px 16px 16px;
    padding: 20px;
    width: 100%;
    max-width: 400px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
}

.sheet-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.15s;
}

.sheet-option:active {
    background: var(--accent-light);
}

/* ==================== УВЕДОМЛЕНИЯ ==================== */
.notification-toast {
    background: var(--bg-card);
    border: none;
    border-radius: 16px;
    padding: 14px 18px;
    color: var(--text-primary);
    font-size: 14px;
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.notification-toast .notif-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.notification-toast .notif-body {
    color: var(--text-secondary);
    font-size: 13px;
}

.notification-toast .notif-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Анимация */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ==================== ПРОФИЛЬ ==================== */
.profile-container {
    padding: 0 0 20px 0;
}

.profile-header {
    text-align: center;
    padding: 24px 20px 20px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: var(--shadow-outer);
}

.profile-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-username {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.profile-section {
    margin: 0 12px 16px;
    background: var(--bg-card);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-outer);
}

.profile-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px 4px;
}

.profile-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.profile-item:active {
    background: var(--accent-light);
}

/* Разделитель между строками */
.profile-item + .profile-item {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.profile-item-value {
    color: var(--text-secondary);
    font-size: 14px;
}

.profile-item-arrow {
    color: var(--text-tertiary);
    font-size: 18px;
}

.profile-version {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 12px;
    padding: 20px;
}

/* ==================== ЭКРАН ТЕМ ==================== */
.themes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.theme-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px;
    border: none;
    background: var(--bg-card);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: inherit;
    box-shadow: var(--shadow-outer);
    color: var(--text-primary);
}

.theme-card:active {
    box-shadow: var(--shadow-inner);
    transform: scale(0.98);
}

.theme-preview {
    width: 48px;
    height: 36px;
    border-radius: 8px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-shrink: 0;
}

.theme-preview-light {
    background: #e8ecf1;
}

.theme-preview-dark {
    background: #1a1f2e;
}

.theme-preview-matcha {
    background: #e8f0da;
}

.theme-preview-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--text-tertiary);
    opacity: 0.3;
}

.theme-preview-card {
    height: 4px;
    border-radius: 2px;
    background: var(--text-tertiary);
    opacity: 0.15;
}

.theme-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
}

.theme-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.theme-check {
    font-size: 14px;
    color: var(--accent);
    opacity: 0;
}

.theme-check.active {
    opacity: 1;
}

#themesScreen h2 {
    margin-bottom: 8px;
}

/* Адаптивность */
@media (max-width: 480px) {
    .roadmap-dot {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
    
    .nav-arrow-btn {
        width: 40px;
        height: 40px;
    }
    
    .procedure-nav {
        padding: 10px 12px;
        gap: 12px;
    }
}

@media (max-width: 380px) {
    .projects-grid {
        gap: 10px;
    }
    .project-card {
        padding: 14px;
        min-height: 100px;
    }
    .project-card-title {
        font-size: 13px;
    }
}