/* Minimal chrome for the Controls3 viewer-comparison app. This is a
   product shell, not a Leptos demo -- deliberately plain rather than
   themed. Ported from the sibling controls2-leptos app's own
   styles/app.css, trimmed to drop the schedule/property-inspector rules
   this app has no matching markup for, and with storey/pick/appearance
   section rules added. */

:root {
  color-scheme: light dark;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
}

body {
  margin: 0;
}

.shell {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.experimental-banner {
  background: #7a2e0e;
  color: #fff;
  text-align: center;
  font-weight: 600;
  padding: 0.5rem 1rem;
  letter-spacing: 0.02em;
}

h1 {
  font-size: 1.4rem;
}

h2 {
  font-size: 1.1rem;
  margin-top: 2rem;
}

.lede {
  color: #555;
  max-width: 65ch;
}

.open-file {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 1.5rem 0;
}

.hint {
  color: #666;
  font-style: italic;
}

.status-ok {
  color: #1a7a3a;
}

.status-err {
  color: #b3261e;
  white-space: pre-wrap;
}

.summary .file-name {
  font-weight: 600;
}

.attribute-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.15rem 0.75rem;
  margin: 0.5rem 0 1rem;
}

.attribute-list dt {
  font-weight: 600;
}

.attribute-list dd {
  margin: 0;
}

.global-id {
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  color: #666;
  word-break: break-all;
}

.viewer {
  margin-top: 2rem;
}

canvas {
  display: block;
  max-width: 100%;
  border: 1px solid #ccc;
  background: #111;
  touch-action: none;
  cursor: grab;
}

.timeline,
.qto,
.pick,
.storeys,
.appearance {
  margin-top: 2rem;
}

.qto-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.qto-filter-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.qto-filter-controls select {
  margin: 0;
}

.qto-filter-controls output {
  color: #666;
  font-size: 0.9rem;
}

.qto table {
  width: 100%;
  min-width: 48rem;
  border-collapse: collapse;
}

.qto th,
.qto td {
  padding: 0.4rem 0.55rem;
  vertical-align: top;
  text-align: left;
  border: 1px solid #888;
}

.qto th {
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.qto-refused td:last-child {
  color: #b3261e;
}

.timeline-scrubber {
  display: grid;
  gap: 0.4rem;
  max-width: 42rem;
  font-weight: 600;
}

.timeline-scrubber input {
  width: 100%;
}

.task-filter-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  max-width: 42rem;
  margin-top: 0.75rem;
}

.task-filter-controls input,
.task-filter-controls select {
  margin: 0;
}

.task-filter-controls output {
  color: #666;
  font-size: 0.9rem;
}

#local-gantt {
  max-width: 42rem;
  margin-top: 1rem;
}

#local-gantt h3 {
  margin-bottom: 0;
}

.gantt-list {
  display: grid;
  gap: 0.35rem;
}

.gantt-task-row {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(10rem, 2fr) max-content;
  gap: 0.6rem;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.55rem;
  text-align: left;
  border: 1px solid #888;
  border-radius: 0.25rem;
  background: transparent;
}

.gantt-task-label {
  font-weight: 600;
}

.gantt-track {
  display: grid;
  grid-template-columns: repeat(var(--gantt-columns), minmax(0, 1fr));
  grid-template-rows: 1.5rem;
  min-width: 0;
  overflow: hidden;
  border-radius: 0.2rem;
  background: repeating-linear-gradient(
    90deg,
    color-mix(in srgb, currentColor 10%, transparent) 0,
    color-mix(in srgb, currentColor 10%, transparent) calc(100% / var(--gantt-columns) - 1px),
    color-mix(in srgb, currentColor 28%, transparent) calc(100% / var(--gantt-columns) - 1px),
    color-mix(in srgb, currentColor 28%, transparent) calc(100% / var(--gantt-columns))
  );
}

.gantt-bar {
  grid-row: 1;
  z-index: 1;
  align-self: center;
  overflow: hidden;
  padding: 0.18rem 0.35rem;
  color: #fff;
  font-size: 0.78rem;
  white-space: nowrap;
  border-radius: 0.18rem;
  background: #2e6bd8;
}

.gantt-day-marker {
  grid-row: 1;
  z-index: 2;
  justify-self: start;
  width: 2px;
  height: 100%;
  background: #d37b00;
  pointer-events: none;
}

.gantt-task-row:hover,
.gantt-task-row:focus-visible,
.gantt-task-selected {
  outline: 2px solid #2e6bd8;
  outline-offset: 1px;
}

.task-row:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.task-tree {
  display: grid;
  gap: 0.35rem;
  max-width: 42rem;
}

.schedule-tree-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
  max-width: 42rem;
  margin-top: 1rem;
}

.schedule-tree-header h3 {
  margin: 0;
}

.schedule-tree-header button {
  margin: 0;
}

.task-navigation {
  max-width: 42rem;
  margin-top: 0.75rem;
}

.task-navigation .hint {
  margin-bottom: 0;
}

.task-detail {
  max-width: 42rem;
  margin-top: 1rem;
  padding: 0.75rem;
  border: 1px solid #888;
  border-radius: 0.25rem;
}

.task-detail h3 {
  margin: 0;
}

.task-row {
  display: grid;
  grid-template-columns: minmax(11rem, 1fr) max-content max-content;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.65rem;
  text-align: left;
  border: 1px solid #888;
  border-radius: 0.25rem;
  background: transparent;
}

.task-row:hover,
.task-row:focus-visible,
.task-selected {
  outline: 2px solid #2e6bd8;
  outline-offset: 1px;
}

.task-state,
.task-binding {
  color: #666;
  font-size: 0.85rem;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .task-filter-controls {
    align-items: stretch;
  }

  .task-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .gantt-task-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

.storey-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
  font-size: 0.9rem;
}

button {
  margin-top: 0.5rem;
  margin-right: 0.5rem;
}

code {
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
}
