/* ENH-238: approved application shell. Table Play keeps its dedicated layout. */
:root{
  --shell-navy:#071827;
  --shell-navy-2:#0d2638;
  --shell-navy-3:#17394d;
  --shell-cream:#f7f2e7;
  --shell-paper:#fffdfa;
  --shell-ink:#16222d;
  --shell-muted:#61717d;
  --shell-line:#d8d2c6;
  --shell-teal:#087f78;
  --shell-teal-dark:#075f5b;
  --shell-gold:#ddb84c;
  --shell-gold-soft:#f6e8ac;
  --shell-soft:#f7f3eb;
  --shell-shadow:0 16px 48px rgba(5,20,31,.13);
}

body:not(.table-mode){background:linear-gradient(180deg,#e9e1d2 0,var(--shell-cream) 180px);color:var(--shell-ink)}
body:not(.table-mode) #topbar{
  min-height:72px;padding:10px 18px;gap:12px;background:var(--shell-bg);color:var(--shell-ink);
  border:0;border-bottom:1px solid var(--shell-line);box-shadow:0 4px 14px rgba(4,15,24,.12);overflow:visible
}
body:not(.table-mode) #topbar .topbar-brand{gap:10px;padding:3px 5px;border-radius:10px}
body:not(.table-mode) #topbar :is(.topbar-brand,.connection-status,.topbar-account){flex-shrink:0}
body:not(.table-mode) #topbar .topbar-brand img{width:45px;height:45px;border-radius:0;object-fit:contain}
.topbar-brand-copy{display:grid;text-align:left;line-height:1}
.topbar-brand-copy strong{font-family:Georgia,serif;font-size:1.17rem;color:var(--shell-teal-dark)}
.topbar-brand-copy span{margin-top:5px;color:#bdcbd3;font-size:.7rem;letter-spacing:.11em;text-transform:uppercase}

body:not(.table-mode) #topbar-navigation{flex:1;justify-content:center;gap:6px;min-width:0}
body:not(.table-mode) #topbar-navigation>button{
  min-height:44px;padding:9px 11px;border:1px solid var(--shell-line);border-radius:9px;background:var(--shell-paper);
  color:var(--shell-ink);white-space:nowrap;font-size:17px;font-weight:700;letter-spacing:0
}
body:not(.table-mode) #topbar-navigation>button:hover{background:#efe8d9;color:var(--shell-teal-dark);border-color:#8b7a55}
body:not(.table-mode) #topbar-navigation>button[aria-current="page"]{
  background:var(--shell-gold-soft);color:#132536;font-weight:800;
  box-shadow:inset 0 0 0 1px #efd982
}
body:not(.table-mode) #tb-player-id{display:none!important}
body:not(.table-mode) #topbar.has-context{flex-wrap:wrap}
body:not(.table-mode) .topbar-context{
  display:none;order:99;flex:0 0 calc(100% + 44px);align-items:center;justify-content:flex-end;
  margin:0 -18px -10px;padding:8px 18px;background:#eee6d7;border-top:1px solid var(--shell-line)
}
body:not(.table-mode) #topbar.has-context .topbar-context{display:flex}
body:not(.table-mode) #topbar .topbar-context button{border-color:#708999;background:#fff;color:#193243;font-weight:700}

