.transmissions {
  background: var(--sage-50);
}

.transmissions [hidden] {
  display: none !important;
}

.app-header {
  background: var(--ivory);
  border-bottom: 1px solid var(--border);
}

.app-header-inner,
.app-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.app-header-inner {
  min-height: 64px;
  justify-content: space-between;
}

.app-header a {
  padding-block: 0.625rem;
}

.workspace {
  max-width: 1040px;
  padding-block: clamp(1.75rem, 5vw, 4rem);
}

.workspace h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.45rem;
}

.demo-note {
  max-width: 62ch;
  margin-bottom: 1.5rem;
  color: var(--muted);
}

.workspace-grid {
  display: grid;
  gap: 1rem;
  align-items: start;
}

.section-overview,
.day-sheet {
  min-width: 0;
  border: 1px solid var(--sage-300);
  border-radius: var(--radius);
  background: var(--surface);
}

.section-overview,
.sheet-header,
.sheet-section {
  padding: clamp(1rem, 3vw, 1.75rem);
}

.section-toolbar {
  display: grid;
  gap: 0.75rem;
  align-items: start;
}

.section-toolbar p,
.overview-help {
  margin-bottom: 0;
  color: var(--muted);
}

.overview-help {
  margin-top: 0.75rem;
}

.section-list {
  padding: 0;
  margin-block: 0.8rem 0;
  list-style: none;
}

.child-row {
  display: grid;
  gap: 0.6rem;
  padding: 0.85rem 0.65rem;
  border-top: 1px solid var(--border);
}

.child-row.is-selected {
  background: var(--sage-50);
}

.child-row-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.3rem 0.7rem;
}

.child-row-header h3 {
  margin: 0;
}

.child-status {
  color: var(--muted);
  font-size: 0.875rem;
}

.child-status.has-review {
  color: var(--sage-800);
  font-weight: 700;
}

.child-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.25rem 0.55rem;
  margin: 0;
  font-size: 0.875rem;
}

.child-summary dt {
  color: var(--muted);
}

.child-summary dd {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.child-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
}

.child-actions .text-button {
  font-size: 0.875rem;
}

.section-return {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 0.4rem;
}

.sheet-header {
  background: var(--ivory);
  border-radius: var(--radius) var(--radius) 0 0;
}

.sheet-header p,
.sheet-section > p {
  color: var(--muted);
}

.sheet-section {
  border-top: 1px solid var(--border);
}

.sheet-section h3 {
  font-size: 1.25rem;
}

#arrival-summary {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.transmissions label {
  display: grid;
  gap: 0.3rem;
  color: var(--text);
  font-weight: 600;
}

.transmissions input,
.transmissions select,
.transmissions textarea {
  min-width: 0;
  width: 100%;
  min-height: 46px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--sage-700);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.transmissions textarea {
  resize: vertical;
}

.transmissions :is(select, textarea):focus-visible {
  outline: 3px solid var(--sage-800);
  outline-offset: 3px;
}

.sheet-section details {
  margin-block: 0.65rem 1rem;
}

.sheet-section summary,
.text-button {
  min-height: 44px;
  padding: 0.5rem 0;
  color: var(--sage-800);
  font-weight: 700;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.transmissions .review-control {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
}

.review-control input {
  width: 1.15rem;
  min-height: 0;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--sage-700);
}

.sheet-section summary span,
.text-button {
  text-decoration: underline;
}

.sheet-section form,
.field-pair {
  display: grid;
  gap: 0.85rem;
}

.sheet-section form {
  padding: 0.9rem;
  border: 1px solid var(--sage-300);
  border-radius: var(--radius-small);
  background: var(--sage-50);
}

.sheet-section .btn {
  cursor: pointer;
  width: 100%;
  padding-inline: 0.65rem;
  box-shadow: none;
}

.text-button {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 1rem;
}

.entry-context {
  margin: 0;
  color: var(--sage-800);
  font-weight: 700;
}

.save-status:empty,
.form-error:empty {
  margin: 0;
}

.sheet-section form .form-error:empty {
  position: absolute;
}

.save-status:not(:empty) {
  margin: 0.9rem 0 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--sage-300);
  border-radius: 8px;
  background: var(--sage-50);
  color: var(--sage-900);
}

.form-error {
  color: #842e20;
  margin: 0;
}

.transmissions [aria-invalid="true"] {
  border-color: #842e20;
}

.event-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.event-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 0.35rem 0.8rem;
  align-items: start;
  padding-block: 0.85rem;
  border-top: 1px solid var(--border);
}

.event-item h4 {
  margin: 0.2rem 0 0;
}

.event-item time {
  color: var(--sage-800);
  font-variant-numeric: tabular-nums;
}

.event-item p {
  margin: 0.25rem 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

@media (min-width: 600px) {
  .field-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sheet-section .btn {
    width: auto;
    justify-self: start;
    padding-inline: 1rem;
  }
}

@media (min-width: 760px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  }
}
