*, *::before, *::after {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    :root {
        --blue:        #0066CC;
        --blue-hover:  #0052A3;
        --blue-dark:   #0D4CD3;
        --blue-soft:   #E5F0FA;
        --bg:          #F6F7F9;
        --surface:     #FFFFFF;
        --text:        #1C1C1C;
        --text-dim:    #5B677A;
        --text-faint:  #99A2AD;
        --border:      #DFE3E8;
        --success:     #1ABF54;
    }

    html, body {
        background: var(--bg);
        color: var(--text);
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
        font-size: 16px;
        line-height: 1.5;
        -webkit-font-smoothing: antialiased;
        min-height: 100vh;
    }

    /* ============ ВЕРХНЯЯ ПЛАШКА ============ */
    .topbar {
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: 12px 24px;
    }

    .topbar-inner {
        max-width: 1200px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
    }

    .topbar-left {
        display: flex;
        align-items: center;
        gap: 32px;
    }

    .logo {
        display: inline-flex;
        align-items: center;
        line-height: 1;
    }

    .logo-svg {
        height: 32px;
        width: auto;
        display: block;
    }

    .topbar-nav {
        display: flex;
        align-items: center;
        gap: 24px;
    }

    .topbar-nav a {
        font-size: 14px;
        color: var(--text);
        text-decoration: none;
        font-weight: 400;
    }

    .topbar-nav a:hover { color: var(--blue); }

    .topbar-right {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .lang-btn {
        font-size: 14px;
        color: var(--text-dim);
        background: transparent;
        border: none;
        padding: 6px 8px;
        cursor: pointer;
        font-family: inherit;
    }

    .login-btn {
        background: var(--blue);
        color: white;
        border: none;
        padding: 10px 22px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        font-family: inherit;
        transition: background 0.15s;
    }

    .login-btn:hover { background: var(--blue-hover); }

    /* ============ КОНТЕНТ ============ */
    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 24px 24px 48px;
    }

    .breadcrumbs {
        font-size: 14px;
        color: var(--text-dim);
        margin-bottom: 20px;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
    }

    .breadcrumbs > span {
        margin: 0 8px;
        color: var(--text-faint);
    }

    .breadcrumbs .bc-blue {
        color: var(--blue);
        margin: 0;
    }

    /* ============ ГЕРОЙ-БАННЕР ============ */
    .hero {
        background: linear-gradient(135deg, #0066CC 0%, #0D4CD3 100%);
        border-radius: 16px;
        padding: 40px 44px;
        margin-bottom: 32px;
        color: white;
        position: relative;
        overflow: hidden;
    }

    .hero::after {
        content: '';
        position: absolute;
        right: -80px;
        top: -80px;
        width: 320px;
        height: 320px;
        background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 65%);
        pointer-events: none;
    }

    .hero-tag {
        display: inline-block;
        font-size: 13px;
        font-weight: 500;
        background: rgba(255, 255, 255, 0.18);
        padding: 5px 12px;
        border-radius: 6px;
        margin-bottom: 16px;
        backdrop-filter: blur(4px);
    }

    h1 {
        font-size: 32px;
        font-weight: 600;
        letter-spacing: -0.022em;
        line-height: 1.2;
        margin-bottom: 12px;
        color: white;
        max-width: 720px;
    }

    .lead {
        font-size: 16px;
        color: rgba(255, 255, 255, 0.88);
        max-width: 680px;
        margin-bottom: 0;
        line-height: 1.5;
    }

    /* ============ ИНФО-ПОЛОСА ============ */
    .info-bar {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin-bottom: 28px;
    }

    .info-chip {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 999px;
        padding: 8px 14px;
        font-size: 14px;
        color: var(--text-dim);
    }

    .info-chip strong {
        color: var(--text);
        font-weight: 600;
    }

    .dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--success);
        animation: live 2s ease-in-out infinite;
    }

    @keyframes live {
        0%, 100% { opacity: 1; }
        50%      { opacity: 0.5; }
    }

    /* ============ КАРТОЧКИ ============ */
    .cards {
        display: grid;
        gap: 10px;
        margin-bottom: 28px;
    }

    .card {
        background: var(--surface);
        border: 1.5px solid var(--border);
        border-radius: 14px;
        padding: 18px 22px;
        cursor: pointer;
        transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, transform 0.2s;
        display: grid;
        grid-template-columns: 56px 1fr auto;
        align-items: center;
        gap: 18px;
        position: relative;
        overflow: hidden;
    }

    .card:hover {
        border-color: #B8BFC9;
        box-shadow: 0 4px 14px rgba(0, 102, 204, 0.07);
        transform: translateY(-1px);
    }

    .card.selected {
        border-color: var(--blue);
        background: var(--blue-soft);
        box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1), 0 4px 14px rgba(0, 102, 204, 0.08);
    }

    .card::after {
        content: '';
        position: absolute;
        left: 0; top: 0; bottom: 0;
        width: var(--progress, 0%);
        background: rgba(10, 92, 158, 0.05);
        transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
        pointer-events: none;
        z-index: 0;
    }

    .card > * { position: relative; z-index: 1; }

    .avatar {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        overflow: hidden;
        flex-shrink: 0;
        background: var(--blue-soft);
        border: 2px solid var(--surface);
        box-shadow: 0 0 0 1px var(--border);
        transition: box-shadow 0.2s;
    }

    .card.selected .avatar {
        box-shadow: 0 0 0 2px var(--blue);
    }

    .avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .info {
        display: flex;
        flex-direction: column;
        gap: 3px;
        min-width: 0;
    }

    .name {
        font-size: 17px;
        font-weight: 600;
        color: var(--text);
        letter-spacing: -0.01em;
    }

    .role {
        font-size: 14px;
        color: var(--text-dim);
    }

    .right {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
        min-width: 90px;
    }

    .percent {
        display: none;
    }

    .votes {
        font-size: 13px;
        color: var(--text-dim);
        font-variant-numeric: tabular-nums;
    }

    @keyframes pop {
        0%   { transform: scale(1); }
        50%  { transform: scale(1.08); }
        100% { transform: scale(1); }
    }
    .card.just-voted .avatar { animation: pop 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

    /* ============ КНОПКИ ============ */
    .actions {
        display: flex;
        gap: 12px;
        align-items: center;
        flex-wrap: wrap;
    }

    .btn {
        font-family: inherit;
        font-size: 15px;
        font-weight: 500;
        padding: 14px 26px;
        border-radius: 14px;
        border: none;
        cursor: pointer;
        transition: background 0.15s ease, transform 0.1s ease;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        letter-spacing: -0.005em;
        text-decoration: none;
    }

    .btn-primary {
        background: var(--blue);
        color: white;
    }

    .btn-primary:hover {
        background: var(--blue-hover);
    }

    .btn-primary:active {
        transform: scale(0.98);
    }

    .btn-primary:disabled {
        background: #C5C9D0;
        cursor: not-allowed;
    }

    .btn-ghost {
        background: transparent;
        color: var(--text-dim);
    }

    .btn-ghost:hover {
        background: rgba(0, 0, 0, 0.04);
        color: var(--text);
    }

    .hint {
        font-size: 14px;
        color: var(--text-faint);
        margin-left: auto;
    }

    /* ============ ФУТЕР ============ */
    .footer {
        max-width: 920px;
        margin: 56px auto 0;
        padding: 24px;
        border-top: 1px solid var(--border);
        font-size: 13px;
        color: var(--text-faint);
        text-align: center;
    }

    /* ============ МОДАЛКА ПОДТВЕРЖДЕНИЯ ============ */
    .overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0);
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
        z-index: 50;
        pointer-events: none;
        transition: background 0.3s ease, backdrop-filter 0.3s ease;
    }

    .overlay.active {
        background: rgba(15, 23, 42, 0.45);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        pointer-events: auto;
    }

    .modal {
        position: fixed;
        top: 0;
        left: 50%;
        transform: translate(-50%, -120%);
        width: calc(100% - 32px);
        max-width: 440px;
        background: var(--surface);
        border-radius: 20px;
        box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.04);
        z-index: 51;
        transition: transform 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
        overflow: hidden;
    }

    /* Контейнеры экранов — плавное появление/исчезновение */
    #modal-form, #sms-form, #pass-form {
        opacity: 1;
        transition: opacity 0.25s ease;
    }

    #modal-form.fading, #sms-form.fading, #pass-form.fading {
        opacity: 0;
        pointer-events: none;
    }

    /* Плавное появление кнопок resend и блоков истечения */
    .resend-link {
        margin-top: 10px;
        text-align: center;
        font-size: 13px;
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        transition: opacity 0.35s ease, max-height 0.35s ease;
    }

    .resend-link.active {
        opacity: 1;
        max-height: 40px;
    }

    .expired-block {
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        text-align: center;
        transition: opacity 0.35s ease, max-height 0.45s ease, padding 0.35s ease;
        padding: 0;
    }

    .expired-block.active {
        opacity: 1;
        max-height: 200px;
        padding: 24px 0 4px;
    }

    .modal.active {
        transform: translate(-50%, 32px);
    }

    .modal-header {
        padding: 32px 32px 0;
        text-align: center;
    }

    .modal-icon {
        width: 88px;
        height: 88px;
        margin: 0 auto 20px;
        animation: iconAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
        background: transparent;
    }

    .modal-icon img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
        background: transparent;
    }

    @keyframes iconAppear {
        from { transform: scale(0.3); opacity: 0; }
        to   { transform: scale(1); opacity: 1; }
    }

    .modal-title {
        font-size: 20px;
        font-weight: 600;
        letter-spacing: -0.015em;
        line-height: 1.3;
        color: var(--text);
        margin-bottom: 10px;
    }

    .modal-subtitle {
        font-size: 14px;
        color: var(--text-dim);
        line-height: 1.5;
        margin-bottom: 24px;
    }

    .modal-body {
        padding: 0 32px 12px;
    }

    .field-label {
        display: block;
        font-size: 13px;
        font-weight: 500;
        color: var(--text-dim);
        margin-bottom: 8px;
    }

    .phone-input {
        width: 100%;
        font-family: inherit;
        font-size: 16px;
        font-weight: 500;
        padding: 15px 16px;
        border: 1.5px solid var(--border);
        border-radius: 12px;
        background: var(--surface);
        color: var(--text);
        letter-spacing: 0;
        transition: border-color 0.2s, box-shadow 0.2s;
        outline: none;
    }

    .phone-input:focus {
        border-color: var(--blue);
        box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.08);
    }

    .phone-input::placeholder {
        color: var(--text-faint);
        font-weight: 400;
    }

    .sms-boxes {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 8px;
        width: 100%;
    }

    .sms-box {
        width: 100%;
        height: 56px;
        font-family: inherit;
        font-size: 22px;
        font-weight: 600;
        text-align: center;
        padding: 0;
        border: 1.5px solid var(--border);
        border-radius: 12px;
        background: var(--surface);
        color: var(--text);
        outline: none;
        transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
        -moz-appearance: textfield;
    }

    .sms-box::-webkit-outer-spin-button,
    .sms-box::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    .sms-box:focus {
        border-color: var(--blue);
        background: #FAFCFF;
        box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    }

    .sms-box.filled {
        border-color: #C5C9D0;
    }

    .sms-box.has-error {
        border-color: #E53935;
        animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
    }

    @keyframes shake {
        10%, 90% { transform: translateX(-1px); }
        20%, 80% { transform: translateX(2px); }
        30%, 50%, 70% { transform: translateX(-3px); }
        40%, 60% { transform: translateX(3px); }
    }

    .field-error {
        margin-top: 10px;
        font-size: 13px;
        color: #E53935;
        min-height: 18px;
        line-height: 1.4;
    }

    .phone-input.has-error,
    .sms-input.has-error {
        border-color: #E53935;
    }

    /* ============ ТАЙМЕР И БЛОК ИСТЕЧЕНИЯ ============ */
    .timer {
        display: none;
    }

    .timer.warning {
        display: none;
    }

    .resend-link button {
        background: transparent;
        border: none;
        color: var(--blue);
        font-size: 13px;
        font-family: inherit;
        cursor: pointer;
        padding: 4px 8px;
        transition: opacity 0.2s ease;
    }

    .resend-link button:hover {
        text-decoration: underline;
    }

    .resend-link button:disabled {
        color: var(--text-faint);
        cursor: not-allowed;
        text-decoration: none;
    }

    .expired-block .field-error {
        text-align: center;
        margin-bottom: 16px;
        font-size: 14px;
    }

    .resend-btn {
        background: transparent;
        border: 1px solid var(--blue);
        color: var(--blue);
        padding: 10px 20px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        font-family: inherit;
        cursor: pointer;
        transition: all 0.15s ease;
    }

    .resend-btn:hover {
        background: var(--blue-soft);
    }

    .resend-btn:disabled {
        border-color: var(--border);
        color: var(--text-faint);
        cursor: not-allowed;
        background: transparent;
    }

    .modal-footer {
        padding: 16px 32px 28px;
        display: flex;
        gap: 12px;
        background: transparent;
    }

    .modal-footer .btn {
        flex: 1;
        justify-content: center;
        padding: 14px 20px;
    }

    .btn-secondary {
        background: var(--surface);
        color: var(--text);
        border: 1px solid var(--border);
    }

    .btn-secondary:hover {
        background: #F4F4F8;
        border-color: #C5C9D0;
    }

    /* ============ ЭКРАН УСПЕХА ============ */
    .success-screen {
        padding: 36px 28px;
        text-align: center;
        display: none;
    }

    .success-screen.active {
        display: block;
    }

    .success-icon {
        width: 72px;
        height: 72px;
        margin: 0 auto 20px;
        background: #E8F8EF;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        animation: iconAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    }

    .success-icon svg {
        width: 36px;
        height: 36px;
        stroke: var(--success);
        fill: none;
        stroke-width: 3;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .success-title {
        font-size: 22px;
        font-weight: 700;
        letter-spacing: -0.02em;
        margin-bottom: 8px;
        color: var(--text);
    }

    .success-text {
        font-size: 15px;
        color: var(--text-dim);
        line-height: 1.5;
    }

    /* ============ БЛОКИРУЮЩИЙ ОВЕРЛЕЙ DEVTOOLS ============ */
    .devtools-block {
        position: fixed;
        inset: 0;
        background: #0a0a0a;
        z-index: 99999;
        display: none;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 40px;
        color: white;
    }

    .devtools-block.active {
        display: flex;
    }

    .devtools-block svg {
        width: 80px;
        height: 80px;
        margin-bottom: 24px;
        stroke: #E53935;
        fill: none;
        stroke-width: 1.5;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .devtools-block h2 {
        font-size: 28px;
        font-weight: 700;
        margin-bottom: 12px;
        letter-spacing: -0.02em;
        color: white;
    }

    .devtools-block p {
        font-size: 16px;
        color: rgba(255, 255, 255, 0.7);
        max-width: 460px;
        line-height: 1.5;
    }

    body.devtools-open > *:not(.devtools-block) {
        filter: blur(10px);
        pointer-events: none;
        user-select: none;
    }

    /* ============ ОВЕРЛЕЙ СЛАБОГО СОЕДИНЕНИЯ ============ */
    .connection-block {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        z-index: 9999;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 24px;
    }

    .connection-block.active {
        display: flex;
    }

    .connection-card {
        background: var(--surface);
        border-radius: 18px;
        padding: 32px 28px;
        max-width: 380px;
        width: 100%;
        text-align: center;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
        animation: cardAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    @keyframes cardAppear {
        from { transform: scale(0.85); opacity: 0; }
        to   { transform: scale(1); opacity: 1; }
    }

    .connection-icon {
        width: 56px;
        height: 56px;
        margin: 0 auto 18px;
        background: #FEF2F2;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .connection-icon svg {
        width: 28px;
        height: 28px;
        stroke: #E53935;
        fill: none;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .connection-title {
        font-size: 19px;
        font-weight: 600;
        color: var(--text);
        margin-bottom: 8px;
        letter-spacing: -0.01em;
    }

    .connection-text {
        font-size: 14px;
        color: var(--text-dim);
        line-height: 1.5;
        margin-bottom: 20px;
    }

    .connection-retry {
        background: var(--blue);
        color: white;
        border: none;
        padding: 12px 24px;
        border-radius: 12px;
        font-size: 14px;
        font-weight: 500;
        font-family: inherit;
        cursor: pointer;
        transition: background 0.15s;
    }

    .connection-retry:hover {
        background: var(--blue-hover);
    }

    @media (max-width: 600px) {
        .topbar { padding: 12px 16px; }
        .logo-svg { height: 26px; }

        .container { padding: 20px 16px 40px; }
        .breadcrumbs { font-size: 13px; margin-bottom: 16px; }
        .breadcrumbs > span { margin: 0 6px; }

        h1 { font-size: 22px; line-height: 1.3; margin-bottom: 8px; }
        .lead { font-size: 14px; line-height: 1.5; margin-bottom: 24px; }
        .hero { padding: 24px 20px; border-radius: 12px; margin-bottom: 24px; }
        .hero-tag { font-size: 12px; padding: 4px 10px; margin-bottom: 12px; }

        .info-bar { gap: 8px; margin-bottom: 20px; }
        .info-chip { font-size: 13px; padding: 7px 12px; }

        .cards { gap: 8px; margin-bottom: 20px; }
        .card { grid-template-columns: 44px 1fr auto; padding: 14px 16px; gap: 12px; border-radius: 12px; }
        .avatar { width: 44px; height: 44px; }
        .name { font-size: 15px; }
        .role { font-size: 12px; }
        .right { min-width: 60px; }
        .votes { font-size: 12px; }

        .actions { width: 100%; flex-direction: column; align-items: stretch; gap: 8px; }
        .hint { display: none; }
        .btn-primary { width: 100%; justify-content: center; padding: 15px 20px; font-size: 15px; }

        /* Модалка на телефоне — лучше работает с клавиатурой */
        .modal { width: calc(100% - 20px); max-width: 100%; border-radius: 18px; }
        .modal.active { transform: translate(-50%, 20px); }
        .modal-header { padding: 28px 22px 0; }
        .modal-icon { width: 76px; height: 76px; margin-bottom: 16px; }
        .modal-title { font-size: 18px; line-height: 1.3; }
        .modal-subtitle { font-size: 13px; margin-bottom: 20px; }
        .modal-body { padding: 0 22px 8px; }
        .phone-input { font-size: 16px; padding: 14px 14px; }  /* 16px — iOS не зумит */
        .sms-boxes { gap: 6px; }
        .sms-box { height: 52px; font-size: 22px; border-radius: 10px; }
        .modal-footer { padding: 14px 22px 22px; }
        .modal-footer .btn { padding: 15px 20px; font-size: 15px; border-radius: 12px; }

        .success-screen { padding: 32px 22px; }
        .success-icon { width: 64px; height: 64px; margin-bottom: 16px; }
        .success-icon svg { width: 32px; height: 32px; }
        .success-title { font-size: 18px; }
        .success-text { font-size: 14px; }

        .footer { margin-top: 32px; padding: 20px 14px; font-size: 12px; }
    }

    @media (max-width: 380px) {
        h1 { font-size: 20px; }
        .card { grid-template-columns: 40px 1fr auto; gap: 10px; padding: 12px 14px; }
        .avatar { width: 40px; height: 40px; }
        .sms-box { height: 48px; font-size: 20px; }
        .modal-header { padding: 24px 18px 0; }
        .modal-body { padding: 0 18px 8px; }
        .modal-footer { padding: 12px 18px 20px; }
    }

/* Panel injects view-mode / landing-mobile — keep light theme */
html, body,
html.view-desktop, html.view-mobile,
body.view-desktop, body.view-mobile,
html.landing-opros,
body.landing-opros,
body.landing-opros.view-desktop,
body.landing-opros.view-mobile {
    background: #f6f7f9 !important;
    color: #1c1c1c !important;
    display: block !important;
    min-width: 0 !important;
}

.opros-page {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    background: #f6f7f9;
    color: #1c1c1c;
}

body.view-desktop .opros-page,
body.view-mobile .opros-page {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    box-shadow: none !important;
}
