/* Client portal redesign */
.portal-body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 22% 10%, rgba(28, 78, 151, 0.22), rgba(11, 19, 36, 0.92)),
    radial-gradient(circle at 78% 0%, rgba(255, 153, 0, 0.14), rgba(11, 19, 36, 0.95)),
    #0b1324;
  color: #e4ebff;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
}

.portal-body.modal-open {
  overflow: hidden;
}

body.portal-policy-open {
  overflow: hidden;
}

.policy-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px;
  background: rgba(4, 8, 18, 0.45);
}

.policy-modal[hidden] {
  display: none;
}

.policy-modal__dialog {
  width: min(560px, 100%);
  background: #0b1326;
  color: #e8edff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

.policy-modal__title {
  margin: 0 0 8px;
  font-size: 22px;
}

.policy-modal__copy {
  margin: 0 0 16px;
  color: #cbd7ff;
  line-height: 1.6;
}

.policy-modal__checks {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.policy-modal__check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 15px;
}

.policy-modal__check input {
  margin-top: 3px;
}

.policy-modal__check a {
  color: #93c5fd;
  text-decoration: none;
}

.policy-modal__check a:hover,
.policy-modal__check a:focus-visible {
  text-decoration: underline;
}

.policy-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
}

@media (max-width: 520px) {
  .policy-modal {
    padding: 16px;
  }
  .policy-modal__actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

.portal-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 32px);
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(16px, 3vw, 24px);
  margin-top: clamp(12px, 3vw, 24px);
}

.portal-body .site-header {
  position: static;
  margin-bottom: clamp(8px, 2vw, 16px);
}

.portal-sidebar {
  background: linear-gradient(180deg, rgba(13, 22, 43, 0.9), rgba(9, 15, 28, 0.94));
  border: none;
  border-radius: 28px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.portal-brand {
  display: grid;
  gap: 8px;
}

.portal-brand__pill {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: #f5f4ff;
}

.portal-brand__label {
  margin: 0;
  font-weight: 700;
  color: #f5f4ff;
}

.portal-nav {
  display: grid;
  gap: 10px;
}

.portal-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.12);
  border: none;
  border-radius: 16px;
  color: #f4f4ff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.2s ease, background 0.2s ease;
}

.portal-prod .portal-nav__item--settings,
.portal-prod .portal-nav__item--help {
  display: none;
}

.portal-nav__item:hover {
  transform: translateY(-1px);
  border-color: transparent;
}

.portal-nav__item.is-active {
  border-color: transparent;
  background: rgba(28, 78, 151, 0.18);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.portal-sidebar__footer {
  margin-top: auto;
  padding: 12px;
  background: rgba(0, 0, 0, 0.12);
  border: none;
  border-radius: 16px;
}

.portal-sidebar__hint {
  margin: 0;
  font-size: 12px;
  color: rgba(232, 234, 255, 0.7);
}

.portal-sidebar__user {
  margin: 2px 0 0;
  font-weight: 700;
  color: #ffffff;
  max-width: 100%;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
}

.portal-sidebar__user::after {
  content: attr(data-full-email);
  position: absolute;
  left: 0;
  top: 100%;
  transform: translateY(8px);
  background: rgba(6, 10, 22, 0.95);
  color: #e5edff;
  padding: 8px 10px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.08);
  opacity: 0;
  pointer-events: none;
  white-space: normal;
  max-width: 240px;
  z-index: 10;
  transition: opacity 0.15s ease;
}

.portal-sidebar__user:hover::after,
.portal-sidebar__user:focus-visible::after {
  opacity: 1;
}

.portal-canvas {
  display: grid;
  gap: clamp(16px, 3vw, 24px);
}

.portal-body .btn {
  background: rgba(255, 255, 255, 0.08);
  color: #e0e7ff;
  border: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 10px 24px rgba(0,0,0,0.35);
  line-height: 1.05;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.16s ease, box-shadow 0.2s ease, filter 0.16s ease;
}

.portal-body .btn:hover,
.portal-body .btn:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 14px 30px rgba(0,0,0,0.45);
}

.portal-top,
.portal-bottom {
  display: grid;
  gap: clamp(14px, 2vw, 20px);
  grid-template-columns: 2fr 1fr;
}

.portal-card {
  --card-pad: clamp(16px, 2vw, 24px);
  background: linear-gradient(180deg, rgba(9, 15, 28, 0.92), rgba(6, 11, 22, 0.96));
  border: none;
  border-radius: 18px;
  padding: var(--card-pad);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.portal-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.portal-card h2 {
  margin: 0;
  color: #f8f9ff;
}

.portal-animate {
  opacity: 0;
  transform: translateY(12px);
  animation: portalFadeUp 0.6s ease forwards;
}

.portal-animate.delay-1 { animation-delay: 0.08s; }
.portal-animate.delay-2 { animation-delay: 0.14s; }

@keyframes portalFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.typing-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  position: relative;
}

.typing-text[data-typing-active="true"]::after {
  content: "";
  width: 2px;
  height: 1em;
  background: rgba(255, 255, 255, 0.8);
  display: inline-block;
  animation: caretBlink 1s steps(1, end) infinite;
}

@keyframes caretBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.portal-eyebrow {
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.74rem;
  color: #cdd7ff;
}

.tasks-card {
  --task-pad: clamp(16px, 2vw, 24px);
  background: linear-gradient(180deg, rgba(7, 12, 24, 0.95), rgba(4, 7, 16, 0.97));
  padding: var(--task-pad);
}

.task-carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.task-window {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 94%, rgba(0, 0, 0, 0.4) 97%, transparent 100%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 94%, rgba(0, 0, 0, 0.4) 97%, transparent 100%);
  padding-top: 10px;
  padding-bottom: 4px;
}

.task-track {
  display: flex;
  gap: 12px;
  overflow: hidden;
  scroll-behavior: smooth;
  padding: 12px 0;
}

.task-window::before,
.task-window::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  pointer-events: none;
  z-index: 1;
}

