/* KathalSquaer wide-screen utility layout + compact chat typography */
:root{ --ksq-left: 260px; --ksq-right: 320px; --ksq-side-gap: 28px; }
.chatCard, .chatMessage, .msgCard, .roomMsg, .gchatMsg, .chatInput, .chatComposer, .chatGrid, #globalChat{
  font-size: 13px;
}
.chatCard .text, .chatMessage .text, .msgText, .chatText, .gchatText{ line-height: 1.55; }
@media (max-width: 760px){
  .chatCard, .chatMessage, .msgCard, .roomMsg, .gchatMsg, .chatInput, .chatComposer, .chatGrid, #globalChat{ font-size: 12px; }
}

@media (min-width: 1180px){
  body.ksq-wide .page{
    width: min(960px, calc(100vw - var(--ksq-left) - var(--ksq-right) - 96px));
    max-width: min(960px, calc(100vw - var(--ksq-left) - var(--ksq-right) - 96px));
    margin-left: auto;
    margin-right: auto;
    position: relative;
    left: calc((var(--ksq-left) - var(--ksq-right)) / 2);
  }
}
.ksq-left-panel,.ksq-right-panel{
  position: fixed; top: 20px; bottom: 20px; z-index: 24;
  display:flex; flex-direction:column; gap:12px;
  pointer-events:none;
}
.ksq-left-panel{ left:18px; width:var(--ksq-left); }
.ksq-right-panel{ right:18px; width:var(--ksq-right); }
.ksq-side-card{
  pointer-events:auto;
  border:1px solid rgba(150,220,255,.16);
  background:linear-gradient(180deg, rgba(16,22,34,.86), rgba(9,12,18,.78));
  box-shadow:0 14px 50px rgba(0,0,0,.35);
  border-radius:18px;
  padding:12px;
  backdrop-filter: blur(10px);
  color:var(--text, #e9edf6);
}
.ksq-active{ display:flex; gap:10px; align-items:center; }
.ksq-active img{ width:48px; height:48px; border-radius:14px; object-fit:cover; border:1px solid rgba(255,255,255,.14); }
.ksq-active-name{ font-weight:900; font-size:14px; }
.ksq-active-sub{ opacity:.75; font-size:12px; margin-top:2px; }
.ksq-currencies{ display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:10px; }
.ksq-chip{ border:1px solid rgba(255,255,255,.1); background:rgba(255,255,255,.05); border-radius:12px; padding:8px; }
.ksq-chip b{ display:block; font-size:15px; }
.ksq-chip span{ display:block; opacity:.65; font-size:11px; }
.ksq-nav{ display:grid; gap:8px; }
.ksq-nav a{ color:inherit; text-decoration:none; padding:10px 12px; border-radius:12px; border:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.045); font-weight:800; font-size:13px; }
.ksq-nav a:hover{ background:rgba(120,220,255,.10); border-color:rgba(120,220,255,.22); }
.ksq-side-title{ font-weight:900; font-size:13px; margin-bottom:8px; display:flex; justify-content:space-between; gap:8px; }
.ksq-list{ display:grid; gap:7px; max-height:calc((100vh - 88px) / 2); overflow:auto; }
.ksq-list-item{ display:block; color:inherit; text-decoration:none; border:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.035); padding:8px; border-radius:12px; font-size:12px; }
.ksq-list-item strong{ display:block; font-size:12px; }
.ksq-list-item small{ display:block; opacity:.62; margin-top:3px; }
.ksq-mobile-toggle{ display:none; position:fixed; top:12px; left:12px; z-index:60; width:40px; height:40px; border-radius:14px; border:1px solid rgba(255,255,255,.16); background:rgba(12,18,28,.86); color:#fff; }
@media (max-width:1179px){
  .ksq-left-panel,.ksq-right-panel{ display:none; }
  .ksq-mobile-toggle{ display:block; }
  body.ksq-mobile-open .ksq-left-panel{ display:flex; left:12px; right:12px; top:60px; bottom:auto; width:auto; max-height:calc(100vh - 74px); overflow:auto; }
  body.ksq-mobile-open .ksq-right-panel{ display:none; }
  body.ksq-wide .page{ margin-left:auto; margin-right:auto; left:auto; width:auto; max-width:var(--pageMax, 980px); }
}

/* item/shop/admin pages */
.ksq-grid{ display:grid; grid-template-columns:1fr; gap:12px; }
.ksq-item-card{ border:1px solid var(--line, rgba(255,255,255,.12)); border-radius:16px; padding:12px; background:rgba(255,255,255,.035); display:grid; gap:8px; }
.ksq-item-card h3{ margin:0; font-size:15px; }
.ksq-item-meta{ opacity:.7; font-size:12px; }
.ksq-actions{ display:flex; gap:6px; flex-wrap:wrap; }
.ksq-tabs{ display:flex; gap:8px; flex-wrap:wrap; margin:0 0 12px; }
.ksq-tabs button{ width:auto; padding:8px 12px; }
.ksq-tabs .active{ border-color:rgba(120,220,255,.55); background:rgba(120,220,255,.12); }

.ksq-item-card{ position:relative; }
.ksq-item-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.ksq-item-title{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.ksq-item-card h3{ margin:0; }
.ksq-badges{ display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.ksq-badge{ display:inline-flex; align-items:center; gap:4px; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.055); border-radius:999px; padding:3px 8px; font-size:11px; font-weight:800; white-space:nowrap; }
.ksq-badge.is-on{ border-color:rgba(120,220,255,.42); background:rgba(120,220,255,.12); }
.ksq-badge.is-warn{ border-color:rgba(255,210,110,.36); background:rgba(255,210,110,.10); }
.ksq-badge.is-danger{ border-color:rgba(255,120,150,.32); background:rgba(255,120,150,.08); }
.ksq-item-card p{ margin:0; line-height:1.55; }
.ksq-form-grid{ display:grid; grid-template-columns: 160px 1fr 1fr 140px 120px 120px 120px 90px; gap:8px; align-items:end; }
.ksq-form-grid label{ display:grid; gap:4px; font-size:12px; }
.ksq-form-grid textarea{ min-height:42px; }
@media (max-width: 900px){ .ksq-form-grid{ grid-template-columns:1fr; } .ksq-item-head{ flex-direction:column; } .ksq-badges{ justify-content:flex-start; } }
@media (min-width:1180px){
  .ksq-left-panel,.ksq-right-panel{ height:calc(100vh - 40px); }
  .ksq-left-panel .ksq-nav{ flex:1; align-content:start; }
  .ksq-right-panel .ksq-side-card{ min-height:0; display:flex; flex-direction:column; }
  .ksq-right-panel .ksq-side-card:first-child{ flex:1 1 auto; }
  .ksq-right-panel .ksq-side-card:last-child{ flex:0 0 auto; }
  .ksq-right-panel .ksq-list{ flex:1 1 auto; max-height:none; }
}


/* 20260518c: shop/editor readability */
.ksq-price-inline{ font-size:12px; transform:translateY(-1px); }
.ksq-admin-item-form{ grid-template-columns: 160px minmax(180px,1fr) 140px 110px 110px 120px 90px; }
.ksq-admin-item-form .ksq-field-desc{ grid-column:1 / -1; }
.ksq-admin-item-form .ksq-field-desc textarea{ min-height:112px; width:100%; resize:vertical; line-height:1.55; }
@media (max-width: 900px){ .ksq-admin-item-form{ grid-template-columns:1fr; } }

/* 20260518d: item editor / activity log posting */
.ksq-editor-tools{
  display:grid;
  grid-template-columns:minmax(220px,1fr) 180px auto;
  gap:10px;
  align-items:end;
  margin:0 0 14px;
  padding:10px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  background:rgba(255,255,255,.035);
}
.ksq-editor-tools label{ display:grid; gap:4px; font-size:12px; }
.ksq-admin-item-card{ gap:12px; }
.ksq-admin-section{
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  padding:10px;
  background:rgba(0,0,0,.12);
}
.ksq-admin-section-title{ font-size:12px; font-weight:900; opacity:.8; margin-bottom:8px; }
.ksq-admin-basic-grid{ display:grid; grid-template-columns: 180px minmax(180px,1fr) 140px 110px 110px 120px 90px; gap:8px; align-items:end; }
.ksq-admin-basic-grid label,.ksq-admin-text-grid label{ display:grid; gap:4px; font-size:12px; }
.ksq-admin-text-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.ksq-admin-text-grid textarea{ min-height:150px; width:100%; resize:vertical; line-height:1.6; }
.ksq-check-field{ align-content:end; }
.ksq-log-item a{ color:inherit; text-decoration:none; display:block; }
.ksq-log-actions{ margin-top:6px; display:flex; justify-content:flex-end; }
.ksq-log-post{ padding:4px 8px; font-size:11px; }
.ksq-log-flavor{ margin-top:4px; opacity:.78; font-size:12px; line-height:1.45; white-space:pre-wrap; }
@media (max-width:900px){
  .ksq-editor-tools,.ksq-admin-basic-grid,.ksq-admin-text-grid{ grid-template-columns:1fr; }
}

/* left-panel integrated menu extras */
.ksq-character-switch .ksq-list{ max-height:220px; }
.ksq-char-btn{
  width:100%;
  display:grid;
  grid-template-columns:32px 1fr auto;
  align-items:center;
  gap:8px;
  color:inherit;
  text-align:left;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.035);
  border-radius:12px;
  padding:7px;
  cursor:pointer;
}
.ksq-char-btn:hover{ background:rgba(120,220,255,.10); border-color:rgba(120,220,255,.22); }
.ksq-char-btn.is-active{ border-color:rgba(120,220,255,.42); box-shadow:0 0 0 1px rgba(120,220,255,.14) inset; }
.ksq-char-btn img{ width:32px; height:32px; border-radius:10px; object-fit:cover; background:rgba(255,255,255,.06); }
.ksq-char-btn span{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:800; font-size:12px; }
.ksq-char-btn small{ opacity:.62; font-size:11px; white-space:nowrap; }
.ksq-session-actions{ padding:10px 12px; }
.ksq-session-actions .ksq-logout{ width:100%; }
@media (max-width:1179px){
  body.ksq-mobile-open .ksq-character-switch .ksq-list{ max-height:180px; }
}

/* 20260524b: Re:birth2 deck page width with fixed left/right panels */
@media (min-width:1180px){
  body.ksq-wide.rb2-decks .wrap{
    width:min(1280px, calc(100vw - var(--ksq-left) - var(--ksq-right) - 96px));
    max-width:min(1280px, calc(100vw - var(--ksq-left) - var(--ksq-right) - 96px));
    margin-left:auto;
    margin-right:auto;
    position:relative;
    left:calc((var(--ksq-left) - var(--ksq-right)) / 2);
  }
}

/* 20260524: compact left status panel + scrollable mobile menu */
:root{ --ksq-left: 244px; }

#ksqStatus.ksq-side-card{
  padding:10px;
  border-radius:16px;
}
#ksqStatus .ksq-active{
  gap:8px;
  min-width:0;
}
#ksqStatus .ksq-active img{
  width:38px;
  height:38px;
  border-radius:12px;
  flex:0 0 auto;
}
#ksqStatus .ksq-active > div{
  min-width:0;
}
#ksqStatus .ksq-active-name{
  font-size:13px;
  line-height:1.25;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
