@font-face {
  font-family: "LoopSeer Website Condensed";
  src: url("../fonts/loopseer-website-condensed-bold-latin.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #171e21;
  --sidebar: #1b2427;
  --surface: #1e282c;
  --raised: #263236;
  --line: #3b4a4e;
  --divider: #334145;
  --text: #eef1e8;
  --secondary: #b8c6c7;
  --quiet: #a8b8ba;
  --teal: #79d9d0;
  --teal-surface: #223c3c;
  --amber: #ebbb7a;
  font: 100%/1.5 system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); color: var(--text); }
a { color: var(--teal); text-underline-offset: .22em; }
a:hover { color: var(--text); }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }
strong { font-weight: 650; }
.secondary { display: block; color: var(--secondary); font-size: .8125rem; }
.muted { color: var(--quiet); }
.visually-hidden,
.view-modes input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  z-index: 1;
  inset: .75rem auto auto .75rem;
  padding: .65rem 1rem;
  background: var(--raised);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.app-header {
  display: flex;
  min-height: 4.25rem;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .45rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: var(--sidebar);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  min-height: 2.75rem;
  color: var(--text);
  font-size: 1.18rem;
  font-weight: 650;
  letter-spacing: -.025em;
  text-decoration: none;
}
.brand img { border-radius: .45rem; }
.sample-label {
  border: 1px solid #675746;
  border-radius: .25rem;
  padding: .23rem .5rem;
  background: #302a25;
  color: var(--amber);
  font-size: .75rem;
  font-weight: 600;
  text-align: center;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: calc(100vh - 4.25rem);
}
.workspace-nav { display: none; }
main { min-width: 0; padding: clamp(1rem, 2vw, 2rem); }
main:focus { outline: none; }
.log-page { max-width: 100rem; margin-inline: auto; }
.browser-page { max-width: 52rem; margin: 1rem auto 0; }
.page-intro { margin-bottom: 1.55rem; }
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .25rem .8rem;
  margin-bottom: .65rem;
  font-size: .875rem;
  color: var(--secondary);
}
.breadcrumbs a { display: inline-flex; align-items: center; min-height: 2.75rem; }
h1 {
  font: 700 clamp(2.2rem, 4vw, 3.05rem)/1.08 "LoopSeer Website Condensed", system-ui, sans-serif;
  letter-spacing: -.018em;
}
.page-meta { margin-top: .55rem; color: var(--secondary); font-size: .9375rem; }

.workspace-cards, .workspace-nav ul { list-style: none; padding: 0; margin: 0; }
.workspace-cards {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: var(--surface);
}
.workspace-cards li + li { border-top: 1px solid var(--divider); }
.workspace-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto .55rem;
  align-items: center;
  gap: .9rem;
  min-height: 5.5rem;
  padding: 1rem 1.2rem;
  color: var(--text);
  text-decoration: none;
}
.workspace-card:hover, .workspace-card:focus-visible { background: var(--raised); }
.workspace-card:focus-visible { outline-offset: -3px; }
.workspace-description { display: grid; gap: .25rem; }
.workspace-count { font-variant-numeric: tabular-nums; }

.log-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem 1rem;
  margin-bottom: .85rem;
}
.view-modes {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: .2rem;
  min-width: 0;
  margin: 0;
  padding: .2rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: var(--sidebar);
}
.view-modes label { display: flex; }
.view-modes span {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: .25rem .8rem;
  border: 1px solid transparent;
  border-radius: .25rem;
  color: var(--secondary);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
}
.view-modes label:hover span { color: var(--text); }
.view-modes input:checked + span { background: var(--teal-surface); border-color: #4b7775; color: var(--teal); }
.view-modes input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 1px; }
.timezone, .log-footnote, .comparison-note { color: var(--secondary); font-size: .8125rem; }
.log-footnote { margin-top: .85rem; }
.comparison-note { margin-bottom: .65rem; }
.empty-state { padding: 1.25rem; border: 1px solid var(--line); border-radius: .4rem; }

