/* Waper.ru — мобильный WAP-стиль, реконструкция */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: #ffffff;
    color: #111111;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 1.42;
}
img { border: 0; max-width: 100%; height: auto; }
a:link, a:visited { color: #225CB3; text-decoration: underline; }
a:hover { color: #ff0000; }
h1 { font-size: 1.25em; margin: 0 0 4px 0; }
hr { border-top: 1px #aaa dotted; border-bottom: 0; border-left: 0; border-right: 0; margin: 5px 0 3px 0; }
form, div, ol, ul, li { margin: 0; padding: 0; }
ul, ol { padding-left: 18px; }
small { font-size: 10px; }
p { margin: 6px 0; }

.page { background: #fff; max-width: 760px; margin: 0 auto; min-height: 100vh; }
@media (min-width: 800px) {
    body { background: #d7e2ec; }
    .page { box-shadow: 0 0 14px rgba(0, 0, 0, 0.18); }
}

/* Шапка */
div.tp {
    background-color: #5088b7;
    background-image: linear-gradient(#5f98c7, #5088b7 55%, #3d6f99);
    border-top: 1px solid #9ebfdb;
    border-bottom: 1px solid #36546f;
    color: #ffffff;
    font-weight: bold;
    padding: 4px 5px;
    font-size: 13px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}
div.tp h1 { margin: 0; font-size: 1em; }
div.tp a, div.tp a:visited { color: #f5da25; }
div.tp small { color: #e8f2fb; }

div.ad {
    padding: 4px 5px;
    color: #000;
    background-color: #fff5d7;
    border-bottom: 1px solid #86b3d9;
}
div.ad a { color: #225CB3; }

div.tpanel {
    padding: 4px 5px;
    background-color: #cbdeef;
    border-bottom: 1px solid #9ebfdb;
    color: #000;
}
div.mpanel {
    margin: 3px 0;
    padding: 4px 5px;
    background-color: #e9f2f9;
    border: 1px solid #cbdeef;
    border-radius: 3px;
}
div.box {
    margin: 4px 0;
    padding: 4px 5px;
    background-color: #cbdeef;
    border-radius: 4px;
}
div.body { padding: 4px 5px; }
div.cont { padding: 4px 5px; }
div.panel, div.bpanel {
    clear: both;
    padding: 4px 5px;
    background-color: #eaeaea;
    border-top: 1px solid #999;
    color: #000;
}
div.bpanel { border-bottom: 1px solid #cdcdcd; }
div.bhead {
    font-weight: bold;
    padding: 4px 5px;
    border-bottom: 2px solid #5088b7;
    background: #f7f9fb;
}
div.btm {
    clear: both;
    padding: 4px 5px;
    background-color: #cbdeef;
    border-top: 2px solid #333333;
}
div.btm a, div.btm a:visited { color: #1D67BB; }
div.footer {
    background: #eaeaea linear-gradient(#fdfdfd, #eaeaea);
    color: #999;
    padding: 5px;
    border-top: 1px solid #fff;
}
div.footer a, div.footer a:visited { color: #777; }
.footer-note { margin-top: 3px; color: #999; font-size: 10px; }

/* Списки */
div.rows .r0, div.forum .r0, div.topic .r0 { background-color: #eaeaea; }
div.rows .r1, div.forum .r1, div.topic .r1 { background-color: #ffffff; }
div.rows .r0, div.rows .r1, div.forum .r0, div.forum .r1,
div.topic .r0, div.topic .r1 {
    padding: 4px 5px;
    border-bottom: 1px solid #c9c9c9;
    word-wrap: break-word;
}
div.forum-cat {
    padding: 4px 5px;
    background: #dfeaf4;
    border-bottom: 1px solid #abc6dc;
    font-weight: bold;
}
div.topic div.r0h, div.topic div.r1h, .rows .r0h, .rows .r1h {
    background-color: #F5F2C4;
    border-bottom: 1px solid #999;
    padding: 4px 5px;
}
div.msgh {
    padding: 4px 5px;
    background-color: #eaeaea;
    border-top: 1px solid #d5d5d5;
    word-wrap: break-word;
}
div.comments .head {
    font-weight: bold;
    padding: 4px 5px;
    border-bottom: 2px solid #5088b7;
    background: #f7f9fb;
}
div.comments .r0, div.comments .r1 {
    padding: 4px 5px;
    border-bottom: 1px solid #c9c9c9;
    word-wrap: break-word;
}
div.comments .r0 { background-color: #eaeaea; }
div.comments .r1 { background-color: #fff; }
div.comments .b { margin-top: 3px; }
div.attachbox {
    margin-top: 4px;
    padding: 4px;
    background-color: #c5daed;
    border: 1px solid #86b3d9;
    border-radius: 3px;
}
div.replybox { margin-top: 3px; }
div.litebox {
    margin: 3px 0;
    border: 1px dotted #999;
    background-color: #fcfcfc;
    padding: 5px;
}
div.litebox del { background-color: #fcd8d8; }
ins { background-color: #c4ffc4; text-decoration: none; }
pre.syntax {
    margin: 3px 0;
    border: 1px dashed #999;
    background-color: #fcfcfc;
    padding: 5px;
    overflow: auto;
    white-space: pre-wrap;
}

/* Пагинация */
div.paginator {
    margin: 2px 5px 4px;
    color: #000;
    border-top: #eaeaea 3px solid;
    padding-top: 3px;
}
div.paginator a { margin: 0 1px; }
div.jump { margin-top: 2px; }
div.jump input[type="text"] { width: 45px; }

/* Цвета и статусы */
.gr { color: #909090; }
a.gr:link, a.gr:visited { color: #909090; }
.green { color: #00aa00; }
a.green:link, a.green:visited { color: #00aa00; }
.info { color: #ff8400; }
.online { color: #00aa00; font-weight: bold; }
.offline { color: #ee3c1f; font-weight: bold; }
.error, .attention { color: #ee3c1f; }
div.attention {
    color: #000;
    padding: 5px;
    margin: 4px 0;
    background-color: #fcd8d8;
    border: 1px solid #db8686;
    border-radius: 3px;
}
div.flash {
    width: 92%;
    max-width: 520px;
    margin: 5px auto;
    padding: 6px;
    text-align: center;
    background-color: #fff4b0;
    border: 1px solid #e4c17c;
    border-radius: 4px;
    font-weight: bold;
}
div.flash-success { background: #e4f8e4; border-color: #8ecf8e; color: #116611; }
div.flash-info { background: #e7f1fa; border-color: #9dbdda; color: #17466f; }
.error-code { font-size: 42px; font-weight: bold; color: #5088b7; margin-bottom: 6px; }

/* Звания */
.ti_blog { color: #a5643c; font-weight: bold; }
.ti_vip { color: #009e9b; font-weight: bold; }
.ti_res { color: #ef467e; font-weight: bold; }
.ti_c2 { color: #d98b3a; }
.ti_c3 { color: #d8730a; }
.ti_c4 { color: #d96c00; font-weight: bold; }
.ti_f2 { color: #8d55b5; }
.ti_f3 { color: #7a1fd0; }
.ti_f4 { color: #6d00d0; font-weight: bold; }
.ti_pers { color: #d00000; font-weight: bold; }
.rank { font-size: 10px; }

/* Формы */
input, textarea, select, button {
    font-family: inherit;
    font-size: 12px;
}
input[type="text"], input[type="password"], input[type="email"], input[type="date"],
input[type="file"], textarea, select {
    background: #fff;
    color: #111;
    border: 1px solid #9aa7b1;
    border-radius: 2px;
    padding: 3px 4px;
    max-width: 100%;
}
input[type="text"], input[type="password"], input[type="email"], input[type="date"] { width: 96%; }
textarea { width: 100%; resize: vertical; }
select { max-width: 100%; }
input[type="submit"], button, .btn {
    display: inline-block;
    background: #cbdeef linear-gradient(#eaf4fd, #cbdeef);
    border: 1px solid #7d9cb7;
    border-radius: 3px;
    color: #123a63;
    cursor: pointer;
    font-weight: bold;
    padding: 3px 8px;
    text-decoration: none;
}
input[type="submit"]:hover, button:hover, .btn:hover { background: #e5f1fb; color: #000; }
.inline { display: inline; }
.link-button {
    background: none;
    border: 0;
    color: #225CB3;
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    font-weight: normal;
    text-decoration: underline;
}
.link-button:hover { color: #ff0000; }

/* Пользователи */
.avatar { background: #eaeaea; border: 1px solid #9aa7b1; object-fit: cover; vertical-align: middle; }
.avatar-xs { width: 28px; height: 28px; }
.avatar-sm { width: 40px; height: 40px; float: left; margin-right: 6px; }
.avatar-md { width: 80px; height: 60px; }
.avatar-lg { width: 120px; height: 90px; }
.user-row { clear: both; padding: 5px 0; border-bottom: 1px dotted #c9c9c9; overflow: hidden; }
.user-row-main { overflow: hidden; }
.top-row { padding: 3px 0; border-bottom: 1px dotted #ccc; }
.top-num { display: inline-block; min-width: 26px; color: #5088b7; font-weight: bold; }
.profile-head { overflow: hidden; margin-bottom: 6px; }
.profile-head .avatar-lg { float: left; margin-right: 8px; }
.profile-head-info { overflow: hidden; }
.profile-actions { margin-top: 8px; padding-top: 6px; border-top: 1px dotted #999; }
.profile-actions .btn, .profile-actions form { margin: 2px 2px 2px 0; }

/* Флаги */
.flag {
    display: inline-block;
    min-width: 20px;
    padding: 0 2px;
    background: #eef3f7;
    border: 1px solid #a9bdcf;
    border-radius: 2px;
    color: #35546d;
    font-size: 9px;
    font-weight: bold;
    text-align: center;
    line-height: 12px;
    vertical-align: middle;
}

/* Иконки и смайлы */
.ico { vertical-align: middle; }
.smile { width: 16px; height: 16px; vertical-align: middle; }
.bb-img { max-width: 100%; height: auto; margin: 3px 0; border: 1px solid #d5d5d5; }
.bb-quote {
    margin: 4px 0;
    padding: 4px 6px;
    border-left: 3px solid #86b3d9;
    background: #f1f6fa;
    color: #333;
}
.quote-author { font-weight: bold; font-size: 10px; color: #666; }
.bb-spoiler { margin: 4px 0; border: 1px dashed #aaa; padding: 4px; background: #fafafa; }
.bb-spoiler summary { cursor: pointer; font-weight: bold; }
.bb-u { text-decoration: underline; }
.bb-s { text-decoration: line-through; }
.bb-center { text-align: center; }
.bb-left { text-align: left; }
.bb-right { text-align: right; }

/* Фото */
.photo-strip { display: flex; gap: 4px; overflow-x: auto; padding: 4px 5px; }
.photo-strip a { flex: 0 0 auto; }
.photo-strip img { width: 110px; height: 82px; object-fit: cover; border: 1px solid #9aa7b1; }
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 5px;
    padding: 5px;
}
.photo-grid-item {
    display: block;
    border: 1px solid #b9c9d7;
    background: #f4f7fa;
    padding: 2px;
    text-decoration: none;
    color: #225CB3;
}
.photo-grid-item img { display: block; width: 100%; height: 100px; object-fit: cover; }
.photo-grid-item span { display: block; padding: 2px; font-size: 10px; }
.photo-feed-item { padding: 6px 5px; border-bottom: 1px dotted #bbb; text-align: center; }
.photo-feed-item img { max-height: 320px; object-fit: contain; }
.photo-single img { display: block; margin: 0 auto 6px; max-height: 70vh; object-fit: contain; }
.photo-video { display: block; width: 100%; max-height: 70vh; background: #000; }
.photo-grid-item .photo-video { height: 100px; object-fit: cover; }
.photo-meta { margin-top: 5px; }
.photo-nav { margin: 6px 0; }

/* Файлы */
.file-row, .folder-row { padding: 4px 0; border-bottom: 1px dotted #ccc; }
.file-row .gr, .folder-row .gr { color: #888; }

/* Сообщения, заявки, уведомления */
.message-row, .request-row { padding: 5px 0; border-bottom: 1px dotted #ccc; }
.badge {
    display: inline-block;
    background: #ee3c1f;
    color: #fff;
    border-radius: 7px;
    padding: 0 5px;
    font-size: 9px;
    font-weight: bold;
    vertical-align: middle;
}
.message-body, .blog-post-body, .post-body { margin-top: 5px; word-wrap: break-word; }
.post-actions { margin-top: 4px; font-size: 10px; }

/* Чаты */
.chat-box { max-height: 65vh; overflow-y: auto; }
.chat-message { padding: 3px 0 4px; border-bottom: 1px dotted #e0e0e0; }
.chat-author { font-weight: bold; }
.chat-time { color: #909090; margin-left: 3px; font-size: 10px; }
.chat-text { margin-top: 1px; word-wrap: break-word; }

/* Цитатник */
.quote-box { margin: 6px 5px; padding: 10px; background: #f7f3e7; border: 1px solid #d8c9a4; border-radius: 4px; }
.quote-text { font-size: 15px; line-height: 1.5; font-style: italic; }
.quote-author { margin-top: 6px; text-align: right; }
.quote-meta { margin-top: 6px; font-size: 10px; color: #666; }
.quote-row { padding: 4px 0; border-bottom: 1px dotted #ccc; }

/* Админка */
.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 4px 5px;
    background: #eaeaea;
    border-bottom: 1px solid #bbb;
}
.admin-nav a {
    padding: 2px 7px;
    border: 1px solid #b9c9d7;
    background: #f7fbff;
    text-decoration: none;
    border-radius: 2px;
    font-size: 11px;
}
.admin-nav a.active { background: #5088b7; color: #fff; border-color: #36546f; }
.admin-tabs { padding: 5px; background: #eaeaea; border-bottom: 1px solid #bbb; }
.admin-tabs a { margin-right: 8px; }
.admin-tabs a.active { font-weight: bold; color: #000; text-decoration: none; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 4px; padding: 5px; }
.admin-stat { background: #eef4f9; border: 1px solid #c5daed; padding: 7px; text-align: center; }
.admin-stat b { font-size: 17px; color: #225CB3; }
.admin-stat small { color: #666; }
.admin-row { padding: 5px 0; border-bottom: 1px dotted #bbb; }
.admin-actions { margin-top: 3px; }

/* Прочее */
.section-label {
    padding: 4px 5px;
    background: #dfeaf4;
    border-top: 1px solid #c5daed;
    border-bottom: 1px solid #abc6dc;
    font-weight: bold;
    color: #234e75;
}
.home-nav a { font-weight: bold; }
.litebox input[type="text"] { width: 100%; }
.jump select { max-width: 90%; }
.hidden { display: none; }

@media (max-width: 480px) {
    .page { max-width: none; }
    .photo-grid { grid-template-columns: repeat(2, 1fr); }
    .photo-strip img { width: 92px; height: 70px; }
    .avatar-lg { width: 96px; height: 72px; }
    .admin-grid { grid-template-columns: repeat(2, 1fr); }
}