#ksqStatus .ksq-active-sub{
  font-size:11px;
  line-height:1.25;
}
#ksqStatus .ksq-currencies{
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:6px;
  margin-top:8px;
}
#ksqStatus .ksq-chip{
  padding:6px 7px;
  border-radius:10px;
  min-width:0;
}
#ksqStatus .ksq-chip b{
  font-size:13px;
  line-height:1.15;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
#ksqStatus .ksq-chip span{
  font-size:10px;
  line-height:1.15;
}

.ksq-left-panel{ gap:10px; }
.ksq-nav{ gap:6px; }
.ksq-nav a{ padding:8px 10px; border-radius:11px; font-size:12px; }
.ksq-character-switch .ksq-list{ max-height:180px; }
.ksq-session-actions{ padding:8px 10px; }

@media (max-width:1179px){
  body.ksq-mobile-open .ksq-left-panel{
    display:flex;
    position:fixed;
    left:10px;
    right:10px;
    top:58px;
    bottom:10px;
    width:auto;
    max-height:none;
    overflow-y:auto;
    overflow-x:hidden;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
    padding-right:2px;
    pointer-events:auto;
  }
  body.ksq-mobile-open .ksq-left-panel .ksq-side-card{
    flex:0 0 auto;
  }
  body.ksq-mobile-open #ksqStatus.ksq-side-card{
    padding:8px;
  }
  body.ksq-mobile-open #ksqStatus .ksq-active img{
    width:34px;
    height:34px;
    border-radius:10px;
  }
  body.ksq-mobile-open #ksqStatus .ksq-currencies{
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:5px;
    margin-top:7px;
  }
  body.ksq-mobile-open #ksqStatus .ksq-chip{
    padding:5px 6px;
  }
  body.ksq-mobile-open #ksqMainNav{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:6px;
    padding:8px;
  }
  body.ksq-mobile-open #ksqMainNav a{
    padding:8px 9px;
    font-size:12px;
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  body.ksq-mobile-open .ksq-character-switch .ksq-list{
    max-height:160px;
    overflow:auto;
    -webkit-overflow-scrolling:touch;
  }
  body.ksq-mobile-open .ksq-char-btn{
    grid-template-columns:28px 1fr auto;
    gap:7px;
    padding:6px;
  }
  body.ksq-mobile-open .ksq-char-btn img{
    width:28px;
    height:28px;
    border-radius:9px;
  }
  body.ksq-mobile-open .ksq-session-actions{
    padding:8px;
  }
}

