/*
 * Public ticket support page:
 * templates/apps/tickets/public_show.html.twig
 */

:root {
  --tkpub-bg: var(--app-bg);
  --tkpub-surface: var(--app-surface);
  --tkpub-surface-raised: var(--app-surface-raised);
  --tkpub-surface-muted: var(--app-surface-muted);
  --tkpub-border: var(--app-border);
  --tkpub-border-strong: var(--app-border-strong);
  --tkpub-text: var(--app-text);
  --tkpub-muted: var(--app-text-muted);
  --tkpub-soft: var(--app-text-soft);
  --tkpub-accent: var(--app-accent);
  --tkpub-accent-strong: var(--app-accent-strong);
  --tkpub-accent-soft: var(--app-accent-soft);
  --tkpub-info-soft: var(--app-info-soft);
  --tkpub-info: var(--app-info);
  --tkpub-shadow: var(--app-shadow-sm);
  --tkpub-shadow-lg: var(--app-shadow-md);
  --tkpub-sidebar-w: 282px;
}

.tkpub-page,
.tkpub-page * {
  box-sizing: border-box;
}

.tkpub-page {
  min-height: 100vh;
  background:
    radial-gradient(880px 360px at 0% -10%, color-mix(in srgb, var(--tkpub-accent) 10%, transparent), transparent 58%),
    radial-gradient(760px 320px at 100% 0%, color-mix(in srgb, var(--tkpub-info) 7%, transparent), transparent 56%),
    linear-gradient(180deg, color-mix(in srgb, var(--tkpub-surface) 72%, var(--tkpub-bg)) 0%, var(--tkpub-bg) 100%);
  color: var(--tkpub-text);
}

.tkpub-shell {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 1rem;
}

.tkpub-layout {
  display: grid;
  grid-template-columns: var(--tkpub-sidebar-w) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.tkpub-side {
  position: sticky;
  top: 4.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.tkpub-backlink {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.15rem 0.15rem 0.15rem 0;
  color: var(--tkpub-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.tkpub-backlink:hover {
  color: var(--tkpub-accent-strong);
}

.tkpub-backlink .material-symbols-outlined {
  font-size: 1rem;
}

.tkpub-thread,
.tkpub-panel {
  border: 1px solid color-mix(in srgb, var(--tkpub-border) 92%, transparent);
  border-radius: var(--app-radius-lg);
  background: color-mix(in srgb, var(--tkpub-surface) 96%, transparent);
  box-shadow: var(--tkpub-shadow);
  overflow: hidden;
}

.tkpub-panel {
  backdrop-filter: blur(8px);
}

.tkpub-panel--identity {
  padding: 1rem;
  box-shadow: var(--tkpub-shadow-lg);
}

.tkpub-identity {
  display: flex;
  gap: 0.8rem;
  min-width: 0;
}

.tkpub-avatar {
  width: 2.9rem;
  height: 2.9rem;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tkpub-accent-soft) 90%, white), var(--tkpub-accent-soft));
  color: var(--tkpub-accent-strong);
  font-size: 1rem;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tkpub-accent) 15%, transparent);
}

.tkpub-identity__copy {
  min-width: 0;
}

.tkpub-identity__eyebrow,
.tkpub-thread__label,
.tkpub-thread__count,
.tkpub-composer__label,
.tkpub-summary dt {
  color: var(--tkpub-soft);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.tkpub-identity__title {
  margin: 0.18rem 0 0;
  color: var(--tkpub-text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.tkpub-identity__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  margin-top: 0.4rem;
  color: var(--tkpub-muted);
  font-size: 0.77rem;
}

.tkpub-statusbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.95rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--tkpub-border);
}

.tkpub-badge {
  min-height: 1.7rem;
  display: inline-flex;
  align-items: center;
  padding: 0 0.65rem;
  border: 1px solid var(--tkpub-border);
  border-radius: 999px;
  background: var(--tkpub-surface-muted);
  color: var(--tkpub-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.tkpub-badge--status {
  border-color: color-mix(in srgb, var(--tkpub-accent) 28%, var(--tkpub-border));
  background: var(--tkpub-accent-soft);
  color: var(--tkpub-accent-strong);
}

.tkpub-panel--collapsible[open] {
  box-shadow: var(--tkpub-shadow-lg);
}

.tkpub-panel__summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
}

.tkpub-panel__summary::-webkit-details-marker {
  display: none;
}

.tkpub-panel__head {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--tkpub-text);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.2;
}

