/* The grey wash calculator (plan 3I2): the mix card, a sheet of paper on the mat with the shades and the table,
   and the inspector's paired fields. The card is paper in both themes (DESIGN.md: paper is dimmed at night,
   never inverted), so its text and rules use the fixed print colors, as site.css's .sheet does. No change colors. */

.wash-mat {
  display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-items: start; align-content: start;
}
@media (max-width: 599px) { .wash .wash-mat { padding: 16px 12px; } }

/* Both cards share one cell, so switching what the page works out never moves the controls under it. */
.wash-card { grid-area: 1 / 1; width: 100%; min-width: 0; max-width: 680px; padding: 20px 20px 16px; color: #111111; }
/* Each redraw of the table and swatches stays inside the card: its own layout and paint, on its own layer, so
   the mat's grid under it is never repainted on a key (INP). */
.wash-card { contain: layout paint; will-change: transform; }
@media (max-width: 599px) { .wash-card { padding: 16px 12px 12px; } }
.wash[data-mode="read"] #set-card, .wash[data-mode="set"] #read-card { visibility: hidden; }

/* The shades, darkest first: a chip of grey over the paper, its number and its percent under it in words. */
.swatches {
  list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: calc(2 * (48px + 40px) + 12px); align-content: start;
}
@media (min-width: 600px) {
  .swatches { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); min-height: 104px; }
}
.swatches li { display: grid; gap: 2px; justify-items: center; min-width: 0; }
.swatches svg { display: block; width: 100%; height: 48px; border: 1px solid #CDD2DA; margin-bottom: 4px; }
@media (min-width: 600px) { .swatches svg { height: 56px; } }
.swatch-name, .swatch-pct {
  font-family: var(--measure); font-weight: 600; font-size: 14px; line-height: 1.2; letter-spacing: .03em;
  font-variant-numeric: tabular-nums; color: #4C5666;
}
.swatch-pct { color: #111111; font-size: 15px; }

/* The table: it scrolls inside its own frame on a narrow phone, never the page. */
/* The caption as seen: outside the scrolling frame, so it wraps to the card on a phone. */
.mix-title { margin: 0 0 8px; font-weight: 600; font-size: 15px; line-height: 1.3; color: #111111; }
.mix-title[data-tone="problem"] { font-size: 16px; }
.mix-title[data-tone="problem"]::before { content: "\26A0\FE0E  "; }
/* A soft shadow at an edge that has more table past it (the covers scroll with the table, the shadows don't). */
.table-wrap {
  overflow-x: auto; overscroll-behavior-x: contain;
  background:
    linear-gradient(to right, var(--paper) 40%, rgba(255, 255, 255, 0)) left center / 28px 100% no-repeat local,
    linear-gradient(to left, var(--paper) 40%, rgba(255, 255, 255, 0)) right center / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .22), rgba(0, 0, 0, 0)) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .22), rgba(0, 0, 0, 0)) right center / 12px 100% no-repeat scroll;
}
.table-wrap:focus-visible { outline: 3px solid #111111; outline-offset: 2px; }
.mix-table { width: 100%; min-width: 30rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.mix-table th, .mix-table td {
  height: 44px; padding: 0 8px; border-bottom: 1px solid #CDD2DA; text-align: right; white-space: nowrap;
}
.mix-table th:first-child, .mix-table td:first-child { text-align: left; padding-left: 0; }
.mix-table th:last-child, .mix-table td:last-child { padding-right: 0; }
.mix-table thead th { font-size: 15px; font-weight: 600; color: #4C5666; border-bottom-color: #9AA3B2; }
.mix-table tbody th { font-size: 15px; font-weight: 600; color: #111111; }
.mix-table td { font-family: var(--measure); font-weight: 600; font-size: 17px; color: #111111; }
.mix-table td.mix-problem { font-family: inherit; font-weight: 500; font-size: 16px; text-align: left; padding-left: 0; color: #4C5666; }

.wash-key { margin: 12px 0 0; font-size: 15px; line-height: 1.4; color: #4C5666; max-width: 60ch; }
.wash-notes { margin: 8px 0 0; min-height: 1.4em; font-size: 15px; line-height: 1.4; font-weight: 600; color: #111111; max-width: 60ch; }
.wash-notes:empty { min-height: 0; }

/* Under 900 px the mat sits above the controls, so the card keeps room for 8 shades and changing the set never
   moves the field being used. The notes move to the status line under the controls (greywash.js writes them
   there too), next to the field the artist is typing in. Heights measured in Chrome for 8 shades, plus spare. */
@media (max-width: 899px) {
  .wash-notes { display: none; }
  #set-card { min-height: 760px; } /* 736 measured at 360, 716 at 390 */
}
@media (max-width: 359px) { #set-card { min-height: 780px; } } /* 757 measured at 320 */
@media (min-width: 600px) and (max-width: 899px) { #set-card { min-height: 660px; } } /* 635 measured at 600 */

/* Read a mix: one chip, the percent large. */
.read-card { display: grid; justify-items: center; align-content: start; gap: 4px; text-align: center; padding-top: 28px; }
.read-swatch { display: block; width: 144px; height: 144px; border: 1px solid #CDD2DA; margin-bottom: 12px; }
.read-figure { margin: 0; color: #111111; }
.read-percent {
  font-family: var(--measure); font-weight: 600; font-size: 56px; line-height: 1; font-variant-numeric: tabular-nums;
}
.read-of { display: block; margin-top: 4px; font-size: 17px; font-weight: 600; }
.read-ratio {
  margin: 12px 0 0; min-height: 1.2em; font-family: var(--measure); font-weight: 600; font-size: 24px;
  font-variant-numeric: tabular-nums; color: #111111;
}
.read-words { margin: 4px 0 0; max-width: 32ch; font-size: 16px; line-height: 1.4; color: #4C5666; }

/* The inspector: modes swap whole groups of fields; two short fields share a row. */
.mode-fields { display: grid; gap: 22px; }
.mode-fields[hidden] { display: none; }
.field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.field-pair > .hint { grid-column: 1 / -1; margin-top: 0; }
.field-pair .note:empty { min-height: 0; }
.field-pair .note { margin-top: 6px; }
.inspector .note:empty { display: none; }
