/* ==========================================================================
   SAMTAE PORTAL — METRO UI (WINDOWS 8 / WP 8.1) FULL-STACK STYLESHEET
   ========================================================================== */
:root {
    --bg: #111111;
    --surface: #1d1d1d;
    --surface-light: #2a2a2a;
    --surface-hover: #333333;
    --text: #ffffff;
    --muted: #8c8c8c;
    --blue: #0078d7;
    --teal: #00aba9;
    --purple: #6b2976;
    --red: #d13438;
    --green: #107c10;
    --orange: #da3b01;
    --magenta: #b4009e;
    --ease-metro: cubic-bezier(0.1, 0.9, 0.2, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.45;
    user-select: none;
}

input, textarea, select, p, .selectable {
    user-select: text;
}

/* ТИПОГРАФИКА METRO UI */
h1 {
    font-size: clamp(1.75rem, 4.8vw, 2.75rem);
    font-weight: 200;
    letter-spacing: -0.5px;
    line-height: 1.15;
}

h2 {
    font-size: clamp(1.25rem, 3.2vw, 1.7rem);
    font-weight: 300;
    line-height: 1.22;
    margin-bottom: 6px;
}

h3 {
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 6px;
}

p {
    font-size: 0.93rem;
    font-weight: 300;
    color: #d8d8d8;
}

.muted { color: var(--muted); }

/* SVG ИКОНКИ METRO */
.metro-svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.tile-svg {
    width: 34px;
    height: 34px;
    fill: currentColor;
    opacity: 0.92;
    margin-bottom: 6px;
}

/* ВЕРХНЯЯ ПАНЕЛЬ НАВИГАЦИИ (TOPBAR) */
.topbar {
    position: sticky;
    top: 0;
    z-index: 2500;
    display: flex;
    align-items: stretch;
    background: #0a0a0a;
    border-bottom: 1px solid #262626;
    overflow-x: auto;
    scrollbar-width: none;
}
.topbar::-webkit-scrollbar { display: none; }

.brand {
    background: var(--blue);
    color: #fff;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 300;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 52px;
    padding: 0 15px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.79rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: color 0.18s var(--ease-metro), background-color 0.18s var(--ease-metro), border-color 0.18s var(--ease-metro);
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
    color: #fff;
    border-bottom-color: var(--blue);
}

.nav-link.admin-link {
    color: #ffb900;
    border-bottom-color: transparent;
}
.nav-link.admin-link.active {
    border-bottom-color: #ffb900;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
}

.nav-btn {
    background: var(--surface);
    color: #fff;
    border: 0;
    border-left: 1px solid #262626;
    padding: 0 16px;
    font: inherit;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s var(--ease-metro);
}

.nav-btn:hover { background: var(--surface-light); }
.nav-cta { background: var(--orange); }
.nav-cta:hover { filter: brightness(1.12); background: var(--orange); }

.role-badge {
    background: var(--red);
    color: #fff;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

/* КОНТЕЙНЕРЫ И ЭКРАНЫ */
.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 26px 20px 84px;
    animation: metroFadeIn 0.3s var(--ease-metro);
}

.screen {
    display: none;
    padding: 26px 20px 92px;
    max-width: 1120px;
    margin: 0 auto;
    animation: metroSlideIn 0.3s var(--ease-metro) forwards;
}

.screen.active { display: block; }

@keyframes metroSlideIn {
    from { opacity: 0; transform: translateX(32px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes metroFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ШАПКА ЭКРАНА */
.header-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.back-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
    border: 2px solid var(--text);
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s var(--ease-metro), transform 0.12s var(--ease-metro);
}

.back-btn:hover { background: var(--blue); border-color: var(--blue); }
.back-btn:active { transform: scale(0.9); }

.header-titles { min-width: 0; flex: 1; }
.header-sub {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    color: var(--muted);
    margin-top: 3px;
}

/* СЕТКА ПЛИТОК METRO (START HUB) */
.section-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--muted);
    margin: 24px 0 10px;
}
.section-label:first-of-type { margin-top: 0; }

.tile-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(122px, auto);
    gap: 10px;
}