body:not(.table-mode) .topbar-account{position:relative;gap:5px;padding:0;border:0}
body:not(.table-mode) #topbar .topbar-account>button{
  min-height:44px;padding:9px 10px;border:1px solid var(--shell-line);border-radius:9px;color:var(--shell-ink);background:var(--shell-paper);font-size:.94rem
}
body:not(.table-mode) #topbar .topbar-account>button:hover{background:#efe8d9;color:var(--shell-teal-dark)}
body:not(.table-mode) #topbar #tb-notifications{display:inline-flex;align-items:center;gap:7px;position:relative;font-weight:800}
body:not(.table-mode) #topbar #tb-notifications .notification-bell{font-size:1.32rem;line-height:1}
body:not(.table-mode) #topbar #tb-notification-count{min-width:24px;padding:3px 6px;border:2px solid #fff;background:#a92e34;color:#fff;font-size:.75rem;line-height:1;text-align:center}
body:not(.table-mode) #topbar #tb-notifications.has-pending{border-color:#9c6800;background:#fff0c9;color:#593b00;box-shadow:0 0 0 2px #f4d77e}
body:not(.table-mode) #topbar #tb-notifications.has-new{outline:4px solid var(--shell-gold);outline-offset:2px;box-shadow:0 0 0 3px #fff,0 0 16px #d9a91b99}
body:not(.table-mode) #topbar #tb-account{
  display:flex;align-items:center;gap:9px;padding:7px 10px;background:var(--shell-paper);
  border:1px solid var(--shell-line);border-radius:9px;color:var(--shell-ink)
}
.topbar-avatar{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--shell-gold);color:#193042;font-size:.78rem;font-weight:900}
.topbar-account-copy{display:grid;text-align:left;line-height:1.1}
.topbar-account-copy strong{max-width:130px;overflow:hidden;text-overflow:ellipsis;font-size:.84rem}
.topbar-account-copy span{margin-top:3px;color:var(--shell-muted);font-size:.69rem}

#topbar .topbar-popover{
  position:absolute;top:calc(100% + 10px);right:0;z-index:80;width:270px;padding:8px;
  border:1px solid var(--shell-line);border-radius:14px;background:var(--shell-paper);
  color:var(--shell-ink);box-shadow:var(--shell-shadow)
}
#topbar .topbar-popover[hidden]{display:none!important}
#topbar #help-menu{right:205px}
#topbar .topbar-popover>strong{display:block;padding:9px 11px 7px;color:var(--shell-muted);font-size:.78rem;letter-spacing:.08em;text-transform:uppercase}
#topbar .topbar-popover :is(button,a){
  display:flex;width:100%;min-height:44px;align-items:center;justify-content:space-between;gap:10px;
  padding:10px 11px;border:0;border-radius:9px;background:transparent;color:var(--shell-ink);
  text-align:left;text-decoration:none;font-size:.88rem;letter-spacing:normal
}
#topbar .topbar-popover :is(button,a):hover{background:#f0eadf;color:var(--shell-ink)}
#topbar .topbar-popover button small{margin-left:auto;color:var(--shell-muted);font-size:.72rem;font-weight:400}
#topbar .topbar-popover button:disabled{color:#8a918f;opacity:1;cursor:not-allowed}
#topbar .topbar-popover button:disabled:hover{background:transparent}
#topbar #account-menu #tb-out{margin-top:5px;border-top:1px solid var(--shell-line);border-radius:0 0 9px 9px;color:#8e3038}
#topbar .help-guide-search{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;padding:0 8px 8px}
#topbar .help-guide-search input{min-width:0;height:42px;margin:0;padding:8px 10px;border:1px solid #aeb9b7;border-radius:8px;background:#fff;color:var(--shell-ink);font-size:.84rem}
#topbar .help-guide-search button{width:auto;min-height:42px;padding:8px 10px;background:var(--shell-teal);color:#fff}
#topbar .help-guide-list{display:grid}
#topbar .help-guide-status{min-height:18px;margin:3px 11px 7px;color:#7c2930;font-size:.78rem}

