.flash { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 12px auto; }
.product-bar { background: var(--navy); color: var(--gold-2); font-size: .82rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 8px 0; }
.is-forum .product-bar { background: var(--green); color: #f6efe2; }
.is-chat .product-bar { background: #1a2744; color: var(--gold-2); }

.forum-wrap { max-width: 960px; }
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 16px;
}
.crumbs a { color: var(--red); }
.forum-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.forum-toolbar .sec { margin: 6px 0 8px; }
.forum-toolbar .sec-lead { margin: 0; }
.forum-toolbar .btn { flex-shrink: 0; }
.forum-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}
.forum-cat {
  background: var(--red-deep);
  color: var(--gold-2);
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.forum-table { width: 100%; border-collapse: collapse; }
.forum-table th,
.forum-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.forum-table thead th {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper);
  font-weight: 800;
}
.forum-table tbody tr:last-child td { border-bottom: 0; }
.forum-table tbody tr:hover { background: rgba(246, 239, 226, .55); }
.forum-table .col-num {
  width: 88px;
  text-align: center;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.forum-table .col-last { width: 220px; }
.forum-table .col-last a {
  display: block;
  font-weight: 700;
  color: var(--ink);
  max-width: 28ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.forum-table .col-last a:hover { color: var(--red); }
.forum-table .col-last small,
.topic-meta {
  display: block;
  margin-top: 4px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
}
.forum-board {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.forum-board strong { display: block; color: var(--ink); font-size: 1.02rem; }
.forum-board small { display: block; margin-top: 3px; color: var(--muted); font-weight: 600; }
.forum-board:hover strong { color: var(--red); }
.forum-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--red-deep);
  font-weight: 800;
  border: 1px solid var(--line);
}
.topic-link {
  font-weight: 800;
  color: var(--ink);
  font-size: 1.02rem;
}
.topic-link:hover { color: var(--red); }
.hot-dot {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--red-deep);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.forum-empty { margin: 8px 0; color: var(--muted); }

.fpost {
  display: grid;
  grid-template-columns: 140px 1fr;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.fpost__side {
  padding: 18px 14px;
  background: var(--paper);
  text-align: center;
  border-right: 1px solid var(--line);
}
.fpost__side strong { display: block; margin-top: 8px; font-size: .92rem; }
.fpost__side small { color: var(--muted); font-weight: 700; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--red-deep);
  color: var(--gold-2);
  font-weight: 800;
  font-size: 1.2rem;
  border: 2px solid var(--gold);
}
.fpost__main { padding: 16px 18px 18px; min-width: 0; }
.fpost__meta {
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.fpost__body { white-space: pre-wrap; line-height: 1.6; }
.fpost-reply { padding-bottom: 8px; }
.fpost-reply .form { padding: 12px 16px 8px; }

.composer-wrap { max-width: 720px; }
.composer {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.composer__head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px 18px;
  background:
    radial-gradient(280px 120px at 0% 0%, rgba(212, 180, 90, .18), transparent 70%),
    var(--paper);
  border-bottom: 1px solid var(--line);
}
.composer__head img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
  flex-shrink: 0;
}
.composer__head .kicker { margin: 0 0 4px; }
.composer__head h1 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 6px;
  letter-spacing: -.03em;
}
.composer__head p { margin: 0; color: var(--muted); font-size: .95rem; max-width: 46ch; }
.composer__form { padding: 8px 24px 22px; }
.composer__field { margin: 14px 0; }
.composer__field label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: .82rem;
  font-weight: 800;
  margin: 0 0 6px;
}
.composer__field label span { font-weight: 600; color: var(--muted); font-size: .75rem; }
.composer__field input,
.composer__field select,
.composer__field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: var(--paper);
  color: var(--ink);
}
.composer__field input:focus,
.composer__field select:focus,
.composer__field textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(212, 180, 90, .25);
}
.composer__field textarea { min-height: 220px; resize: vertical; line-height: 1.55; }
.composer__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.composer--auth .composer__field textarea { min-height: 0; }

