.tc-body {
  min-height: 100vh;
}

.tc-header-pill {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.18rem 0.58rem;
  border-radius: 999px;
  color: var(--teal-tint);
  background: rgba(24, 63, 61, 0.45);
  border: 1px solid rgba(158, 231, 223, 0.28);
}

.tc-top-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.tc-top-nav a {
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.15s ease;
}

.tc-top-nav a:hover,
.tc-top-nav a.is-active {
  color: var(--ink);
}

.tc-user-badge {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
  padding: 0.34rem 0.68rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

/* AUTH GATE */
.tc-auth-wrap {
  min-height: calc(100vh - 4.6rem);
  display: grid;
  place-items: center;
  padding: 2.5rem 1.25rem;
}

.tc-auth-card {
  width: 100%;
  max-width: 460px;
  background: linear-gradient(180deg, rgba(17, 22, 26, 0.96), rgba(10, 13, 16, 0.98));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  box-shadow: 0 32px 84px rgba(0, 0, 0, 0.5);
}

.tc-auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.75rem;
}

.tc-auth-logo {
  display: inline-grid;
  place-items: center;
  width: 84px;
  height: 52px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--brand);
  border: 1px solid rgba(158, 231, 223, 0.28);
  margin-bottom: 1.15rem;
}

.tc-auth-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.tc-auth-brand h1 {
  margin: 0.55rem 0 0.65rem;
  font-size: 2.25rem;
  line-height: 1.05;
}

.tc-auth-brand p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
}

.tc-login-form {
  display: grid;
  gap: 1.05rem;
}

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

.tc-field label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.tc-field input {
  width: 100%;
  height: 2.85rem;
  padding: 0 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(7, 8, 10, 0.8);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tc-field input:focus {
  outline: none;
  border-color: var(--teal-tint);
  box-shadow: 0 0 0 3px rgba(158, 231, 223, 0.14);
}

.tc-error {
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  font-size: 0.85rem;
}

.tc-submit {
  width: 100%;
  margin-top: 0.25rem;
}

.tc-auth-footer {
  margin-top: 1.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.tc-auth-footer a {
  color: var(--teal-tint);
  text-decoration: none;
}

.tc-auth-footer a:hover {
  text-decoration: underline;
}

/* OVERVIEW DASHBOARD */
.tc-dashboard {
  padding: 2.25rem 0 4.5rem;
}

.tc-hero-banner {
  background:
    radial-gradient(640px 320px at 100% 0%, rgba(24, 63, 61, 0.56), transparent 65%),
    rgba(13, 17, 20, 0.92);
  border: 1px solid rgba(158, 231, 223, 0.24);
  border-radius: var(--radius-lg);
  padding: clamp(1.6rem, 3.5vw, 2.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: 2rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

.tc-hero-left h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.25rem, 4.2vw, 3.3rem);
  line-height: 1.02;
}

.tc-hero-left p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.97rem;
  max-width: 40rem;
}

.tc-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-items: flex-start;
}

.tc-hero-actions .btn {
  width: 100%;
}

.tc-hero-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.25rem;
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--muted);
}

.tc-hero-meta a {
  color: var(--teal-tint);
  text-decoration: none;
}

.tc-hero-meta a:hover {
  text-decoration: underline;
}

.tc-section {
  margin-bottom: 3rem;
  scroll-margin-top: 5.5rem;
}

.tc-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.tc-section-head h2 {
  margin: 0.35rem 0 0;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  line-height: 1.08;
}

.tc-honest-pill,
.tc-count-badge {
  font-family: var(--mono);
  font-size: 0.71rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
}

/* POSTURE STRIP (5 CARDS) */
.posture-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.95rem;
}

