/* Tracker view (markup from dist/tracker.js). Zyper tokens only; tables reuse the shared th/td, .section-header,
   .table-tab, .status, .live-chip and .tip styles. Phones (<=550px) stack table rows like dist/mobile-tables.css sizes. */
#tracker-view{display:flex;flex-direction:column;gap:12px;min-width:0}
.tk-panel{min-width:0;overflow:hidden;background:var(--z-panel-bg);border:1px solid var(--z-panel-border);border-radius:10px;box-shadow:var(--z-panel-shadow);animation:zyper-fade-in 180ms ease-out both}

/* Tab bar */
.tk-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:48px;padding:0 12px 0 6px}
.tk-tabs{display:flex;min-width:0;overflow-x:auto;scrollbar-width:none}.tk-tabs::-webkit-scrollbar{display:none}
.tk-tabs .table-tab{flex-shrink:0}
.tk-bar-meta{display:flex;align-items:center;flex-shrink:0}.tk-bar-meta .live-chip{margin-left:0}

/* Layout: list rail beside the wallet column on wide screens, stacked below 1280px. */
.tk-body{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;align-items:start;min-width:0}
.tk-main{display:flex;flex-direction:column;gap:12px;min-width:0}
.tk-rail{display:flex;flex-direction:column}
.tk-pane{display:flex;flex-direction:column;min-height:0;flex:1}
.tk-rail-scroll{min-height:0;max-height:min(420px,55vh);overflow:auto;overscroll-behavior:contain}
@media(min-width:1280px){
 .tk-body.tk-has-rail{grid-template-columns:370px minmax(0,1fr)}
 .tk-rail{position:sticky;top:0;max-height:calc(100dvh - 210px)}
 .tk-rail-scroll{flex:1;max-height:none}
}
@media(min-width:1550px){.tk-body.tk-has-rail{grid-template-columns:400px minmax(0,1fr)}}

/* Section titles, counts, meta */
.tk-h{display:inline-flex;align-items:center;gap:6px;margin:0;color:rgb(var(--z-text));font-size:.705882rem;font-weight:500;letter-spacing:0;white-space:nowrap}
.tk-h .tip{margin-left:0}
.tk-count{padding:1px 5px;border-radius:4px;background:var(--z-surface3);color:rgb(var(--z-textDim));font-size:.588235rem;font-weight:400}
.tk-meta{display:inline-flex;align-items:center;gap:6px;color:rgb(var(--z-muted));font-size:.588235rem;white-space:nowrap}.tk-meta:empty{display:none}
.tk-msg{margin:0;padding:26px 16px;text-align:center;color:rgb(var(--z-muted));font-size:.705882rem}.tk-msg:empty{display:none}
.tk-error{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:10px 12px;padding:7px 10px;border:1px solid rgb(var(--z-danger) / .25);border-radius:6px;background:rgb(var(--z-danger) / .04);color:rgb(var(--z-danger));font-size:.647059rem;line-height:1.45;overflow-wrap:anywhere}
.tk-error button{flex-shrink:0;padding:4px 9px;font-size:.647059rem}

/* Chips */
.tk-chip{display:inline-flex;align-items:center;flex-shrink:0;padding:1px 5px;border:1px solid var(--z-border);border-radius:4px;color:rgb(var(--z-textDim));font-size:.588235rem;font-weight:500;line-height:1.4;letter-spacing:.02em;white-space:nowrap}
.tk-chip.tk-ok{color:rgb(var(--z-success));border-color:rgb(var(--z-success) / .3);background:rgb(var(--z-success) / .07)}
.tk-chip.tk-bad{color:rgb(var(--z-danger));border-color:rgb(var(--z-danger) / .3);background:rgb(var(--z-danger) / .06)}
.tk-chip.tk-warn{color:rgb(var(--z-warn));border-color:rgb(var(--z-warn) / .35);background:rgb(var(--z-warn) / .08)}
.tk-chip.tk-info{color:rgb(var(--z-accent));border-color:rgb(var(--z-accent) / .3);background:rgb(var(--z-accent) / .06)}
.tk-chip.tk-accent{color:rgb(var(--z-accent));border-color:rgb(var(--z-accent) / .55);background:rgb(var(--z-accent) / .14)}
.tk-chip.tk-muted{color:rgb(var(--z-muted))}
.tk-chips{display:flex;flex-wrap:wrap;align-items:center;gap:4px;min-width:0}.tk-chips:empty{display:none}

