/* Layout and component rules for the primitives in src/app/primitives.ts.
   Every color and space value resolves to a --tc-* token from tokens.css;
   this file declares no color or spacing literal of its own
   (test/node/ux-prohibitions.spec.ts checks src/app/ and this directory). */

.tc-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--tc-bg-page);
  color: var(--tc-text-primary);
}

.tc-app__header {
  display: flex;
  flex-direction: column;
  gap: var(--tc-spacing-01);
  padding: var(--tc-spacing-04) var(--tc-spacing-05);
  background: var(--tc-bg-header);
  color: var(--tc-text-on-dark);
  border-bottom: 1px solid var(--tc-border-subtle);
  padding-top: max(var(--tc-spacing-04), env(safe-area-inset-top));
}

.tc-app__title {
  font-size: var(--tc-font-size-lg);
  font-weight: var(--tc-font-weight-semibold);
}

.tc-app__context {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tc-spacing-05);
  color: var(--tc-text-on-dark);
  opacity: 0.85;
  font-size: var(--tc-font-size-sm);
}

.tc-app__body {
  flex: 1;
  padding: var(--tc-spacing-04);
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

.tc-app__nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--tc-bg-surface);
  border-top: 1px solid var(--tc-border-subtle);
  padding-bottom: env(safe-area-inset-bottom);
}

.tc-app__nav a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  color: var(--tc-text-secondary);
  text-decoration: none;
  font-size: var(--tc-font-size-xs);
}

.tc-app__nav a[aria-current="page"] {
  color: var(--tc-interactive);
  font-weight: var(--tc-font-weight-medium);
}

@media (min-width: 768px) {
  .tc-app {
    flex-direction: row;
  }
  .tc-app__nav {
    position: static;
    flex-direction: column;
    width: 64px;
    border-top: none;
    border-right: 1px solid var(--tc-border-subtle);
  }
  .tc-app__nav a {
    flex: none;
    height: 56px;
  }
  .tc-app__main {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  .tc-app__body {
    padding-bottom: var(--tc-spacing-04);
  }
}

.tc-stack {
  display: flex;
  flex-direction: column;
  gap: var(--tc-spacing-04);
}

.tc-stack--row {
  flex-direction: row;
  align-items: center;
}

.tc-row {
  display: flex;
  align-items: center;
  gap: var(--tc-spacing-04);
  min-height: 44px;
  padding: var(--tc-spacing-03) var(--tc-spacing-04);
  border-bottom: 1px solid var(--tc-border-subtle);
  text-decoration: none;
  color: inherit;
}

.tc-row__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.tc-row__dot--verified,
.tc-row__dot--pass {
  background: var(--tc-support-success);
}

.tc-row__dot--falsified,
.tc-row__dot--fail {
  background: var(--tc-support-error);
}

.tc-row__dot--unknown {
  background: var(--tc-border-strong);
}

.tc-row__main {
  flex: 1;
  min-width: 0;
}

.tc-row__primary {
  font-size: var(--tc-font-size-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tc-row__meta {
  color: var(--tc-text-secondary);
  font-size: var(--tc-font-size-xs);
}

.tc-row__trailing {
  flex-shrink: 0;
}

.tc-meter {
  display: flex;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--tc-border-subtle);
}

.tc-meter__segment--verified {
  background: var(--tc-support-success);
}

.tc-meter__segment--falsified {
  background: var(--tc-support-error);
}

.tc-meter__segment--unknown {
  background: var(--tc-border-strong);
}

.tc-measure {
  font-family: var(--tc-font-mono);
  font-weight: var(--tc-font-weight-semibold);
  border-bottom: 1px dashed var(--tc-border-provenance);
  cursor: pointer;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.tc-measure:hover,
.tc-measure:focus-visible {
  color: var(--tc-interactive);
}

.tc-measure--untraced {
  border-bottom-color: var(--tc-support-warning);
}

.tc-measure__label {
  font-family: var(--tc-font-sans);
  font-weight: var(--tc-font-weight-regular);
  color: var(--tc-text-secondary);
  margin-left: var(--tc-spacing-01);
}

.tc-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--tc-bg-elevated);
  border-radius: var(--tc-radius-lg) var(--tc-radius-lg) 0 0;
  box-shadow: var(--tc-shadow-md);
  padding: var(--tc-spacing-05);
  max-height: 80vh;
  overflow-y: auto;
  padding-bottom: max(var(--tc-spacing-05), env(safe-area-inset-bottom));
}

.tc-sheet[hidden] {
  display: none;
}

.tc-sheet__handle {
  width: 24px;
  height: 3px;
  border-radius: 999px;
  background: var(--tc-border-strong);
  margin: 0 auto var(--tc-spacing-04);
}

@media (min-width: 768px) {
  .tc-sheet {
    left: auto;
    top: 0;
    width: 360px;
    border-radius: var(--tc-radius-lg) 0 0 var(--tc-radius-lg);
    max-height: none;
  }
  .tc-sheet__handle {
    display: none;
  }
}

.tc-form {
  display: flex;
  flex-direction: column;
  gap: var(--tc-spacing-05);
  max-width: 480px;
}

.tc-form label {
  display: flex;
  flex-direction: column;
  gap: var(--tc-spacing-02);
  font-size: var(--tc-font-size-sm);
}

.tc-form input {
  min-height: 44px;
  padding: var(--tc-spacing-03);
  border: 1px solid var(--tc-border-subtle);
  border-radius: var(--tc-radius-sm);
  font-family: var(--tc-font-mono);
  font-size: var(--tc-font-size-sm);
  background: var(--tc-bg-surface);
  color: var(--tc-text-primary);
}

.tc-form button {
  min-height: 44px;
  border-radius: var(--tc-radius-sm);
  border: none;
  background: var(--tc-interactive);
  color: var(--tc-text-inverse);
  font-size: var(--tc-font-size-sm);
  font-weight: var(--tc-font-weight-medium);
  cursor: pointer;
}

.tc-form__error {
  color: var(--tc-support-error);
  font-size: var(--tc-font-size-sm);
}
