/* Shared workspace chrome for the Decoys and Reports tab groups. The child views keep their
   established classes; these rules only own the grouping and responsive treatment. */

.workspace-page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0;
}

/* The page head every main page opens with (js/page_head.js, tickets 931 and 972): the page title
   alone on the left, with an optional `meta` line under it, and on the right the page's time control
   and actions. No eyebrow and no lead: the local nav row names the section (design note rule 1).
   css/depth.css draws it as a HUD title bar; this file owns its layout. */
.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--space-6);
  margin-bottom: var(--space-5);
}

.workspace-head > div:first-child {
  min-width: 0;
}

/* One title size on every page (ticket 931); the phone rule below makes it fluid. */
.workspace-title {
  font: var(--type-large-title);
  margin: 0;
}

.workspace-meta {
  margin: var(--space-2) 0 0;
  color: var(--ink-muted);
  font-size: var(--fs-2xs);
}

.workspace-head__action {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3) var(--space-4);
  flex-wrap: wrap;
}

/* The time control and the actions are two groups in the one action slot. */
.workspace-head__time,
.workspace-head__buttons {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* The evidence strip lives in the head's time slot on the evidence pages; it loses the row it has at
   its home in index.html. Two classes, so it beats console-simple.css's margins at every width. */
.workspace-head__action .evidence-summary {
  margin: 0;
  max-width: none;
}

/* A day-range label's muted second part: where the capture starts when that is after the window. */
.page-head__range-note {
  color: var(--ink-muted);
}

.workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
  padding: .3rem;
  margin: 0 0 1.35rem;
  border: 1px solid var(--border);
  border-radius: .75rem;
  background: rgba(255, 255, 255, .025);
}

.workspace-tabs__tab {
  appearance: none;
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: .45rem .85rem;
  border-radius: .55rem;
  background: transparent;
  border: 1px solid transparent;
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-dim);
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease,
    border-color 0.12s ease;
}

.workspace-tabs__tab:hover {
  background: var(--glass);
  color: var(--ink);
}

.workspace-tabs__tab:focus-visible {
  outline: 2px solid var(--gold-2);
  outline-offset: 2px;
}

.workspace-tabs__tab.is-active {
  background: var(--gold-soft);
  border-color: var(--border-gold);
  color: var(--gold);
  box-shadow: none;
}

.workspace-tabs__tab[disabled] {
  opacity: .5;
  cursor: default;
}

.workspace-presentations {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
}

.workspace-presentations__label {
  color: var(--ink-muted);
  font: var(--type-footnote);
}

.workspace-tab-content > .section:first-child {
  margin-top: 0;
}

.workspace-head__actions, .workspace-runtime, .service-card__actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
}
.workspace-runtime { margin-top: .5rem; font-size: var(--fs-xs); }
.workspace-meta--status { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .8rem; }
.workspace-meta--status > .workspace-meta, .workspace-meta--status > .workspace-runtime { margin: 0; }
/* The runtime pill (30px) fills this host after the scenario read answers; keep its row until then so
   the tabs and the page below do not drop by 10px (ticket 926). */
.workspace-runtime:empty { min-height: 1.875rem; }
.report-actions { position: relative; align-self: flex-start; }
.report-actions > summary { cursor: pointer; list-style: none; }
.report-actions > summary::-webkit-details-marker { display: none; }
.report-actions > summary::after { content: "▾"; margin-left: .6rem; }
.report-actions__menu {
  position: absolute; right: 0; top: calc(100% + .4rem); z-index: 10;
  display: grid; gap: .4rem; min-width: 13rem; padding: .6rem;
  border: 1px solid var(--border-strong); border-radius: .6rem; background: var(--panel);
  box-shadow: 0 .5rem 1.5rem rgb(0 0 0 / .3);
}
.report-actions__menu > .btn { justify-content: flex-start; white-space: nowrap; }
.service-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.service-card__head, .scenario-current__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.service-card__name, .scenario-current__name { margin: 0 0 .3rem; font-family: var(--font-ui); font-size: var(--fs-md); }
.service-card__id { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--ink-dim); }
.service-card__desc, .service-card__note, .scenario-current__description { font-family: var(--font-ui); color: var(--ink-dim); font-size: var(--fs-sm); }
.service-card__facts { display: grid; gap: .8rem; margin: 1.2rem 0; }
.service-card__facts > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; }
.service-card__facts dt { color: var(--ink-dim); }
.service-card__facts dd { margin: 0; overflow-wrap: anywhere; }
.service-card__address { font-family: var(--font-mono); }
.scenario-current { padding: 1.1rem; border: 1px solid var(--border); border-radius: .7rem; background: var(--panel); }
.scenario-current__description { margin: .3rem 0; }
.scenario-current__services { margin: .8rem 0 0; color: var(--ink-dim); }
.workspace-tab-content > details { margin-top: 1.5rem; }
.workspace-tab-content > details > summary { cursor: pointer; color: var(--ink-dim); padding: .7rem 0; }

@media (max-width: 640px) {
  .report-actions__menu { left: 0; right: auto; }
  .workspace-page {
    padding-inline: 0;
  }

  .workspace-presentations {
    width: 100%;
  }
}

/* A phone (760px and narrower): the title (and its meta line), then the time slot on a row of its own
   across the head, and the actions wrapping below it. */
@media (max-width: 760px) {
  .workspace-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-title {
    font-size: clamp(1.5rem, 7vw, var(--fs-xl));
  }

  .workspace-head > div:first-child,
  .workspace-head__action {
    width: 100%;
  }

  .workspace-head__action {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }

  .workspace-head__time,
  .workspace-head__buttons {
    width: 100%;
  }

  .workspace-head__action .evidence-summary {
    width: 100%;
  }
}

/* Evidence keeps its own narrow-viewport head layout: .investigate-shell__head's media rule below
   is scoped to that compound selector (matching investigate.css:507) so it out-specifies the
   unconditional .workspace-head{display:flex} above regardless of stylesheet load order — that
   rule used to live in investigate.css, but decoys-reports.css loads after it, so an equal-
   specificity single-class selector there always lost the cascade (ticket 007 review finding 2).
   */
@media (max-width: 820px) {
  .workspace-head.investigate-shell__head {
    display: grid;
    align-items: start;
  }
}

@media print {
  .workspace-tabs,
  .workspace-presentations {
    display: none;
  }

  .workspace-head__action {
    display: none;
  }

  .workspace-page {
    max-width: none;
    padding: 0;
  }
}
