/* The Desk v2 — ported from the v1 design language: paper & ink, serif
   wordmark, monospace eyebrows, 2x2 matrix with ghost digits, amber flag card. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

.desk { min-height: 100vh; background: #EFF1EE; color: #1C2126;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.45; padding: 0 0 48px; }

.bar { background: #1C2126; color: #EFF1EE; padding: 14px 20px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.wordmark { font-family: Georgia, "Times New Roman", serif;
  font-size: 22px; letter-spacing: 0.5px; }
.bar .date { font-family: ui-monospace, Menlo, monospace; font-size: 12px;
  color: #9AA3A0; }
.bar button { margin-left: auto; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 20px 16px; }

.card { background: #FDFDFB; border: 1px solid #C9CEC8; margin-bottom: 20px; }
.card > .head { display: flex; align-items: baseline; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid #C9CEC8; }
.cardpad { padding: 0 14px 10px; }
.secthead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }

.eyebrow { font-family: ui-monospace, Menlo, monospace; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; color: #5E6660; }
.count { font-family: ui-monospace, Menlo, monospace; font-size: 11px;
  color: #5E6660; }
.stale { color: #8A6A14; }

button { font: inherit; font-size: 12px; padding: 4px 12px; cursor: pointer;
  background: #FDFDFB; color: #1C2126; border: 1px solid #1C2126;
  min-height: 28px; }
button:hover { background: #1C2126; color: #FDFDFB; }
button:focus-visible { outline: 2px solid #1E5945; outline-offset: 2px; }
button:disabled { opacity: 0.4; cursor: default; }
.ghostbtn { border-color: #9AA39F; color: #5E6660; }
.headbtn { margin-left: auto; }

.cols { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; }

/* — the matrix: signature element — */
.matrix { display: grid; grid-template-columns: 1fr 1fr;
  border: 2px solid #1C2126; background: #1C2126; gap: 2px; }
.cell { background: #FDFDFB; min-height: 150px; padding: 12px;
  position: relative; overflow: hidden; }
.cell .ghost { position: absolute; right: 4px; bottom: -22px;
  font-family: Georgia, serif; font-size: 110px; line-height: 1;
  color: #1C2126; opacity: 0.05; user-select: none; pointer-events: none; }
.cell h3 { margin: 0; font-size: 14px; font-weight: 700; }
.cell h3 span { display: block; font-weight: 400; font-size: 11px;
  color: #5E6660; margin-top: 1px; }
.cell.q1 h3 { color: #1E5945; }

.tasklist { list-style: none; margin: 10px 0 0; padding: 0; position: relative; }
.tasklist li { padding: 0; border-top: 1px dotted #C9CEC8; }
.taskbtn { display: flex; gap: 8px; align-items: baseline; width: 100%;
  text-align: left; background: none; border: none; padding: 10px 2px;
  min-height: 44px; font-size: 13.5px; cursor: pointer; }
.taskbtn:hover { background: #F2F3EF; color: inherit; }
.taskbtn .due { margin-left: auto; font-family: ui-monospace, monospace;
  font-size: 11px; color: #5E6660; white-space: nowrap; }
.taskbtn .matter { font-family: ui-monospace, monospace; font-size: 10px;
  color: #9AA39F; white-space: nowrap; }
.taskbtn.busy { opacity: 0.45; }

.flag { background: #FBF3DC; border: 1px solid #C7A75B; }
.flag .head { border-bottom-color: #C7A75B; }
.flag .eyebrow { color: #8A6A14; }

.maillist { list-style: none; margin: 0; padding: 6px 14px 10px; }
.maillist li { padding: 8px 0; border-top: 1px dotted #C9CEC8; }
.maillist li:first-child { border-top: none; }
.m-from { font-size: 12px; color: #5E6660; }
.m-subj { font-weight: 600; font-size: 13.5px; }
.m-prev { font-size: 12.5px; color: #444B47; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; }
.m-when { font-family: ui-monospace, monospace; font-size: 11px; color: #9AA39F; }

.empty { padding: 16px 14px; color: #5E6660; font-size: 13px; }
.err { padding: 12px 14px; color: #7A2E2E; font-size: 13px;
  background: #F7ECEC; border-top: 1px solid #D9BABA; }

.digest-frame { display: block; width: 100%; height: 540px; border: none;
  background: #FDFDFB; }

.pilehead { width: 100%; text-align: left; border: none; background: none;
  padding: 12px 14px; display: flex; gap: 10px; align-items: baseline;
  min-height: 44px; }
.pilehead:hover { background: #F2F3EF; color: inherit; }

/* voicemails */
.vmlist { list-style: none; margin: 0; padding: 6px 14px 10px; }
.vmlist li { display: flex; gap: 10px; padding: 10px 0;
  border-top: 1px dotted #C9CEC8; align-items: center; }
.vmlist li:first-child { border-top: none; }
.vm-meta { flex: 1; min-width: 0; }
.vm-done { min-height: 44px; min-width: 64px; flex: none; }
.vm-queued { font-family: ui-monospace, monospace; font-size: 11px;
  color: #1E5945; flex: none; max-width: 130px; text-align: right; }

/* toast */
.toast { position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 60; background: #7A2E2E; color: #FDFDFB; padding: 10px 18px;
  font-size: 13px; max-width: 92vw; box-shadow: 0 2px 10px rgba(28,33,38,0.35); }

/* action sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(28,33,38,0.45);
  z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #FDFDFB; border: 1px solid #C9CEC8; border-bottom: none;
  width: 100%; max-width: 480px; padding: 16px 16px
  calc(16px + env(safe-area-inset-bottom, 0px)); }
.sheet-name { font-size: 14px; font-weight: 600; margin-bottom: 12px;
  overflow-wrap: anywhere; }
.sheet-actions { display: flex; flex-direction: column; gap: 8px; }
.sheet-actions button { min-height: 44px; font-size: 14px; }
.sheet-quads { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet-done { background: #1E5945; color: #FDFDFB; border-color: #1E5945; }
.sheet-done:hover { background: #17452F; }

/* — mobile: single column, matrix stacks, tap targets stay ≥44px — */
@media (max-width: 820px) {
  .cols { grid-template-columns: 1fr; }
  .digest-frame { height: 65vh; }
}
@media (max-width: 480px) {
  .matrix { grid-template-columns: 1fr; }
  .cell { min-height: 110px; }
  .bar { padding-left: 14px; padding-right: 14px; }
  .wrap { padding: 14px 10px; }
}
