/* YDK — design inspired by reference screenshot */
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;background:#1a1715;color:#eee;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%}

/* ==== Layout: hero + sidebar ==== */
.layout{display:grid;grid-template-columns:1fr 320px;gap:0;max-width:1240px;margin:24px auto 0;padding:0 24px;border-radius:8px;overflow:hidden;box-shadow:0 30px 80px rgba(0,0,0,.45)}
@media(max-width:900px){.layout{grid-template-columns:1fr;padding:0 12px;margin-top:12px}}

/* Hero */
.hero{position:relative;min-height:px;background:#222 center/cover no-repeat;color:#fff;display:flex;flex-direction:column;justify-content:space-between;padding:24px 28px}
.hero-top{display:flex;justify-content:space-between;align-items:center}
.brand{font-size:18px;font-weight:600;letter-spacing:.5px;display:flex;gap:8px;align-items:center}
.brand span{font-weight:700}
.hero-actions{display:flex;gap:10px}
.circle-btn{width:36px;height:36px;border-radius:50%;border:0;background:rgba(255,255,255,.18);color:#fff;cursor:pointer;backdrop-filter:blur(4px);font-size:16px;position:relative}
.circle-btn.dot::after{content:"";position:absolute;top:6px;right:6px;width:8px;height:8px;background:#ff5252;border-radius:50%}
.hero-body{margin-top:auto}
.hero-title{font-size:48px;font-weight:300;margin:0 0 18px;text-shadow:0 2px 18px rgba(0,0,0,.4);letter-spacing:.5px}
@media(max-width:600px){.hero-title{font-size:32px}}
.hero-meta{display:flex;gap:14px;align-items:center;margin-bottom:24px}
.pill{display:inline-flex;align-items:center;gap:8px;padding:8px 14px;border-radius:30px;background:rgba(0,0,0,.28);font-size:13px;border:1px solid rgba(255,255,255,.18)}
.hero-foot{display:flex;justify-content:space-between;align-items:center;border-top:1px solid rgba(255,255,255,.15);padding-top:16px;margin-top:16px}
.avatars{display:flex;align-items:center}
.avatars img{width:32px;height:32px;border-radius:50%;border:2px solid rgba(255,255,255,.4);margin-left:-8px;object-fit:cover}
.avatars img:first-child{margin-left:0}
.avatar-more{display:inline-flex;width:32px;height:32px;border-radius:50%;background:rgba(255,255,255,.2);align-items:center;justify-content:center;margin-left:-8px;font-size:14px}
.hero-loc{font-size:12px;letter-spacing:2px;opacity:.85}
.hero-loc .pin-icon{display:inline-flex;width:24px;height:24px;border-radius:50%;background:rgba(255,255,255,.18);align-items:center;justify-content:center;margin-left:8px}

/* Sidebar */
.sidebar{background:rgba(60,55,55,.75);backdrop-filter:blur(12px);padding:22px 22px 18px;color:#f4f0ec;position:relative}
.close-btn{position:absolute;top:14px;right:14px;width:28px;height:28px;border-radius:50%;border:0;background:rgba(255,255,255,.15);color:#fff;cursor:pointer}
.profile{text-align:center;padding-top:6px}
.avatar-lg{width:88px;height:88px;border-radius:50%;margin:0 auto 12px;object-fit:cover;border:3px solid rgba(255,255,255,.2)}
.profile h3{margin:0;font-weight:500;font-size:18px}
.profile p{margin:4px 0 0;font-size:12px;opacity:.7}
.divider{height:1px;background:rgba(255,255,255,.12);margin:18px 0}
.browse-label{font-size:11px;letter-spacing:2px;color:#bca99a;margin-bottom:8px}
.nav a{display:flex;align-items:center;gap:14px;padding:10px 12px;border-radius:6px;font-size:13px;letter-spacing:1.5px;color:#e8e0d8;margin:2px 0;transition:.2s}
.nav a span{width:18px;text-align:center;opacity:.7}
.nav a:hover{background:rgba(255,255,255,.06)}
.nav a.active{background:rgba(255,255,255,.1);box-shadow:inset 0 0 0 1px rgba(255,255,255,.06)}
.nav a em{margin-left:auto;font-style:normal;font-size:11px;opacity:.6}
.search{display:flex;margin-top:18px;background:rgba(255,255,255,.95);border-radius:6px;overflow:hidden}
.search input{flex:1;border:0;padding:10px 12px;background:transparent;color:#333;outline:none;font-size:13px}
.search button{border:0;background:transparent;padding:0 14px;color:#888;cursor:pointer}
.auth-links{display:flex;flex-direction:column;gap:8px;align-items:center;font-size:13px}
.auth-links .muted{opacity:.6}
.btn{display:inline-block;background:#d68a5b;color:#fff;border:0;padding:10px 18px;border-radius:6px;font-size:13px;cursor:pointer;letter-spacing:.5px}
.btn:hover{background:#c87a4b}

/* ==== Grid of pins ==== */
.grid{max-width:1240px;margin:24px auto;padding:0 24px;display:grid;grid-template-columns:repeat(4,1fr);gap:18px}
@media(max-width:1100px){.grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:780px){.grid{grid-template-columns:repeat(2,1fr);padding:0 12px;gap:12px}}
@media(max-width:480px){.grid{grid-template-columns:1fr}}
.card{position:relative;background:#3a3330;border-radius:6px;overflow:hidden;box-shadow:0 6px 20px rgba(0,0,0,.35);transition:transform .25s ease}
.card:hover{transform:translateY(-3px)}
.card>a img{width:100%;aspect-ratio:3/4;object-fit:cover;display:block}
.like{position:absolute;top:10px;left:10px;background:rgba(0,0,0,.35);color:#fff;border:0;padding:6px 10px;border-radius:20px;font-size:19px;cursor:pointer;display:inline-flex;align-items:center;gap:6px;backdrop-filter:blur(4px)}
.like .heart{color:#fff;opacity:.85}
.like.on .heart{color:#ff5151;opacity:1}
.card-avatar{position:absolute;top:8px;right:10px;width:30px;height:30px;border-radius:50%;border:2px solid rgba(255,255,255,.7);object-fit:cover}
.card-body{position:absolute;bottom:0;left:0;right:0;padding:14px 14px 12px;background:linear-gradient(180deg,transparent,rgba(0,0,0,.7));color:#fff}
.card-body h4{margin:0 0 4px;font-weight:400;font-size:18px}
.card-body .meta{font-size:10px;letter-spacing:2px;opacity:.7}
.empty{grid-column:1/-1;text-align:center;padding:40px;opacity:.7}

/* Footer */
.site-footer{background:#1f1c1a;color:#9a8d83;text-align:center;padding:20px 20px 20px;margin-top:30px;font-size:21px;font-weight: 600;line-height:1.7}
.logo-mark{margin-top:16px;font-size:22px;opacity:.6}

/* Auth pages & pin page */
.auth-page{max-width:420px;margin:60px auto;background:rgba(60,55,55,.75);padding:30px;border-radius:8px;color:#fff}
.auth-page h1{margin-top:0;font-weight:300}
.auth-page form{display:flex;flex-direction:column;gap:10px}
.auth-page input,.auth-page textarea,.auth-page select{padding:10px 12px;border-radius:6px;border:1px solid rgba(255,255,255,.15);background:rgba(0,0,0,.3);color:#fff;font-size:14px}
.auth-page textarea{min-height:80px;resize:vertical}
.auth-page p{font-size:13px;opacity:.8}
.auth-page .err{background:#7a2b2b;padding:8px 12px;border-radius:4px}

.pin-page{max-width:1100px;margin:30px auto;padding:0 20px}
.pin-page .back{opacity:.7;font-size:13px}
.pin-grid{display:grid;grid-template-columns:1.2fr 1fr;gap:24px;margin-top:16px;background:rgba(60,55,55,.55);border-radius:8px;overflow:hidden}
@media(max-width:780px){.pin-grid{grid-template-columns:1fr}}
.pin-grid img{width:100%;height:100%;object-fit:cover;max-height:600px}
.pin-info{padding:24px}
.pin-info h1{margin-top:0;font-weight:300}
.pin-info .muted{opacity:.7;font-size:13px}
.comments{list-style:none;padding:0;margin:12px 0;display:flex;flex-direction:column;gap:8px}
.comments li{background:rgba(0,0,0,.25);padding:8px 12px;border-radius:6px;font-size:14px}
.comment-form{display:flex;flex-direction:column;gap:8px;margin:10px 0}
.comment-form textarea{min-height:60px;background:rgba(0,0,0,.3);color:#fff;border:1px solid rgba(255,255,255,.15);border-radius:6px;padding:8px}

/* Mobile menu */
.menu-toggle{display:none;position:fixed;top:16px;right:16px;z-index:50;width:42px;height:42px;border-radius:50%;border:0;background:rgba(0,0,0,.55);color:#fff;font-size:20px;cursor:pointer}
@media(max-width:900px){
  .menu-toggle{display:block}
  .sidebar{position:fixed;inset:0 0 0 auto;width:300px;max-width:85vw;z-index:40;transform:translateX(105%);transition:transform .3s ease;overflow-y:auto}
  .sidebar.open{transform:translateX(0)}
  .layout{display:block;box-shadow:none}
  .hero{border-radius:8px}
}

/* Admin */
.admin{max-width:1200px;margin:30px auto;padding:0 20px;color:#eee}
.admin-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}
.admin-head h1{font-weight:300;margin:0}
.admin-msg{background:#3a5a3a;padding:10px 14px;border-radius:6px;margin-bottom:16px}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:20px}
.stats>div{background:rgba(60,55,55,.7);padding:18px;border-radius:8px;text-align:center}
.stats b{display:block;font-size:28px;font-weight:300}
.stats span{font-size:11px;letter-spacing:1.5px;opacity:.7}
.admin-tabs{display:flex;gap:6px;margin-bottom:14px;border-bottom:1px solid rgba(255,255,255,.12)}
.admin-tabs a{padding:10px 16px;font-size:13px;letter-spacing:1px;opacity:.6;border-bottom:2px solid transparent}
.admin-tabs a.active{opacity:1;border-color:#d68a5b}
.admin-table{width:100%;border-collapse:collapse;background:rgba(60,55,55,.5);border-radius:8px;overflow:hidden;font-size:13px}
.admin-table th,.admin-table td{padding:10px 12px;text-align:left;border-bottom:1px solid rgba(255,255,255,.06);vertical-align:middle}
.admin-table th{background:rgba(0,0,0,.3);font-weight:500;font-size:11px;letter-spacing:1px;text-transform:uppercase}
.admin-table .thumb{width:54px;height:54px;object-fit:cover;border-radius:4px}
.btn-del,.btn-edit{padding:6px 10px;border-radius:4px;border:0;font-size:12px;cursor:pointer;color:#fff;margin-right:4px}
.btn-del{background:#9b3b3b}.btn-del:hover{background:#b54848}
.btn-edit{background:#3b6b9b}.btn-edit:hover{background:#4880b5}
@media(max-width:780px){.stats{grid-template-columns:repeat(2,1fr)}.admin-table{font-size:12px}.admin-table th,.admin-table td{padding:6px 8px}}

/* ==== Pinterest 2.0: профиль, коллекции ==== */
.avatar-placeholder{display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.1);font-size:34px;color:#d68a5b}
.edit-link{display:inline-block;margin-top:8px;font-size:11px;letter-spacing:1.5px;color:#d68a5b;border-bottom:1px dashed rgba(214,138,91,.5);padding-bottom:1px}
.edit-link:hover{color:#fff;border-color:#fff}

.profile-page,.collections-page{max-width:980px;margin:30px auto;padding:0 20px;color:#eee}
.profile-page .back,.collections-page .back{opacity:.7;font-size:13px}
.profile-card{text-align:center;padding:30px 20px;background:rgba(60,55,55,.55);border-radius:10px;margin:16px 0 24px}
.avatar-xl{width:140px;height:140px;border-radius:50%;object-fit:cover;border:4px solid rgba(255,255,255,.15);margin:0 auto 14px}
.profile-card h1{margin:0;font-weight:300;font-size:30px}
.profile-card .muted{opacity:.7;font-size:14px;margin-top:4px}
.profile-stats{display:flex;justify-content:center;gap:40px;margin-top:18px}
.profile-stats b{display:block;font-size:24px;font-weight:300}
.profile-stats span{font-size:11px;letter-spacing:2px;opacity:.6}

.profile-edit{background:rgba(60,55,55,.55);padding:24px;border-radius:10px}
.profile-edit h2{font-weight:300;margin-top:0}
.profile-edit form{display:flex;flex-direction:column;gap:12px}
.profile-edit label{display:flex;flex-direction:column;gap:6px;font-size:12px;letter-spacing:1.5px;color:#bca99a}
.profile-edit input[type=text],.profile-edit input:not([type=file]):not([type=submit]){padding:10px 12px;border-radius:6px;border:1px solid rgba(255,255,255,.15);background:rgba(0,0,0,.3);color:#fff;font-size:14px}
.profile-edit input[type=file]{padding:8px 0;color:#ccc;font-size:13px}
.profile-edit .btn{align-self:flex-start;margin-top:6px}
.ok{background:#3a5a3a;padding:8px 12px;border-radius:4px;margin:0 0 12px}
.err{background:#7a2b2b;padding:8px 12px;border-radius:4px;margin:0 0 12px}

.col-head h1{font-weight:300;margin:18px 0 4px}
.col-head .muted{opacity:.7}
.col-create{display:flex;gap:8px;flex-wrap:wrap;background:rgba(60,55,55,.55);padding:14px;border-radius:8px;margin:18px 0}
.col-create input{flex:1;min-width:160px;padding:10px 12px;border-radius:6px;border:1px solid rgba(255,255,255,.15);background:rgba(0,0,0,.3);color:#fff;font-size:13px}
.col-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
@media(max-width:780px){.col-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:480px){.col-grid{grid-template-columns:1fr}}
.col-tile{background:rgba(60,55,55,.55);border-radius:8px;overflow:hidden;padding-bottom:10px;display:flex;flex-direction:column}
.col-tile a{display:block}
.col-cover{aspect-ratio:4/3;background:#222 center/cover no-repeat;display:flex;align-items:center;justify-content:center;color:#666;font-size:12px;letter-spacing:2px}
.col-tile h3{margin:10px 14px 2px;font-weight:400;font-size:16px}
.col-tile .muted{margin:0 14px;font-size:12px;opacity:.6}
.col-tile form{margin:8px 14px 0}

.save-box{background:rgba(0,0,0,.25);padding:14px;border-radius:8px;margin:14px 0}
.save-box h3{margin:0 0 8px;font-weight:400;font-size:14px;letter-spacing:1px;text-transform:uppercase;opacity:.8}
.save-form{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.save-form select,.save-form input{padding:8px 10px;border-radius:6px;border:1px solid rgba(255,255,255,.15);background:rgba(0,0,0,.3);color:#fff;font-size:13px}
.save-form .or{font-size:12px;opacity:.6}

.save-btn{position:absolute;top:10px;right:50px;background:#d68a5b;color:#fff;font-size:11px;padding:5px 10px;border-radius:20px;letter-spacing:.5px;opacity:0;transition:.2s}
.card:hover .save-btn{opacity:1}

.card-remove{position:absolute;top:8px;right:8px}
.card-remove button{background:rgba(0,0,0,.6);color:#fff;border:0;width:26px;height:26px;border-radius:50%;cursor:pointer;font-size:14px}

/* Переопределение для Premium-вида */
body {
    font-family: 'Playfair Display', serif;
    background: #1a1715; /* Глубокий темный */
    color: #e8e0d8;
}

/* Верхняя панель */
.top-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 70px;
    background: rgba(26, 23, 21, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(214, 138, 91, 0.15);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-container {
    max-width: 1400px !important; /* Точно такая же ширина, как у контента */
    width: 100% !important;
    padding: 0 24px !important;   /* Такие же отступы по краям */
    margin: 0 auto !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 22px;
    font-weight: 700;
    color: #d68a5b; /* Медный акцент */
    letter-spacing: 2px;
}

.nav-search {
    flex: 0 1 600px;
    display: flex;
    background: rgba(255,255,255,0.05);
    border-radius: 30px;
    padding: 5px 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

.nav-search input {
    background: transparent;
    border: 0;
    color: #fff;
    padding: 8px;
    width: 100%;
    outline: none;
}

/* Контентная область */
.main-content {
    margin-top: 100px; /* Отступ под шапку */
    min-height: 80vh;
}

/* Раздвигаем сетку и макет */
.layout {
    display: flex;
    max-width: 1700px;
    width: 96%;
    margin: 0 auto;
    gap: 30px;
    box-shadow: none; /* Убираем лишние тени */
    background: transparent;
}

.hero {
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(145deg, #2a2522, #161412);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    
    /* ДОБАВИТЬ ЭТИ 3 СТРОКИ: */
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Кнопки и формы */
.btn-gold {
    background: linear-gradient(135deg, #d68a5b 0%, #a3633d 100%);
    color: #fff;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 600;
    transition: 0.3s;
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(214, 138, 91, 0.4);
}

/* Сетка пинов */
.grid {
    max-width: 1700px;
    width: 96%;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

/* Исправление карточек */
.card {
    background: #231f1d;
    border: 1px solid rgba(255,255,255,0.03);
}

.nav-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #d68a5b;
}
/* Возвращаем правильную ширину главному блоку */
.layout {
    display: grid !important;
    grid-template-columns: 1fr 320px !important; /* Левая часть тянется, правая фиксирована 320px */
    max-width: 1400px !important; 
    width: 100% !important;
    margin: 0 auto !important;
    gap: 24px !important;
    padding: 0 24px !important;
}

.hero {
    width: 100% !important;
    border-radius: 12px !important;
}

.sidebar {
    border-radius: 12px !important;
    height: max-content !important; /* Чтобы панель не тянулась вниз до бесконечности */
}
/* Фикс иконок в шапке */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}
.nav-actions a { color: #e8e0d8; text-decoration: none; }

/* ---- Дизайн формы в стиле Pinterest ---- */
.pin-create-container {
    max-width: 900px;
    margin: 40px auto;
    background: #231f1d;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.pin-create-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
}
@media (max-width: 768px) {
    .pin-create-grid { grid-template-columns: 1fr; }
}

/* Левая часть: Зона загрузки картинки */
.upload-dropzone {
    background: #2f2a27;
    border: 2px dashed rgba(255,255,255,0.15);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 450px;
    position: relative;
    cursor: pointer;
    transition: 0.3s;
    text-align: center;
}
.upload-dropzone:hover {
    background: #36302d;
    border-color: #d68a5b;
}
.upload-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 10;
}
.upload-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    display: none;
    z-index: 5;
}
.upload-icon {
    width: 40px; height: 40px;
    background: #d68a5b;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff; margin-bottom: 15px;
}

/* Правая часть: Поля ввода */
.upload-fields {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.upload-fields input[type="text"], 
.upload-fields textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    font-size: 16px;
    padding: 10px 0;
    border-radius: 0;
    outline: none;
}
.upload-fields input[type="text"]:focus,
.upload-fields textarea:focus {
    border-bottom-color: #d68a5b;
}
.upload-fields .title-input {
    font-size: 36px;
    font-weight: 600;
}
.upload-fields .title-input::placeholder { color: rgba(255,255,255,0.2); }

/* Иконки в шапке и красная точка уведомлений */
.nav-icon {
    position: relative;
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.nav-icon:hover {
    transform: scale(1.1);
}
.dot-badge::after {
    content: "";
    position: absolute;
    top: -2px;
    right: -4px;
    width: 8px;
    height: 8px;
    background: #ff5252;
    border-radius: 50%;
    border: 2px solid #1a1715; /* Обводка цвета фона шапки, чтобы не сливалось */
}
/* Единая ширина и выравнивание для шапки, главного блока и сетки пинов */
.nav-container, 
.layout, 
.grid {
    max-width: 1600px !important; /* Широкий, современный размер */
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 40px !important;   /* Одинаковые отступы от краев экрана */
    box-sizing: border-box !important;
}

/* Сетка карточек внизу: растягиваем по ширине без дыр */
.grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 24px !important;
    margin-top: 24px !important;
}
.notif-dropdown {
    position: absolute;
    top: 50px;
    right: -10px;
    width: 320px;
    background: #2a2522;
    border: 1px solid rgba(214, 138, 91, 0.2);
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: 0.3s;
    z-index: 1000;
}
.notif-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.notif-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-weight: 600;
    color: #fff;
}
.notif-body {
    padding: 10px;
    max-height: 350px;
    overflow-y: auto;
}
/* Фикс для кликабельной аватарки на карточке */
.card-avatar-link {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 32px;
    height: 32px;
    z-index: 10;
    display: block;
}
.card-avatar-link .card-avatar {
    position: static !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
}
.notif-body a:hover {
    background: rgba(255,255,255,0.05);
}
/* Модалка для увеличения картинки */
.img-modal {
    position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.9);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: 0.3s;
    cursor: zoom-out;
}
.img-modal.show { opacity: 1; visibility: visible; }
.img-modal .modal-content {
    max-width: 95%; max-height: 95vh; border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

/* Оформление комментариев */
.comments-list { display: flex; flex-direction: column; gap: 15px; margin-top: 15px; }
.comment-item { display: flex; gap: 12px; background: rgba(0,0,0,0.2); padding: 12px; border-radius: 8px; }
.comment-avatar { width: 12px; height: 12px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255,255,255,0.1); }
.comment-content { flex: 1; }
.comment-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.comment-author { font-weight: 600; color: #d68a5b; font-size: 14px; text-decoration: none; }
.comment-author:hover { text-decoration: underline; }
.comment-date { font-size: 11px; opacity: 0.5; }
.comment-text { font-size: 13px; line-height: 1.4; color: #eee; }

/* Жесткая фиксация аватарок и дизайна в комментариях */
.comment-item {
    display: flex !important;
    gap: 12px !important;
    background: rgba(0,0,0,0.2) !important;
    padding: 12px !important;
    border-radius: 8px !important;
    margin-bottom: 12px !important;
}

/* Контейнер-ссылка вокруг аватарки: запрещаем ему растягиваться */
.comment-item > a {
    flex: 0 0 40px !important; 
    width: 40px !important;
    height: 40px !important;
    display: block !important;
}

/* Сама аватарка */
.comment-avatar {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    margin: 0 !important;
}

/* Текстовая часть комментария */
.comment-content {
    flex: 1 !important;
    min-width: 0 !important; /* Защита от вылезания длинного текста */
}

.comment-head {
    display: flex !important;
    justify-content: space-between !important;
    align-items: baseline !important;
    margin-bottom: 6px !important;
}

.comment-author {
    font-weight: 600 !important; 
    color: #d68a5b !important; 
    font-size: 14px !important; 
    text-decoration: none !important;
}

.comment-author:hover {
    text-decoration: underline !important;
}

.comment-date {
    font-size: 11px !important; 
    opacity: 0.5 !important; 
}

.comment-text {
    font-size: 13px !important; 
    line-height: 1.4 !important; 
    color: #eee !important; 
    margin: 0 !important;
    word-wrap: break-word !important; /* Перенос длинных слов, чтобы не ломать верстку */
}
/* Экран загрузки генерации */
.ai-loader-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 10, 12, 0.95);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.4s;
}
.ai-loader-overlay.active {
    opacity: 1;
    visibility: visible;
}
.loader-content {
    text-align: center;
    color: #fff;
}
.magic-star {
    font-size: 60px;
    color: #d68a5b;
    margin-bottom: 20px;
    animation: magicPulse 2s infinite ease-in-out;
}
@keyframes magicPulse {
    0% { transform: scale(1) rotate(0deg); text-shadow: 0 0 10px #d68a5b; }
    50% { transform: scale(1.3) rotate(20deg); text-shadow: 0 0 30px #d68a5b; }
    100% { transform: scale(1) rotate(0deg); text-shadow: 0 0 10px #d68a5b; }
}
.loader-content h2 { font-weight: 300; letter-spacing: 2px; margin-bottom: 10px; }
.loader-content p { opacity: 0.6; font-size: 14px; }

/* Пульсация иконки в самой форме */
.upload-icon.pulse {
    animation: softPulse 3s infinite;
}
@keyframes softPulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}
/* Обновленная зона загрузки для референса */
.upload-dropzone {
    border: 2px dashed rgba(214, 138, 91, 0.3);
    transition: 0.3s;
    position: relative;
    overflow: hidden;
    min-height: 300px;
}
.upload-dropzone:hover {
    border-color: #d68a5b;
    background: rgba(214, 138, 91, 0.05);
}
#upload-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 20px;
}

/* Премиальный стиль для главного заголовка */
.hero-premium-title {
    font-size: 42px !important;       /* Увеличиваем, но делаем тоньше */
    font-weight: 300 !important;      /* Тонкое, изящное начертание */
    line-height: 1.2 !important;      /* Расстояние между строками */
    letter-spacing: -0.5px !important;/* Слегка сужаем буквы для элегантности */
    color: #f8f3ef !important;        /* Мягкий белый с теплым оттенком */
    text-shadow: 0 4px 20px rgba(0,0,0,0.8) !important; /* Глубокая тень для читаемости на любом фоне */
    max-width: 80% !important;        /* Чтобы текст не бился в края экрана */
    margin-bottom: 15px !important;
}

/* Если экран маленький (телефон), делаем шрифт меньше */
@media (max-width: 768px) {
    .hero-premium-title {
        font-size: 28px !important;
        max-width: 100% !important;
    }
}
/* Кнопка применения промпта на странице пина */
.btn-apply-prompt {
    background: transparent;
    color: #d68a5b;
    border: 1px solid #d68a5b;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-family: 'Playfair Display', serif;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-apply-prompt:hover {
    background: #d68a5b;
    color: #fff;
    box-shadow: 0 4px 15px rgba(214, 138, 91, 0.3);
}

/* ==== БЛОК ДЛЯ ДЛИННЫХ ПРОМПТОВ ==== */
.prompt-box {
    max-height: 250px; /* Максимальная высота окошка */
    overflow-y: auto;  /* Включаем вертикальный скролл */
    background: rgba(0, 0, 0, 0.25);
    padding: 16px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
    line-height: 1.6;
    color: #e8e0d8;
    margin: 8px 0 24px 0;
    white-space: pre-wrap; /* Сохраняем переносы строк абзацев */
    word-break: break-word;
    letter-spacing: 0.5px;
}

/* Красивый кастомный ползунок только для этого блока */
.prompt-box::-webkit-scrollbar {
    width: 6px;
}
.prompt-box::-webkit-scrollbar-track {
    background: transparent;
}
.prompt-box::-webkit-scrollbar-thumb {
    background: rgba(214, 138, 91, 0.3); /* Полупрозрачный медный */
    border-radius: 10px;
}
.prompt-box::-webkit-scrollbar-thumb:hover {
    background: rgba(214, 138, 91, 0.7);
}
/* =========================================
   МОБИЛЬНАЯ АДАПТАЦИЯ (Экраны до 768px)
   ========================================= */
@media (max-width: 768px) {
    /* 1. Чиним премиум-шапку: Логотип и Кнопка сверху, Поиск снизу */
    .top-nav {
        height: auto !important; /* Убираем жесткие 70px, чтобы шапка могла расти вниз */
        padding: 10px 0 !important;
    }
    
    .nav-container {
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        padding: 0 15px !important;
    }
    
    .nav-brand {
        white-space: nowrap !important;
        font-size: 20px !important;
        flex-shrink: 0 !important;
    }
    
    /* Форма поиска падает на 2 строку и занимает 100% ширины */
    .nav-search {
        flex-basis: 100% !important;
        order: 3 !important;
        margin-top: 15px !important;
        margin-bottom: 5px !important;
    }
    
    /* Сдвигаем контент ниже, так как шапка стала выше из-за двух строк */
    .main-content {
        margin-top: 130px !important; 
    }

    /* 2. Чиним Главный баннер (Hero) */
    .hero {
        min-height: 450px !important;
        padding: 30px 15px !important;
        background-position: center !important;
    }
    
    .hero-premium-title {
        font-size: 26px !important;
        word-break: break-word !important;
        white-space: normal !important;
        width: 100% !important;
        max-width: 100% !important;
        line-height: 1.3 !important;
    }

    /* 3. Сетка пинов и контент */
    .layout {
        display: flex !important;
        flex-direction: column !important;
        padding: 0 15px !important;
    }
    
    .sidebar {
        width: 100% !important;
        border-left: none !important;
        border-top: 1px solid rgba(255,255,255,0.05);
        margin-top: 20px;
        padding-top: 20px;
    }

    /* На телефонах делаем пины в 1 колонку */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        padding: 0 15px !important;
    }

    /* 4. Футер */
    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .footer-separator {
        display: none !important;
    }
}
/* --- ПРЕМИАЛЬНЫЕ ИКОНКИ В ШАПКЕ --- */
.header-icons-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 15px;
    padding: 0 15px;
    border-left: 1px solid rgba(255, 255, 255, 0.05); /* Легкие разделители */
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.header-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03); /* Едва заметный фон */
    color: #bca99a; /* Приглушенный текст */
    text-decoration: none;
    font-size: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Эффект при наведении мышки */
.header-icon-btn:hover {
    background: rgba(214, 138, 91, 0.1);
    color: #d68a5b; /* Наш фирменный золотой */
    border-color: rgba(214, 138, 91, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(214, 138, 91, 0.15); /* Мягкое золотое свечение */
}

/* Отдельный акцент для кнопки плюса (Создать) */
.header-icon-btn.icon-accent {
    color: #d68a5b;
    border-color: rgba(214, 138, 91, 0.3);
}