.task-window::before {
  left: 0;
  background: linear-gradient(90deg, rgba(5, 9, 18, 1), rgba(5, 9, 18, 0));
  opacity: 1;
  transition: opacity 0.2s ease;
}

.task-window::after {
  right: 0;
  background: linear-gradient(270deg, rgba(5, 9, 18, 1), rgba(5, 9, 18, 0));
}

.task-window.no-overflow {
  -webkit-mask-image: none;
  mask-image: none;
}

.task-window.no-overflow::before,
.task-window.no-overflow::after {
  display: none;
}

.task-window.at-end {
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 100%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 100%);
}

.task-window.at-start::before {
  opacity: 0;
}

.task-window.at-end::after {
  opacity: 0;
}

.task-card {
  --task-card-pad: 14px;
  min-width: 100px;
  min-height: 190px;
  height: auto;
  flex: 0 0 150px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(28, 78, 151, 0.18), rgba(17, 41, 86, 0.32));
  border: 1px solid rgba(147, 197, 253, 0.08);
  border-radius: 18px;
  padding: var(--task-card-pad);
  color: #f8f9ff;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.32);
  transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.2s ease, border-color 0.2s ease;
}

.task-pill {
  text-transform: capitalize;
  font-weight: 700;
  font-size: 0.8rem;
}

.task-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #dfe3ff;
}

.task-indicator {
  height: 10px;
  width: 10px;
  border-radius: 50%;
  --indicator-color: #fbbf24;
  --pulse-color: rgba(251, 191, 36, 0.25);
  background: var(--indicator-color);
  box-shadow: 0 0 0 6px var(--pulse-color);
  animation: pulseIndicator 2.4s ease-out infinite;
}

.task-indicator.is-done {
  --indicator-color: #22c55e;
  --pulse-color: rgba(34, 197, 94, 0.28);
  background: var(--indicator-color);
  box-shadow: 0 0 0 6px var(--pulse-color);
}

.task-indicator.is-urgent {
  --indicator-color: #ef4444;
  --pulse-color: rgba(239, 68, 68, 0.32);
  background: var(--indicator-color);
  box-shadow: 0 0 0 6px var(--pulse-color);
  animation-duration: 1.8s;
}

.task-indicator.is-rejected {
  --indicator-color: #dc2626;
  --pulse-color: rgba(220, 38, 38, 0.28);
  background: var(--indicator-color);
  box-shadow: 0 0 0 6px var(--pulse-color);
  animation-duration: 2.1s;
}

.task-card.is-complete {
  opacity: 0.5;
  filter: grayscale(0.4);
}

.task-indicator.is-low {
  --indicator-color: #22c55e;
  --pulse-color: rgba(34, 197, 94, 0.28);
}

.task-card.is-pending {
  background: linear-gradient(180deg, rgba(20, 35, 66, 0.14), rgba(12, 24, 50, 0.24));
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.task-card.is-pending .task-card__top,
.task-card.is-pending .task-card__label {
  color: #d6dcff;
}

.task-card.is-pending .task-card__statusline,
.task-card.is-pending .task-card__due {
  color: #a7b4df;
}

.task-card.is-rejected {
  background: linear-gradient(180deg, rgba(120, 10, 10, 0.85), rgba(69, 8, 8, 0.92));
  border-color: rgba(248, 113, 113, 0.55);
  box-shadow: 0 18px 36px rgba(127, 29, 29, 0.45);
}

.task-card.is-rejected .task-card__top,
.task-card.is-rejected .task-card__statusline,
.task-card.is-rejected .task-card__due {
  color: #fecaca;
}

.task-card.is-rejected .task-card__label {
  color: #fff7f7;
}

.task-card.is-rejected .task-card__divider {
  background: rgba(248, 113, 113, 0.55);
}

.task-indicator.is-pending {
  --indicator-color: #94a3b8;
  --pulse-color: rgba(148, 163, 184, 0.18);
  background: var(--indicator-color);
  box-shadow: 0 0 0 0 var(--pulse-color);
  animation: none;
}

.task-card__label {
  margin: 0;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  line-clamp: 2;
}

.task-card__statusline {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: #b8c8ff;
  opacity: 0.92;
}

.task-card__footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.task-card__actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-card__actions--stack {
  flex-direction: column;
}

.task-card__actions--stack .task-card__action {
  width: 100%;
  justify-content: center;
}

.task-card__action {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 10px;
  line-height: 1.15;
  white-space: normal;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
}

.task-card__action:hover,
.task-card__action:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(148, 163, 184, 0.5);
  transform: translateY(-1px);
}

.task-card__action--ghost {
  background: transparent;
  color: #cbd5f5;
}

.task-card.is-pending .task-card__action {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.35);
}

.task-card.is-rejected .task-card__action {
  background: rgba(127, 29, 29, 0.5);
  border-color: rgba(248, 113, 113, 0.55);
  color: #fee2e2;
}

.task-card.is-rejected .task-card__action--ghost {
  background: transparent;
  color: #fecaca;
}

.task-rejection-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  line-height: 1.3;
  color: #fee2e2;
  background: rgba(127, 29, 29, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.task-card__divider {
  width: calc(100% + 2 * var(--task-card-pad, 0px));
  height: 1px;
  background: linear-gradient(90deg, rgba(147, 197, 253, 0.5), rgba(147, 197, 253, 0.5));
  border-radius: 999px;
  margin: 10px calc(-1 * var(--task-card-pad, 0px)) 8px;
}

.task-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.5);
  background: linear-gradient(180deg, rgba(54, 104, 174, 0.48), rgba(21, 53, 104, 0.68));
  border-color: rgba(147, 197, 253, 0.24);
}

.task-card.is-pending:hover {
  background: linear-gradient(180deg, rgba(24, 41, 79, 0.22), rgba(15, 32, 61, 0.34));
  border-color: rgba(148, 163, 184, 0.3);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
}