@media (max-width:420px){
  body.ksq-mobile-open .ksq-left-panel{
    left:8px;
    right:8px;
    top:56px;
    bottom:8px;
  }
  body.ksq-mobile-open #ksqMainNav{
    grid-template-columns:1fr 1fr;
  }
  body.ksq-mobile-open #ksqStatus .ksq-currencies{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

/* 20260524c: AP/BP first + compact mobile chat composer */
#ksqStatus .ksq-currencies{
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:6px;
}
#ksqStatus .ksq-chip:nth-child(1),
#ksqStatus .ksq-chip:nth-child(2){
  background:rgba(120,220,255,.075);
  border-color:rgba(120,220,255,.16);
}
@media (max-width:1179px){
  body.ksq-mobile-open #ksqStatus .ksq-currencies{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:5px;
  }
}

@media (max-width:760px){
  .chatComposer,
  .chatInputBlock .chatComposer,
  body.room-chat .chatComposer{
    gap:6px !important;
    align-items:stretch !important;
  }
  .chatMessageInput,
  .chatInput,
  textarea#messageInput,
  textarea#chat-input,
  textarea[name="message"]{
    min-height:58px !important;
    font-size:12px !important;
    line-height:1.45 !important;
    padding:8px 9px !important;
  }
  .chatTargetRow,
  .chatHintRow,
  .chatComposerRow,
  .replyBar{
    gap:6px !important;
    margin-top:5px !important;
    margin-bottom:5px !important;
    padding-top:6px !important;
    padding-bottom:6px !important;
  }
  .chatHint,
  .chatCounterRow,
  .chatTargetRow .fieldLabel,
  .replyBarLabel,
  .replyBarText{
    font-size:11px !important;
  }
  .chatFmtBtns,
  .chatButtons,
  .chatTopBtns,
  .msgActions{
    gap:5px !important;
  }
  .chatFmtBtns button,
  .chatButtons button,
  .chatTopBtns button,
  .chatTopBtns a,
  .chatSendWrap button,
  .msgActBtn,
  button#btnSend,
  button#btnPreview,
  button#btnIcons,
  button#sendBtn,
  button#previewBtn,
  button#iconBtn{
    min-height:28px !important;
    height:auto !important;
    padding:5px 8px !important;
    border-radius:9px !important;
    font-size:11px !important;
    line-height:1.2 !important;
  }
  .chatTargetRow label,
  .chatComposer label,
  .chatInputBlock label,
  body.room-chat label:has(input[type="checkbox"]){
    font-size:11px !important;
    line-height:1.25 !important;
  }
  input[type="checkbox"]{
    width:14px !important;
    height:14px !important;
  }
  .gchatIconPicker,
  body.room-chat .gchatIconPicker{
    margin-top:6px !important;
    padding:7px !important;
  }
  .gchatIconGrid,
  body.room-chat .gchatIconGrid{
    grid-template-columns:repeat(auto-fill, minmax(34px, 1fr)) !important;
    gap:6px !important;
  }
  .gchatIconItem,
  body.room-chat .gchatIconItem{
    width:34px !important;
    height:34px !important;
    border-radius:9px !important;
  }
}


