:root {
  --bg: #f3f1ea;
  --panel: #fffdf8;
  --ink: #1d241d;
  --muted: #667066;
  --line: #dfdfd6;
  --green: #236d3c;
  --green-deep: #184b29;
  --green-soft: #edf6ef;
  --amber: #9b6b10;
  --amber-soft: #fff7df;
  --red: #a6402f;
  --red-soft: #fff0ec;
  --shadow: 0 18px 45px rgba(27, 32, 24, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(35, 109, 60, 0.1), transparent 26%),
    linear-gradient(180deg, #f8f6ef 0%, var(--bg) 100%);
}

body.is-embedded {
  min-height: 0;
  background: transparent;
}

body.is-embedded .support-page {
  padding-top: 8px;
  padding-bottom: 8px;
}

button,
input,
select,
textarea { font: inherit; }

button { cursor: pointer; }

a { color: inherit; }

.support-page {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 28px 22px 64px;
}

.support-page--narrow { width: min(100%, 900px); }

.support-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.support-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.support-brand img {
  width: 76px;
  height: 58px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.support-eyebrow {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.support-header h1 {
  margin: 7px 0 0;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.support-header p {
  max-width: 720px;
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.support-header--form {
  display: block;
}

.case-back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 15px;
  color: var(--green-deep);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.case-back-link:hover { text-decoration: underline; }

.support-header--case {
  align-items: flex-start;
  margin-bottom: 16px;
}

.support-header--case h1 {
  margin-top: 5px;
  font-size: clamp(24px, 3vw, 32px);
}

.support-header--case p {
  margin-top: 6px;
  font-size: 14px;
}

.support-header--case .support-brand {
  gap: 13px;
}

.support-header--case .support-brand img {
  width: 62px;
  height: 48px;
  border-radius: 13px;
}

.support-header--case > .badge {
  flex: 0 0 auto;
  margin-top: 4px;
}

.case-detail-page .support-page {
  padding-top: 22px;
}

.case-detail-page .case-back-link {
  margin-bottom: 10px;
}

.case-detail-page .support-card {
  padding: 17px;
  border-radius: 19px;
}

.case-detail-page .support-card + .support-card {
  margin-top: 12px;
}

.case-detail-page .support-card__head {
  margin-bottom: 12px;
}

.case-detail-page .support-card__copy {
  margin-top: 5px;
  font-size: 14px;
}

.advisor-profile {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid #cadbcd;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(35, 109, 60, 0.09), transparent 36%),
    rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
}

.advisor-profile__photo {
  width: 132px;
  height: 164px;
  display: block;
  object-fit: cover;
  object-position: center 28%;
  border: 1px solid #c6d8c9;
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(27, 32, 24, 0.12);
}

.advisor-profile__content {
  min-width: 0;
  display: grid;
  align-content: center;
}

.advisor-profile__topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.advisor-profile__eyebrow {
  color: var(--green);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.advisor-profile h2 {
  margin: 5px 0 0;
  font-size: 25px;
  letter-spacing: -0.035em;
}

.advisor-profile__copy {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.availability-status {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #d7dcd5;
  border-radius: 999px;
  background: #f2f3f0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.availability-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #929a92;
  box-shadow: 0 0 0 4px rgba(102, 112, 102, 0.1);
}

.availability-status[data-state="available"] {
  border-color: #bcd6c1;
  background: var(--green-soft);
  color: var(--green-deep);
}

.availability-status[data-state="available"] .availability-status__dot {
  background: #2d8a4b;
  box-shadow: 0 0 0 4px rgba(45, 138, 75, 0.12);
}

.availability-status[data-state="lunch"] {
  border-color: #ead7a7;
  background: var(--amber-soft);
  color: var(--amber);
}

.availability-status[data-state="lunch"] .availability-status__dot {
  background: #c58a1c;
  box-shadow: 0 0 0 4px rgba(197, 138, 28, 0.12);
}

.advisor-schedule {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 13px;
}

.advisor-schedule__item {
  display: grid;
  gap: 3px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.advisor-schedule__item span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.advisor-schedule__item strong {
  font-size: 13px;
}

.support-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.button,
.support-actions button,
.support-actions a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid var(--green);
  border-radius: 13px;
  background: var(--green);
  color: #fff;
  font-weight: 750;
  text-decoration: none;
}

.button--secondary,
.support-actions .button--secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.button--danger {
  border-color: #e8c7bd;
  background: #fff;
  color: var(--red);
}

.button:disabled,
.support-actions button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.support-card {
  border: 1px solid rgba(223, 223, 214, 0.95);
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
  padding: 22px;
}

.support-card + .support-card { margin-top: 16px; }

.support-card__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.support-card h2,
.support-card h3 {
  margin: 0;
  letter-spacing: -0.025em;
}

.support-card__copy {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.choice-card {
  position: relative;
  display: block;
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.choice-card:hover {
  transform: translateY(-1px);
  border-color: #b8cdbb;
  box-shadow: 0 12px 28px rgba(27, 32, 24, 0.07);
}

.choice-card:has(input:checked) {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(35, 109, 60, 0.09);
  background: var(--green-soft);
}

.choice-card input {
  position: absolute;
  top: 18px;
  right: 18px;
  accent-color: var(--green);
}

.choice-card strong {
  display: block;
  padding-right: 30px;
  font-size: 18px;
  line-height: 1.3;
}

.choice-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.form-section[hidden] { display: none; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  align-content: start;
  gap: 7px;
}

.field--full { grid-column: 1 / -1; }

.fieldset-reset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field > span,
.field legend {
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.field input,
.field select { height: 46px; padding: 0 13px; }

.field textarea {
  min-height: 124px;
  resize: vertical;
  padding: 12px 13px;
  line-height: 1.5;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #a9c5ad;
  box-shadow: 0 0 0 4px rgba(35, 109, 60, 0.08);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.checkbox-option:has(input:checked) {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 0 0 3px rgba(35, 109, 60, 0.07);
}

.checkbox-option input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  accent-color: var(--green);
}

.field .conditional-input {
  margin-top: 2px;
}

.field .conditional-input[hidden] {
  display: none;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.privacy-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.privacy-check input {
  margin-top: 2px;
  accent-color: var(--green);
}

.form-message {
  min-height: 20px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.form-message.is-error { color: var(--red); }

.success-card {
  padding: 28px;
  text-align: center;
  border: 1px solid #cde2cf;
  border-radius: 22px;
  background: var(--green-soft);
}

.success-card h2 { margin: 0; }
.success-card p { color: var(--muted); line-height: 1.55; }

.success-card__icon {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: #fff;
  color: var(--green);
  font-size: 32px;
  font-weight: 900;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.stat-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 5px;
  font-size: 25px;
}

.stat-card--attention strong { color: var(--amber); }

.filter-bar {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 10px;
  margin-bottom: 14px;
}

.filter-bar input,
.filter-bar select {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  padding: 0 13px;
}

.case-list { display: grid; gap: 9px; }

.case-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(150px, 0.7fr) minmax(150px, 0.7fr) auto;
  gap: 14px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  text-decoration: none;
}

.case-row:hover { border-color: #b8cdbb; }

.case-row__label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.case-row strong,
.case-row span { overflow-wrap: anywhere; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.badge--attention { background: var(--amber-soft); color: var(--amber); }
.badge--resolved { background: #eef0ed; color: var(--muted); }
.badge--waiting { background: #edf3fb; color: #315e8c; }

.empty-state {
  padding: 32px 18px;
  border: 1px dashed #cfd2ca;
  border-radius: 17px;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
}

.meta-list { display: grid; gap: 10px; }

.case-overview__grid {
  display: grid;
  gap: 11px;
  align-items: start;
}

.case-overview__section {
  min-width: 0;
}

.case-overview__section--answers {
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.case-overview__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 26px;
  margin-bottom: 7px;
}

.case-overview__section-head h2 {
  font-size: 15px;
}

.text-action {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.meta-list--compact {
  gap: 8px;
}

.meta-list--customer {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.meta-list--answers {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.meta-row {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.meta-list--compact .meta-row {
  min-width: 0;
  padding: 6px 8px;
  border-radius: 10px;
  background: #fbfaf6;
}

.case-overview .meta-row span {
  font-size: 9px;
}

.case-overview .meta-row p {
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.38;
}

.meta-list--compact .meta-row--span-3 {
  grid-column: span 3;
}

.meta-list--compact .meta-row--span-4 {
  grid-column: 1 / -1;
}

.meta-row span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.meta-row strong,
.meta-row p {
  display: block;
  margin: 4px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.conversation { display: grid; gap: 12px; }

.case-detail-page .conversation-entry,
.customer-conversation-page .conversation-entry {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 86%;
}

.case-detail-page .conversation-entry--customer,
.customer-conversation-page .conversation-entry--customer {
  justify-self: end;
}

.case-detail-page .conversation-entry--expert,
.customer-conversation-page .conversation-entry--expert {
  justify-self: start;
}

.message-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  object-fit: cover;
  object-position: center 28%;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(27, 32, 24, 0.16);
}

.case-detail-page .conversation-entry .message,
.customer-conversation-page .conversation-entry .message {
  max-width: none;
}

.case-detail-page .conversation-entry--customer .message,
.customer-conversation-page .conversation-entry--customer .message {
  border-radius: 17px 17px 5px 17px;
  background: #f8f7f2;
}

.case-detail-page .conversation-entry--expert .message,
.customer-conversation-page .conversation-entry--expert .message {
  border-radius: 17px 17px 17px 5px;
}

.support-header--customer h1 {
  font-size: clamp(27px, 4vw, 38px);
}

.customer-waiting {
  display: flex;
  align-items: center;
  gap: 14px;
  border-color: #cde2cf;
  background: var(--green-soft);
}

.customer-waiting[hidden] { display: none; }

.customer-waiting__avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  object-fit: cover;
  object-position: center 28%;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(27, 32, 24, 0.16);
}

.customer-waiting h2 {
  margin: 0;
  font-size: 18px;
}

.customer-waiting p {
  margin: 5px 0 0;
  color: var(--green-deep);
  font-size: 14px;
  line-height: 1.5;
}

.message {
  max-width: 84%;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 17px 17px 17px 5px;
  background: #fff;
}

.message--expert {
  justify-self: end;
  border-color: #cde2cf;
  border-radius: 17px 17px 5px 17px;
  background: var(--green-soft);
}

.message__meta {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.message__text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.58;
}

.reply-box textarea {
  width: 100%;
  min-height: 120px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  resize: vertical;
  line-height: 1.5;
}

.reply-box__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.reply-box__footer p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.case-lifecycle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 14px;
  padding: 14px 4px 0;
  border-top: 1px solid #d3d5cd;
}

.case-lifecycle h2 {
  margin: 0;
  font-size: 17px;
}

.case-lifecycle p {
  max-width: 720px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.case-lifecycle .button {
  flex: 0 0 auto;
}

.customer-intro {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #cde2cf;
  border-radius: 17px;
  background: var(--green-soft);
  color: var(--green-deep);
  line-height: 1.55;
}

@media (max-width: 820px) {
  .support-header,
  .support-card__head,
  .form-footer,
  .reply-box__footer {
    align-items: stretch;
    flex-direction: column;
  }

  .choice-grid,
  .form-grid,
  .stats-grid,
  .case-overview__grid,
  .filter-bar { grid-template-columns: 1fr; }

  .meta-list--customer,
  .meta-list--answers { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .meta-list--compact .meta-row--span-3,
  .meta-list--compact .meta-row--span-4 { grid-column: 1 / -1; }

  .case-lifecycle {
    align-items: stretch;
    flex-direction: column;
  }

  .case-row { grid-template-columns: 1fr 1fr; }

  .message { max-width: 94%; }

  .advisor-profile__topline { display: grid; }

  .availability-status { justify-self: start; }
}

@media (max-width: 520px) {
  .support-page { padding: 18px 14px 42px; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .support-brand { align-items: flex-start; }
  .support-brand img { width: 62px; height: 50px; }
  .support-card { padding: 17px; border-radius: 19px; }
  .case-row { grid-template-columns: 1fr; }
  .support-actions { width: 100%; }
  .support-actions > * { flex: 1; }
  .advisor-profile {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
    border-radius: 19px;
  }
  .advisor-profile__photo {
    width: 88px;
    height: 112px;
    border-radius: 14px;
  }
  .advisor-profile h2 { font-size: 21px; }
  .advisor-profile__copy,
  .advisor-schedule { grid-column: 1 / -1; }
  .advisor-profile__content { display: contents; }
  .advisor-profile__topline { align-self: center; }
  .advisor-schedule { display: grid; }
}