.task-card.is-rejected:hover {
  background: linear-gradient(180deg, rgba(146, 18, 18, 0.9), rgba(92, 10, 10, 0.95));
  border-color: rgba(248, 113, 113, 0.7);
  box-shadow: 0 22px 44px rgba(127, 29, 29, 0.5);
}

.tasks-card .portal-card__header {
  margin-top: -10px;
  margin-bottom: 10px;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}

.payment-card .portal-card__header,
.case-card .portal-card__header,
.comm-card .portal-card__header {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 10px;
}

.payment-card .portal-card__header {
  margin-top: -10px;
  width: 100%;
  position: relative;
  text-align: left;
  padding-top: 10px;
}

.payment-card .portal-card__header h2 {
  text-align: left;
  font-size: 1.35em;
}

.portal-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(147, 197, 253, 0.5), rgba(147, 197, 253, 0.5));
  border-radius: 999px;
  margin-top: 8px;
  margin-left: 0;
  margin-right: 0;
}

.tasks-divider {
  width: 700px;
  height: 1px;
  background: linear-gradient(90deg, rgba(147, 197, 253, 0.5), rgba(147, 197, 253, 0.5));
  border-radius: 999px;
  margin-top: 8px;
  margin-left: calc(-1 * var(--task-pad, var(--card-pad, 0px)));
  margin-right: calc(-1 * var(--task-pad, var(--card-pad, 0px)));
}

.task-card__due {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: #dbeafe;
  opacity: 0.9;
}

.payment-divider,
.case-divider,
.comm-divider {
  width: calc(100% + 2 * var(--card-pad, 0px));
  height: 1px;
  background: linear-gradient(90deg, rgba(147, 197, 253, 0.5), rgba(147, 197, 253, 0.5));
  border-radius: 999px;
  margin-top: 8px;
  margin-left: calc(-1 * var(--card-pad, 0px));
  margin-right: calc(-1 * var(--card-pad, 0px));
}

.comm-subdivider {
  width: 100%;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(147, 197, 253, 0.5), rgba(147, 197, 253, 0.5));
  margin: 14px 0 16px;
  opacity: 0.6;
}

@keyframes pulseIndicator {
  0% {
    box-shadow: 0 0 0 0 var(--pulse-color);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(0, 0, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}

.carousel-btn {
  height: 44px;
  width: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: #f8f9ff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.08s ease, background 0.2s ease;
}

.carousel-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
}

.task-progress {
  margin-top: 14px;
}

.task-progress__labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #dbeafe;
}

.task-progress__bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  margin-top: 10px;
  overflow: hidden;
}

.task-progress__bar span {
  position: absolute;
  inset: 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  transition: width 0.35s ease;
}

.payment-card {
  --card-pad: calc(16px + 10px);
  --payment-pad-vertical: 14px;
  background: linear-gradient(180deg, rgba(17, 28, 54, 0.92), rgba(13, 22, 43, 0.96));
  padding: var(--payment-pad-vertical) var(--card-pad);
}

.payment-note {
  margin-top: 8px;
  color: #8eb3ff;
  font-size: 14px;
  text-align: center;
}

.payment-grid {
  display: grid;
  position: relative;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 12px 16px 114px;
  --partition-offset: 30px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.25);
  border: none;
  width: 100%;
  max-width: 520px;
  margin: 0 auto 12px;
  align-items: center;
  justify-items: center;
}

.payment-grid > div {
  padding: 6px 18px;
  text-align: center;
  display: grid;
  place-content: center;
  gap: 6px;
  transform: translateY(40px);
}

.payment-grid > div:first-child {
  transform: translate(-15px, 40px);
}

.payment-grid::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: auto;
  bottom: var(--partition-offset);
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.payment-grid::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: var(--partition-offset);
  left: 50%;
  width: 1px;
  background: rgba(255, 255, 255, 0.14);
  transform: translateX(-0.5px);
}

.payment-label {
  margin: 0;
  color: #dcdff5;
  font-size: 0.92rem;
  line-height: 1.2;
  white-space: nowrap;
}

.payment-value {
  margin: 2px 0 0;
  font-size: 1.54rem;
  font-weight: 800;
  line-height: 1.15;
}

.payment-btn {
  width: 80%;
  margin: 8px auto 0;
  border-radius: 999px;
  display: block;
}

.case-card {
  background: linear-gradient(180deg, rgba(13, 22, 43, 0.92), rgba(10, 18, 36, 0.96));
}

.case-grid {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr;
  gap: 12px;
}

.case-fields {
  display: grid;
  gap: 10px;
}

.pill-row,
.status-block {
  --case-section-pad: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  margin-right: 20px;
}

.pill-row {
  --case-section-pad: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px var(--case-section-pad);
}

.status-block {
  --case-section-pad: 16px;
  display: grid;
  gap: 6px;
  padding: 20px var(--case-section-pad) 30px;
  margin-right: 0;
  position: relative;
  overflow: hidden;
}

.status-block::before {
  content: "";
  position: absolute;
  top: 58px;
  right: 6px;
  bottom: 6px;
  left: 6px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.5));
  pointer-events: none;
  z-index: 0;
}

.pill-label {
  margin: 0;
  font-size: 0.9rem;
  color: #d9ddff;
}

.pill-value,
.status-text {
  margin: 0;
  font-weight: 800;
  color: #f8f9ff;
  position: relative;
  z-index: 1;
  justify-self: center;
  align-self: center;
  transform: translateY(10px);
}

.pill-row .pill-label {
  flex: 0 0 auto;
  align-self: center;
}

.pill-row .pill-value {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  text-align: center;
  transform: translateY(2px);
}

.case-section-divider {
  background: linear-gradient(90deg, rgba(147, 197, 253, 0.5), rgba(147, 197, 253, 0.5));
  border-radius: 999px;
}

.case-section-divider--vertical {
  width: 1px;
  align-self: stretch;
  margin: calc(-1 * var(--case-section-pad, 0px)) 10px;
}

.case-section-divider--horizontal {
  width: calc(100% + 2 * var(--case-section-pad, 0px));
  height: 1px;
  margin: 6px calc(-1 * var(--case-section-pad, 0px)) 4px;
}

