:root {
  --bg: #ffffff;
  --ink: #000000;
  --muted: #666666;
  --line: #cccccc;
  --soft: #eeeeee;
  --blue: #0066cc;
  --link: #0033cc;
  --bar: #f0f0f0;
  --amber: #ffcc66;
  --amber-b: #e8a800;
  --max: 960px;
  --font: Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 13px; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.35;
  display: flex;
  flex-direction: column;
}
a { color: var(--link); text-decoration: underline; }
a:hover { color: #cc0000; }
.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 10px;
}

/* ===== TOP BAR ===== */
.topbar {
  background: var(--bar);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.topbar-inner {
  display: table;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 4px 10px;
}
.top-left, .top-right {
  display: table-cell;
  vertical-align: middle;
  white-space: nowrap;
}
.top-right { text-align: right; }
.top-left span { color: var(--muted); margin-right: 4px; }
.top-left a, .top-right a {
  text-decoration: none;
  margin-right: 8px;
}
.top-left a:hover, .top-right a:hover { text-decoration: underline; }
.btn-amber {
  display: inline-block;
  background: var(--amber);
  border: 1px solid var(--amber-b);
  color: #000 !important;
  font-weight: bold;
  font-size: 12px;
  padding: 2px 8px;
  text-decoration: none !important;
  cursor: pointer;
  font-family: var(--font);
}
.btn-amber:hover { filter: brightness(0.97); }
.btn-sm {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--line);
  color: #000 !important;
  font-size: 12px;
  padding: 2px 8px;
  text-decoration: none !important;
  cursor: pointer;
  font-family: var(--font);
}

/* ===== MAIN ===== */
.main { flex: 1; padding: 12px 0 24px; }
.messages { list-style: none; margin: 0 0 10px; padding: 0; }
.messages li {
  padding: 6px 8px;
  margin-bottom: 4px;
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
}
.messages li.error { background: #ffebee; border-color: #ffcdd2; }

/* ===== HOME: ROW 1 — rating | activity (table layout = LI) ===== */
.li-row1 {
  display: table;
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 4px;
}
.li-row1-left,
.li-row1-right {
  display: table-cell;
  vertical-align: top;
  width: 50%;
}
.li-row1-left { padding-right: 20px; }
.li-row1-right { padding-left: 20px; border-left: 1px solid var(--soft); }

.sec-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: bold;
  color: #333;
  line-height: 1.4;
}
.sec-title .btn-amber { margin-left: 8px; vertical-align: middle; }
.sec-note {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--muted);
}

/* categories 3 cols — like LI */
.cat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.cat-table td {
  width: 33.33%;
  padding: 1px 8px 1px 0;
  vertical-align: top;
}
.cat-table a { text-decoration: none; }
.cat-table a:hover { text-decoration: underline; }

