:root {
  --bg: #f4f7fb;
  --panel: #fff;
  --text: #172033;
  --muted: #607086;
  --line: #dbe4ef;
  --blue: #1463ff;
  --green: #0f9f6e;
  --amber: #b7791f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.topbar,
.brand-row,
.shell,
.footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar nav,
.main-nav,
.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 15px 0;
}

.brand {
  display: grid;
  grid-template-columns: 46px auto;
  gap: 10px;
  min-width: 270px;
  color: var(--text);
}

.brand span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}

.brand strong { font-size: 20px; }
.brand em { color: var(--muted); font-size: 12px; font-style: normal; }

.main-nav { flex: 1; }
.main-nav a { color: #334155; font-weight: 700; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.button.secondary {
  color: var(--blue);
  background: #eef5ff;
}

.shell { padding: 22px 0; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr);
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #eef7ff);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
}

h1 { margin: 0 0 12px; font-size: 34px; line-height: 1.15; }
h2 { margin: 0 0 12px; font-size: 22px; }
h3 { margin: 0 0 10px; }

.hero p,
.lead {
  color: var(--muted);
  font-size: 17px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-stats {
  display: grid;
  gap: 10px;
}

.hero-stats article,
.widget,
.panel,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.hero-stats article {
  padding: 14px;
}

.hero-stats strong {
  display: block;
  color: var(--blue);
  font-size: 28px;
}

.hero-stats span,
.topic-row span,
.category span,
.meta,
.reply span {
  color: var(--muted);
  font-size: 13px;
}

.notice {
  margin: 16px 0;
  padding: 12px 14px;
  color: #4a3412;
  background: #fff8e6;
  border-color: #f0d28a;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
}

.main,
.stack,
.sidebar,
.replies {
  display: grid;
  gap: 12px;
}

.panel,
.widget {
  padding: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.category,
.topic-row,
.news-card {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdff;
}

.category strong,
.topic-row strong {
  display: block;
  color: var(--text);
}

.topic-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.topic-row em {
  flex: 0 0 auto;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.widget dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 0;
}

.widget dt { color: var(--muted); }
.widget dd { margin: 0; font-weight: 900; }

.thread .lead {
  white-space: pre-line;
}

.reply {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  color: #fff;
  background: var(--green);
  font-weight: 900;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table-scroll { overflow-x: auto; }

.auth {
  max-width: 720px;
  margin: 0 auto;
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.content {
  margin-top: 18px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0 34px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

[dir="rtl"] th,
[dir="rtl"] td {
  text-align: right;
}

@media (max-width: 860px) {
  .brand-row,
  .topbar,
  .footer,
  .topic-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero,
  .layout,
  .category-grid {
    grid-template-columns: 1fr;
  }

  h1 { font-size: 28px; }
}