.dates-card {
  display: grid;
  gap: 12px;
  --dates-pad: 16px;
  padding: var(--dates-pad);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  margin: 0;
  justify-items: start;
}

.dates-divider {
  width: calc(100% + 2 * var(--dates-pad, 0px));
  height: 1px;
  background: linear-gradient(90deg, rgba(147, 197, 253, 0.5), rgba(147, 197, 253, 0.5));
  border-radius: 999px;
  margin: 4px calc(-1 * var(--dates-pad, 0px)) 4px;
}

.dates-slider {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.dates-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.16);
  color: #f8f9ff;
  cursor: pointer;
}

.dates-display {
  text-align: center;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 14px;
  border: none;
  padding: 16px 14px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.dates-primary {
  margin: 0;
  font-weight: 800;
  font-size: 1rem;
}

.dates-details,
.dates-all {
  border-radius: 999px;
}

.dates-details {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 4px 10px;
  margin-top: 10px;
  font-size: 0.82em;
  line-height: 1;
}

.dates-all {
  width: 100%;
  max-width: 288px;
  margin: 4px auto 0;
  padding: 4px 12px;
  line-height: 1;
  font-size: 0.85em;
}

.dates-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.dates-modal[hidden] {
  display: none;
}

.dates-modal__dialog {
  background: linear-gradient(180deg, #0b1224, #0c162b);
  border: 1px solid rgba(147, 197, 253, 0.14);
  border-radius: 16px;
  width: min(640px, 100%);
  display: grid;
  gap: 14px;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.dates-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dates-modal__title {
  margin: 0;
}

.dates-modal__close {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-size: 20px;
  height: 34px;
  width: 34px;
  border-radius: 50%;
  cursor: pointer;
}

.dates-modal__list {
  display: grid;
  gap: 12px;
  max-height: 60vh;
  overflow: auto;
}

.dates-modal__item {
  border: 1px solid rgba(147, 197, 253, 0.18);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
}

.dates-modal__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dates-modal__date {
  margin: 0;
  font-weight: 800;
}

.dates-modal__label {
  margin: 2px 0 0;
  color: #cbd5e1;
  font-size: 0.95em;
}

.dates-modal__note {
  margin: 10px 0 0;
  color: #e2e8f0;
  font-size: 0.95em;
}

.dates-modal__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(147, 197, 253, 0.2);
  color: #e2e8f0;
  font-size: 0.8em;
}

.payment-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at top, rgba(37, 99, 235, 0.2), rgba(2, 6, 23, 0.9));
  z-index: 1200;
}

.payment-modal[hidden] {
  display: none;
}

.payment-modal__dialog {
  width: min(680px, 92vw);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(10, 16, 34, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.6);
  padding: 20px 22px 24px;
  color: #e2e8f0;
}

.payment-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.payment-modal__close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.2s ease;
}

.payment-modal__close:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.14);
}

.payment-modal__note {
  margin: 0 0 16px;
  color: #c7d2fe;
  font-size: 0.95rem;
}

.payment-modal__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.payment-modal__field {
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.15);
  display: grid;
  gap: 6px;
  min-width: 0;
}

.payment-modal__label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(226, 232, 240, 0.7);
}

.payment-modal__value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.payment-modal__sub {
  font-size: 0.88rem;
  color: rgba(226, 232, 240, 0.7);
}

.payment-modal__memoRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.payment-modal__memoValue {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-modal__copy {
  flex: 0 0 auto;
}

.payment-modal__helper,
.payment-modal__hint {
  font-size: 0.86rem;
  color: rgba(226, 232, 240, 0.72);
}

.payment-modal__helper {
  margin: 0 0 10px;
}

.payment-modal__hint {
  margin-top: 4px;
}

.payment-modal__body textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(8, 15, 30, 0.85);
  color: #e2e8f0;
  padding: 10px 12px;
  margin-bottom: 14px;
  resize: vertical;
}

.payment-modal__body input[type="file"] {
  width: 100%;
  color: #cbd5f5;
  background: rgba(8, 15, 30, 0.85);
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.payment-modal__status {
  min-height: 18px;
  margin: 6px 0 12px;
  font-size: 0.88rem;
  color: #93c5fd;
}

.payment-modal__status[data-tone="error"] {
  color: #fca5a5;
}

.payment-modal__status[data-tone="success"] {
  color: #86efac;
}

.payment-modal__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .payment-modal__actions {
    flex-direction: column;
    align-items: stretch;
  }
}

.portal-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  z-index: 9999;
  backdrop-filter: blur(6px);
}

.portal-modal__dialog {
  background: linear-gradient(180deg, #0b1224, #0c162b);
  border: 1px solid rgba(147, 197, 253, 0.18);
  border-radius: 16px;
  width: min(560px, 92vw);
  padding: 20px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  color: #e2e8f0;
}

.portal-modal__title {
  margin: 0 0 10px 0;
  font-size: 20px;
  color: #fecaca;
}

.portal-modal__body {
  margin: 0 0 16px 0;
  color: #e2e8f0;
  white-space: pre-wrap;
}

.portal-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.portal-modal__actions .btn {
  min-width: 110px;
  border: 1px solid transparent;
}

.portal-modal__actions .btn-glass {
  background: rgba(15, 23, 42, 0.6);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.portal-modal__actions .btn-cream {
  background: rgba(59, 130, 246, 0.32);
  color: #f8fafc;
  border-color: rgba(147, 197, 253, 0.55);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.3);
}

.portal-modal__actions .btn-cream:hover,
.portal-modal__actions .btn-cream:focus-visible {
  background: rgba(59, 130, 246, 0.45);
}

.comm-card {
  background: linear-gradient(180deg, rgba(17, 28, 54, 0.9), rgba(13, 22, 43, 0.95));
  position: relative;
}

.comm-top {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
  align-items: center;
}

.comm-contact {
  display: flex;
  gap: 12px;
  align-items: center;
}

.avatar {
  height: 42px;
  width: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.comm-name {
  margin: 0;
  font-weight: 800;
}

.comm-status {
  margin: 2px 0 0;
  color: #dfe3ff;
  font-size: 0.9rem;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.dot.online {
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.15);
}

.dot.offline {
  background: #9ca3af;
  box-shadow: 0 0 0 6px rgba(156, 163, 175, 0.12);
}

.comm-contacts {
  position: relative;
  display: grid;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 18px;
  padding: 14px 16px 16px;
}

.contact-list {
  list-style: none;
  margin: 2px 0 0;
  padding: 10px;
  display: grid;
  gap: 8px;
  color: #f8f9ff;
  font-weight: 600;
  font-size: 0.65rem;
  max-height: 160px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 14px;
  text-align: center;
}

.contact-list li {
  height: 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  transition: transform 0.1s ease, filter 0.2s ease;
  cursor: pointer;
}

.contact-list li:hover,
.contact-list li:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

.contact-menu {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 22, 43, 0.96), rgba(8, 13, 26, 0.98));
  border-radius: 18px;
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 14px;
  z-index: 2;
  border: 1px solid rgba(147, 197, 253, 0.18);
  box-shadow:
    0 20px 46px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.28s ease, transform 0.32s ease;
}

