/* Everyday outputs and quick setup: morning summary, wall sheet, staff paste, rules in plain words.
   Same layer as the other views (loaded after app.css). */
@layer views {
  /* day page: the two output buttons. Laptop: at the end of the date row. Phone and narrow windows: their own row under the day buttons. */
  .dayout { display: flex; gap: 8px; flex-wrap: wrap; }
  .dayout.top { margin-left: auto; }
  .dayout.low { display: none; margin: -6px 0 16px; }
  .dayout .sm { display: none; }
  @container main (max-width: 980px) { .dayout .lg { display: none; } .dayout .sm { display: inline; } }
  @container main (max-width: 820px) {
    .dayout.top { display: none; }
    .dayout.low { display: flex; }
    .dayout.low button { flex: 1 1 0; }
  }

  /* morning summary pop-up */
  .modal:has(.morning) { width: min(680px, calc(100vw - 24px)); }
  .mstext {
    width: 100%; font: 14px/1.5 var(--font-mono, ui-monospace, Menlo, Consolas, monospace); padding: 10px 12px;
    border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink, inherit); resize: vertical; white-space: pre-wrap;
  }
  .morning .mbtns { align-items: center; }
  .mscopied { margin-right: auto; color: var(--green); font-weight: 600; }

  /* wall sheet: preview in the pop-up, and the printed page */
  .modal:has(.wallwrap) { width: min(1040px, calc(100vw - 24px)); }
  .wsbar h2 { margin: 0; }
  .wsbar p { margin: 4px 0 0; }
  .wallsheet { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; display: grid; gap: 12px; }
  .wshead { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; border-bottom: 2px solid var(--navy); padding-bottom: 8px; }
  .wshead h1 { margin: 0; font-size: 22px; }
  .wshead span { font-size: 16px; font-weight: 600; color: var(--muted); }
  .wsgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-items: stretch; }
  .wsgroup {
    display: grid; grid-template-rows: auto 1fr auto; gap: 8px; border: 1px solid var(--line); border-top: 5px solid var(--gc);
    border-radius: 8px; padding: 10px 12px; break-inside: avoid;
  }
  .wsgroup header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .wsgroup h2 { margin: 0; font-size: 17px; }
  .wsgroup header .muted { margin-left: auto; }
  .wstable { width: 100%; border-collapse: collapse; font-size: 13px; align-self: start; }
  .wstable th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 0 6px 4px 0; border-bottom: 1px solid var(--line); }
  .wstable td { vertical-align: top; padding: 5px 6px 5px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
  .wstable tr:last-child td { border-bottom: 0; }
  .wstable { table-layout: fixed; }
  .wstable th:nth-child(1) { width: 36%; }
  .wstable th:nth-child(2) { width: 8.2em; }
  .wstable td:nth-child(2) { white-space: nowrap; }
  .wstable td { overflow-wrap: anywhere; }
  .wstable .brk { display: block; }
  .wstable .brk span { white-space: nowrap; }
  .wstable td small { display: block; color: var(--muted); font-size: 11px; }
  .wstable td small.wsnote { color: var(--ink, inherit); font-weight: 500; }
  .wsstat { margin: 0; font-size: 13px; font-weight: 600; padding: 4px 8px; border-radius: 6px; }
  .wsstat.ok { background: var(--greenbg); color: #14532d; }
  .wsstat.bad { background: var(--redbg); color: var(--red-deep, var(--red)); }
  .wsstat.norule { background: var(--amberbg); color: var(--ambertext); }
  .wsfoot { display: grid; gap: 4px; font-size: 13px; border-top: 1px solid var(--line); padding-top: 8px; }
  .wsfoot p { margin: 0; }
  .wallwrap { display: grid; gap: 12px; }

  @media (max-width: 760px) {
    .wallsheet { padding: 12px; }
    .wsgrid { grid-template-columns: minmax(0, 1fr); }
    /* phone: one person per block, name and time on top, breaks underneath */
    .wstable, .wstable tbody { display: block; }
    .wstable thead { display: none; }
    .wstable tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; border-bottom: 1px solid var(--line); padding: 6px 0; }
    .wstable tr:last-child { border-bottom: 0; }
    .wstable td { border: 0; padding: 0; overflow-wrap: normal; }
    .wstable td:nth-child(3) { grid-column: 1 / -1; color: var(--muted); }
    .wstable .brk { display: inline-block; margin-right: 12px; }
  }

  /* printing the wall sheet: only the sheet, nothing else on the page */
  @media print {
    html.print-wall .shell, html.print-wall .scrim, html.print-wall .toast, html.print-wall .bottomnav,
    html.print-wall .wsbar, html.print-wall .wallwrap .mbtns { display: none !important; }
    html.print-wall .modal {
      position: static !important; transform: none !important; width: auto !important; max-height: none !important; overflow: visible !important;
      box-shadow: none !important; border: 0 !important; padding: 0 !important; background: #fff;
    }
    html.print-wall .wallsheet { border: 0; padding: 0; }
    html.print-wall .wsgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    html.print-wall .wsgroup, html.print-wall .wsstat { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    html.print-wall .wallsheet { page: wall; gap: 8px; }
    html.print-wall .wsgrid { gap: 8px; }
    html.print-wall .wsgroup { padding: 6px 8px; gap: 4px; }
    html.print-wall .wstable { font-size: 11px; line-height: 1.3; }
    html.print-wall .wstable td { padding: 3px 4px 3px 0; }
    html.print-wall .wshead h1 { font-size: 18px; }
  }
  @page wall { size: A4 portrait; margin: 8mm; }
  @media print {
    html.print-wall, html.print-wall body { background: #fff !important; }
  }
}

/* staff list from Excel */
@layer views {
  .modal:has(.paste) { width: min(900px, calc(100vw - 24px)); }
  .paste h2 { margin: 0; }
  .paste p { margin: 0; }
  .pstext { width: 100%; font: 13px/1.45 ui-monospace, Menlo, Consolas, monospace; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; resize: vertical; white-space: pre; overflow-x: auto; }
  .pscols { display: grid; gap: 6px; }
  .pschips { display: flex; flex-wrap: wrap; gap: 6px; }
  .pschip { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); }
  .pstable td { vertical-align: top; }
  .pstable .pss { text-align: right; white-space: nowrap; }
  .pstable tr.psoff td { color: var(--muted); }
  .pstable small.psnote { display: block; color: var(--ambertext); font-size: 12px; }
}
@layer views {
  .pstable td:nth-child(4), .pstable .tag { white-space: nowrap; }
  @media (max-width: 760px) { .pstable td:nth-child(4) { white-space: normal; } .pstable .pss { text-align: start; } }
}

/* settings › in plain words */
@layer views {
  .rwhead { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; }
  .rwhead h3 { margin: 0 0 4px; }
  .rwhead p { margin: 0; }
  .rwtools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .rwgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px; align-items: stretch; }
  .rwgrid .card { margin: 0; }
  .rwtitle { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
  .rwtitle h3 { margin: 0; }
  .rwtitle button { flex: none; white-space: nowrap; }
  .rwlist { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; line-height: 1.45; }
  .rwlist li.warn { list-style: none; margin-left: -1.1em; color: var(--ambertext); background: var(--amberbg); padding: 4px 8px; border-radius: 6px; }
  @media print {
    .rwtools button, .rwtitle button { display: none !important; }
    .rwgrid { grid-template-columns: 1fr 1fr; }
    .rwsec { break-inside: avoid; }
    .rwlist li.warn { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  }
}
@layer views {
  .psex { border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; display: grid; gap: 6px; background: var(--soft); }
  .psexhead { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; }
  .psextable { border-collapse: collapse; font-size: 12px; background: #fff; }
  .psextable th, .psextable td { border: 1px solid var(--line); padding: 3px 8px; text-align: left; white-space: nowrap; }
  .psextable th { font-weight: 600; }
  .pscolgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .modal label.pscol { display: grid; grid-template-rows: auto auto auto; gap: 3px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: inherit; font-weight: 400; }
  .pscol.on { border-color: var(--blue, #0D6BE8); }
  .pscol.sens { background: var(--soft); }
  .pscol .pshead { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pscol .pssample { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pscol select { width: 100%; }
  @media (max-width: 760px) { .pscolgrid { grid-template-columns: 1fr 1fr; } .psextable { font-size: 11px; } }
}
