        body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background-color: var(--bg-body); color: var(--text-main); margin: 0; padding: 16px 16px calc(90px + max(env(safe-area-inset-bottom, 0px), var(--sa-bottom, 0px))) 16px; line-height: 1.5; padding-top: calc(72px + max(env(safe-area-inset-top, 0px), var(--sa-top, 0px))); }
        .container { max-width: 800px; margin: 0 auto; }


        .section-header { display: flex; align-items: center; gap: 10px; margin-top: 8px; margin-bottom: 12px; }
        .step-badge { background: var(--brand-accent); color: white; font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 20px; }
        .section-title { font-size: 16px; font-weight: 700; color: #ffffff; }
        .question-label { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: #ffffff; display: block; }
        .subtitle { font-size: 13px; color: var(--text-sub); margin-bottom: 16px; }

        .card { background: var(--surface-card); border: 1px solid var(--border-soft); border-radius: 12px; padding: 20px; margin-bottom: 16px; }

        .metrics-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            column-gap: 12px;
            row-gap: 14px;
            align-items: start;
        }
        .metric-field { display: flex; flex-direction: column; min-width: 0; }
        .metric-wide { grid-column: 1 / -1; }
        .metric-label { display: flex; flex-direction: column; justify-content: flex-start; margin-bottom: 6px; }
        .metric-label:has(.metric-hint) { min-height: 44px; }
        .metric-name { font-size: 13px; font-weight: 600; color: #ffffff; line-height: 1.25; }
        .metric-hint { font-size: 11px; color: var(--text-sub); line-height: 1.25; margin-top: 1px; }
        .metric-field .input-text { margin-bottom: 0; }
        .input-text { width: 100%; background: var(--surface-field); border: 1px solid var(--border-soft); border-radius: 8px; height: 40px; padding: 0 12px; line-height: 38px; color: #ffffff; font-size: 16px; box-sizing: border-box; font-family: inherit; }
        .input-text::placeholder { color: #5a7a68; }

        .tabs-container { display: flex; gap: 10px; margin-top: 0; margin-bottom: 16px; align-items: stretch; }
        .measure-note { display: none; margin-top: 16px; padding: 8px 10px; border: 1px solid var(--border-soft); border-radius: 8px; font-size: 12px; font-weight: 500; color: var(--text-sub); line-height: 1.35; }
        /* Расширенная зона тапа (44px по высоте) и крупный кружок (28px)
           у ползунков самооценки упругости и отечности */
        #m-turgor, #m-edema {
            -webkit-appearance: none;
            appearance: none;
            width: 100%;
            height: 44px;
            margin: 0;
            padding: 0;
            background: transparent;
            cursor: pointer;
            touch-action: none;
            -webkit-tap-highlight-color: transparent;
        }
        #m-turgor::-webkit-slider-runnable-track,
        #m-edema::-webkit-slider-runnable-track {
            height: 8px;
            border-radius: 4px;
            background: var(--surface-field);
            border: 1px solid var(--border-soft);
        }
        /* бегунок — горизонтальная пилюля с вертикальными насечками;
           насечки — полупрозрачный SVG поверх заливки, читается на обеих темах */
        #m-turgor::-webkit-slider-thumb,
        #m-edema::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 34px;
            height: 20px;
            border-radius: 10px;
            background-color: var(--brand-green);
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 20'%3E%3Cg stroke='%23000' stroke-opacity='.32' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M13 5.5v9'/%3E%3Cpath d='M17 5.5v9'/%3E%3Cpath d='M21 5.5v9'/%3E%3C/g%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: center;
            border: 2px solid #f0fdf4;
            margin-top: -8px;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
        }
        /* тёмная тема (без data-theme): насечки светлые — чёрные тонут в зелёном */
        html:not([data-theme]) #m-turgor::-webkit-slider-thumb,
        html:not([data-theme]) #m-edema::-webkit-slider-thumb {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 20'%3E%3Cg stroke='%23fff' stroke-opacity='.5' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M13 5.5v9'/%3E%3Cpath d='M17 5.5v9'/%3E%3Cpath d='M21 5.5v9'/%3E%3C/g%3E%3C/svg%3E");
        }
        #m-turgor::-moz-range-track,
        #m-edema::-moz-range-track {
            height: 8px;
            border-radius: 4px;
            background: var(--surface-field);
            border: 1px solid var(--border-soft);
        }
        #m-turgor::-moz-range-thumb,
        #m-edema::-moz-range-thumb {
            width: 34px;
            height: 20px;
            border-radius: 10px;
            background-color: var(--brand-green);
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 20'%3E%3Cg stroke='%23000' stroke-opacity='.32' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M13 5.5v9'/%3E%3Cpath d='M17 5.5v9'/%3E%3Cpath d='M21 5.5v9'/%3E%3C/g%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: center;
            border: 2px solid #f0fdf4;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
        }
        html:not([data-theme]) #m-turgor::-moz-range-thumb,
        html:not([data-theme]) #m-edema::-moz-range-thumb {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 20'%3E%3Cg stroke='%23fff' stroke-opacity='.5' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M13 5.5v9'/%3E%3Cpath d='M17 5.5v9'/%3E%3Cpath d='M21 5.5v9'/%3E%3C/g%3E%3C/svg%3E");
        }
        .measure-note.is-on { display: block; }
        .measure-note.is-ok { color: var(--brand-green); border-color: rgba(46, 204, 113, 0.35); }
        .monday-confirm { display: none; margin: 8px 0 0; padding: 10px 12px; background: #111d18; border: 1px solid var(--border-soft); border-radius: 8px; }
        .monday-confirm.is-on { display: block; }
        .monday-confirm label { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: #fff; cursor: pointer; line-height: 1.35; }
        .monday-confirm input { margin-top: 3px; accent-color: var(--brand-green); width: 16px; height: 16px; flex-shrink: 0; }
        .btn-submit { background: #2F5644; color: #E8F0EB; border: 1px solid #8fa89b; padding: 16px; font-weight: bold; border-radius: 12px; cursor: pointer; font-size: 15px; width: 100%; margin-top: 16px; position: relative; z-index: 2; box-sizing: border-box; }
        .btn-submit.is-off { background: var(--surface-field); color: var(--text-sub); border-color: var(--border-soft); cursor: default; opacity: 0.7; }
        .tab-btn { flex: 1 1 0; min-width: 0; padding: 10px 6px; border: 1px solid var(--border-soft); background: var(--surface-card); color: var(--text-sub); border-radius: 12px; cursor: pointer; text-align: center; line-height: 1.2; transition: all 0.2s; display: flex; flex-direction: column; align-items: center; justify-content: center; box-sizing: border-box; }
        .tab-btn.active { background: var(--text-sub); color: #0c1c14; border-color: var(--text-sub); }
        .tab-name { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
        .tab-sub { font-size: 14px; font-weight: 500; opacity: 0.85; margin-top: 2px; }

        .slot { border: 1px solid var(--border-soft); border-radius: 12px; padding: 10px 14px; min-height: 40px; display: flex; align-items: center; justify-content: center; text-align: center; margin-bottom: 8px; position: relative; cursor: pointer; transition: all 0.2s; background: var(--surface-field); box-sizing: border-box; }
        .slot:hover { border-color: var(--brand-green); background: rgba(46, 204, 113, 0.05); }
        .slot:hover { border-color: var(--brand-green); }
        .slot-title { font-weight: 600; font-size: 15px; margin: 0; color: #fff; line-height: 1.2; }
        .slot-filled { border: 1px solid var(--brand-green); background: #0f1c16; padding: 0; overflow: hidden; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 12px; }
        .slot-filled img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }
        .slot-filled .slot-title { position: absolute; bottom: 10px; left: 10px; margin: 0; background: rgba(0,0,0,0.7); padding: 4px 10px; border-radius: 6px; z-index: 2; }
        .check-badge { position: absolute; top: 10px; right: 10px; background: var(--brand-green); color: #000; border-radius: 50%; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px; z-index: 2; box-shadow: 0 2px 5px rgba(0,0,0,0.5); }
        .file-input { display: none; }

        .chat-hint { font-size: 12px; color: var(--text-sub); margin-top: -8px; margin-bottom: 12px; }
        .chat-box { background: #09110d; border: 1px solid var(--border-soft); border-radius: 12px; height: 250px; max-height: 250px; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; padding: 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
        .chat-msg { background: var(--surface-field); padding: 10px 14px; border-radius: 12px; border-bottom-right-radius: 0; align-self: flex-end; max-width: 85%; font-size: 13px; color: #fff; line-height: 1.4; flex-shrink: 0; }
        .chat-msg-in { align-self: flex-start; border-bottom-right-radius: 12px; border-bottom-left-radius: 0; background: #13241c; }
        .empty-state { text-align: center; color: var(--text-sub); padding: 40px 20px; line-height: 1.6; font-size: 15px; }
        .chat-input-wrapper { display: flex; gap: 8px; }
        .chat-input { flex-grow: 1; background: var(--surface-field); border: 1px solid var(--border-soft); color: #fff; height: 40px; padding: 0 12px; line-height: 38px; border-radius: 8px; font-size: 16px; outline: none; min-width: 0; box-sizing: border-box; }
        .chat-input:focus { border-color: var(--brand-green); }
        .chat-send { background: #2F5644; color: #E8F0EB; border: 1px solid #8fa89b; padding: 0 20px; border-radius: 12px; font-weight: bold; cursor: pointer; box-sizing: border-box; transition: transform 0.08s ease, filter 0.08s ease; -webkit-tap-highlight-color: transparent; }
        /* :active убран — единый отклик нажатия живёт в tokens.css */