/* Following: the add box leads the rail; with nothing followed yet it is the whole view below 1280px. */
.tk-add{display:grid;gap:8px;padding:12px 14px;border-bottom:1px solid var(--z-border)}
.tk-add input{width:100%;padding:8px 10px;font-size:.705882rem}
.tk-add input[aria-invalid="true"]{border-color:rgb(var(--z-danger) / .5)}
.tk-add-row{display:flex;gap:8px}.tk-add-row input{flex:1}
.tk-add button{flex-shrink:0;padding:8px 14px;font-size:.705882rem}
.tk-form-error{margin:0;color:rgb(var(--z-danger));font-size:.647059rem}.tk-form-error:empty{display:none}
.tk-form-note{margin:0;color:rgb(var(--z-textDim));font-size:.647059rem}.tk-form-note:empty{display:none}
.tk-follows .tk-hint{padding:12px 8px;text-align:left}
@media(max-width:1279px){.tk-body.tk-empty .tk-main{display:none}}
.tk-follows{list-style:none;margin:0;padding:6px}
.tk-follows li{display:flex;align-items:center;gap:2px;border-radius:7px}
.tk-follows li.tk-selected{background:var(--z-surface3);box-shadow:inset 2px 0 rgb(var(--z-accent))}
.tk-follow-pick{flex:1;min-width:0;display:flex;align-items:baseline;gap:8px;padding:9px 10px;border:0;border-radius:7px;background:transparent;box-shadow:none;color:rgb(var(--z-text));font-size:.705882rem;text-align:left}
.tk-follow-pick:hover{background:var(--z-surface2)}
.tk-follow-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}
.tk-addr{flex-shrink:0;color:rgb(var(--z-muted));font-size:.647059rem;font-weight:400;white-space:nowrap}
.tk-x{flex-shrink:0;width:30px;height:30px;padding:0;border:0;background:transparent;box-shadow:none;color:rgb(var(--z-muted));font-size:1rem;line-height:1}
.tk-x:hover{color:var(--z-btn-danger-text);background:var(--z-btn-danger-hover-bg)}

/* Wallet header */
.tk-head{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;min-height:56px;padding:11px 14px}
.tk-head-empty{justify-content:center;gap:12px}.tk-head-empty .tk-msg{padding:6px 0}
.tk-head-empty button{padding:6px 12px;font-size:.705882rem}
.tk-id{display:flex;align-items:center;gap:8px;min-width:0}
.tk-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:rgb(var(--z-text));font-size:.941176rem;font-weight:500;letter-spacing:-.02em}
.tk-copy{display:inline-flex;align-items:center;gap:5px;padding:3px 5px;border:0;border-radius:5px;background:transparent;box-shadow:none;color:rgb(var(--z-muted));font-size:.647059rem;white-space:nowrap}
.tk-copy:hover{color:rgb(var(--z-text));background:var(--z-surface2)}
.tk-copy svg{flex-shrink:0}
.tk-head-right{display:flex;align-items:center;gap:10px;margin-left:auto}
.tk-head-right>button{padding:6px 12px;font-size:.705882rem}
.tk-block{display:inline-flex;align-items:center;color:rgb(var(--z-textDim));font-size:.647059rem;white-space:nowrap}
.tk-busy{width:6px;height:6px;border-radius:50%;background:rgb(var(--z-muted) / .45);flex-shrink:0}
.tk-busy.on{background:rgb(var(--z-accent));animation:tk-pulse 1s ease-in-out infinite}
@keyframes tk-pulse{50%{opacity:.25}}

/* Positions and activity tables */
.tk-table td{vertical-align:middle}
.tk-table th .tip{margin-left:4px}
.tk-poolbox{display:inline-flex;align-items:center;gap:6px}
.tk-pair{font-weight:500;color:rgb(var(--z-text))}
.tk-pool .tk-chip{font-weight:400}
.tk-line{display:block;line-height:1.5}
.tk-sym{margin-left:4px;color:rgb(var(--z-muted))}
.tk-est{display:inline-block;margin-top:2px;padding:0 4px;border-radius:3px;background:rgb(var(--z-warn) / .1);color:rgb(var(--z-warn));font-size:.529412rem;letter-spacing:.04em;line-height:1.5}
.tk-id,.tk-age{color:rgb(var(--z-muted))}
.tk-status .status{white-space:nowrap}
.tk-tx .tk-copy{padding:3px 4px;margin-left:-4px}
.tk-nofees .tk-col-fees{display:none}
.tk-sec .table-scroll{max-height:none}

