.tt-app{--tt-card-width:172px;--tt-card-height:104px;max-width:1920px;margin:auto;padding:1.2rem .5rem 3rem}
.tt-toolbar,.tt-heading,.tt-actions,.tt-view-controls{display:flex;align-items:center;gap:.7rem;flex-wrap:wrap}
.tt-toolbar{padding-bottom:1rem;border-bottom:1px solid var(--line)}
.tt-toolbar>.tt-actions{margin-left:auto}
.tt-heading{justify-content:space-between;margin:1rem 0}
.tt-heading h1{font-size:1.8rem;margin:.25rem 0}
.tt-muted{font-size:.73rem;line-height:1.6;color:var(--muted)}
.tt-status{min-height:1.5rem;font-size:.8rem;margin:.8rem 0}
.tt-error,.tt-status.error{color:#ff9a91}
.tt-save-state{font-size:.75rem;color:#a9c695}
.tt-save-state.dirty{color:#e5bd7c}
.tt-empty,.tt-landing{max-width:850px;margin:6vh auto;padding:3rem;background:linear-gradient(135deg,#26332f,#18202a);border:1px solid #4b5b63}
.tt-empty h1,.tt-landing h1{font-size:clamp(2rem,4vw,3.3rem);margin:1rem 0}
.tt-empty p,.tt-landing p{color:#aebbc6;line-height:1.8}
.tt-tabs{display:flex;border-bottom:1px solid var(--line);gap:.5rem;margin-bottom:1rem}
.tt-tabs button{padding:.7rem 1.2rem;background:none;color:var(--muted);border:none;border-bottom:3px solid transparent}
.tt-tabs button[aria-pressed=true]{color:#fff;border-bottom-color:var(--red)}
.tt-view-controls{margin:1rem 0;align-items:end}
.tt-view-controls label{max-width:190px}
.tt-view-controls .tt-find{max-width:250px;flex:1}
.tt-view-controls>.tt-muted{margin-left:auto;max-width:350px}
.tt-app label{display:grid;gap:.35rem;font-size:.73rem;color:#bfccd7}
.tt-app input,.tt-app select,.tt-app textarea{width:100%;min-width:0;background:#111c24;color:var(--ink);padding:.55rem .65rem;border:1px solid #4b5c69;border-radius:0;font:inherit}
.tt-app input:focus,.tt-app select:focus,.tt-app textarea:focus{outline:2px solid #b1c693;outline-offset:1px}
.tt-app button{cursor:pointer}
.tt-app button:disabled{opacity:.45;cursor:default}
.tt-app input[type=checkbox]{width:17px;min-width:17px}
.tt-app .tt-checkbox{display:flex;align-items:center;gap:.6rem;margin:1rem 0}
.tt-picker{position:relative;min-width:270px;max-width:450px;flex:1}
.tt-picker summary{display:flex;align-items:center;gap:.6rem;cursor:pointer;padding:.65rem .8rem;background:#1e2b34;border:1px solid #607181;list-style:none}
.tt-picker summary::-webkit-details-marker{display:none}
.tt-picker summary>span:nth-last-child(2){flex:1}
.tt-picker img{width:28px;height:18px;object-fit:contain}
.tt-picker-panel{position:absolute;top:100%;left:0;right:0;background:#1b2731;padding:.5rem;z-index:30;border:1px solid #607181;box-shadow:0 12px 25px #0008}
.tt-picker-panel>div{max-height:350px;overflow:auto}
.tt-picker-panel button{width:100%;display:flex;align-items:center;gap:.65rem;background:transparent;border:0;text-align:left;color:#eee;padding:.7rem}
.tt-picker-panel button:hover,.tt-picker-panel button[aria-current=true]{background:#364639}
.tt-picker-panel button small{display:block;font-size:.65rem;color:var(--muted);margin-top:.15rem}
.tt-scroll{overflow:auto;max-height:76vh;border:1px solid #3e4f5e;background:#141d25;overscroll-behavior:contain;scrollbar-color:#647b56 #111b23}
.tt-board{position:relative;min-width:1440px;padding:0 12px 18px 0;isolation:isolate}
.tt-column-headings,.tt-rank{display:grid;grid-template-columns:var(--tt-grid-template,64px repeat(7,minmax(172px,1fr)));column-gap:18px}
.tt-column-headings{position:sticky;top:0;z-index:5;background:#202d37;border-bottom:1px solid #556572}
.tt-column-headings>div{padding:1rem .4rem;text-align:center;font-size:.75rem;color:#c3d0dc}
.tt-column-headings .special{color:#e0c47c}
.tt-rank{position:relative;border-bottom:1px solid #34434f;padding:18px 0;row-gap:20px}
.tt-rank-label{position:sticky;left:0;background:#141d25;color:#c2cbd3;font-size:1rem;display:flex;align-items:center;justify-content:center;z-index:3;grid-column:1;grid-row:1/-1}
.tt-cell{height:100%;position:relative;z-index:2;min-width:0}
.tt-add-slot{width:100%;height:100%;border:1px dashed #344b59;background:#1b293244;color:#778b99;font-size:.7rem}
.tt-add-slot:hover,.tt-cell.drag-over .tt-add-slot{border-color:#9ab586;background:#324731;color:#d6e8c9}
.tt-node{width:100%;height:100%;position:relative;display:flex;flex-direction:column;justify-content:space-between;text-align:left;color:#e8edf1;background:linear-gradient(125deg,var(--tt-card-start,#2b3d50),var(--tt-card-end,#1e2b3b));border:1px solid var(--tt-card-border,#536f8a);border-top:3px solid var(--tt-card-accent,#80a8cf);padding:7px 8px;transition:filter .15s}
.tt-node:hover{border-color:#c5d6a0;filter:brightness(1.13)}
.tt-node.dimmed{opacity:.25}
#tt-vehicle-kind-field[hidden]{display:none}
.tt-node.dragging{opacity:.4}
.tt-node-top{display:flex;align-items:center;justify-content:space-between;font-size:.7rem;gap:.3rem}
.tt-node-top>img{width:23px;height:15px;object-fit:contain}
.tt-node-name{font-size:.72rem;font-weight:bold;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:100%;text-shadow:0 1px 3px #000}
.tt-node .tt-image{flex-shrink:0;height:48px;max-width:140px;width:100%;align-self:center}
.tt-image{position:relative;display:inline-flex;align-items:center;justify-content:center;min-height:45px}
.tt-image img,.tt-image canvas{width:100%;height:100%;object-fit:contain}
.tt-image.loading img{opacity:0}
.tt-image.loading:after{content:'';position:absolute;width:18px;height:18px;border:2px solid #788681;border-top-color:#d7dfd2;border-radius:50%;animation:tt-spin .8s linear infinite}
.tt-image.failed:after{content:'Image unavailable';font-size:.6rem;color:#a9b1b9}
.tt-image.failed img{display:none}
.tt-folder-badge{position:absolute;bottom:28px;right:6px;border:1px solid #9dba82;padding:1px 4px;background:#152320;color:#d1dfbb;font-size:.6rem}
.tt-edges{position:absolute;inset:0;z-index:1;pointer-events:none;width:100%;height:100%;overflow:visible}
.tt-edges path{stroke:#a2ad98;stroke-width:2;fill:none}
.tt-edges polygon{fill:#a2ad98}
.tt-settings{max-width:1100px}
.tt-settings section{padding:1.3rem;background:#1b2730;border:1px solid #3a4d5c;margin:1rem 0}
.tt-settings h2{font-size:1rem;margin-bottom:1rem}
.tt-form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem}
.tt-icon-add{display:flex;align-items:end;gap:.7rem;flex-wrap:wrap}
.tt-icon-add label:first-child{min-width:180px}
.tt-icon-add label:nth-child(2){max-width:100px}
.tt-icon-row{display:flex;align-items:center;gap:1rem;border-bottom:1px solid #344551;padding:.5rem;margin-bottom:.6rem}
.tt-icon-row>span{flex:1}
.tt-dialog{background:#1b2730;color:var(--ink);padding:0;border:1px solid #72808b;width:min(780px,94vw);max-height:92dvh;box-shadow:0 30px 100px #000a}
.tt-dialog::backdrop{background:#050a10bc}
.tt-dialog header{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1.1rem 1.3rem;border-bottom:1px solid #465866}
.tt-dialog h2{font-size:1.1rem;margin:.3rem 0}
.tt-dialog header>button{background:none;color:#ddd;border:0;font-size:1.4rem}
.tt-dialog-body{padding:1.3rem;max-height:69dvh;overflow:auto}
.tt-dialog footer{display:flex;gap:.6rem;justify-content:flex-end;padding:1rem 1.3rem;border-top:1px solid #465866;flex-wrap:wrap}
.tt-dialog .tt-dialog-body>label{margin:.8rem 0}
.tt-dialog fieldset{padding:1rem;border:1px solid #40515e;margin:1rem 0}
.tt-dialog legend{font-size:.8rem;float:none;width:auto;padding:0 .4rem;margin:0}
.tt-vehicle-dialog{width:min(980px,96vw)}
.tt-editor-image{display:flex;align-items:center;gap:1.4rem;margin-bottom:1rem}
.tt-editor-image>.tt-image{width:200px;height:96px;border:1px solid #40515e;background:#16222b}
.tt-images-dialog{width:min(1100px,96vw)}
.tt-image-filters{display:grid;grid-template-columns:2fr 1fr 1fr .6fr;gap:.6rem}
.tt-image-results{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.6rem;min-height:150px}
.tt-image-option{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem;padding:.8rem;border:1px solid #4b5d6a;background:#22313b;color:#e1e7eb}
.tt-image-option:hover,.tt-image-option[aria-pressed=true]{border-color:#b2cb8d;background:#344934}
.tt-image-option .tt-image{width:100%;height:65px}
.tt-image-option strong{font-size:.73rem}
.tt-image-option small{font-size:.6rem;color:var(--muted)}
.tt-pagination{display:flex;align-items:center;justify-content:center;gap:1rem;margin-top:1rem;font-size:.75rem}
.tt-statcard-dialog{width:min(600px,94vw)}
.tt-statcard-hero{display:flex;align-items:center;gap:1rem}
.tt-statcard-hero>.tt-image{width:240px;height:120px}
.tt-statcard-hero>div{flex:1;font-size:.8rem}
.tt-statcard-hero img.tt-stat-flag{width:34px;height:22px;object-fit:contain}
.tt-statcard-data{display:grid;grid-template-columns:1fr 1fr;gap:0;margin:1rem 0}
.tt-statcard-data>div{border-bottom:1px solid #374a59;padding:.65rem}
.tt-statcard-data dt{font-size:.65rem;color:var(--muted);margin-bottom:.2rem}
.tt-statcard-data dd{font-size:.8rem;margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.tt-statcard-notes{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7;font-size:.8rem;border-top:1px solid #40515e;padding-top:1rem}
.tt-folder-tabs{display:flex;gap:.4rem;flex-wrap:wrap;margin-top:1rem}
.tt-folder-tabs button{font-size:.7rem;padding:.4rem .6rem;border:1px solid #586a73;color:#ddd;background:#22313a}
.tt-folder-tabs button[aria-pressed=true]{background:#435a39;border-color:#abc48b}
@keyframes tt-spin{to{transform:rotate(360deg)}
}
@media(max-width:700px){.tt-app{padding:.8rem 0}
.tt-toolbar>.tt-actions{margin-left:0}
.tt-picker{min-width:240px;max-width:none}
.tt-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.tt-image-filters{grid-template-columns:1fr 1fr}
.tt-image-results{grid-template-columns:repeat(2,minmax(0,1fr))}
.tt-dialog-body{padding:.8rem;max-height:68dvh}
.tt-dialog footer{padding:.8rem}
.tt-heading h1{font-size:1.4rem}
.tt-empty,.tt-landing{padding:1.5rem}
.tt-view-controls>.tt-muted{margin-left:0;max-width:none}
.tt-view-controls label{flex:1}
.tt-statcard-hero>.tt-image{width:55%}
}
@media(prefers-reduced-motion:reduce){.tt-image.loading:after{animation:none}
.tt-node{transition:none}
}

#tt-tree-count{white-space:nowrap;flex-shrink:0}
.tt-flag-picker{position:relative;min-width:0}
.tt-flag-trigger{display:flex;align-items:center;gap:.65rem;width:100%;padding:.45rem .6rem;min-height:44px;background:#111c24;color:var(--ink);border:1px solid #4b5c69;text-align:left}
.tt-flag-trigger>span:first-of-type{flex:1}
.tt-flag-trigger img{width:44px;height:26px;object-fit:contain}
.tt-flag-menu{position:absolute;top:100%;left:0;width:max(100%,260px);max-width:80vw;z-index:35;background:#1c2a35;border:1px solid #71818d;box-shadow:0 12px 24px #0008;padding:.5rem}
.tt-flag-menu [role=listbox]{max-height:230px;overflow:auto}
.tt-flag-menu button{display:flex;align-items:center;gap:.7rem;width:100%;background:none;border:0;color:#e4e9ee;text-align:left;padding:.55rem}
.tt-flag-menu button:hover,.tt-flag-menu button:focus,.tt-flag-menu button[aria-selected=true]{background:#3b5036}
.tt-flag-menu button img{width:42px;height:25px;object-fit:contain}
.tt-node-top>img{flex:0 0 32px;width:32px;height:18px;object-fit:cover}
.tt-picker img{width:36px;height:22px}
.tt-statcard-hero img.tt-stat-flag{width:44px;height:27px}
.tt-icon-row>input:first-child{flex:1}
.tt-icon-row>input:nth-child(2){max-width:90px}
.tt-name-field{display:flex;align-items:stretch}
.tt-name-field>input{flex:1}
.tt-name-field>button{width:39px;flex:0 0 39px;background:#273b46;color:#e1e8ed;border:1px solid #64757f;border-left:0}
.tt-name-field svg{width:22px;height:22px;stroke:currentColor;stroke-width:1.7;fill:none}
.tt-nation-icon-picker{position:fixed;z-index:45;min-width:180px;max-height:250px;overflow:auto;background:#172530;border:1px solid #798a93;box-shadow:0 10px 24px #000a}
.tt-nation-icon-picker button{display:flex;align-items:center;gap:.8rem;width:100%;padding:.65rem .9rem;border:0;color:#e5edf1;background:none;text-align:left}
.tt-nation-icon-picker button:hover,.tt-nation-icon-picker button:focus{background:#3c5437}
.tt-nation-icon-picker b{font-size:1rem;min-width:20px}
.tt-folder{position:relative;height:100%}
.tt-folder-menu{position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:12;max-height:360px;overflow:auto;padding:4px;border:1px solid #a6bb8d;background:#17282c;box-shadow:0 12px 24px #0009}
.tt-folder-menu .tt-node{height:104px;display:flex;margin-bottom:4px}
.tt-cell:has(.tt-folder.open){z-index:12}
.tt-rank:has(.tt-folder.open){z-index:11}
.tt-column-headings{z-index:15}

.tt-folder-menu.opens-up{top:auto;bottom:calc(100% + 4px)}

.tt-folder-card{gap:3px;justify-content:flex-start}
.tt-folder-art{display:flex;align-items:center;justify-content:center;gap:0;align-self:center;width:100%;height:30px;flex:0 0 30px}
.tt-node .tt-folder-art .tt-image{width:100%;max-width:none;height:100%;min-height:0;filter:drop-shadow(0 2px 2px #0009)}
.tt-folder-names{display:flex;flex-direction:column;align-self:stretch;margin-top:auto;min-height:0}
.tt-folder-names .tt-node-name{display:block;line-height:14px;padding-right:2px}
.tt-folder-count{display:block;font-size:.65rem;line-height:14px;color:#b7c7ba}
.tt-cell.drag-over>.tt-folder>.tt-node{border-color:#c8e5a0;box-shadow:0 0 0 2px #93b575;background:#3b553a}
.tt-drag-preview{position:fixed;left:-10000px;top:0;pointer-events:none;z-index:100;box-sizing:border-box}
.tt-drag-preview>.tt-node{box-sizing:border-box;opacity:1;filter:none}
.tt-spinner{display:inline-block;width:18px;height:18px;vertical-align:middle;border:2px solid #788681;border-top-color:#d7dfd2;border-radius:50%;animation:tt-spin .8s linear infinite;margin:.35rem}
@media(prefers-reduced-motion:reduce){.tt-spinner{animation:none}}

.tt-spinner[hidden]{display:none}

.tt-read-only .tt-editor-only,.tt-read-only .tt-add-slot,.tt-shared #tt-picker,.tt-shared #tt-tree-count,.tt-shared #tt-share,.tt-shared #tt-dirty{display:none!important}
.tt-read-only .tt-node{cursor:pointer}
.tt-is-dragging .tt-folder-menu{opacity:.18}
.tt-node-top>span{max-width:calc(100% - 36px);text-align:right;white-space:normal;overflow-wrap:anywhere;line-height:1.2}
.tt-stat-section h3{font-size:.8rem;color:#c7d2bd;border-bottom:1px solid #4b5f54;padding:.6rem 0;margin:.8rem 0 0}
.tt-stat-section .tt-statcard-data{margin-top:0}
.tt-card-br{display:flex;align-items:center;gap:.4rem}
.tt-card-br img{width:20px;height:20px;object-fit:contain}
#tt-stat-fields>.tt-form-grid{display:grid}


.tt-node-br{display:inline-flex;align-items:flex-start;justify-content:flex-end;gap:3px;min-width:0}
.tt-node-br>img{width:14px;height:14px;object-fit:contain;flex-shrink:0}
.tt-node-br>span{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.tt-folder-art>span{position:relative;flex:0 1 50px;width:50px;min-width:0;height:100%}

.tt-board.tt-compact{min-width:0;width:max-content}
.tt-read-only .tt-scroll{width:fit-content;max-width:100%}
.tt-view-empty{margin:0;padding:1.2rem}

.tt-view-line{display:flex;flex-direction:column;gap:20px;min-width:0;align-self:start;grid-row:1}
.tt-view-line>.tt-cell{flex-shrink:0}

.tt-compact .tt-cell:has(.tt-folder.open){height:auto!important}
.tt-compact .tt-folder.open{height:auto}
.tt-compact .tt-folder>.tt-node{height:var(--tt-slot-height)}
.tt-compact .tt-folder-menu{position:relative;inset:auto;margin-top:4px}

.tt-compact .tt-column-headings>div{overflow-wrap:anywhere}

.tt-shared .tt-toolbar{display:none}

.tt-node-top>.tt-folder-flag{position:relative;display:block;flex:0 0 32px;width:32px;max-width:32px;height:18px;overflow:hidden}
.tt-folder-flag>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