/* 20260524d: activity log list page + favorite room height adjustment */
@media (min-width:1180px){
  body.ksq-wide.ksq-logs-page .page{
    width:min(1040px, calc(100vw - var(--ksq-left) - var(--ksq-right) - 96px));
    max-width:min(1040px, calc(100vw - var(--ksq-left) - var(--ksq-right) - 96px));
  }
  .ksq-right-panel .ksq-side-card:first-child{ flex:1 1 0; }
  .ksq-right-panel .ksq-side-card:last-child{
    flex:0 0 40%;
    min-height:220px;
  }
}
.ksq-side-actions{ display:inline-flex; gap:6px; align-items:center; }
.ksq-side-actions .btn{ text-decoration:none; color:inherit; }
.ksq-log-page-list{ display:grid; gap:10px; }
.ksq-log-page-card{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.035);
  border-radius:14px;
  padding:12px;
  display:grid;
  gap:8px;
}
.ksq-log-page-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.ksq-log-page-title{ font-weight:900; font-size:14px; line-height:1.35; }
.ksq-log-page-meta{ opacity:.68; font-size:11px; line-height:1.35; }
.ksq-log-page-flavor{ opacity:.82; font-size:12px; line-height:1.55; white-space:pre-wrap; }
.ksq-log-page-actions{ display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.ksq-log-page-empty{ border:1px dashed rgba(255,255,255,.16); border-radius:14px; padding:16px; opacity:.78; }
@media (max-width:760px){
  .ksq-log-page-head{ flex-direction:column; }
  .ksq-log-page-actions{ justify-content:flex-start; }
}


/* 20260524e: fixed-height scrollable left navigation */
.ksq-left-panel{ min-height:0; }
#ksqMainNav{
  flex:0 1 auto;
  max-height:min(48vh, 430px);
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  padding-right:8px;
  scrollbar-gutter:stable;
}
#ksqMainNav a{ flex:0 0 auto; }
@media (min-width:1180px){
  .ksq-left-panel .ksq-nav{
    flex:0 1 auto;
    align-content:start;
  }
  .ksq-character-switch{ flex:0 0 auto; }
  .ksq-session-actions{ flex:0 0 auto; }
}
@media (max-height:760px) and (min-width:1180px){
  #ksqMainNav{ max-height:38vh; }
  .ksq-nav a{ padding-top:7px; padding-bottom:7px; }
  #ksqStatus.ksq-side-card{ padding:8px; }
  #ksqStatus .ksq-currencies{ gap:5px; margin-top:6px; }
  #ksqStatus .ksq-chip{ padding:5px 6px; }
}
@media (max-width:1179px){
  body.ksq-mobile-open #ksqMainNav{
    max-height:42vh;
    overflow-y:auto;
    overflow-x:hidden;
    -webkit-overflow-scrolling:touch;
    scrollbar-gutter:stable;
  }
}
@media (max-height:680px) and (max-width:1179px){
  body.ksq-mobile-open #ksqMainNav{ max-height:34vh; }
}