a.tile, button.tile, .tile {
    padding: 16px;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    text-decoration: none;
    border: 0;
    font: inherit;
    text-align: left;
    overflow: hidden;
    transition: transform 0.14s var(--ease-metro), filter 0.16s var(--ease-metro), outline 0.12s ease;
}

.tile:hover {
    filter: brightness(1.09);
    outline: 2px solid rgba(255, 255, 255, 0.35);
}

.tile:active {
    transform: scale(0.975);
}

.tile.w2 { grid-column: span 2; }
.tile.w4 { grid-column: span 4; }
.tile.h2 { grid-row: span 2; min-height: 254px; }

.bg-blue { background-color: var(--blue); }
.bg-teal { background-color: var(--teal); }
.bg-purple { background-color: var(--purple); }
.bg-red { background-color: var(--red); }
.bg-green { background-color: var(--green); }
.bg-orange { background-color: var(--orange); }
.bg-magenta { background-color: var(--magenta); }
.bg-dark { background-color: var(--surface); }

.tile-num {
    font-size: 2.1rem;
    font-weight: 100;
    line-height: 1;
    opacity: 0.92;
}

.tile-tag {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.88;
    font-weight: 600;
}

.tile-title {
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1.25;
}

.tile-desc {
    font-size: 0.78rem;
    opacity: 0.84;
    margin-top: 4px;
}

/* ЭКРАН БЛОКИРОВКИ НА СТРАНИЦЕ ВЫБОРОВ */
#lock-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(145deg, #09151e 0%, #102a3b 100%);
    z-index: 5000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 28px;
    cursor: pointer;
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

#lock-screen.unlocked {
    transform: translateY(-100%);
    pointer-events: none;
}

.lock-clock {
    font-size: clamp(4rem, 15vw, 6.5rem);
    font-weight: 100;
    line-height: 1;
    letter-spacing: -2px;
}

.lock-date {
    font-size: clamp(1.15rem, 3.8vw, 1.75rem);
    font-weight: 200;
    color: #b0c4de;
    margin-top: 6px;
}

.lock-summary {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    max-width: 780px;
}

.lock-card {
    background: rgba(255, 255, 255, 0.07);
    border-left: 4px solid var(--blue);
    padding: 14px 16px;
}