/* Phone bottom bar: one equal column per visible destination (up to seven: Trenches, Terminal, Portfolio, Copy Trading,
   Positions, PnL, Tracker; the public beta hides Copy Trading and Tracker, so five). Seven: smaller labels (portfolio.css). */
@media(max-width:550px){
 .workspace-nav{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr)}
 .workspace-nav button span{letter-spacing:0}
}

/* Phones: rows stack into compact cards; labels come from data-label. */
@media(max-width:550px){
 #tracker-view{gap:10px}
 .tk-bar{min-height:45px;padding:0 8px 0 0}
 .tk-head{padding:10px 12px;gap:6px 10px}
 .tk-name{font-size:.823529rem}
 .tk-head-right{gap:8px}
 .tk-head-right>button{min-height:36px}
 .tk-add{padding:10px 12px}
 .tk-add input{font-size:.764706rem}
 .tk-rail-scroll{max-height:min(380px,50vh)}
 .tk-follow-pick{min-height:44px}
 .tk-x{width:44px;height:44px}
 .tk-table thead{display:none}
 .tk-table,.tk-table tbody{display:block;width:100%;min-width:0}
 .tk-table tr{display:grid;gap:6px 10px;align-items:center;padding:11px 12px;border-top:1px solid var(--z-border)}
 .tk-table tbody tr:first-child{border-top:0}
 .tk-table td{display:block;min-width:0;padding:0;border:0;font-size:.647059rem;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .tk-table td:first-child{font-size:.647059rem}
 .tk-table td[data-label]::before{content:attr(data-label);display:block;margin-bottom:1px;color:rgb(var(--z-muted));font-size:.529412rem;font-weight:400;letter-spacing:.1em;text-transform:uppercase}
 .tk-table .status{display:inline-block;padding:3px 4px;font-size:.588235rem;line-height:1.4}
 /* Positions: pool | status, range | id, amounts | fees */
 .tk-pos tr{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"pool status" "range id" "amts fees"}
 .tk-pos td:nth-child(1){grid-area:pool}.tk-pos td:nth-child(2){grid-area:range}.tk-pos td:nth-child(3){grid-area:status;justify-self:end}
 .tk-pos td:nth-child(4){grid-area:amts}.tk-pos td:nth-child(5){grid-area:fees;justify-self:end;text-align:right}.tk-pos td:nth-child(6){grid-area:id;justify-self:end;align-self:end}
 /* Activity: type pool age / id range tx / fees. Flex lines with fixed lead widths keep columns aligned across rows. */
 .tk-act-table tr{display:flex;flex-wrap:wrap;align-items:center;gap:0 10px}
 .tk-act-table tr::after{content:'';order:35;flex-basis:100%;height:0}
 .tk-act-table td.tk-type{order:10;width:66px;flex-shrink:0}
 .tk-act-table td.tk-pool{order:20;flex:1 1 0}
 .tk-act-table td.tk-age{order:30;flex-shrink:0}
 .tk-act-table td.tk-id{order:40;min-width:66px;margin-top:5px}
 .tk-act-table td.tk-range{order:50;flex:1 1 0;margin-top:5px}
 .tk-act-table td.tk-tx{order:60;flex-shrink:0;margin-top:5px}
 .tk-act-table td.tk-col-fees{order:70;flex-basis:100%;margin-top:5px}
 .tk-act-table td.tk-range::before{display:none}
 .tk-act-table td.tk-col-fees::before{display:inline;margin-right:6px}
 .tk-act-table td.tk-col-fees .tk-line{display:inline;margin-right:10px}
 .tk-act-table tr[data-fees="0"] td.tk-col-fees{display:none}
 .tk-tx .tk-copy{min-height:36px;margin:-8px -4px -8px 0;padding:0 4px}
}