.forum-boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 12px; }
.thread { background:#fff; border:1px solid var(--line); border-radius:14px; padding:14px 16px; margin-bottom:10px; }
.thread h3 { margin:0 0 6px; font-size:1.05rem; }
.thread .hot-tags { margin: 6px 0 0; }
.chat-layout { display:grid; grid-template-columns: 200px 1fr; gap:16px; min-height:60vh; }
.chat-rooms { background:#fff; border:1px solid var(--line); border-radius:16px; padding:12px; }
.chat-rooms a { display:block; padding:8px 10px; border-radius:8px; color:var(--ink); font-weight:700; }
.chat-rooms a.is-on { background:var(--paper-2); color:var(--red); }
.chat-log { background:#fff; border:1px solid var(--line); border-radius:16px; padding:14px; display:flex; flex-direction:column; min-height:420px; }
.chat-msgs { flex:1; overflow:auto; display:flex; flex-direction:column; gap:10px; }
.chat-msg small { color:var(--muted); font-weight:700; }
.chat-form { display:flex; gap:8px; margin-top:12px; }
.chat-form input { flex:1; }

.admin { display:grid; grid-template-columns: 240px 1fr; min-height:100vh; background: var(--paper); }
.admin-aside { background: var(--red-deep); color:#f3ead8; padding:18px 14px; }
.admin-aside a { display:block; color:#f3ead8; padding:8px 10px; border-radius:8px; font-weight:700; }
.admin-aside a.active, .admin-aside a:hover { background: rgba(255,255,255,.1); color:#fff; }
.admin-aside .aside-label { font-size:11px; letter-spacing:.12em; text-transform:uppercase; opacity:.7; margin:16px 0 6px; }
.admin-main { padding:28px 24px 60px; }
.admin-main table { width:100%; border-collapse:collapse; background:#fff; border-radius:12px; overflow:hidden; }
.admin-main th, .admin-main td { text-align:left; padding:10px 12px; border-bottom:1px solid var(--line); font-size:.9rem; }
.dash-stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:12px; margin:18px 0 28px; }
.dash-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; margin:22px 0; }
.dash-card {
  display:block; background:#fff; border:1px solid var(--line); border-radius:16px;
  padding:16px 18px; box-shadow: var(--shadow); color:inherit; text-decoration:none;
}
.dash-card small { display:block; font-size:11px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; color:var(--red); margin-bottom:6px; }
.dash-card strong { display:block; font-size:1.05rem; margin-bottom:6px; }
.dash-card span { display:block; color:var(--muted); font-size:.88rem; }
.dash-card:hover { border-color: var(--gold); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-actions form { margin: 0; }
.admin-form input, .admin-form textarea, .admin-form select { width:100%; margin-bottom:10px; }
.repeat-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:8px; }
.quote-edit {
  display: grid;
  grid-template-columns: 1.4fr .7fr .9fr .9fr;
  gap: 8px;
  margin-bottom: 10px;
}
.quote-edit textarea { min-height: 72px; }

@media (max-width: 960px) {
  .chat-layout, .admin, .dash-stats, .repeat-row, .quote-edit { grid-template-columns: 1fr; }
  .admin-aside { display:flex; flex-wrap:wrap; gap:6px; }
  .admin-aside a { width:auto; }
  .forum-toolbar { flex-direction: column; align-items: flex-start; }
  .forum-table thead { display: none; }
  .forum-table,
  .forum-table tbody,
  .forum-table tr,
  .forum-table td { display: block; width: 100%; }
  .forum-table td { padding: 12px 16px 4px; border-bottom: 0; }
  .forum-table tr { padding: 8px 0 12px; border-bottom: 1px solid var(--line); }
  .forum-table tbody tr:last-child { border-bottom: 0; }
  .forum-table .col-num {
    display: inline-block;
    width: auto;
    margin-right: 14px;
    padding-top: 0;
  }
  .forum-table .col-num::before { content: attr(data-label) " "; font-weight: 700; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
  .forum-table .col-last { width: auto; padding-bottom: 12px; }
  .forum-table .col-last a { max-width: none; white-space: normal; }
  .fpost { grid-template-columns: 1fr; }
  .fpost__side {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
  }
  .fpost__side strong { margin-top: 0; }
  .avatar { width: 40px; height: 40px; font-size: 1rem; }
  .composer__head { flex-direction: column; padding: 18px 16px 14px; }
  .composer__form { padding: 4px 16px 18px; }
  .composer__foot { flex-direction: column-reverse; align-items: stretch; }
  .composer__foot .btn, .composer__foot .more { width: 100%; }
}
