.rec-dialog,
.rec-history {
  --rec-ink: #29243b;
  --rec-muted: #756e83;
  --rec-line: #e6e2ed;
  --rec-accent: #7958c5;
  color: var(--rec-ink);
  font-family: inherit;
}
.rec-dialog *,
.rec-history * { box-sizing: border-box; }
.rec-dialog {
  position: fixed;
  inset: 0;
  width: min(454px, calc(100% - 32px));
  max-height: min(88dvh, 760px);
  margin: auto;
  border: 1px solid var(--rec-line);
  border-radius: 24px;
  padding: 0;
  background: white;
  box-shadow: 0 28px 90px #27203835;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.rec-dialog::backdrop { background: #27213465; backdrop-filter: blur(3px); }
.rec-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--rec-line);
}
.rec-heading { flex: 1; }
.rec-heading h2 { margin: 0; font-size: 21px; line-height: 1.3; font-weight: 700; }
.rec-heading > span { display: block; color: var(--rec-muted); margin-top: 4px; font-size: 12px; }
.rec-kind-icon {
  display: inline-grid;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f1ecfb;
  color: #8062bc;
  flex: 0 0 auto;
}
.rec-kind-icon.rec-measure { color: #557f92; background: #e9f2f5; }
.rec-kind-icon.rec-injection { color: #7561a8; background: #eeebf9; }
.rec-kind-icon.rec-symptom { color: #b36f69; background: #fbefed; }
.rec-kind-icon.rec-meal { color: #ab793c; background: #faf0dd; }
.rec-icon-button,
.rec-footer button,
.rec-severity label,
.rec-primary,
.rec-filters button,
.rec-row { font: inherit; cursor: pointer; }
.rec-icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: #726c7f;
  background: #f6f4f8;
}
.rec-form { display: grid; gap: 19px; padding: 22px 24px 24px; }
.rec-form [data-rec-symptom-details]:not([hidden]) { display: grid; gap: 16px; }
.rec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rec-grid.rec-three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rec-label { display: grid; align-content: start; min-width: 0; gap: 7px; }
.rec-label > span:first-child,
.rec-fieldset legend { color: #524a60; font-size: 13px; font-weight: 650; }
.rec-form input:not([type=radio]),
.rec-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  font: inherit;
  font-size: 15px;
  color: var(--rec-ink);
  background: #fff;
  border: 1px solid #dcd7e5;
  border-radius: 9px;
  padding: 10px 12px;
}
.rec-form textarea { resize: vertical; min-height: 72px; max-height: 220px; }
.rec-form input::placeholder,
.rec-form textarea::placeholder { color: #958e9e; }
.rec-number { display: block; position: relative; }
.rec-number input:not([type=radio]) { padding-right: 39px; }
.rec-number > span {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--rec-muted);
  pointer-events: none;
}
.rec-fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
.rec-fieldset legend { margin: 0 0 9px; padding: 0; }
.rec-fieldset legend small { color: var(--rec-muted); font-size: 11px; font-weight: 400; margin-left: 5px; }
.rec-severity { display: flex; gap: 7px; }
.rec-severity label { flex: 1; position: relative; }
.rec-severity input { position: absolute; opacity: 0; }
.rec-severity span {
  display: grid;
  place-items: center;
  padding: 9px 6px;
  min-height: 40px;
  border: 1px solid var(--rec-line);
  border-radius: 9px;
  font-size: 14px;
}
.rec-severity input:checked + span { color: #6543a6; border-color: #a790cf; background: #f2ecfa; }
.rec-severity input:focus-visible + span,
.rec-dialog :focus-visible,
.rec-history :focus-visible { outline: 3px solid #9c7ed2; outline-offset: 2px; }
.rec-footer { display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.rec-footer button,
.rec-primary { border-radius: 9px; padding: 10px 17px; min-height: 42px; font-size: 14px; font-weight: 650; }
.rec-secondary { margin-left: auto; border: 1px solid var(--rec-line); color: #5c5468; background: #fff; }
.rec-primary { border: 1px solid #7550bf; color: white; background: #7956c2; }
.rec-primary:hover { background: #6844ae; }
.rec-footer button.rec-delete { display: inline-flex; align-items: center; gap: 6px; padding: 8px 3px; color: #9a505e; border: 0; background: transparent; }
.rec-error { margin: 0; padding: 9px 12px; border-radius: 8px; color: #963d49; background: #fff1f1; font-size: 13px; }
.rec-error[hidden] { display: none; }
.rec-history { min-width: 0; }
.rec-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 0 0 24px; }
.rec-filters button {
  border: 1px solid var(--rec-line);
  border-radius: 999px;
  padding: 8px 15px;
  background: #fff;
  color: #655d70;
  font-size: 13px;
  font-weight: 550;
}
.rec-filters button[aria-pressed=true] { color: #6643ac; background: #f0eafa; border-color: #d6c8ea; }
.rec-day { margin: 0 0 22px; }
.rec-day h3 { margin: 0 0 9px; font-size: 13px; font-weight: 600; color: #746d7c; }
.rec-list { background: white; border: 1px solid var(--rec-line); border-radius: 15px; overflow: hidden; }
.rec-row {
  display: flex;
  width: 100%;
  min-height: 68px;
  padding: 12px 16px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid #efedf2;
  color: inherit;
  background: transparent;
  text-align: start;
}
.rec-row:last-child { border-bottom: 0; }
.rec-row:hover { background: #faf8fd; }
.rec-row:focus-visible { outline-offset: -3px; }
.rec-row-copy { flex: 1; min-width: 0; }
.rec-row-copy strong,
.rec-row-copy small { display: block; overflow-wrap: anywhere; }
.rec-row-copy strong { color: #393244; font-size: 15px; font-weight: 650; }
.rec-row-copy small { margin-top: 3px; color: var(--rec-muted); font-size: 12px; }
.rec-row time { color: var(--rec-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.rec-row > svg { flex: 0 0 auto; color: #9b93a6; }
.rec-empty { text-align: center; padding: 44px 12px; background: white; border: 1px dashed var(--rec-line); border-radius: 15px; }
.rec-empty > svg { color: #9478ba; }
.rec-empty h3 { font-size: 17px; margin: 12px 0 16px; }
@media (max-width: 500px) {
  .rec-dialog { width: min(100% - 20px, 454px); max-height: 92dvh; border-radius: 18px; }
  .rec-header { padding: 18px 18px 15px; }
  .rec-form { padding: 18px; gap: 16px; }
  .rec-form input:not([type=radio]), .rec-form textarea { font-size: 16px; }
  .rec-filters { gap: 6px; margin-bottom: 18px; }
  .rec-filters button { padding: 7px 12px; }
  .rec-row { padding: 10px; gap: 8px; }
  .rec-row-copy strong { font-size: 14px; }
}
