/* Peptide Calendar */
.pcal { padding-top: 6px; }
.pcal-builder { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.6fr); gap: 14px; align-items: start; }
.pcal-panel { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pcal-panel h2 { margin: 0 0 10px; font-size: 22px; }
.pcal-help { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.pcal-settings { display: grid; gap: 12px; margin-bottom: 12px; }
.pcal-settings label, .pcal-field > label, .pcal-label { display: grid; gap: 6px; color: var(--text); font-size: 14px; font-weight: 700; }
.pcal-settings label span, .pcal-field label span { color: var(--faint); font-weight: 500; }
.pcal select, .pcal input[type=time], .pcal input[type=date], .pcal input[type=number], .pcal input:not([type]) {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg); color: var(--text); font: inherit; color-scheme: dark;
}
.pcal select:focus, .pcal input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .15); }

.pcal-items { display: grid; gap: 12px; margin-bottom: 12px; }
.pcal-item { padding: 16px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-2); }
.pcal-item.is-picking { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .15); }
.pcal-item__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pcal-item__head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcal-item__num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; }
.pcal-dot { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%; }
.pcal-remove { padding: 6px 8px; border: 0; background: none; color: var(--faint); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.pcal-remove:hover { color: #fca5a5; }
.pcal-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.pcal-field { display: grid; gap: 6px; }
.pcal-field[hidden] { display: none; }
.pcal-field--wide { grid-column: 1 / -1; }
.pcal-days { display: flex; flex-wrap: wrap; gap: 6px; }
.pcal-day input, .pcal-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.pcal-day span { display: inline-block; min-width: 48px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 600; text-align: center; cursor: pointer; }
.pcal-day input:checked + span { border-color: var(--cyan); background: var(--cyan); color: #03161d; }
.pcal-day input:focus-visible + span, .pcal-swatch input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }
.pcal-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.pcal-swatch { position: relative; display: grid; justify-items: center; gap: 3px; cursor: pointer; }
.pcal-swatch span { width: 30px; height: 30px; border: 2px solid transparent; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25); }
.pcal-swatch em { color: var(--faint); font-size: 11px; font-style: normal; }
.pcal-swatch input:checked + span { border-color: #fff; box-shadow: 0 0 0 2px var(--cyan); }
.pcal-swatch input:checked ~ em { color: var(--text); font-weight: 700; }
.pcal-add { width: 100%; justify-content: center; }
.pcal-pick { width: 100%; justify-content: center; }

/* The printable sheet */
.pcal-sheet { margin-top: 18px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pcal-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.pcal-sheet__head h2 { margin: 0; font-size: 26px; text-align: center; }
.pcal-sheet__brand { display: block; color: var(--cyan); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.pcal-step { width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; }
.pcal-step:hover { border-color: var(--cyan); color: var(--cyan); }
.pcal-pick-hint { margin: 0 0 12px; padding: 10px 12px; border: 1px solid rgba(34, 211, 238, .45); border-radius: 10px; background: rgba(34, 211, 238, .08); color: var(--text); font-size: 14px; }
.pcal-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pcal-grid th { padding: 8px 4px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-align: center; text-transform: uppercase; }
.pcal-grid td { height: 96px; padding: 4px; border: 1px solid var(--line); vertical-align: top; overflow: hidden; }
.pcal-grid td.is-blank { background: rgba(0, 0, 0, .15); }
.pcal-grid td.is-today .pcal-num { background: var(--cyan); color: #03161d; }
.pcal-grid td.is-pickable { cursor: pointer; }
.pcal-grid td.is-pickable:hover, .pcal-grid td.is-pickable:focus { outline: 2px solid var(--cyan); outline-offset: -2px; }
.pcal-grid td.is-picked { background: rgba(34, 211, 238, .12); }
.pcal-num { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-bottom: 3px; padding: 0 4px; border-radius: 6px; color: var(--text); font-size: 13px; font-weight: 700; }
.pcal-chip { display: block; margin-top: 2px; padding: 2px 6px; border-radius: 5px; font-size: 11px; font-weight: 700; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pcal-c-blue { background: #3b82f6; color: #fff; }
.pcal-c-cyan { background: #06b6d4; color: #03161d; }
.pcal-c-green { background: #22c55e; color: #052e14; }
.pcal-c-yellow { background: #eab308; color: #2b2100; }
.pcal-c-orange { background: #f97316; color: #2a1000; }
.pcal-c-red { background: #ef4444; color: #fff; }
.pcal-c-pink { background: #ec4899; color: #fff; }
.pcal-c-purple { background: #a855f7; color: #fff; }
.pcal-c-brown { background: #a16207; color: #fff; }
.pcal-c-gray { background: #64748b; color: #fff; }
.pcal-legend { display: grid; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.pcal-legend li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; }
.pcal-legend .pcal-dot { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pcal-legend__rule { color: var(--muted); }
.pcal-sheet__foot { display: flex; justify-content: space-between; gap: 12px; margin: 12px 0 0; color: var(--faint); font-size: 12px; }

/* Step 3 */
.pcal-actions { margin-top: 18px; }
.pcal-actions__row { display: flex; flex-wrap: wrap; gap: 10px; }
.pcal-actions__row .calc-btn { text-decoration: none; }
.pcal-status { min-height: 1.4em; margin: 12px 0; color: var(--green); font-size: 14px; font-weight: 600; }
.pcal-howto-list { display: grid; gap: 4px; margin: 0 0 14px; padding-left: 18px; color: var(--muted); font-size: 14px; }
.pcal-google__list { display: flex; flex-wrap: wrap; gap: 8px; }
.pcal-gcal { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 9px; color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.pcal-gcal:hover { border-color: var(--cyan); color: var(--cyan); }
.pcal-gcal.is-off { color: var(--faint); border-style: dashed; }
.pcal-info { margin-top: 40px; }

@media (max-width: 900px) {
  .pcal-builder { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .pcal-fields { grid-template-columns: 1fr; }
  .pcal-panel, .pcal-sheet { padding: 14px; }
  .pcal-grid td { height: 64px; padding: 2px; }
  .pcal-grid th { font-size: 10px; letter-spacing: 0; }
  .pcal-num { min-width: 20px; height: 20px; font-size: 11px; }
  /* On phones the chips shrink to colored bars; the key below the calendar names them. */
  .pcal-chip { height: 6px; margin-top: 3px; padding: 0; font-size: 0; }
}

/* One landscape page: just the month, the key, and the footer line. */
@media print {
  @page { size: landscape; margin: 8mm; }
  .pcal-hero, .pcal-builder, .pcal-actions, .pcal-info { display: none !important; }
  .pcal .wrap { width: 100%; }
  .pcal-sheet { margin: 0; padding: 0; border: 0; background: #fff !important; color: #000 !important; }
  .pcal-sheet__head { justify-content: center; margin-bottom: 6pt; }
  .pcal-sheet__head h2 { color: #000 !important; font-size: 20pt; }
  .pcal-sheet__brand { color: #0e7490 !important; }
  .pcal-grid th { color: #333 !important; padding: 3pt; }
  .pcal-grid td { height: 22mm; border-color: #999 !important; background: #fff !important; }
  .pcal-grid td.is-blank { background: #f3f3f3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pcal-num, .pcal-grid td.is-today .pcal-num { color: #000 !important; background: none !important; }
  .pcal-chip { font-size: 8pt; }
  .pcal-legend li, .pcal-legend b { color: #000 !important; font-size: 10pt; }
  .pcal-legend__rule, .pcal-sheet__foot { color: #444 !important; }
}
