/* lib/worklog.css — Work Log view + the printed data sheet. The app shell
   (banner, .app-content, .history-label, .empty-state) comes from index.html. */

:root { --wl: #0f766e; --wl-dark: #115e59; --wl-soft: #ccfbf1; --wl-ink: #134e4a; }

#view-work .app-banner { background: linear-gradient(135deg, #042f2e 0%, #115e59 55%, #0f766e 100%); }

.wl-card { background: white; border-radius: 16px; padding: 18px 16px; margin-bottom: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06); }
.wl-card h2 { font-size: 15px; color: var(--wl-ink); margin-bottom: 12px; }

.wl-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wl-meta .wl-student { grid-column: 1 / -1; }
/* Date inputs have a wide intrinsic size; without min-width:0 two of them overflow a phone-width grid. */
.wl-meta > *, .wl-field input, .wl-field select { min-width: 0; max-width: 100%; }
.wl-field span { display: block; font-size: 11px; color: #6b7280; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.wl-field input, .wl-field select, .wl-other, #wl-comments {
  width: 100%; padding: 11px 12px; border: 1.5px solid #e5e7eb; border-radius: 10px; font-size: 16px; font-family: inherit;
  background: #fafbfc; color: #1a1a1a; min-height: 46px; -webkit-appearance: none; appearance: none;
}
.wl-field input:focus, .wl-field select:focus, .wl-other:focus, #wl-comments:focus { outline: none; border-color: var(--wl); box-shadow: 0 0 0 3px rgba(15,118,110,0.15); background: white; }
#wl-comments { resize: vertical; line-height: 1.4; }
.wl-other { margin-top: 8px; }

