:root {
  --bg-top: #efe4cf;
  --bg-bottom: #f7f3ea;
  --paper: rgba(255, 252, 247, 0.84);
  --paper-strong: #fffaf1;
  --ink: #2f241a;
  --muted: #6e5b48;
  --accent: #8b5e34;
  --accent-soft: #d8b78d;
  --edge: rgba(83, 58, 35, 0.12);
  --shadow: rgba(53, 35, 16, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(255, 248, 231, 0.9), transparent 38%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.page-shell {
  width: min(1080px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.page-shell.page-shell-wide {
  width: calc(100vw - 2rem);
  max-width: 1600px;
}

.hero {
  position: relative;
  overflow: hidden;
  margin: 0 0 1.5rem;
  padding: 2.2rem;
  border: 1px solid var(--edge);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(143, 96, 49, 0.18), rgba(255, 251, 243, 0.84)),
    var(--paper);
  box-shadow: 0 18px 48px var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -32% auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 94, 52, 0.18), transparent 68%);
  pointer-events: none;
}

.hero-kicker {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--accent);
}

.hero-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 0.95;
}

.hero-text {
  max-width: 46rem;
  margin: 1rem 0 0;
  font-size: 1.06rem;
  line-height: 1.6;
  color: var(--muted);
}

.content-shell {
  display: grid;
  gap: 1rem;
}

.panel {
  padding: 1.35rem;
  border: 1px solid var(--edge);
  border-radius: 22px;
  background: var(--paper-strong);
  box-shadow: 0 14px 34px rgba(72, 49, 25, 0.08);
}

.panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
}

.panel p {
  margin: 0;
  line-height: 1.55;
  color: var(--muted);
}

.panel code {
  padding: 0.15rem 0.35rem;
  border-radius: 999px;
  background: rgba(139, 94, 52, 0.08);
}

.section-head {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.stat-card {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(139, 94, 52, 0.14);
  background: linear-gradient(180deg, rgba(255, 247, 235, 0.95), rgba(246, 237, 223, 0.95));
}

.stat-number {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.stat-label {
  display: block;
  margin-top: 0.4rem;
  color: var(--muted);
}

.tag-list,
.thread-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-chip,
.thread-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid rgba(139, 94, 52, 0.18);
  border-radius: 999px;
  background: rgba(255, 249, 240, 0.9);
  color: var(--ink);
  text-decoration: none;
}

.thread-chip span {
  color: var(--muted);
}

.thread-chip-active {
  border-color: rgba(139, 94, 52, 0.34);
  background: rgba(240, 220, 191, 0.92);
  color: var(--accent);
  font-weight: 700;
}

.board-section {
  scroll-margin-top: 1rem;
}

.thread-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.thread-card {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(139, 94, 52, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.97), rgba(247, 238, 225, 0.97));
}