.lock-hint {
    font-size: 0.85rem;
    font-weight: 300;
    color: #b0c4de;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* ФОРМЫ, КНОПКИ И ПОЛЯ ВВОДА METRO */
.metro-input, select.metro-input {
    width: 100%;
    background: #ffffff;
    color: #000000;
    border: 2px solid #888888;
    border-radius: 0;
    padding: 11px 13px;
    font: inherit;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.15s ease;
}

.metro-input:focus {
    border-color: var(--blue);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.form-row .metro-input {
    flex: 1;
    width: auto;
    min-width: 160px;
}

.metro-btn {
    background-color: var(--blue);
    color: #ffffff;
    border: none;
    border-radius: 0;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.metro-btn:hover { filter: brightness(1.12); }
.metro-btn:active { transform: scale(0.97); }
.metro-btn.w-full { width: 100%; }

/* КАРТОЧКИ НОВОСТЕЙ И МЕДИАПЛЕЕР (ФОТО / ВИДЕО) */
.news {
    background: var(--surface);
    border-left: 4px solid var(--blue);
    margin-bottom: 18px;
    transition: transform 0.15s var(--ease-metro);
}

.news-body { padding: 20px; }
.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.news-media {
    margin-top: 14px;
    max-height: 460px;
    overflow: hidden;
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
}

.news-media img, .news-media video {
    display: block;
    width: 100%;
    max-height: 450px;
    object-fit: cover;
}

.discuss {
    background: #161616;
    border-top: 1px solid #2b2b2b;
    padding: 16px 20px 20px;
}

.cmt {
    padding: 10px 0;
    border-bottom: 1px solid #262626;
}
.cmt:last-child { border-bottom: none; }
.cmt b { font-size: 0.86rem; font-weight: 600; }
.cmt time { margin-left: 8px; color: var(--muted); font-size: 0.74rem; }

/* МЕССЕНДЖЕР */
.chat-app {
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 10px;
    height: calc(100vh - 185px);
    min-height: 440px;
}

.chat-list {
    background: var(--surface);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 12px;
    background: none;
    border: 0;
    border-left: 4px solid transparent;
    border-bottom: 1px solid #252525;
    color: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.chat-item:hover { background: var(--surface-light); }
.chat-item.active {
    background: var(--surface-light);
    border-left-color: var(--blue);
}

.ava {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 400;
}

.chat-win {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--surface);
}

.chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface-light);
}

.chat-back { display: none; }

.msgs {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
}

.msg {
    max-width: 76%;
    padding: 10px 14px;
    background: var(--surface-light);
    align-self: flex-start;
    font-size: 0.91rem;
    border-left: 3px solid var(--teal);
}

.msg.me {
    align-self: flex-end;
    background: var(--blue);
    border-left: none;
}

.msg-author {
    font-size: 0.74rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.msg small {
    display: block;
    margin-top: 4px;
    font-size: 0.7rem;
    opacity: 0.75;
    text-align: right;
}

.chat-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: var(--surface-light);
}

/* ДОСЬЕ, БЮЛЛЕТЕНЬ И КАРТОЧКИ ВЫБОРОВ */
.dossier-header {
    background-color: var(--surface);
    padding: 20px;
    border-left: 4px solid var(--blue);
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.meta-box {
    background-color: var(--surface);
    padding: 12px 14px;
}

.meta-box span {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.info-card {
    background-color: var(--surface);
    padding: 18px;
    border-top: 3px solid var(--teal);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.card-cat {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    font-weight: 600;
}

.ballot-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.ballot-card {
    background-color: var(--surface);
    padding: 22px;
    border-top: 4px solid var(--blue);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.88rem;
    margin-bottom: 6px;
}

.bar-track {
    height: 12px;
    background-color: #111111;
    width: 100%;
}

.bar-fill {
    height: 100%;
    width: 50%;
    transition: width 0.4s var(--ease-metro);
}

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
}

.metro-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 540px;
}

.metro-table th, .metro-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #2c2c2c;
    font-size: 0.88rem;
    vertical-align: top;
}

/* НИЖНИЙ БАР НАВИГАЦИИ ВЫБОРОВ */
.app-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: #0a0a0a;
    border-top: 1px solid #262626;
    display: flex;
    align-items: center;
    overflow-x: auto;
    z-index: 3000;
    padding: 0 8px;
    gap: 4px;
}
.app-bar::-webkit-scrollbar { display: none; }

.nav-tab {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.nav-tab.active {
    color: var(--text);
    border-bottom-color: var(--blue);
}

/* МОДАЛЬНЫЕ ОКНА METRO И УВЕДОМЛЕНИЯ TOAST */
.modal {
    position: fixed;
    inset: 0;
    z-index: 7000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.85);
}
.modal.show { display: flex; }

.modal-box {
    width: 100%;
    max-width: 460px;
    padding: 28px;
    background: var(--surface);
    border-top: 5px solid var(--blue);
    animation: metroFadeIn 0.22s var(--ease-metro);
}

.modal-box .metro-input {
    margin-top: 10px;
}

#metro-toast {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--green);
    color: #fff;
    padding: 14px 20px;
    z-index: 8000;
    transform: translateY(-100%);
    transition: transform 0.3s var(--ease-metro);
    cursor: pointer;
}
#metro-toast.show { transform: translateY(0); }

