/* pae.css — Pre-Anaesthetic Evaluation tracker. Local-only. Mobile-first. */

.pae-tool-card { text-align: left; padding: 1.25rem 1rem; }
.pae-tool-card h2 { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; color: var(--ink); text-align: left; }
.pae-tool-card > p { text-align: left; color: var(--muted); font-size: 0.82rem; line-height: 1.5; margin: 0.35rem 0 1rem; }

.pae-new-btn { margin-bottom: 0.9rem; }

.pae-form-wrap {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.pae-form-row { display: flex; gap: 0.6rem; }
.pae-form-row .field { flex: 1; min-width: 0; }

.pae-form-actions { display: flex; gap: 0.5rem; margin-top: 0.2rem; }
.pae-form-actions .ob-btn { padding: 0.75rem; font-size: 0.85rem; }

.pae-case-list { display: flex; flex-direction: column; gap: 0.65rem; }

.pae-case {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.pae-case-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 0.9rem;
  cursor: pointer;
}

.pae-case-info { flex: 1; min-width: 0; }
.pae-case-label { font-size: 0.96rem; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pae-case-meta { font-size: 0.7rem; color: var(--muted); margin-top: 1px; }

.pae-status-pill {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.pae-status-pill.investigations { background: var(--red-d); color: var(--red); }
.pae-status-pill.complete { background: var(--green-d); color: var(--green); }

.pae-case-chevron { width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; transition: transform 0.2s; flex-shrink: 0; }
.pae-case.open .pae-case-chevron { transform: rotate(180deg); }

.pae-case-delete {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.pae-case-delete:active { color: var(--red); }
.pae-case-delete svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

.pae-case-body { display: none; border-top: 1px solid var(--border); padding: 0.85rem 0.9rem 1rem; }
.pae-case.open .pae-case-body { display: block; }

.pae-section-label {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin: 0.7rem 0 0.5rem;
}
.pae-section-label:first-child { margin-top: 0; }

.pae-test-grid { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.4rem; }

.pae-test-chip {
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.42rem 0.75rem;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.pae-test-chip.sent { background: var(--accent-soft); border-color: rgba(170,68,101,.22); color: var(--accent); }
.pae-test-chip.received { background: var(--green-d); border-color: rgba(46,125,79,.22); color: var(--green); }
.pae-test-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.5; }
.pae-test-chip.sent .dot, .pae-test-chip.received .dot { opacity: 1; }

.pae-category-list { display: flex; flex-direction: column; gap: 0.6rem; }

.pae-category {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.65rem 0.75rem;
}
.pae-category.ready { border-color: rgba(46,125,79,.28); background: var(--green-d); }

.pae-category-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.pae-category-label { font-size: 0.8rem; font-weight: 700; color: var(--ink); }
.pae-category-check { color: var(--green); font-weight: 700; font-size: 0.85rem; }

.pae-thumb-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.pae-thumb {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
}
.pae-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pae-thumb-pdf {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-size: 0.6rem; font-weight: 800; color: var(--accent);
  background: var(--accent-soft);
}
.pae-thumb-remove {
  position: absolute; top: 1px; right: 1px;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(36,35,49,.72); color: #fff; border: none;
  font-size: 0.7rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.pae-thumb-add {
  width: 52px; height: 52px; border-radius: 10px;
  border: 1.5px dashed var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted); flex-shrink: 0;
}
.pae-thumb-add svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.pae-share-btn { margin-top: 0.9rem; }

.pae-empty { text-align: center; font-size: 0.8rem; color: var(--muted); font-style: italic; padding: 1.5rem 0.5rem; }

.ob-btn.secondary { background: #fff; border: 1.5px solid var(--border); color: var(--ink); box-shadow: none; }
/* Custom PAE report slots — additions only; existing PAE styles remain unchanged. */
.pae-category-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pae-custom-remove {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.pae-custom-remove:active {
  color: var(--red);
}

.pae-custom-add {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.pae-custom-add-input {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.pae-custom-add-btn {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;

  border: none;
  border-radius: 50%;

  background: var(--accent);
  color: #fff;

  font-family: var(--sans);
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;
  margin: 0;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.pae-custom-add-btn:active {
  transform: scale(0.96);
}