.contact-menu:not([hidden]) {
  display: flex;
}

.contact-menu.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.contact-menu--actions .contact-menu__view.is-placeholder {
  display: none;
}

.contact-menu--email-active .contact-menu__actions,
.contact-menu--email-active .contact-menu__profile,
.contact-menu--email-active .contact-menu__online-dot,
.contact-menu--email-active .contact-menu__close {
  pointer-events: none;
}

.contact-menu--email-active .contact-menu__view {
  display: flex;
}

.contact-menu__online-dot {
  position: absolute;
  top: 62px;
  right: 142px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow:
    0 0 0 6px rgba(34, 197, 94, 0.14),
    0 12px 20px rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(9, 18, 36, 0.95);
  pointer-events: none;
  z-index: 3;
}

.contact-menu__profile {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.contact-menu__avatar {
  height: 64px;
  width: 64px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(32, 64, 118, 0.94), rgba(18, 38, 74, 0.94));
  border: 1px solid rgba(147, 197, 253, 0.55);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #f8f9ff;
  font-size: 1.2rem;
  position: relative;
}

.contact-menu__name {
  margin: 0;
  font-weight: 800;
  color: #f8f9ff;
}

.contact-menu__status {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.24);
  border: 2px solid rgba(9, 18, 36, 0.95);
  z-index: 2;
  pointer-events: none;
}

.contact-menu__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  justify-items: center;
}

.contact-menu__action {
  border: none;
  height: 72px;
  width: 72px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.07));
  color: #f8f9ff;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.2s ease, box-shadow 0.2s ease;
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(147, 197, 253, 0.28);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.contact-menu__action:hover,
.contact-menu__action:focus-visible {
  transform: translateY(-4px);
  filter: brightness(1.12);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.contact-menu__view {
  min-height: 120px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  padding: 12px;
  color: #f8f9ff;
  border: 1px solid rgba(147, 197, 253, 0.18);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-menu__view.is-placeholder {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  min-height: 0;
  font-size: 0.625em;
  text-align: center;
}

.contact-menu__view.is-overlay {
  position: absolute;
  inset: 0;
  padding: 14px;
  z-index: 5;
  background: linear-gradient(180deg, rgba(13, 22, 43, 0.95), rgba(8, 13, 26, 0.97));
  border-radius: 18px;
  border: 1px solid rgba(147, 197, 253, 0.24);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow-y: auto;
}

.contact-menu__close {
  border: 1px solid rgba(147, 197, 253, 0.24);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.06));
  color: #f8f9ff;
  cursor: pointer;
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  width: calc(100% - 20px);
  align-self: center;
  transition: transform 0.12s ease, filter 0.2s ease, box-shadow 0.2s ease;
  animation: pushUp 0.45s ease;
}

.contact-menu__close:hover,
.contact-menu__close:focus-visible {
  transform: translateY(-4px);
  filter: brightness(1.12);
  box-shadow:
    0 12px 22px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.contact-menu__edit {
  border: 1px solid rgba(147, 197, 253, 0.24);
  border-radius: 999px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8f9ff;
  font-size: 0.72rem;
  font-weight: 600;
  align-self: center;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.2s ease, box-shadow 0.2s ease;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.contact-menu__edit:hover,
.contact-menu__edit:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

.contact-app {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
}

.contact-app__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.contact-app__panel {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(147, 197, 253, 0.18);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-app__row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.contact-app__label {
  margin: 0;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(248, 249, 255, 0.72);
}

.contact-app__value {
  margin: 6px 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: #f8f9ff;
}

.contact-app__body {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(248, 249, 255, 0.78);
}

.contact-app__input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(147, 197, 253, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #f8f9ff;
  padding: 12px 14px;
  font: inherit;
}

.contact-app__input:focus {
  outline: 2px solid rgba(147, 197, 253, 0.7);
}

.contact-app__input--multiline {
  min-height: 120px;
  resize: vertical;
}

.contact-app__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.contact-app__actions--wrap {
  flex-wrap: wrap;
}

.contact-app__btn {
  border: 1px solid rgba(147, 197, 253, 0.25);
  border-radius: 999px;
  height: 40px;
  padding: 0 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.08));
  color: #f8f9ff;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, filter 0.2s ease, box-shadow 0.2s ease;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.contact-app__btn:hover,
.contact-app__btn:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.contact-app__btn--primary {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.35), rgba(37, 99, 235, 0.18));
  border-color: rgba(147, 197, 253, 0.45);
}

.contact-app__btn--ghost {
  background: rgba(255, 255, 255, 0.08);
}

.contact-app__chip {
  border: 1px solid rgba(147, 197, 253, 0.24);
  border-radius: 999px;
  height: 34px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8f9ff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, filter 0.2s ease, box-shadow 0.2s ease;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.contact-app__chip:hover,
.contact-app__chip:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.contact-app__footer {
  margin-top: auto;
  padding-top: 8px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(13, 22, 43, 0), rgba(13, 22, 43, 0.95));
}