/* 20260524f: mobile sidebar menu anti-squash */
@media (max-width:1179px){
  body.ksq-mobile-open{
    overflow:hidden;
  }
  body.ksq-mobile-open .ksq-left-panel{
    display:flex;
    flex-direction:column;
    gap:8px;
    left:8px;
    right:8px;
    top:54px;
    bottom:8px;
    width:auto;
    height:auto;
    max-height:none;
    min-height:0;
    overflow-y:auto;
    overflow-x:hidden;
    padding:0 4px 10px 0;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
  }
  body.ksq-mobile-open .ksq-left-panel .ksq-side-card{
    flex:0 0 auto;
    min-height:auto;
  }
  body.ksq-mobile-open #ksqStatus.ksq-side-card{
    padding:7px;
  }
  body.ksq-mobile-open #ksqStatus .ksq-active{
    gap:7px;
  }
  body.ksq-mobile-open #ksqStatus .ksq-active img{
    width:32px;
    height:32px;
    border-radius:9px;
  }
  body.ksq-mobile-open #ksqStatus .ksq-active-name{
    font-size:12px;
  }
  body.ksq-mobile-open #ksqStatus .ksq-active-sub{
    font-size:10px;
  }
  body.ksq-mobile-open #ksqStatus .ksq-currencies{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:5px;
    margin-top:6px;
  }
  body.ksq-mobile-open #ksqStatus .ksq-chip{
    padding:5px 6px;
    min-height:32px;
  }
  body.ksq-mobile-open #ksqMainNav{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:6px;
    max-height:none;
    overflow:visible;
    padding:8px;
    scrollbar-gutter:auto;
  }
  body.ksq-mobile-open #ksqMainNav a{
    display:flex;
    align-items:center;
    min-height:36px;
    padding:8px 9px;
    font-size:12px;
    line-height:1.2;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  body.ksq-mobile-open .ksq-character-switch .ksq-list{
    max-height:150px;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
  }
  body.ksq-mobile-open .ksq-session-actions{
    padding:7px;
  }
}
@media (max-width:420px){
  body.ksq-mobile-open #ksqMainNav{
    grid-template-columns:1fr;
  }
  body.ksq-mobile-open #ksqMainNav a{
    min-height:34px;
  }
}
@media (max-height:680px) and (max-width:1179px){
  body.ksq-mobile-open #ksqMainNav{
    max-height:none;
  }
  body.ksq-mobile-open .ksq-character-switch .ksq-list{
    max-height:120px;
  }
}


