/* Tickets pages (the list, a ticket, the report form): the page-local pieces on the shell's tokens and the
   components in app.css. One block per piece, named as the templates use them. */

/* ── small shared bits: a person, the category, when, what a ticket is about ── */
.tperson { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.tperson__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.tcat { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--ink-2); }
.tcat .icon { color: var(--ink-3); flex: none; }
.when { font: 12px/1 var(--mono); color: var(--ink-3); white-space: nowrap; }
.page__sub .when { font-size: inherit; font-family: inherit; color: inherit; }
.tscope { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.tabout { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; min-width: 0; max-width: 100%; }
.tabout__link { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink); text-decoration: none; }
.tabout__link:hover { text-decoration: none; }
.tabout__link:hover .tabout__name { color: var(--accent); }
.tabout__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tabout__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.tabout__sub { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabout__pc { --sz: 24px; width: var(--sz); height: var(--sz); flex: none; display: inline-grid; place-items: center; border-radius: calc(var(--sz) * .27); background: var(--panel-2); border: 1px solid var(--line-2); color: var(--ink-2); }
.tabout .src, .tabout .bavatar { flex: none; }
/* on the ticket page: one row per thing, its status chip at the end */
.tabout--lg { display: flex; flex-direction: column; gap: 10px; }
.tabout--lg .tabout__link { gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.tabout--lg .tabout__link:hover { border-color: var(--line-2); }
.tabout--lg .tabout__text { flex: 1; gap: 2px; }
.tabout--lg .tabout__sub { font-size: 12px; }
.tabout--lg .pill { flex: none; }

/* ── the stacked pictures of a ticket in its row ── */
.tpics { align-items: center; }
.tpics .thumbs__img { object-fit: cover; }
.tpics__more { margin-left: 4px; font: 500 11px/1 var(--mono); color: var(--ink-3); }

/* ── Tickets: the table (eight columns that fit the content frame at 1440; narrower screens scroll it inside the panel) ── */
.ttable { min-width: 980px; }
.ttable th, .ttable td { padding-left: 9px; padding-right: 9px; }
.ttable td { padding-top: 10px; padding-bottom: 10px; }
.ttable th:first-child, .ttable td:first-child { width: 44px; }
.ttable__report { min-width: 260px; max-width: 340px; }
.ttable__status { white-space: nowrap; }
.ttable__status .cell-sub { display: flex; margin-top: 4px; }
.tmail--warn { color: var(--warn); } .tmail--bad { color: var(--bad); }
.treport { display: flex; align-items: center; gap: 12px; min-width: 0; }
.treport__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.treport__title { font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.treport__title:hover { color: var(--accent); text-decoration: none; }
.treport__dot { color: var(--line-2); margin: 0 1px; }
.ttable__about { max-width: 200px; }
.ttable__about .tabout { flex-direction: column; gap: 6px; }
.ttable__about .tabout__sub { max-width: 130px; }
.ttable .tperson { max-width: 120px; }

/* ── a ticket: the head, the manage row, the facts strip, the report, the pictures, the comments ── */
.thead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.thead .page__title { min-width: 0; overflow-wrap: anywhere; }
.thead__n { font: 500 22px/1 var(--mono); color: var(--ink-3); margin-right: 10px; letter-spacing: 0; }
.thead__chips { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.thead__chips .tcat { height: 24px; padding: 0 9px 0 8px; border-radius: 7px; background: var(--neutral-bg); font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.tmanage { gap: 8px; }
.tmanage__form { display: inline-flex; align-items: center; gap: 6px; }
.tmanage__form .input { width: auto; min-width: 140px; height: 28px; font-size: 12px; }
.tfacts .sstrip { border-top: 0; }
.tfacts .sstrip__cell { padding: 10px 16px; }
.tfacts .sstrip__value--sans { display: flex; align-items: center; min-height: 22px; }
.tbody__text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; color: var(--ink); }
.tbody__h { margin: 16px 0 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.texp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.texp__cell { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); border-left-width: 3px; line-height: 1.45; overflow-wrap: anywhere; }
.texp__cell--ok { border-left-color: var(--ok); } .texp__cell--bad { border-left-color: var(--bad); }
.texp__label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.tgallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tshot { margin: 0; min-width: 0; }
.tshot__img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 10px; cursor: zoom-in; background: var(--sunk); }
.tshot__img.is-missing { cursor: default; }
.tshot__cap { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 11.5px; color: var(--ink-3); min-width: 0; }
.tshot__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.tshot__meta { font-family: var(--mono); white-space: nowrap; }
.tfiles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tfiles--after { margin-top: 12px; }
.tfile { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); min-width: 0; font-size: 12.5px; }
.tfile__icon { width: 24px; height: 24px; flex: none; display: inline-grid; place-items: center; border-radius: 7px; background: var(--panel); color: var(--ink-2); font: 12px/1 var(--mono); }
.tfile__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.tfile__meta { margin-left: auto; font: 11.5px/1 var(--mono); color: var(--ink-3); white-space: nowrap; }
.tctx { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-2); font-size: 12.5px; }
.tctx__page { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.tcomments { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 480px; overflow: auto; }
.tcomments__none { color: var(--ink-3); font-size: 12.5px; padding: 4px 0; }
.tcomment { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); }
.tcomment__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.tcomment__head .tperson__name { font-weight: 500; }
.tcomment__body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.tcomment__form { display: flex; gap: 8px; }
.tcomment__form .input { flex: 1; }

/* ── the report form: category picks with icons, the severity as a segmented choice, the drop area ── */
.tnew__form { display: flex; flex-direction: column; min-width: 0; }
.tnew__form .panel__body { gap: 16px; }
.tnew__kind { gap: 14px 16px; }
.tpick { display: flex; flex-wrap: wrap; gap: 6px; }
.tpick__opt { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 9px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--panel); font-size: 12.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tpick__opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.tpick__opt .icon { color: var(--ink-3); }
.tpick__opt:hover { color: var(--ink); }
.tpick__opt:has(input:checked) { color: var(--ink); border-color: var(--accent); background: var(--accent-bg); }
.tpick__opt:has(input:checked) .icon { color: var(--accent); }
.tpick__opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.tsev { flex-wrap: wrap; }
.tsev label > .tsev__opt { display: inline-flex; align-items: center; gap: 6px; }
.tsev__g { font: 600 10px/1 var(--mono); }
.tsev input:checked + .tsev__opt--neutral { color: var(--neutral); } .tsev input:checked + .tsev__opt--info { color: var(--info); }
.tsev input:checked + .tsev__opt--warn { color: var(--warn); } .tsev input:checked + .tsev__opt--bad { color: var(--bad); }
.tnew__picked { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.tnew__count { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tnew__len { font: 11.5px/1 var(--mono); color: var(--warn); }
.tnew__len.is-ok { color: var(--ok); }
.tnew__desc { min-height: 170px; }
.tnew__steps { min-height: 80px; }
.tdrop { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: 12px; background: var(--panel-2); cursor: pointer; position: relative; min-width: 0; }
.tdrop:hover { border-color: var(--accent); }
.tdrop:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.tdrop__input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.tdrop__icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-2); color: var(--ink-2); }
.tdrop__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tdrop__text strong { font-weight: 600; color: var(--ink); }
.tdrop__hint { font-size: 12px; color: var(--ink-3); text-wrap: pretty; }
.tdrop + .tfiles { margin-top: 8px; }
.tnew__foot { flex-wrap: wrap; }
.tnew__note { font-size: 12px; color: var(--ink-3); text-wrap: pretty; }
.tlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tlist li { display: flex; flex-direction: column; gap: 2px; padding-left: 18px; position: relative; line-height: 1.4; }
.tlist li::before { content: "✓"; position: absolute; left: 0; top: 1px; font: 600 11px/1.4 var(--mono); color: var(--ok); }
.tlist strong { font-weight: 500; color: var(--ink); }
.tlist span { font-size: 12.5px; color: var(--ink-2); }

/* ── phones: the manage row and the facts wrap, the gallery goes one by one ── */
@media (max-width: 760px) {
  .tmanage { width: 100%; }
  .tmanage__form { flex-wrap: wrap; }
  .thead__n { display: block; margin: 0 0 2px; font-size: 15px; }
  .tfacts .sstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .texp { grid-template-columns: minmax(0, 1fr); }
  .tgallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .tpics-panel .panel__meta { display: none; }
  .tcomment__form { flex-wrap: wrap; }
  .tcomment__form .input { flex-basis: 100%; }
}