/* МОБИЛЬНАЯ ОПТИМИЗАЦИЯ */
@media (max-width: 760px) {
    .tile-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: minmax(112px, auto);
    }
    .tile.w4 { grid-column: span 2; }
    .tile.h2 { grid-row: span 1; min-height: 170px; }
    .ballot-grid { grid-template-columns: 1fr; }
    .chat-app {
        grid-template-columns: 1fr;
        height: calc(100vh - 165px);
    }
    .chat-app.open .chat-list { display: none; }
    .chat-app:not(.open) .chat-win { display: none; }
    .chat-back { display: inline-flex; }
    .msg { max-width: 90%; }
    .brand { padding: 0 14px; font-size: 1rem; }
    .nav-link { padding: 0 11px; font-size: 0.74rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}


/* ЖЁСТКАЯ ЗАЩИТА РАЗМЕРОВ SVG (ПРЕДОТВРАЩЕНИЕ ГИГАНТСКИХ ИКОНОК) */
svg.metro-svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    fill: currentColor;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

svg.tile-svg, .tile svg {
    width: 34px !important;
    height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    fill: currentColor !important;
    flex-shrink: 0;
    opacity: 0.92;
}


/* ==========================================================================
   SAMTAE v7 — КАНДИДАТЫ, РЕАКЦИИ, ВЛОЖЕНИЯ И METRO MEDIA PLAYER
   ========================================================================== */
html { max-width: 100%; overflow-x: hidden; }
body { min-height: 100dvh; max-width: 100%; }
button, a, input, textarea, select { outline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, video:focus-visible {
    outline: 2px solid #67c8ff;
}
button:disabled, input:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    filter: grayscale(0.35);
}
.candidate-badge { background: var(--teal); }

