/* CONTACT TICKETS — the public pages for the Lemo AI team's inbox.

   Same rules as the rest of the site (style.css): colour from its tokens, depth
   is a 1px border and never a shadow, hover changes colour and never position,
   and nothing is decorative. The one reading column is the width Studio uses,
   so a ticket and a Studio chat read the same. */

body[data-page="tickets"] { background: var(--bg); }

.tk { max-width: 46rem; margin: 0 auto; padding: 28px 16px 80px; color: var(--text); }
.tk > h1 { font-family: var(--f-disp); font-size: 1.75rem; letter-spacing: -.02em; line-height: 1.2; margin: 0 0 8px; color: var(--text); }
.tk h2 { font-family: var(--f-disp); font-size: 1.05rem; letter-spacing: -.01em; margin: 0 0 6px; color: var(--text); }
.tk-lead { color: var(--muted); font-size: .95rem; line-height: 1.6; margin: 0 0 24px; max-width: 40rem; }
.tk-muted { color: var(--muted); font-size: .92rem; line-height: 1.55; }
.tk-small { font-size: .82rem; }
.tk-link { color: var(--gold-deep); font-weight: 600; margin-left: 4px; }
.tk-section { margin-top: 32px; }
.tk-section-title { font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 0 0 10px; }

.tk-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.tk-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }

/* The categories are the ticket bot's panel: one row per thing a person might
   need, each a button, so the choice is made before a word is typed. */
.tk-cats { display: grid; gap: 8px; }
.tk-cat { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer; }
.tk-cat:hover { background: var(--hover); }
.tk-cat:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tk-cat.is-chosen { background: var(--gold-soft); border-color: var(--gold-line); }
.tk-cat[disabled] { color: var(--faint); cursor: default; background: var(--card); }
.tk-cat[disabled]:hover { background: var(--card); }
.tk-cat-text { flex: 1; min-width: 0; }
.tk-cat-title { display: block; font-weight: 650; }
.tk-cat-hint { display: block; color: var(--muted); font-size: .86rem; margin-top: 2px; }
.tk-chev { width: 16px; height: 16px; color: var(--faint); flex: none; }

.tk-form { margin-top: 14px; display: grid; gap: 14px; }
.tk-form h2 { margin: 0; }
.tk-form > .tk-muted { margin: -8px 0 0; }
.tk-field label { display: block; font-size: .84rem; font-weight: 600; margin: 0 0 6px; color: var(--text); }
.tk-input, .tk-textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.tk-textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
/* A text box takes the accent colour on its own edge when it has focus. No ring
   and no halo around it: the site's input rule adds a 3px glow on focus, and that
   glow is the second line the owner objected to. Clearing it here is deliberate. */
.tk-input:focus, .tk-textarea:focus { outline: none; border-color: var(--gold-deep); box-shadow: none; }
.tk-counter { text-align: right; color: var(--faint); font-size: .76rem; margin-top: 4px; }
.tk-error { color: var(--bad); font-size: .9rem; line-height: 1.5; margin: 0; }
.tk-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.tk-actions-left { justify-content: flex-start; margin-top: 18px; }

/* A ticket list is one bordered panel with hairlines between rows. */
.tk-list { border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; }
.tk-item { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; }
.tk-list > :first-child { border-top: none; }
a.tk-item:hover { background: var(--hover); }
.tk-item-static { grid-template-columns: minmax(0, 1fr) auto; }
.tk-num { font-family: var(--f-mono); font-size: .8rem; color: var(--muted); }
.tk-item-words { min-width: 0; display: grid; gap: 2px; }
.tk-item-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-item-meta { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-item-side { display: inline-flex; align-items: center; gap: 8px; }

.tk-pill { display: inline-flex; align-items: center; font-size: .74rem; font-weight: 650; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); white-space: nowrap; }
.tk-pill.is-open { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold-deep); }
.tk-pill.is-answered { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.tk-pill.is-solved { background: var(--hover); color: var(--muted); }
.tk-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }

.tk-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.tk-tab { font-size: .86rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); text-decoration: none; }
.tk-tab:hover { background: var(--hover); color: var(--text); }
.tk-tab[aria-current="page"] { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold-deep); font-weight: 650; }
.tk-count { margin-left: 6px; color: var(--faint); font-variant-numeric: tabular-nums; }

.tk-back { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--muted); text-decoration: none; margin-bottom: 14px; }
.tk-back:hover { color: var(--text); }
.tk-back svg { width: 16px; height: 16px; }
.tk-thread-head { margin-bottom: 18px; }
.tk-thread-head h1 { font-family: var(--f-disp); font-size: 1.5rem; letter-spacing: -.02em; line-height: 1.25; margin: 4px 0 8px; overflow-wrap: anywhere; }
.tk-thread-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .86rem; }

.tk-thread { display: grid; gap: 12px; }
.tk-msg { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--card); }
.tk-msg.is-customer { background: var(--hover); }
.tk-msg.is-team { border-left: 3px solid var(--gold); }
.tk-msg-head { display: flex; justify-content: space-between; gap: 12px; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.tk-msg-who { font-weight: 650; color: var(--text); }
.tk-msg-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; color: var(--ink); }
.tk-system { text-align: center; color: var(--faint); font-size: .84rem; margin: 4px 0; }
.tk-note { margin-top: 14px; background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 12px; padding: 12px 14px; color: var(--ink); font-size: .92rem; line-height: 1.5; }
.tk-reply { margin-top: 16px; display: grid; gap: 10px; }
.tk-reply label { font-size: .84rem; font-weight: 600; color: var(--text); }
.tk-reply .tk-actions { justify-content: flex-end; }

.tk-split { display: grid; gap: 20px; }
.tk-side { align-self: start; display: grid; gap: 12px; }
.tk-side h2 { margin: 0; }
.tk-side dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: .9rem; }
.tk-side dt { color: var(--muted); }
.tk-side dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.tk-claimed { font-size: .9rem; color: var(--text); margin: 4px 0 0; }
.tk-side .btn { justify-self: start; }

@media (min-width: 900px) {
  .tk { max-width: 64rem; }
  .tk-split { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
}
@media (max-width: 520px) {
  .tk { padding: 22px 14px 72px; }
  .tk-item { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .tk-item-side { justify-self: start; }
  .tk-actions { justify-content: stretch; }
  .tk-actions .btn { flex: 1 1 auto; text-align: center; }
}
