:root {
  --pr-bg: #eef7fa;
  --pr-card: #ffffff;
  --pr-ink: #16303a;
  --pr-muted: #5b7380;
  --pr-line: #d7e7ed;
  --pr-accent: #009dc4;
  --pr-accent-dark: #007a99;
  --pr-star: #f5b301;
  --pr-star-empty: #d5dee3;
  --pr-ok: #0a7a3f;
  --pr-danger: #b42318;
  --pr-safe: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 420px at 50% -80px, #b9e8f4 0%, transparent 70%),
    var(--pr-bg);
  color: var(--pr-ink);
  font-family: "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

body {
  padding: 0 0 calc(96px + var(--pr-safe));
}

body.pr-done {
  padding-bottom: calc(24px + var(--pr-safe));
}

.pr-top {
  background: linear-gradient(180deg, #009dc4 0%, #0086aa 100%);
  color: #fff;
  padding: 22px 16px 28px;
  text-align: center;
}

.pr-logo {
  display: inline-block;
  letter-spacing: 0.18em;
  font-size: 15px;
  font-weight: 800;
  opacity: 0.92;
}

.pr-top h1 {
  margin: 10px 0 6px;
  font-size: 26px;
  font-weight: 800;
}

.pr-top p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
}

.pr-wrap {
  width: min(560px, calc(100% - 24px));
  margin: -16px auto 0;
}

.pr-card {
  background: var(--pr-card);
  border: 1px solid var(--pr-line);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 10px 28px rgba(22, 48, 58, 0.08);
}

.pr-section-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
  color: var(--pr-accent-dark);
  letter-spacing: 0.04em;
}

.pr-doctor-card {
  border-color: #9ad7e6;
  box-shadow: 0 12px 30px rgba(0, 157, 196, 0.14);
}

.pr-doctor-card .pr-q {
  font-size: 17px;
}

.pr-q,
.pr-label {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.7;
  font-weight: 800;
}

.pr-item + .pr-item {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--pr-line);
}

.pr-input,
.pr-textarea {
  width: 100%;
  border: 1.5px solid #c9dbe3;
  border-radius: 14px;
  background: #f8fcfd;
  color: var(--pr-ink);
  font: inherit;
  font-size: 16px;
  padding: 14px 14px;
  outline: none;
}

.pr-textarea {
  min-height: 120px;
  resize: vertical;
}

.pr-comment {
  min-height: 88px;
}

.pr-optional {
  font-weight: 400;
  color: var(--pr-muted);
  font-size: 13px;
}

.pr-input:focus,
.pr-textarea:focus {
  background: #fff;
  border-color: var(--pr-accent);
  box-shadow: 0 0 0 4px rgba(0, 157, 196, 0.14);
}

.pr-hello {
  display: none;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #e8f8ee;
  color: var(--pr-ok);
  font-weight: 800;
  font-size: 14px;
}

.pr-hello.is-bad {
  background: #fff1f0;
  color: var(--pr-danger);
}

.pr-stars {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  direction: ltr;
}

.pr-star {
  flex: 1;
  min-height: 56px;
  border: 1px solid #e4edf1;
  border-radius: 14px;
  background: #f7fbfc;
  color: var(--pr-star-empty);
  font-size: 30px;
  line-height: 1;
  padding: 0;
}

.pr-star.is-on {
  color: var(--pr-star);
  background: #fff8e6;
  border-color: #f3d36a;
}

.pr-score {
  display: block;
  text-align: center;
  min-height: 20px;
  margin-top: 8px;
  color: var(--pr-muted);
  font-size: 13px;
  font-weight: 800;
}

.pr-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pr-choice label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border: 1.5px solid #c9dbe3;
  border-radius: 14px;
  font-weight: 800;
  background: #f8fcfd;
}

.pr-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pr-choice label.is-on {
  border-color: var(--pr-accent);
  background: #e5f6fb;
  color: var(--pr-accent-dark);
}

.pr-hidden { display: none; }

.pr-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 12px calc(12px + var(--pr-safe));
  background: linear-gradient(180deg, rgba(238, 247, 250, 0), #eef7fa 28%);
}

.pr-submit {
  width: min(560px, 100%);
  display: block;
  margin: 0 auto;
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #12b3dc, #009dc4);
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(0, 157, 196, 0.28);
}

.pr-submit:disabled { opacity: 0.65; }

.pr-errors {
  background: #fff1f0;
  color: var(--pr-danger);
  border: 1px solid #ffd1cf;
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-weight: 700;
}

.pr-thanks {
  text-align: center;
  padding: 28px 16px 22px;
}

.pr-thanks-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e8f8ee;
  color: var(--pr-ok);
  font-size: 30px;
  font-weight: 800;
}

.pr-thanks h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.pr-thanks p {
  margin: 0;
  color: var(--pr-muted);
  font-size: 15px;
  line-height: 1.7;
}

.pr-summary {
  margin: 18px 0 0;
  text-align: right;
  background: #f6fbfd;
  border: 1px solid var(--pr-line);
  border-radius: 16px;
  padding: 12px 12px 8px;
}

.pr-summary-title {
  margin: 0 4px 10px;
  font-size: 15px;
  font-weight: 800;
  color: var(--pr-accent-dark);
}

.pr-summary-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 6px 10px;
  padding: 6px 4px;
  border-top: 1px solid var(--pr-line);
}

.pr-summary-row:first-of-type { border-top: 0; }

.pr-summary-label {
  font-size: 13px;
  font-weight: 800;
}

.pr-summary-stars {
  color: var(--pr-star);
  letter-spacing: 1px;
  font-size: 14px;
  line-height: 1;
}

.pr-summary-score {
  color: var(--pr-muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.pr-summary-notes {
  margin: 8px 0 2px;
  padding-top: 8px;
  border-top: 1px solid var(--pr-line);
}

.pr-summary-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 8px;
  align-items: start;
  width: 100%;
  margin: 0;
  padding: 5px 2px;
  border: 0;
  background: transparent;
  color: var(--pr-ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  text-align: right;
  cursor: pointer;
}

.pr-summary-note + .pr-summary-note {
  border-top: 1px dashed var(--pr-line);
}

.pr-summary-note b {
  display: inline-block;
  margin: 1px 0 0;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e5f6fb;
  color: var(--pr-accent-dark);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.pr-summary-note span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-width: 0;
  color: var(--pr-ink);
  text-align: right;
  word-break: break-word;
}

.pr-summary-note.is-open span {
  display: block;
  -webkit-line-clamp: unset;
  white-space: pre-wrap;
}

.pr-again {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  background: var(--pr-accent);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  margin-top: 16px;
}

.default-report .pr-remove-cell {
  width: 44px;
  text-align: center;
  white-space: nowrap;
}

.pr-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #f0c2c2;
  border-radius: 8px;
  background: #fff5f5;
  color: #a00000;
  cursor: pointer;
}

.pr-remove-btn:hover {
  background: #a00000;
  border-color: #a00000;
  color: #fff;
}

.default-report .pr-cell-note {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 170px;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}

@media (min-width: 720px) {
  .pr-top { padding-top: 32px; }
  .pr-card { padding: 20px; }
}