.wl-sec { margin-top: 18px; }
.wl-sec h3 { font-size: 12px; font-weight: 800; color: var(--wl-ink); text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 8px; }
.wl-sec h3 em { font-style: normal; font-weight: 600; color: #9ca3af; text-transform: none; letter-spacing: 0; }

.wl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wl-chip {
  min-height: 44px; padding: 10px 14px; border-radius: 999px; border: 1.5px solid #d1d5db; background: white;
  font-size: 15px; font-weight: 600; color: #374151; font-family: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.08s;
}
.wl-chip:active { transform: scale(0.97); }
.wl-chip[aria-pressed="true"] { background: var(--wl); border-color: var(--wl); color: white; }
.wl-chip[aria-pressed="true"]::before { content: '✓ '; }
.wl-single { display: grid; gap: 8px; }
#wl-result { grid-template-columns: repeat(3, 1fr); }
#wl-accuracy { grid-template-columns: repeat(4, 1fr); }
.wl-single .wl-chip { border-radius: 12px; padding: 10px 2px; text-align: center; white-space: nowrap; font-size: clamp(13px, 3.7vw, 15px); }
.wl-single .wl-chip[aria-pressed="true"]::before { content: ''; }
#wl-result .wl-chip[data-key="full"][aria-pressed="true"] { background: #047857; border-color: #047857; }
#wl-result .wl-chip[data-key="partial"][aria-pressed="true"] { background: #b45309; border-color: #b45309; }
#wl-result .wl-chip[data-key="none"][aria-pressed="true"] { background: #b91c1c; border-color: #b91c1c; }

.wl-textbtn { background: none; border: none; color: var(--wl); font-size: 14px; font-weight: 600; padding: 8px 0; cursor: pointer; font-family: inherit; }
.wl-copy { margin-top: 6px; }
.wl-edit-banner { background: #fef3c7; color: #92400e; border-radius: 10px; padding: 6px 12px; margin-bottom: 12px; font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.wl-edit-banner[hidden] { display: none; }
.wl-edit-banner .wl-textbtn { color: #92400e; text-decoration: underline; padding: 4px 0; }

/* Save bar sticks to the bottom of the screen while the form is on it. */
.wl-savebar { position: sticky; bottom: 0; margin: 18px -16px -18px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,0.96); backdrop-filter: blur(8px); border-top: 1px solid #f3f4f6; border-radius: 0 0 16px 16px; }
.wl-savebtns { display: flex; gap: 10px; }
.wl-save { flex: 1; padding: 15px; border: none; border-radius: 12px; background: linear-gradient(135deg, var(--wl), var(--wl-dark)); color: white; font-size: 16px; font-weight: 800; font-family: inherit; cursor: pointer; box-shadow: 0 4px 12px rgba(15,118,110,0.3); }
.wl-save:disabled { opacity: 0.6; }
.wl-delete { padding: 15px 16px; border-radius: 12px; border: 1.5px solid #fecaca; background: white; color: #b91c1c; font-weight: 700; font-size: 15px; font-family: inherit; cursor: pointer; }
.wl-delete[hidden] { display: none; }
.wl-err { color: #b91c1c; font-size: 14px; font-weight: 600; }
.wl-err:not(:empty) { margin-bottom: 8px; }

.wl-ranges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.wl-range { padding: 8px 12px; border-radius: 999px; border: 1.5px solid #e5e7eb; background: white; font-size: 13px; font-weight: 600; color: #4b5563; font-family: inherit; cursor: pointer; }
.wl-range.on { background: var(--wl-soft); border-color: var(--wl); color: var(--wl-ink); }
.wl-print-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.wl-printbtn { padding: 12px 22px; border-radius: 12px; border: none; background: #1f2937; color: white; font-weight: 800; font-size: 15px; font-family: inherit; cursor: pointer; }
.wl-printbtn:disabled { opacity: 0.35; }
.wl-muted { color: #6b7280; font-size: 13px; }
.wl-more { text-align: center; margin: 4px 0 12px; }

.wl-entry { display: block; width: 100%; text-align: left; background: white; border: none; border-left: 4px solid var(--wl); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); font-family: inherit; cursor: pointer; }
.wl-entry.editing { border-left-color: #f59e0b; background: #fffbeb; }
.wl-entry-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: #1f2937; }
.wl-entry-top span { color: #6b7280; font-size: 13px; white-space: nowrap; }
.wl-entry-sum { display: block; margin-top: 4px; font-size: 13px; color: #4b5563; line-height: 1.4; }

.wl-toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: #111827; color: white; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 50; }
.wl-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Printed data sheet (rebuilds the paper form) ---------- */
#print-root { display: none; }
@media print {
  @page { size: letter landscape; margin: 0.5in; }
  html, body { background: white !important; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; color: #000; font-family: Calibri, Carlito, 'Helvetica Neue', Arial, sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pf-page { break-after: page; page-break-after: always; }
  .pf-page:last-child { break-after: auto; page-break-after: auto; }
  .pf-title { font-size: 11pt; margin: 0 0 0.16in; }
  .pf-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 10pt; line-height: 1.15; margin-bottom: 0.2in; break-inside: avoid; page-break-inside: avoid; }
  .pf-table th, .pf-table td { border: 1px solid #000; padding: 2pt 5pt; vertical-align: top; }
  .pf-table th { font-weight: 700; text-align: center; }
  .pf-table td { height: 2.75in; }
  .pf-when { font-size: 10pt; }
  .pf-item { display: flex; align-items: flex-start; gap: 5pt; margin: 0 0 7pt; }
  .pf-box { flex: none; position: relative; width: 9pt; height: 9pt; border: 1px solid #000; margin-top: 2pt; }
  .pf-box.on::after { content: '✓'; position: absolute; left: 0.5pt; top: -5pt; font-size: 12pt; font-weight: 900; line-height: 1; }
  .pf-line { display: inline-block; min-width: 1in; border-bottom: 1px solid #000; margin-left: 3pt; padding: 0 2pt; }
  .pf-wide { display: block; min-width: 0; width: 100%; margin: 4pt 0 0; height: 12pt; }
  .pf-comment { font-size: 9.5pt; line-height: 1.25; border-bottom: 1px solid #000; padding-bottom: 2pt; white-space: pre-wrap; overflow-wrap: anywhere; }
  .pf-comment.pf-small { font-size: 8pt; line-height: 1.2; }
}
