/* `[hidden]` polyfill — see work-order.css for rationale. Required for
   the pre-auth modal (display: flex) and the recommendations card. */
[hidden] { display: none !important; }

:root {
  --green: #1B4D2E;
  --green-mid: #2D6A42;
  --green-light: #4A8C5C;
  --green-pale: #EAF3DE;
  --amber: #E07B24;
  --amber-light: #F59B4A;
  --cream: #FAFAF5;
  --dark: #0F1F14;
  --text: #1A1A1A;
  --text-mid: #4A4A4A;
  --text-muted: #7A7A72;
  --border: #E2E0D4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  background:
    radial-gradient(ellipse 70% 55% at 8% 5%, rgba(74,140,92,0.10), transparent 55%),
    radial-gradient(ellipse 60% 50% at 95% 95%, rgba(224,123,36,0.08), transparent 55%),
    linear-gradient(180deg, #f7faf2 0%, #fafdf5 100%);
}

.portal-nav {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px clamp(18px, 4vw, 42px);
  background: rgba(15,31,20,0.97);
  box-shadow: 0 2px 24px rgba(0,0,0,0.22);
}

.portal-logo img {
  width: auto;
  height: 88px;
}

.portal-call {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.portal-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.portal-hero {
  position: relative;
  padding: clamp(32px, 6vw, 64px);
  border-radius: 28px;
  background:
    radial-gradient(ellipse 50% 70% at 8% 15%, rgba(243,144,25,0.20), transparent 60%),
    radial-gradient(ellipse 60% 60% at 95% 90%, rgba(74,140,92,0.22), transparent 55%),
    linear-gradient(135deg, #112418 0%, #0F1F14 50%, #0a1810 100%);
  color: #fff;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(27,77,46,0.18);
}

.portal-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 32px 32px;
}

.portal-hero > * {
  position: relative;
}

.portal-eyebrow {
  display: inline-flex;
  margin: 0 0 16px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(243,144,25,0.32);
  background: rgba(243,144,25,0.10);
  color: rgba(255,255,255,0.82);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  line-height: 1.03;
  text-transform: uppercase;
}

h1 {
  max-width: 14ch;
  color: #fff;
  font-size: clamp(40px, 7vw, 72px);
}

.portal-hero p:not(.portal-eyebrow) {
  max-width: 58ch;
  margin: 16px 0 0;
  color: rgba(255,255,255,0.78);
}

.portal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

.portal-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(27,77,46,0.06);
}

.portal-card h2 {
  color: var(--green);
  font-size: 30px;
  margin-bottom: 14px;
}

.portal-status {
  background: var(--green-pale);
}

.portal-status span,
.portal-total span,
.portal-contact dt {
  color: var(--text-muted);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.portal-status strong,
.portal-total strong {
  display: block;
  color: var(--green);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 42px;
  line-height: 1;
  text-transform: uppercase;
}

.portal-status p,
.portal-help p {
  color: var(--text-mid);
}

.portal-services {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.portal-services li,
.portal-total {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border-radius: 10px;
  background: #f7faf2;
}

.portal-total {
  margin-top: 12px;
  align-items: center;
}

.portal-contact {
  display: grid;
  gap: 12px;
  margin: 0;
}

.portal-contact div {
  display: grid;
  gap: 4px;
}

.portal-contact dd {
  margin: 0;
  color: var(--text-mid);
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.portal-actions a,
.portal-error a {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #F59B4A 0%, #C96A2A 100%);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.portal-error {
  margin-top: 18px;
}

@media (max-width: 760px) {
  .portal-nav {
    min-height: 92px;
  }

  .portal-logo img {
    height: 68px;
  }

  .portal-grid {
    grid-template-columns: 1fr;
  }
}

/* Your System card */
.portal-system {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(74,140,92,0.10) 0%, rgba(255,255,255,0.95) 100%);
  border: 1px solid rgba(74,140,92,0.25);
}
.portal-system-intro {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.5;
}
.portal-system-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 18px;
  margin: 0 0 16px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(27,77,46,0.10);
}
.portal-system-grid dt {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
  align-self: center;
}
.portal-system-grid dd {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
}
.portal-system-zones h3 {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 8px;
}
.portal-zone-list {
  margin: 0;
  padding: 0 0 0 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px 18px;
  font-size: 14px;
  color: var(--text-mid);
}
.portal-zone-list li::marker {
  color: var(--green);
  font-weight: 700;
}
.portal-system-zone-meta {
  color: var(--text-muted);
  font-size: 13px;
}
@media (max-width: 540px) {
  .portal-system-grid { grid-template-columns: 1fr; gap: 4px; }
  .portal-system-grid dt { padding-top: 6px; }
}

/* ============= Status timeline ============= */
.portal-timeline {
  margin: 0 auto 28px;
  max-width: 920px;
  padding: 22px 28px;
  background: #fff;
  border: 1px solid rgba(27, 77, 46, 0.12);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(15, 31, 20, 0.05);
}
.timeline-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  position: relative;
}
.timeline-track::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 10%;
  right: 10%;
  height: 3px;
  background: rgba(27, 77, 46, 0.10);
  border-radius: 999px;
}
.timeline-track li {
  position: relative;
  text-align: center;
  padding: 0 6px;
}
.timeline-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid rgba(27, 77, 46, 0.18);
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
  transition: all 0.2s ease;
}
.timeline-track li.is-complete .timeline-dot {
  background: #1B4D2E;
  border-color: #1B4D2E;
}
.timeline-track li.is-complete .timeline-dot::after {
  content: "✓";
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.timeline-track li.is-current .timeline-dot {
  background: #E07B24;
  border-color: #E07B24;
  box-shadow: 0 0 0 6px rgba(224, 123, 36, 0.18);
}
.timeline-track li.is-current .timeline-dot::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}
.timeline-label {
  display: block;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(15, 31, 20, 0.55);
  font-weight: 600;
}
.timeline-track li.is-complete .timeline-label,
.timeline-track li.is-current .timeline-label {
  color: #1B4D2E;
}
.timeline-track li.is-current .timeline-label {
  font-weight: 700;
}

