:root {
    /* Современная типографика вместо старых шрифтов */
    --font-primary: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    --color-surface: #ffffff;
    --color-text-primary: #111827;
    --color-text-secondary: #4b5563;
    --color-accent-red: #ef0021;
    --color-accent-green: #10b981; /* Более современный зеленый */
    --color-accent-green-hover: #059669; /* ДОБАВЛЕНО: Цвет при наведении */
    --color-danger: #dc2626;
    --color-border: #e5e7eb;
    --color-form-focus: #2563eb;
    --color-background: #f4f7f6; /* Чистый светло-серый фон вместо градиента */
    --color-accent-blue: #2563eb;  
    --color-accent-blue-hover: #1d4ed8;
    --color-accent-red-hover:#b00018;
}

body {  
    background: var(--color-background); 
    min-height: 100vh; 
    padding: 0; 
    margin: 0;
    font-family: var(--font-primary); 
    font-size: 11pt;
    line-height: 1.6;
    color: var(--color-text-primary);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 600;
}

/* --- 2. Шапка (Header Redesign) --- */

/* Верхняя полоса с доверием */
.head-info-line {    background: #1f2937;    color: #e5e7eb;    font-size: 0.8rem;    padding: 6px 0;    border-bottom: 1px solid rgba(255,255,255,0.1);}
.container-wide {    max-width: 1400px;    margin: 0 auto;    padding: 0 1rem;    display: flex;    justify-content: space-between;    align-items: center;}
.trust-badge {    display: flex;    align-items: center;    gap: 6px;    color: #10b981;     font-weight: 500;}
.icon-tiny {    width: 14px;    height: 14px;    fill: currentColor;}

/* Основная шапка */
.head {    background-color: rgba(255, 255, 255, 0.95);    backdrop-filter: blur(12px);    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);    position: sticky;    top: 0;    z-index: 1000;}

.head-wrap {    max-width: 1400px;    margin: 0 auto;    padding: 0.6rem 1rem;    display: flex;    justify-content: space-between;    align-items: center;}

/* Навигация в центре */
.head-nav {
    display: flex;
    gap: 1.5rem;
}
.head-nav a {    color: var(--color-text-primary);    text-decoration: none;    font-weight: 600;    font-size: 0.95rem;    display: flex;    align-items: center;    gap: 0.5rem;    padding: 0.5rem 0.75rem;    border-radius: 8px;    transition: all 0.2s ease;}
.head-nav a:hover {    background-color: #f3f4f6;    color: var(--color-accent-red);}
.head-nav a:hover .icon {    fill: var(--color-accent-red);}
.head .icon {    width: 1.25rem;    height: 1.25rem;    fill: #6b7280;}

/* Логотип */
.logo img {    max-height: 42px;    display: block;}

/* Кнопки справа */
.head-actions {    display: flex;    align-items: center;    gap: 1rem;}

/* Кнопка "Нужна помощь" */
.btn-help {    display: flex;    align-items: center;    gap: 8px;   color : var(--color-accent-blue);     border: 2px solid var(--color-accent-blue);    background: #fff !important;     padding-left:14px;    border-radius: 20px;    font-weight: 700 !important;    font-size: 0.9rem !important;    transition: all 0.3s ease;    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2); text-decoration: none;}
.btn-help-icon {    color: #fff;    background: var(--color-accent-blue);     width: 32px;    height: 32px;    border-radius: 50%;    display: flex;    align-items: center;    justify-content: center;    font-size: 1.1rem;    transition: all 0.3s ease;}
.btn-help:hover {   color : #fff;     background: var(--color-accent-blue) !important;     transform: translateY(-1px);    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.25);}
.btn-help:hover .btn-help-icon {   color : var(--color-accent-blue);     background: #fff;}

/* Кнопка профиля */
.btn-profile {    color: var(--color-text-secondary) !important;font-weight: 600; text-decoration: none;    font-size: 0.95rem;}
.btn-profile.active {    color: var(--color-accent-red) !important;}
.btn-profile:hover {    color: var(--color-text-primary) !important;}

/* Адаптивность шапки */
@media (max-width: 1024px) {
    .head-nav span { display: none; }    .head-nav { gap: 0.5rem; }    .head-info-line { display: none; }
}

@media (max-width: 768px) {
    .btn-help-text { display: none; }    .btn-help { padding: 0; border-radius: 50%; }    .logo img { max-height: 32px; }
}


.container {
    display: flex;  justify-content: center;   padding: 40px 0 40px 0; min-height: 69vh;
}

.rightblok {
    max-width: 60%;  
    flex-grow: 1; 
    background-color: #ffffff; /* Сделали белым без прозрачности */
    border-radius: 12px; /* Более современное скругление */
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); /* Мягкая тень */
    position:relative; 
    height: 100%;
    border: 1px solid var(--color-border);
}

.rightblok h1 {padding-left: 20px; color: var(--color-accent-green); text-align: center;  }
.rightblok h2 {padding-left: 20px; color: var(--color-text-primary);}
.rightblok h2 a {color: var(--color-text-secondary);}
.rightblok h2 a:hover {color: var(--color-accent-green); text-decoration: none; }
.rightblok p {padding:  0 20px;}

/* Общие стили для формы */
.usermenu {
    margin: 20px auto;
    padding:1px;
}

.usermenu h4 {
    color: var(--color-text-secondary);
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 600;
}

.usermenu ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.usermenu li {
    margin-bottom: 5px;
}

.usermenu a {
    text-decoration: none;
    color: var(--color-text-secondary);
    padding: 10px 14px; /* Чуть увеличили отступы */
    display: block;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.usermenu a:hover {
    background-color: #f3f4f6; /* Легкий серый фон вместо синего */
    color: var(--color-accent-blue);
}

.usermenu a:active , .usermenu a.active{
    background-color: #eff6ff; /* Нежный голубой для активного пункта */
    color: var(--color-accent-blue);
    font-weight: 600;
    border-left: 3px solid var(--color-accent-blue); /* Акцентная полоска слева */
    border-radius: 0 6px 6px 0;
}

form {
    margin: 0 auto;
    padding: 20px;
    border-top: 1px solid #F2F2F2;
}

.registration-form {  background-color: #fff; border-radius:10px; max-width: 600px;}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--color-text-primary);
}

/* Стили для текстового поля input */
input[type="text"], input[type="email"], input[type="password"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    box-sizing: border-box;
    font-family: var(--font-primary);
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus {
    border-color: var(--color-form-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); /* Современное свечение фокуса */
    outline: none;
}

/* Стили для textarea */
textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    box-sizing: border-box;
    font-family: var(--font-primary);
    transition: border-color 0.3s, box-shadow 0.3s;
    resize: vertical;
}

textarea:focus {
    border-color: var(--color-form-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

/* Стили для чекбокса */
input[type="checkbox"] {
    margin-right: 10px;
    vertical-align: middle;
}

/* Стили для кнопки */ 
button {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background-color: var(--color-accent-green);
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s, transform 0.1s;
    text-align: center;
}

button:hover { 
    background-color: var(--color-accent-green-hover) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.form-links {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.form-links a, .links a {
    color: var(--color-accent-blue);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

.form-links a:hover,.links a:hover {
    color: var(--color-accent-blue-hover);
}

.form-group {
    margin-bottom: 20px;
}

.checkboxes input[type="checkbox"] { margin-right: 10px; accent-color: var(--color-accent-blue); }
.checkboxes {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.form-group-radio {
    display: block;
    margin-bottom: 1rem;
}

.form-group-radio input[type="radio"] {
    display: none;
}

.form-group-radio label {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.form-group-radio label:hover {
    border-color: #d1d5db;
    background-color: #f9fafb;
}

.form-group-radio label::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-right: 12px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    transition: all 0.2s ease-in-out;
}

.form-group-radio input[type="radio"]:checked + label {
    border-color: var(--color-accent-blue);
    background-color: #eff6ff;
    font-weight: 600;
    color: #1e40af;
}

.form-group-radio input[type="radio"]:checked + label::before {
    border-color: var(--color-accent-blue);
    box-shadow: inset 0 0 0 4px var(--color-accent-blue);
    background-color: #ffffff;
}

.photo-section {
    display: flex;
    align-items: center;
}

input[type="file"] {
    margin-right: 20px;
    width: 180px;
}

.photo-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.photo-preview img {
    max-width: 100px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 10px;
}

.photo-preview a {
    color: var(--color-danger);
    text-decoration: none;
    font-size: 12px;
}

.photo-preview a:hover {
    text-decoration: underline;
}

.form-buttons {
    display: flex;
    justify-content: space-between;
}

button.save-button {
    background-color: var(--color-accent-green);
    color: white;
    margin: 10px;
}

button.delete-button {
    background-color: transparent;
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
    margin: 10px;
}
button.delete-button:hover {
    background-color: var(--color-danger);
    color: #fff;
}

footer {
    background-color: rgba(44, 62, 80, 0.6);
    color: white;
    padding: 10px 0;
}
.footer-bottom {
    text-align: center; background-color:rgba(0, 0, 0, 0.5);
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #111;
}

.footer-bottom p {
    margin: 0;   color: var(--color-accent-green);
    padding: 5px 0;
}

.footer-links {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
}

.footer-links li {
    margin: 15px;
}

.footer-links a {
    color: #A2D5AB;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* КАРТОЧКИ СТАТЕЙ И ОТЗЫВОВ */
.articl {display: flex; flex-wrap: wrap; gap: 16px; padding: 0 20px 20px 20px;}
.articl .art {
    flex-grow: 1;  
    border: 1px solid var(--color-border); /* Нормальные границы вместо старых border-left/top */
    border-radius: 8px; /* Скругления карточкам */
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    box-sizing: border-box; 
    padding-bottom: 10px; 
    line-height: 120%; 
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.articl .art:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.articl .art p {padding: 15px 15px 5px 15px; display: flex; justify-content: space-between; margin: 0; color:var(--color-text-secondary);}
.articl .art p.center{ display: flex; align-items: flex-end; justify-content: center; text-align: center; height: 100%; padding-bottom: 15px;}
.articl .art span {color: var(--text-muted); font-size: 12px;}
.articl .art .spacer { flex-grow: 1; }  
.articl .art .cvs { display: flex; justify-content: space-between; color: var(--color-text-primary); border-top: 1px solid var(--color-border); padding-top: 10px; margin-top: 10px;} 
.articl .art .cv {display: flex; justify-content: space-between;   padding: 0 15px; font-size: 13px;}
.articl .art .cv a{color:var(--color-accent-green); font-weight: 500; text-decoration: none; padding: 4px 8px;}
.articl .art .cv a span {color:#A2D5AB;}
.articl .art .cv a:hover {color:#ffffff; background-color: var(--color-accent-green);  border-radius: 4px;}

.articl .art p a{font-size: 1.1em; font-weight: 600; color:var(--color-text-primary);}
.articl .art p a:hover {color:var(--color-accent-blue); text-decoration: none;}
.articl .art p.center a{font-size: 1em; font-weight: 500; color:var(--color-accent-blue); background: #eff6ff; padding: 6px 12px; border-radius: 6px;}
.articl .art p.center a:hover {color:#ffffff; background: var(--color-accent-blue); text-decoration: none;}

.articl .art  .view {
   background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" aria-hidden="true" focusable="false" fill="%239ca3af"><path d="M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"/></svg>');
    background-repeat: no-repeat;
    background-size: contain; 
    width: 1em; height: 1em;
    margin-right: 5px; margin-top: 3px;
}
.articl .art  .com {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" aria-hidden="true" focusable="false" fill="%239ca3af"><path d="M208 352c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176c0 38.6 14.7 74.3 39.6 103.4c-3.5 9.4-8.7 17.7-14.2 24.7c-4.8 6.2-9.7 11-13.3 14.3c-1.8 1.6-3.3 2.9-4.3 3.7c-.5 .4-.9 .7-1.1 .8l-.2 .2 0 0 0 0C1 327.2-1.4 334.4 .8 340.9S9.1 352 16 352c21.8 0 43.8-5.6 62.1-12.5c9.2-3.5 17.8-7.4 25.3-11.4C134.1 343.3 169.8 352 208 352zM448 176c0 112.3-99.1 196.9-216.5 207C255.8 457.4 336.4 512 432 512c38.2 0 73.9-8.7 104.7-23.9c7.5 4 16 7.9 25.2 11.4c18.3 6.9 40.3 12.5 62.1 12.5c6.9 0 13.1-4.5 15.2-11.1c2.1-6.6-.2-13.8-5.8-17.9l0 0 0 0-.2-.2c-.2-.2-.6-.4-1.1-.8c-1-.8-2.5-2-4.3-3.7c-3.6-3.3-8.5-8.1-13.3-14.3c-5.5-7-10.7-15.4-14.2-24.7c24.9-29 39.6-64.7 39.6-103.4c0-92.8-84.9-168.9-192.6-175.5c.4 5.1 .6 10.3 .6 15.5z"/></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    width: 1em; height: 1em;
    margin-right: 5px; margin-top: 3px; 
}

/* ШАПКА ПРОФИЛЯ */
.userprofil {
    background-color: #ffffff; 
    border-radius: 12px; 
    padding: 24px; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--color-border);
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
.profile-info-left { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 250px; }
.profile-info-left h1 {
    margin: 0; 
    color: var(--color-text-primary); 
    font-size: 24px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.profile-meta { color: var(--color-text-secondary); font-size: 14px; }

.profile-actions-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}
.balance-block { font-size: 14px; color: var(--color-text-secondary); display: flex; align-items: center; gap: 8px; }
.balance-block strong { color: var(--color-text-primary); font-size: 16px; font-weight: 600; }
.btn-topup { color: var(--color-accent-blue); text-decoration: none; font-weight: 500; font-size: 13px; }
.btn-topup:hover { text-decoration: underline; color: var(--color-accent-blue-hover); }

.btn-public-profile {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eff6ff;
    color: var(--color-accent-blue);
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    border: 1px solid #bfdbfe;
    transition: all 0.2s ease;
}
.btn-public-profile:hover {
    background: var(--color-accent-blue);
    color: #ffffff;
    text-decoration: none;
}

.pro-badge {
    font-size: 12px;
    color: #fff;
    background-color: var(--color-accent-green);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
}
.pro-badge small { font-size: 10px; font-weight: 400; text-transform: none; opacity: 0.9; }
.pro-badge:hover { background-color: var(--color-accent-green-hover); text-decoration: none; color: #fff; }

/* СЕТКА ФОРМ НАСТРОЕК */
.settings-section {
    background: #f9fafb;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
}
.settings-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 12px;
}
.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid-3-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 20px; }

/* Стилевые правила для личных сообщений */
.msg {   display: flex;     width: 100%;       height: 100%; max-height: 45vh;}

.sidebar {
    width: 25%;
    background-color: #f9fafb;
    border-right: 1px solid var(--color-border);
    overflow-y: auto;    
}
.sidebar a {text-decoration: none; color: var(--color-accent-blue);}
.sidebar a:hover .conversation  {background-color: #e5e7eb;}

.conversation {
    padding: 10px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar .act {background-color: #fff;}

.conversation .user-name {
    font-weight: bold;
}

.conversation .unread-count {
    background-color: var(--color-danger);
    color: #fff;
    border-radius: 50%;
    padding: 5px 10px;
    font-size: 12px;
}

.conversation .last-message-date {
    font-size: 12px;
    color: #888;
    padding-left: 5px;
}

.chat {
    width: 75%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.message .message-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 5px;
}
.message-info {background-color: rgba(255, 255, 255, 0.3); padding: 3px;}
.message.sender .message-content {
    background-color: #ecfdf5;
    align-self: flex-end;
}

.message.receiver .message-content {
    background-color: #eff6ff;
    align-self: flex-start;
}

.message-content {
    padding: 10px;
    border-radius: 10px;
    max-width: 60%;
    border: 1px solid var(--color-border);
}

.message-form {
    display: flex;
    margin: 0;
}
.message-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    margin-right: 10px;
    resize: none;
    height: auto;
    min-height: 40px; 
    max-height: 120px; 
    overflow-y: auto;
}

.send-button {
    padding: 10px 20px;
    width: auto;
    height: 52px;
}

.sect1 {background-color: #f9fafb; padding: 15px; border-radius: 8px; border: 1px solid var(--color-border);}

/* Стилевые правила для всплывающего окна */
a.open-popup {
    display: inline-block;
}

.popup, .popup2 {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(4px);
}

.popup-content, .popup-content2  {
    background-color: #ffffff;
    margin: 15% auto;
    padding: 30px;
    border: 1px solid var(--color-border);
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.close, .close2 {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
}

.close:hover, .close:focus, .close2:hover, .close2:focus {
    color: var(--color-text-primary);
    text-decoration: none;
}

.infopage { padding: 20px; font-size: 1.1em; font-weight: 400; text-align: center; background-color: #ffffff; border-radius:  0 0 12px 12px;}
.infopage ul { list-style-type: upper-roman; text-align: justify; margin: 0 40px;}
.infopage ul li {  font-size: 0.9em; padding-bottom: 15px;}
.infopage p a {color: var(--color-accent-blue); }
.infopage p a:hover {color: var(--color-accent-blue-hover); }
.infopage .proact {display: flex; justify-content: space-around;  align-items: baseline; }
.infopage a {text-decoration: none; max-width: 24%; }

/* Контейнер для кнопок редактора */
.editor-toolbar {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
    background-color: #f9fafb;
    padding: 8px;
    border: 1px solid var(--color-border);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

.editor-toolbar button.editor-btn {
    display: inline-block !important; 
    width: auto !important;           
    margin: 0 !important;             
    float: none !important;           
    
    background-color: #ffffff;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 14px;
    line-height: 1.5;
    min-width: 36px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.editor-toolbar button.editor-btn:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.editor-toolbar button.editor-btn:active {
    background-color: #e5e7eb;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
    transform: translateY(1px);
}

textarea#content {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    resize: vertical;
}
.photos-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}
.photo-preview-item {
    position: relative;
    border: 1px solid var(--color-border);
    padding: 5px;
    border-radius: 6px;
    text-align: center;
}
.photo-preview-item img {
    max-width: 150px;
    height: auto;
    display: block;
    margin-bottom: 5px;
    border-radius: 4px;
}
.photo-preview-item label {
    font-size: 12px;
    cursor: pointer;
}

.password-wrapper {
    position: relative;
}
.password-wrapper input {
    padding-right: 40px; 
}
.toggle-password {
    position: absolute;
    top: 35%;
    right: 10px;
    transform: translateY(-50%);
    cursor: pointer;
    color: #888;
    font-size: 1.1em;
    line-height: 1em;
}

/* --- Стили для фотогалереи в кабинете --- */
.gallery-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; padding: 1.5rem 0; border-top: 1px solid var(--color-border); }
.gallery-item { position: relative; border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.05); aspect-ratio: 4 / 3; cursor: grab; }
.gallery-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery-item .delete-form { position: absolute; top: 8px; right: 8px; }
.gallery-item .delete-form button { background-color: rgba(220, 38, 38, 0.8); color: white; border: none; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-size: 16px; line-height: 30px; text-align: center; padding: 0; backdrop-filter: blur(2px); transition: background-color 0.2s ease; }
.gallery-item .delete-form button:hover { background-color: rgba(220, 38, 38, 1); }
.gallery-item.sortable-ghost { opacity: 0.4; background: #eef2ff; }
.gallery-item.sortable-dragging { cursor: grabbing; opacity: 0.8; transform: scale(1.05); box-shadow: 0 8px 20px rgba(0,0,0,0.2); }

.upload-form { margin-top: 2rem; padding: 1.5rem; background-color: #f9fafb; border: 1px solid var(--color-border); border-radius: 8px; }
.upload-form label { font-weight: 600; margin-bottom: 0.5rem; display: block; }
.upload-form input[type="file"] { width: 100%; }
.upload-form button { margin-top: 1rem; width: auto; padding: 10px 20px; }
#save-order-status { text-align: center; padding: 10px; margin-top: 1rem; border-radius: 8px; display: none; font-weight: 500; }
#save-order-status.success { background-color: #dcfce7; color: #166534; }
#save-order-status.error { background-color: #fee2e2; color: #991b1b; }

.error-message {
  padding: 12px 16px;
  margin: 1rem 0;
  border-radius: 6px;
  background-color: #fef2f2; 
  color: #b91c1c;            
  border: 1px solid #fecaca; 
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 500;
}
.success-message   {
  padding: 12px 16px;
  margin: 1rem 0;
  border-radius: 6px;
  background-color: #ecfdf5;  
  color: #047857;             
  border: 1px solid #a7f3d0;  
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 500;
}

.accdel { padding: 20px; }
.accdel a {color: var(--color-danger); text-decoration: none;}
.accdel a:hover {color: #991b1b; text-decoration: underline; } 

.dashboard-section { margin-bottom: 40px; }
.dashboard-section:last-of-type { margin-bottom: 20px; }

.dashboard-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-end; 
    margin-bottom: 16px; 
    padding-bottom: 10px; 
    border-bottom: 2px solid var(--color-border); 
}
.dashboard-title { margin: 0; font-size: 20px; color: var(--color-text-primary); }
.dashboard-link { font-size: 14px; font-weight: 500; color: var(--color-accent-blue); text-decoration: none; }
.dashboard-link:hover { text-decoration: underline; color: var(--color-accent-blue-hover); }

.dashboard-card { padding: 16px; display: flex; flex-direction: column; }

.card-meta-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card-header-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 10px; }
.card-header-row.mb-8 { margin-bottom: 8px; }

.card-title-link { font-weight: 600; font-size: 15px; color: var(--color-text-primary); text-decoration: none; line-height: 1.4; display: block; margin-bottom: 8px; }
.card-title-link.no-margin { margin-bottom: 0; }
.card-title-link:hover { color: var(--color-accent-blue); text-decoration: none; }

.card-author { font-weight: 600; font-size: 15px; color: var(--color-text-primary); }

.card-date { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; }
.card-date.block-date { display: block; margin-bottom: 10px; }

.card-text { font-size: 13px; color: var(--color-text-secondary); margin: 0 0 16px 0; line-height: 1.5; }
.card-text.italic { font-style: italic; }

.card-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--color-border); text-align: right; }
.card-footer.flex-between { display: flex; justify-content: space-between; align-items: center; text-align: left; }

.card-action-link { font-size: 13px; font-weight: 500; color: var(--color-accent-blue); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.card-action-link.green { color: var(--color-accent-green); }
.card-action-link:hover { text-decoration: underline; }

.card-badge { font-size: 11px; color: var(--color-accent-green); text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; }
.card-views { font-size: 12px; color: var(--color-text-muted); display: flex; align-items: center; gap: 4px; }

.empty-state { width: 100%; background: #f9fafb; border: 1px dashed var(--color-border); border-radius: 8px; padding: 20px; text-align: center; color: var(--color-text-muted); font-size: 14px; box-sizing: border-box; }
.icon-sm { width: 14px; height: 14px; }
        .reg-description {
            font-size: 14px;
            color: #555;
            margin-bottom: 20px;
            line-height: 1.5;
            background: #f9f9f9;
            padding: 15px;
            border-radius: 8px;
            border-left: 4px solid #007bff;  
            max-width: 420px;
        }
        .type-switch {
            text-align: center;
            margin-bottom: 20px;
            font-size: 14px;
        }
        .type-switch a {
            color: #007bff;
            text-decoration: underline;
            font-weight: bold;
        }
        .type-switch a:hover {
            text-decoration: none;
        }

        .claim-options { 
    margin-top: 20px; 
}

 
.claim-option-content {
    display: none; 
    margin-left: 25px;
    margin-top: 10px;
     margin-bottom: 10px;
    padding: 15px;
    background: #f9fafb;
    border-left: 3px solid var(--color-accent-blue);
    border-radius: 8px;
    border-top: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

 
.claim-option-content.active { 
    display: block; 
}

.clinic-header { 
    text-align: center; 
    margin-bottom: 20px; 
}

.clinic-domain-badge { 
    display: inline-block; 
    background: #e5e7eb; 
    padding: 2px 8px; 
    border-radius: 4px; 
    font-weight: bold;
}
/* =========================================================
   ОРИГИНАЛЬНАЯ АДАПТИВНОСТЬ 
   (Все медиа-запросы оставлены как было, только для .art учтен отступ gap:16px)
   ========================================================= */

/* Стилевые правила для экранов с шириной от 0 до 480px */
@media (max-width: 480px) {
    .lefttopmenu a span {display: none;}
    .container { display: flex;  justify-content: center; flex-direction: column; padding: 0 0 40px 0;}
    .rightblok { max-width: 100%;    margin: 10px;}
    .leftblok {min-width: 90%;  padding-left: 20px; padding-right: 20px;} 
    
    .articl .art {width: 100%;} /* Занимает 100% ширины */
    
    .usermenu ul  {float: left; width: 46%; padding: 20px 0 0 2%;} /* ОРИГИНАЛЬНЫЕ 2 КОЛОНКИ */
    .usermenu li {     margin-bottom: 1px;}
    .usermenu a {       border-radius: 4px;}
    .usermenu h4 { display: none; }
    .usermenu { margin: 0 auto; overflow: hidden; /* clearfix для float */}
    
    .chat {width: 90%;}
    .sidebar { width: 100%; border: 0; min-height: 150px;}
    .msg {   flex-direction: column; }
    .checkboxes label { width: 100%; }
    
    .grid-2-col, .grid-3-col { grid-template-columns: 1fr; }
    .userprofil { flex-direction: column; align-items: flex-start; }
    .profile-actions-right { align-items: flex-start; width: 100%; }
    .balance-block { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* Стилевые правила для экранов с шириной от 481px до 960px */
@media (min-width: 481px) and (max-width: 960px) {
    .lefttopmenu a span {display: none;}
    .container { display: flex;  justify-content: center;}
    .leftblok {min-width: 28%;  padding-left: 20px; }
    .rightblok { max-width: 65%;   }
    
    /* 2 карточки в ряд с учетом gap 16px */
    .articl .art {width: calc(100% - 8px); } 
    
    .checkboxes label { width: 100%; }
}

/* Стилевые правила для экранов с шириной от 961px до 1200px */
@media (min-width: 961px) and (max-width: 1200px) {
    .lefttopmenu a span {display: none;}
    .leftblok {min-width: 20%; }
    
    /* 3 карточки в ряд с учетом gap 16px */
    .articl .art {width: calc(100% - 8px);}
    
    .checkboxes label { width: 50%; }
}

/* Стилевые правила для экранов с шириной от 1201px и выше */
@media (min-width: 1201px) {
    .leftblok {min-width: 15%; }
    
    /* 4 карточки в ряд с учетом gap 16px */
    .articl .art {width: calc(50% - 8px);}
    
    .checkboxes label { width: 30%; }
}

/* =========================================================
   АДАПТИВНОСТЬ ЛИЧНЫХ СООБЩЕНИЙ (МЕССЕНДЖЕР)
   ========================================================= */

/* Легкая тень для пузырей сообщений, чтобы они выглядели объемнее */
.message-content {
    box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

/* Мобильная версия чата (экраны до 960px) */
@media (max-width: 960px) {
    
    /* Главный контейнер чата */
    .settings-section[style*="height: 70vh"] {
        flex-direction: column !important;
        height: calc(100vh - 80px) !important; /* Чат занимает почти весь экран */
        min-height: 500px !important;
    }

    /* Список диалогов (левая колонка) */
    .sidebar[style*="width: 35%"] {
        width: 100% !important;
        max-height: 220px !important; /* На мобильном список занимает только верхнюю часть */
        border-right: none !important;
        border-bottom: 2px solid var(--color-border) !important;
        flex-shrink: 0;
    }

    /* Окно активной переписки (правая колонка) */
    .sidebar[style*="width: 35%"] + div {
        width: 100% !important;
        flex: 1 !important; /* Занимает всё оставшееся место внизу */
        height: auto !important;
    }

    /* Окно ввода сообщения и кнопка отправки */
    .message-form {
        gap: 8px !important;
    }
    .message-input {
        min-height: 44px !important;
        padding: 10px 14px !important;
    }
    .send-button {
        padding: 0 16px !important;
        height: 44px !important;
        border-radius: 16px !important;
    }
}