.thread-badge {
  display: inline-flex;
  width: fit-content;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(139, 94, 52, 0.1);
  color: var(--accent);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.thread-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.thread-card a {
  color: var(--ink);
  text-decoration: none;
}

.thread-card a:hover {
  color: var(--accent);
}

.thread-card p {
  margin: 0;
}

.thread-id,
.thread-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb a::after {
  content: "/";
  margin-left: 0.55rem;
  color: var(--accent-soft);
}

.breadcrumb a:last-child::after {
  content: "";
  margin: 0;
}

.post-stack {
  display: grid;
  gap: 1rem;
}

.post-card {
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(139, 94, 52, 0.16);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(247, 239, 226, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.post-card--hidden {
  border-style: dashed;
  background: linear-gradient(180deg, rgba(245, 238, 228, 0.96), rgba(238, 228, 213, 0.94));
}

.post-meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.post-id,
.post-tags,
.post-relation,
.post-link,
.post-identity {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.post-subject {
  margin: 0 0 0.7rem;
  font-size: 1.35rem;
}

.post-body {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.post-body p {
  color: var(--ink);
}

.quote-line {
  padding-left: 0.9rem;
  border-left: 3px solid rgba(139, 94, 52, 0.35);
  color: var(--muted);
}

.moderation-note {
  font-style: italic;
}

.post-card a {
  color: var(--accent);
  text-decoration: none;
}

.post-card a:hover,
.breadcrumb a:hover {
  color: var(--ink);
}

.profile-grid {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.profile-grid > * {
  margin: 0;
}

.profile-grid p {
  margin: 0;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.key-block {
  overflow-x: auto;
  margin: 0;
  padding: 1rem;
  border: 1px solid rgba(139, 94, 52, 0.16);
  border-radius: 18px;
  background: rgba(255, 249, 240, 0.84);
  color: var(--ink);
  font: 0.82rem/1.45 "Courier New", Courier, monospace;
}

.moderation-card {
  gap: 0.8rem;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(139, 94, 52, 0.2);
  border-radius: 14px;
  background: rgba(255, 251, 244, 0.96);
  color: var(--ink);
}

textarea {
  resize: vertical;
}

button {
  padding: 0.8rem 1rem;
  border: 1px solid rgba(139, 94, 52, 0.22);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 247, 235, 0.98), rgba(239, 223, 199, 0.98));
  color: var(--ink);
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.compose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.compose-card {
  display: grid;
  gap: 0.85rem;
}

.compose-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1rem;
}

.compose-details[open] summary {
  margin-bottom: 1rem;
}

.field-stack {
  display: grid;
  gap: 0.4rem;
}

.field-stack span {
  font-size: 0.92rem;
  color: var(--muted);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.field-grid-span {
  grid-column: 1 / -1;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.status-note {
  min-height: 1.4rem;
}

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

.priority-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.priority-table .col-task-id {
  width: 7%;
}

.priority-table .col-task-main {
  width: 37%;
}

.priority-table .col-impact {
  width: 11%;
}

.priority-table .col-difficulty {
  width: 13%;
}

.priority-table .col-dependencies {
  width: 11%;
}

.priority-table .col-sources {
  width: 13%;
}

.priority-table .col-comments {
  width: 8%;
}

.priority-table caption {
  padding: 0 0 1rem;
  text-align: left;
  color: var(--muted);
}

.priority-table th,
.priority-table td {
  padding: 0.9rem 0.85rem;
  border-bottom: 1px solid rgba(139, 94, 52, 0.16);
  text-align: left;
  vertical-align: top;
}

.priority-table tbody tr:nth-child(even) {
  background: rgba(255, 249, 240, 0.54);
}

.priority-table tbody tr:target {
  outline: 2px solid rgba(139, 94, 52, 0.4);
  outline-offset: -2px;
  background: rgba(255, 245, 230, 0.92);
}

.priority-table th[aria-sort="ascending"],
.priority-table th[aria-sort="descending"] {
  color: var(--accent);
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.sort-button::after {
  content: " ";
  width: 0.8rem;
  text-align: center;
  color: var(--accent);
}

.priority-table th[aria-sort="ascending"] .sort-button::after {
  content: "^";
}

.priority-table th[aria-sort="descending"] .sort-button::after {
  content: "v";
}

.task-id {
  display: inline-flex;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(139, 94, 52, 0.1);
  color: var(--accent);
  font: 0.82rem/1.2 "Courier New", Courier, monospace;
  text-decoration: none;
}

.task-title {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  line-height: 1.35;
}

.task-link {
  color: var(--ink);
  text-decoration: none;
}

.task-link:hover {
  color: var(--accent);
}

.task-note {
  margin: 0 0 0.45rem;
  line-height: 1.45;
}

.task-status,
.discussion-note {
  margin: 0;
}

.task-note,
.task-status,
.dep-list,
.source-list,
.discussion-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.task-note {
  max-width: 32rem;
}

.task-note--detail {
  margin-top: 1rem;
  max-width: 48rem;
}

.task-thread-context {
  display: grid;
  gap: 0.9rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid rgba(139, 94, 52, 0.16);
  border-radius: 18px;
  background: rgba(255, 249, 240, 0.72);
}

.task-thread-context h3 {
  margin: 0;
  font-size: 1rem;
}

.task-status {
  margin-top: 0.45rem;
}

.rating-value {
  font: 0.95rem/1.4 "Courier New", Courier, monospace;
  color: var(--ink);
  white-space: nowrap;
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.source-list code {
  white-space: nowrap;
}

.dep-list a,
.discussion-note a {
  color: var(--accent);
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 700px) {
  .page-shell {
    width: min(100vw - 1rem, 1080px);
    padding-top: 0.75rem;
  }

  .hero,
  .panel {
    padding: 1rem;
    border-radius: 18px;
  }

  .hero-title {
    line-height: 1.05;
  }
}