.contact-app__back {
  width: 100%;
}

.contact-app__error {
  margin: 0;
  color: #fca5a5;
  font-weight: 600;
  font-size: 0.78rem;
}

.contact-app__hint {
  margin: 0;
  color: rgba(248, 249, 255, 0.7);
  font-size: 0.78rem;
}

.contact-app__success {
  margin: 0;
  color: #c7f9cc;
  font-weight: 600;
  font-size: 0.78rem;
}

@keyframes pushUp {
  0% { transform: translateY(14px); opacity: 0; }
  60% { transform: translateY(-4px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

.contact-list::-webkit-scrollbar {
  width: 8px;
}

.contact-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.contact-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
}

.comm-form {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.comm-form textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.2);
  color: #f8f9ff;
  padding: 12px;
  font: inherit;
}

.comm-form textarea:focus {
  outline: 2px solid rgba(147, 197, 253, 0.7);
}

.send-btn {
  border-radius: 999px;
  justify-self: start;
}

.comm-feedback {
  margin: 0;
  color: #c7f9cc;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-top,
  .portal-bottom,
  .case-grid,
  .comm-top {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    flex-direction: row;
    align-items: center;
  }

  .portal-nav {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
  }

  .portal-sidebar__footer {
    margin: 0;
  }
}

@media (max-width: 640px) {
  .portal-shell {
    padding: clamp(8px, 3vw, 14px);
    gap: clamp(10px, 3vw, 14px);
    margin-left: 0;
    margin-right: auto;
    width: 100%;
    max-width: 100%;
  }

  .portal-sidebar {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px;
    gap: 10px;
    border-radius: 16px;
    width: 100%;
  }

  .portal-brand__pill {
    font-size: 7px;
  }

  .portal-brand__label {
    font-size: 0.9rem;
  }

  .task-track {
    overflow-x: auto;
  }

  .portal-nav {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .portal-nav__item {
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
  }

  .portal-sidebar__footer {
    width: 100%;
    padding: 8px;
  }

  .portal-sidebar__hint {
    font-size: 10px;
  }

  .portal-sidebar__user {
    font-size: 0.75rem;
  }

  .portal-top,
  .portal-bottom {
    gap: 10px;
  }

  .portal-card {
    --card-pad: 10px;
    border-radius: 12px;
    max-width: 100%;
  }

  .portal-card h2 {
    font-size: 1rem;
  }

  .portal-eyebrow {
    font-size: 0.5rem;
  }

  .task-carousel {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 6px;
  }

  .carousel-btn {
    width: 28px;
    height: 28px;
  }

  .task-track {
    gap: 8px;
    padding: 8px 0;
  }

  .task-card {
    flex: 0 0 120px;
    height: 140px;
    --task-card-pad: 10px;
    border-radius: 12px;
  }

  .task-pill,
  .task-card__top,
  .task-card__label {
    font-size: 0.7rem;
  }

  .task-card__statusline {
    font-size: 0.65rem;
  }

  .task-card__due {
    font-size: 0.6rem;
  }

  .tasks-divider {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .payment-divider,
  .case-divider,
  .comm-divider,
  .case-section-divider--horizontal,
  .dates-divider {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .task-progress__labels {
    font-size: 0.7rem;
  }

  .task-progress__bar {
    height: 8px;
  }

  .payment-grid {
    grid-template-columns: 1fr;
    padding: 10px 12px 64px;
    max-width: 100%;
  }

  .payment-grid > div {
    padding: 4px 10px;
    transform: translateY(20px);
  }

  .payment-grid > div:first-child {
    transform: translateY(20px);
  }

  .payment-grid::after {
    display: none;
  }

  .payment-label {
    font-size: 0.7rem;
  }

  .payment-value {
    font-size: 1.1rem;
  }

  .pill-row,
  .status-block,
  .dates-card {
    border-radius: 12px;
  }

  .pill-row {
    padding: 6px 10px;
    gap: 8px;
    margin-right: 0;
  }

  .status-block {
    padding: 12px 12px 18px;
  }

  .dates-card {
    --dates-pad: 10px;
  }

  .dates-btn {
    width: 28px;
    height: 28px;
  }

  .dates-display {
    padding: 10px;
    border-radius: 10px;
    max-width: 100%;
  }

  .dates-primary {
    font-size: 0.85rem;
  }
}

body.light-ui.portal-body {
  background:
    radial-gradient(circle at 18% 12%, rgba(59, 130, 246, 0.16), rgba(248, 250, 252, 0.92)),
    radial-gradient(circle at 82% 0%, rgba(14, 165, 233, 0.14), rgba(248, 250, 252, 0.98)),
    #f8fafc;
  color: #0f172a;
}

body.light-ui .portal-sidebar {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(226, 232, 255, 0.98));
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.12),
    inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}

body.light-ui .portal-brand__pill,
body.light-ui .portal-brand__label {
  color: #0f172a;
}

body.light-ui .portal-nav__item {
  background: rgba(59, 130, 246, 0.1);
  color: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}

body.light-ui .portal-nav__item.is-active {
  background: rgba(59, 130, 246, 0.22);
  color: #0f172a;
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.12),
    inset 0 0 0 1px rgba(37, 99, 235, 0.35);
}

body.light-ui .portal-sidebar__footer {
  background: rgba(59, 130, 246, 0.08);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.16);
}

body.light-ui .portal-sidebar__hint {
  color: #475569;
}

body.light-ui .portal-sidebar__user {
  color: #0f172a;
}

body.light-ui .portal-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.95));
  border: 1px solid rgba(59, 130, 246, 0.16);
  color: #0f172a;
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(59, 130, 246, 0.12);
}

body.light-ui .portal-card__header h2,
body.light-ui .payment-value,
body.light-ui .tasks-divider,
body.light-ui .payment-divider {
  color: #0f172a;
}

