/* Features and Bugs tabs: same tokens and patterns as record.css / script-desk.css. */
#view-features, #view-bugs {--tk-p0: var(--red); --tk-p1: var(--accent); --tk-p2: var(--orange);}
#view-features *, #view-bugs *, #view-features *::before, #view-bugs *::before, #view-features *::after, #view-bugs *::after {box-sizing: border-box;}
#view-features, #view-bugs {background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 14px; line-height: 1.5; letter-spacing: -0.01em; min-height: calc(100dvh - 66px); min-width: 0;}
#view-features h1, #view-bugs h1 {margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.012em;}
.tk-root{container: tracker-table / inline-size}
.tk-root [hidden] {display: none !important;}
.tk-root .tk-mono {font-family: var(--mono); font-size: 12px; letter-spacing: -0.013em;}
.tk-root .tk-bar {display: flex; align-items: baseline; gap: 10px 16px; padding: 10px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap;}
.tk-root .tk-heading {display: flex; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; flex: 1; min-width: 0;}
.tk-root .tk-sub {color: var(--text2);}
.tk-root .tk-grow {flex: 1;}
.tk-root .tk-wrap {padding: 16px; width: 100%; min-width: 0; display: flex; flex-direction: column; gap: 12px;}
.tk-root .tk-tools {display: flex; align-items: center; gap: 8px; flex-wrap: wrap;}
.tk-root .tk-filter {display: flex; flex-direction: column; gap: 4px; min-width: 0;}
.tk-root .tk-filter-label, .tk-root .tk-field-label {display: none;}
.tk-root .tk-filters {display: contents;}
.tk-root .tk-filter-toggle {display: none;}
.tk-root .tk-inp, .tk-root .tk-sel {font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; min-width: 0;}
.tk-root .tk-inp:focus-visible, .tk-root .tk-sel:focus-visible, .tk-root .tk-btn:focus-visible, .tk-root .tk-link:focus-visible {outline: 2px solid var(--accent); outline-offset: 1px;}
.tk-root .tk-search {width: 220px;}
.tk-root .tk-btn {font: inherit; font-size: 14px; border-radius: 6px; padding: 7px 12px; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; white-space: nowrap;}
.tk-root .tk-btn:hover:not(:disabled) {border-color: var(--border-strong);}
.tk-root .tk-btn.tk-primary {background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600;}
.tk-root .tk-btn.tk-primary:hover:not(:disabled) {background: var(--accent-hover); border-color: var(--accent-hover);}
.tk-root .tk-btn.tk-small {padding: 3px 8px; font-size: 12px;}
.tk-root .tk-btn:disabled {opacity: .4; cursor: not-allowed;}
.tk-root .tk-msg {color: var(--green);}
.tk-root .tk-notice {display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--success-soft); border: 1px solid var(--success-border); border-radius: 6px; overflow-wrap: anywhere;}
.tk-root .tk-dismiss {flex-shrink: 0; color: inherit;}
.tk-root .tk-notice.tk-err {background: var(--danger-soft); border-color: var(--danger-border);}
.tk-root .tk-msg.tk-err, .tk-root .tk-err {color: var(--red);}
.tk-root .tk-panel {background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-subtle);}
.tk-root dialog.tk-panel {width: 800px; max-width: calc(100vw - 48px); max-height: 88dvh; margin: auto; padding: 0; overflow: hidden; color: var(--text);}
.tk-root dialog::backdrop {background: rgb(0 0 0 / .6);}
.tk-root .tk-form-head {padding: 24px 24px 12px;}
.tk-root .tk-form-head .tk-hint {margin-top: 6px;}
.tk-root .tk-form-scroll {overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 0 24px 12px;}
.tk-root .tk-form-footer {flex-shrink: 0; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface);}
.tk-root .tk-form-footer .tk-err {margin: 0 0 12px;}
.tk-root .tk-form h2 {margin: 0; font-size: 22px;}
.tk-root .tk-form h3 {margin: 0; font-size: 14px;}
.tk-root .tk-intake-fields {display: flex; flex-direction: column; gap: 18px; padding: 0; border: 0; margin: 12px 0; min-width: 0;}
.tk-root .tk-intake-fields .tk-row {align-items: start; gap: 16px;}
.tk-root .tk-intake-fields .tk-inp, .tk-root .tk-intake-fields .tk-sel {width: 100%; padding: 9px 10px;}
.tk-root .tk-hint {font-size: 12px; line-height: 1.5; color: var(--text3); margin: 0; overflow-wrap: anywhere;}
.tk-root .tk-form-actions {display: flex; justify-content: flex-end; gap: 10px; padding: 0;}
.tk-root .tk-evidence {display: flex; flex-direction: column; gap: 8px;}
.tk-root .tk-screenshots {display: flex; gap: 12px; flex-wrap: wrap;}
.tk-root .tk-screenshots figure {width: 150px; margin: 0; display: flex; flex-direction: column; gap: 6px;}
.tk-root .tk-screenshots img {width: 100%; height: 90px; object-fit: contain; background: var(--bg); border: 1px solid var(--border); border-radius: 4px;}
.tk-root .tk-screenshots figcaption {font-size: 12px; overflow-wrap: anywhere;}
.tk-root .tk-screenshot-link {color: var(--accent); font-size: 12px;}
.tk-root .tk-table-screenshots {display: flex; flex-wrap: wrap; gap: 6px;}
.tk-root .tk-table-screenshots img {display: block; width: 58px; height: 48px; object-fit: contain; border: 1px solid var(--border); border-radius: 4px;}
.tk-root .tk-missing {display: block; padding: 6px; color: var(--text3); font-size: 12px;}
.tk-root .tk-form {display: flex; flex-direction: column; min-height: 0; max-height: 88dvh; overflow: hidden;}
.tk-root .tk-form-field {display: flex; flex: 1; flex-direction: column; gap: 6px; min-width: 0;}
.tk-root .tk-form-label {font-size: 12px; color: var(--text2);}
.tk-root .tk-form > .tk-btn {align-self: flex-end;}
.tk-root .tk-panel textarea {width: 100%; resize: vertical;}
.tk-root .tk-row {display: flex; gap: 8px; flex-wrap: wrap; align-items: center;}
.tk-root .tk-row > .tk-inp {flex: 1 1 180px;}
.tk-root .tk-table-scroll {max-width: 100%; max-height: 70dvh; overflow: auto; border: 1px solid var(--border); border-radius: 8px;}
.tk-root .tk-table-scroll:focus-visible {outline: 2px solid var(--accent); outline-offset: 2px;}
.tk-root .tk-table {display: flex; flex-direction: column; width: max-content; min-width: 100%; background: var(--surface);}
.tk-root .tk-tr {display: grid; grid-template-columns: var(--tk-columns); align-items: start; border-bottom: 1px solid var(--border);}
.tk-root .tk-tr > * {grid-area: auto; padding: 10px 8px; border-right: 1px solid var(--surface2);}
.tk-root .tk-tr > :first-child, .tk-root .tk-tr > :nth-child(2) {position: sticky; left: 0; z-index: 1; align-self: stretch; background: var(--surface);}
.tk-root .tk-tr > :nth-child(2) {left: 64px; border-right-color: var(--border);}
.tk-root .tk-row-actions {display: flex; gap: 8px; flex-wrap: wrap;}
.tk-root .tk-details {display: none;}
.tk-root .tk-field {min-width: 0;}
.tk-root .tk-tr:last-child {border-bottom: 0;}
.tk-root .tk-th {color: var(--text3); font-size: 12px; align-items: center; background: var(--bg); position: sticky; top: 0; z-index: 2; border-radius: 7px 7px 0 0; border-bottom-color: var(--border);}
.tk-root .tk-th > :first-child, .tk-root .tk-th > :nth-child(2) {background: var(--bg);}
.tk-root .tk-question-header {display: flex; align-items: center; gap: 6px; cursor: help;}
.tk-root .tk-question-header:focus-visible {outline: 2px solid var(--accent); outline-offset: -2px;}
.tk-root .tk-question-icon {display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; flex-shrink: 0; border: 1px solid var(--text3); border-radius: 50%; font-size: 10px; color: var(--text2);}
.tk-root .tk-question-tooltip {position: fixed; z-index: 200; width: max-content; max-width: min(300px, calc(100vw - 16px)); padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-medium); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere;}
.tk-root .tk-tr.tk-closed {opacity: .6;}
.tk-root .tk-id {padding-top: 7px; color: var(--text2);}
.tk-root .tk-raised {padding-top: 7px; color: var(--text3);}
.tk-root .tk-cell {width: 100%; border-color: transparent; background: transparent; padding: 6px 6px;}
.tk-root .tk-cell:hover {border-color: var(--border);}
.tk-root .tk-cell.tk-item {font-weight: 600;}
.tk-root textarea.tk-cell {resize: none; field-sizing: content; min-height: 34px; line-height: 1.4;}
.tk-root .tk-tr .tk-sel {width: 100%;}
.tk-root .tk-state {padding: 24px 8px; color: var(--text2);}
.tk-root .tk-link {font: inherit; background: none; border: 0; color: var(--accent); cursor: pointer; margin-left: 8px; padding: 0; text-decoration: underline;}
@media (max-width: 900px) {
  body:has(.tk-root.active) .topbar {align-items: stretch; flex-direction: column; gap: 8px; padding: 10px 12px;}
  body:has(.tk-root.active) .topbar-left {justify-content: space-between;}
  body:has(.tk-root.active) .topbar-right {width: 100%;}
  body:has(.tk-root.active) .nav-tabs {flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;}
  body:has(.tk-root.active) .nav-tab, body:has(.tk-root.active) .topbar-sign-out, body:has(.tk-root.active) .theme-toggle {min-height: 44px;}
  body:has(.tk-root.active) .topbar-sign-out {width: 44px;}
}
@container tracker-table (max-width:900px){
  .tk-root .tk-bar {align-items: center; padding: 16px 12px; gap: 12px;}
  .tk-root .tk-heading {display: block;}
  .tk-root .tk-sub {display: block; margin-top: 3px; font-size: 13px;}
  .tk-root .tk-wrap {padding: 12px; gap: 12px;}
  .tk-root .tk-btn, .tk-root .tk-inp, .tk-root .tk-sel {min-height: 44px;}
  .tk-root .tk-link {display: inline-flex; align-items: center; min-height: 44px;}
  .tk-root .tk-inp, .tk-root .tk-sel {font-size: 16px; padding: 9px 10px; width: 100%;}
  .tk-root .tk-btn.tk-small {font-size: 14px; padding: 9px 12px;}
  .tk-root .tk-tools {display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 10px;}
  .tk-root .tk-search {width: 100%;}
  .tk-root .tk-filter-toggle {display: block;}
  .tk-root .tk-filters {grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px;}
  .tk-root .tk-tools[data-filters-open="false"] .tk-filters {display: none;}
  .tk-root .tk-filter-label {display: block; margin-bottom: 4px; color: var(--text3); font-size: 12px; font-weight: 400;}
  .tk-root .tk-form {gap: 14px;}
  .tk-root .tk-form .tk-row {display: flex; flex-direction: column; align-items: stretch; gap: 12px;}
  .tk-root .tk-form-field {flex: none;}
  .tk-root .tk-form > .tk-btn {align-self: stretch;}
  .tk-root .tk-notice {position: fixed; bottom: max(12px, env(safe-area-inset-bottom)); left: 12px; right: 12px; z-index: 110; box-shadow: var(--shadow-medium);}
}
@media (max-width: 380px) {
  .tk-root .tk-bar {align-items: stretch; flex-direction: column;}
  .tk-root .tk-heading {flex: none;}
  .tk-root .tk-add {width: 100%;}
}

.tk-root .tk-table-scroll{min-width:0;overscroll-behavior-x:contain}
.tk-root .tk-tr>*{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tk-root textarea.tk-cell:not(:focus){field-sizing:fixed;height:36px!important;min-height:36px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tk-root textarea.tk-cell:focus{field-sizing:content;min-height:80px;white-space:pre-wrap}
@container tracker-table (max-width:900px){
 .tk-root .tk-tr>:first-child,.tk-root .tk-tr>:nth-child(2){position:static}
 .tk-root .tk-tr .tk-inp,.tk-root .tk-tr .tk-sel{font-size:14px;min-height:36px;padding:6px}
}
