/* Labels sit above a shared control row; every action ends at the same edge. */
.topbar{height:auto;min-height:88px}
.topbar .top-actions{align-items:flex-end;min-width:0;row-gap:12px;flex-wrap:nowrap}
.topbar .top-actions>.context-filter{flex:0 1 250px;min-width:150px}
.topbar .context-filter{gap:5px}
.topbar .context-filter>span{line-height:1.25}
.topbar .context-filter select{box-sizing:border-box;height:44px;min-height:44px;margin:0;padding:10px 12px;border-radius:9px;font-size:12px}
.topbar .club-filter{width:100%;max-width:100%}
.topbar .period-controls{align-items:flex-end;flex:0 0 auto}
.topbar .period-controls>.icon-btn,.topbar .top-profile-button,.topbar .niwus-launcher{box-sizing:border-box;height:44px;min-height:44px;margin:0;align-self:flex-end;display:inline-flex;align-items:center;justify-content:center}
.topbar .period-controls>.icon-btn{width:32px;min-width:32px}
.topbar .top-profile-button{padding:10px 14px}
.topbar .niwus-launcher{padding:0 10px 0 2px}
.topbar .niwus-launcher .niwus-portrait{width:44px;height:44px;margin:0}
.topbar .niwus-launcher-text{padding:10px 13px}

/* Grow a draft up to a bounded height; long prompts keep their own scrollbar. */
.niwus-chat textarea,.niwus-dock .niwus-chat textarea{box-sizing:border-box;min-height:132px;max-height:320px;resize:vertical;overflow-y:auto;line-height:1.6}
.niwus-dock .niwus-chat textarea{max-height:260px}
.niwus-chat-actions{margin-top:10px}
@media(max-width:1280px){
  .topbar{padding-top:12px;padding-bottom:12px}
  .topbar .breadcrumb{display:none}
  .topbar .top-actions{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:10px 8px;flex:1}
  .topbar .top-actions>.context-filter{min-width:0;grid-column:1;grid-row:1}
  .topbar .niwus-launcher{grid-column:2;grid-row:1}
  .topbar .top-profile-button{grid-column:3;grid-row:1}
  .topbar .period-controls{grid-column:1/-1;grid-row:2;width:100%;min-width:0;justify-content:flex-end}
}
@media(max-width:560px){
  .topbar .top-actions{grid-template-columns:minmax(0,1fr) auto 44px}
  .topbar .top-profile-button{grid-column:3;padding:10px;width:44px}
  .topbar .top-profile-button .profile-button-label{display:none}
  .topbar .niwus-launcher{grid-column:2;padding-right:8px;gap:2px;font-size:11px}
  .topbar .niwus-launcher-text{padding:10px}
  .topbar .period-controls{grid-column:1/-1;width:100%;min-width:0;gap:6px}
  .topbar .period-controls .context-filter:first-of-type{flex:1;min-width:0}
  .topbar .period-controls select{min-width:0;width:100%;padding-right:7px}
  .topbar .period-controls #year-filter{min-width:76px;width:76px}
  .topbar .context-filter select{font-size:11px;padding-left:9px}
  .niwus-chat textarea,.niwus-dock .niwus-chat textarea{min-height:116px}
}

/* Mobile: let the club use the whole row and scroll the taller header away.
   The optional value overlay wraps long names while keeping the native select. */
.topbar .club-filter-value{display:none}
@media(max-width:720px){
  .topbar{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:end;gap:6px 8px;position:static;min-height:0;padding:10px 12px!important}
  .topbar>.mobile-menu{grid-column:1;grid-row:1;width:44px;min-width:44px;height:44px;margin:0;align-self:center}
  .topbar .top-actions{display:contents}
  .topbar .top-actions>.context-filter{grid-column:1/-1;grid-row:2;min-width:0;width:100%}
  .topbar .context-filter{gap:4px}
  .topbar .context-filter>span{font-size:11px;line-height:1.2}
  .topbar .context-filter select{font-size:14px;min-height:44px}
  .topbar .niwus-launcher{grid-column:2;grid-row:1;justify-self:start;min-width:0;max-width:100%;gap:4px;padding:0 10px 0 0;font-size:14px}
  .topbar .niwus-launcher-text{padding:10px 12px}
  .topbar .niwus-launcher>span{min-width:0;overflow:hidden;text-overflow:ellipsis}
  .topbar .top-profile-button{grid-column:3;grid-row:1;width:44px;padding:10px}
  .topbar .top-profile-button .profile-button-label{display:none}
  .topbar .period-controls{grid-column:1/-1;grid-row:3;display:grid;grid-template-columns:44px minmax(0,1fr) minmax(72px,.6fr) 44px;gap:6px;min-width:0;width:100%;align-items:end}
  .topbar .period-controls>.icon-btn{width:44px;min-width:44px;height:44px}
  .topbar .period-controls .context-filter{min-width:0}
  .topbar .period-controls select{min-width:0;width:100%;padding:8px 6px;font-size:14px}
  .topbar .period-controls #year-filter{min-width:0;width:100%}
  .topbar .top-actions>.context-filter:has(>.club-filter-value){display:grid;grid-template-columns:minmax(0,1fr)}
  .topbar .top-actions>.context-filter:has(>.club-filter-value)>.club-filter{grid-column:1;grid-row:2;appearance:none;height:100%;color:transparent}
  .topbar .top-actions>.context-filter:has(>.club-filter-value)>.club-filter option{color:var(--ink)}
  .topbar .top-actions>.context-filter:has(>.club-filter-value)>.club-filter-value{display:block;grid-column:1;grid-row:2;align-self:center;min-width:0;padding:8px 32px 8px 12px;pointer-events:none;overflow-wrap:anywhere;color:var(--ink);font-size:14px;font-weight:500;line-height:1.35}
  .topbar .top-actions>.context-filter:has(>.club-filter-value)::after{content:"";grid-column:1;grid-row:2;align-self:center;justify-self:end;width:6px;height:6px;margin-right:15px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(45deg);pointer-events:none}
  .topbar .top-actions>.context-filter:has(>.club-filter:disabled)>.club-filter-value{color:var(--muted)}
}
