:root {
  --paper: #f4f1eb;
  --paper-deep: #e9e4db;
  --card: #fbfaf7;
  --ink: #17201e;
  --muted: #68706c;
  --line: #d7d2c9;
  --accent: #087c70;
  --accent-dark: #055e56;
  --accent-soft: #dceee9;
  --warning: #a55f14;
  --danger: #a13e36;
  --success: #247458;
  --radius: 14px;
  --shadow: 0 18px 55px rgb(28 41 37 / 8%);
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}
body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  line-height: 1.5;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 3px solid #2aa99b;
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  z-index: 100;
  left: 1rem;
  top: -5rem;
  background: var(--ink);
  color: white;
  padding: 0.7rem 1rem;
  border-radius: 8px;
}
.skip-link:focus {
  top: 1rem;
}
.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;
}
.wordmark {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-decoration: none;
}
.wordmark span {
  color: var(--accent);
}
.wordmark-large {
  font-size: 2rem;
}
.eyebrow,
.kicker,
.micro-label {
  color: var(--accent-dark);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.muted {
  color: var(--muted);
}
.microcopy {
  color: var(--muted);
  font-size: 0.76rem;
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(22rem, 0.8fr);
}
.auth-intro {
  padding: clamp(2rem, 6vw, 6.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--ink);
  color: #f7f4ed;
  position: relative;
  overflow: hidden;
}
.auth-intro::after {
  content: '';
  position: absolute;
  width: 28rem;
  height: 28rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 50%;
  right: -9rem;
  bottom: -12rem;
  box-shadow:
    0 0 0 5rem rgb(255 255 255 / 2%),
    0 0 0 10rem rgb(255 255 255 / 2%);
}
.auth-intro h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(3rem, 7vw, 6.6rem);
  line-height: 0.93;
  letter-spacing: -0.06em;
  margin: 1.6rem 0;
  max-width: 10ch;
  position: relative;
  z-index: 1;
}
.auth-intro .lede {
  max-width: 36rem;
  color: #c8d0cc;
  font-size: 1.06rem;
}
.auth-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 2rem;
  position: relative;
  z-index: 1;
}
.auth-proof span {
  border: 1px solid rgb(255 255 255 / 20%);
  padding: 0.5rem 0.7rem;
  border-radius: 999px;
  font-size: 0.76rem;
  color: #dce5e1;
}
.auth-card {
  align-self: center;
  margin: clamp(1.5rem, 6vw, 6rem);
  max-width: 30rem;
}
.auth-card h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2rem;
  margin: 0.4rem 0;
  letter-spacing: -0.03em;
}
label {
  display: block;
  font-size: 0.78rem;
  font-weight: 750;
  margin: 1.25rem 0 0.45rem;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #bdb8af;
  background: var(--card);
  color: var(--ink);
  padding: 0.78rem 0.85rem;
  border-radius: 9px;
}
.auth-card .button-primary {
  width: 100%;
  margin-top: 1rem;
}
.form-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 600;
}
.check-row input {
  width: auto;
  margin-top: 0.2rem;
}
.signin-details {
  margin-top: 1.25rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}
.signin-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}
.inline-field {
  display: flex;
  gap: 0.5rem;
}
.token-panel {
  margin-top: 1.3rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--line);
}
.form-message {
  min-height: 1.5rem;
  font-size: 0.84rem;
}
@media (max-width: 520px) {
  .form-pair {
    grid-template-columns: 1fr;
  }
}

.button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 0.66rem 0.85rem;
  border-radius: 8px;
  font-weight: 750;
}
.button:hover {
  border-color: #aaa49a;
  transform: translateY(-1px);
}
.button-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.button-primary:hover {
  background: var(--accent-dark);
}
.button-danger {
  color: var(--danger);
  border-color: #d8b9b5;
}
.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}
.text-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
}
.icon-button {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  color: var(--ink);
  font-size: 1.1rem;
}