/* 20260524g: mobile quick buttons for right-side panels */
.ksq-mobile-tools{
  display:none;
  position:fixed;
  top:12px;
  left:60px;
  z-index:60;
  gap:6px;
}
.ksq-mobile-tool{
  min-height:40px;
  padding:0 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(12,18,28,.86);
  color:#eaf7ff;
  font-weight:800;
  font-size:12px;
  letter-spacing:.02em;
  box-shadow:0 8px 24px rgba(0,0,0,.28);
}
.ksq-mobile-tool:active,
body.ksq-mobile-right-activity .ksq-mobile-tool[data-ksq-right="activity"],
body.ksq-mobile-right-fav .ksq-mobile-tool[data-ksq-right="fav"]{
  border-color:rgba(80,210,255,.45);
  background:linear-gradient(180deg, rgba(22,50,65,.94), rgba(12,18,28,.92));
  color:#fff;
}
@media (max-width: 980px){
  .ksq-mobile-tools{ display:flex; }
  body.ksq-mobile-right-open .ksq-left-panel{ display:none; }
  body.ksq-mobile-right-open .ksq-right-panel{
    display:flex;
    position:fixed;
    left:12px;
    right:12px;
    top:60px;
    bottom:12px;
    width:auto;
    max-height:calc(100vh - 72px);
    z-index:55;
    overflow:auto;
    padding:10px;
    border-radius:18px;
    background:rgba(7,12,20,.96);
    border:1px solid rgba(72,190,230,.22);
    box-shadow:0 16px 40px rgba(0,0,0,.42);
  }
  body.ksq-mobile-right-open .ksq-right-panel .ksq-side-card{
    min-height:0;
    flex:1 1 auto;
    overflow:auto;
  }
  body.ksq-mobile-right-activity .ksq-right-panel [data-ksq-right-panel="fav"],
  body.ksq-mobile-right-fav .ksq-right-panel [data-ksq-right-panel="activity"]{
    display:none;
  }
  body.ksq-mobile-right-open .ksq-right-panel .ksq-list{
    max-height:none;
    overflow:auto;
  }
}
@media (max-width: 420px){
  .ksq-mobile-tools{ left:56px; gap:5px; }
  .ksq-mobile-tool{ padding:0 9px; min-height:38px; font-size:11px; border-radius:12px; }
}


