.main-panel {
  container-type: inline-size;
}

.board-toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  min-height: 58px;
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(248, 249, 251, 0.93);
  backdrop-filter: blur(10px);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-left: 0;
}

.card-size-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 40px;
  padding: 3px;
  border: 1px solid #c9d3e2;
  border-radius: 8px;
  background: #ffffff;
}

.theme-control { display:inline-flex; min-height:40px; align-items:center; gap:7px; color:#475467; font-size:.76rem; font-weight:800; white-space:nowrap; }
.theme-control select { min-height:38px; padding:0 30px 0 10px; border:1px solid #c9d3e2; border-radius:7px; color:#344054; background:#fff; font-size:.78rem; font-weight:700; }
.board-toolbar { background:var(--panel-soft); }

.card-size-label {
  padding: 0 6px;
  color: #667085;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.card-size-button {
  min-width: 36px;
  min-height: 32px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  color: #475467;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.card-size-button:hover,
.card-size-button:focus,
.card-size-button.is-active {
  color: var(--primary-dark);
  background: #eef4ff;
  outline: none;
}

.view-switch {
  display: flex;
  gap: 6px;
  margin-right: auto;
  margin-left: 0;
}

.tool-button,
.tool-button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #c9d3e2;
  border-radius: 8px;
  color: #344054;
  background: #ffffff;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.tool-button:hover,
.tool-button:focus,
.tool-button.is-active {
  border-color: #9eb4ef;
  color: var(--primary-dark);
  background: #eef4ff;
  outline: none;
}

.tool-button-primary {
  border-color: rgba(0, 103, 192, 0.55);
  color: #005bab;
  background: rgba(0, 103, 192, 0.12);
}

@container (max-width: 960px) {
  .board-toolbar {
    min-height: 52px;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .view-switch {
    flex: 0 0 auto;
    gap: 4px;
    margin-right: 0;
  }

  .toolbar-actions {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    width: auto;
    min-width: 0;
    gap: 4px;
    margin-left: 0;
  }

  .tool-button {
    flex: 0 0 38px;
    width: 38px;
    min-width: 38px;
    padding: 0;
  }

  .tool-button span,
  .card-size-label {
    display: none;
  }

  .card-size-switch {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
  }

  .card-size-button {
    flex: 0 0 auto;
    min-width: 36px;
    padding-inline: 4px;
  }

  .theme-control { flex:0 0 108px; }
  .theme-control > span { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
  .theme-control select { width:108px; padding-inline:7px; }
}