.tkpub-panel__head .material-symbols-outlined {
  font-size: 1rem;
  color: var(--tkpub-accent-strong);
}

.tkpub-panel__chevron {
  font-size: 1rem;
  color: var(--tkpub-soft);
  transition: transform 0.18s ease;
}

.tkpub-panel--collapsible[open] .tkpub-panel__chevron {
  transform: rotate(180deg);
}

.tkpub-panel__body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--tkpub-border);
}

.tkpub-panel__body--actions {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.tkpub-panel__body--summary {
  padding-top: 0.35rem;
  padding-bottom: 0.7rem;
}

.tkpub-actions-form {
  margin: 0;
}

.tkpub-summary {
  display: grid;
  gap: 0.5rem;
  margin: 0;
}

.tkpub-summary div {
  display: grid;
  gap: 0.18rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--tkpub-border);
}

.tkpub-summary div:first-child {
  border-top: 0;
  padding-top: 0.35rem;
}


.tkpub-summary dd {
  margin: 0;
  color: var(--tkpub-text);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.4;
}

.tkpub-thread {
  height: min(80vh, 56rem);
  min-height: 40rem;
  max-height: 56rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 2px solid color-mix(in srgb, var(--tkpub-border-strong) 92%, #94a3b8);
  background: #ffffff;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.025),
    0 18px 42px rgba(15, 23, 42, 0.1);
}

.tkpub-thread__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem 0.95rem;
  border-bottom: 1px solid var(--tkpub-border-strong);
  background: #f8fafc;
}

.tkpub-thread__intro {
  min-width: 0;
}

