/* styles/sections/doc-shell.css
 * Brief document shot (Status Reporting "The Conflict" ZtcyV, vHNKD, c9zf4q): the shared window
 * (line-2 edge, radius lg) with the document's own shadow, a ruled header (breadcrumb and the
 * version chip, the serif title, the toolbar) and the body (the status chart, its scope line,
 * Conflicts & Risks, Next Actions). The app greys are --app-*. Icons, the pie and the legend
 * swatches are Pencil exports in assets/figures/status-reporting/. The notes (eXXjj) start low
 * beside the document as drawn: 468 down from D, 280 under it on M.
 * The window lays itself out by its own width (container brief-doc): the M frame's stacked
 * breadcrumb and toolbar below 600px, the D frame's rows from there. */
@layer sections {
  .brief-doc {
    --doc-pad: var(--space-20);
    --marker-inset: var(--doc-pad);
    container: brief-doc / inline-size;
    margin: 0;
    box-shadow: var(--elevation-doc);
    font-family: var(--font-body);
    color: var(--app-ink);
  }

  .brief-doc p { margin: 0; }

  .brief-doc__header {
    display: flex;
    flex-direction: column;
    gap: var(--space-14);
    padding: var(--space-28) var(--doc-pad) 17px;
    border-bottom: 1px solid var(--app-line);
  }

  .brief-doc__top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-16);
  }

  .brief-doc__crumbs {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-8);
    font-size: 13px;
    line-height: 16px;
    color: var(--app-ink-2);
  }

  .brief-doc__version {
    display: inline-flex;
    align-items: center;
    gap: var(--space-6);
    padding: 4px 9px;
    border: 1px solid var(--app-line);
    border-radius: 6px;
    font-size: 12px;
    line-height: 14px;
    color: var(--app-ink-2);
  }

  .brief-doc__title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    line-height: round(nearest, 1.05em, 1px);
    letter-spacing: -0.23px;
  }

  .brief-doc__tools {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    font-size: 12px;
    line-height: 14px;
    color: var(--app-ink-2);
  }

  .brief-doc__tool {
    display: inline-flex;
    align-items: center;
    gap: var(--space-6);
  }

  .brief-doc__body {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: var(--space-24) var(--doc-pad) var(--space-40);
  }

  .brief-doc__chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-28);
    /* Drawn inside the box, as Pencil strokes it: the chart is as tall as its pie and legend */
    outline: 1px solid var(--app-line);
    outline-offset: -1px;
    border-radius: var(--radius-md);
  }

  .brief-doc__pie {
    position: relative;
    flex: none;
    width: 168px;
    height: 168px;
  }

  .brief-doc__pie > img { display: block; }

  .brief-doc__pct {
    position: absolute;
    font-size: 11px;
    line-height: 13px;
    color: var(--app-ink-2);
  }

  .brief-doc__pct--33 { top: 40px; left: 40px; }
  .brief-doc__pct--67 { top: 110px; left: 112px; }

  .brief-doc__legend {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
    line-height: 14px;
    color: var(--app-ink-2);
  }

  .brief-doc__legend > li {
    display: flex;
    align-items: center;
    gap: var(--space-8);
  }

  .brief-doc__scope {
    font-size: 13px;
    font-style: italic;
    line-height: 20px;
    color: var(--app-ink-2);
  }

  .brief-doc__section {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    padding-top: var(--space-8);
  }

  .brief-doc__section--actions { gap: var(--space-10); }

  .brief-doc__heading {
    font-size: 17px;
    font-weight: 600;
    line-height: 20px;
  }

  .brief-doc__risks,
  .brief-doc__actions {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    line-height: 22px;
  }

  .brief-doc__risks { gap: var(--space-12); }
  .brief-doc__actions { gap: var(--space-10); }

  .brief-doc__risks > li,
  .brief-doc__actions > li {
    position: relative;
    display: flex;
    gap: var(--space-12);
  }

  .brief-doc__risks > li > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .brief-doc__risks p:not(.brief-doc__lead) { color: var(--app-ink-2); }

  .brief-doc__lead { font-weight: 600; }

  .brief-doc__dot,
  .brief-doc__num {
    flex: none;
    color: var(--app-placeholder);
  }

  .brief-doc__dot { width: 5px; }
  .brief-doc__num { width: 14px; }

  /* Notes start low beside the document, level with Conflicts & Risks */
  .shot-row--conflict .marker-notes { padding-top: 280px; }

  @container brief-doc (width >= 600px) {
    .brief-doc__top {
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
    }

    .brief-doc__crumbs {
      flex-direction: row;
      align-items: center;
    }

    .brief-doc__tools {
      flex-direction: row;
      align-self: flex-end;
      align-items: center;
    }

    .brief-doc__chart {
      flex-direction: row;
      height: 212px;
    }
  }

  @media (min-width: 900px) {
    .brief-doc {
      --doc-pad: var(--space-40);
    }

    .brief-doc__title {
      font-size: 26px;
      letter-spacing: -0.3px;
    }

    .brief-doc__heading {
      font-size: 19px;
      line-height: 23px;
    }

    .shot-row--conflict { grid-template-columns: minmax(0, 860fr) minmax(0, 356fr); }
    .shot-row--conflict .marker-notes { padding-top: 468px; }
  }

  @media (min-width: 1680px) {
    .shot-row--conflict { grid-template-columns: 860px minmax(0, 1fr); }
  }
}