/* Видеоплеер с собственной панелью поверх нижней части видео. */
.news-media { max-height: none; }
.metro-player {
    position: relative;
    width: 100%;
    background: #0d0d0d;
    overflow: hidden;
}
.metro-player video {
    display: block;
    width: 100%;
    max-height: 450px;
    min-height: 160px;
    object-fit: contain;
    background: #0d0d0d;
    cursor: pointer;
}
.player-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: 44px auto minmax(90px, 1fr) 44px 72px 44px;
    align-items: center;
    gap: 8px;
    min-height: 56px;
    padding: 6px 8px;
    background: rgba(17, 17, 17, 0.94);
    border-top: 1px solid #3a3a3a;
}
.player-btn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: var(--blue);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}
.player-btn:hover { background: #1088e8; }
.player-btn:active { transform: scale(0.94); }
.player-time {
    color: #fff;
    font-size: 0.75rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.player-seek, .player-volume {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    accent-color: var(--blue);
    cursor: pointer;
}
.metro-player:fullscreen { display: flex; align-items: center; justify-content: center; }
.metro-player:fullscreen video { max-height: 100vh; }

/* Реакции и вложения в обсуждении. */
.news-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #2c2c2c;
}
.reaction-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid #3b3b3b;
    background: #161616;
    color: #d8d8d8;
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.reaction-btn:hover { background: var(--surface-hover); color: #fff; }
.reaction-btn.active { background: var(--blue); border-color: #67c8ff; color: #fff; }
.reaction-count { font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.comment-attach-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}
.cmt-attach { min-height: 44px; }
.cmt-attach.has-file { background: var(--green); }
.cmt-file-name { font-size: 0.76rem; overflow-wrap: anywhere; }
.cmt .news-media { max-width: 520px; margin: 10px 0 4px; }
.cmt .news-media img, .cmt .news-media video { object-fit: contain; }
.msg .news-media { max-width: min(520px, 100%); }
.msg .news-media img { object-fit: contain; }

/* Фотографии кандидатов. */
.candidate-photo {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #141414;
    border: 1px solid #353535;
    display: flex;
    align-items: center;
    justify-content: center;
}
.candidate-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.candidate-photo img[hidden] { display: none; }
.candidate-photo > span {
    padding: 16px;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.candidate-photo.has-photo > span { display: none; }
.candidate-tile-photo {
    width: 112px;
    min-width: 112px;
    aspect-ratio: 4 / 5;
    margin: -16px 16px -16px -16px;
    border: 0;
}
.candidate-tile-content { min-width: 0; flex: 1; }
.tile.candidate-tile { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0; }
.candidate-tile .candidate-tile-photo { grid-row: 1 / span 2; }
.candidate-tile > .tile-title { grid-column: 2; align-self: end; margin-left: 16px; }
.candidate-dossier-photo { width: 180px; min-width: 180px; max-height: 225px; }
.candidate-ballot-photo { max-height: 320px; aspect-ratio: 4 / 3; margin-bottom: 14px; }
.candidate-ballot-photo img { object-position: center 22%; }

/* Samtae.Выборы: регистрация и кабинет. */
.candidate-panel { gap: 20px; }
.candidate-panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}
.candidate-panel-heading > div { max-width: 720px; }
.candidate-form { display: flex; flex-direction: column; gap: 14px; min-width: 0; flex: 1; }
.form-two-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.field-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #d8d8d8;
    font-size: 0.82rem;
}
.file-drop {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    background: #141414;
    border: 1px dashed #4a4a4a;
    color: #fff;
    cursor: pointer;
}
.file-drop input, .candidate-admin-file { width: 100%; color: #fff; font: inherit; font-size: 0.84rem; }
.file-drop-title { font-weight: 600; }
.candidate-profile-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 18px;
    padding: 20px;
    background: var(--surface);
    border-top: 4px solid var(--teal);
}
.candidate-profile-photo { align-self: start; }
.candidate-notice > div { margin-bottom: 12px; }
.candidate-notice a { text-decoration: none; }
.candidate-photo-editor {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #303030;
}
.candidate-photo-editor:last-child { border-bottom: 0; }
.candidate-photo-fields { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.admin-candidate-photo { max-height: 175px; }

/* Статусы и органы управления ЦИК. */
.voting-status {
    display: block;
    padding: 12px 14px;
    margin-bottom: 16px;
    border-left: 4px solid var(--blue);
    background: #15202a;
    color: #fff;
    font-size: 0.9rem;
}
.voting-status.status-open { border-left-color: var(--green); background: #122718; }
.voting-status.status-paused { border-left-color: var(--orange); background: #2b1b14; }
.voting-status.status-closed { border-left-color: var(--red); background: #2b1618; }
.voting-admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.voting-total {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}
.voting-total strong { font-size: 2rem; font-weight: 200; }

.metro-btn.bg-blue { background-color: var(--blue); }
.metro-btn.bg-teal { background-color: var(--teal); }
.metro-btn.bg-purple { background-color: var(--purple); }
.metro-btn.bg-red { background-color: var(--red); }
.metro-btn.bg-green { background-color: var(--green); }
.metro-btn.bg-orange { background-color: var(--orange); }
.metro-btn.bg-dark { background-color: var(--surface); }

@media (max-width: 760px) {
    #candidate-root .header-bar { flex-wrap: wrap; }
    #candidate-root .header-bar .header-titles { flex-basis: 100%; }
    #candidate-root .header-bar > .metro-btn { width: 100%; }
    .player-controls {
        grid-template-columns: 44px minmax(0, 1fr) 44px 44px;
        gap: 6px;
    }
    .player-time { text-align: center; }
    .player-seek { grid-column: 1 / -1; grid-row: 2; }
    .player-volume { display: none; }
    .metro-player video { min-height: 210px; padding-bottom: 96px; }
    .candidate-profile-layout { grid-template-columns: 1fr; }
    .candidate-profile-photo { max-width: 280px; }
    .form-two-columns { grid-template-columns: 1fr; }
    .candidate-dossier-photo { width: 130px; min-width: 130px; }
    .candidate-tile-photo { width: 88px; min-width: 88px; }
    .candidate-tile h2 { font-size: 1.1rem; }
    .reaction-btn { flex: 1 1 auto; justify-content: center; }
}
