/* 0.5.99 - quiet CT and Commercial worksheets.
   Screen-only colors: no control, layout, status, focus or print changes.
   The subtle gray of calculated cells remains separate from editable cells. */
@media screen {
  html[data-theme] {
    --row599-paper: #ffffff;
    --row599-stripe: #fcfcfd;
    --row599-calculated: #f7f8fa;
    --row599-hover: #f4f7f9;
    --row599-calculated-hover: #eff3f6;
    --row599-heading: #f7f8fa;
    --row599-stage: #fafbfc;
    --row599-stage-hover: #f1f4f6;
    --row599-total: #f3f5f7;
    --row599-line: #edf0f2;
    --row599-column-line: #f1f3f5;
  }

  html[data-theme=dark] {
    --row599-paper: #202427;
    --row599-stripe: #222629;
    --row599-calculated: #262b2f;
    --row599-hover: #272d32;
    --row599-calculated-hover: #2c3338;
    --row599-heading: #24292d;
    --row599-stage: #23282c;
    --row599-stage-hover: #2a3035;
    --row599-total: #282e33;
    --row599-line: #30373c;
    --row599-column-line: #2b3237;
  }

  html[data-theme=dark][data-theme-variant=blue] {
    --row599-paper: #192534;
    --row599-stripe: #1b2736;
    --row599-calculated: #202d3b;
    --row599-hover: #223142;
    --row599-calculated-hover: #273747;
    --row599-heading: #1e2b3b;
    --row599-stage: #1c2938;
    --row599-stage-hover: #233244;
    --row599-total: #223142;
    --row599-line: #2c3a4b;
    --row599-column-line: #273545;
  }

  /* The native saved CT and saved Commercial have their own roots. Keep the
     same treatment in both editing and consultation, including the wide CT. */
  html[data-theme][data-interface567]
  :is(#ct592-editor, #ct577-root, #commercial593-editor, .commercial593-readonly)
  .b575-scroll {
    border-color: var(--row599-line);
  }

  html[data-theme][data-interface567]
  :is(#ct592-editor, #ct577-root, #commercial593-editor, .commercial593-readonly)
  .b575-table {
    background-color: var(--row599-paper);
  }

  html[data-theme][data-interface567]
  :is(#ct592-editor, #ct577-root, #commercial593-editor, .commercial593-readonly)
  .b575-table > :is(thead, tbody, tfoot) > tr > :is(th, td) {
    border-top-color: var(--row599-line);
    border-bottom-color: var(--row599-line);
    border-left-color: var(--row599-column-line);
    border-right-color: var(--row599-column-line);
  }

  /* Most of the table stays at the paper level. Alternation is only a very
     small change, rather than a second colored band competing with numbers. */
  html[data-theme][data-interface567]
  :is(#ct592-editor, #ct577-root, #commercial593-editor, .commercial593-readonly)
  .b575-table > tbody > tr[data-b575-row] > td {
    background-color: var(--row599-paper);
  }

  html[data-theme][data-interface567]
  :is(#ct592-editor, #ct577-root, #commercial593-editor, .commercial593-readonly)
  .b575-table > tbody:nth-of-type(2n) > tr[data-b575-row] > td {
    background-color: var(--row599-stripe);
  }

  html[data-theme][data-interface567]
  :is(#ct592-editor, #ct577-root, #commercial593-editor, .commercial593-readonly)
  .b575-table > tbody > tr[data-b575-row] > td.b575-calculated {
    background-color: var(--row599-calculated) !important;
  }

  html[data-theme][data-interface567]
  :is(#ct592-editor, #ct577-root, #commercial593-editor, .commercial593-readonly)
  .b575-table .b575-name {
    box-shadow: 1px 0 0 var(--row599-column-line);
  }

  html[data-theme][data-interface567]
  :is(#ct592-editor, #ct577-root, #commercial593-editor, .commercial593-readonly)
  .b575-table > thead > tr > th {
    background-color: var(--row599-heading);
  }

  html[data-theme][data-interface567]
  :is(#ct592-editor, #ct577-root, #commercial593-editor, .commercial593-readonly)
  .b575-table > tfoot > tr > :is(th, td) {
    background-color: var(--row599-total) !important;
  }

  /* A stage is identified by its label, chevron and original left accent.
     Its full width no longer inherits a colored wash from that accent. */
  html[data-theme][data-interface567]
  :is(#ct592-editor, #ct577-root, #commercial593-editor, .commercial593-readonly)
  .stage597-table > tbody[data-stage597-header] > tr > th {
    background-color: var(--row599-stage);
    border-left-color: var(--stage597-accent);
  }

  html[data-theme][data-interface567]
  :is(#ct592-editor, #ct577-root, #commercial593-editor, .commercial593-readonly)
  .stage597-table .stage597-toggle {
    background: var(--row599-stage);
  }

  html[data-theme][data-interface567]
  :is(#ct592-editor, #ct577-root, #commercial593-editor, .commercial593-readonly)
  .stage597-table .stage597-count {
    background-color: var(--row599-paper);
    border-color: var(--row599-line);
  }

  @media (hover: hover) {
    html[data-theme][data-interface567]
    :is(#ct592-editor, #ct577-root, #commercial593-editor, .commercial593-readonly)
    .b575-table > tbody > tr[data-b575-row]:hover > td {
      background-color: var(--row599-hover);
    }

    html[data-theme][data-interface567]
    :is(#ct592-editor, #ct577-root, #commercial593-editor, .commercial593-readonly)
    .b575-table > tbody > tr[data-b575-row]:hover > td.b575-calculated {
      background-color: var(--row599-calculated-hover) !important;
    }

    html[data-theme][data-interface567]
    :is(#ct592-editor, #ct577-root, #commercial593-editor, .commercial593-readonly)
    .stage597-table .stage597-toggle:hover {
      background: var(--row599-stage-hover);
    }
  }
}
