/* support/ticket.html - a customer's view of one support ticket.

   Rides on promo.css for the page chrome (header, footer, the .promo-btn),
   and adds only the thread. Tokens only, never a colour, so it reads in
   whichever of the eight themes the visitor's machine picks. */

.ticket {
  --ticket-width: 46rem;
}

.promo.ticket > * {
  max-width: var(--ticket-width);
}

.ticket__head {
  padding: 28px 0 8px;
}

.ticket__number {
  margin: 0 0 4px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: calc(0.85rem * var(--font-scale, 1));
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  word-break: break-all;
}

.ticket__head h2 {
  margin: 0 0 10px;
}

.ticket__status {
  display: inline-block;
  margin: 0 0 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: calc(0.95rem * var(--font-scale, 1));
}

.ticket__status:empty {
  display: none;
}

.ticket__status[data-status="waiting"] {
  background: var(--warn-soft);
}

.ticket__status[data-status="closed"] {
  background: var(--surface-alt);
  color: var(--ink-muted);
}

.ticket__line {
  margin: 4px 0 0;
  color: var(--ink-muted);
}

.ticket__thread {
  list-style: none;
  margin: 18px auto 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.ticket__msg {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
}

/* The desk's own words and a technician's are set apart from the customer's. */
.ticket__msg--staff {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.ticket__msg--system {
  background: var(--surface-alt);
  color: var(--ink-muted);
}

.ticket__who {
  font-weight: 600;
}

.ticket__when {
  font-size: calc(0.8rem * var(--font-scale, 1));
  color: var(--ink-faint);
  align-self: center;
}

.ticket__body {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ticket__reply {
  margin: 22px auto 0;
  display: grid;
  gap: 8px;
}

.ticket__reply textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font: inherit;
  color: var(--field-ink, var(--ink));
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  resize: vertical;
}

.ticket__reply textarea:focus {
  outline: 2px solid var(--focus-ring, var(--accent));
}

.ticket__actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ticket__say.is-good {
  color: var(--ok);
}

.ticket__say.is-bad {
  color: var(--danger);
}

.ticket__keep {
  margin-top: 20px;
  color: var(--ink-muted);
}

/* The chat start form: a name and a message, laid out like the reply box. */
.ticket__reply input[type="text"],
.ticket__reply input[type="email"],
.ticket__reply input[type="tel"],
.ticket__mail input[type="email"] {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font: inherit;
  color: var(--field-ink, var(--ink));
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
}

/* Off the page for people, on it for scripts. */
.chat__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* The rating, once it is solved. */
.ticket__rate {
  margin: 22px auto 0;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  display: grid;
  gap: 8px;
}

.ticket__rate h3 {
  margin: 0;
}

.ticket__rate textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font: inherit;
  color: var(--field-ink, var(--ink));
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  resize: vertical;
}

.ticket__stars {
  display: flex;
  gap: 4px;
}

.ticket__stars button {
  padding: 0 4px;
  border: 0;
  background: none;
  font-size: calc(2rem * var(--font-scale, 1));
  line-height: 1;
  color: var(--rule-strong);
  cursor: pointer;
}

.ticket__stars button.is-on {
  color: var(--warn);
}

/* Tell me about a reply by email. */
.ticket__mail {
  margin: 18px auto 0;
  display: grid;
  gap: 6px;
  color: var(--ink-muted);
}

.ticket__mail input {
  flex: 1 1 14rem;
  max-width: 22rem;
  padding: 8px 10px;
  font: inherit;
  color: var(--field-ink, var(--ink));
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
}

/* A number to call back on: stands out until there is one. */
.ticket__phone {
  margin: 14px auto 0;
  padding: 10px 14px;
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  background: var(--accent-soft);
  display: grid;
  gap: 6px;
}

.ticket__phone.is-given {
  border-color: var(--rule);
  background: var(--surface);
}

.ticket__phone input {
  flex: 1 1 12rem;
  max-width: 16rem;
  padding: 8px 10px;
  font: inherit;
  color: var(--field-ink, var(--ink));
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
}

/* The example must never read as a value somebody already typed. */
.ticket__phone input::placeholder {
  color: var(--ink-muted, var(--ink));
  opacity: 0.45;
  font-style: italic;
}

.ticket__note {
  margin: 0;
  color: var(--ink-muted);
  font-size: calc(0.9rem * var(--font-scale, 1));
}

.ticket__talk {
  margin-top: 22px;
  color: var(--ink-muted);
}

/* Support is waiting for the customer to say yes or no to sending logs. */
.ticket__ask {
  margin: 14px auto 0;
  padding: 10px 14px;
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  background: var(--accent-soft);
}
