.forum-page { max-width: 1440px; margin: 0 auto; padding: 20px 12px 48px; color: #1e293b; }
.forum-page *, .forum-page *::before, .forum-page *::after { box-sizing: border-box; }
.forum-page a { color: #075985; }
.forum-page a:hover { color: #0c4a6e; }
.forum-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 26px 30px; margin: 0 0 24px; color: #e2e8f0; background: linear-gradient(125deg, #122033, #164e63); border-radius: 18px; box-shadow: 0 12px 30px rgba(15, 23, 42, .12); }
.forum-hero h1 { margin: 5px 0 6px; color: #fff !important; font-size: clamp(28px, 4vw, 38px); line-height: 1.15; }
.forum-hero p { margin: 0; color: #cbd5e1; }
.forum-eyebrow { color: #a5f3fc; font-size: 11px; font-weight: 800; letter-spacing: 1.4px; }
.forum-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.forum-layout { display: block; }
.forum-categories { padding: 17px; margin: 0 0 22px; border: 1px solid #dbe4ef; border-radius: 14px; background: #fff; }
.forum-categories h2 { margin: 0 0 12px; font-size: 18px; }
.forum-category-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.forum-category-list > a { display: flex; min-height: 48px; flex-direction: column; justify-content: center; gap: 4px; padding: 9px 12px; border: 1px solid #e2e8f0; border-radius: 9px; color: #334155; text-decoration: none; }
.forum-category-list > a[aria-current="page"], .forum-category-list > a:hover { border-color: #bae6fd; background: #eff6ff; color: #075985; }
.forum-category-list > a[aria-current="page"] { font-weight: 700; box-shadow: inset 3px 0 #0284c7; }
.forum-categories small { color: #64748b; font-size: 11px; font-weight: 400; line-height: 1.4; }
.forum-content { min-width: 0; }
.forum-panel { padding: 22px; margin: 0 0 18px; border: 1px solid #dbe4ef; border-radius: 14px; background: #fff; box-shadow: 0 4px 16px rgba(15, 23, 42, .035); }
.forum-panel h2 { margin: 0 0 14px; font-size: 21px; line-height: 1.3; }
.forum-button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; padding: 8px 14px; border: 1px solid #0369a1; border-radius: 9px; background: #0369a1; color: #fff !important; font: inherit; font-size: 13px; font-weight: 700; text-decoration: none !important; cursor: pointer; }
.forum-button:hover { border-color: #075985; background: #075985; color: #fff !important; }
.forum-button-light { border-color: rgba(255,255,255,.55); background: rgba(255,255,255,.1); }
.forum-button-light:hover { background: rgba(255,255,255,.2); }
.forum-button-muted { border-color: #cbd5e1; background: #f8fafc; color: #334155 !important; }
.forum-button-muted:hover { background: #e2e8f0; color: #0f172a !important; }
.forum-button-danger { border-color: #fecaca; background: #fff7f7; color: #b91c1c !important; }
.forum-button-danger:hover { border-color: #b91c1c; background: #b91c1c; color: #fff !important; }
.forum-alert { padding: 13px 16px; margin: 0 0 18px; border: 1px solid; border-radius: 10px; }
.forum-alert-success { border-color: #a7f3d0; background: #ecfdf5; color: #065f46; }
.forum-alert-error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.forum-form { display: grid; gap: 9px; margin: 12px 0; }
.forum-form label, .forum-search label { margin: 2px 0 0; color: #334155; font-size: 13px; font-weight: 700; }
.forum-form input, .forum-form textarea, .forum-form select, .forum-search input { width: 100%; min-width: 0; min-height: 40px; padding: 9px 11px; margin: 0; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #0f172a; font: inherit; }
.forum-form textarea { resize: vertical; line-height: 1.6; }
.forum-form input:focus, .forum-form textarea:focus, .forum-form select:focus, .forum-search input:focus { border-color: #0284c7; outline: 3px solid rgba(14, 165, 233, .16); }
.forum-form > button { justify-self: start; margin-top: 4px; }
.forum-category-form { grid-template-columns: minmax(90px, .35fr) minmax(0, 1fr); align-items: center; gap: 10px; }
.forum-category-form > button { grid-column: 2; justify-self: start; }
.forum-category-row { padding: 12px 0; border-top: 1px solid #e2e8f0; }
.forum-category-row > form:last-child { margin-top: 8px; }
.forum-muted { color: #64748b; font-size: 12px; line-height: 1.6; }
.forum-empty { padding: 25px; text-align: center; color: #64748b; }
.forum-empty h3 { margin: 0 0 8px; color: #334155; }
.forum-topic-modal { width: min(620px, calc(100% - 28px)); max-width: 620px; max-height: min(90vh, 820px); padding: 24px; overflow-y: auto; border: 1px solid #dbe4ef; border-radius: 18px; background: #fff; color: #1e293b; box-shadow: 0 24px 80px rgba(15, 23, 42, .3); }
.forum-topic-modal::backdrop { background: rgba(15, 23, 42, .66); backdrop-filter: blur(3px); }
.forum-topic-modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.forum-topic-modal-header h2 { margin: 6px 0 0; font-size: 23px; }
.forum-modal-close { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid #cbd5e1; border-radius: 50%; background: #f8fafc; color: #334155; font-size: 25px; line-height: 1; cursor: pointer; }
.forum-topic-modal .forum-form { grid-template-columns: 1fr; margin-top: 18px; }
.forum-topic-modal .forum-alert { margin-top: 16px; }
.forum-topic-modal[open] { animation: forum-modal-in .16s ease-out; }
@keyframes forum-modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.forum-search { display: grid; gap: 7px; margin: 0 0 20px; }
.forum-search > div { display: flex; gap: 8px; }
.forum-search input { flex: 1; }
.forum-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 12px; }
.forum-section-heading h2 { margin: 0; font-size: 20px; }
.forum-count { padding: 3px 10px; border-radius: 99px; background: #eaf3fb; color: #075985; font-size: 12px; font-weight: 700; white-space: nowrap; }
.forum-topic-row { display: flex; align-items: center; gap: 16px; padding: 18px; margin: 0 0 10px; border: 1px solid #dbe4ef; border-radius: 12px; background: #fff; }
.forum-topic-row-closed { border-color: #b91c1c; background: linear-gradient(115deg, #ef4444 0%, #b91c1c 58%, #7f1d1d 100%); color: #fff; box-shadow: 0 8px 22px rgba(185, 28, 28, .16); }
.forum-topic-closed { border-color: #b91c1c; background: linear-gradient(115deg, #ef4444 0%, #b91c1c 58%, #7f1d1d 100%); color: #fff; }
.forum-topic-closed .forum-message, .forum-topic-closed .forum-topic-byline, .forum-topic-closed .forum-edit > summary { color: #fff; }
.forum-topic-closed .forum-author-identity strong { color: #fff; }
.forum-topic-closed .forum-category-badge { border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.16); color: #fff !important; }
.forum-topic-row-main { flex: 1; min-width: 0; }
.forum-topic-flags, .forum-topic-heading .forum-category-badge { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.forum-category-badge, .forum-status { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 99px; background: #e0f2fe; color: #075985 !important; font-size: 11px; font-weight: 700; text-decoration: none; }
.forum-status-pinned { background: #fef3c7; color: #92400e !important; }
.forum-status-closed { background: #e2e8f0; color: #334155 !important; }
.forum-status-deleted { background: #fee2e2; color: #991b1b !important; }
.forum-topic-row h3 { margin: 8px 0 5px; font-size: 17px; line-height: 1.45; overflow-wrap: anywhere; }
.forum-topic-row h3 a { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: #0f172a; text-decoration: none; }
.forum-topic-row h3 a > span:last-child, .forum-topic-heading h2 > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.forum-topic-row h3 a:hover { color: #0369a1; }
.forum-topic-row p { margin: 0 0 9px; color: #475569; font-size: 13px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.forum-topic-row-meta { display: flex; flex-wrap: wrap; gap: 7px 13px; color: #64748b; font-size: 11px; }
.forum-author-meta { display: inline-flex; align-items: center; gap: 6px; }
.forum-avatar { width: 25px; height: 25px; flex: 0 0 25px; border: 1px solid #dbe4ef; border-radius: 50%; object-fit: cover; background: #f1f5f9; }
.forum-avatar-large { width: 42px; height: 42px; flex-basis: 42px; }
.forum-topic-icon { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.forum-title-status { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 99px; background: #fef3c7; color: #92400e; font-size: 10px; font-weight: 800; line-height: 1.4; white-space: nowrap; }
.forum-title-status svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.forum-title-closed { background: #fee2e2; color: #991b1b; }
.forum-title-deleted { background: #e2e8f0; color: #334155; }
.forum-topic-row-count { display: flex; flex: 0 0 72px; flex-direction: column; align-items: center; color: #64748b; font-size: 11px; }
.forum-topic-row-count strong { color: #0f172a; font-size: 20px; }
.forum-topic-row-count span { text-align: center; }
.forum-moderation { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.forum-moderation form, .forum-inline-action { margin: 0; }
.forum-moderation .forum-button, .forum-inline-action .forum-button { min-height: 32px; padding: 5px 9px; font-size: 11px; }
.forum-pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 15px; margin: 20px 0; color: #475569; font-size: 13px; }
.forum-pagination a, .forum-back { color: #075985; font-weight: 700; }
.forum-back { display: inline-block; margin: 0 0 14px; text-decoration: none; }
.forum-topic-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.forum-topic-heading h2 { margin: 11px 0 0; font-size: clamp(22px, 3.5vw, 30px); overflow-wrap: anywhere; }
.forum-topic-heading h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.forum-topic-byline { display: grid; gap: 4px; flex: 0 0 auto; color: #64748b; font-size: 12px; text-align: right; }
.forum-topic-byline { grid-template-columns: 42px minmax(0, 1fr); align-items: center; text-align: left; }
.forum-topic-byline .forum-avatar { grid-row: span 2; }
.forum-author-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.forum-author-identity strong { color: #0f172a; overflow-wrap: anywhere; }
.forum-rank-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1px solid transparent; border-radius: 99px; font-size: 10px; font-weight: 800; line-height: 1.3; white-space: nowrap; }
.forum-rank-badge svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.forum-rank-administrator { border-color: #c4b5fd; background: #ede9fe; color: #5b21b6; }
.forum-rank-vip { border-color: #fcd34d; background: #fef3c7; color: #854d0e; }
.forum-rank-moderator { border-color: #bfdbfe; background: #dbeafe; color: #1e40af; }
.forum-rank-member { border-color: #cbd5e1; background: #f1f5f9; color: #475569; }
.forum-message { margin: 18px 0; color: #334155; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.forum-edit, .forum-reply { margin-top: 12px; }
.forum-edit > summary, .forum-reply > summary { display: inline-block; color: #075985; font-size: 12px; font-weight: 700; cursor: pointer; }
.forum-edit .forum-form, .forum-reply .forum-form { max-width: 760px; margin: 12px 0; }
.forum-comment { padding: 17px 0; border-top: 1px solid #e2e8f0; }
.forum-comment-reply { margin-left: clamp(12px, 3vw, 32px); padding-left: 15px; border-left: 3px solid #dbeafe; }
.forum-comment-header { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; color: #64748b; font-size: 12px; }
.forum-comment-header strong { color: #0f172a; font-size: 13px; }
.forum-comment-header .forum-avatar { margin-right: 1px; }
.forum-comment-header time { margin-left: auto; }
.forum-comment .forum-message { margin: 10px 0; }
.forum-new-comment { padding-top: 20px; border-top: 1px solid #dbe4ef; }
.forum-access-note { padding: 13px 15px; border-radius: 9px; background: #eff6ff; }
.forum-page a:focus-visible, .forum-page button:focus-visible, .forum-page summary:focus-visible { outline: 3px solid #0ea5e9; outline-offset: 3px; }
@media (max-width: 900px) {
  .forum-category-list { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
}
@media (max-width: 600px) {
  .forum-page { padding: 12px 7px 30px; }
  .forum-hero { align-items: flex-start; flex-direction: column; padding: 21px; border-radius: 13px; }
  .forum-panel { padding: 16px; }
  .forum-topic-row { align-items: flex-start; flex-wrap: wrap; padding: 14px; }
  .forum-topic-row-main { flex-basis: calc(100% - 72px); }
  .forum-topic-row-count { order: 1; }
  .forum-topic-row > .forum-moderation { flex-basis: 100%; order: 2; }
  .forum-topic-heading { flex-direction: column; gap: 10px; }
  .forum-topic-byline { display: flex; flex-wrap: wrap; text-align: left; }
  .forum-topic-byline time { margin-left: 5px; }
  .forum-category-form { grid-template-columns: 1fr; }
  .forum-category-form > button { grid-column: 1; }
  .forum-search > div { align-items: stretch; flex-direction: column; }
  .forum-topic-modal { padding: 19px; border-radius: 14px; }
}
.forum-topic-row-closed .forum-topic-row-main, .forum-topic-row-closed h3 a, .forum-topic-row-closed h3 a:hover, .forum-topic-row-closed p, .forum-topic-row-closed .forum-topic-row-meta, .forum-topic-row-closed .forum-topic-row-count, .forum-topic-row-closed .forum-topic-row-count strong { color: #fff; }
.forum-topic-row-closed .forum-category-badge { border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.16); color: #fff !important; }
.forum-topic-row-closed .forum-title-status { background: rgba(255,255,255,.92); }
@media (prefers-reduced-motion: reduce) {
  .forum-topic-modal[open] { animation: none; }
}