.workspace {
  min-height: 100vh;
  grid-template-columns: 17rem 1fr;
}
.workspace:not([hidden]) {
  display: grid;
}
.sidebar {
  background: #16211f;
  color: #e8efec;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem 1.2rem;
}
.site-identity {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  padding: 0.9rem 0.55rem;
  border-block: 1px solid rgb(255 255 255 / 10%);
  margin-bottom: 1rem;
  min-width: 0;
}
.site-avatar {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  background: var(--accent);
  border-radius: 8px;
  font-family: Georgia, serif;
}
.site-identity div {
  min-width: 0;
}
.site-identity strong,
.site-identity span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-identity strong {
  font-size: 0.82rem;
}
.site-identity div span {
  color: #9faaa6;
  font-size: 0.67rem;
  margin-top: 0.1rem;
}
.nav-list {
  display: grid;
  gap: 0.15rem;
  overflow-y: auto;
  padding-right: 0.2rem;
}
.nav-group {
  color: #7f8d88;
  font-size: 0.61rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  margin: 0.9rem 0.65rem 0.25rem;
}
.nav-link {
  border: 0;
  background: transparent;
  color: #acb7b3;
  border-radius: 8px;
  padding: 0.58rem 0.65rem;
  text-align: left;
  font-size: 0.79rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-link:hover {
  color: white;
  background: rgb(255 255 255 / 6%);
}
.nav-link[aria-current='page'] {
  background: #263532;
  color: white;
  box-shadow: inset 3px 0 var(--accent);
}
.nav-link .nav-dot {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: #65736f;
}
.nav-link[aria-current='page'] .nav-dot {
  background: #39b4a4;
}
.sidebar-foot {
  margin-top: auto;
  padding: 1rem 0.55rem 0;
  border-top: 1px solid rgb(255 255 255 / 10%);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
}
.sidebar-foot strong {
  display: block;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.75rem;
  white-space: nowrap;
}
.sidebar-foot .text-button {
  color: #9faaa6;
  font-size: 0.7rem;
}

.work-area {
  min-width: 0;
}
#view {
  min-width: 0;
  max-width: 100%;
}
.topbar {
  height: 4.7rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  position: sticky;
  top: 0;
  background: rgb(244 241 235 / 93%);
  backdrop-filter: blur(12px);
  z-index: 10;
}
.breadcrumb span,
.breadcrumb strong {
  display: block;
}
.breadcrumb span {
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.breadcrumb strong {
  font-family: Georgia, serif;
  font-size: 1.15rem;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.site-select-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
}
#site-select {
  width: min(16rem, 30vw);
  min-width: 0;
  padding: 0.58rem 0.7rem;
  background: transparent;
}
.main-content {
  padding: clamp(1.1rem, 3vw, 2.6rem);
  max-width: 96rem;
  margin: 0 auto;
}
.view-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 1.6rem;
}
.view-head h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.045em;
  margin: 0.35rem 0;
}
.view-head p {
  margin: 0;
  color: var(--muted);
  max-width: 44rem;
}
.view-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}
.metric-card,
.panel,
.state-panel {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgb(255 255 255 / 70%);
}
.metric-card {
  padding: 1rem;
  min-height: 8rem;
  position: relative;
  overflow: hidden;
}
.metric-card::before {
  content: '';
  width: 2.7rem;
  height: 3px;
  background: var(--accent);
  position: absolute;
  left: 1rem;
  top: 0;
}
.metric-label {
  color: var(--muted);
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.metric-value {
  font-family: Georgia, serif;
  display: block;
  font-size: 2.4rem;
  line-height: 1;
  margin: 0.8rem 0 0.45rem;
  letter-spacing: -0.05em;
}
.metric-note {
  font-size: 0.72rem;
  color: var(--muted);
}
.panel {
  padding: 1.15rem;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.panel-head h2,
.panel-head h3 {
  font-family: Georgia, serif;
  margin: 0;
  letter-spacing: -0.025em;
}
.panel-head p {
  color: var(--muted);
  margin: 0.2rem 0 0;
  font-size: 0.77rem;
}
.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(19rem, 0.8fr);
  gap: 0.8rem;
  margin-top: 0.8rem;
}
.grid-equal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.stack {
  display: grid;
  gap: 0.8rem;
}
.content-board {
  margin-top: 0.8rem;
}
.content-card h3 {
  font-family: Georgia, serif;
  margin: 0;
}
.content-lineage {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.8rem 0;
}
.content-lineage span {
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.68rem;
}
.signal-list,
.timeline,
.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.signal-row {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) 4fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}
.signal-row:first-child {
  border-top: 0;
}
.bar {
  height: 0.4rem;
  border-radius: 999px;
  background: var(--paper-deep);
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}
.timeline li {
  padding: 0.7rem 0 0.7rem 1.25rem;
  border-left: 1px solid var(--line);
  position: relative;
}
.timeline li::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  left: -0.25rem;
  top: 1rem;
}
.timeline strong,
.timeline span {
  display: block;
  font-size: 0.75rem;
}
.timeline span {
  color: var(--muted);
  font-size: 0.67rem;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 42rem;
}
th {
  text-align: left;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.61rem;
  padding: 0.65rem;
  border-bottom: 1px solid var(--line);
}
td {
  font-size: 0.75rem;
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
tr:last-child td {
  border-bottom: 0;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  word-break: break-all;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.22rem 0.5rem;
  font-size: 0.62rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.pill-success {
  background: #e3f0e9;
  color: var(--success);
  border-color: #bcd8ca;
}
.pill-warning {
  background: #f5ead9;
  color: var(--warning);
  border-color: #e2c79f;
}
.pill-danger {
  background: #f4e3e1;
  color: var(--danger);
  border-color: #ddb9b5;
}
.pill-neutral {
  background: var(--paper);
  color: var(--muted);
}
.action-card {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}
.action-card:first-of-type {
  border-top: 0;
}
.action-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.action-title h3 {
  margin: 0;
  font-family: Georgia, serif;
}
.action-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.55rem 0;
}
.code-block {
  background: #17201e;
  color: #dbe8e4;
  border-radius: 9px;
  padding: 0.8rem;
  max-height: 14rem;
  overflow: auto;
  font:
    0.7rem/1.5 ui-monospace,
    monospace;
  white-space: pre-wrap;
}
.state-panel {
  padding: clamp(1.4rem, 4vw, 3rem);
  text-align: center;
  min-height: 15rem;
  display: grid;
  place-items: center;
}
.state-panel > div {
  min-width: 0;
  max-width: min(35rem, 100%);
}
.state-panel h2,
.state-panel p {
  overflow-wrap: anywhere;
}
.state-mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  margin: 0 auto 0.9rem;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-family: Georgia, serif;
  font-size: 1.5rem;
}
.state-panel h2 {
  font-family: Georgia, serif;
  margin: 0 0 0.35rem;
}
.state-panel p {
  color: var(--muted);
  margin: 0 0 1rem;
}
.empty-inline {
  color: var(--muted);
  font-size: 0.78rem;
  padding: 1rem 0;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
}
.form-grid .full {
  grid-column: 1 / -1;
}
.form-grid .button {
  align-self: end;
  margin-bottom: 0;
  height: 2.75rem;
}
.notice {
  padding: 0.75rem 0.85rem;
  border-left: 3px solid var(--warning);
  background: #f5ead9;
  font-size: 0.76rem;
  margin-bottom: 0.8rem;
}
.receipt {
  border-left: 3px solid var(--accent);
}
.mobile-only {
  display: none;
}
.skeleton {
  display: block;
  background: linear-gradient(90deg, #e2ded6 25%, #efebe5 50%, #e2ded6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}
.skeleton-short {
  width: 7rem;
  height: 0.7rem;
}
.skeleton-title {
  width: min(25rem, 70%);
  height: 3rem;
  margin-top: 0.7rem;
}
.skeleton-card {
  min-height: 8rem;
}
.skeleton-panel {
  min-height: 20rem;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
  }
}

@media (max-width: 960px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-two,
  .grid-equal {
    grid-template-columns: 1fr;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0;
    width: min(19rem, 88vw);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .scrim {
    position: fixed;
    inset: 0;
    background: rgb(12 19 17 / 44%);
    z-index: 15;
  }
  .mobile-only {
    display: grid;
  }
}
@media (max-width: 700px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }
  .auth-intro {
    min-height: 47vh;
    padding: 2rem 1.3rem;
  }
  .auth-intro h1 {
    font-size: clamp(2.7rem, 14vw, 4.6rem);
  }
  .auth-card {
    margin: 2.2rem 1.3rem;
  }
  .topbar {
    height: auto;
    min-height: 4.5rem;
    padding: 0.7rem 1rem;
    flex-wrap: wrap;
  }
  .breadcrumb {
    margin-right: auto;
  }
  .topbar-actions {
    width: 100%;
  }
  .site-select-label {
    display: none;
  }
  #site-select {
    flex: 1;
    width: auto;
  }
  .main-content {
    padding: 1.1rem 0.8rem 2.5rem;
  }
  .view-head {
    align-items: start;
    flex-direction: column;
  }
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .metric-value {
    font-size: 2rem;
  }
  .signal-row {
    grid-template-columns: 1fr auto;
  }
  .signal-row .bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .full {
    grid-column: auto;
  }
}
@media (max-width: 420px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }
}
