.ti-root,
.ti-view,
.ti-detail,
.ti-panel,
.ti-filters,
.ti-form,
.ti-list,
.ti-list li {
  min-width: 0;
}
.ti-root {
  color: var(--ink);
  overflow-wrap: anywhere;
}
.ti-message {
  position: sticky;
  z-index: 2;
  top: 0;
  margin: 0;
  background: var(--sky);
  border-radius: 6px;
  font-weight: 600;
}
.ti-message:not(:empty) {
  padding: 9px 12px;
  margin-bottom: 12px;
}
.ti-message:empty {
  display: none;
}
.ti-filters,
.ti-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 14px;
}
.ti-filters,
.ti-form,
.ti-back,
.ti-pager {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}
.ti-panel h2,
.ti-panel h3 {
  margin: 0 0 12px;
}
.ti-panel p {
  line-height: 1.45;
}
.ti-form {
  margin: 12px 0;
}
.ti-root .form-label {
  min-width: 0;
  flex: 1 1 130px;
  padding: 0;
  margin: 0;
}
.ti-root input,
.ti-root select,
.ti-root textarea {
  max-width: 100%;
  min-width: 0;
}
.ti-root textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  font: inherit;
}
.ti-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 0;
  font-size: 0.9rem;
}
.ti-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(145px, 100%), 1fr));
  gap: 8px;
  margin: 0 0 14px;
}
.ti-metrics button {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--white);
  padding: 12px;
  text-align: left;
}
.ti-metrics button:hover,
.ti-metrics button[aria-pressed="true"] {
  border-color: var(--blue);
}
.ti-metrics button[aria-pressed="true"] {
  background: var(--sky);
}
.ti-metrics strong,
.ti-metrics span {
  display: block;
}
.ti-metrics strong {
  font-size: 1.5rem;
}
.ti-list,
.ti-history {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ti-ticket {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.85fr) minmax(0, 0.7fr);
  gap: 12px;
  padding: 13px 4px;
  color: var(--ink);
  background: white;
  border: 0;
  border-top: 1px solid var(--line);
  text-align: left;
  min-height: 48px;
}
.ti-ticket:hover {
  background: var(--cloud);
}
.ti-ticket small,
.ti-history small {
  display: block;
  color: var(--dim);
  font-size: 0.83rem;
  margin-top: 4px;
}
.ti-urgent,
.ti-due {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.8rem;
}
.ti-urgent {
  background: var(--peach);
  color: var(--dark-orange);
}
.ti-due {
  background: var(--sky);
  color: var(--ink);
}
.ti-urgent + .ti-due {
  margin-left: 5px;
}
.ti-back,
.ti-pager {
  align-items: center;
  margin-bottom: 14px;
}
.ti-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}
.ti-panel details {
  margin-top: 12px;
}
.ti-panel summary {
  cursor: pointer;
  font-weight: 650;
}
.ti-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.ti-facts dt {
  color: var(--dim);
  font-size: 0.85rem;
}
.ti-facts dd {
  margin: 3px 0 0;
}
.ti-note,
.ti-history p {
  white-space: pre-wrap;
}
.ti-history li {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
@media (max-width: 800px) {
  .ti-detail {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 580px) {
  .ti-ticket {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  }
  .ti-ticket > span:last-child {
    grid-column: 1/-1;
  }
  .ti-ticket > span:last-child:has(small:empty):not(:has(b)) {
    display: none;
  }
  .ti-filters,
  .ti-panel {
    padding: 12px;
  }
  .ti-root .page-head {
    flex-wrap: wrap;
  }
  .ti-root .btn {
    white-space: normal;
  }
  .ti-facts {
    grid-template-columns: 1fr;
  }
}
