:root {
  --paper: #f3ecdc;
  --paper-dark: #e6dcc4;
  --ink: #2e2519;
  --soft-ink: #6b5f4e;
  --red: #8e2c1f;
  --line: #c8b89b;
  --module: #efe4ce;
  --shadow: rgba(49, 33, 15, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.55), transparent 38%),
    linear-gradient(180deg, #d9c9a7, #efe7d4 24%, #e8ddc6 100%);
  font-family: Georgia, "Times New Roman", serif;
}

a {
  color: var(--red);
}

#container {
  width: min(1140px, calc(100vw - 32px));
  margin: 22px auto 40px;
  background: var(--paper);
  border: 1px solid #bba987;
  box-shadow: 0 22px 48px var(--shadow);
}

#banner {
  padding: 28px 32px 22px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0)),
    linear-gradient(90deg, #ceb98d, #efe2c5 42%, #c7b087);
}

#banner h1 {
  margin: 0 0 6px;
  font-size: clamp(2.3rem, 5vw, 3.9rem);
  letter-spacing: 0.03em;
}

#banner h1 a {
  color: #5f180f;
  text-decoration: none;
}

#banner p {
  margin: 0;
  color: var(--soft-ink);
}

#pagebody {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 230px;
  gap: 0;
}

.sidebar,
#content {
  min-width: 0;
  padding: 22px 24px 32px;
}

.sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(215, 197, 165, 0.35));
}

.sidebar.left {
  border-right: 1px solid var(--line);
}

.sidebar.right {
  border-left: 1px solid var(--line);
}

.module + .module {
  margin-top: 22px;
}

.module h2 {
  margin: 0 0 10px;
  padding-bottom: 6px;
  font-size: 1rem;
  color: #5e4534;
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.module p,
.module li,
.entry-footer,
.archive-head p,
.empty-comments,
.comment-meta {
  color: var(--soft-ink);
}

.link-list,
.archive-list,
.popular-posts {
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-list li + li,
.archive-list li + li,
.popular-posts li + li {
  margin-top: 8px;
}

.archive-list li,
.popular-posts li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.archive-list li.active a {
  font-weight: bold;
}

.entry {
  padding: 0 0 24px;
  margin-bottom: 24px;
  border-bottom: 1px dotted var(--line);
}

.entry:last-child {
  margin-bottom: 0;
}

.entry-header {
  margin: 0 0 14px;
  font-size: clamp(1.6rem, 3vw, 2rem);
  line-height: 1.15;
}

.entry-header a {
  text-decoration: none;
}

.entry-body p,
.comment-body p {
  margin: 0 0 1em;
  line-height: 1.74;
  font-size: 1.05rem;
}

.entry-single .entry-body p:first-child::first-letter {
  float: left;
  margin: 0 10px 0 0;
  font-size: 3.6rem;
  line-height: 0.9;
  color: var(--red);
}

.entry-footer {
  font-size: 0.95rem;
}

.separator {
  margin: 0 8px;
  color: #9f8e75;
}

.entry-image {
  margin: 0 0 22px;
  padding: 8px;
  border: 1px solid var(--line);
  background: #faf5ea;
}

.entry-image img {
  display: block;
  max-width: 100%;
  height: auto;
}

.comments {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 2px solid var(--line);
}

.comment {
  padding: 14px 0;
  border-bottom: 1px dotted var(--line);
}

.comment-meta {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.archive-head {
  margin-bottom: 24px;
}

.archive-head h2 {
  margin: 0 0 6px;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
}

.stats-page {
  padding: 20px;
}

.stats-header,
.stats-main {
  max-width: 1240px;
  margin: 0 auto;
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 20px;
}

.stats-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

button,
.stats-actions a {
  border: 1px solid #7e6651;
  background: #f4ead6;
  color: var(--ink);
  padding: 10px 14px;
  text-decoration: none;
  cursor: pointer;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.summary-card,
.stats-panel {
  background: rgba(244, 234, 214, 0.92);
  border: 1px solid #c9b896;
  box-shadow: 0 14px 30px rgba(65, 44, 20, 0.08);
}

.summary-card {
  padding: 16px;
}

.summary-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--soft-ink);
}

.summary-card strong {
  font-size: 2rem;
}

.stats-panel {
  padding: 18px;
  margin-bottom: 14px;
}

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

.stats-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

.overall-chart-svg {
  width: 100%;
  height: auto;
}

.overall-chart-svg line {
  stroke: #9d876c;
}

.overall-chart-svg text {
  fill: #6e5946;
  font-size: 13px;
  font-family: Georgia, "Times New Roman", serif;
}

.grid-line {
  stroke: #d8cab0;
  stroke-dasharray: 4 4;
}

.chart-area {
  fill: rgba(142, 44, 31, 0.14);
}

.chart-line {
  fill: none;
  stroke: #8e2c1f;
  stroke-width: 4;
}

.overall-chart-svg circle {
  fill: #8e2c1f;
}

.chart-legend {
  font-size: 14px;
  font-weight: 700;
}

.bar-row {
  margin-bottom: 14px;
}

.bar-row-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.bar-row-meta span {
  color: var(--soft-ink);
}

.bar-track {
  height: 12px;
  background: #e5d8bf;
  border: 1px solid #ccb995;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #8e2c1f, #b86a3f);
}

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

.stats-table th,
.stats-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #d8cab0;
  text-align: left;
}

@media (max-width: 960px) {
  #pagebody,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .sidebar.left,
  .sidebar.right {
    border: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  #container {
    width: min(100vw - 16px, 1140px);
  }

  #banner,
  .sidebar,
  #content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .stats-page {
    padding: 12px;
  }

  .stats-header {
    align-items: start;
    flex-direction: column;
  }
}