body:not(.table-mode) :is(#lobby,#admin,#tourneys,#tn-detail,#match-detail,#people-screen,#history-screen,#profile-screen,#chat-screen){
  background:linear-gradient(180deg,#e9e1d2 0,var(--shell-cream) 180px);color:var(--shell-ink)
}
body:not(.table-mode) :is(#lobby,#admin,#tourneys,#tn-detail,#match-detail,#people-screen,#profile-screen,#chat-screen){padding-top:calc(var(--topbar-clearance) + 26px)}
body:not(.table-mode) .lobby-inner{width:min(1500px,100%);margin-inline:auto;padding-inline:28px}
body:not(.table-mode) #history-screen .lobby-inner{width:100%;max-width:none;padding-inline:0}
body:not(.table-mode) .workspace-heading{margin-bottom:20px}
body:not(.table-mode) .workspace-heading .mark{margin-bottom:5px;color:var(--shell-teal-dark);font-family:inherit;font-size:.77rem;font-weight:800;letter-spacing:.1em}
body:not(.table-mode) .workspace-heading h1{margin:0;color:#102c3d;font-family:inherit;font-size:clamp(1.8rem,2.4vw,2.35rem);font-weight:800;line-height:1.1}
body:not(.table-mode) .workspace-heading h1 em{color:var(--shell-teal-dark)}
body:not(.table-mode) .workspace-heading .lede{max-width:720px;color:var(--shell-muted);font-size:1rem;line-height:1.45}
body:not(.table-mode) :is(.workspace-panel,.tncard,.tnsection,.tablecard,.roombox,.historyrow,.people-row,.admin-action-panel,.activity-strip){
  border:1px solid var(--shell-line);border-radius:14px;background:rgba(255,253,250,.97);
  color:var(--shell-ink);box-shadow:0 6px 22px rgba(19,37,50,.06)
}
body:not(.table-mode) :is(.btn,.seatcell button,.row-action){border-radius:10px}
body:not(.table-mode) .btn{background:var(--shell-teal);color:#fff;border-color:var(--shell-teal);font-weight:750}
body:not(.table-mode) .btn:hover{background:var(--shell-teal-dark)}
body:not(.table-mode) .btn.ghost{background:var(--shell-paper);color:var(--shell-teal-dark);border-color:#9cbcb8}
body:not(.table-mode) :is(input,select,textarea){border-color:#b9b09f;background:#fff;color:var(--shell-ink)}
body:not(.table-mode) :is(.sub,.tnmeta,.meta,.note,.byline,.lede){color:var(--shell-muted)}
body:not(.table-mode) :is(th,.pairhead,.cap){background:#f7f3eb;color:#66757f}

#lobby-activity.activity-strip{
  display:flex;align-items:center;gap:12px;min-height:52px;margin:0 0 14px;padding:8px 10px;
  border-left:5px solid var(--shell-gold);box-shadow:none
}
#lobby-activity[hidden]{display:none!important}
#lobby-activity .activity-label{color:var(--shell-teal-dark);font-weight:800}
#lobby-activity .btn{width:auto;min-height:40px;margin-left:auto;padding:7px 12px}

/* ENH-238 compact Team Match and Tournament indexes. */
.compact-index-heading{align-items:center;margin-bottom:12px}
.compact-index-heading h1{margin:0}
#lobby-teams{padding:16px}
#lobby-teams>.section-heading{margin-bottom:10px}
.index-list-toolbar{display:flex;align-items:end;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.index-list-toolbar label{display:flex;align-items:center;gap:7px;margin:0;color:var(--shell-muted);font-size:.86rem;font-weight:750}
.index-list-toolbar :is(input,select){min-height:38px;padding:7px 10px;border:1px solid var(--shell-line);border-radius:8px;background:#fff;color:var(--shell-ink);font:inherit}
.index-list-toolbar .index-search{margin-left:auto}
.index-list-toolbar .index-search input{width:min(310px,42vw)}
.index-table-wrap{width:100%;overflow:auto;border:1px solid var(--shell-line);border-radius:8px;background:#fff}
.compact-index-table{width:100%;min-width:1100px;border-collapse:separate;border-spacing:0;font-size:.9rem}
.compact-index-table :is(th,td){padding:10px 14px;border-bottom:1px solid var(--shell-line);text-align:left;vertical-align:middle}
.compact-index-table :is(th,td)+:is(th,td){border-left:8px solid var(--shell-cream)}
.compact-index-table th{background:var(--shell-soft);color:var(--shell-muted);font-size:.74rem;letter-spacing:.045em;text-transform:uppercase;white-space:nowrap}
.compact-index-table tbody tr:last-child td{border-bottom:0}
.compact-index-table tbody tr:hover{background:#f7f4ed}
.compact-index-table .id-cell{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:800;white-space:nowrap}
.compact-index-table .date-cell{min-width:135px}
.compact-index-table .row-sub{display:block;margin-top:3px;color:var(--shell-muted);font-size:.78rem;font-weight:500;white-space:nowrap}
.compact-index-table .status{display:inline-block;white-space:nowrap}
.match-grid.compact-index-table{min-width:920px}
.match-grid .match-name-cell{width:18%;max-width:220px}
.match-grid .match-name-cell strong{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;
  -webkit-line-clamp:2;line-clamp:2;line-height:1.25;overflow-wrap:anywhere}
.match-grid .match-teams-cell{min-width:150px;line-height:1.35}
.match-grid .match-teams-cell b{color:var(--shell-muted);font-weight:600;white-space:nowrap}
.match-grid .match-status-result{min-width:125px}
.casual-grid{min-width:850px;table-layout:fixed}
.casual-grid th:nth-child(1),.casual-grid td:nth-child(1){width:10%}
.casual-grid th:nth-child(2),.casual-grid td:nth-child(2){width:18%}
.casual-grid th:nth-child(n+3),.casual-grid td:nth-child(n+3){width:18%}
.casual-grid td{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.casual-seat-state,.casual-seat-action{display:block;width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}
.casual-seat-state.mine{font-weight:800;color:var(--shell-teal-dark)}
.casual-seat-state.reserved{color:#7a5a0b}
body:not(.table-mode) .casual-seat-action{min-height:38px;padding:6px 8px;border:1px dashed #77988b;border-radius:6px;background:#edf5f1;color:var(--shell-teal-dark);font:inherit}
.row-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
body:not(.table-mode) .compact-index-table .row-actions .btn{min-height:34px;padding:5px 9px;font-size:.78rem;white-space:nowrap}
.index-pager{position:sticky;bottom:0;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;margin-top:10px;padding:10px 0 0;background:var(--shell-cream);color:var(--shell-muted);font-size:.85rem;text-align:center}
.index-pager .btn:first-child{justify-self:start}.index-pager .btn:last-child{justify-self:end}
body:not(.table-mode) .index-pager .btn{min-height:38px;padding:7px 12px}

.admin-shell-layout{display:grid;grid-template-columns:240px minmax(0,1fr);gap:18px;align-items:start}
.admin-shell-layout .admin-action-menu{
  position:sticky;top:calc(var(--topbar-clearance) + 18px);display:grid;gap:5px;margin:0;padding:10px;
  border:1px solid var(--shell-line);border-radius:14px;background:var(--shell-paper);
  box-shadow:0 6px 22px rgba(19,37,50,.06)
}
body:not(.table-mode) .admin-shell-layout .admin-action-menu .btn{
  width:100%;min-height:44px;padding:10px 11px;border:0;border-radius:9px;background:transparent;
  color:#334650;text-align:left;font-size:.86rem
}
body:not(.table-mode) .admin-shell-layout .admin-action-menu .btn:hover{background:#f0eadf;color:var(--shell-teal-dark)}
body:not(.table-mode) .admin-shell-layout .admin-action-menu .btn[aria-current="page"]{
  background:#e7f0ed;color:var(--shell-teal-dark);font-weight:800
}
.admin-shell-content{display:grid;gap:14px;min-width:0}
.admin-shell-content>.admin-action-panel{box-sizing:border-box;max-width:100%;min-width:0;margin:0}
.admin-shell-content>.lobby-actions{margin-top:0}
.admin-table-scroll{box-sizing:border-box;max-width:100%;overflow-x:auto}
.admin-users-grid{min-width:1280px}.admin-table-grid{min-width:920px}.admin-robot-grid{min-width:760px}
.history-index{min-width:860px}.history-match-grid{min-width:980px}.history-board-grid{min-width:860px}
.history-index .history-open{width:auto;min-height:38px;padding:6px 10px}
.people-search{display:grid;grid-template-columns:auto minmax(220px,320px);align-items:center;gap:8px;margin:0}
.people-search input{margin:0;min-width:0}
#people-screen>.lobby-inner{width:min(1180px,100%);height:100%;display:flex;flex-direction:column;min-height:0}
#people-screen{max-width:none;padding:calc(var(--topbar-clearance) + 18px) 0 18px}
#people-screen .workspace-heading{align-items:end}
#people-list{min-height:0;overflow:auto}
.people-grid{min-width:880px;table-layout:fixed}
.people-grid tr{white-space:nowrap}.people-grid td{overflow:hidden;text-overflow:ellipsis}
.people-grid th:nth-child(1){width:14%}.people-grid th:nth-child(2){width:24%}.people-grid th:nth-child(3){width:20%}.people-grid th:nth-child(4){width:30%}.people-grid th:nth-child(5){width:12%}

#chat-screen{position:fixed;inset:0;z-index:44;display:none;overflow:auto}
#chat-screen.on{display:block}
.chat-workspace-panel{min-height:590px;padding:0;overflow:hidden}
#chat-workspace-host{min-height:590px}
#chat-workspace-status{margin:0;padding:12px 18px;color:#8d1e1e}
#chat-workspace-status:empty{display:none}
body:not(.table-mode) #direct-chat-host[data-screen="chat"]{
  position:static;width:100%;height:590px;padding:0;background:transparent
}
body:not(.table-mode) #direct-chat-host[data-screen="chat"] #direct-chat-fallback{margin:16px}

@media(max-width:1500px){
  body:not(.table-mode) #topbar #tb-notifications{width:42px;justify-content:center;overflow:visible}
  body:not(.table-mode) #topbar #tb-notifications .notification-label{display:none}
  body:not(.table-mode) #topbar #tb-notification-count{font-size:.7rem}
}

@media(max-width:1320px){
  body:not(.table-mode) #topbar.on{display:grid;grid-template-columns:auto auto auto 1fr;gap:10px}
  body:not(.table-mode) #topbar .topbar-brand{grid-column:1;grid-row:1}
  body:not(.table-mode) #topbar>.connection-status{grid-column:2;grid-row:1}
  body:not(.table-mode) #topbar .topbar-menu{display:block;grid-column:3;grid-row:1;border:1px solid var(--shell-line);background:var(--shell-paper);color:var(--shell-ink)}
  body:not(.table-mode) #topbar-navigation{display:none;position:absolute;top:100%;left:0;right:0;z-index:75;justify-content:flex-start;overflow:auto;padding:10px 14px;background:var(--shell-navy-2);border-top:1px solid #345165}
  body:not(.table-mode) #topbar.menu-open #topbar-navigation{display:flex}
  body:not(.table-mode) .topbar-account{grid-column:4;grid-row:1;justify-self:end}
  body:not(.table-mode) .topbar-context{grid-column:1/-1;grid-row:2;justify-content:flex-end;margin:0 -22px -10px}
}

/* Administration adds an eighth primary destination. At ordinary laptop
   widths keep the full set in the same labelled menu instead of squeezing or
   overlapping the larger, older-player-friendly targets. */
@media(min-width:1321px) and (max-width:1500px){
  body:not(.table-mode) #topbar.on:has(#tb-admin:not([hidden])){display:grid;grid-template-columns:auto auto auto 1fr;gap:10px}
  body:not(.table-mode) #topbar:has(#tb-admin:not([hidden])) .topbar-brand{grid-column:1;grid-row:1}
  body:not(.table-mode) #topbar:has(#tb-admin:not([hidden]))>.connection-status{grid-column:2;grid-row:1}
  body:not(.table-mode) #topbar:has(#tb-admin:not([hidden])) .topbar-menu{display:block;grid-column:3;grid-row:1;border:1px solid var(--shell-line);background:var(--shell-paper);color:var(--shell-ink)}
  body:not(.table-mode) #topbar:has(#tb-admin:not([hidden])) #topbar-navigation{display:none;position:absolute;top:100%;left:0;right:0;z-index:75;justify-content:flex-start;overflow:auto;padding:10px 14px;background:var(--shell-paper);border-top:1px solid var(--shell-line)}
  body:not(.table-mode) #topbar.menu-open:has(#tb-admin:not([hidden])) #topbar-navigation{display:flex}
  body:not(.table-mode) #topbar:has(#tb-admin:not([hidden])) .topbar-account{grid-column:4;grid-row:1;justify-self:end}
  body:not(.table-mode) #topbar:has(#tb-admin:not([hidden])) .topbar-context{grid-column:1/-1;grid-row:2;justify-content:flex-end;margin:0 -18px -10px}
}

@media(max-width:760px){
  body:not(.table-mode) #topbar{min-height:64px;padding:7px 10px;gap:7px;grid-template-columns:auto auto 1fr}
  body:not(.table-mode) #topbar .topbar-brand{grid-column:1;grid-row:1;order:initial;margin-right:32px}
  body:not(.table-mode) #topbar .connection-status{position:absolute;left:55px;top:16px}
  body:not(.table-mode) #topbar .topbar-menu{grid-column:2;grid-row:1;order:initial;margin:0}
  body:not(.table-mode) #topbar .topbar-account{grid-column:3;grid-row:1;order:initial}
  body:not(.table-mode) .topbar-brand-copy{display:none}
  body:not(.table-mode) #topbar .topbar-brand img{width:40px;height:40px}
  body:not(.table-mode) .topbar-account-copy{display:none}
  body:not(.table-mode) #topbar #tb-notifications{width:42px;justify-content:center;overflow:visible}
  body:not(.table-mode) #topbar #tb-notifications .notification-label{display:none}
  body:not(.table-mode) #topbar #tb-notification-count{font-size:.7rem}
  body:not(.table-mode) #topbar #tb-help{padding-inline:7px}
  body:not(.table-mode) #topbar .topbar-popover{position:fixed;top:72px;right:10px;left:10px;width:auto}
  body:not(.table-mode) #topbar #help-menu{right:10px}
  body:not(.table-mode) #topbar-navigation{
    flex-direction:column;align-items:stretch;max-height:calc(100dvh - 72px);overflow:auto
  }
  body:not(.table-mode) #topbar-navigation>button{width:100%;text-align:left}
  body:not(.table-mode) .lobby-inner{padding-inline:12px}
  .index-list-toolbar{display:grid;grid-template-columns:1fr;align-items:stretch}
  .index-list-toolbar .index-search{margin-left:0}
  .index-list-toolbar label{display:grid;grid-template-columns:1fr;align-items:stretch;gap:5px}
  .index-list-toolbar :is(input,select),.index-list-toolbar .index-search input{
    box-sizing:border-box;width:100%;min-width:0}
  .index-pager{grid-template-columns:auto 1fr auto;gap:6px;font-size:.76rem}
  .chat-workspace-panel,#chat-workspace-host{min-height:520px}
  body:not(.table-mode) #direct-chat-host[data-screen="chat"]{height:520px}
  .admin-shell-layout{grid-template-columns:1fr}
  .admin-shell-layout .admin-action-menu{position:static;display:flex;overflow:auto}
  body:not(.table-mode) .admin-shell-layout .admin-action-menu .btn{width:auto;flex:0 0 auto;white-space:nowrap}
}

/* Replay keeps the compact one-row shell so its measured felt retains the
   same vertical budget as Table Play. */
body.history-replay-mode:not(.table-mode) #topbar,
body.history-replay-mode:not(.table-mode) #topbar.has-context{display:flex;flex-wrap:nowrap}
body.history-replay-mode:not(.table-mode) #topbar #tb-player-id{display:none!important}
body.history-replay-mode:not(.table-mode) #topbar .topbar-account{display:flex;order:1;flex:0 0 auto}
body.history-replay-mode:not(.table-mode) #topbar :is(.topbar-menu,.topbar-context){order:2}
body.history-replay-mode:not(.table-mode) #topbar .topbar-menu{margin-left:auto}
body.history-replay-mode:not(.table-mode) #topbar .topbar-context{
  display:flex;order:2;flex:0 0 auto;margin:0;padding:0;background:transparent;border:0
}

/* Table Play keeps one compact row. The full primary menu is available through
   Menu, while navigation authority remains unchanged. */
body.table-mode #topbar{background:var(--shell-bg);color:var(--shell-ink);border-bottom:1px solid var(--shell-line);box-shadow:0 3px 12px rgba(4,15,24,.14)}
body.table-mode #topbar :is(#tb-table-title,#tb-scoring){color:var(--shell-ink)}
body.table-mode #topbar button{color:var(--shell-ink);border-color:var(--shell-line);background:var(--shell-paper)}
body.table-mode #topbar .topbar-brand-copy{display:none!important}
body.table-mode #topbar #tb-player-id{display:none!important}
body.table-mode #topbar .topbar-account{display:flex;align-items:center;gap:5px;flex:0 0 auto!important;position:relative!important;width:auto!important;padding:0!important}
body.table-mode #topbar #tb-notifications{display:inline-flex;align-items:center;justify-content:center;gap:3px;width:44px;min-width:44px;min-height:44px;padding:5px}
body.table-mode #topbar #tb-notifications .notification-label{display:none}
body.table-mode #topbar .topbar-account>#tb-account{display:flex!important;align-items:center;min-height:44px;padding:6px 9px}
body.table-mode #topbar .topbar-account>#account-menu{display:block!important;top:calc(100% + 10px);right:0;width:270px}
body.table-mode #topbar .topbar-account>#account-menu[hidden]{display:none!important}
body.table-mode #topbar #tb-account .topbar-avatar,
body.table-mode #topbar #tb-account .topbar-account-copy span{display:none}
body.table-mode #topbar #tb-account .topbar-account-copy strong{max-width:116px;color:var(--shell-ink)}
body.table-mode #topbar #tb-help{display:none!important}
body.table-mode #topbar.menu-open #tb-help{display:flex!important}
body.table-mode #topbar #topbar-navigation,
body.history-replay-mode #topbar.menu-open #topbar-navigation{background:var(--shell-paper);border-color:var(--shell-line)}
body.table-mode #topbar.menu-open #topbar-navigation button,
body.history-replay-mode #topbar.menu-open #topbar-navigation button{min-height:44px;border:1px solid var(--shell-line);border-radius:8px;background:var(--shell-paper);color:var(--shell-ink);font-size:17px;font-weight:700;letter-spacing:0}
body.table-mode #topbar .topbar-popover,
body.history-replay-mode #topbar .topbar-popover{background:var(--shell-paper);color:var(--shell-ink)}
body.history-replay-mode #topbar .topbar-account>:not(#tb-notifications):not(#tb-account){display:none!important}
body.history-replay-mode #topbar .topbar-account>#tb-account{display:flex!important;min-height:44px}
body.history-replay-mode #topbar #tb-account .topbar-avatar,
body.history-replay-mode #topbar #tb-account .topbar-account-copy span{display:none}
body.history-replay-mode #topbar.menu-open #tb-help{display:flex!important}

@media(max-width:860px){
  body.table-mode #topbar #tb-account .topbar-account-copy{display:none}
  body.table-mode #topbar #tb-account{width:44px;min-width:44px;justify-content:center}
  body.table-mode #topbar #tb-account .topbar-avatar{display:grid!important}
  body.table-mode #topbar #tb-account::before{content:none}
  body.history-replay-mode #topbar #tb-account .topbar-account-copy{display:none}
}

@media(max-width:700px){
  body.table-mode #topbar{gap:4px;padding:4px 6px}
  body.table-mode #topbar .topbar-brand img{width:44px;height:34px}
  body.table-mode #topbar #tb-table-title{min-width:0;max-width:64px;font-size:15px}
  body.table-mode #topbar .topbar-menu{min-width:72px;min-height:44px;padding-inline:6px}
}
