/* Support page (SupportPage.jsx) and the Owner Panel Support inbox
   (OwnerSupport.jsx). The open request or the new-request form on the left,
   the list of requests and tips on the right; one column on phones. Colours
   come from the theme tokens in colors_and_type.css, so light and dark both
   work. */

.support-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: 20px;
  align-items: start;
}

/* ---------------------------------------------------------------- panel */

.support-panel {
  min-width: 0;
  padding: 28px;
  background:
    radial-gradient(120% 70% at 0% 0%, var(--pc-accent-soft) 0%, transparent 55%),
    var(--pc-bg-card);
}

.support-panel h2 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--pc-slate-text);
  text-wrap: balance;
}

.support-panel-sub {
  margin: 0 0 20px;
  color: var(--pc-slate-muted);
  font-size: 13px;
}

.support-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.support-hero-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--pc-bg-card);
  color: var(--pc-accent);
  box-shadow: 0 0 0 1px var(--pc-slate-border), 0 8px 20px -12px rgba(var(--pc-ink-rgb), 0.35);
}

.support-hero h2 {
  font-size: 21px;
  letter-spacing: -0.01em;
}

.support-hero p {
  margin: 0;
  max-width: 62ch;
  color: var(--pc-slate-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Topic shortcuts: one click fills the subject. */
.support-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.support-topic {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--pc-slate-border);
  border-radius: 999px;
  background: var(--pc-bg-card);
  color: var(--pc-slate-text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.support-topic:hover {
  border-color: var(--pc-accent);
}

.support-topic.is-chosen {
  border-color: var(--pc-accent);
  background: var(--pc-accent-soft);
  color: var(--pc-accent);
}

.support-form {
  display: grid;
  gap: 18px;
}

.support-form textarea {
  min-height: 140px;
  resize: vertical;
  font: inherit;
}

.support-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---------------------------------------------------------------- files */

.support-dropzone {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1.5px dashed var(--pc-slate-border);
  border-radius: 14px;
  background: var(--pc-bg-card-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.support-dropzone:hover,
.support-dropzone.is-dragging {
  border-color: var(--pc-accent);
  background: var(--pc-accent-soft);
}

.support-dropzone[aria-disabled='true'] {
  cursor: default;
  opacity: 0.6;
}

.support-dropzone-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--pc-bg-card);
  color: var(--pc-accent);
  box-shadow: 0 0 0 1px var(--pc-slate-border);
}

.support-dropzone-text {
  display: grid;
  gap: 2px;
}

.support-dropzone-text strong {
  font-size: 14px;
  color: var(--pc-slate-text);
}

.support-dropzone-text small {
  font-size: 12px;
  line-height: 1.45;
  color: var(--pc-slate-muted);
}

.support-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.support-thumb {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--pc-slate-border);
  border-radius: 12px;
  background: var(--pc-bg-card);
  min-width: 0;
}

.support-thumb img,
.support-thumb-video {
  width: 100%;
  height: 78px;
  border-radius: 8px;
  object-fit: cover;
}

.support-thumb-video {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  background: var(--pc-inverse-bg);
  color: var(--pc-inverse-text);
}

.support-thumb-video small {
  font-size: 11px;
}

.support-thumb-name {
  overflow: hidden;
  font-size: 12px;
  color: var(--pc-slate-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-thumb-size {
  font-size: 11px;
  color: var(--pc-slate-muted);
}

.support-thumb-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(8, 8, 10, 0.65);
  color: #fff;
  cursor: pointer;
}

.support-list-item:focus-visible,
.support-topic:focus-visible,
.support-dropzone:focus-visible,
.support-thumb-remove:focus-visible {
  outline: 2px solid var(--pc-accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------- thread */

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

/* Where the request is: sent, support replied, solved. */
.support-steps {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  padding: 12px 14px;
  border: 1px solid var(--pc-slate-border);
  border-radius: 12px;
  background: var(--pc-bg-card);
  list-style: none;
  font-size: 12px;
  color: var(--pc-slate-muted);
}

.support-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  white-space: nowrap;
}

.support-steps li:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 2px;
  min-width: 12px;
  border-radius: 2px;
  background: var(--pc-slate-border);
}

.support-steps li.is-done:not(:last-child)::after {
  background: var(--pc-slate-success);
}

.support-steps li:last-child {
  flex: none;
}

.support-step-dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--pc-slate-border);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.support-steps li.is-done .support-step-dot {
  border-color: var(--pc-slate-success);
  background: var(--pc-slate-success);
  color: #fff;
}

.support-steps li.is-current {
  color: var(--pc-slate-text);
  font-weight: 600;
}

.support-steps li.is-current .support-step-dot {
  border-color: var(--pc-accent);
  background: var(--pc-accent);
  color: #fff;
}

.support-messages {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
}

.support-message {
  display: grid;
  gap: 4px;
  max-width: min(600px, 90%);
}

.support-message.has-avatar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: min(640px, 94%);
}

.support-message.is-mine {
  justify-self: end;
}

.support-message.has-avatar.is-mine {
  flex-direction: row-reverse;
}

.support-message-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.support-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pc-accent-soft);
  color: var(--pc-accent);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
}

.support-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}

.support-message-meta {
  font-size: 12px;
  color: var(--pc-slate-muted);
}

.support-message.is-mine .support-message-meta {
  text-align: right;
}