/* lists */
.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.plain-list li {
  display: table;
  width: 100%;
  padding: 2px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 12px;
}
.plain-list .n {
  display: table-cell;
  width: 22px;
  color: var(--muted);
  font-weight: bold;
  vertical-align: top;
}
.plain-list .t {
  display: table-cell;
  vertical-align: top;
}
.plain-list .t a {
  text-decoration: none;
  color: var(--link);
}
.plain-list .t a:hover { text-decoration: underline; color: #c00; }
.plain-list .h {
  display: table-cell;
  text-align: right;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
  vertical-align: top;
  padding-left: 8px;
}
.growth { font-size: 10px; margin-left: 3px; }
.growth.up { color: #008800; }
.growth.down { color: #aa0000; }

/* ===== HOME: ROW 2 — logo + search (centered band) ===== */
.li-row2 {
  margin: 18px 0 16px;
  padding: 14px 0;
  border-top: 1px solid var(--soft);
  border-bottom: 1px solid var(--soft);
  text-align: left;
}
.li-row2-inner {
  display: table;
  width: 100%;
}
.li-logo-cell {
  display: table-cell;
  vertical-align: middle;
  width: 200px;
  white-space: nowrap;
  padding-right: 16px;
}
.logo {
  font-size: 28px;
  font-weight: normal;
  color: #999999;
  text-decoration: none !important;
  letter-spacing: -0.5px;
}
.logo span { color: var(--blue); font-weight: bold; }
.li-search-cell {
  display: table-cell;
  vertical-align: middle;
}
.search-form {
  display: flex;
  width: 100%;
  max-width: 480px;
  align-items: stretch;
}
.search-form input {
  flex: 1;
  min-width: 0;
  border: 2px solid var(--blue);
  border-right: 0;
  padding: 7px 10px;
  font: inherit;
  outline: none;
  margin: 0;
}
.search-form button {
  flex: 0 0 auto;
  background: var(--blue);
  color: #fff;
  border: 2px solid var(--blue);
  padding: 7px 16px;
  font-weight: bold;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
}
.search-hint {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

/* ===== HOME: ROW 3 — 3 equal columns ===== */
.li-row3 {
  display: table;
  width: 100%;
  table-layout: fixed;
  margin-top: 4px;
}
.li-col {
  display: table-cell;
  vertical-align: top;
  width: 33.33%;
  padding-right: 18px;
}
.li-col:last-child { padding-right: 0; }
.li-col h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: bold;
  color: #444;
  border-bottom: 1px solid var(--soft);
  padding-bottom: 3px;
}
.rate-line {
  font-size: 12px;
  margin: 3px 0;
}
.rate-line b { color: #222; }
.more-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
}

/* ===== INNER PAGES ===== */
.block-head {
  display: table;
  width: 100%;
  margin-bottom: 6px;
}
.block-head h1 {
  display: table-cell;
  margin: 0;
  font-size: 15px;
  font-weight: bold;
  color: #333;
  vertical-align: middle;
}
.block-head .tools {
  display: table-cell;
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}
.period-tabs a, .cat-pills a {
  display: inline-block;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--link);
  text-decoration: none;
  border: 1px solid transparent;
  margin: 1px;
}
.period-tabs a.on, .cat-pills a.on {
  background: #e8f0fe;
  border-color: var(--line);
  font-weight: bold;
  color: #000;
}
.cat-pills { margin: 6px 0 10px; }
.sub {
  font-size: 13px;
  margin: 14px 0 6px;
  font-weight: bold;
  color: #333;
  border-bottom: 1px solid var(--soft);
  padding-bottom: 2px;
}
.muted { color: var(--muted); font-size: 11px; }

.stat-cards {
  display: table;
  width: 100%;
  table-layout: fixed;
  border: 1px solid var(--line);
  border-collapse: collapse;
  margin: 10px 0;
}
.stat-card {
  display: table-cell;
  text-align: center;
  padding: 10px 6px;
  background: #fafafa;
  border-right: 1px solid var(--line);
  width: 25%;
}
.stat-card:last-child { border-right: 0; }
.stat-card .n {
  font-size: 18px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}
.stat-card .l { font-size: 10px; color: var(--muted); margin-top: 2px; }

.two-col {
  display: table;
  width: 100%;
  table-layout: fixed;
}
.two-col > div {
  display: table-cell;
  vertical-align: top;
  width: 50%;
  padding-right: 16px;
}
.two-col > div:last-child { padding-right: 0; padding-left: 16px; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  font-size: 12px;
}
.data-table th, .data-table td {
  padding: 4px 7px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}
.data-table th {
  background: #f5f5f5;
  font-size: 11px;
  font-weight: bold;
  color: #444;
}
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tr:hover td { background: #fafafa; }

.chart-bars {
  display: table;
  width: 100%;
  height: 72px;
  table-layout: fixed;
  border-bottom: 1px solid var(--line);
  margin: 10px 0;
}
.chart-bars .bar-cell {
  display: table-cell;
  vertical-align: bottom;
  padding: 0 1px;
  height: 72px;
}
.chart-bars .bar {
  display: block;
  background: var(--blue);
  width: 100%;
  opacity: 0.85;
  min-height: 2px;
}

.form-card {
  max-width: 360px;
  border: 1px solid var(--line);
  padding: 12px;
  background: #fafafa;
}
.form-card label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: bold;
}
.form-card input, .form-card select, .form-card textarea {
  display: block;
  width: 100%;
  margin-top: 3px;
  padding: 5px 6px;
  border: 1px solid #aaa;
  font: inherit;
  font-weight: normal;
}
.form-card ul.errorlist {
  color: #c00;
  font-size: 11px;
  margin: 0;
  padding-left: 14px;
  font-weight: normal;
}
.code-box {
  background: #f5f5f5;
  border: 1px solid var(--line);
  padding: 8px;
  margin: 8px 0;
  overflow-x: auto;
}
.code-box pre {
  margin: 0 0 6px;
  font-size: 11px;
  font-family: Consolas, Monaco, monospace;
  white-space: pre-wrap;
  word-break: break-all;
}
.help-box {
  border: 1px solid var(--line);
  padding: 10px;
  margin: 10px 0;
  background: #fafafa;
  font-size: 12px;
}
.pager { margin: 12px 0; font-size: 12px; }
.pager a { margin-right: 8px; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bar);
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 12px 0;
  margin-top: auto;
  font-size: 11px;
}
.footer-inner {
  display: table;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 10px;
}
.footer-inner > div {
  display: table-cell;
  vertical-align: middle;
}
.footer-inner a { color: var(--link); margin-right: 10px; }
.footer-right { text-align: right; }

@media (max-width: 700px) {
  .li-row1, .li-row1-left, .li-row1-right,
  .li-row3, .li-col,
  .li-row2-inner, .li-logo-cell, .li-search-cell,
  .two-col, .two-col > div,
  .stat-cards, .stat-card {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
  }
  .li-row1-left { margin-bottom: 16px; }
  .li-row1-right { border-left: 0; border-top: 1px solid var(--soft); padding-top: 12px; }
  .li-col { margin-bottom: 14px; }
  .li-logo-cell { margin-bottom: 8px; }
  .stat-card {
    display: inline-block;
    width: 49%;
    border: 1px solid var(--line);
    margin: 0 0 2px;
  }
  .top-left, .top-right {
    display: block;
    text-align: left;
  }
  .top-right { margin-top: 4px; }
  .footer-inner > div { display: block; text-align: left !important; margin-bottom: 6px; }
}

.site-footer img { vertical-align: middle; }


.badge-grid {
  display: table;
  width: 100%;
  border-collapse: separate;
  border-spacing: 10px;
}
.badge-card {
  display: inline-block;
  width: 140px;
  vertical-align: top;
  border: 1px solid #ddd;
  background: #fafafa;
  padding: 12px 10px;
  text-align: center;
  margin: 0 8px 10px 0;
}
.badge-name {
  font-weight: bold;
  font-size: 12px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #444;
}

/* Favicons */
.favicon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 5px;
  border: 0;
  border-radius: 2px;
  flex-shrink: 0;
  image-rendering: -webkit-optimize-contrast;
}
.favicon-lg {
  width: 20px;
  height: 20px;
  margin-right: 6px;
}
.plain-list .t {
  display: table-cell;
  vertical-align: middle;
}
.plain-list .t a {
  vertical-align: middle;
}
.icon {
  display: inline-block;
  vertical-align: -2px;
  margin-right: 4px;
  fill: currentColor;
  color: #666;
}
.topbar .icon { color: #555; }
.sec-title .icon { color: #444; }
.site-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-title-row h1 {
  margin: 0;
  display: inline;
  font-size: 15px;
}