body.light-ui .portal-card p,
body.light-ui .payment-label {
  color: #475569;
}

body.light-ui .portal-eyebrow {
  color: #2563eb;
}

body.light-ui.portal-body .btn {
  background: rgba(59, 130, 246, 0.12);
  color: #0f172a;
  border: 1px solid rgba(59, 130, 246, 0.24);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

body.light-ui.portal-body .btn:hover,
body.light-ui.portal-body .btn:focus-visible {
  background: rgba(37, 99, 235, 0.2);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.16);
}

body.light-ui .portal-sidebar__user::after {
  background: #eff6ff;
  color: #0f172a;
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

body.light-ui .tasks-card,
body.light-ui .payment-card,
body.light-ui .case-card,
body.light-ui .comm-card {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.95), rgba(255, 255, 255, 0.98));
}

body.light-ui .task-card {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.28);
  color: #0f172a;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

body.light-ui .task-card__top {
  color: #475569;
}

body.light-ui .task-card__statusline,
body.light-ui .task-card__due {
  color: #64748b;
}

body.light-ui .task-card__divider,
body.light-ui .tasks-divider,
body.light-ui .payment-divider,
body.light-ui .case-divider,
body.light-ui .comm-divider,
body.light-ui .comm-subdivider,
body.light-ui .portal-divider,
body.light-ui .case-section-divider {
  background: rgba(59, 130, 246, 0.28);
}

body.light-ui .task-card:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
}

body.light-ui .task-card.is-pending:hover {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.32);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.14);
}

body.light-ui .task-card.is-rejected:hover {
  background: rgba(248, 113, 113, 0.28);
  border-color: rgba(220, 38, 38, 0.55);
  box-shadow: 0 18px 32px rgba(220, 38, 38, 0.2);
}