.posture-card {
  background: var(--bg-panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.posture-card:hover {
  border-color: rgba(158, 231, 223, 0.32);
  transform: translateY(-1px);
}

.posture-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.posture-badge-icon {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
  background: var(--brand);
  border: 1px solid rgba(158, 231, 223, 0.34);
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
}

.status-pill {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 600;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  white-space: nowrap;
}

.status-active {
  color: var(--signal);
  background: var(--signal-dim);
  border: 1px solid rgba(47, 191, 113, 0.3);
}

.status-ai {
  color: var(--teal-tint);
  background: rgba(158, 231, 223, 0.12);
  border: 1px solid rgba(158, 231, 223, 0.28);
}

.status-request {
  color: #f3d082;
  background: rgba(243, 208, 130, 0.12);
  border: 1px solid rgba(243, 208, 130, 0.28);
}

.posture-card h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
}

.posture-sub {
  margin: 0;
  font-size: 0.76rem;
  color: var(--teal-tint);
}

.posture-desc {
  margin: 0.2rem 0 0;
  font-size: 0.81rem;
  line-height: 1.5;
  color: var(--muted);
  flex-grow: 1;
}

.posture-foot {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink-soft);
}

/* SEARCHABLE CONTROLS EXPLORER */
.controls-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}

.controls-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.controls-search-wrap svg {
  position: absolute;
  left: 0.95rem;
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}

.controls-search-wrap input {
  width: 100%;
  height: 2.9rem;
  padding: 0 1rem 0 2.65rem;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 13, 16, 0.85);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.92rem;
}

.controls-search-wrap input:focus {
  outline: none;
  border-color: var(--teal-tint);
  box-shadow: 0 0 0 3px rgba(158, 231, 223, 0.14);
}

.controls-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ctrl-cat-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.81rem;
  font-weight: 500;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ctrl-cat-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.ctrl-cat-btn.is-active {
  background: var(--brand);
  border-color: rgba(158, 231, 223, 0.45);
  color: #ffffff;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.control-card {
  background: rgba(13, 16, 19, 0.82);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.control-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.control-cat-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal-tint);
}

.control-card h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
}

.control-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.52;
}

.control-card-foot {
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-soft);
}

.control-doc-link {
  color: var(--teal-tint);
  text-decoration: none;
}

.control-doc-link:hover {
  text-decoration: underline;
}

.controls-empty {
  grid-column: 1 / -1;
  padding: 2rem;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}

/* EVIDENCE VAULT */
.vault-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.vault-tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.44rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

.vault-tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
  font-weight: 600;
}

.vault-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.95rem;
}

.vault-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-decoration: none;
  background: var(--bg-panel-soft);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 1.25rem;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.vault-card:hover {
  border-color: rgba(158, 231, 223, 0.38);
  background: rgba(24, 63, 61, 0.22);
  transform: translateY(-1px);
}

.vault-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.vault-cat {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--teal-tint);
  background: rgba(24, 63, 61, 0.45);
  border: 1px solid rgba(158, 231, 223, 0.22);
  padding: 0.16rem 0.52rem;
  border-radius: 999px;
}

.vault-group-tag {
  font-family: var(--mono);
  font-size: 0.67rem;
  color: var(--muted);
}

.vault-card h3 {
  margin: 0.15rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.vault-card p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
  flex-grow: 1;
}

.vault-open {
  margin-top: 0.45rem;
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--teal-tint);
}