/* 20260611b: grouped integrated navigation */
.ksq-nav{gap:12px}
.ksq-nav-group{display:grid;gap:7px}
.ksq-nav-group-title{font-size:11px;font-weight:900;letter-spacing:.12em;text-transform:uppercase;opacity:.68;padding:0 4px}
.ksq-nav-group-links{display:grid;gap:7px}
.ksq-nav a.ksq-nav-link{display:block}
.ksq-nav a.ksq-nav-link.is-current{
  border-color:rgba(120,220,255,.45);
  background:linear-gradient(180deg, rgba(120,220,255,.16), rgba(120,220,255,.06));
  box-shadow:0 0 0 1px rgba(120,220,255,.12) inset, 0 0 18px rgba(120,220,255,.08);
}
.ksq-nav-group.is-current-group .ksq-nav-group-title{color:rgba(180,235,255,.94);opacity:.96}


/* 20260705: Re:Birth pages share the home side menu without visual overlap */
@media (min-width:1180px){
  body.ksq-wide.rb2-lobby .wrap,
  body.ksq-wide.rb2-logs .wrap,
  body.ksq-wide.rb2-scenario .wrap{
    width:min(1280px, calc(100vw - var(--ksq-left) - var(--ksq-right) - 96px));
    max-width:min(1280px, calc(100vw - var(--ksq-left) - var(--ksq-right) - 96px));
    margin-left:auto;
    margin-right:auto;
    position:relative;
    left:calc((var(--ksq-left) - var(--ksq-right)) / 2);
  }
  body.ksq-wide.rb2-play .rb2-wrap{
    width:min(1280px, calc(100vw - var(--ksq-left) - var(--ksq-right) - 96px));
    max-width:min(1280px, calc(100vw - var(--ksq-left) - var(--ksq-right) - 96px));
    margin-left:auto;
    margin-right:auto;
    position:relative;
    left:calc((var(--ksq-left) - var(--ksq-right)) / 2);
    padding-left:12px;
    padding-right:12px;
  }
}

@media (min-width:1180px){
  body.ksq-wide.rb2-rulebook .rb2rb-wrap{
    width:min(1120px, calc(100vw - var(--ksq-left) - var(--ksq-right) - 96px));
    max-width:min(1120px, calc(100vw - var(--ksq-left) - var(--ksq-right) - 96px));
    margin-left:auto;
    margin-right:auto;
    position:relative;
    left:calc((var(--ksq-left) - var(--ksq-right)) / 2);
  }
}


/* 20260705b: constrain Re:Birth participant icons in activity/log lists */
.ksq-log-icon-line{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  margin-top:6px;
  min-width:0;
  font-size:11px;
  line-height:1.35;
  opacity:.95;
}
.ksq-log-icon-line > span:first-child{
  flex:0 0 auto;
  opacity:.78;
  font-weight:800;
}
.ksq-log-actor-icons{
  display:inline-flex;
  align-items:center;
  gap:4px;
  flex-wrap:wrap;
  min-width:0;
  max-width:100%;
  vertical-align:middle;
}
.ksq-log-actor-icon{
  display:inline-block !important;
  width:30px !important;
  height:30px !important;
  min-width:30px !important;
  min-height:30px !important;
  max-width:30px !important;
  max-height:30px !important;
  aspect-ratio:1 / 1;
  object-fit:cover !important;
  border-radius:50%;
  border:1px solid rgba(255,255,255,.24);
  background:rgba(255,255,255,.08);
  box-shadow:0 0 0 1px rgba(0,0,0,.22) inset;
  overflow:hidden;
  flex:0 0 auto;
}
.ksq-log-actor-icons-small .ksq-log-actor-icon,
.ksq-right-panel .ksq-log-actor-icon{
  width:24px !important;
  height:24px !important;
  min-width:24px !important;
  min-height:24px !important;
  max-width:24px !important;
  max-height:24px !important;
}
.ksq-log-actor-icon-blank{
  background:linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
}
.ksq-log-icon-empty{
  opacity:.6;
  font-size:11px;
}
.ksq-log-page-card .ksq-log-icon-line{
  margin-top:8px;
}
.ksq-log-page-card .ksq-log-actor-icon{
  width:32px !important;
  height:32px !important;
  min-width:32px !important;
  min-height:32px !important;
  max-width:32px !important;
  max-height:32px !important;
}