.support-bubble {
  padding: 12px 15px;
  border: 1px solid var(--pc-slate-border);
  border-radius: 16px 16px 16px 4px;
  background: var(--pc-bg-card);
  color: var(--pc-slate-text);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.support-message.is-mine .support-bubble {
  border-color: transparent;
  border-radius: 16px 16px 4px 16px;
  background: var(--pc-accent);
  color: #fff;
}

/* An internal note in the Owner Panel: only our team sees it. */
.support-message.is-note .support-bubble {
  border: 1px dashed var(--pc-slate-warning-border);
  background: var(--pc-slate-warning-bg);
  color: var(--pc-slate-warning-text);
}

.support-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.support-message.is-mine .support-attachments {
  justify-content: flex-end;
}

.support-attachments a img {
  display: block;
  width: 168px;
  height: 112px;
  border: 1px solid var(--pc-slate-border);
  border-radius: 12px;
  object-fit: cover;
  transition: transform 0.15s ease;
}

.support-attachments a:hover img {
  transform: scale(1.02);
}

.support-attachments video {
  width: min(340px, 100%);
  border-radius: 12px;
  background: #000;
}

.support-solved-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--pc-slate-success-soft);
  color: var(--pc-slate-success);
  font-size: 13px;
}

.support-reply {
  padding-top: 18px;
  border-top: 1px solid var(--pc-slate-border);
}

/* ------------------------------------------------------- right column */

.support-side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.support-list {
  padding: 10px;
  max-height: calc(100vh - 360px);
  min-height: 160px;
  overflow-y: auto;
}

.support-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 10px;
}

.support-list-head h2 {
  margin: 0;
  font-size: 15px;
  color: var(--pc-slate-text);
}

.support-count {
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--pc-bg-card-soft);
  color: var(--pc-slate-muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.support-list-empty {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 12px 8px 16px;
  color: var(--pc-slate-muted);
  font-size: 13px;
  line-height: 1.5;
}

.support-list-empty-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--pc-bg-card-soft);
}

.support-list-item {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: none;
  color: var(--pc-slate-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.support-list-item + .support-list-item {
  margin-top: 4px;
}

.support-list-item:hover {
  background: var(--pc-bg-card-soft);
}

.support-list-item.is-active {
  border-color: var(--pc-slate-border);
  background: var(--pc-accent-soft);
  box-shadow: 0 6px 16px -12px rgba(var(--pc-ink-rgb), 0.45);
}

.support-list-subject {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.support-unread-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pc-accent);
  box-shadow: 0 0 0 3px var(--pc-accent-soft);
}

.support-list-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--pc-slate-muted);
  font-size: 12px;
}

.support-tips {
  padding: 18px 20px;
}

.support-tips h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--pc-slate-text);
}

.support-tips h2 svg {
  color: var(--pc-slate-warning-text);
}

.support-tips ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--pc-slate-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ------------------------------------------- Owner Panel Support inbox */

.owner-support-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

.owner-support-side {
  display: grid;
  gap: 10px;
}

.owner-support-side h2 {
  margin: 0;
  font-size: 15px;
}

.owner-support-side p {
  margin: 0;
}

.owner-support-facts {
  display: grid;
  gap: 6px;
  margin: 0;
}

.owner-support-facts div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.owner-support-facts dt {
  color: var(--pc-slate-muted);
}

.owner-support-facts dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  text-transform: capitalize;
}

.owner-support-note-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--pc-slate-muted);
}

.owner-nav-count {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--pc-accent);
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  text-align: center;
}

/* The inbox list: room between the description, the tabs and the table,
   and taller rows that are easy to scan and click. */
.owner-support-list {
  padding: 24px 26px 18px;
}

.owner-support-list .owner-card-head {
  margin-bottom: 18px;
}

.owner-support-list .owner-o5-tabs {
  margin-bottom: 18px;
}

.owner-support-list .owner-table th {
  padding: 12px 16px;
}

.owner-support-list .owner-table td {
  padding: 16px;
}

.owner-support-list .owner-cell-title {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
}

.owner-support-list .owner-cell-sub {
  display: block;
  margin-top: 4px;
}

.owner-support-list .owner-status {
  white-space: nowrap;
}

/* One request: the thread, then the customer and the request's settings. */
.owner-support-thread {
  padding: 24px 26px;
}

.owner-support-thread .owner-card-head {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--pc-slate-border);
}

.owner-support-thread .support-messages {
  margin-bottom: 26px;
}

.owner-support-thread .support-form {
  padding-top: 20px;
  border-top: 1px solid var(--pc-slate-border);
}

.owner-support-side {
  gap: 12px;
  padding: 22px 24px;
}

.owner-support-side .field {
  display: grid;
  gap: 6px;
}

.owner-support-side .owner-support-facts {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--pc-bg-card-soft);
}

.owner-support-side .owner-support-side-section {
  margin-top: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--pc-slate-border);
}

/* -------------------------------------------------------------- layouts */

@media (max-width: 1100px) {
  .owner-support-detail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .support-layout {
    grid-template-columns: 1fr;
  }

  /* On a phone the list comes first, above the open request. */
  .support-side {
    order: -1;
  }

  .support-list {
    max-height: 280px;
  }

  .support-tips {
    display: none;
  }

  .support-panel {
    padding: 20px 16px;
  }

  .support-steps li {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .support-topic,
  .support-dropzone,
  .support-list-item,
  .support-attachments a img {
    transition: none;
  }
}