/* SUB-PROCESSOR MODE SNAPSHOT */
.subproc-card {
  background: var(--bg-panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.subproc-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.subproc-summary h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.subproc-summary p {
  margin: 0;
  max-width: 44rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.subproc-rows {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.subproc-row {
  background: rgba(7, 8, 10, 0.56);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
}

.subproc-row strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.subproc-row span {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.48;
}

/* PROTECTED READER PORTAL */
.tc-portal {
  padding: 2rem 0 4.5rem;
}

.tc-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.tc-sidebar {
  position: sticky;
  top: 5.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  max-height: calc(100vh - 6.75rem);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.tc-back-dashboard {
  width: 100%;
  border: 1px solid rgba(158, 231, 223, 0.34);
  background: rgba(24, 63, 61, 0.38);
  color: var(--teal-tint);
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.72rem 1rem;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tc-back-dashboard:hover {
  background: var(--brand);
  color: #ffffff;
}

.tc-sidebar-block {
  background: var(--bg-panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.05rem;
}

.tc-doc-nav {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.25rem;
}

.tc-nav-group-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.75rem 0 0.25rem;
  padding-left: 0.45rem;
}

.tc-nav-group-label:first-child {
  margin-top: 0.1rem;
}

.tc-doc-link {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.52rem 0.65rem;
  border-radius: 9px;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--ink-soft);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tc-doc-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
}

.tc-doc-link.is-active {
  background: rgba(24, 63, 61, 0.48);
  border-color: rgba(158, 231, 223, 0.34);
  color: #ffffff;
}

.tc-doc-link strong {
  font-size: 0.84rem;
  font-weight: 500;
}

.tc-toc-nav {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.28rem;
}

.tc-toc-nav a {
  text-decoration: none;
  font-size: 0.79rem;
  color: var(--muted);
  line-height: 1.4;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
}

.tc-toc-nav a.is-sub {
  padding-left: 0.9rem;
  font-size: 0.75rem;
}

.tc-toc-nav a:hover {
  color: var(--teal-tint);
  background: rgba(255, 255, 255, 0.03);
}

.tc-reader {
  background: rgba(13, 16, 19, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3.2vw, 2.75rem);
  min-width: 0;
}

.tc-reader-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 1.15rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.tc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
}

.tc-breadcrumb a {
  color: var(--teal-tint);
  text-decoration: none;
}

.tc-breadcrumb a:hover {
  text-decoration: underline;
}

.tc-cat-pill {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--signal);
  background: var(--signal-dim);
  border: 1px solid rgba(47, 191, 113, 0.28);
  padding: 0.16rem 0.58rem;
  border-radius: 999px;
}

.tc-access-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

/* MARKDOWN CONTENT */
.tc-markdown h1 {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 4vw, 3.1rem);
  line-height: 1.04;
}

.tc-markdown h2 {
  margin: 2.35rem 0 0.85rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.85rem;
  line-height: 1.12;
  scroll-margin-top: 5.5rem;
}

.tc-markdown h3 {
  margin: 1.55rem 0 0.55rem;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink);
  scroll-margin-top: 5.5rem;
}

.tc-markdown h4 {
  margin: 1.25rem 0 0.4rem;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--teal-tint);
}

.tc-markdown p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.96rem;
  line-height: 1.68;
}

.tc-markdown ul,
.tc-markdown ol {
  margin: 0 0 1.15rem;
  padding-left: 1.35rem;
  display: grid;
  gap: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.tc-markdown li strong {
  color: var(--ink);
}

.tc-markdown blockquote {
  margin: 1rem 0 1.25rem;
  padding: 0.85rem 1.1rem;
  border-left: 3px solid var(--signal);
  background: rgba(24, 63, 61, 0.18);
  border-radius: 0 8px 8px 0;
}

.tc-markdown blockquote p {
  margin: 0;
}

.tc-markdown hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.75rem 0;
}

.tc-pre {
  margin: 1rem 0 1.3rem;
  padding: 1rem 1.15rem;
  background: #090c0f;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.tc-pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}

.tc-markdown a {
  color: var(--teal-tint);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tc-markdown a:hover {
  color: #ffffff;
}

.tc-placeholder {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.77em;
  color: var(--teal-tint);
  background: rgba(24, 63, 61, 0.38);
  border: 1px solid rgba(158, 231, 223, 0.22);
  padding: 0.08em 0.45em;
  border-radius: 5px;
}

.tc-table-wrap {
  overflow-x: auto;
  margin: 1.2rem 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.tc-markdown table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.tc-markdown th,
.tc-markdown td {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.tc-markdown th {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal-tint);
  background: rgba(24, 63, 61, 0.24);
}

.tc-markdown td {
  color: var(--ink-soft);
  line-height: 1.5;
}

.tc-markdown tr:last-child td {
  border-bottom: 0;
}

.tc-loading {
  color: var(--muted);
}

@media (max-width: 1120px) {
  .posture-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .vault-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .tc-top-nav,
  .tc-user-badge {
    display: none;
  }

  .tc-hero-banner,
  .tc-layout,
  .controls-grid,
  .subproc-rows {
    grid-template-columns: 1fr;
  }

  .tc-sidebar {
    position: static;
    max-height: none;
  }

  .tc-toc-block {
    display: none;
  }
}

@media (max-width: 680px) {
  .posture-grid,
  .vault-grid {
    grid-template-columns: 1fr;
  }
}