/* Both modes use this table geometry at every viewport size. */
.table-guide {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .35rem 1rem;
  margin: 0 0 .25rem;
  color: var(--secondary);
  font-size: .8125rem;
}
.change-key {
  margin-inline-end: .3rem;
  padding: .05rem .3rem;
  border-inline-start: 2px solid var(--teal);
  color: var(--teal);
  background: var(--teal-surface);
}
.table-frame {
  position: relative;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: var(--surface);
}
.event-table {
  --row-line: 1.125rem;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: .8125rem;
  line-height: var(--row-line);
}
.event-table th, .event-table td {
  text-align: left;
  vertical-align: top;
  padding: .4rem .44rem;
  border-bottom: 1px solid var(--divider);
}
.event-table th {
  background: var(--raised);
  color: var(--secondary);
  font-size: .75rem;
  line-height: 1.25;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.event-table th:is([scope="col"], [scope="colgroup"]) {
  font-family: "LoopSeer Website Condensed", system-ui, sans-serif;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.13;
}
.event-table .column-groups th {
  padding-block: .48rem;
  background: var(--sidebar);
  border-inline-end: 1px solid var(--line);
  color: var(--text);
}
.event-table td { overflow-wrap: anywhere; }
.event-table :is(.col-alpha, .col-beta, .col-gamma) { padding-inline: .25rem; }
.event-table .col-model-type, .event-table .col-method {
  border-inline-start: 1px solid var(--line);
}
.event-table :is(.col-loop, .col-field-time) {
  position: sticky;
  left: 0;
  z-index: 1;
  border-inline-end: 1px solid var(--line);
}
.event-table:not(.is-grouped) .col-field-time { left: var(--loop-width); }
.event-table td:is(.col-loop, .col-field-time) { background: var(--surface); }
.event-table tbody:last-child tr:last-child td { border-bottom: 0; }
.field-time, .cell-stack, .value-stack { display: grid; align-content: start; }
.field-time { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .75rem; }
.time-clock { font-size: .6875rem; }
.compact-cell, .field-note:not(.is-expanded) .note-text { max-height: calc(2 * var(--row-line)); overflow: hidden; }
.loop-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-table .loop-tag { white-space: nowrap; }
.field-note { position: relative; }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.field-note:has(.note-toggle:not([hidden])) .note-text { padding-inline-end: 1.75rem; }
.note-toggle {
  position: absolute;
  inset: auto 0 0 auto;
  width: 1.55rem;
  min-height: 1.5rem;
  border: 1px solid #537c7b;
  border-radius: .2rem;
  padding: 0;
  background: var(--teal-surface);
  color: var(--teal);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.note-toggle:hover { background: var(--raised); color: var(--text); }
.note-toggle::after { content: ""; position: absolute; inset: -.32rem; }
.note-toggle:focus-visible { outline-offset: 1px; }
.loop-tag { font-weight: 650; }
.loop-tag { font-variant-numeric: tabular-nums; }
.event-kind {
  display: inline-block;
  justify-self: start;
  padding: 0 .22rem;
  border: 1px solid #57696f;
  border-radius: .23rem;
  color: #d8e3e9;
  font-size: .6875rem;
  font-weight: 650;
  line-height: 1rem;
  white-space: nowrap;
}
.event-kind.implemented { border-color: #4b7775; background: var(--teal-surface); color: var(--teal); }
.chevron {
  display: inline-block;
  flex: none;
  width: .4rem;
  height: .4rem;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(-45deg);
}
.value-stack.numeric { text-align: right; }
.numeric .cell-value {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
}
.event-table abbr { white-space: nowrap; }
.value-unit { color: var(--secondary); font-size: .6875rem; white-space: nowrap; }
.model-archive { display: inline; font-size: .6875rem; }
.event-table td.changed {
  background: var(--teal-surface);
  box-shadow: inset 2px 0 var(--teal);
}
.changed .cell-value { color: var(--teal); font-weight: 650; }
.revision-note { color: var(--amber); font-size: .75rem; }
.event-table .loop-heading th { padding: 0; background: var(--sidebar); }
.loop-toggle {
  position: sticky;
  left: .3rem;
  display: inline-flex;
  gap: .42rem .6rem;
  align-items: center;
  min-height: 2.75rem;
  padding: .45rem .6rem;
  border: 0;
  background: var(--sidebar);
  color: var(--text);
  cursor: pointer;
}
.loop-toggle:hover { background: var(--raised); }
.loop-toggle:focus-visible { outline-offset: -2px; }
.loop-toggle .chevron { margin-right: .15rem; color: var(--teal); }
.loop-toggle[aria-expanded="true"] .chevron { transform: translateY(-.12rem) rotate(45deg); }
.group-count { white-space: nowrap; }

@media (min-width: 108rem) {
  .app-shell:has(.workspace-nav:not([hidden])) { grid-template-columns: 14.5rem minmax(0, 1fr); }
  .workspace-nav {
    display: block;
    padding: 1.75rem .85rem;
    border-inline-end: 1px solid var(--line);
    background: var(--sidebar);
  }
  .nav-title {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding-inline: .55rem;
    color: var(--secondary);
    font-size: .875rem;
    font-weight: 650;
    text-decoration: none;
  }
  .workspace-nav ul { display: grid; gap: .3rem; }
  .workspace-link {
    display: grid;
    gap: .15rem;
    padding: .65rem .55rem;
    border: 1px solid transparent;
    border-radius: .35rem;
    color: var(--text);
    font-size: .875rem;
    text-decoration: none;
  }
  .workspace-link:hover { background: var(--surface); }
  .workspace-link[aria-current] { background: var(--teal-surface); border-color: #4b7775; }
  .workspace-link[aria-current] strong { color: var(--teal); }
}

@media (max-width: 28rem) {
  .workspace-card { grid-template-columns: minmax(0, 1fr) .55rem; gap: .15rem .75rem; }
  .workspace-card .chevron { grid-column: 2; grid-row: 1 / 3; }
  .loop-toggle { flex-wrap: wrap; max-width: 16.7rem; }
}

.native-preview :is(.col-otherFeatures, .col-event-type, .col-model-type) .compact-cell { max-height: none; }
.native-preview .cell-stack .loop-name { font-weight: 650; }
.native-preview .value-unit { white-space: normal; }
.native-preview .loop-toggle { flex-wrap: wrap; }
.reporting-zone select {
  min-height: 2.75rem;
  padding-inline: .5rem;
  color: var(--text);
  background: var(--sidebar);
  border: 1px solid var(--line);
  border-radius: .25rem;
  font: inherit;
}