.tkpub-thread__head h2 {
  margin: 0.14rem 0 0;
  color: var(--tkpub-text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.tkpub-thread__subtitle {
  margin: 0.35rem 0 0;
  color: var(--tkpub-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.tkpub-thread__meta {
  flex: 0 0 auto;
}

.tkpub-thread__count {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0 0.58rem;
  border: 1px solid var(--tkpub-border);
  border-radius: 999px;
  background: var(--tkpub-surface);
}

.tkpub-thread__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  padding: 1.2rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #f6f8fb;
  scrollbar-color: color-mix(in srgb, var(--tkpub-border-strong) 80%, #64748b) transparent;
  scrollbar-width: thin;
}

.tkpub-message {
  display: grid;
  gap: 0.35rem;
}

.tkpub-message--operator {
  justify-items: start;
}

.tkpub-message--owner {
  justify-items: end;
}

.tkpub-message__meta,
.tkpub-message__bubble,
.tkpub-message__files {
  max-width: min(760px, 86%);
}

.tkpub-message__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  padding: 0 0.2rem;
  color: var(--tkpub-soft);
  font-size: 0.72rem;
  line-height: 1.3;
}

.tkpub-message__meta span:first-child {
  color: var(--tkpub-muted);
  font-weight: 800;
}

.tkpub-message__bubble {
  padding: 0.9rem 1rem;
  border: 1px solid var(--tkpub-border);
  border-radius: 1.05rem;
  background: color-mix(in srgb, var(--tkpub-surface) 98%, transparent);
  color: var(--tkpub-text);
  font-size: 0.92rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.03);
}

.tkpub-message--operator .tkpub-message__meta,
.tkpub-message--operator .tkpub-message__bubble,
.tkpub-message--operator .tkpub-message__files {
  justify-self: start;
}

.tkpub-message--operator .tkpub-message__bubble {
  border-color: color-mix(in srgb, var(--tkpub-border) 90%, white);
}

.tkpub-message--owner .tkpub-message__meta,
.tkpub-message--owner .tkpub-message__bubble,
.tkpub-message--owner .tkpub-message__files {
  justify-self: end;
}

.tkpub-message--owner .tkpub-message__bubble {
  border-color: color-mix(in srgb, var(--tkpub-accent) 18%, var(--tkpub-border));
  background: linear-gradient(180deg, color-mix(in srgb, var(--tkpub-accent-soft) 62%, white), color-mix(in srgb, var(--tkpub-accent-soft) 88%, transparent));
}

.tkpub-message__files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tkpub-file {
  min-height: 1.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0 0.62rem;
  border: 1px solid var(--tkpub-border);
  border-radius: 999px;
  background: var(--tkpub-surface);
  color: var(--tkpub-muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.tkpub-file:hover {
  border-color: var(--tkpub-accent);
  color: var(--tkpub-accent-strong);
}

.tkpub-file .material-symbols-outlined {
  font-size: 1rem;
}

.tkpub-system {
  align-self: center;
  max-width: min(720px, 100%);
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.28rem 0.5rem;
  padding: 0.36rem 0.72rem;
  border: 1px solid color-mix(in srgb, var(--tkpub-border) 82%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tkpub-surface-muted) 75%, transparent);
  color: var(--tkpub-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.tkpub-system__label {
  color: var(--tkpub-text);
  font-weight: 800;
}

.tkpub-empty {
  min-height: 16rem;
  display: grid;
  place-items: center;
  gap: 0.45rem;
  align-content: center;
  border: 1px dashed var(--tkpub-border-strong);
  border-radius: var(--app-radius-lg);
  background: color-mix(in srgb, var(--tkpub-surface-muted) 70%, transparent);
  color: var(--tkpub-muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
}

.tkpub-empty .material-symbols-outlined {
  color: var(--tkpub-accent-strong);
  font-size: 1.65rem;
}

.tkpub-composer {
  flex: 0 0 auto;
  display: block;
  padding: 1rem;
  border-top: 1px solid var(--tkpub-border-strong);
  background: #ffffff;
}

.tkpub-composer__input {
  width: 100%;
  min-height: calc(1.35em + 0.8rem);
  max-height: 88px;
  padding: 0.4rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--tkpub-text);
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.35;
  outline: none;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  resize: none;
  transition: none;
}

.tkpub-composer__input::placeholder {
  color: #6b7280;
}

.tkpub-composer__input:focus {
  outline: none;
  box-shadow: none;
}

.tkpub-composer__input:focus-visible {
  outline: none;
  box-shadow: none;
}

.tkpub-composer__input:disabled {
  color: #6b7280;
  cursor: not-allowed;
}

.tkpub-composer__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.tkpub-composer__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.7rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid #d1d5db;
  border-radius: 1.5rem;
  background: #f3f4f6;
}

.tkpub-composer__attach {
  flex: 0 0 auto;
  width: 2.2rem;
  height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tkpub-composer__attach:hover {
  background: #e5e7eb;
  color: var(--tkpub-text);
}

.tkpub-composer__attach .material-symbols-outlined {
  font-size: 1.1rem;
}

.tkpub-composer__attach:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.tkpub-composer__file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tkpub-composer__bar:focus-within {
  border-color: #d1d5db;
  box-shadow: none;
  outline: none;
}

.tkpub-composer__bar.is-disabled {
  border-color: #d1d5db;
  background: #e5e7eb;
  opacity: 0.9;
}

.tkpub-composer__status {
  margin: 0.6rem 0 0;
  color: var(--tkpub-muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.tkpub-composer__files {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.tkpub-composer__file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--tkpub-border);
  border-radius: 0.9rem;
  background: #ffffff;
  padding: 0.65rem 0.8rem;
}

.tkpub-composer__file-meta {
  min-width: 0;
  display: grid;
  gap: 0.18rem;
}

.tkpub-composer__file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--tkpub-text);
  font-size: 0.84rem;
  font-weight: 700;
}

.tkpub-composer__file-size {
  color: var(--tkpub-muted);
  font-size: 0.74rem;
}

.tkpub-composer__file-remove {
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tkpub-composer__file-remove:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.tkpub-composer__status[hidden] {
  display: none;
}

.tkpub-composer__status[data-state="success"] {
  color: #047857;
}

.tkpub-composer__status[data-state="error"] {
  color: #b91c1c;
}

.tkpub-btn {
  min-height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0 0.78rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tkpub-btn .material-symbols-outlined {
  font-size: 0.98rem;
}

.tkpub-btn__label {
  display: none;
}

.tkpub-btn--block {
  width: 100%;
  min-height: 2.7rem;
  padding: 0.55rem 0.95rem;
  line-height: 1.2;
}

.tkpub-btn--primary {
  background: var(--tkpub-accent);
  border-color: var(--tkpub-accent);
  color: #ffffff;
  box-shadow: none;
}

.tkpub-btn--primary:hover {
  background: var(--tkpub-accent-strong);
  border-color: var(--tkpub-accent-strong);
}

.tkpub-btn--secondary {
  border-color: color-mix(in srgb, var(--tkpub-accent) 24%, var(--tkpub-border));
  background: var(--tkpub-accent-soft);
  color: var(--tkpub-accent-strong);
}

.tkpub-btn--secondary:hover {
  border-color: var(--tkpub-accent);
  background: color-mix(in srgb, var(--tkpub-accent-soft) 72%, white);
}

.tkpub-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.tkpub-bot-conversation {
  display: grid;
  gap: 0.8rem;
  padding: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--tkpub-accent) 24%, var(--tkpub-border));
  border-radius: 0.85rem;
  background: var(--tkpub-accent-soft);
}

.tkpub-bot-conversation__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.tkpub-bot-conversation__head div {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
}

.tkpub-bot-conversation__head span {
  color: var(--tkpub-accent-strong);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tkpub-bot-conversation__head strong {
  color: var(--tkpub-text);
  font-size: 0.9rem;
  font-weight: 900;
}

.tkpub-bot-conversation__head em {
  color: var(--tkpub-muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 760;
  white-space: nowrap;
}

.tkpub-bot-conversation__thread {
  display: grid;
  gap: 0.58rem;
  max-height: 22rem;
  overflow-y: auto;
}

.tkpub-bot-message {
  display: grid;
  gap: 0.34rem;
  width: min(86%, 42rem);
  padding: 0.68rem 0.75rem;
  border: 1px solid var(--tkpub-border);
  border-radius: 0.7rem;
  background: var(--tkpub-surface);
}

.tkpub-bot-message--user {
  justify-self: end;
  border-color: color-mix(in srgb, var(--tkpub-accent) 28%, var(--tkpub-border));
  background: #f8fffb;
}

.tkpub-bot-message--assistant {
  justify-self: start;
}

.tkpub-bot-message header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.tkpub-bot-message strong {
  color: var(--tkpub-text);
  font-size: 0.72rem;
  font-weight: 880;
}

.tkpub-bot-message time {
  color: var(--tkpub-muted);
  font-size: 0.64rem;
  font-weight: 720;
}

.tkpub-bot-message p {
  margin: 0;
  color: var(--tkpub-soft);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.45;
}

@media (max-width: 960px) {
  .tkpub-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .tkpub-side {
    position: static;
  }

  .tkpub-thread {
    height: min(48rem, 82vh);
    min-height: 38rem;
  }
}

@media (max-width: 640px) {
  .tkpub-shell {
    padding: 0.85rem;
  }

  .tkpub-panel--identity,
  .tkpub-panel__summary,
  .tkpub-panel__body,
  .tkpub-thread__head,
  .tkpub-thread__body,
  .tkpub-composer {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .tkpub-thread__head {
    flex-direction: column;
    align-items: stretch;
  }

  .tkpub-thread__meta {
    display: flex;
    justify-content: flex-start;
  }

  .tkpub-message__meta,
  .tkpub-message__bubble,
  .tkpub-message__files {
    max-width: 100%;
  }

  .tkpub-bot-conversation__head {
    flex-direction: column;
  }

  .tkpub-bot-conversation__head em {
    white-space: normal;
  }

  .tkpub-bot-message {
    width: 100%;
  }

}
