/* =========================================================================
   patriarsch.at -- the productivity pack
   Paired with office.js. Everything here sits inside a .bad-dialog from
   desktop.css and inherits its Windows 95 chrome, its buttons and its
   .bad-feedback / .bad-actions / .bad-muted furniture, so this file is only
   the four app interiors and nothing else.

   Best viewed during a meeting that could have been an email.
   ========================================================================= */

/* --- arsch sweeper -------------------------------------------------------- */
/* Narrower than the other windows: a 6x6 grid of square cells that is allowed
   to be 560px wide stops looking like a minefield and starts looking like a
   spreadsheet. */
#bad-sweeper { width: min(430px, calc(100vw - 24px)); }
.sweeper-console {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px; margin: 16px 0 12px; border: 3px inset #eee;
}
/* The red seven-segment counter, in VT323 on near-black -- the one part of the
   original everyone can picture. */
.sweeper-counter {
  background: #210000; color: #ff2828; padding: 0 5px;
  font: 38px/1 'VT323', monospace; letter-spacing: 2px;
}
.sweeper-console button { font-size: 24px; padding: 3px 8px; }
.sweeper-console > span { text-align: right; font-size: 13px; }
.sweeper-grid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0; border: 3px inset #eee;
}
/* Overrides the shared .bad-dialog button sizing: cells are square and packed,
   so min-height and padding have to go rather than be reduced. */
.bad-dialog .sweeper-cell {
  min-width: 0; width: 100%; aspect-ratio: 1; min-height: 0; padding: 0;
  border: 3px outset #eee; font: 700 21px/1 ui-monospace, monospace;
}
.bad-dialog .sweeper-cell.revealed { border: 1px solid #929292; background: #c0c0c0; }
/* Minesweeper's own number colours, which are load-bearing for reading a
   board at a glance and have not changed since 1990. */
.sweeper-cell[data-neighbors="1"] { color: #0000bf; }
.sweeper-cell[data-neighbors="2"] { color: #006800; }
.sweeper-cell[data-neighbors="3"] { color: #bd0000; }
.sweeper-cell[data-neighbors="4"] { color: #000064; }
.sweeper-cell[data-neighbors="5"], .sweeper-cell[data-neighbors="6"] { color: #690000; }
.bad-dialog .sweeper-cell.hit { background: #ff5353; }
/* The cells have no gap, so a focus ring drawn outside one is drawn under its
   neighbour. Inset it and lift the focused cell out of the stack. */
.bad-dialog .sweeper-cell:focus-visible { position: relative; z-index: 1; outline-offset: -5px; }

/* --- task manager --------------------------------------------------------- */
/* Green on black for the summary, because the numbers are invented and the
   readout should look like it believes them. */
.task-summary {
  display: flex; justify-content: space-between; gap: 8px; padding: 10px;
  background: #001c00; color: #7cff6b;
  font-family: 'VT323', monospace; font-size: 20px; margin: 16px 0 12px;
}
.task-summary span { font-size: 17px; }
/* Heading and rows share one column template so they stay aligned -- the rows
   are buttons, not table cells, and nothing else would line them up. */
.task-heading, .task-process {
  display: grid; grid-template-columns: minmax(0, 1.55fr) 45px minmax(0, 1fr);
  gap: 7px; align-items: center;
}
.task-heading { padding: 6px 9px; border: 2px outset #eee; font-size: 14px; }
.task-list { background: white; padding: 3px; border: 2px inset #eee; }
/* A list row, so the shared bevelled-button look is flattened back out. */
.bad-dialog .task-process {
  width: 100%; text-align: left; padding: 9px 5px;
  background: white; border: 1px solid transparent; font-size: 14px;
}
/* overthinking.exe grows a counter in its name every time it restarts. */
.task-process span { overflow-wrap: anywhere; }
.bad-dialog .task-process[aria-pressed="true"] { background: #000080; color: white; }
.bad-dialog .task-process:hover:not([aria-pressed="true"]) { background: #dfedff; }
.bad-dialog .task-process:focus-visible { outline-offset: -3px; outline-color: #7b9bed; }

/* --- the printer ---------------------------------------------------------- */
.printer-hardware {
  display: flex; align-items: center; gap: 14px;
  margin: 18px 0; padding: 15px; border: 2px inset #eee;
}
.printer-hardware > span { font-size: 48px; }
.printer-hardware div { min-width: 0; }
.printer-hardware small {
  display: block; overflow-wrap: anywhere;
  font: 11px/1.6 monospace; margin-top: 5px;
}
.printer-queue { border-top: 2px groove #eee; padding-top: 12px; }
#printer-name { margin-top: 5px; }
/* Actual paper: warm white, monospace, torn top and bottom. pre-wrap because
   the certificate is a template string and its line breaks are the layout. */
.printer-receipt {
  white-space: pre-wrap; overflow-wrap: anywhere;
  padding: 18px 14px; background: #fffdf0; color: #222;
  font: 12px/1.5 monospace; box-shadow: 2px 3px #0003;
  border-top: 3px dashed #777; border-bottom: 3px dashed #777;
}

/* --- corporate apology ---------------------------------------------------- */
/* File Edit View Deflect. Pulled up into the window's own padding so it reads
   as a menu bar rather than as the first line of the document. */
.memo-menu {
  padding: 5px 0 9px; margin: -8px 0 16px;
  border-bottom: 2px groove #eee; color: #444;
}
.apology-form { margin-top: 16px; }
.apology-form input { margin-top: 5px; }
.accountability { margin: 18px 0 12px; font-size: 14px; }
.accountability meter { display: block; width: 100%; height: 20px; }
/* The memo is the one thing here that is not Windows 95: white paper and a
   serif, because that is what the apology would actually arrive in. */
.memo-paper { border: 1px solid #898989; box-shadow: 3px 3px #0003; background: #fff; padding: 24px; color: #222; }
.memo-paper small { font: 10px/1.4 monospace; letter-spacing: .06em; }
.memo-paper h2 { font: 700 23px/1.15 Georgia, serif; margin: 17px 0; }
/* pre-wrap keeps the drafts' paragraph breaks; overflow-wrap survives a
   hundred characters of incident with no spaces in it. */
.memo-paper .memo-copy {
  font: 15px/1.5 Georgia, serif;
  white-space: pre-wrap; overflow-wrap: anywhere; margin: 0;
}

/* --- small screens -------------------------------------------------------- */
/* The sweeper needs nothing here: its cells are fractional and its window is
   already capped to the viewport. These four are the ones with fixed columns
   or real paper in them. */
@media (max-width: 640px) {
  .task-heading, .task-process { grid-template-columns: minmax(0, 1.4fr) 33px minmax(0, 1fr); gap: 4px; }
  .bad-dialog .task-process { font-size: 13px; }
  .task-summary { flex-wrap: wrap; }
  .memo-paper { padding: 17px; }
  .printer-receipt { font-size: 11px; padding: 14px 10px; }
}