body.light-ui .task-card__action {
  background: rgba(59, 130, 246, 0.12);
  color: #0f172a;
  border-color: rgba(59, 130, 246, 0.24);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

body.light-ui .task-card__action:hover,
body.light-ui .task-card__action:focus-visible {
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(37, 99, 235, 0.35);
}

body.light-ui .task-card__action--ghost {
  background: transparent;
  color: #1e3a8a;
  box-shadow: none;
}

body.light-ui .task-card.is-pending {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

body.light-ui .task-card.is-pending .task-card__top,
body.light-ui .task-card.is-pending .task-card__label {
  color: #334155;
}

body.light-ui .task-card.is-pending .task-card__statusline,
body.light-ui .task-card.is-pending .task-card__due {
  color: #64748b;
}

body.light-ui .task-card.is-rejected {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(220, 38, 38, 0.45);
  color: #7f1d1d;
  box-shadow: 0 16px 30px rgba(220, 38, 38, 0.18);
}

body.light-ui .task-card.is-rejected .task-card__label {
  color: #7f1d1d;
}

body.light-ui .task-card.is-rejected .task-card__top,
body.light-ui .task-card.is-rejected .task-card__statusline,
body.light-ui .task-card.is-rejected .task-card__due {
  color: #b91c1c;
}

body.light-ui .task-card.is-rejected .task-card__divider {
  background: rgba(220, 38, 38, 0.35);
}

body.light-ui .task-card.is-rejected .task-card__action {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(220, 38, 38, 0.35);
  color: #7f1d1d;
  box-shadow: none;
}

body.light-ui .task-card.is-rejected .task-card__action--ghost {
  color: #7f1d1d;
}

body.light-ui .task-rejection-note {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(220, 38, 38, 0.3);
  color: #7f1d1d;
}

body.light-ui .task-window::before {
  background: linear-gradient(90deg, rgba(226, 232, 240, 0.95), rgba(226, 232, 240, 0));
}

body.light-ui .task-window::after {
  background: linear-gradient(270deg, rgba(226, 232, 240, 0.95), rgba(226, 232, 240, 0));
}

body.light-ui .carousel-btn {
  background: rgba(59, 130, 246, 0.1);
  color: #0f172a;
  border: 1px solid rgba(59, 130, 246, 0.22);
}

body.light-ui .carousel-btn:hover {
  background: rgba(37, 99, 235, 0.2);
}

body.light-ui .task-progress__labels {
  color: #475569;
}

body.light-ui .task-progress__bar {
  background: rgba(59, 130, 246, 0.2);
}

body.light-ui .payment-grid {
  background: rgba(219, 234, 254, 0.6);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

body.light-ui .payment-grid::before,
body.light-ui .payment-grid::after {
  background: rgba(59, 130, 246, 0.24);
}

body.light-ui .payment-note {
  color: #64748b;
}

body.light-ui .pill-row,
body.light-ui .status-block,
body.light-ui .dates-card {
  background: rgba(219, 234, 254, 0.5);
  border: 1px solid rgba(59, 130, 246, 0.18);
}

body.light-ui .status-block::before {
  background: rgba(59, 130, 246, 0.14);
}

body.light-ui .pill-label,
body.light-ui .comm-status {
  color: #64748b;
}

body.light-ui .pill-value,
body.light-ui .status-text,
body.light-ui .dates-primary {
  color: #0f172a;
}

body.light-ui .dates-btn {
  background: rgba(59, 130, 246, 0.14);
  color: #0f172a;
  border: 1px solid rgba(59, 130, 246, 0.24);
}

body.light-ui .dates-display {
  background: rgba(219, 234, 254, 0.65);
  border: 1px solid rgba(59, 130, 246, 0.18);
}

body.light-ui .dates-btn:hover,
body.light-ui .dates-btn:focus-visible {
  background: rgba(37, 99, 235, 0.2);
}

body.light-ui .dates-details,
body.light-ui .dates-all {
  background: rgba(59, 130, 246, 0.1);
  color: #0f172a;
  border: 1px solid rgba(59, 130, 246, 0.22);
}

body.light-ui .dates-details:hover,
body.light-ui .dates-details:focus-visible,
body.light-ui .dates-all:hover,
body.light-ui .dates-all:focus-visible {
  background: rgba(37, 99, 235, 0.2);
}

body.light-ui .dates-modal {
  background: rgba(15, 23, 42, 0.35);
}

body.light-ui .dates-modal__dialog {
  background: linear-gradient(180deg, #ffffff, #eff6ff);
  border-color: rgba(59, 130, 246, 0.18);
  color: #0f172a;
  box-shadow:
    0 18px 36px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(59, 130, 246, 0.12);
}

body.light-ui .dates-modal__item {
  background: rgba(219, 234, 254, 0.5);
  border-color: rgba(59, 130, 246, 0.18);
}

body.light-ui .dates-modal__label,
body.light-ui .dates-modal__note {
  color: #475569;
}

body.light-ui .dates-modal__badge {
  background: rgba(59, 130, 246, 0.18);
  color: #1d4ed8;
}

body.light-ui .payment-modal {
  background: rgba(15, 23, 42, 0.35);
}

body.light-ui .payment-modal__dialog {
  background: linear-gradient(180deg, #ffffff, #eff6ff);
  border-color: rgba(59, 130, 246, 0.18);
  color: #0f172a;
  box-shadow:
    0 18px 36px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(59, 130, 246, 0.12);
}

body.light-ui .payment-modal__field {
  background: rgba(219, 234, 254, 0.5);
  border-color: rgba(59, 130, 246, 0.18);
}

body.light-ui .payment-modal__note,
body.light-ui .payment-modal__sub,
body.light-ui .payment-modal__helper,
body.light-ui .payment-modal__hint {
  color: #475569;
}

body.light-ui .payment-modal__label {
  color: #64748b;
}

body.light-ui .payment-modal__value {
  color: #0f172a;
}

body.light-ui .payment-modal__body textarea,
body.light-ui .payment-modal__body input[type="file"] {
  background: #ffffff;
  border-color: rgba(59, 130, 246, 0.18);
  color: #0f172a;
}

body.light-ui .payment-modal__status {
  color: #1d4ed8;
}

body.light-ui .portal-modal {
  background: rgba(15, 23, 42, 0.35);
}

body.light-ui .portal-modal__dialog {
  background: linear-gradient(180deg, #ffffff, #eff6ff);
  border-color: rgba(59, 130, 246, 0.2);
  color: #0f172a;
  box-shadow:
    0 18px 36px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(59, 130, 246, 0.12);
}

body.light-ui .portal-modal__title {
  color: #b91c1c;
}

body.light-ui .portal-modal__body {
  color: #0f172a;
}

body.light-ui .portal-modal__actions .btn-glass {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.18);
  box-shadow: none;
}

body.light-ui .portal-modal__actions .btn-cream {
  background: rgba(37, 99, 235, 0.16);
  color: #0f172a;
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: none;
}

body.light-ui .portal-modal__actions .btn-cream:hover,
body.light-ui .portal-modal__actions .btn-cream:focus-visible {
  background: rgba(37, 99, 235, 0.24);
}

body.light-ui .avatar {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.25);
  color: #1d4ed8;
}

body.light-ui .comm-contacts {
  background: rgba(219, 234, 254, 0.5);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

body.light-ui .contact-list {
  background: rgba(219, 234, 254, 0.5);
  color: #0f172a;
}

body.light-ui .contact-list li {
  background: rgba(59, 130, 246, 0.12);
}

body.light-ui .contact-list::-webkit-scrollbar-track {
  background: rgba(59, 130, 246, 0.12);
}

body.light-ui .contact-list::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.35);
}

body.light-ui .contact-menu {
  background: linear-gradient(180deg, #ffffff, #eff6ff);
  border-color: rgba(59, 130, 246, 0.18);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.14);
}

body.light-ui .contact-menu__avatar {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.4);
  color: #1d4ed8;
}

body.light-ui .contact-menu__name {
  color: #0f172a;
}

body.light-ui .contact-menu__action {
  background: rgba(59, 130, 246, 0.12);
  color: #0f172a;
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

body.light-ui .contact-menu__action:hover,
body.light-ui .contact-menu__action:focus-visible {
  background: rgba(37, 99, 235, 0.2);
}

body.light-ui .contact-menu__view {
  background: rgba(219, 234, 254, 0.55);
  border-color: rgba(59, 130, 246, 0.18);
  color: #0f172a;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

body.light-ui .contact-menu__view.is-overlay {
  background: rgba(239, 246, 255, 0.94);
  border-color: rgba(59, 130, 246, 0.18);
}

body.light-ui .contact-menu__close {
  background: rgba(59, 130, 246, 0.12);
  color: #0f172a;
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

body.light-ui .contact-menu__edit {
  background: rgba(59, 130, 246, 0.12);
  color: #0f172a;
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

body.light-ui .contact-app__panel {
  background: rgba(219, 234, 254, 0.6);
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

body.light-ui .contact-app__label {
  color: #475569;
}

body.light-ui .contact-app__value,
body.light-ui .contact-app__title {
  color: #0f172a;
}

body.light-ui .contact-app__body {
  color: #475569;
}

body.light-ui .contact-app__hint {
  color: #64748b;
}

body.light-ui .contact-app__success {
  color: #16a34a;
}

body.light-ui .contact-app__input {
  background: #eff6ff;
  border-color: rgba(59, 130, 246, 0.25);
  color: #0f172a;
}

body.light-ui .contact-app__btn {
  background: rgba(59, 130, 246, 0.12);
  color: #0f172a;
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
}

body.light-ui .contact-app__btn--primary {
  background: rgba(37, 99, 235, 0.2);
}

body.light-ui .contact-app__chip {
  background: rgba(59, 130, 246, 0.12);
  color: #0f172a;
  border-color: rgba(59, 130, 246, 0.2);
}

body.light-ui .contact-app__footer {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0), rgba(239, 246, 255, 0.9));
}

body.light-ui .comm-form textarea {
  background: #eff6ff;
  border-color: rgba(59, 130, 246, 0.25);
  color: #0f172a;
}

body.light-ui .comm-form textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.6);
}