/* ============= Work-order card ============= */
.portal-workorder {
  background: linear-gradient(135deg, rgba(27, 77, 46, 0.06) 0%, rgba(27, 77, 46, 0.01) 100%);
  border: 1px solid rgba(27, 77, 46, 0.22);
}
.workorder-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(27, 77, 46, 0.10);
}
.workorder-eyebrow {
  display: block;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(15, 31, 20, 0.55);
  font-weight: 600;
  margin-bottom: 4px;
}
.workorder-id {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: #1B4D2E;
  font-weight: 700;
}
.workorder-status {
  background: rgba(74, 140, 92, 0.18);
  color: #1B4D2E;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.workorder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin: 0;
  padding: 0;
}
.workorder-grid > div {
  margin: 0;
}
.workorder-grid dt {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(15, 31, 20, 0.55);
  margin-bottom: 2px;
}
.workorder-grid dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #1B4D2E;
}
.workorder-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: rgba(224, 123, 36, 0.06);
  border-left: 3px solid var(--amber, #E07B24);
  border-radius: 6px;
  font-size: 13px;
  color: rgba(15, 31, 20, 0.75);
  line-height: 1.55;
}
.workorder-diagnosis {
  margin-top: 16px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid rgba(27, 77, 46, 0.18);
  border-left: 3px solid var(--green-mid, #2D6A42);
  border-radius: 8px;
}
.workorder-diagnosis header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.diagnosis-eyebrow {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #1B4D2E;
  font-weight: 700;
}
.diagnosis-source {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(15, 31, 20, 0.50);
  font-style: italic;
}
.diagnosis-summary {
  margin: 0 0 8px;
  font-weight: 600;
  font-size: 15px;
  color: #1B4D2E;
  line-height: 1.4;
}
.diagnosis-detail {
  margin: 0;
  font-size: 13px;
  color: rgba(15, 31, 20, 0.75);
  line-height: 1.55;
  white-space: normal;
}
.diagnosis-footnote {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px dashed rgba(27, 77, 46, 0.14);
  font-size: 12px;
  color: rgba(15, 31, 20, 0.60);
  line-height: 1.5;
  font-style: italic;
}

.workorder-doc {
  margin-top: 16px;
  padding: 14px 16px;
  background: #fff;
  border: 1px dashed rgba(27, 77, 46, 0.25);
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.workorder-doc-icon {
  font-size: 24px;
  line-height: 1;
}
.workorder-doc strong {
  display: block;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1B4D2E;
  margin-bottom: 2px;
}
.workorder-doc p {
  margin: 0;
  font-size: 13px;
  color: rgba(15, 31, 20, 0.65);
  line-height: 1.5;
}
.workorder-doc a {
  color: var(--amber, #E07B24);
  font-weight: 600;
  text-decoration: none;
}
.workorder-doc a:hover { text-decoration: underline; }

@media (max-width: 540px) {
  .workorder-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .workorder-grid { grid-template-columns: 1fr; }
}

/* ============= Accept-quote card ============= */
.portal-accept {
  background: linear-gradient(135deg, rgba(224, 123, 36, 0.08) 0%, rgba(224, 123, 36, 0.02) 100%);
  border: 1px solid rgba(224, 123, 36, 0.30);
}
.portal-accept.is-accepted {
  background: linear-gradient(135deg, rgba(74, 140, 92, 0.10) 0%, rgba(74, 140, 92, 0.02) 100%);
  border-color: rgba(74, 140, 92, 0.30);
}
.portal-btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.portal-btn-primary {
  background: linear-gradient(135deg, #F59B4A 0%, #E07B24 100%);
  color: #fff;
  box-shadow: 0 6px 14px rgba(224, 123, 36, 0.25);
}
.portal-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(224, 123, 36, 0.32);
}
.portal-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.portal-accept-note {
  margin-top: 12px;
  font-size: 14px;
  color: rgba(15, 31, 20, 0.65);
  min-height: 18px;
}

/* ============= Message PJL form ============= */
.portal-message-card textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(15, 31, 20, 0.18);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
  margin: 6px 0 12px;
  background: #fff;
}
.portal-message-card textarea:focus {
  outline: none;
  border-color: #1B4D2E;
  box-shadow: 0 0 0 3px rgba(27, 77, 46, 0.12);
}
.portal-message-card label {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(15, 31, 20, 0.65);
}
.portal-message-status {
  margin-top: 10px;
  font-size: 14px;
  color: rgba(15, 31, 20, 0.65);
  min-height: 18px;
}

/* ============= Activity log ============= */
.portal-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.portal-activity-list li {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(15, 31, 20, 0.06);
  font-size: 14px;
}
.portal-activity-list li:last-child {
  border-bottom: none;
}
.portal-activity-list strong {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(15, 31, 20, 0.55);
}

@media (max-width: 760px) {
  .portal-timeline {
    padding: 18px 14px;
  }
  .timeline-label {
    font-size: 11px;
    letter-spacing: 0.02em;
  }
  .timeline-track::before {
    left: 14%;
    right: 14%;
  }
  .portal-activity-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.portal-photos-note {
  font-size: 13px;
  color: rgba(15, 31, 20, 0.6);
  margin-top: -4px;
  margin-bottom: 10px;
}
.portal-photo-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.portal-photo-link {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(15, 31, 20, 0.1);
  background: #f7f4ec;
  transition: transform .15s, box-shadow .15s;
}
.portal-photo-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 31, 20, 0.12);
}
.portal-photo-link img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

/* ---- Open recommendations card + pre-auth modal (spec §6) ----------- */

.portal-recommendations-intro {
  margin: 0 0 14px;
  color: #444;
  line-height: 1.55;
}
.portal-recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.portal-recommendation {
  background: #FAFAF5;
  border: 1px solid #E5E5DD;
  border-radius: 10px;
  padding: 14px;
}
.portal-rec-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.portal-rec-zone {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #1B4D2E;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.portal-rec-type {
  font-size: 16px;
  color: #1F2A22;
}
.portal-rec-total {
  font-size: 15px;
  font-weight: 700;
  color: #1B4D2E;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.portal-rec-notes {
  margin: 6px 0;
  color: #444;
  line-height: 1.5;
}
.portal-rec-photos {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.portal-rec-photo {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  border: 1px solid #d8d8c9;
  background: #EFEFE5 center/cover no-repeat;
}
.portal-rec-lines {
  margin: 8px 0;
  padding-left: 18px;
  color: #444;
  font-size: 14px;
}
.portal-rec-lines li { margin-bottom: 2px; }
.portal-rec-line-qty { color: #777; font-weight: 500; }
.portal-rec-action {
  margin-top: 10px;
  width: 100%;
}

/* Modal */

body.portal-modal-open { overflow: hidden; }
.portal-preauth-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 31, 20, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}
@media (min-width: 600px) {
  .portal-preauth-modal { align-items: center; }
}
.portal-preauth-card {
  background: #fff;
  width: 100%;
  max-width: 460px;
  border-radius: 14px 14px 4px 4px;
  padding: 18px 18px 14px;
  box-shadow: 0 -8px 30px rgba(15, 31, 20, 0.25);
  display: grid;
  gap: 10px;
}
@media (min-width: 600px) {
  .portal-preauth-card { border-radius: 14px; }
}
.portal-preauth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.portal-preauth-header h2 { margin: 0; font-size: 18px; color: #1B4D2E; }
.portal-preauth-close {
  background: none;
  border: 0;
  font-size: 26px;
  line-height: 1;
  color: #555;
  cursor: pointer;
}
.portal-preauth-summary {
  margin: 0;
  font-weight: 600;
  color: #1F2A22;
  background: #EAF3DE;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #C7E0A8;
}
.portal-preauth-help { margin: 0; font-size: 13px; color: #555; line-height: 1.5; }
.portal-preauth-label { font-weight: 600; font-size: 13px; color: #444; }
.portal-preauth-input {
  font-family: inherit;
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid #d8d8c9;
  border-radius: 8px;
  background: #fff;
}
.portal-preauth-canvas {
  width: 100%;
  height: 140px;
  border: 1px dashed #1B4D2E;
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}
.portal-preauth-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 8px;
}
.portal-preauth-clear {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  color: #555;
  border: 1px solid #d8d8c9;
  cursor: pointer;
  min-height: 44px;
}
.portal-preauth-error { margin: 0; color: #C03A2C; font-size: 13px; }

/* Customer notification preferences (spec §6.3) */
.portal-prefs-form { display: flex; flex-direction: column; gap: 12px; }
.portal-prefs-field { display: flex; flex-direction: column; gap: 4px; }
.portal-prefs-field span { font-size: 12px; font-weight: 600; color: #555; text-transform: uppercase; letter-spacing: 0.04em; }
.portal-prefs-field input {
  font-family: inherit;
  font-size: 15px;
  padding: 9px 12px;
  border: 1px solid #d8d8c9;
  border-radius: 8px;
  background: #fff;
}
.portal-prefs-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #FAFAF5;
  border: 1px solid #E5E5DD;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #1F2A22;
}
.portal-prefs-toggle input { width: 18px; height: 18px; cursor: pointer; }
.portal-prefs-status { margin: 6px 0 0; font-size: 13px; color: #555; }

/* ============= Workorder action row + secondary button ============= */
.workorder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 4px;
}
.portal-btn-secondary {
  background: #fff;
  color: var(--green);
  border: 1.5px solid var(--green);
  padding: 11px 20px;
  min-height: 44px;
}
.portal-btn-secondary:hover:not(:disabled) {
  background: var(--green-pale);
}

/* ============= Reschedule modal =============
   Single-panel, centered on every viewport. No bottom-sheet, no slide-up,
   no swipe-between-views. Body scrolls vertically inside the card. */
.portal-resched-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 31, 20, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
.portal-resched-card {
  background: #fff;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  border-radius: 14px;
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}
.portal-resched-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.portal-resched-header h2 {
  margin: 0;
  font-size: 19px;
  color: var(--green);
}
.portal-resched-close {
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 8px;
}
.portal-resched-close:hover { background: var(--green-pale); color: var(--green); }
.portal-resched-toolate {
  padding: 14px 4px 10px;
}
.portal-resched-toolate p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.5;
}
.portal-resched-toolate a.portal-btn {
  display: inline-block;
  text-decoration: none;
  margin-top: 4px;
}
.portal-resched-body {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-grow: 1;
}
.portal-resched-current {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-mid);
}
.portal-resched-current strong { color: var(--green); }
.portal-resched-help {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}
.portal-resched-slots {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.portal-resched-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  min-height: 44px;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.portal-resched-date:hover { background: var(--cream); }
.portal-resched-date.is-open {
  background: var(--green-pale);
  border-color: var(--green);
}
.portal-resched-date-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
}
.portal-resched-date-count {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.portal-resched-times {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px 4px;
  margin-top: -2px;
  margin-bottom: 4px;
}
.portal-resched-times[hidden] { display: none; }
.portal-resched-slot-btn {
  flex: 1 1 auto;
  min-width: 80px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1.5px solid var(--green);
  background: #fff;
  color: var(--green);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s ease;
}
.portal-resched-slot-btn:hover:not(:disabled) { background: var(--green-pale); }
.portal-resched-slot-btn.is-selected {
  background: var(--green);
  color: #fff;
}
.portal-resched-slot-bucket {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-top: 2px;
  font-weight: 600;
}
.portal-resched-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-muted);
  font-size: 14px;
}
.portal-resched-reason-label {
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 4px;
}
.portal-resched-reason {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 44px;
  margin-bottom: 14px;
}
.portal-resched-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.portal-resched-cancel {
  padding: 12px 18px;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-mid);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  min-height: 44px;
}
.portal-resched-error {
  margin: 10px 0 0;
  font-size: 13px;
  color: #b53b1c;
}
.portal-resched-status {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--green);
  min-height: 18px;
}
@media (max-width: 480px) {
  .portal-resched-modal { padding: 12px; }
  .portal-resched-card { padding: 16px 14px 14px; max-height: calc(100vh - 24px); }
  .portal-resched-header h2 { font-size: 17px; }
  .portal-resched-actions { justify-content: stretch; }
  .portal-resched-actions button { flex: 1 1 auto; }
}
