:root {
  --bg: #f4f1ea;
  --panel: #fffdf8;
  --ink: #171512;
  --muted: #6b645b;
  --line: rgba(23, 21, 18, 0.14);
  --line-strong: rgba(23, 21, 18, 0.26);
  --blue: #214f74;
  --red: #9b3329;
  --green: #44624a;
  --amber: #b7832d;
  --shadow: 0 22px 70px rgba(30, 25, 18, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(23, 21, 18, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(23, 21, 18, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
}

a {
  color: inherit;
}

.workbench {
  width: min(1440px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 0 36px;
}

.app-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  min-height: 118px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
}

.eyebrow,
.panel-label {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-weight: 650;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.6rem, 5vw, 5.6rem);
  line-height: 0.9;
}

.header-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(108px, 1fr));
  gap: 10px;
  min-width: min(100%, 300px);
}

.stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 5px;
  color: var(--green);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-size: 1.35rem;
}

.layout-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 220px;
  gap: 14px;
  margin-top: 14px;
  align-items: stretch;
}

.side-panel,
.data-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: var(--shadow);
}

.side-panel {
  min-height: 620px;
  padding: 16px;
}

.topic-list {
  display: grid;
  gap: 9px;
}

.topic-link {
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(244, 241, 234, 0.7);
  text-decoration: none;
}

.topic-link:hover,
.topic-link:focus-visible,
.topic-link.is-active {
  border-color: rgba(155, 51, 41, 0.45);
  background: #fffaf0;
}

.topic-link span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.topic-link strong {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-size: 1.14rem;
  line-height: 1.05;
}

.data-panel {
  min-width: 0;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  min-height: 130px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: 0.92;
}

.panel-head p:last-child {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.table-slot {
  display: block;
  min-block-size: 490px;
}

.table-slot > * {
  min-block-size: inherit;
}

.table-slot[data-fragment-state="loading"] {
  cursor: progress;
}

.table-card {
  min-block-size: inherit;
  background: var(--panel);
}

.table-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.table-meta .eyebrow {
  margin: 0;
}

.table-meta strong {
  color: var(--blue);
  font-size: 0.84rem;
  text-transform: uppercase;
}

.object-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.object-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.object-table th,
.object-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.object-table th {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.object-table td {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.42;
}

.object-table th:nth-child(1),
.object-table td:nth-child(1) {
  width: 36%;
}

.object-table th:nth-child(2),
.object-table td:nth-child(2) {
  width: 22%;
}

.object-table th:nth-child(3),
.object-table td:nth-child(3) {
  width: 16%;
}

.object-table a {
  font-weight: 800;
  text-decoration-color: rgba(155, 51, 41, 0.35);
  text-underline-offset: 3px;
}

.object-table small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.74rem;
}

.table-card--loading .object-table td {
  height: 64px;
}

.sk {
  display: block;
  height: 12px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent),
    rgba(23, 21, 18, 0.15);
  background-size: 180% 100%, auto;
  animation: sweep 1.15s linear infinite;
  animation-delay: calc(var(--row-delay, 0ms) + var(--cell-delay, 0ms));
}

.object-table tbody tr:nth-child(2n) .sk {
  --row-delay: 90ms;
}

.object-table tbody tr:nth-child(3n) .sk {
  --row-delay: 180ms;
}

.sk-title {
  width: 92%;
  height: 16px;
}

.sk-maker {
  width: 76%;
  --cell-delay: 40ms;
}

.sk-date {
  width: 58%;
  --cell-delay: 80ms;
}

.sk-medium {
  width: 84%;
  --cell-delay: 120ms;
}

.table-card--error {
  padding: 32px;
}

.table-card--error h2 {
  max-width: 620px;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.96;
}

.table-card--error p:last-child {
  max-width: 520px;
  color: var(--muted);
  line-height: 1.6;
}

.shell-map {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.shell-map span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.shell-map span::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.shell-map .is-ready::after {
  background: var(--green);
}

.shell-map .is-loading::after {
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(183, 131, 45, 0.14);
}

@keyframes sweep {
  from {
    background-position: 180% 0, 0 0;
  }
  to {
    background-position: -180% 0, 0 0;
  }
}

@media (max-width: 1040px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    min-height: 0;
  }

  .side-panel--left {
    order: -1;
  }

  .topic-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-panel--right {
    display: none;
  }
}

@media (max-width: 700px) {
  .workbench {
    width: min(100% - 20px, 520px);
    padding-top: 10px;
  }

  .app-header,
  .panel-head {
    display: grid;
  }

  .header-status,
  .topic-list {
    grid-template-columns: 1fr;
  }

  .table-slot {
    min-block-size: 420px;
  }

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

  .object-table {
    min-width: 760px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
